diff --git a/2020/.prettierrc.cjs b/.prettierrc.cjs similarity index 100% rename from 2020/.prettierrc.cjs rename to .prettierrc.cjs diff --git a/2020/Gauge/src/components/controls/controls.tsx b/2020/Gauge/src/components/controls/controls.tsx deleted file mode 100644 index ec8e381..0000000 --- a/2020/Gauge/src/components/controls/controls.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { - ComponentProps, - ComputedSubject, - DisplayComponent, - FSComponent, - NodeReference, - Subscribable, - VNode, -} from '@microsoft/msfs-sdk'; - -import './controls.scss'; - -interface ControlsProps extends ComponentProps { - containerRef: NodeReference; - reload: () => void; - position: Subscribable; - page: number; -} - -export class Controls extends DisplayComponent { - private cycleRef = FSComponent.createRef(); - private toTopRef = FSComponent.createRef(); - private reloadRef = FSComponent.createRef(); - private switchPosRef = FSComponent.createRef(); - private buttonName = ComputedSubject.create(0, (val) => { - if (val === 1) return '/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png'; - else if (val === 2) return '/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png'; - return ''; - }); - - constructor(props: ControlsProps) { - super(props); - - props.position.sub((p) => this.buttonName.set(p)); - } - - private cycle = (): void => { - if (this.props.page === 0) SimVar.SetSimVarValue('L:KH_FE_FPLAN_P1', 'bool', true); - else if (this.props.page === 1) SimVar.SetSimVarValue('L:KH_FE_FPLAN_P1', 'bool', false); - }; - - private toTop = (): void => { - if (!this.props.containerRef.instance) return; - - this.props.containerRef.instance.scrollTop = 0; - }; - - private switchPosition = (): void => { - if (this.props.position.get() === 1) SimVar.SetSimVarValue('L:KH_FE_FPLAN_BOARD', 'number', 2); - else if (this.props.position.get() === 2) SimVar.SetSimVarValue('L:KH_FE_FPLAN_BOARD', 'number', 1); - }; - - public render = (): VNode => ( -
- {this.props.page === 1 && ( -
- -
- )} -
- -
-
- -
-
- -
- {this.props.page === 0 && ( -
- -
- )} -
- ); - - public onAfterRender = (): void => { - this.cycleRef.instance.onclick = this.cycle; - this.toTopRef.instance.onclick = this.toTop; - this.reloadRef.instance.onclick = this.props.reload; - this.switchPosRef.instance.onclick = this.switchPosition; - }; -} diff --git a/2020/Gauge/src/components/ofp/ofp.tsx b/2020/Gauge/src/components/ofp/ofp.tsx deleted file mode 100644 index b51e032..0000000 --- a/2020/Gauge/src/components/ofp/ofp.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { ComponentProps, DisplayComponent, FSComponent, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Controls } from '../controls/controls'; - -interface OFPProps extends ComponentProps { - content: Subscribable; - reload: () => void; - position: Subscribable; -} - -export class OFP extends DisplayComponent { - private containerRef = FSComponent.createRef(); - private ofpRef = FSComponent.createRef(); - - constructor(props: OFPProps) { - super(props); - } - - private defineDragScroll = (horizontalScroll = true, verticalScroll = true): void => { - if (!this.containerRef.instance) return; - - let pos = { top: 0, left: 0, x: 0, y: 0 }; - - const mouseDownHandler = (e: MouseEvent) => { - pos = { - left: this.containerRef.instance.scrollLeft, - top: this.containerRef.instance.scrollTop, - x: e.clientX, - y: e.clientY, - }; - document.addEventListener('mousemove', mouseMoveHandler); - document.addEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - const mouseMoveHandler = (e: MouseEvent) => { - const dx = e.clientX - pos.x; - const dy = e.clientY - pos.y; - - if (verticalScroll) { - this.containerRef.instance.scrollTop = pos.top - dy; - } - if (horizontalScroll) { - this.containerRef.instance.scrollLeft = pos.left - dx; - } - }; - - const mouseUpHandler = (e: MouseEvent) => { - document.removeEventListener('mousemove', mouseMoveHandler); - document.removeEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - this.containerRef.instance.addEventListener('mousedown', mouseDownHandler); - }; - - public render = (): VNode => ( - <> -
-
-
- - - ); - - public onAfterRender = (): void => { - this.defineDragScroll(); - - this.props.content.sub((content) => { - this.ofpRef.instance.innerHTML = content; - }); - }; -} diff --git a/2020/Gauge/src/components/tlr/tlr.tsx b/2020/Gauge/src/components/tlr/tlr.tsx deleted file mode 100644 index 9f210da..0000000 --- a/2020/Gauge/src/components/tlr/tlr.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { ComponentProps, DisplayComponent, FSComponent, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Controls } from '../controls/controls'; - -interface TLRProps extends ComponentProps { - content: Subscribable; - reload: () => void; - position: Subscribable; -} - -export class TLR extends DisplayComponent { - private containerRef = FSComponent.createRef(); - - constructor(props: TLRProps) { - super(props); - } - - private defineDragScroll = (horizontalScroll = true, verticalScroll = true): void => { - if (!this.containerRef.instance) return; - - let pos = { top: 0, left: 0, x: 0, y: 0 }; - - const mouseDownHandler = (e: MouseEvent) => { - pos = { - left: this.containerRef.instance.scrollLeft, - top: this.containerRef.instance.scrollTop, - x: e.clientX, - y: e.clientY, - }; - document.addEventListener('mousemove', mouseMoveHandler); - document.addEventListener('mouseup', mouseUpHandler); - document.addEventListener('mouseleave', mouseUpHandler); - }; - - const mouseMoveHandler = (e: MouseEvent) => { - const dx = e.clientX - pos.x; - const dy = e.clientY - pos.y; - - if (verticalScroll) { - this.containerRef.instance.scrollTop = pos.top - dy; - } - if (horizontalScroll) { - this.containerRef.instance.scrollLeft = pos.left - dx; - } - }; - - const mouseUpHandler = (e: MouseEvent) => { - document.removeEventListener('mousemove', mouseMoveHandler); - document.removeEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - this.containerRef.instance.addEventListener('mousedown', mouseDownHandler); - }; - - public render = (): VNode => ( - <> -
-
-
-
{this.props.content}
-
-
-
- - - ); - - public onAfterRender = (): void => { - this.defineDragScroll(); - }; -} diff --git a/2020/Gauge/src/index.tsx b/2020/Gauge/src/index.tsx deleted file mode 100644 index 2362269..0000000 --- a/2020/Gauge/src/index.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/// -/// - -import { EventBus, FSComponent, SimVarPublisher, SimVarValueType, Subject } from '@microsoft/msfs-sdk'; -import { OFP } from './components/ofp/ofp'; -import { TLR } from './components/tlr/tlr'; - -import './index.scss'; - -export interface NewDataEvents { - newData: boolean; - position: number; -} - -class KH_FE_FPLAN extends BaseInstrument { - private readonly bus = new EventBus(); - private readonly newDataPublisher = new SimVarPublisher( - new Map([ - ['newData', { name: 'L:KH_FE_FPLAN_NEW_DATA', type: SimVarValueType.Bool }], - ['position', { name: 'L:KH_FE_FPLAN_BOARD', type: SimVarValueType.Number }], - ]), - this.bus - ); - private contentOFP = Subject.create(''); - private contentTLR = Subject.create(''); - private position = Subject.create(0); - - private sbID = ''; - - get templateID(): string { - return 'kh-fe-fplan'; - } - - get isInteractive() { - return true; - } - - constructor() { - super(); - - const config = GetStoredData('FSS_B727_EFB_CONFIG_PREFLIGHT'); - try { - this.sbID = JSON.parse(config).simBriefId; - } catch (e) { - console.error('Failed loading config.', e); - } - } - - private getSB = async (): Promise => { - try { - const res = await fetch(`https://www.simbrief.com/api/xml.fetcher.php?username=${this.sbID}&json=1`); - if (res.ok) { - try { - const data = await res.json(); - - let ofp: string = data.text.plan_html; - ofp = ofp.replace(/href=".*?"/g, ''); - - this.contentOFP.set(ofp); - this.contentTLR.set(data.text.tlr_section); - } catch (e) { - console.error('JSON DECODE ERR', e); - } - } - } catch (e) { - console.error('FETCH ERR', e); - } - }; - - private reloadSB = (): void => { - SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 1); - }; - - protected Update(): void { - super.Update(); - - this.newDataPublisher.onUpdate(); - } - - public connectedCallback(): void { - super.connectedCallback(); - - this.newDataPublisher.startPublish(); - const sub = this.bus.getSubscriber(); - sub.on('newData').handle((flag) => { - if (!flag) return; - SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 0); - this.getSB(); - }); - sub.on('position').handle((position) => { - this.position.set(position); - }); - - const url = new URL(this.getAttribute('Url') ?? ''); - const type = url.searchParams.get('type'); - - FSComponent.render( - <> - {type === 'ofp' && } - {type === 'tlr' && } - , - document.getElementById('root') - ); - } -} - -registerInstrument('kh-fe-fplan', KH_FE_FPLAN); diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf deleted file mode 100644 index bb988e8..0000000 Binary files a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf and /dev/null differ diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png deleted file mode 100644 index 600e82a..0000000 Binary files a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png and /dev/null differ diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png deleted file mode 100644 index 5784ffa..0000000 Binary files a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png and /dev/null differ diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css deleted file mode 100644 index ef664e2..0000000 --- a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css +++ /dev/null @@ -1 +0,0 @@ -#KH_CTRL{align-items:center;display:flex;height:80px;justify-content:space-around}#KH_CTRL .button{border:1px solid #000;border-radius:5px;padding-left:7px;padding-right:7px}#KH_CTRL .button .icon{margin-top:6px;width:30px}#KH_CTRL .button:hover:not([disabled]){background-color:var(--buttonHoverColor)}#KH_CTRL .button.d180{transform:rotate(180deg)}#KH_CTRL .button.d90{transform:rotate(90deg)}@font-face{font-family:Consolas;font-style:normal;font-weight:100;src:url(assets/fonts/Consolas.ttf) format("truetype")}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:#d3d3d3}::-webkit-scrollbar-thumb{background:gray;height:200px}::-webkit-scrollbar-thumb:hover{background:#a9a9a9}#root{--buttonHoverColor:#d3d3d3;--fss-select-hover:#d3d3d3;background-image:url(../EFB/Images/bg.png);background-size:100% 100%;color:#000;font-size:25px;height:100%;padding:3vw;width:594px}#root #KH_FE_FPLAN{height:calc(100vh - 6vw - 180px);margin-bottom:3vw;margin-top:100px;overflow-x:hidden;overflow-y:scroll;width:100%}#root #KH_FE_FPLAN #OFP div,#root #KH_FE_FPLAN #TLR div{font-size:unset!important;line-height:unset!important}#root #KH_FE_FPLAN #OFP pre,#root #KH_FE_FPLAN #TLR pre{font-family:Consolas!important;font-size:13px;line-height:14px;white-space:pre}#root #KH_FE_FPLAN #OFP img{width:100%}#root #KH_FE_FPLAN.p2{height:calc(100vh - 6vw - 240px);margin-top:160px} \ No newline at end of file diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html deleted file mode 100644 index 58665b4..0000000 --- a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js b/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js deleted file mode 100644 index 8059d1a..0000000 --- a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js +++ /dev/null @@ -1 +0,0 @@ -class t{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,s){this.handler=t,this.initialNotifyFunc=e,this.onDestroy=s,this._isAlive=!0,this._isPaused=!1,this.canInitialNotify=void 0!==e}initialNotify(){if(!this._isAlive)throw new Error("HandlerSubscription: cannot notify a dead Subscription.");this.initialNotifyFunc&&this.initialNotifyFunc(this)}pause(){if(!this._isAlive)throw new Error("Subscription: cannot pause a dead Subscription.");return this._isPaused=!0,this}resume(t=!1){if(!this._isAlive)throw new Error("Subscription: cannot resume a dead Subscription.");return this._isPaused?(this._isPaused=!1,t&&this.initialNotify(),this):this}destroy(){this._isAlive&&(this._isAlive=!1,this.onDestroy&&this.onDestroy(this))}}class e{constructor(t,e={},s){this.subscribe=t,this.state=e,this.currentHandler=s,this.isConsumer=!0,this.activeSubs=new Map}handle(t,e=!1){let i;i=void 0!==this.currentHandler?e=>{this.currentHandler(e,this.state,t)}:t;let n=this.activeSubs.get(t);n||(n=[],this.activeSubs.set(t,n));const r=new s(this.subscribe(i,e),(e=>{const s=this.activeSubs.get(t);s&&(s.splice(s.indexOf(e),1),0===s.length&&this.activeSubs.delete(t))}));return r.isAlive?n.push(r):0===n.length&&this.activeSubs.delete(t),r}off(t){var e;const s=this.activeSubs.get(t);s&&(null===(e=s.shift())||void 0===e||e.destroy(),0===s.length&&this.activeSubs.delete(t))}atFrequency(t,s=!0){const i={previousTime:Date.now(),firstRun:s};return new e(this.subscribe,i,this.getAtFrequencyHandler(t))}getAtFrequencyHandler(t){const e=1e3/t;return(t,s,i)=>{const n=Date.now(),r=n-s.previousTime;if(e<=r||s.firstRun){for(;s.previousTime+e{const n=e,r=Math.pow(10,t),a=Math.round(n*r)/r;s.hasLastValue&&a===s.lastValue||(s.hasLastValue=!0,s.lastValue=a,this.with(a,i))}}whenChangedBy(t){return new e(this.subscribe,{lastValue:0,hasLastValue:!1},this.getWhenChangedByHandler(t))}getWhenChangedByHandler(t){return(e,s,i)=>{const n=e,r=Math.abs(n-s.lastValue);(!s.hasLastValue||r>=t)&&(s.hasLastValue=!0,s.lastValue=n,this.with(e,i))}}whenChanged(){return new e(this.subscribe,{lastValue:"",hasLastValue:!1},this.getWhenChangedHandler())}getWhenChangedHandler(){return(t,e,s)=>{e.hasLastValue&&e.lastValue===t||(e.hasLastValue=!0,e.lastValue=t,this.with(t,s))}}onlyAfter(t){return new e(this.subscribe,{previousTime:Date.now()},this.getOnlyAfterHandler(t))}getOnlyAfterHandler(t){return(e,s,i)=>{Date.now()-s.previousTime>t&&(s.previousTime+=t,this.with(e,i))}}with(t,e){void 0!==this.currentHandler?this.currentHandler(t,this.state,e):e(t)}}class s{get isAlive(){return this.sub.isAlive}get isPaused(){return this.sub.isPaused}get canInitialNotify(){return this.sub.canInitialNotify}constructor(t,e){this.sub=t,this.onDestroy=e}pause(){return this.sub.pause(),this}resume(t=!1){return this.sub.resume(t),this}destroy(){this.sub.destroy(),this.onDestroy(this)}}class i{constructor(t){this.bus=t}on(t){return new e(((e,s)=>this.bus.on(t,e,s)))}}class n{constructor(t=!1,e=!0){this._topicSubsMap=new Map,this._wildcardSubs=new Array,this._notifyDepthMap=new Map,this._wildcardNotifyDepth=0,this._eventCache=new Map,this.onWildcardSubDestroyedFunc=this.onWildcardSubDestroyed.bind(this),this._busId=Math.floor(2147483647*Math.random());const s="undefined"==typeof RegisterGenericDataListener?o:c;this._busSync=new s(this.pub.bind(this),this._busId),!0===e&&(this.syncEvent("event_bus","resync_request",!1),this.on("event_bus",(t=>{"resync_request"==t&&this.resyncEvents()})))}on(e,s,i=!1){let n=this._topicSubsMap.get(e);void 0===n&&(this._topicSubsMap.set(e,n=[]),this.pub("event_bus_topic_first_sub",e,!1,!1));const r=new t(s,(t=>{const s=this._eventCache.get(e);void 0!==s&&t.handler(s.data)}),(t=>{var s;if(0===(null!==(s=this._notifyDepthMap.get(e))&&void 0!==s?s:0)){const s=this._topicSubsMap.get(e);s&&s.splice(s.indexOf(t),1)}}));return n.push(r),i?r.pause():r.initialNotify(),r}off(t,e){const s=this._topicSubsMap.get(t),i=null==s?void 0:s.find((t=>t.handler===e));null==i||i.destroy()}onAll(e){const s=new t(e,void 0,this.onWildcardSubDestroyedFunc);return this._wildcardSubs.push(s),s}offAll(t){const e=this._wildcardSubs.find((e=>e.handler===t));null==e||e.destroy()}pub(t,e,s=!1,i=!0){var n;i&&this._eventCache.set(t,{data:e,synced:s});const r=this._topicSubsMap.get(t);if(void 0!==r){let a=!1;const o=null!==(n=this._notifyDepthMap.get(t))&&void 0!==n?n:0;this._notifyDepthMap.set(t,o+1);const c=r.length;for(let n=0;nt.isAlive));this._topicSubsMap.set(t,e)}}s&&this.syncEvent(t,e,i);let a=!1;this._wildcardNotifyDepth++;const o=this._wildcardSubs.length;for(let s=0;st.isAlive)))}onWildcardSubDestroyed(t){0===this._wildcardNotifyDepth&&this._wildcardSubs.splice(this._wildcardSubs.indexOf(t),1)}resyncEvents(){for(const[t,e]of this._eventCache)e.synced&&this.syncEvent(t,e.data,!0)}syncEvent(t,e,s){this._busSync.sendEvent(t,e,s)}getPublisher(){return this}getSubscriber(){return new i(this)}getTopicSubscriberCount(t){var e,s;return null!==(s=null===(e=this._topicSubsMap.get(t))||void 0===e?void 0:e.length)&&void 0!==s?s:0}forEachSubscribedTopic(t){this._topicSubsMap.forEach(((e,s)=>{e.length>0&&t(s,e.length)}))}}class r{constructor(t,e){this.isPaused=!1,this.lastEventSynced=-1,this.dataPackageQueue=[],this.recvEventCb=t,this.busId=e,this.hookReceiveEvent();const s=()=>{if(!this.isPaused&&this.dataPackageQueue.length>0){const t={busId:this.busId,packagedId:Math.floor(1e9*Math.random()),data:this.dataPackageQueue};this.executeSync(t)?this.dataPackageQueue.length=0:console.warn("Failed to send sync data package")}requestAnimationFrame(s)};requestAnimationFrame(s)}processEventsReceived(t){this.busId!==t.busId&&this.lastEventSynced!==t.packagedId&&(this.lastEventSynced=t.packagedId,t.data.forEach((t=>{try{this.recvEventCb(t.topic,void 0!==t.data?t.data:void 0,!1,t.isCached)}catch(t){console.error(t),t instanceof Error&&console.error(t.stack)}})))}sendEvent(t,e,s){const i={topic:t,data:e,isCached:s};this.dataPackageQueue.push(i)}}class a extends r{executeSync(t){try{return this.listener.triggerToAllSubscribers(a.EB_KEY,JSON.stringify(t)),!0}catch(t){return!1}}hookReceiveEvent(){this.listener=RegisterViewListener(a.EB_LISTENER_KEY,void 0,!0),this.listener.on(a.EB_KEY,(t=>{try{const e=JSON.parse(t);this.processEventsReceived(e)}catch(t){console.error(t)}}))}}a.EB_KEY="eb.evt",a.EB_LISTENER_KEY="JS_LISTENER_SIMVARS";class o extends r{executeSync(t){try{return LaunchFlowEvent("ON_MOUSERECT_HTMLEVENT",o.EB_LISTENER_KEY,this.busId.toString(),JSON.stringify(t)),!0}catch(t){return!1}}hookReceiveEvent(){Coherent.on("OnInteractionEvent",((t,e)=>{0!==e.length&&e[0]===o.EB_LISTENER_KEY&&e[2]&&this.processEventsReceived(JSON.parse(e[2]))}))}}o.EB_LISTENER_KEY="EB_EVENTS";class c extends r{executeSync(t){try{return this.listener.send(c.EB_KEY,t),!0}catch(t){return!1}}hookReceiveEvent(){this.isPaused=!0,this.listener=RegisterGenericDataListener((()=>{this.listener.onDataReceived(c.EB_KEY,(t=>{try{this.processEventsReceived(t)}catch(t){console.error(t)}})),this.isPaused=!1}))}}c.EB_KEY="wt.eb.evt",c.EB_LISTENER_KEY="JS_LISTENER_GENERICDATA";class h{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e){this.canInitialNotify=!0,this.consumerHandler=t=>{this.value=t},this._isAlive=!0,this._isPaused=!1,this.value=e,this.sub=null==t?void 0:t.handle(this.consumerHandler)}get(){return this.value}setConsumer(t){var e;return this._isAlive?(null===(e=this.sub)||void 0===e||e.destroy(),this.sub=null==t?void 0:t.handle(this.consumerHandler,this._isPaused),this):this}pause(){var t;return this._isPaused||(null===(t=this.sub)||void 0===t||t.pause(),this._isPaused=!0),this}resume(){var t;return this._isPaused?(this._isPaused=!1,null===(t=this.sub)||void 0===t||t.resume(!0),this):this}destroy(){var t;this._isAlive=!1,null===(t=this.sub)||void 0===t||t.destroy()}static create(t,e){return new h(t,e)}}var l;!function(t){t.Amps="Amperes",t.Bool="bool",t.Celsius="celsius",t.Degree="degrees",t.DegreesPerSecond="degrees per second",t.Enum="enum",t.Farenheit="farenheit",t.Feet="feet",t.FPM="feet per minute",t.GAL="gallons",t.GPH="gph",t.Hertz="hertz",t.Hours="Hours",t.HPA="hectopascals",t.InHG="inches of mercury",t.KHz="KHz",t.Knots="knots",t.LBS="pounds",t.LLA="latlonalt",t.Mach="mach",t.MB="Millibars",t.Meters="meters",t.MetersPerSecond="meters per second",t.MetersPerSecondSquared="meters per second squared",t.MillimetersWater="millimeters of water",t.MHz="MHz",t.NM="nautical mile",t.Number="number",t.Percent="percent",t.PercentOver100="percent over 100",t.Pounds="pounds",t.PPH="Pounds per hour",t.PSI="psi",t.Radians="radians",t.RadiansPerSecond="radians per second",t.Rankine="rankine",t.RPM="Rpm",t.Seconds="seconds",t.SlugsPerCubicFoot="slug per cubic foot",t.String="string",t.Volts="Volts",t.FtLb="Foot pounds"}(l||(l={}));const u=new RegExp(/latlonalt/i),d=new RegExp(/latlonaltpbh/i),p=new RegExp(/pbh/i),f=new RegExp(/pid_struct/i),m=new RegExp(/xyz/i),A=new RegExp(/string/i),g=new RegExp(/boolean|bool/i),y=new RegExp(/number/i);SimVar.GetSimVarValue=(t,e,s="")=>{try{if(simvar){let i;const n=SimVar.GetRegisteredId(t,e,s);return n>=0&&(i=y.test(e)?simvar.getValueReg(n):A.test(e)?simvar.getValueReg_String(n):u.test(e)?new LatLongAlt(simvar.getValue_LatLongAlt(t,s)):d.test(e)?new LatLongAltPBH(simvar.getValue_LatLongAltPBH(t,s)):p.test(e)?new PitchBankHeading(simvar.getValue_PBH(t,s)):f.test(e)?new PID_STRUCT(simvar.getValue_PID_STRUCT(t,s)):m.test(e)?new XYZ(simvar.getValue_XYZ(t,s)):simvar.getValueReg(n)),i}console.warn("SimVar handler is not defined ("+t+")")}catch(s){return console.warn("ERROR ",s," GetSimVarValue "+t+" unit : "+e),null}return null},SimVar.SetSimVarValue=(t,e,s,i="")=>{if(null==s)return console.warn(t+" : Trying to set a null value"),Promise.resolve();try{if(simvar){const n=SimVar.GetRegisteredId(t,e,i);if(n>=0)return A.test(e)?Coherent.call("setValueReg_String",n,s):g.test(e)?Coherent.call("setValueReg_Bool",n,!!s):y.test(e)?Coherent.call("setValueReg_Number",n,s):u.test(e)?Coherent.call("setValue_LatLongAlt",t,s,i):d.test(e)?Coherent.call("setValue_LatLongAltPBH",t,s,i):p.test(e)?Coherent.call("setValue_PBH",t,s,i):f.test(e)?Coherent.call("setValue_PID_STRUCT",t,s,i):m.test(e)?Coherent.call("setValue_XYZ",t,s,i):Coherent.call("setValueReg_Number",n,s)}else console.warn("SimVar handler is not defined")}catch(t){console.warn("error SetSimVarValue "+t)}return Promise.resolve()},SimVar.GetSimVarValue,SimVar.SetSimVarValue;class v{constructor(t,e=void 0){this.bus=t,this.publisher=this.bus.getPublisher(),this.publishActive=!1,this.pacer=e}startPublish(){this.publishActive=!0}stopPublish(){this.publishActive=!1}isPublishing(){return this.publishActive}onUpdate(){}publish(t,e,s=!1,i=!0){!this.publishActive||this.pacer&&!this.pacer.canPublish(t,e)||this.publisher.pub(t,e,s,i)}}class _ extends v{constructor(t,e,s){super(e,s),this.resolvedSimVars=new Map,this.indexedSimVars=new Map,this.subscribed=new Set;for(const[e,s]of t)s.indexed?this.indexedSimVars.set(e,{name:s.name,type:s.type,map:s.map,indexes:!0===s.indexed?void 0:new Set(s.indexed),defaultIndex:s.defaultIndex}):this.resolvedSimVars.set(e,Object.assign({},s));const i=this.handleSubscribedTopic.bind(this);this.bus.forEachSubscribedTopic(i),this.bus.getSubscriber().on("event_bus_topic_first_sub").handle(i)}handleSubscribedTopic(t){this.resolvedSimVars.has(t)?this.onTopicSubscribed(t):this.tryMatchIndexedSubscribedTopic(t)}tryMatchIndexedSubscribedTopic(t){var e;if(0===this.indexedSimVars.size)return;let s=this.indexedSimVars.get(t);if(s){if(null!==s.defaultIndex){const i=this.resolveIndexedSimVar(t,s,null!==(e=s.defaultIndex)&&void 0!==e?e:1);void 0!==i&&this.onTopicSubscribed(i)}return}if(!_.INDEXED_REGEX.test(t))return;const i=t.match(_.INDEXED_REGEX),[,n,r]=i;if(s=this.indexedSimVars.get(n),s){const t=this.resolveIndexedSimVar(n,s,parseInt(r));void 0!==t&&this.onTopicSubscribed(t)}}resolveIndexedSimVar(t,e,s){null!=s||(s=1);const i=`${t}_${s}`;if(this.resolvedSimVars.has(i))return i;const n=void 0===e.defaultIndex?1:e.defaultIndex;return void 0===e.indexes||e.indexes.has(s)?(this.resolvedSimVars.set(i,{name:e.name.replace("#index#",`${null!=s?s:1}`),type:e.type,map:e.map,unsuffixedTopic:n===s?t:void 0}),i):void 0}onTopicSubscribed(t){this.subscribed.has(t)||(this.subscribed.add(t),this.publishActive&&this.publishTopic(t))}subscribe(t){}unsubscribe(t){}onUpdate(){for(const t of this.subscribed.values())this.publishTopic(t)}publishTopic(t){const e=this.resolvedSimVars.get(t);if(void 0!==e){const s=this.getValueFromEntry(e);this.publish(t,s),e.unsuffixedTopic&&this.publish(e.unsuffixedTopic,s)}}getValue(t){const e=this.resolvedSimVars.get(t);if(void 0!==e)return this.getValueFromEntry(e)}getValueFromEntry(t){return void 0===t.map?this.getSimVarValue(t):t.map(this.getSimVarValue(t))}getSimVarValue(t){const e=SimVar.GetSimVarValue(t.name,t.type);return t.type===l.Bool?1===e:e}}_.INDEXED_REGEX=/(.*)_(0|[1-9]\d*)$/;class b extends t{constructor(t,e,s,i){let n,r;"function"==typeof i?(n=t=>{e.set(s(t,e.get()))},r=i):(n=t=>{e.set(t)},r=s),super(n,(e=>{e.handler(t.get())}),r)}}class T{constructor(){this.isSubscribable=!0,this.notifyDepth=0,this.initialNotifyFunc=this.notifySubscription.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}sub(e,s=!1,i=!1){const n=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(n),i?n.pause():s&&n.initialNotify(),n}unsub(t){let e;this.singletonSub&&this.singletonSub.handler===t?e=this.singletonSub:this.subs&&(e=this.subs.find((e=>e.handler===t))),null==e||e.destroy()}notify(){const t=0===this.notifyDepth;let e=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isAlive&&!this.singletonSub.isPaused&&this.notifySubscription(this.singletonSub)}catch(t){console.error(`AbstractSubscribable: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(t)if(this.singletonSub)e=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}notifySubscription(t){t.handler(this.get())}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}map(t,e,s,i){return new S(this,t,null!=e?e:T.DEFAULT_EQUALITY_FUNC,s,i)}pipe(t,e,s){let i,n;return"function"==typeof e?(i=new b(this,t,e,this.onSubDestroyedFunc),n=null!=s&&s):(i=new b(this,t,this.onSubDestroyedFunc),n=null!=e&&e),this.addSubscription(i),n?i.pause():i.initialNotify(),i}}T.DEFAULT_EQUALITY_FUNC=(t,e)=>t===e;class S extends T{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,s,i,n){super(),this.input=t,this.mapFunc=e,this.equalityFunc=s,this.canInitialNotify=!0,this._isAlive=!0,this._isPaused=!1,n&&i?(this.value=n,i(this.value,this.mapFunc(this.input.get())),this.mutateFunc=t=>{i(this.value,t)}):(this.value=this.mapFunc(this.input.get()),this.mutateFunc=t=>{this.value=t}),this.inputSub=this.input.sub((t=>{this.updateValue(t)}),!0)}updateValue(t){const e=this.mapFunc(t,this.value);this.equalityFunc(this.value,e)||(this.mutateFunc(e),this.notify())}get(){return this.value}pause(){if(!this._isAlive)throw new Error("MappedSubscribable: cannot pause a dead subscribable");return this._isPaused||(this.inputSub.pause(),this._isPaused=!0),this}resume(){if(!this._isAlive)throw new Error("MappedSubscribable: cannot resume a dead subscribable");return this._isPaused?(this._isPaused=!1,this.inputSub.resume(!0),this):this}destroy(){this._isAlive=!1,this.inputSub.destroy()}}var C,R,E,P,I,N,w,L,F,M,D,O,U,V,x,G,k,B,H,W,j,$,Y,z,q,K,X,Q,Z,J,tt,et,st,it,nt,rt;!function(t){t[t.Any=0]="Any",t[t.Number=1]="Number",t[t.String=2]="String"}(C||(C={})),function(t){t.set=function(t,e){SetStoredData(t,JSON.stringify(e))},t.get=function(t){try{const e=GetStoredData(t);return JSON.parse(e)}catch(t){return}},t.remove=function(t){DeleteStoredData(t)}}(R||(R={}));class at extends T{constructor(t,e,s){super(),this.value=t,this.equalityFunc=e,this.mutateFunc=s,this.isMutableSubscribable=!0}static create(t,e,s){return new at(t,null!=e?e:at.DEFAULT_EQUALITY_FUNC,s)}notifySub(t){t(this.value)}set(t){this.equalityFunc(t,this.value)||(this.mutateFunc?this.mutateFunc(this.value,t):this.value=t,this.notify())}apply(t){if("object"!=typeof this.value||null===this.value)return;let e=!1;for(const s in t)if(e=t[s]!==this.value[s],e)break;Object.assign(this.value,t),e&&this.notify()}notify(){super.notify()}get(){return this.value}}class ot{constructor(){this.gameState=at.create(void 0),window.document.addEventListener("OnVCockpitPanelAttributesChanged",this.onAttributesChanged.bind(this)),this.onAttributesChanged()}onAttributesChanged(){var t;if(null===(t=window.parent)||void 0===t?void 0:t.document.body.hasAttribute("gamestate")){const t=window.parent.document.body.getAttribute("gamestate");if(null!==t){const e=GameState[t];return void(e===GameState.ingame&&this.gameState.get()!==GameState.ingame?setTimeout((()=>{setTimeout((()=>{const t=window.parent.document.body.getAttribute("gamestate");null!==t&&this.gameState.set(GameState[t])}))})):this.gameState.set(e))}}this.gameState.set(void 0)}static get(){var t;return(null!==(t=ot.INSTANCE)&&void 0!==t?t:ot.INSTANCE=new ot).gameState}}class ct{static parseFacilitiesCycle(t,e){const s=t.match(ct.MSFS_DATE_RANGE_REGEX);if(null===s)return void console.warn("AiracUtils: Failed to parse facilitiesDateRange",t);const[,i,n,r,a,o]=s,c=new Date(`${i}-${n}-${o} UTC`),h=new Date(`${r}-${a}-${o} UTC`);c.getTime()>h.getTime()&&c.setUTCFullYear(c.getUTCFullYear()-1);const l=c.getTime(),u=void 0!==e?e:{};return ct.fillCycleFromEffectiveTimestamp(l,u)}static getOffsetCycle(t,e,s){const i=t.effectiveTimestamp+e*ct.CYCLE_DURATION,n=void 0!==s?s:{};return ct.fillCycleFromEffectiveTimestamp(i,n)}static getCycleNumber(t){ct.dateCache.setTime(t);const e=t-Date.UTC(ct.dateCache.getUTCFullYear(),0,1);return Math.trunc(e/ct.CYCLE_DURATION)+1}static getCurrentCycle(t,e){const s=t.getTime()-ct.DATUM_CYCLE_TIMESTAMP,i=Math.floor(s/ct.CYCLE_DURATION),n=ct.DATUM_CYCLE_TIMESTAMP+i*ct.CYCLE_DURATION,r=void 0!==e?e:{};return ct.fillCycleFromEffectiveTimestamp(n,r)}static fillCycleFromEffectiveTimestamp(t,e){return ct.dateCache.setTime(t),e.effectiveTimestamp=t,e.expirationTimestamp=t+ct.CYCLE_DURATION,e.cycle=ct.getCycleNumber(t),e.cycleString=e.cycle.toString().padStart(2,"0"),e.ident=`${(ct.dateCache.getUTCFullYear()%100).toString().padStart(2,"0")}${e.cycleString}`,e}}ct.dateCache=new Date,ct.CYCLE_DURATION=24192e5,ct.MSFS_DATE_RANGE_REGEX=/([A-Z]{3})(\d\d?)([A-Z]{3})(\d\d?)\/(\d\d)/,ct.DATUM_CYCLE_TIMESTAMP=Date.UTC(2024,0,25);class ht{static pressureAir(t,e){return e*ht.R_AIR*(t+273.15)/100}static densityAir(t,e){return 100*t/(ht.R_AIR*(e+273.15))}static temperatureAir(t,e){return 100*t/(ht.R_AIR*e)-273.15}static soundSpeedAir(t){return Math.sqrt(401.8798068394*(t+273.15))}static totalPressureRatioAir(t){return Math.pow(1+.2*t*t,3.5)}static totalTemperatureRatioAir(t,e=1){return 1+.2*e*t*t}static isaTemperature(t){return t<11e3?15+-.0065*Math.max(t,-610):t<2e4?-56.5:t<32e3?.001*(t-2e4)-56.5:t<47e3?.0028*(t-32e3)-44.5:t<51e3?-2.5:t<71e3?-.0028*(t-51e3)-2.5:-.002*(Math.min(t,8e4)-71e3)-58.5}static isaPressure(t){return t<-610?1088.707021458965:t<=11e3?1013.25*Math.pow(1-225577e-10*t,5.2558):t<=2e4?226.32547681422847*Math.exp(-157686e-9*(t-11e3)):t<=32e3?54.7512459834976*Math.pow(1+461574e-11*(t-2e4),-34.1627):t<=47e3?8.68079131804552*Math.pow(1+122458e-10*(t-32e3),-12.201):t<=51e3?1.1091650294132658*Math.exp(-126225e-9*(t-47e3)):t<=71e3?.6694542213945832*Math.pow(1-103455e-10*(t-51e3),12.201):t<=8e4?.03956893750841349*Math.pow(1-931749e-11*(t-71e3),17.0814):.008864013902895545}static isaAltitude(t){return t>1088.707021458965?-610:t>226.32547681422847?-44330.76067152236*(Math.pow(t/1013.25,.1902659918566155)-1):t>54.7512459834976?-6341.717083317479*Math.log(t/226.32547681422847)+11e3:t>8.68079131804552?216649.9846178511*(Math.pow(t/54.7512459834976,-.02927169105486393)-1)+2e4:t>1.1091650294132658?81660.6509987098*(Math.pow(t/8.68079131804552,-.08196049504139005)-1)+32e3:t>.6694542213945832?-7922.360863537334*Math.log(t/1.1091650294132658)+47e3:t>.03956893750841349?-96660.38374172345*(Math.pow(t/.6694542213945832,.08196049504139005)-1)+51e3:t>.008864013902895545?-107325.0414006347*(Math.pow(t/.03956893750841349,.05854321074385004)-1)+71e3:8e4}static isaDensity(t,e=0){return ht.densityAir(ht.isaPressure(t),ht.isaTemperature(t)+e)}static soundSpeedIsa(t,e=0){return this.soundSpeedAir(ht.isaTemperature(t)+e)}static baroPressureAltitudeOffset(t){return 44330.76067152236*(Math.pow(t/1013.25,.1902659918566155)-1)}static altitudeOffsetBaroPressure(t){return 1013.25*Math.pow(1+225577e-10*t,5.2558)}static tasToMach(t,e){return t/e}static tasToMachIsa(t,e,s=0){return t/ht.soundSpeedIsa(e,s)}static machToTas(t,e){return t*e}static machToTasIsa(t,e,s=0){return t*ht.soundSpeedIsa(e,s)}static casToMach(t,e){const s=t/ht.SOUND_SPEED_SEA_LEVEL_ISA,i=1013.25*(Math.pow(1+.2*s*s,3.5)-1);return Math.sqrt(5*(Math.pow(i/e+1,2/7)-1))}static casToMachIsa(t,e){return ht.casToMach(t,ht.isaPressure(e))}static machToCas(t,e){const s=e*(Math.pow(1+.2*t*t,3.5)-1);return ht.SOUND_SPEED_SEA_LEVEL_ISA*Math.sqrt(5*(Math.pow(s/1013.25+1,2/7)-1))}static machToCasIsa(t,e){return ht.machToCas(t,ht.isaPressure(e))}static casToTas(t,e,s){return ht.casToMach(t,e)*ht.soundSpeedAir(s)}static casToTasIsa(t,e,s=0){return ht.casToMachIsa(t,e)*ht.soundSpeedIsa(e,s)}static tasToCas(t,e,s){return ht.machToCas(t/ht.soundSpeedAir(s),e)}static tasToCasIsa(t,e,s=0){return ht.machToCasIsa(t/ht.soundSpeedIsa(e,s),e)}static tasToEas(t,e){return t*Math.sqrt(e/ht.DENSITY_SEA_LEVEL_ISA)}static tasToEasIsa(t,e,s=0){return ht.tasToEas(t,ht.isaDensity(e,s))}static easToTas(t,e){return t*Math.sqrt(ht.DENSITY_SEA_LEVEL_ISA/e)}static easToTasIsa(t,e,s=0){return ht.easToTas(t,ht.isaDensity(e,s))}static machToEas(t,e){return ht.SOUND_SPEED_SEA_LEVEL_ISA*t*Math.sqrt(e/1013.25)}static machToEasIsa(t,e){return ht.machToEas(t,ht.isaPressure(e))}static easToMach(t,e){return t*Math.sqrt(1013.25/e)/ht.SOUND_SPEED_SEA_LEVEL_ISA}static easToMachIsa(t,e){return ht.easToMach(t,ht.isaPressure(e))}static casToEas(t,e){const s=t/ht.SOUND_SPEED_SEA_LEVEL_ISA,i=1013.25*(Math.pow(1+.2*s*s,3.5)-1);return ht.SOUND_SPEED_SEA_LEVEL_ISA*Math.sqrt(5*e/1013.25*(Math.pow(i/e+1,2/7)-1))}static casToEasIsa(t,e){return ht.casToEas(t,ht.isaPressure(e))}static easToCas(t,e){return ht.machToCas(ht.easToMach(t,e),e)}static easToCasIsa(t,e){return ht.easToCas(t,ht.isaPressure(e))}static flowCoefFromForce(t,e,s,i){return t/((void 0===i?100*s:.5*s*i*i)*e)}static flowForceFromCoef(t,e,s,i){return t*(void 0===i?100*s:.5*s*i*i)*e}}ht.R=8.314462618153,ht.R_AIR=287.057,ht.GAMMA_AIR=1.4,ht.SOUND_SPEED_SEA_LEVEL_ISA=340.2964,ht.DENSITY_SEA_LEVEL_ISA=ht.isaDensity(0),ht.liftCoefficient=ht.flowCoefFromForce,ht.lift=ht.flowForceFromCoef,ht.dragCoefficient=ht.flowCoefFromForce,ht.drag=ht.flowForceFromCoef;class lt{static createFlag(t){if(t<0||t>32)throw new Error(`Invalid index ${t} for bit flag. Index must be between 0 and 32.`);return 1<0){for(i+=" per ",t=0;tt.family.localeCompare(e.family))),this.denominator.sort(((t,e)=>t.family.localeCompare(e.family))),this.scaleFactor=this.getScaleFactor()}getScaleFactor(){let t=1;return t=this.numerator.reduce(((t,e)=>t*e.scaleFactor),t),t=this.denominator.reduce(((t,e)=>t/e.scaleFactor),t),t}canConvert(t){return t instanceof At&&super.canConvert(t)}convertTo(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${this.name} to ${e.name}.`);return t*(this.scaleFactor/e.scaleFactor)}convertFrom(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${e.name} to ${this.name}.`);return t*(e.scaleFactor/this.scaleFactor)}}!function(t){t.Distance="distance",t.Angle="angle",t.Duration="duration",t.Weight="weight",t.Mass="weight",t.Volume="volume",t.Pressure="pressure",t.Temperature="temperature",t.TemperatureDelta="temperature_delta",t.Speed="speed",t.Acceleration="acceleration",t.WeightFlux="weight_flux",t.MassFlux="weight_flux",t.VolumeFlux="volume_flux",t.Density="density",t.Force="force",t.DistancePerWeight="distance_per_weight",t.DistanceRatio="distance_ratio",t.WeightPerDistance="weight_per_distance"}(E||(E={}));class gt{}gt.METER=new mt(E.Distance,"meter",1),gt.KILOMETER=new mt(E.Distance,"kilometer",1e3),gt.INCH=new mt(E.Distance,"inch",.0254),gt.FOOT=new mt(E.Distance,"foot",.3048),gt.MILE=new mt(E.Distance,"mile",1609.34),gt.NMILE=new mt(E.Distance,"nautical mile",1852),gt.GA_RADIAN=new mt(E.Distance,"great arc radian",6378100),gt.G_METER=new mt(E.Distance,"9.80665 meter",9.80665),gt.RADIAN=new mt(E.Angle,"radian",1),gt.DEGREE=new mt(E.Angle,"degree",Math.PI/180),gt.ARC_MIN=new mt(E.Angle,"minute",Math.PI/180/60),gt.ARC_SEC=new mt(E.Angle,"second",Math.PI/180/3600),gt.MILLISECOND=new mt(E.Duration,"millisecond",.001),gt.SECOND=new mt(E.Duration,"second",1),gt.MINUTE=new mt(E.Duration,"minute",60),gt.HOUR=new mt(E.Duration,"hour",3600),gt.KILOGRAM=new mt(E.Weight,"kilogram",1),gt.POUND=new mt(E.Weight,"pound",.453592),gt.SLUG=new mt(E.Weight,"slug",14.5939),gt.TON=new mt(E.Weight,"ton",907.185),gt.TONNE=new mt(E.Weight,"tonne",1e3),gt.LITER_FUEL=new mt(E.Weight,"liter",.80283679),gt.GALLON_FUEL=new mt(E.Weight,"gallon",3.0390664),gt.IMP_GALLON_FUEL=new mt(E.Weight,"imperial gallon",3.6497683),gt.LITER=new mt(E.Volume,"liter",1),gt.GALLON=new mt(E.Volume,"gallon",3.78541),gt.HPA=new mt(E.Pressure,"hectopascal",1),gt.MB=new mt(E.Pressure,"millibar",1),gt.ATM=new mt(E.Pressure,"atmosphere",1013.25),gt.IN_HG=new mt(E.Pressure,"inch of mercury",33.8639),gt.MM_HG=new mt(E.Pressure,"millimeter of mercury",1.33322),gt.PSI=new mt(E.Pressure,"pound per square inch",68.9476),gt.KELVIN=new mt(E.Temperature,"kelvin",1,0),gt.CELSIUS=new mt(E.Temperature,"° Celsius",1,273.15),gt.FAHRENHEIT=new mt(E.Temperature,"° Fahrenheit",5/9,459.67),gt.RANKINE=new mt(E.Temperature,"° Rankine",5/9,0),gt.DELTA_CELSIUS=new mt(E.TemperatureDelta,"Δ° Celsius",1),gt.DELTA_FAHRENHEIT=new mt(E.TemperatureDelta,"Δ° Fahrenheit",5/9),gt.KNOT=new At(E.Speed,[gt.NMILE],[gt.HOUR],"knot"),gt.KPH=new At(E.Speed,[gt.KILOMETER],[gt.HOUR]),gt.MPH=new At(E.Speed,[gt.MILE],[gt.HOUR]),gt.MPM=new At(E.Speed,[gt.METER],[gt.MINUTE]),gt.MPS=new At(E.Speed,[gt.METER],[gt.SECOND]),gt.FPM=new At(E.Speed,[gt.FOOT],[gt.MINUTE]),gt.FPS=new At(E.Speed,[gt.FOOT],[gt.SECOND]),gt.MPM_PER_SEC=new At(E.Acceleration,[gt.METER],[gt.MINUTE,gt.SECOND]),gt.MPS_PER_SEC=new At(E.Acceleration,[gt.METER],[gt.SECOND,gt.SECOND]),gt.FPM_PER_SEC=new At(E.Acceleration,[gt.FOOT],[gt.MINUTE,gt.SECOND]),gt.FPS_PER_SEC=new At(E.Acceleration,[gt.FOOT],[gt.SECOND,gt.SECOND]),gt.KNOT_PER_SEC=new At(E.Acceleration,[gt.NMILE],[gt.HOUR,gt.SECOND]),gt.G_ACCEL=new At(E.Acceleration,[gt.G_METER],[gt.SECOND,gt.SECOND]),gt.KGH=new At(E.WeightFlux,[gt.KILOGRAM],[gt.HOUR]),gt.PPH=new At(E.WeightFlux,[gt.POUND],[gt.HOUR]),gt.LPH_FUEL=new At(E.WeightFlux,[gt.LITER_FUEL],[gt.HOUR]),gt.GPH_FUEL=new At(E.WeightFlux,[gt.GALLON_FUEL],[gt.HOUR]),gt.IGPH_FUEL=new At(E.WeightFlux,[gt.IMP_GALLON_FUEL],[gt.HOUR]),gt.SLUG_PER_FT3=new At(E.Density,[gt.SLUG],[gt.FOOT,gt.FOOT,gt.FOOT]),gt.KG_PER_M3=new At(E.Density,[gt.KILOGRAM],[gt.METER,gt.METER,gt.METER]),gt.NEWTON=new At(E.Force,[gt.KILOGRAM,gt.METER],[gt.SECOND,gt.SECOND]),gt.POUND_FORCE=new At(E.Force,[gt.POUND,gt.G_METER],[gt.SECOND,gt.SECOND]),gt.MILE_PER_GALLON_FUEL=new At(E.DistancePerWeight,[gt.MILE],[gt.GALLON_FUEL]),gt.NMILE_PER_GALLON_FUEL=new At(E.DistancePerWeight,[gt.NMILE],[gt.GALLON_FUEL]),gt.FOOT_PER_NMILE=new At(E.DistanceRatio,[gt.FOOT],[gt.NMILE]);class yt{static isSubscribable(t){return"object"==typeof t&&null!==t&&!0===t.isSubscribable}static isMutableSubscribable(t){return"object"==typeof t&&null!==t&&!0===t.isMutableSubscribable}static isSubscribableSet(t){return"object"==typeof t&&null!==t&&!0===t.isSubscribableSet}static isMutableSubscribableSet(t){return"object"==typeof t&&null!==t&&!0===t.isMutableSubscribableSet}static toSubscribable(t,e){return e&&yt.isSubscribable(t)?t:at.create(t)}static pipeMappedSource(t,e,s,i,n){let r,a;"function"==typeof i?(r=i,a=null!=n&&n):a=null!=i&&i;const o=new vt(t,e,void 0,s,r);return a||o.resume(!0),o}static pipeOptionalMappedSource(t,e,s,i,n,r){let a,o;"function"==typeof n?(a=n,o=null!=r&&r):o=null!=n&&n;const c=new vt(t,e,s,i,a);return o||c.resume(!0),c}}yt.NUMERIC_NAN_EQUALITY=(t,e)=>t===e||isNaN(t)&&isNaN(e),yt.NEVER_EQUALITY=()=>!1;class vt{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,s,i,n){this.target=e,this.onOrphaned=s,this.sourceMap=i,this.pipeMap=n,this._isAlive=!0,this._isPaused=!0,this.canInitialNotify=!0,this.isPipePaused=!0,this.sourceSub=t.sub(this.onSourceChanged.bind(this),!1,!0)}onSourceChanged(t){var e;null===(e=this.pipe)||void 0===e||e.destroy();const s=this.sourceMap(t);s?this.pipeMap?this.pipe=s.pipe(this.target,this.pipeMap,this.isPipePaused):this.pipe=s.pipe(this.target,this.isPipePaused):(this.pipe=void 0,!this.isPipePaused&&this.onOrphaned&&this.onOrphaned(this.target))}pause(){var t;if(!this._isAlive)throw new Error("Subscription: cannot pause a dead Subscription.");return this._isPaused=!0,this.isPipePaused=!0,this.sourceSub.pause(),null===(t=this.pipe)||void 0===t||t.pause(),this}resume(t=!1){if(!this._isAlive)throw new Error("Subscription: cannot resume a dead Subscription.");return this._isPaused?(this._isPaused=!1,this.sourceSub.resume(!0),this.isPipePaused=!1,this.pipe?this.pipe.resume(t):t&&this.onOrphaned&&this.onOrphaned(this.target),this):this}destroy(){var t;this._isAlive&&(this._isAlive=!1,this.sourceSub.destroy(),null===(t=this.pipe)||void 0===t||t.destroy(),this.pipe=void 0)}}class _t{static identity(){return t=>t}static not(){return t=>!t}static or(){return t=>t.length>0&&t.includes(!0)}static nor(){return t=>!t.includes(!0)}static and(){return t=>t.length>0&&!t.includes(!1)}static nand(){return t=>t.length<1||t.includes(!1)}static negate(){return t=>-t}static abs(){return Math.abs}static min(){return t=>Math.min(...t)}static max(){return t=>Math.max(...t)}static count(t){return _t.reduce(((e,s)=>t(s)?e+1:e),0)}static reduce(t,e){return s=>s.reduce(t,e)}static withPrecision(t){return yt.isSubscribable(t)?e=>{const s=t.get();return Math.round(e/s)*s}:e=>Math.round(e/t)*t}static changedBy(t){return yt.isSubscribable(t)?(e,s)=>void 0===s||Math.abs(e-s)>=t.get()?e:s:(e,s)=>void 0===s||Math.abs(e-s)>=t?e:s}static atFrequency(t,e=Date.now){let s,i=0;if(yt.isSubscribable(t))return(n,r)=>{let a=null!=r?r:n;const o=e(),c=o-(null!=s?s:s=o);if(s=o,i-=c,i<=0){const e=1e3/t.get();i=e+i%e,a=n}return a};{const n=1e3/t;return(t,r)=>{let a=null!=r?r:t;const o=e(),c=o-(null!=s?s:s=o);return s=o,i-=c,i<=0&&(i=n+i%n,a=t),a}}}}class bt extends T{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,s,i,...n){super(),this.mapFunc=t,this.equalityFunc=e,this.canInitialNotify=!0,this._isAlive=!0,this._isPaused=!1,this.inputs=n,this.inputValues=n.map((t=>t.get())),i&&s?(this.value=i,s(this.value,this.mapFunc(this.inputValues,void 0)),this.mutateFunc=t=>{s(this.value,t)}):(this.value=this.mapFunc(this.inputValues,void 0),this.mutateFunc=t=>{this.value=t}),this.inputSubs=this.inputs.map(((t,e)=>t.sub((t=>{this.inputValues[e]=t,this.updateValue()}))))}static create(...t){let e,s,i,n;return"function"==typeof t[0]?(e=t.shift(),s="function"==typeof t[0]?t.shift():T.DEFAULT_EQUALITY_FUNC,"function"==typeof t[0]&&(i=t.shift(),n=t.shift())):(e=bt.IDENTITY_MAP,s=bt.NEVER_EQUALS),new bt(e,s,i,n,...t)}updateValue(){const t=this.mapFunc(this.inputValues,this.value);this.equalityFunc(this.value,t)||(this.mutateFunc(t),this.notify())}get(){return this.value}pause(){if(!this._isAlive)throw new Error("MappedSubject: cannot pause a dead subject");if(this._isPaused)return this;for(let t=0;t!1;class Tt{static create(t,e){const s=new Float64Array(2);return void 0!==t&&void 0!==e&&(s[0]=t,s[1]=e),s}static theta(t){return Math.atan2(t[1],t[0])}static set(t,e,s){return s[0]=t,s[1]=e,s}static setFromPolar(t,e,s){return s[0]=t*Math.cos(e),s[1]=t*Math.sin(e),s}static add(t,e,s){return s[0]=t[0]+e[0],s[1]=t[1]+e[1],s}static sub(t,e,s){return s[0]=t[0]-e[0],s[1]=t[1]-e[1],s}static dot(t,e){return t[0]*e[0]+t[1]*e[1]}static det(t,e){return t[0]*e[1]-t[1]*e[0]}static multScalar(t,e,s){return s[0]=t[0]*e,s[1]=t[1]*e,s}static abs(t){return Math.hypot(t[0],t[1])}static normalize(t,e){const s=Tt.abs(t);return e[0]=t[0]/s,e[1]=t[1]/s,e}static normal(t,e,s=!1){const i=t[0],n=t[1];return s?(e[0]=-n,e[1]=i):(e[0]=n,e[1]=-i),e}static distance(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}static equals(t,e){return t[0]===e[0]&&t[1]===e[1]}static isFinite(t){return isFinite(t[0])&&isFinite(t[1])}static copy(t,e){return Tt.set(t[0],t[1],e)}static pointWithinPolygon(t,e){let s=0,i=0,n=0,r=0,a=0,o=0,c=null,h=null;const l=e[0],u=e[1],d=t.length-1;if(c=t[0],c[0]!==t[d][0]&&c[1]!==t[d][1])throw new Error("First and last coordinates in a ring must be the same");n=c[0]-l,r=c[1]-u;for(let d=0;d0&&o>0)c=h,r=o,n=c[0]-l;else{if(a=h[0]-e[0],o>0&&r<=0){if(i=n*o-a*r,i>0)s+=1;else if(0===i)return}else if(r>0&&o<=0){if(i=n*o-a*r,i<0)s+=1;else if(0===i)return}else if(0===o&&r<0){if(i=n*o-a*r,0===i)return}else if(0===r&&o<0){if(i=n*o-a*r,0===i)return}else if(0===r&&0===o){if(a<=0&&n>=0)return;if(n<=0&&a>=0)return}c=h,r=o,n=a}return s%2!=0}}class St{static create(t,e,s){const i=new Float64Array(3);return void 0!==t&&void 0!==e&&void 0!==s&&(i[0]=t,i[1]=e,i[2]=s),i}static theta(t){return Math.atan2(Math.hypot(t[0],t[1]),t[2])}static phi(t){return Math.atan2(t[1],t[0])}static set(t,e,s,i){return i[0]=t,i[1]=e,i[2]=s,i}static setFromSpherical(t,e,s,i){const n=Math.sin(e);return i[0]=t*n*Math.cos(s),i[1]=t*n*Math.sin(s),i[2]=t*Math.cos(e),i}static add(t,e,s){return s[0]=t[0]+e[0],s[1]=t[1]+e[1],s[2]=t[2]+e[2],s}static sub(t,e,s){return s[0]=t[0]-e[0],s[1]=t[1]-e[1],s[2]=t[2]-e[2],s}static dot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}static cross(t,e,s){const i=t[0],n=t[1],r=t[2],a=e[0],o=e[1],c=e[2];return s[0]=n*c-r*o,s[1]=r*a-i*c,s[2]=i*o-n*a,s}static multScalar(t,e,s){return s[0]=t[0]*e,s[1]=t[1]*e,s[2]=t[2]*e,s}static abs(t){return Math.hypot(t[0],t[1],t[2])}static normalize(t,e){const s=St.abs(t);return e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s,e}static distance(t,e){return Math.hypot(e[0]-t[0],e[1]-t[0],e[2]-t[2])}static equals(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}static isFinite(t){return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])}static copy(t,e){return St.set(t[0],t[1],t[2],e)}}class Ct{static create(t,...e){const s=new Float64Array(t);for(let i=0;ithis.value.length)throw new RangeError(`VecNSubject: Cannot set ${s.length} components on a vector of length ${this.value.length}`);let i=!0;const n=s.length;for(let t=0;t90&&(s=180-s,s=wt.toPlusMinus180(s),i+=180,i=wt.toPlusMinus180(i)),this._lat=s,this._lon=i,this}setFromCartesian(t,e,s){const i=wt.asVec3(t,e,s),n=St.theta(i),r=St.phi(i);return this.set(90-n*Avionics.Utils.RAD2DEG,r*Avionics.Utils.RAD2DEG)}distance(t,e){const s=wt.asLatLonInterface(t,e);return wt.distance(this.lat,this.lon,s.lat,s.lon)}distanceRhumb(t,e){const s=wt.asLatLonInterface(t,e);return wt.distanceRhumb(this.lat,this.lon,s.lat,s.lon)}bearingTo(t,e){const s=wt.asLatLonInterface(t,e);return wt.initialBearing(this.lat,this.lon,s.lat,s.lon)}bearingFrom(t,e){const s=wt.asLatLonInterface(t,e);return wt.finalBearing(s.lat,s.lon,this.lat,this.lon)}bearingRhumb(t,e){const s=wt.asLatLonInterface(t,e);return wt.bearingRhumb(this.lat,this.lon,s.lat,s.lon)}offset(t,e,s){const i=this.lat*Avionics.Utils.DEG2RAD,n=this.lon*Avionics.Utils.DEG2RAD,r=Math.sin(i),a=Math.cos(i),o=Math.sin(t*Avionics.Utils.DEG2RAD),c=Math.cos(t*Avionics.Utils.DEG2RAD),h=e,l=Math.sin(h),u=Math.cos(h),d=Math.asin(r*u+a*l*c),p=Math.atan2(o*l*a,u-r*Math.sin(d)),f=d*Avionics.Utils.RAD2DEG,m=(n+p)*Avionics.Utils.RAD2DEG;return(null!=s?s:this).set(f,m)}offsetRhumb(t,e,s){const i=this.lat*Avionics.Utils.DEG2RAD,n=this.lon*Avionics.Utils.DEG2RAD,r=t*Avionics.Utils.DEG2RAD;let a,o=i+e*Math.cos(r);if(Math.abs(o)>=Math.PI/2)o=90*Math.sign(o),a=0;else{const t=wt.deltaPsi(i,o),s=wt.rhumbCorrection(t,i,o);a=n+e*Math.sin(r)/s,o*=Avionics.Utils.RAD2DEG,a*=Avionics.Utils.RAD2DEG}return(null!=s?s:this).set(o,a)}antipode(t){return(null!=t?t:this).set(-this._lat,this._lon+180)}toCartesian(t){return wt.sphericalToCartesian(this,t)}equals(t,e,s){const i=wt.asLatLonInterface(t,e);if(i){if(isNaN(this._lat)&&isNaN(this._lon)&&isNaN(i.lat)&&isNaN(i.lon))return!0;const n="number"==typeof t?s:e,r=this.distance(i);return!isNaN(r)&&r<=(null!=n?n:wt.EQUALITY_TOLERANCE)}return!1}copy(t){return t?t.set(this.lat,this.lon):new wt(this.lat,this.lon)}static sphericalToCartesian(t,e,s){const i=wt.asLatLonInterface(t,e),n=(90-i.lat)*Avionics.Utils.DEG2RAD,r=i.lon*Avionics.Utils.DEG2RAD;return St.setFromSpherical(1,n,r,null!=s?s:e)}static equals(t,e,s,i,n){return t instanceof Float64Array?wt.distance(t,e)<=(null!=s?s:wt.EQUALITY_TOLERANCE):"number"==typeof t?wt.distance(t,e,s,i)<=(null!=n?n:wt.EQUALITY_TOLERANCE):wt.distance(t,e)<=(null!=s?s:wt.EQUALITY_TOLERANCE)}static distance(t,e,s,i){if(t instanceof Float64Array)return Math.acos(Utils.Clamp(St.dot(t,e),-1,1));{let n,r,a,o;"number"==typeof t?(n=t,r=e,a=s,o=i):(n=t.lat,r=t.lon,a=e.lat,o=e.lon),n*=Avionics.Utils.DEG2RAD,r*=Avionics.Utils.DEG2RAD,a*=Avionics.Utils.DEG2RAD,o*=Avionics.Utils.DEG2RAD;const c=Math.sin((a-n)/2),h=Math.sin((o-r)/2),l=c*c+Math.cos(n)*Math.cos(a)*h*h;return 2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}}static distanceRhumb(t,e,s,i){let n,r,a,o;if("number"==typeof t)n=t*Avionics.Utils.DEG2RAD,r=e*Avionics.Utils.DEG2RAD,a=s*Avionics.Utils.DEG2RAD,o=i*Avionics.Utils.DEG2RAD;else if(t instanceof Float64Array){const s=wt.tempGeoPoint.setFromCartesian(t);n=s.lat,r=s.lon;const i=wt.tempGeoPoint.setFromCartesian(e);a=i.lat,o=i.lon}else n=t.lat,r=t.lon,a=e.lat,o=e.lon;const c=a-n;let h=o-r;const l=wt.deltaPsi(n,a),u=wt.rhumbCorrection(l,n,a);return Math.abs(h)>Math.PI&&(h+=2*-Math.sign(h)*Math.PI),Math.sqrt(c*c+u*u*h*h)}static initialBearing(t,e,s,i){t*=Avionics.Utils.DEG2RAD,s*=Avionics.Utils.DEG2RAD,e*=Avionics.Utils.DEG2RAD,i*=Avionics.Utils.DEG2RAD;const n=Math.cos(s),r=Math.cos(t)*Math.sin(s)-Math.sin(t)*n*Math.cos(i-e),a=Math.sin(i-e)*n;return(Math.atan2(a,r)*Avionics.Utils.RAD2DEG+360)%360}static finalBearing(t,e,s,i){return(wt.initialBearing(s,i,t,e)+180)%360}static bearingRhumb(t,e,s,i){t*=Avionics.Utils.DEG2RAD,s*=Avionics.Utils.DEG2RAD,e*=Avionics.Utils.DEG2RAD;let n=(i*=Avionics.Utils.DEG2RAD)-e;const r=wt.deltaPsi(t,s);return Math.abs(n)>Math.PI&&(n+=2*-Math.sign(n)*Math.PI),Math.atan2(n,r)*Avionics.Utils.RAD2DEG}static toPlusMinus180(t){return(t%360+540)%360-180}static deltaPsi(t,e){return Math.log(Math.tan(e/2+Math.PI/4)/Math.tan(t/2+Math.PI/4))}static rhumbCorrection(t,e,s){return Math.abs(t)>1e-12?(s-e)/t:Math.cos(e)}}wt.EQUALITY_TOLERANCE=1e-7,wt.tempVec3=new Float64Array(3),wt.tempGeoPoint=new wt(0,0);class Lt{constructor(t,e){this._center=new Float64Array(3),this._radius=0,this._sinRadius=0,this.set(t,e)}get center(){return this._center}get radius(){return this._radius}isGreatCircle(){return this._radius===Math.PI/2}arcLength(t){return this._sinRadius*t}angularWidth(t){return t/this._sinRadius}set(t,e){return t instanceof Float64Array?0===St.abs(t)?St.set(1,0,0,this._center):St.normalize(t,this._center):wt.sphericalToCartesian(t,this._center),this._radius=Math.abs(e)%Math.PI,this._sinRadius=Math.sin(this._radius),this}setAsGreatCircle(t,e){return this.set(Lt._getGreatCircleNormal(t,e,Lt.vec3Cache[0]),Math.PI/2),this}reverse(){return St.multScalar(this._center,-1,this._center),this._radius=Math.PI-this._radius,this}distanceToCenter(t){t=t instanceof Float64Array?St.normalize(t,Lt.vec3Cache[0]):wt.sphericalToCartesian(t,Lt.vec3Cache[0]);const e=St.dot(t,this._center);return Math.acos(Utils.Clamp(e,-1,1))}closest(t,e){t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Lt.vec3Cache[0]));const s=St.multScalar(this._center,Math.cos(this._radius),Lt.vec3Cache[1]),i=St.dot(St.sub(t,s,Lt.vec3Cache[2]),this._center),n=St.sub(t,St.multScalar(this._center,i,Lt.vec3Cache[2]),Lt.vec3Cache[2]);if(0===St.dot(n,n)||1===Math.abs(St.dot(n,this._center)))return e instanceof wt?e.set(NaN,NaN):St.set(NaN,NaN,NaN,e);const r=St.multScalar(St.normalize(St.sub(n,s,Lt.vec3Cache[2]),Lt.vec3Cache[2]),Math.sin(this._radius),Lt.vec3Cache[2]),a=St.add(s,r,Lt.vec3Cache[2]);return e instanceof Float64Array?St.normalize(a,e):e.setFromCartesian(a)}distance(t){return this.distanceToCenter(t)-this._radius}includes(t,e=Lt.ANGULAR_TOLERANCE){const s=this.distance(t);return Math.abs(s)=ut.TWO_PI-i||o<=i?0:o}distanceAlong(t,e,s=Lt.ANGULAR_TOLERANCE,i=0){return this.arcLength(this.angleAlong(t,e,s,this.angularWidth(i)))}bearingAt(t,e=Lt.ANGULAR_TOLERANCE){if(t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Lt.vec3Cache[1])),!this.includes(t,e))throw new Error(`GeoCircle: the specified point does not lie on this circle (distance of ${Math.abs(this.distance(t))} vs tolerance of ${e}).`);if(this._radius<=Lt.ANGULAR_TOLERANCE||1-Math.abs(St.dot(t,Lt.NORTH_POLE))<=Lt.ANGULAR_TOLERANCE)return NaN;const s=St.normalize(St.cross(this._center,t,Lt.vec3Cache[2]),Lt.vec3Cache[2]),i=St.normalize(St.cross(t,Lt.NORTH_POLE,Lt.vec3Cache[3]),Lt.vec3Cache[3]);return(Math.acos(Utils.Clamp(St.dot(s,i),-1,1))*(s[2]>=0?1:-1)*Avionics.Utils.RAD2DEG-90+360)%360}offsetDistanceAlong(t,e,s,i=Lt.ANGULAR_TOLERANCE){const n=e/Math.sin(this.radius);return this._offsetAngleAlong(t,n,s,i)}offsetAngleAlong(t,e,s,i=Lt.ANGULAR_TOLERANCE){return this._offsetAngleAlong(t,e,s,i)}_offsetAngleAlong(t,e,s,i=Lt.ANGULAR_TOLERANCE){if(t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Lt.vec3Cache[3])),!this.includes(t,i))throw new Error(`GeoCircle: the specified point does not lie on this circle (distance of ${Math.abs(this.distance(t))} vs tolerance of ${i}).`);if(0===this.radius)return s instanceof wt?s.setFromCartesian(t):St.copy(t,s);t=this.closest(t,Lt.vec3Cache[3]);const n=Math.sin(e/2),r=Math.cos(e/2),a=n*this._center[0],o=n*this._center[1],c=n*this._center[2],h=r*r,l=a*a,u=o*o,d=c*c,p=r*a,f=r*o,m=r*c,A=a*o,g=a*c,y=o*c,v=h+l-u-d,_=2*(A-m),b=2*(g+f),T=2*(A+m),S=h-l+u-d,C=2*(y-p),R=2*(g-f),E=2*(y+p),P=h-l-u+d,I=t[0],N=t[1],w=t[2],L=v*I+_*N+b*w,F=T*I+S*N+C*w,M=R*I+E*N+P*w;return s instanceof Float64Array?St.set(L,F,M,s):s.setFromCartesian(St.set(L,F,M,Lt.vec3Cache[2]))}intersection(t,e){const s=this._center,i=t._center,n=this._radius,r=t._radius,a=St.dot(s,i),o=a*a;if(1===o)return 0;const c=(Math.cos(n)-a*Math.cos(r))/(1-o),h=(Math.cos(r)-a*Math.cos(n))/(1-o),l=St.add(St.multScalar(s,c,Lt.vec3Cache[0]),St.multScalar(i,h,Lt.vec3Cache[1]),Lt.vec3Cache[0]),u=St.dot(l,l);if(u>1)return 0;const d=St.cross(s,i,Lt.vec3Cache[1]),p=St.dot(d,d);if(0===p)return 0;const f=Math.sqrt((1-u)/p);let m=1;return e[0]||(e[0]=new Float64Array(3)),e[0].set(d),St.multScalar(e[0],f,e[0]),St.add(e[0],l,e[0]),f>0&&(e[1]||(e[1]=new Float64Array(3)),e[1].set(d),St.multScalar(e[1],-f,e[1]),St.add(e[1],l,e[1]),m++),m}intersectionGeoPoint(t,e){const s=this.intersection(t,Lt.intersectionCache);for(let t=0;t1)return 0;const d=St.cross(s,i,Lt.vec3Cache[1]),p=St.dot(d,d);if(0===p)return 0;const f=Math.sin(e);return(1-u)/p>f*f?2:1}static createFromPoint(t,e){return new Lt(wt.sphericalToCartesian(t,Lt.vec3Cache[0]),e)}static createGreatCircle(t,e){return new Lt(Lt._getGreatCircleNormal(t,e,Lt.vec3Cache[0]),Math.PI/2)}static createGreatCircleFromPointBearing(t,e){return new Lt(Lt.getGreatCircleNormalFromPointBearing(t,e,Lt.vec3Cache[0]),Math.PI/2)}static getGreatCircleNormal(t,e,s){return Lt._getGreatCircleNormal(t,e,s)}static _getGreatCircleNormal(t,e,s){return"number"==typeof e?Lt.getGreatCircleNormalFromPointBearing(t,e,s):Lt.getGreatCircleNormalFromPoints(t,e,s)}static getGreatCircleNormalFromPoints(t,e,s){return t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Lt.vec3Cache[0])),e instanceof Float64Array||(e=wt.sphericalToCartesian(e,Lt.vec3Cache[1])),St.normalize(St.cross(t,e,s),s)}static getGreatCircleNormalFromPointBearing(t,e,s){t instanceof Float64Array&&(t=Lt.tempGeoPoint.setFromCartesian(t));const i=t.lat*Avionics.Utils.DEG2RAD,n=t.lon*Avionics.Utils.DEG2RAD;e*=Avionics.Utils.DEG2RAD;const r=Math.sin(i),a=Math.sin(n),o=Math.cos(n),c=Math.sin(e),h=Math.cos(e),l=a*h-r*o*c,u=-o*h-r*a*c,d=Math.cos(i)*c;return St.set(l,u,d,s)}}Lt.ANGULAR_TOLERANCE=1e-7,Lt.NORTH_POLE=new Float64Array([0,0,1]),Lt.tempGeoPoint=new wt(0,0),Lt.vec3Cache=[new Float64Array(3),new Float64Array(3),new Float64Array(3),new Float64Array(3),new Float64Array(3)],Lt.intersectionCache=[new Float64Array(3),new Float64Array(3)];class Ft{static clamp(t,e,s){return Math.min(Math.max(t,e),s)}static normalizeHeading(t){return isFinite(t)?(t%360+360)%360:(console.error(`normalizeHeading: Invalid heading: ${t}`),NaN)}static reciprocateHeading(t){return Ft.normalizeHeading(t+180)}static turnRadius(t,e){return Math.pow(t,2)/(11.26*Math.tan(e*Avionics.Utils.DEG2RAD))/3.2808399}static bankAngle(t,e){const s=.51444444*t;return Math.atan(Math.pow(s,2)/(9.80665*e))*Avionics.Utils.RAD2DEG}static getTurnDirection(t,e){return Ft.normalizeHeading(e-t)>180?"left":"right"}static polarToDegreesNorth(t){return Ft.normalizeHeading(180/Math.PI*(Math.PI/2-t))}static degreesNorthToPolar(t){return Ft.normalizeHeading(t-90)/(180/Math.PI)}static calculateArcDistance(t,e,s){const i=(e-t+360)%360*Avionics.Utils.DEG2RAD,n=gt.GA_RADIAN.convertTo(1,gt.METER);return i*Math.sin(s/n)*n}static circleIntersection(t,e,s,i,n,r,a,o){const c=s-t,h=i-e,l=c*c+h*h,u=2*(c*(t-n)+h*(e-r)),d=u*u-4*l*((t-n)*(t-n)+(e-r)*(e-r)-a*a);if(l<1e-7||d<0)return o.x1=NaN,o.x2=NaN,o.y1=NaN,o.y2=NaN,0;if(0==d){const s=-u/(2*l);return o.x1=t+s*c,o.y1=e+s*h,o.x2=NaN,o.y2=NaN,1}{const s=(-u+Math.sqrt(d))/(2*l);o.x1=t+s*c,o.y1=e+s*h;const i=(-u-Math.sqrt(d))/(2*l);return o.x2=t+i*c,o.y2=e+i*h,2}}static northAngle(t,e,s,i){return Ft.polarToDegreesNorth(Math.atan2(i-e,s-t))}static bearingIsBetween(t,e,s){const i=this.normalizeHeading(s-e),n=this.normalizeHeading(t-e);return n>=0&&n<=i}static headingToAngle(t,e){return Ft.normalizeHeading(t+("left"===e?90:-90))}static angleToHeading(t,e){return Ft.normalizeHeading(t+("left"===e?-90:90))}static windCorrectionAngle(t,e,s,i){const n=i*Math.sin(t*Math.PI/180-s*Math.PI/180);return 180*Math.asin(n/e)/Math.PI}static crossTrack(t,e,s){const i=Ft.geoCircleCache[0].setAsGreatCircle(t,e);return isNaN(i.center[0])?NaN:gt.GA_RADIAN.convertTo(i.distance(s),gt.NMILE)}static alongTrack(t,e,s){const i=Ft.geoCircleCache[0].setAsGreatCircle(t,e);if(isNaN(i.center[0]))return NaN;const n=i.distanceAlong(t,i.closest(s,Ft.vec3Cache[0]));return gt.GA_RADIAN.convertTo((n+Math.PI)%(2*Math.PI)-Math.PI,gt.NMILE)}static desiredTrack(t,e,s){const i=Ft.geoCircleCache[0].setAsGreatCircle(t,e);return isNaN(i.center[0])?NaN:i.bearingAt(i.closest(s,Ft.vec3Cache[0]))}static desiredTrackArc(t,e,s){const i=Ft.geoPointCache[0].set(s).bearingFrom(t);return Ft.angleToHeading(i,e)}static percentAlongTrackArc(t,e,s,i,n){const r="right"===i?1:-1,a=((e-t)*r+360)%360;return((Ft.geoPointCache[0].set(s).bearingTo(n)-(t+a/2*r+360)%360+540)%360-180)*r/a+.5}static positionAlongArc(t,e,s,i,n,r){const a=gt.GA_RADIAN.convertTo(Math.sin(gt.METER.convertTo(s,gt.GA_RADIAN)),gt.METER),o=gt.RADIAN.convertTo(n/a,gt.DEGREE),c="right"===i?t+o:t-o;return e.offset(Ft.normalizeHeading(c),gt.METER.convertTo(s,gt.GA_RADIAN),r),r}static crossTrackArc(t,e,s){return gt.METER.convertTo(e,gt.NMILE)-gt.GA_RADIAN.convertTo(Ft.geoPointCache[0].set(s).distance(t),gt.NMILE)}static diffAngle(t,e){let s=e-t;for(;s>180;)s-=360;for(;s<=-180;)s+=360;return s}static napierSide(t,e,s,i){return 2*Math.atan(Math.tan(.5*(t-e))*(Math.sin(.5*(s+i))/Math.sin(.5*(s-i))))}static normal(t,e,s){const i=Ft.headingToAngle(t,e),n=Ft.degreesNorthToPolar(i);s[0]=Math.cos(n),s[1]=Math.sin(n)}}Ft.vec3Cache=[new Float64Array(3)],Ft.geoPointCache=[new wt(0,0),new wt(0,0)],Ft.geoCircleCache=[new Lt(new Float64Array(3),0)];class Mt{static get(t,e){return Mt.getMagVar(t,e)}static magneticToTrue(t,e,s){return Ft.normalizeHeading(t+("number"==typeof e&&void 0===s?e:Mt.getMagVar(e,s)))}static trueToMagnetic(t,e,s){return Ft.normalizeHeading(t-("number"==typeof e&&void 0===s?e:Mt.getMagVar(e,s)))}static getMagVar(t,e){if("undefined"==typeof Facilities)return 0;let s,i;return"number"==typeof t?(s=t,i=e):(s=t.lat,i=t.lon),Facilities.getMagVar(s,i)}}!function(t){t[t.None=0]="None",t[t.ATIS=1]="ATIS",t[t.Multicom=2]="Multicom",t[t.Unicom=3]="Unicom",t[t.CTAF=4]="CTAF",t[t.Ground=5]="Ground",t[t.Tower=6]="Tower",t[t.Clearance=7]="Clearance",t[t.Approach=8]="Approach",t[t.Departure=9]="Departure",t[t.Center=10]="Center",t[t.FSS=11]="FSS",t[t.AWOS=12]="AWOS",t[t.ASOS=13]="ASOS",t[t.CPT=14]="CPT",t[t.GCO=15]="GCO"}(P||(P={})),function(t){t[t.APPROACH_TYPE_VISUAL=99]="APPROACH_TYPE_VISUAL"}(I||(I={})),function(t){t[t.None=0]="None",t[t.IAF=1]="IAF",t[t.IF=2]="IF",t[t.MAP=4]="MAP",t[t.FAF=8]="FAF",t[t.MAHP=16]="MAHP"}(N||(N={})),function(t){t[t.None=0]="None",t[t.LNAV=1]="LNAV",t[t.LNAVVNAV=2]="LNAVVNAV",t[t.LP=4]="LP",t[t.LPV=8]="LPV"}(w||(w={})),function(t){t[t.None=0]="None",t[t.HardSurface=1]="HardSurface",t[t.SoftSurface=2]="SoftSurface",t[t.AllWater=3]="AllWater",t[t.HeliportOnly=4]="HeliportOnly",t[t.Private=5]="Private"}(L||(L={})),function(t){t[t.None=0]="None",t[t.HardSurface=2]="HardSurface",t[t.SoftSurface=4]="SoftSurface",t[t.AllWater=8]="AllWater",t[t.HeliportOnly=16]="HeliportOnly",t[t.Private=32]="Private"}(F||(F={})),function(t){t[t.None=0]="None",t[t.Named=1]="Named",t[t.Unnamed=2]="Unnamed",t[t.Vor=3]="Vor",t[t.NDB=4]="NDB",t[t.Offroute=5]="Offroute",t[t.IAF=6]="IAF",t[t.FAF=7]="FAF",t[t.RNAV=8]="RNAV",t[t.VFR=9]="VFR"}(M||(M={})),function(t){t[t.RADIAL_RADIAL=0]="RADIAL_RADIAL",t[t.RADIAL_DISTANCE=1]="RADIAL_DISTANCE",t[t.LAT_LONG=2]="LAT_LONG"}(D||(D={})),function(t){t[t.Unknown=0]="Unknown",t[t.AF=1]="AF",t[t.CA=2]="CA",t[t.CD=3]="CD",t[t.CF=4]="CF",t[t.CI=5]="CI",t[t.CR=6]="CR",t[t.DF=7]="DF",t[t.FA=8]="FA",t[t.FC=9]="FC",t[t.FD=10]="FD",t[t.FM=11]="FM",t[t.HA=12]="HA",t[t.HF=13]="HF",t[t.HM=14]="HM",t[t.IF=15]="IF",t[t.PI=16]="PI",t[t.RF=17]="RF",t[t.TF=18]="TF",t[t.VA=19]="VA",t[t.VD=20]="VD",t[t.VI=21]="VI",t[t.VM=22]="VM",t[t.VR=23]="VR",t[t.Discontinuity=99]="Discontinuity",t[t.ThruDiscontinuity=100]="ThruDiscontinuity"}(O||(O={})),function(t){t[t.Unused=0]="Unused",t[t.At=1]="At",t[t.AtOrAbove=2]="AtOrAbove",t[t.AtOrBelow=3]="AtOrBelow",t[t.Between=4]="Between"}(U||(U={})),function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Either=3]="Either"}(V||(V={})),function(t){t[t.None=0]="None",t[t.Victor=1]="Victor",t[t.Jet=2]="Jet",t[t.Both=3]="Both"}(x||(x={})),function(t){t[t.CompassPoint=0]="CompassPoint",t[t.MH=1]="MH",t[t.H=2]="H",t[t.HH=3]="HH"}(G||(G={})),function(t){t[t.Unknown=0]="Unknown",t[t.VOR=1]="VOR",t[t.VORDME=2]="VORDME",t[t.DME=3]="DME",t[t.TACAN=4]="TACAN",t[t.VORTAC=5]="VORTAC",t[t.ILS=6]="ILS",t[t.VOT=7]="VOT"}(k||(k={})),function(t){t[t.Concrete=0]="Concrete",t[t.Grass=1]="Grass",t[t.WaterFSX=2]="WaterFSX",t[t.GrassBumpy=3]="GrassBumpy",t[t.Asphalt=4]="Asphalt",t[t.ShortGrass=5]="ShortGrass",t[t.LongGrass=6]="LongGrass",t[t.HardTurf=7]="HardTurf",t[t.Snow=8]="Snow",t[t.Ice=9]="Ice",t[t.Urban=10]="Urban",t[t.Forest=11]="Forest",t[t.Dirt=12]="Dirt",t[t.Coral=13]="Coral",t[t.Gravel=14]="Gravel",t[t.OilTreated=15]="OilTreated",t[t.SteelMats=16]="SteelMats",t[t.Bituminous=17]="Bituminous",t[t.Brick=18]="Brick",t[t.Macadam=19]="Macadam",t[t.Planks=20]="Planks",t[t.Sand=21]="Sand",t[t.Shale=22]="Shale",t[t.Tarmac=23]="Tarmac",t[t.WrightFlyerTrack=24]="WrightFlyerTrack",t[t.Ocean=26]="Ocean",t[t.Water=27]="Water",t[t.Pond=28]="Pond",t[t.Lake=29]="Lake",t[t.River=30]="River",t[t.WasteWater=31]="WasteWater",t[t.Paint=32]="Paint"}(B||(B={})),function(t){t[t.Unknown=0]="Unknown",t[t.None=1]="None",t[t.PartTime=2]="PartTime",t[t.FullTime=3]="FullTime",t[t.Frequency=4]="Frequency"}(H||(H={})),function(t){t[t.Uknown=0]="Uknown",t[t.Public=1]="Public",t[t.Military=2]="Military",t[t.Private=3]="Private"}(W||(W={})),function(t){t[t.Unknown=0]="Unknown",t[t.No=1]="No",t[t.Yes=2]="Yes"}(j||(j={})),function(t){t[t.Unknown=0]="Unknown",t[t.Terminal=1]="Terminal",t[t.LowAlt=2]="LowAlt",t[t.HighAlt=3]="HighAlt",t[t.ILS=4]="ILS",t[t.VOT=5]="VOT"}($||($={})),function(t){t.Airport="LOAD_AIRPORT",t.Intersection="LOAD_INTERSECTION",t.VOR="LOAD_VOR",t.NDB="LOAD_NDB",t.USR="USR",t.RWY="RWY",t.VIS="VIS"}(Y||(Y={})),function(t){t[t.All=0]="All",t[t.Airport=1]="Airport",t[t.Intersection=2]="Intersection",t[t.Vor=3]="Vor",t[t.Ndb=4]="Ndb",t[t.Boundary=5]="Boundary",t[t.User=6]="User",t[t.Visual=7]="Visual",t[t.AllExceptVisual=8]="AllExceptVisual"}(z||(z={})),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.ClassA=2]="ClassA",t[t.ClassB=3]="ClassB",t[t.ClassC=4]="ClassC",t[t.ClassD=5]="ClassD",t[t.ClassE=6]="ClassE",t[t.ClassF=7]="ClassF",t[t.ClassG=8]="ClassG",t[t.Tower=9]="Tower",t[t.Clearance=10]="Clearance",t[t.Ground=11]="Ground",t[t.Departure=12]="Departure",t[t.Approach=13]="Approach",t[t.MOA=14]="MOA",t[t.Restricted=15]="Restricted",t[t.Prohibited=16]="Prohibited",t[t.Warning=17]="Warning",t[t.Alert=18]="Alert",t[t.Danger=19]="Danger",t[t.NationalPark=20]="NationalPark",t[t.ModeC=21]="ModeC",t[t.Radar=22]="Radar",t[t.Training=23]="Training"}(q||(q={})),function(t){t[t.Unknown=0]="Unknown",t[t.MSL=1]="MSL",t[t.AGL=2]="AGL",t[t.Unlimited=3]="Unlimited"}(K||(K={})),function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.Line=2]="Line",t[t.Origin=3]="Origin",t[t.ArcCW=4]="ArcCW",t[t.ArcCCW=5]="ArcCCW",t[t.Circle=6]="Circle"}(X||(X={})),function(t){t[t.Knot=0]="Knot",t[t.MeterPerSecond=1]="MeterPerSecond",t[t.KilometerPerHour=2]="KilometerPerHour"}(Q||(Q={})),function(t){t[t.Meter=0]="Meter",t[t.StatuteMile=1]="StatuteMile"}(Z||(Z={})),function(t){t[t.SkyClear=0]="SkyClear",t[t.Clear=1]="Clear",t[t.NoSignificant=2]="NoSignificant",t[t.Few=3]="Few",t[t.Scattered=4]="Scattered",t[t.Broken=5]="Broken",t[t.Overcast=6]="Overcast"}(J||(J={})),function(t){t[t.Unspecified=-1]="Unspecified",t[t.ToweringCumulus=0]="ToweringCumulus",t[t.Cumulonimbus=1]="Cumulonimbus",t[t.AltocumulusCastellanus=2]="AltocumulusCastellanus"}(tt||(tt={})),function(t){t[t.None=0]="None",t[t.Mist=1]="Mist",t[t.Duststorm=2]="Duststorm",t[t.Dust=3]="Dust",t[t.Drizzle=4]="Drizzle",t[t.FunnelCloud=5]="FunnelCloud",t[t.Fog=6]="Fog",t[t.Smoke=7]="Smoke",t[t.Hail=8]="Hail",t[t.SmallHail=9]="SmallHail",t[t.Haze=10]="Haze",t[t.IceCrystals=11]="IceCrystals",t[t.IcePellets=12]="IcePellets",t[t.DustSandWhorls=13]="DustSandWhorls",t[t.Spray=14]="Spray",t[t.Rain=15]="Rain",t[t.Sand=16]="Sand",t[t.SnowGrains=17]="SnowGrains",t[t.Shower=18]="Shower",t[t.Snow=19]="Snow",t[t.Squalls=20]="Squalls",t[t.Sandstorm=21]="Sandstorm",t[t.UnknownPrecip=22]="UnknownPrecip",t[t.VolcanicAsh=23]="VolcanicAsh"}(et||(et={})),function(t){t[t.Light=-1]="Light",t[t.Normal=0]="Normal",t[t.Heavy=1]="Heavy"}(st||(st={}));class Dt{static getFacilityType(t){switch(t[0]){case"A":return Y.Airport;case"W":return Y.Intersection;case"V":return Y.VOR;case"N":return Y.NDB;case"U":return Y.USR;case"R":return Y.RWY;case"S":return Y.VIS;default:throw new Error(`ICAO ${t} has unknown type: ${t[0]}`)}}static getAssociatedAirportIdent(t){return t.substr(3,4).trim()}static isFacility(t,e){switch(t[0]){case"A":return void 0===e||e===Y.Airport;case"W":return void 0===e||e===Y.Intersection;case"V":return void 0===e||e===Y.VOR;case"N":return void 0===e||e===Y.NDB;case"U":return void 0===e||e===Y.USR;case"R":return void 0===e||e===Y.RWY;case"S":return void 0===e||e===Y.VIS;default:return!1}}static getIdent(t){return t.substr(7).trim()}static getRegionCode(t){return t.substr(1,2).trim()}}Dt.emptyIcao=" ";class Ot{static isFacilityType(t,e){return"JS_FacilityIntersection"===t.__Type?e===Y.Intersection:Dt.isFacility(t.icao,e)}static getMagVar(t){return Ot.isFacilityType(t,Y.VOR)?-t.magneticVariation:Mt.get(t.lat,t.lon)}static getLatLonFromRadialDistance(t,e,s,i){return Ot.geoPointCache[0].set(t).offset(Mt.magneticToTrue(e,Ot.getMagVar(t)),gt.NMILE.convertTo(s,gt.GA_RADIAN),i)}static getLatLonFromRadialRadial(t,e,s,i,n){const r=Ot.getMagVar(t),a=Ot.getMagVar(s),o=Ot.geoCircleCache[0].setAsGreatCircle(t,Mt.magneticToTrue(e,r)),c=Ot.geoCircleCache[1].setAsGreatCircle(s,Mt.magneticToTrue(i,a)),h=o.includes(s),l=c.includes(t);if(h&&l)return n.set(NaN,NaN);if(h)return o.angleAlong(t,s,Math.PI)Ut.getOneWayRunways(t,e))).forEach((t=>{e.push(t[0]),e.push(t[1])})),e.sort(Ut.sortRunways),e}static getOneWayRunways(t,e){const s=[],i=t.designation.split("-");for(let n=0;nt.designation===e));if(s)return s}}static matchOneWayRunwayFromIdent(t,e){return Ut.matchOneWayRunwayFromDesignation(t,e.substr(2).trim())}static getProceduresForRunway(t,e){const s=new Array,i=e.designation.split("-");for(let t=0;t-1)return t.frequencies[e]}}static getBcFrequency(t,e,s){const i=Ut.getOppositeOneWayRunway(t,e,s);if(i)return Ut.getLocFrequency(t,i)}static getOppositeOneWayRunway(t,e,s){const i=Math.round(Ft.normalizeHeading(10*(e+18))/10);let n=RunwayDesignator.RUNWAY_DESIGNATOR_NONE;switch(s){case RunwayDesignator.RUNWAY_DESIGNATOR_LEFT:n=RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT;break;case RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT:n=RunwayDesignator.RUNWAY_DESIGNATOR_LEFT;break;default:n=s}return Ut.matchOneWayRunway(t,i,n)}static sortRunways(t,e){if(t.direction===e.direction){let s=0;-1!=t.designation.indexOf("L")?s=1:-1!=t.designation.indexOf("C")?s=2:-1!=t.designation.indexOf("R")&&(s=3);let i=0;return-1!=e.designation.indexOf("L")?i=1:-1!=e.designation.indexOf("C")?i=2:-1!=e.designation.indexOf("R")&&(i=3),s-i}return t.direction-e.direction}static getRunwayFacilityIcao(t,e){return`R ${("string"==typeof t?t:t.icao).substring(7,11)}RW${e.designation.padEnd(3," ")}`}static createRunwayFacility(t,e){return{icao:Ut.getRunwayFacilityIcao(t,e),name:`Runway ${e.designation}`,region:t.region,city:t.city,lat:e.latitude,lon:e.longitude,magvar:t.magvar,runway:e}}static getRunwayCode(t){const e=Math.round(t);return String.fromCharCode(48+e+(e>9?7:0))}static getSurfaceCategory(t){const e="object"==typeof t?t.surface:t;return this.SURFACES_HARD.includes(e)?it.Hard:this.SURFACES_SOFT.includes(e)?it.Soft:this.SURFACES_WATER.includes(e)?it.Water:it.Unknown}}Ut.RUNWAY_DESIGNATOR_LETTERS={[RunwayDesignator.RUNWAY_DESIGNATOR_NONE]:"",[RunwayDesignator.RUNWAY_DESIGNATOR_LEFT]:"L",[RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT]:"R",[RunwayDesignator.RUNWAY_DESIGNATOR_CENTER]:"C",[RunwayDesignator.RUNWAY_DESIGNATOR_WATER]:"W",[RunwayDesignator.RUNWAY_DESIGNATOR_A]:"A",[RunwayDesignator.RUNWAY_DESIGNATOR_B]:"B"},Ut.SURFACES_HARD=[B.Asphalt,B.Bituminous,B.Brick,B.Concrete,B.Ice,B.Macadam,B.Paint,B.Planks,B.SteelMats,B.Tarmac,B.Urban],Ut.SURFACES_SOFT=[B.Coral,B.Dirt,B.Forest,B.Grass,B.GrassBumpy,B.Gravel,B.HardTurf,B.LongGrass,B.OilTreated,B.Sand,B.Shale,B.ShortGrass,B.Snow,B.WrightFlyerTrack],Ut.SURFACES_WATER=[B.WaterFSX,B.Lake,B.Ocean,B.Pond,B.River,B.WasteWater,B.Water],Ut.tempGeoPoint=new wt(0,0),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.ClassA=2]="ClassA",t[t.ClassB=3]="ClassB",t[t.ClassC=4]="ClassC",t[t.ClassD=5]="ClassD",t[t.ClassE=6]="ClassE",t[t.ClassF=7]="ClassF",t[t.ClassG=8]="ClassG",t[t.Tower=9]="Tower",t[t.Clearance=10]="Clearance",t[t.Ground=11]="Ground",t[t.Departure=12]="Departure",t[t.Approach=13]="Approach",t[t.MOA=14]="MOA",t[t.Restricted=15]="Restricted",t[t.Prohibited=16]="Prohibited",t[t.Warning=17]="Warning",t[t.Alert=18]="Alert",t[t.Danger=19]="Danger",t[t.Nationalpark=20]="Nationalpark",t[t.ModeC=21]="ModeC",t[t.Radar=22]="Radar",t[t.Training=23]="Training",t[t.Max=24]="Max"}(nt||(nt={})),function(t){t[t.LogicOn=1]="LogicOn",t[t.APOn=2]="APOn",t[t.FDOn=4]="FDOn",t[t.FLC=8]="FLC",t[t.Alt=16]="Alt",t[t.AltArm=32]="AltArm",t[t.GS=64]="GS",t[t.GSArm=128]="GSArm",t[t.Pitch=256]="Pitch",t[t.VS=512]="VS",t[t.Heading=1024]="Heading",t[t.Nav=2048]="Nav",t[t.NavArm=4096]="NavArm",t[t.WingLevel=8192]="WingLevel",t[t.Attitude=16384]="Attitude",t[t.ThrottleSpd=32768]="ThrottleSpd",t[t.ThrottleMach=65536]="ThrottleMach",t[t.ATArm=131072]="ATArm",t[t.YD=262144]="YD",t[t.EngineRPM=524288]="EngineRPM",t[t.TOGAPower=1048576]="TOGAPower",t[t.Autoland=2097152]="Autoland",t[t.TOGAPitch=4194304]="TOGAPitch",t[t.Bank=8388608]="Bank",t[t.FBW=16777216]="FBW",t[t.AvionicsManaged=33554432]="AvionicsManaged",t[t.None=-2147483648]="None"}(rt||(rt={}));const Vt=new RegExp(/^A../);Y.Airport,z.Airport,Y.Intersection,z.Intersection,Y.NDB,z.Ndb,Y.VOR,z.Vor,Y.USR,z.User,Y.VIS,z.Visual;class xt{constructor(t,e=()=>{}){this.facilityRepo=t,this.onInitialized=e,void 0===xt.facilityListener&&(xt.facilityListener=RegisterViewListener("JS_LISTENER_FACILITY",(()=>{xt.facilityListener.on("SendAirport",xt.onFacilityReceived),xt.facilityListener.on("SendIntersection",xt.onFacilityReceived),xt.facilityListener.on("SendVor",xt.onFacilityReceived),xt.facilityListener.on("SendNdb",xt.onFacilityReceived),xt.facilityListener.on("NearestSearchCompleted",xt.onNearestSearchCompleted),setTimeout((()=>xt.init()),2e3)}),!0)),this.awaitInitialization().then((()=>this.onInitialized()))}static init(){xt.isInitialized=!0;for(const t of this.initPromiseResolveQueue)t();this.initPromiseResolveQueue.length=0}awaitInitialization(){return xt.isInitialized?Promise.resolve():new Promise((t=>{xt.initPromiseResolveQueue.push(t)}))}getFacility(t,e){switch(t){case Y.USR:case Y.RWY:case Y.VIS:return this.getFacilityFromRepo(t,e);default:return this.getFacilityFromCoherent(t,e)}}async getFacilityFromRepo(t,e){const s=this.facilityRepo.get(e);if(s)return s;if(t===Y.RWY)try{const t=await this.getFacility(Y.Airport,`A ${e.substr(3,4)} `),s=Ut.matchOneWayRunwayFromIdent(t,Dt.getIdent(e));if(s){const e=Ut.createRunwayFacility(t,s);return this.facilityRepo.add(e),e}}catch(t){}throw`Facility ${e} could not be found.`}async getFacilityFromCoherent(t,e){const s=Dt.getFacilityType(e)!==t;t===Y.Airport&&(e=e.replace(Vt,"A "));let i=xt.requestQueue,n=xt.facCache;s&&(i=xt.mismatchRequestQueue,n=xt.typeMismatchFacCache),xt.isInitialized||await this.awaitInitialization();const r=n.get(e);if(void 0!==r)return Promise.resolve(r);const a=Date.now();let o=i.get(e);if(void 0===o||a-o.timeStamp>1e4){let s,n;void 0!==o&&o.reject(`Facility request for ${e} has timed out.`);o={promise:new Promise(((r,a)=>{s=r,n=a,Coherent.call(t,e).then((t=>{t||(a(`Facility ${e} could not be found.`),i.delete(e))}))})),timeStamp:a,resolve:s,reject:n},i.set(e,o)}return o.promise}async getAirway(t,e,s){if(xt.airwayCache.has(t)){const e=xt.airwayCache.get(t);if(void 0!==(null==e?void 0:e.waypoints.find((t=>{t.icao})))&&void 0!==e)return e}const i=await this.getFacility(Y.Intersection,s),n=i.routes.find((e=>e.name===t));if(void 0!==n){const s=new Ps(i,n,this);if(await s.startBuild()===Yt.COMPLETE){const i=s.waypoints;if(null!==i){const s=new $t(t,e);return s.waypoints=[...i],xt.addToAirwayCache(s),s}}}throw new Error("Airway could not be found.")}async startNearestSearchSession(t){switch(t){case z.User:case z.Visual:return this.startRepoNearestSearchSession(t);case z.AllExceptVisual:return this.startCoherentNearestSearchSession(z.All);default:return this.startCoherentNearestSearchSession(t)}}async startCoherentNearestSearchSession(t){xt.isInitialized||await this.awaitInitialization();const e=await Coherent.call("START_NEAREST_SEARCH_SESSION",t);let s;switch(t){case z.Airport:s=new kt(e);break;case z.Intersection:s=new Bt(e);break;case z.Vor:s=new Ht(e);break;case z.Boundary:s=new Wt(e);break;default:s=new Gt(e)}return xt.searchSessions.set(e,s),s}startRepoNearestSearchSession(t){const e=xt.repoSearchSessionId--;switch(t){case z.User:case z.Visual:return new jt(this.facilityRepo,e);default:throw new Error}}async getMetar(t){xt.isInitialized||await this.awaitInitialization();const e="string"==typeof t?t:Dt.getIdent(t.icao),s=await Coherent.call("GET_METAR_BY_IDENT",e);return xt.cleanMetar(s)}async searchMetar(t,e){xt.isInitialized||await this.awaitInitialization();const s=await Coherent.call("GET_METAR_BY_LATLON",t,e);return xt.cleanMetar(s)}static cleanMetar(t){if(""!==t.icao)return t.gust<0&&delete t.gust,t.vertVis<0&&delete t.vertVis,isNaN(t.altimeterA)&&delete t.altimeterA,t.altimeterQ<0&&delete t.altimeterQ,isNaN(t.slp)&&delete t.slp,t.maxWindDir<0&&delete t.maxWindDir,t.minWindDir<0&&delete t.minWindDir,t.windDir<0&&delete t.windDir,t}async searchByIdent(t,e,s=40){let i;if(xt.isInitialized||await this.awaitInitialization(),t!==z.User&&t!==z.Visual){const n=t===z.AllExceptVisual?z.All:t;i=await Coherent.call("SEARCH_BY_IDENT",e,n,s)}else i=[];const n=xt.facRepositorySearchTypes[t];return n&&this.facilityRepo.forEach((t=>{const s=Dt.getIdent(t.icao);s===e?i.unshift(t.icao):s.startsWith(e)&&i.push(t.icao)}),n),i}async findNearestFacilitiesByIdent(t,e,s,i,n=40){const r=await this.searchByIdent(t,e,n);if(!r)return[];const a=[];for(let t=0;t1?(o.sort(((t,e)=>wt.distance(s,i,t.lat,t.lon)-wt.distance(s,i,e.lat,e.lon))),o):1===o.length?o:[]}static onFacilityReceived(t){const e="JS_FacilityIntersection"===t.__Type&&"W"!==t.icao[0],s=e?xt.mismatchRequestQueue:xt.requestQueue,i=s.get(t.icao);void 0!==i&&(i.resolve(t),xt.addToFacilityCache(t,e),s.delete(t.icao))}static onNearestSearchCompleted(t){const e=xt.searchSessions.get(t.sessionId);e instanceof Gt&&e.onSearchCompleted(t)}static addToFacilityCache(t,e){const s=e?xt.typeMismatchFacCache:xt.facCache;s.set(t.icao,t),s.size>xt.MAX_FACILITY_CACHE_ITEMS&&s.delete(s.keys().next().value)}static addToAirwayCache(t){xt.airwayCache.set(t.name,t),xt.airwayCache.size>xt.MAX_AIRWAY_CACHE_ITEMS&&xt.airwayCache.delete(xt.airwayCache.keys().next().value)}static getDatabaseCycles(){if(void 0===xt.databaseCycleCache){const t=SimVar.GetGameVarValue("FLIGHT NAVDATA DATE RANGE",l.String);let e=ct.parseFacilitiesCycle(t);void 0===e&&(console.error("FacilityLoader: Could not get facility database AIRAC cycle! Falling back to current cycle."),e=ct.getCurrentCycle(new Date));const s=ct.getOffsetCycle(e,-1),i=ct.getOffsetCycle(e,1);xt.databaseCycleCache={previous:s,current:e,next:i}}return xt.databaseCycleCache}}xt.MAX_FACILITY_CACHE_ITEMS=1e3,xt.MAX_AIRWAY_CACHE_ITEMS=1e3,xt.requestQueue=new Map,xt.mismatchRequestQueue=new Map,xt.facCache=new Map,xt.typeMismatchFacCache=new Map,xt.airwayCache=new Map,xt.searchSessions=new Map,xt.facRepositorySearchTypes={[z.All]:[Y.USR,Y.VIS],[z.User]:[Y.USR],[z.Visual]:[Y.VIS],[z.AllExceptVisual]:[Y.USR]},xt.repoSearchSessionId=-1,xt.isInitialized=!1,xt.initPromiseResolveQueue=[];class Gt{constructor(t){this.sessionId=t,this.searchQueue=new Map}searchNearest(t,e,s,i){const n=new Promise((r=>{Coherent.call("SEARCH_NEAREST",this.sessionId,t,e,s,i).then((t=>{this.searchQueue.set(t,{promise:n,resolve:r})}))}));return n}onSearchCompleted(t){const e=this.searchQueue.get(t.searchId);void 0!==e&&(e.resolve(t),this.searchQueue.delete(t.searchId))}}class kt extends Gt{setAirportFilter(t,e){Coherent.call("SET_NEAREST_AIRPORT_FILTER",this.sessionId,t?1:0,e)}setExtendedAirportFilters(t,e,s,i){Coherent.call("SET_NEAREST_EXTENDED_AIRPORT_FILTERS",this.sessionId,t,e,s,i)}}kt.Defaults={ShowClosed:!1,ClassMask:lt.union(lt.createFlag(L.HardSurface),lt.createFlag(L.SoftSurface),lt.createFlag(L.AllWater),lt.createFlag(L.HeliportOnly),lt.createFlag(L.Private)),SurfaceTypeMask:2147483647,ApproachTypeMask:2147483647,MinimumRunwayLength:0,ToweredMask:3};class Bt extends Gt{setIntersectionFilter(t,e=!0){Coherent.call("SET_NEAREST_INTERSECTION_FILTER",this.sessionId,t,e?1:0)}}Bt.Defaults={TypeMask:lt.union(lt.createFlag(M.Named),lt.createFlag(M.Unnamed),lt.createFlag(M.Offroute),lt.createFlag(M.IAF),lt.createFlag(M.FAF))};class Ht extends Gt{setVorFilter(t,e){Coherent.call("SET_NEAREST_VOR_FILTER",this.sessionId,t,e)}}Ht.Defaults={ClassMask:lt.union(lt.createFlag($.Terminal),lt.createFlag($.HighAlt),lt.createFlag($.LowAlt)),TypeMask:lt.union(lt.createFlag(k.VOR),lt.createFlag(k.DME),lt.createFlag(k.VORDME),lt.createFlag(k.VORTAC),lt.createFlag(k.TACAN))};class Wt extends Gt{setBoundaryFilter(t){Coherent.call("SET_NEAREST_BOUNDARY_FILTER",this.sessionId,t)}}class jt{constructor(t,e){this.repo=t,this.sessionId=e,this.filter=void 0,this.cachedResults=new Set,this.searchId=0}searchNearest(t,e,s,i){const n=gt.METER.convertTo(s,gt.GA_RADIAN),r=this.repo.search(Y.USR,t,e,n,i,[],this.filter),a=[];for(let t=0;t0&&" "!=n[0]&&null!==this._waypointsArray&&!this._waypointsArray.find((t=>t.icao===n))){const t=await this.facilityLoader.getFacility(Y.Intersection,n);e(t);const r=t.routes.find((t=>t.name===i.name));void 0!==r?i=r:s=!0}else s=!0}}async _stepForward(){if(null!==this._waypointsArray)return this._step(!0,this._waypointsArray.push.bind(this._waypointsArray))}async _stepBackward(){if(null!==this._waypointsArray)return this._step(!1,this._waypointsArray.unshift.bind(this._waypointsArray))}setWaypointsArray(t){this._waypointsArray=t}startBuild(){return this.hasStarted?Promise.reject(new Error("Airway builder has already started building.")):new Promise((t=>{this._hasStarted=!0,null!==this._waypointsArray&&(this._waypointsArray.push(this._initialWaypoint),Promise.all([this._stepForward(),this._stepBackward()]).then((()=>{this._isDone=!0,t(Yt.COMPLETE)})).catch((()=>{this._isDone=!0,t(Yt.PARTIAL)})))}))}}class Is{static create(t,e){const s=[];for(let i=0;i=t.length)throw new RangeError;return t[e]}static peekAt(t,e){return e<0&&(e+=t.length),t[e]}static first(t){if(0===t.length)throw new RangeError;return t[0]}static peekFirst(t){return t[0]}static last(t){if(0===t.length)throw new RangeError;return t[t.length-1]}static peekLast(t){return t[t.length-1]}static includes(t,e,s){return t.includes(e,s)}static equals(t,e,s=Is.STRICT_EQUALS){if(t.length!==e.length)return!1;for(let i=0;i0)){const n=i?-1:1;for(;a+n>=0&&a+ne.length>t?e.length:t),0)}}Is.STRICT_EQUALS=(t,e)=>t===e;class Ns{get size(){return this.tree.length}constructor(t){this.comparator=t,this.tree=[]}findMin(){return this.tree[0]}removeMin(){if(0===this.tree.length)return;const t=this.tree[0];return this.swap(0,this.tree.length-1),this.tree.length--,this.heapifyDown(0),t}insert(t){return this.tree.push(t),this.heapifyUp(this.tree.length-1),this}insertAndRemoveMin(t){return 0===this.tree.length||this.comparator(t,this.tree[0])<=0?t:this.removeMinAndInsert(t)}removeMinAndInsert(t){const e=this.tree[0];return this.tree[0]=t,this.heapifyDown(0),e}clear(){return this.tree.length=0,this}heapifyUp(t){let e=Ns.parent(t);for(;e>=0&&this.comparator(this.tree[t],this.tree[e])<0;)this.swap(e,t),t=e,e=Ns.parent(t)}heapifyDown(t){const e=this.tree.length;for(;t0&&(n|=1),i0&&(n|=2),3===n&&(n=this.comparator(this.tree[s],this.tree[i])<=0?1:2),0===n)break;const r=1===n?s:i;this.swap(t,r),t=r}}swap(t,e){const s=this.tree[t];this.tree[t]=this.tree[e],this.tree[e]=s}static parent(t){return t-1>>1}static left(t){return 2*t+1}static right(t){return 2*t+2}}class ws{get size(){return this.elements.length}constructor(t,e){if(this.keyFunc=e,this.elements=[],this.keys=[],this.nodes=[],this.minDepth=-1,this.maxDepth=-1,this.dimensionCount=Math.trunc(t),this.dimensionCount<2)throw new Error(`KdTree: cannot create a tree with ${this.dimensionCount} dimensions.`);this.indexArrays=Array.from({length:this.dimensionCount+1},(()=>[])),this.indexSortFuncs=Array.from({length:this.dimensionCount},((t,e)=>(t,s)=>{const i=this.keys[t],n=this.keys[s];for(let t=0;tn[s])return 1}return 0})),this.keyCache=[new Float64Array(this.dimensionCount)]}searchKey(t,e,s,i,n){if("number"==typeof s)return this.doResultsSearch(void 0,t,e,s,i,n);this.doVisitorSearch(void 0,t,e,s)}search(t,e,s,i,n){const r=this.keyFunc(t,this.keyCache[0]);if("number"==typeof s)return this.doResultsSearch(t,r,e,s,i,n);this.doVisitorSearch(t,r,e,s)}doVisitorSearch(t,e,s,i){this.searchTree(t,e,s,0,0,((t,e,s,n,r,a)=>i(e,s,n,r,a)),((t,e,s)=>e+t*s>=0))}doResultsSearch(t,e,s,i,n,r){if(i<=0)return n.length=0,n;const a=new Ns(((t,s)=>ws.distance(e,this.keys[s],this.dimensionCount)-ws.distance(e,this.keys[t],this.dimensionCount)));this.searchTree(t,e,s,0,0,((t,e,s,n,o,c)=>(r&&!r(e,s,n,o,c)||(a.size===i?a.insertAndRemoveMin(t):a.insert(t)),!0)),((t,s,n)=>{let r=s;return a.size===i&&(r=Math.min(r,ws.distance(e,this.keys[a.findMin()],this.dimensionCount))),r+t*n>=0})),n.length=a.size;for(let t=n.length-1;t>=0;t--)n[t]=this.elements[a.removeMin()];return n}searchTree(t,e,s,i,n,r,a){const o=this.nodes[i];if(void 0===o)return!0;const c=this.keys[o],h=ws.distance(e,c,this.dimensionCount);if(h<=s&&!r(o,this.elements[o],c,h,e,t))return!1;const l=e[n]-c[n],u=(n+1)%this.dimensionCount,d=ws.lesser(i),p=ws.greater(i);return!(void 0!==this.nodes[d]&&a(l,s,-1)&&!this.searchTree(t,e,s,d,u,r,a))&&!(void 0!==this.nodes[p]&&a(l,s,1)&&!this.searchTree(t,e,s,p,u,r,a))}insert(t){const e=this.insertElementInTree(t)+1;this.maxDepth=Math.max(this.maxDepth,e),e===this.minDepth+1&&(this.minDepth=ws.depth(this.nodes.indexOf(void 0,ws.leastIndexAtDepth(Math.max(0,this.minDepth))))),this.maxDepth+1>2*(this.minDepth+1)&&this.rebuild()}insertAll(t){for(const e of t){this.elements.push(e),this.keys.push(this.keyFunc(e,new Float64Array(this.dimensionCount)));const t=this.elements.length-1;for(let e=0;e=s&&(this.nodes[ws.lesser(t)]=r[e]),void(n>1}static lesser(t){return 2*t+1}static greater(t){return 2*t+2}static leastIndexAtDepth(t){return 1<=this.maxDepth)return y;const v=St.set(n,r,a,this.vec3Cache[0]),_=St.set(u,d,p,this.vec3Cache[1]),b=e.angleAlong(v,_,Math.PI);if(b<=Lt.ANGULAR_TOLERANCE)return y;const T=e.offsetAngleAlong(v,b/2,this.vec3Cache[2]),S=Tt.set(o,c,this.vec2Cache[0]),C=Tt.set(f,m,this.vec2Cache[1]),R=Tt.sub(C,S,this.vec2Cache[2]),E=Tt.dot(R,R),P=this.geoPointCache[0].setFromCartesian(T),I=t.project(P,this.vec2Cache[2]),N=P.lat,w=P.lon,L=T[0],F=T[1],M=T[2],D=I[0],O=I[1],U=f-o,V=m-c,x=o*o-f*f+c*c-m*m,G=D-o,k=O-c,B=o*o-D*D+c*c-O*O,H=2*(U*k-V*G);if(H*H/4/E>this.dpTolSq){const t=(V*B-x*k)/H,e=(x*G-U*B)/H,s=Math.hypot(t-o,e-c),i=St.set(U,V,0,this.vec3Cache[3]),n=St.set(D-t,O-e,0,this.vec3Cache[4]),r=St.cross(i,n,this.vec3Cache[4]);y.vectorType="arc",y.arcCenterX=t,y.arcCenterY=e,y.arcRadius=s,y.isArcCounterClockwise=r[2]>0}else y.vectorType="line";if(St.dot(v,T)>this.cosMinDistance){if("line"===y.vectorType)return y;const s=e.offsetAngleAlong(v,b/4,this.geoPointCache[0]),i=t.project(s,this.vec2Cache[0]);let n=Math.hypot(i[0]-y.arcCenterX,i[1]-y.arcCenterY);if((n-y.arcRadius)*(n-y.arcRadius)<=this.dpTolSq&&(e.offsetAngleAlong(v,3*b/4,s),t.project(s,i),n=Math.hypot(i[0]-y.arcCenterX,i[1]-y.arcCenterY),(n-y.arcRadius)*(n-y.arcRadius)<=this.dpTolSq))return y}return y=this.resampleHelper(t,e,s,i,n,r,a,o,c,N,w,L,F,M,D,O,A,g+1,y),this.callHandler(A,N,w,D,O,y),y.index++,y.prevX=D,y.prevY=O,this.resampleHelper(t,e,N,w,L,F,M,D,O,h,l,u,d,p,f,m,A,g+1,y)}callHandler(t,e,s,i,n,r){let a;"line"===r.vectorType?a=this.lineVector:(a=this.arcVector,Tt.set(r.arcCenterX,r.arcCenterY,a.projectedArcCenter),a.projectedArcRadius=r.arcRadius,a.projectedArcStartAngle=Math.atan2(r.prevY-r.arcCenterY,r.prevX-r.arcCenterX),a.projectedArcEndAngle=Math.atan2(n-r.arcCenterY,i-r.arcCenterX),a.projectedArcEndAngle{const s=this.keyFunc(t,Vs.vec3Cache[0]);return e[0]=s[0],e[1]=s[1],e[2]=s[2],e}))}search(t,e,s,i,n,r){let a,o,c,h,l;"number"==typeof t?(a=wt.sphericalToCartesian(t,e,Vs.vec3Cache[1]),o=s,c=i,h=n,l=r):t instanceof Float64Array?(a=t,o=e,c=s,h=i,l=n):(a=wt.sphericalToCartesian(t,Vs.vec3Cache[1]),o=e,c=s,h=i,l=n);const u=Math.sqrt(2*(1-Math.cos(Utils.Clamp(o,0,Math.PI))));if("number"==typeof c)return this.doResultsSearch(a,u,c,h,l);this.doVisitorSearch(a,u,c)}doVisitorSearch(t,e,s){this.cartesianTree.searchKey(t,e,((e,i)=>{const n=St.set(i[0],i[1],i[2],Vs.vec3Cache[2]),r=wt.distance(n,t);return s(e,n,r,t)}))}doResultsSearch(t,e,s,i,n){const r=n?(e,s)=>{const i=St.set(s[0],s[1],s[2],Vs.vec3Cache[2]),r=wt.distance(i,t);return n(e,i,r,t)}:void 0;return this.cartesianTree.searchKey(t,e,s,i,r)}insert(t){this.cartesianTree.insert(t)}insertAll(t){this.cartesianTree.insertAll(t)}remove(t){return this.cartesianTree.remove(t)}removeAll(t){return this.cartesianTree.removeAll(t)}removeAndInsert(t,e){this.cartesianTree.removeAndInsert(t,e)}rebuild(){this.cartesianTree.rebuild()}clear(){this.cartesianTree.clear()}}Vs.vec3Cache=[new Float64Array(3),new Float64Array(3),new Float64Array(3),new Float64Array(3)],function(t){t.Added="Added",t.Removed="Removed",t.Cleared="Cleared"}(qt||(qt={}));class xs{constructor(){this.notifyDepth=0,this.initialNotifyFunc=this.initialNotify.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}sub(e,s=!1,i=!1){const n=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(n),i?n.pause():s&&n.initialNotify(),n}unsub(t){let e;this.singletonSub&&this.singletonSub.handler===t?e=this.singletonSub:this.subs&&(e=this.subs.find((e=>e.handler===t))),null==e||e.destroy()}get(t){const e=this.getArray();if(t>e.length-1)throw new Error("Index out of range");return e[t]}tryGet(t){return this.getArray()[t]}notify(t,e,s){const i=0===this.notifyDepth;let n=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isAlive&&!this.singletonSub.isPaused&&this.singletonSub.handler(t,e,s,this.getArray())}catch(t){console.error(`AbstractSubscribableArray: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(i)if(this.singletonSub)n=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}initialNotify(t){const e=this.getArray();t.handler(0,qt.Added,e,e)}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}}!function(t){t.Add="Add",t.Remove="Remove",t.DumpRequest="DumpRequest",t.DumpResponse="DumpResponse"}(Kt||(Kt={}));class Gs{constructor(t){this.bus=t,this.publisher=this.bus.getPublisher(),this.repos=new Map,this.trees={[Y.USR]:new Vs(Gs.treeKeyFunc),[Y.VIS]:new Vs(Gs.treeKeyFunc)},this.ignoreSync=!1,t.getSubscriber().on(Gs.SYNC_TOPIC).handle(this.onSyncEvent.bind(this)),this.pubSyncEvent({type:Kt.DumpRequest,uid:this.lastDumpRequestUid=Math.random()*Number.MAX_SAFE_INTEGER})}size(t){var e,s;let i=0;if(void 0===t)for(const t of this.repos.values())i+=t.size;else for(let n=0;n"object"==typeof t?t.icao:t))})}forEach(t,e){var s;if(void 0===e)for(const e of this.repos.values())e.forEach(t);else for(let i=0;iOt.isFacilityType(t,Y.USR)));if(n.length>0){const t=s.filter((t=>Ot.isFacilityType(t,Y.USR)));this.trees[Y.USR].removeAndInsert(t,n)}const r=t.filter((t=>Ot.isFacilityType(t,Y.VIS)));if(r.length>0){const t=s.filter((t=>Ot.isFacilityType(t,Y.VIS)));this.trees[Y.VIS].removeAndInsert(t,r)}for(let t=0;tOt.isFacilityType(t,Y.USR)));s.length>0&&this.trees[Y.USR].removeAll(s);const i=e.filter((t=>Ot.isFacilityType(t,Y.VIS)));i.length>0&&this.trees[Y.VIS].removeAll(i);for(let t=0;te.push(t))),this.pubSyncEvent({type:Kt.DumpResponse,uid:t.uid,facs:e})}}}static getRepository(t){var e;return null!==(e=Gs.INSTANCE)&&void 0!==e?e:Gs.INSTANCE=new Gs(t)}}Gs.SYNC_TOPIC="facilityrepo_sync",Gs.treeKeyFunc=(t,e)=>wt.sphericalToCartesian(t,e),function(t){t[t.Direct=0]="Direct",t[t.Teardrop=1]="Teardrop",t[t.Parallel=2]="Parallel",t[t.None=3]="None"}(Xt||(Xt={})),function(t){t[t.Faa=0]="Faa",t[t.Icao=1]="Icao"}(Qt||(Qt={})),new Map([[z.Airport,Y.Airport],[z.Intersection,Y.Intersection],[z.Vor,Y.VOR],[z.Ndb,Y.NDB],[z.User,Y.USR]]);class ks extends xs{constructor(t,e){super(),this.innerSubscription=t,this.sortFunc=(t,e)=>this.pos.distance(t)-this.pos.distance(e),this.facilities=[],this.derivedMaxItems=0,this.searchInProgress=!1,this.pos=new wt(0,0),this.diffMap=new Map,this.updatePromiseResolves=[],this.absoluteMaxItems=yt.toSubscribable(e,!0)}get length(){return this.facilities.length}getArray(){return this.facilities}get started(){return this.innerSubscription.started}awaitStart(){return this.innerSubscription.awaitStart()}start(){return this.innerSubscription.start()}update(t,e,s,i){return new Promise((n=>{this.updatePromiseResolves.push(n),this.searchInProgress||this.doUpdate(t,e,s,i)}))}async doUpdate(t,e,s,i){if(this.searchInProgress=!0,this.pos.set(t,e),(i=Math.max(0,i))>this.derivedMaxItems&&(this.derivedMaxItems=i),await this.innerSubscription.update(t,e,s,this.derivedMaxItems),this.innerSubscription.length>i)this.derivedMaxItems=Math.max(Math.round(this.derivedMaxItems-this.derivedMaxItems*ks.RAMP_DOWN_FACTOR),i);else{const n=this.absoluteMaxItems.get();for(;this.innerSubscription.lengthi)if(i>1){const t=Array.from(this.innerSubscription.getArray()).sort(this.sortFunc);t.length=i,this.diffAndNotify(t)}else 1===i?this.diffAndNotify([this.findNearest(this.innerSubscription.getArray())]):this.diffAndNotify(ks.EMPTY_ARRAY);else this.diffAndNotify(this.innerSubscription.getArray());this.searchInProgress=!1,this.updatePromiseResolves.forEach((t=>{t()})),this.updatePromiseResolves.length=0}findNearest(t){let e=t[0],s=this.pos.distance(e);for(let i=1;i=0;t--){const e=this.facilities[t];this.diffMap.has(e.icao)?this.diffMap.delete(e.icao):(this.facilities.splice(t,1),this.notify(t,qt.Removed,e))}for(const t of this.diffMap.values())this.facilities.push(t),this.notify(this.facilities.length-1,qt.Added,t);this.diffMap.clear()}}}ks.RAMP_UP_FACTOR=1.33,ks.RAMP_DOWN_FACTOR=.1,ks.EMPTY_ARRAY=[],new Lt(new Float64Array(3),0),new Ns(((t,e)=>e.distanceToFarthestVector-t.distanceToFarthestVector));class Bs{constructor(t){this.tasks=t,this.head=0}hasNext(){return this.head()=>{r.added[e]=this.cache.get(t)}));return await new Promise((t=>{new Hs(new Bs(a),new js(this.frameBudget,t)).start()})),r}setFilter(t){this.session.setBoundaryFilter(t)}}class js{constructor(t,e){this.frameBudget=t,this.resolve=e}onStarted(){}canContinue(t,e,s){return sut.HALF_PI?"right":"left"}static getVectorTurnRadius(t){return Math.min(t.radius,Math.PI-t.radius)}static getVectorInitialCourse(t){return Ys.setGeoCircleFromVector(t,Ys.geoCircleCache[0]).bearingAt(Ys.geoPointCache[0].set(t.startLat,t.startLon),Math.PI)}static getVectorFinalCourse(t){return Ys.setGeoCircleFromVector(t,Ys.geoCircleCache[0]).bearingAt(Ys.geoPointCache[0].set(t.endLat,t.endLon),Math.PI)}static getLegTrueCourse(t,e,s){if(t.trueDegrees)return t.course;const i=s?-s.magneticVariation:Facilities.getMagVar(e.lat,e.lon);return Ft.normalizeHeading(t.course+i)}static getLegFinalPosition(t,e){if(void 0!==t.endLat&&void 0!==t.endLon)return e.set(t.endLat,t.endLon)}static getLegFinalCourse(t){if(t.flightPath.length>0){const e=t.flightPath[t.flightPath.length-1];return this.getVectorFinalCourse(e)}}static getTurnCircle(t,e,s,i){return i.set(t,e),"right"===s&&i.reverse(),i}static reverseTurnCircle(t,e){return e.set(St.multScalar(t.center,-1,Ys.vec3Cache[0]),Math.PI-t.radius)}static getTurnDirectionFromCircle(t){return t.radius>ut.HALF_PI?"right":"left"}static getTurnRadiusFromCircle(t){return Math.min(t.radius,Math.PI-t.radius)}static getTurnCenterFromCircle(t,e){return t.radius>ut.HALF_PI?e instanceof Float64Array?St.multScalar(t.center,-1,e):e.setFromCartesian(-t.center[0],-t.center[1],-t.center[2]):e instanceof Float64Array?St.copy(t.center,e):e.setFromCartesian(t.center)}static getGreatCircleTangentToPath(t,e,s){t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Ys.vec3Cache[0]));const i=St.normalize(St.cross(e.center,t,Ys.vec3Cache[1]),Ys.vec3Cache[1]);return s.set(St.cross(t,i,Ys.vec3Cache[1]),ut.HALF_PI)}static getGreatCircleTangentToVector(t,e,s){t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Ys.vec3Cache[0]));const i=St.set(e.centerX,e.centerY,e.centerZ,Ys.vec3Cache[1]),n=St.normalize(St.cross(i,t,Ys.vec3Cache[1]),Ys.vec3Cache[1]);return s.set(St.cross(t,n,Ys.vec3Cache[1]),ut.HALF_PI)}static getTurnCircleStartingFromPath(t,e,s,i,n){t instanceof Float64Array||(t=wt.sphericalToCartesian(t,Ys.vec3Cache[0]));const r="left"===i?s:Math.PI-s,a=St.cross(t,e.center,Ys.vec3Cache[1]),o=Ys.geoCircleCache[0].set(a,ut.HALF_PI).offsetDistanceAlong(t,r,Ys.vec3Cache[1],Math.PI);return n.set(o,r)}static getAlongArcSignedDistance(t,e,s,i,n=Lt.ANGULAR_TOLERANCE){const r=t.angleAlong(e,i,Math.PI);if(Math.min(r,ut.TWO_PI-r)<=n)return 0;const a=t.angleAlong(e,s,Math.PI);return t.arcLength((r-a/2+Math.PI)%ut.TWO_PI-Math.PI+a/2)}static getAlongArcNormalizedDistance(t,e,s,i,n=Lt.ANGULAR_TOLERANCE){const r=t.angleAlong(e,i,Math.PI);if(Math.min(r,ut.TWO_PI-r)<=n)return 0;const a=t.angleAlong(e,s,Math.PI);return Math.min(a,ut.TWO_PI-a)<=n?r>=Math.PI?-1/0:1/0:((r-a/2+Math.PI)%ut.TWO_PI-Math.PI)/a+.5}static isPointAlongArc(t,e,s,i,n=!0,r=Lt.ANGULAR_TOLERANCE){const a=t.angularWidth(r);if("number"!=typeof s&&(s=t.angleAlong(e,s,Math.PI,a)),n&&Math.abs(s)>=ut.TWO_PI-a)return!0;const o=t.angleAlong(e,i,Math.PI);if(n&&o>=ut.TWO_PI-a)return!0;const c=(o-s)*(s>=0?1:-1);return n?c<=a:c<-a}static projectVelocityToCircle(t,e,s,i){if(i.radius<=Lt.ANGULAR_TOLERANCE)return NaN;if(0===t)return 0;e instanceof Float64Array||(e=wt.sphericalToCartesian(e,Ys.vec3Cache[0]));const n="number"==typeof s?Ys.geoCircleCache[0].setAsGreatCircle(e,s):s.isGreatCircle()?s:Ys.geoCircleCache[0].setAsGreatCircle(e,Ys.geoCircleCache[0].setAsGreatCircle(s.center,e).center),r=n.encircles(i.center)?1:-1,a=St.copy(n.center,Ys.vec3Cache[1]),o=Ys.geoCircleCache[0].setAsGreatCircle(i.center,e).center,c=St.dot(o,a);return t*Math.sqrt(1-ut.clamp(c*c,0,1))*r}static resolveIngressToEgress(t){var e,s,i,n,r,a,o,c,h,l,u,d;const p=t.ingressToEgress;let f=0,m=Math.max(0,t.ingressJoinIndex);const A=t.ingress[t.ingress.length-1],g=t.flightPath[t.ingressJoinIndex],y=t.egress[0],v=t.flightPath[t.egressJoinIndex];if(A&&g){const i=Ys.geoPointCache[0].set(A.endLat,A.endLon),n=Ys.geoPointCache[1].set(g.startLat,g.startLon),r=t.ingressJoinIndex===t.egressJoinIndex&&y?Ys.geoPointCache[2].set(y.startLat,y.startLon):Ys.geoPointCache[2].set(g.endLat,g.endLon),a=Ys.setGeoCircleFromVector(g,Ys.geoCircleCache[0]),h=Ys.getAlongArcNormalizedDistance(a,n,r,i),l=Lt.ANGULAR_TOLERANCE/gt.METER.convertTo(g.distance,gt.GA_RADIAN);h<1-l&&(h>l?(a.closest(i,i),Ys.setCircleVector(null!==(e=p[o=f++])&&void 0!==e?e:p[o]=Ys.createEmptyCircleVector(),a,i,r,g.flags)):Object.assign(null!==(s=p[c=f++])&&void 0!==s?s:p[c]=Ys.createEmptyCircleVector(),g)),m++}const _=Math.min(t.flightPath.length,t.egressJoinIndex<0?1/0:t.egressJoinIndex);for(let e=m;e<_;e++)Object.assign(null!==(i=p[h=f++])&&void 0!==i?i:p[h]=Ys.createEmptyCircleVector(),t.flightPath[e]),m++;if(m===t.egressJoinIndex&&v)if(y){const t=Ys.geoPointCache[0].set(y.startLat,y.startLon),e=Ys.geoPointCache[1].set(v.startLat,v.startLon),s=Ys.geoPointCache[2].set(v.endLat,v.endLon),i=Ys.setGeoCircleFromVector(v,Ys.geoCircleCache[0]),a=Ys.getAlongArcNormalizedDistance(i,e,s,t),o=Lt.ANGULAR_TOLERANCE/gt.METER.convertTo(v.distance,gt.GA_RADIAN);a>o&&(a<1-o?(i.closest(t,t),Ys.setCircleVector(null!==(n=p[l=f++])&&void 0!==n?n:p[l]=Ys.createEmptyCircleVector(),i,e,t,v.flags)):Object.assign(null!==(r=p[u=f++])&&void 0!==r?r:p[u]=Ys.createEmptyCircleVector(),v))}else Object.assign(null!==(a=p[d=f++])&&void 0!==a?a:p[d]=Ys.createEmptyCircleVector(),v);return p.length=f,t}}Ys.vec3Cache=[new Float64Array(3),new Float64Array(3)],Ys.geoPointCache=[new wt(0,0),new wt(0,0),new wt(0,0)],Ys.geoCircleCache=[new Lt(new Float64Array(3),0)],new Lt(new Float64Array(3),0),new wt(0,0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new wt(0,0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),O.AF,O.RF,O.PI,O.CA,O.FA,O.VA,O.VA,O.VD,O.VI,O.VM,O.VR,O.CR,O.VR,O.HA,O.HF,O.HM,O.FM,O.VM,O.Discontinuity,O.ThruDiscontinuity,new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),new wt(0,0),new wt(0,0),St.create(),St.create(),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0),function(t){t.Default="Default",t.GroundSpeed="GroundSpeed",t.TrueAirspeed="TrueAirspeed",t.TrueAirspeedPlusWind="TrueAirspeedPlusWind"}(ne||(ne={})),function(t){t.Added="Added",t.Removed="Removed",t.Changed="Changed"}(re||(re={})),function(t){t.Added="Added",t.Removed="Removed",t.Changed="Changed",t.Inserted="Inserted"}(ae||(ae={})),function(t){t.Lateral="Lateral",t.Vertical="Vertical",t.Calculating="Calculating"}(oe||(oe={})),function(t){t.OriginAdded="OriginAdded",t.OriginRemoved="OriginRemoved",t.DestinationAdded="DestinationAdded",t.DestinationRemoved="DestinationRemoved"}(ce||(ce={}));class zs{constructor(){this.subs=[],this.notifyDepth=0,this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}on(e,s=!1){const i=new t(e,void 0,this.onSubDestroyedFunc);return this.subs.push(i),s&&i.pause(),i}off(t){const e=this.subs.find((e=>e.handler===t));null==e||e.destroy()}clear(){this.notifyDepth++;for(let t=0;tt.isAlive)))}onSubDestroyed(t){0===this.notifyDepth&&this.subs.splice(this.subs.indexOf(t),1)}}!function(t){t.Custom="Custom",t.Airport="Airport",t.NDB="NDB",t.VOR="VOR",t.Intersection="Intersection",t.Runway="Runway",t.User="User",t.Visual="Visual",t.FlightPlan="FlightPlan",t.VNAV="VNAV"}(he||(he={}));class qs{equals(t){return this.uid===t.uid}}class Ks extends qs{constructor(t,e){super(),this.bus=e,this.isFacilityWaypoint=!0,this._facility=at.create(t),this._location=Ls.createFromGeoPoint(new wt(t.lat,t.lon)),this._type=Ks.getType(t);const s=Dt.getFacilityType(t.icao);s!==Y.VIS&&s!==Y.USR||(this.facChangeSub=this.bus.getSubscriber().on(`facility_changed_${t.icao}`).handle((t=>{this._facility.set(t),this._location.set(t.lat,t.lon)})))}get location(){return this._location}get uid(){return this.facility.get().icao}get type(){return this._type}get facility(){return this._facility}static getType(t){switch(Dt.getFacilityType(t.icao)){case Y.Airport:return he.Airport;case Y.Intersection:return he.Intersection;case Y.NDB:return he.NDB;case Y.RWY:return he.Runway;case Y.USR:return he.User;case Y.VIS:return he.Visual;case Y.VOR:return he.VOR;default:return he.User}}}class Xs extends qs{get location(){return this._location}get uid(){return this._uid}get type(){return he.FlightPlan}constructor(t,e,s,i,n){super(),"number"==typeof t?(this._location=Ls.create(new wt(t,e)),this._uid=`${Xs.UID_PREFIX}_${i}`,this.leg=s,this.ident=n):(this._location=t,this._uid=`${Xs.UID_PREFIX}_${s}`,this.leg=e,this.ident=i)}}Xs.UID_PREFIX="FLPTH";class Qs extends qs{get type(){return he.VNAV}get location(){return this._location}get uid(){return this._uid}constructor(t,e,s,i){super(),this.ident=i,this._uid=s,this._location=Ls.create(this.getWaypointLocation(t,e,new wt(0,0)))}setLocation(t,e){this._location.set(this.getWaypointLocation(t,e,Qs.geoPointCache[0]))}getWaypointLocation(t,e,s){var i,n;if(void 0!==t.calculated){const r=[...t.calculated.ingress,...t.calculated.ingressToEgress,...t.calculated.egress];let a=r.length-1;for(;a>=0;){const t=r[a],i=t.distance;if(i>=e){const i=wt.sphericalToCartesian(t.endLat,t.endLon,Qs.vec3Cache[0]);return Ys.setGeoCircleFromVector(t,Qs.geoCircleCache[0]).offsetDistanceAlong(i,gt.METER.convertTo(-e,gt.GA_RADIAN),s,Math.PI)}e-=i,a--}r.length>0?s.set(r[0].startLat,r[0].startLon):s.set(null!==(i=t.calculated.endLat)&&void 0!==i?i:0,null!==(n=t.calculated.endLon)&&void 0!==n?n:0)}return s}}Qs.vec3Cache=[new Float64Array(3)],Qs.geoPointCache=[new wt(0,0)],Qs.geoCircleCache=[new Lt(new Float64Array(3),0)];class Zs{constructor(t,e){this.bus=t,this.size=e,this.cache=new Map}get(t){const e=Zs.getFacilityKey(t);let s=this.cache.get(e);return s||(s=new Ks(t,this.bus),this.addToCache(e,s)),s}addToCache(t,e){this.cache.set(t,e),this.cache.size>this.size&&this.cache.delete(this.cache.keys().next().value)}static getCache(t){var e;return null!==(e=Zs.INSTANCE)&&void 0!==e?e:Zs.INSTANCE=new Zs(t,1e3)}static getFacilityKey(t){return Ot.isFacilityType(t,Y.Intersection)&&Dt.getFacilityType(t.icao)!==Y.Intersection?`mismatch.${t.icao}`:t.icao}}!function(t){t.Added="Added",t.Changed="Changed",t.Deleted="Deleted"}(le||(le={})),function(t){t.Added="Added",t.Deleted="Deleted"}(ue||(ue={}));class Js extends xs{get length(){return this.array.length}constructor(t){super(),this.array=t}static create(t=[]){return new Js(t)}insert(t,e){void 0===e||e>this.array.length-1?(e=this.array.length,this.array.push(t)):this.array.splice(e,0,t),this.notify(e,qt.Added,t)}insertRange(t=0,e){this.array.splice(t,0,...e),this.notify(t,qt.Added,e)}removeAt(t){const e=this.array.splice(t,1);this.notify(t,qt.Removed,e[0])}removeItem(t){const e=this.array.indexOf(t);return e>-1&&(this.removeAt(e),!0)}set(t){this.clear(),this.insertRange(0,t)}clear(){this.array.length=0,this.notify(0,qt.Cleared)}getArray(){return this.array}}class ti{constructor(t,e){this.computeFn=e,this.isSubscribable=!0,this.isMutableSubscribable=!0,this.subs=[],this.notifyDepth=0,this.initialNotifyFunc=this.notifySubscription.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this),this.rawValue=t,this.value=e(t)}static create(t,e){return new ti(t,e)}set(t){this.rawValue=t;const e=this.computeFn(t);e!==this.value&&(this.value=e,this.notify())}get(){return this.value}getRaw(){return this.rawValue}sub(e,s=!1,i=!1){const n=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.subs.push(n),i?n.pause():s&&n.initialNotify(),n}unsub(t){const e=this.subs.find((e=>e.handler===t));null==e||e.destroy()}notify(){let t=!1;this.notifyDepth++;const e=this.subs.length;for(let s=0;st.isAlive)))}notifySubscription(t){t.handler(this.value,this.rawValue)}onSubDestroyed(t){0===this.notifyDepth&&this.subs.splice(this.subs.indexOf(t),1)}map(t,e,s,i){const n=(e,s)=>t(e[0],s);return s?bt.create(n,e,s,i,this):bt.create(n,null!=e?e:T.DEFAULT_EQUALITY_FUNC,this)}pipe(t,e,s){let i,n;return"function"==typeof e?(i=new b(this,t,e,this.onSubDestroyedFunc),n=null!=s&&s):(i=new b(this,t,this.onSubDestroyedFunc),n=null!=e&&e),this.subs.push(i),n?i.pause():i.initialNotify(),i}}class ei{constructor(t){this.obj=t,this.isSubscribable=!0,this.isMutableSubscribable=!0,this.subs=[],this.notifyDepth=0,this.initialNotifyFunc=this.initialNotify.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}static create(t){return new ei(t)}get(){return this.obj}sub(e,s=!1,i=!1){const n=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(n),i?n.pause():s&&n.initialNotify(),n}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}unsub(t){let e;this.singletonSub&&this.singletonSub.handler===t?e=this.singletonSub:this.subs&&(e=this.subs.find((e=>e.handler===t))),null==e||e.destroy()}set(t,e){if("object"==typeof t)for(const e in t)e in this.obj&&this.set(e,t[e]);else{const s=this.obj[t];e!==s&&(this.obj[t]=e,this.notify(t,s))}}notify(t,e){const s=0===this.notifyDepth;let i=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isAlive&&!this.singletonSub.isPaused&&this.singletonSub.handler(this.obj,t,this.obj[t],e)}catch(t){console.error(`ObjectSubject: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(s)if(this.singletonSub)i=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}initialNotify(t){for(const e in this.obj){const s=this.obj[e];t.handler(this.obj,e,s,s)}}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}map(t,e,s,i){const n=(e,s)=>t(e[0],s);return s?bt.create(n,e,s,i,this):bt.create(n,null!=e?e:T.DEFAULT_EQUALITY_FUNC,this)}pipe(t,e,s){let i,n;return"function"==typeof e?(i=new b(this,t,e,this.onSubDestroyedFunc),n=null!=s&&s):(i=new b(this,t,this.onSubDestroyedFunc),n=null!=e&&e),this.subs.push(i),n?i.pause():i.initialNotify(),i}}new zs,new zs,function(t){t[t.ALL=0]="ALL",t[t.AIRPORT=1]="AIRPORT",t[t.VOR=2]="VOR",t[t.NDB=3]="NDB",t[t.INTERSECTION=4]="INTERSECTION",t[t.USR=5]="USR"}(de||(de={}));class si extends _{constructor(t,e){var s,i,n,r,a,o,c,h;super(new Map([["indicated_alt",{name:"INDICATED ALTITUDE:#index#",type:l.Feet,indexed:!0}],["altimeter_baro_setting_inhg",{name:"KOHLSMAN SETTING HG:#index#",type:l.InHG,indexed:!0}],["altimeter_baro_setting_mb",{name:"KOHLSMAN SETTING MB:#index#",type:l.MB,indexed:!0}],["altimeter_baro_preselect_raw",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,indexed:!0}],["altimeter_baro_preselect_inhg",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,map:t=>gt.HPA.convertTo(t/16,gt.IN_HG),indexed:!0}],["altimeter_baro_preselect_mb",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,map:t=>t/16,indexed:!0}],["altimeter_baro_is_std",{name:"L:XMLVAR_Baro#index#_ForcedToSTD",type:l.Bool,indexed:!0}],["radio_alt",{name:"RADIO HEIGHT",type:l.Feet}],["pressure_alt",{name:"PRESSURE ALTITUDE",type:l.Feet}],["vertical_speed",{name:"VERTICAL SPEED",type:l.FPM}],["ambient_density",{name:"AMBIENT DENSITY",type:l.SlugsPerCubicFoot}],["isa_temp_c",{name:"STANDARD ATM TEMPERATURE",type:l.Celsius}],["ram_air_temp_c",{name:"TOTAL AIR TEMPERATURE",type:l.Celsius}],["ambient_wind_velocity",{name:"AMBIENT WIND VELOCITY",type:l.Knots}],["ambient_wind_direction",{name:"AMBIENT WIND DIRECTION",type:l.Degree}],["on_ground",{name:"SIM ON GROUND",type:l.Bool}],["aoa",{name:"INCIDENCE ALPHA",type:l.Degree}],["stall_aoa",{name:"STALL ALPHA",type:l.Degree}],["zero_lift_aoa",{name:"ZERO LIFT ALPHA",type:l.Degree}],["density_alt",{name:"DENSITY ALTITUDE",type:l.Feet}]]),t,e),null!==(s=this.needPublish)&&void 0!==s||(this.needPublish={mach_number:!1,ambient_pressure_inhg:!1,ambient_temp_c:!1}),null!==(i=this.needPublishIasTopics)&&void 0!==i||(this.needPublishIasTopics=new Map),null!==(n=this.needRetrievePressure)&&void 0!==n||(this.needRetrievePressure=!1),null!==(r=this.needRetrieveTemperature)&&void 0!==r||(this.needRetrieveTemperature=!1),null!==(a=this.needRetrieveMach)&&void 0!==a||(this.needRetrieveMach=!1),null!==(o=this.pressure)&&void 0!==o||(this.pressure=1013.25),null!==(c=this.temperature)&&void 0!==c||(this.temperature=0),null!==(h=this.mach)&&void 0!==h||(this.mach=0)}handleSubscribedTopic(t){var e,s;null!==(e=this.needPublish)&&void 0!==e||(this.needPublish={mach_number:!1,ambient_pressure_inhg:!1,ambient_temp_c:!1}),null!==(s=this.needPublishIasTopics)&&void 0!==s||(this.needPublishIasTopics=new Map),this.resolvedSimVars.has(t)||t in this.needPublish||si.TOPIC_REGEXES.ias.test(t)||si.TOPIC_REGEXES.tas.test(t)||si.TOPIC_REGEXES.indicated_mach_number.test(t)||si.TOPIC_REGEXES.indicated_tas.test(t)||si.TOPIC_REGEXES.mach_to_kias_factor.test(t)||si.TOPIC_REGEXES.tas_to_ias_factor.test(t)||si.TOPIC_REGEXES.indicated_mach_to_kias_factor.test(t)||si.TOPIC_REGEXES.indicated_tas_to_ias_factor.test(t)?this.onTopicSubscribed(t):this.tryMatchIndexedSubscribedTopic(t)}onTopicSubscribed(t){if(t in this.needPublish)switch(this.needPublish[t]=!0,t){case"ambient_pressure_inhg":this.needRetrievePressure=!0,this.publishActive&&this.retrieveAmbientPressure(!0);break;case"ambient_temp_c":this.needRetrieveTemperature=!0,this.publishActive&&this.retrieveAmbientTemperature(!0);break;case"mach_number":this.needRetrieveMach=!0,this.publishActive&&this.retrieveMach(!0)}else if(si.TOPIC_REGEXES.ias.test(t)){const e=t.match(si.TOPIC_REGEXES.ias)[1],s=e?parseInt(e):-1,i=this.getOrCreateIasTopicEntry(s);i.iasTopic=s<0?"ias":`ias_${s}`,this.publishActive&&this.retrieveIas(i,!0)}else if(si.TOPIC_REGEXES.tas.test(t)){const e=t.match(si.TOPIC_REGEXES.tas)[1],s=e?parseInt(e):-1,i=this.getOrCreateIasTopicEntry(s);i.tasTopic=s<0?"tas":`tas_${s}`,this.publishActive&&this.retrieveTas(i,!0)}else if(si.TOPIC_REGEXES.indicated_mach_number.test(t)){const e=t.match(si.TOPIC_REGEXES.indicated_mach_number)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0;const i=this.getOrCreateIasTopicEntry(s);i.indicatedMachTopic=s<0?"indicated_mach_number":`indicated_mach_number_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveIas(i,!1),this.retrieveIndicatedMach(i,!0))}else if(si.TOPIC_REGEXES.indicated_tas.test(t)){const e=t.match(si.TOPIC_REGEXES.indicated_tas)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const i=this.getOrCreateIasTopicEntry(s);i.indicatedTasTopic=s<0?"indicated_tas":`indicated_tas_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(i,!1),this.retrieveIndicatedTas(i,!0))}else if(si.TOPIC_REGEXES.mach_to_kias_factor.test(t)){const e=t.match(si.TOPIC_REGEXES.mach_to_kias_factor)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveMach=!0;const i=this.getOrCreateIasTopicEntry(s);i.machToKiasTopic=s<0?"mach_to_kias_factor":`mach_to_kias_factor_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveMach(!1),this.retrieveIas(i,!1),this.publishMachToKias(i))}else if(si.TOPIC_REGEXES.tas_to_ias_factor.test(t)){const e=t.match(si.TOPIC_REGEXES.tas_to_ias_factor)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const i=this.getOrCreateIasTopicEntry(s);i.tasToIasTopic=s<0?"tas_to_ias_factor":`tas_to_ias_factor_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(i,!1),this.retrieveTas(i,!1),this.publishTasToIas(i))}else if(si.TOPIC_REGEXES.indicated_mach_to_kias_factor.test(t)){const e=t.match(si.TOPIC_REGEXES.indicated_mach_to_kias_factor)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0;const i=this.getOrCreateIasTopicEntry(s);i.indicatedMachToKiasTopic=s<0?"indicated_mach_to_kias_factor":`indicated_mach_to_kias_factor_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveIas(i,!1),this.retrieveIndicatedMach(i,!1),this.publishIndicatedMachToKias(i))}else if(si.TOPIC_REGEXES.indicated_tas_to_ias_factor.test(t)){const e=t.match(si.TOPIC_REGEXES.indicated_tas_to_ias_factor)[1],s=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const i=this.getOrCreateIasTopicEntry(s);i.indicatedTasToIasTopic=s<0?"indicated_tas_to_ias_factor":`indicated_tas_to_ias_factor_${s}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(i,!1),this.retrieveIndicatedTas(i,!1),this.publishIndicatedTasToIas(i))}else super.onTopicSubscribed(t)}getOrCreateIasTopicEntry(t){let e=this.needPublishIasTopics.get(t);return e||(e={iasSimVar:t<0?"AIRSPEED INDICATED:1":`AIRSPEED INDICATED:${t}`,tasSimVar:t<0?"AIRSPEED TRUE:1":`AIRSPEED TRUE:${t}`,kias:0,iasMps:0,ktas:0,indicatedMach:0,indicatedTas:0},this.needPublishIasTopics.set(t,e)),e}onUpdate(){if(!SimVar.GetSimVarValue("IS SLEW ACTIVE","bool")){this.needRetrievePressure&&this.retrieveAmbientPressure(this.needPublish.ambient_pressure_inhg),this.needRetrieveTemperature&&this.retrieveAmbientTemperature(this.needPublish.ambient_temp_c),this.needRetrieveMach&&this.retrieveMach(this.needPublish.mach_number);for(const t of this.needPublishIasTopics.values())this.retrieveIas(t,!0),(t.tasTopic||t.tasToIasTopic)&&this.retrieveTas(t,!0),(t.indicatedMachTopic||t.indicatedMachToKiasTopic)&&this.retrieveIndicatedMach(t,!0),(t.indicatedTasTopic||t.indicatedTasToIasTopic)&&this.retrieveIndicatedTas(t,!0),this.publishMachToKias(t),this.publishTasToIas(t),this.publishIndicatedMachToKias(t),this.publishIndicatedTasToIas(t);super.onUpdate()}}retrieveAmbientPressure(t){const e=SimVar.GetSimVarValue("AMBIENT PRESSURE",l.InHG);this.pressure=gt.IN_HG.convertTo(e,gt.HPA),t&&this.publish("ambient_pressure_inhg",e)}retrieveAmbientTemperature(t){this.temperature=SimVar.GetSimVarValue("AMBIENT TEMPERATURE",l.Celsius),t&&this.publish("ambient_temp_c",this.temperature)}retrieveMach(t){this.mach=SimVar.GetSimVarValue("AIRSPEED MACH",l.Mach),t&&this.publish("mach_number",this.mach)}retrieveIas(t,e){t.kias=SimVar.GetSimVarValue(t.iasSimVar,l.Knots),t.iasMps=gt.KNOT.convertTo(t.kias,gt.MPS),e&&t.iasTopic&&this.publish(t.iasTopic,t.kias)}retrieveTas(t,e){t.ktas=SimVar.GetSimVarValue(t.tasSimVar,l.Knots),e&&t.tasTopic&&this.publish(t.tasTopic,t.ktas)}retrieveIndicatedMach(t,e){t.indicatedMach=ht.casToMach(t.iasMps,this.pressure),e&&t.indicatedMachTopic&&this.publish(t.indicatedMachTopic,t.indicatedMach)}retrieveIndicatedTas(t,e){t.indicatedTas=gt.MPS.convertTo(ht.casToTas(t.iasMps,this.pressure,this.temperature),gt.KNOT),e&&t.indicatedTasTopic&&this.publish(t.indicatedTasTopic,t.indicatedTas)}publishMachToKias(t){if(!t.machToKiasTopic)return;const e=t.kias<1||0===this.mach?1/ht.casToMach(1,this.pressure):t.kias/this.mach;this.publish(t.machToKiasTopic,isFinite(e)?e:1)}publishTasToIas(t){if(!t.tasToIasTopic)return;const e=t.kias<1||0===t.ktas?1/ht.casToTas(1,this.pressure,this.temperature):t.kias/t.ktas;this.publish(t.tasToIasTopic,isFinite(e)?e:1)}publishIndicatedMachToKias(t){if(!t.indicatedMachToKiasTopic)return;const e=t.kias<1||0===t.indicatedMach?1/ht.casToMach(1,this.pressure):t.kias/t.indicatedMach;this.publish(t.indicatedMachToKiasTopic,isFinite(e)?e:1)}publishIndicatedTasToIas(t){if(!t.indicatedTasToIasTopic)return;const e=t.kias<1||0===t.indicatedTas?1/ht.casToTas(1,this.pressure,this.temperature):t.kias/t.indicatedTas;this.publish(t.indicatedTasToIasTopic,isFinite(e)?e:1)}}si.TOPIC_REGEXES={ias:/^ias(?:_(0|(?:[1-9])\d*))?$/,tas:/^tas(?:_(0|(?:[1-9])\d*))?$/,indicated_mach_number:/^indicated_mach_number(?:_(0|(?:[1-9])\d*))?$/,indicated_tas:/^indicated_tas(?:_(0|(?:[1-9])\d*))?$/,mach_to_kias_factor:/^mach_to_kias_factor(?:_(0|(?:[1-9])\d*))?$/,tas_to_ias_factor:/^tas_to_ias_factor(?:_(0|(?:[1-9])\d*))?$/,indicated_mach_to_kias_factor:/^indicated_mach_to_kias_factor(?:_(0|(?:[1-9])\d*))?$/,indicated_tas_to_ias_factor:/^indicated_tas_to_ias_factor(?:_(0|(?:[1-9])\d*))?$/},function(t){t[t.None=2]="None",t[t.Rain=4]="Rain",t[t.Snow=8]="Snow"}(pe||(pe={}));class ii extends _{constructor(t,e){const s=[["anti_ice_engine_switch_on",{name:"ENG ANTI ICE",type:l.Bool}],["anti_ice_prop_switch_on",{name:"PROP DEICE SWITCH",type:l.Bool}]],i=new Map(ii.nonIndexedSimVars),n=SimVar.GetSimVarValue("NUMBER OF ENGINES",l.Number);for(const[t,e]of s)for(let s=1;s<=n;s++)i.set(`${t}_${s}`,{name:`${e.name}:${s}`,type:e.type,map:e.map});super(i,t,e)}}ii.nonIndexedSimVars=[["anti_ice_structural_switch_on",{name:"STRUCTURAL DEICE SWITCH",type:l.Bool}],["anti_ice_windshield_switch_on",{name:"WINDSHIELD DEICE SWITCH",type:l.Bool}],["anti_ice_structural_ice_pct",{name:"STRUCTURAL ICE PCT",type:l.Percent}]],function(t){t[t.Heading=0]="Heading",t[t.Nav=1]="Nav",t[t.Alt=2]="Alt",t[t.Bank=3]="Bank",t[t.WingLevel=4]="WingLevel",t[t.Vs=5]="Vs",t[t.Flc=6]="Flc",t[t.Pitch=7]="Pitch",t[t.Approach=8]="Approach",t[t.Backcourse=9]="Backcourse",t[t.Glideslope=10]="Glideslope",t[t.VNav=11]="VNav"}(fe||(fe={}));class ni extends _{constructor(t,e=void 0){super(ni.simvars,t,e)}}ni.simvars=new Map([["ap_master_status",{name:"AUTOPILOT MASTER",type:l.Bool}],["ap_yd_status",{name:"AUTOPILOT YAW DAMPER",type:l.Bool}],["ap_disengage_status",{name:"AUTOPILOT DISENGAGED",type:l.Bool}],["ap_heading_hold",{name:"AUTOPILOT HEADING LOCK",type:l.Bool}],["ap_nav_hold",{name:"AUTOPILOT NAV1 LOCK",type:l.Bool}],["ap_bank_hold",{name:"AUTOPILOT BANK HOLD",type:l.Bool}],["ap_max_bank_id",{name:"AUTOPILOT MAX BANK ID",type:l.Number}],["ap_max_bank_value",{name:"AUTOPILOT MAX BANK",type:l.Degree}],["ap_wing_lvl_hold",{name:"AUTOPILOT WING LEVELER",type:l.Bool}],["ap_approach_hold",{name:"AUTOPILOT APPROACH HOLD",type:l.Bool}],["ap_backcourse_hold",{name:"AUTOPILOT BACKCOURSE HOLD",type:l.Bool}],["ap_vs_hold",{name:"AUTOPILOT VERTICAL HOLD",type:l.Bool}],["ap_flc_hold",{name:"AUTOPILOT FLIGHT LEVEL CHANGE",type:l.Bool}],["ap_alt_hold",{name:"AUTOPILOT ALTITUDE LOCK",type:l.Bool}],["ap_glideslope_hold",{name:"AUTOPILOT GLIDESLOPE HOLD",type:l.Bool}],["ap_pitch_hold",{name:"AUTOPILOT PITCH HOLD",type:l.Bool}],["ap_toga_hold",{name:"AUTOPILOT TAKEOFF POWER ACTIVE",type:l.Bool}],["ap_heading_selected",{name:"AUTOPILOT HEADING LOCK DIR:#index#",type:l.Degree,indexed:!0}],["ap_altitude_selected",{name:"AUTOPILOT ALTITUDE LOCK VAR:#index#",type:l.Feet,indexed:!0}],["ap_pitch_selected",{name:"AUTOPILOT PITCH HOLD REF",type:l.Degree}],["ap_vs_selected",{name:"AUTOPILOT VERTICAL HOLD VAR:#index#",type:l.FPM,indexed:!0}],["ap_fpa_selected",{name:"L:WT_AP_FPA_Target:#index#",type:l.Degree,indexed:!0}],["ap_ias_selected",{name:"AUTOPILOT AIRSPEED HOLD VAR:#index#",type:l.Knots,indexed:!0}],["ap_mach_selected",{name:"AUTOPILOT MACH HOLD VAR:#index#",type:l.Number,indexed:!0}],["ap_selected_speed_is_mach",{name:"AUTOPILOT MANAGED SPEED IN MACH",type:l.Bool}],["ap_selected_speed_is_manual",{name:"L:XMLVAR_SpeedIsManuallySet",type:l.Bool}],["flight_director_bank",{name:"AUTOPILOT FLIGHT DIRECTOR BANK",type:l.Degree}],["flight_director_pitch",{name:"AUTOPILOT FLIGHT DIRECTOR PITCH",type:l.Degree}],["flight_director_is_active_1",{name:"AUTOPILOT FLIGHT DIRECTOR ACTIVE:1",type:l.Bool}],["flight_director_is_active_2",{name:"AUTOPILOT FLIGHT DIRECTOR ACTIVE:2",type:l.Bool}],["vnav_active",{name:"L:XMLVAR_VNAVButtonValue",type:l.Bool}]]),function(t){t[t.OFF=0]="OFF",t[t.TO=1]="TO",t[t.FROM=2]="FROM"}(me||(me={})),function(t){t[t.Inactive=0]="Inactive",t[t.Outer=1]="Outer",t[t.Middle=2]="Middle",t[t.Inner=3]="Inner"}(Ae||(Ae={})),function(t){t.Com="COM",t.Nav="NAV",t.Adf="ADF"}(ge||(ge={})),function(t){t[t.Active=0]="Active",t[t.Standby=1]="Standby"}(ye||(ye={})),function(t){t[t.Spacing25Khz=0]="Spacing25Khz",t[t.Spacing833Khz=1]="Spacing833Khz"}(ve||(ve={}));class ri extends _{constructor(t,e=void 0){super(ri.simvars,t,e)}static createNavRadioDefinitions(t){return[[`nav_signal_${t}`,{name:`NAV SIGNAL:${t}`,type:l.Number}],[`nav_obs_${t}`,{name:`NAV OBS:${t}`,type:l.Degree}],[`nav_has_dme_${t}`,{name:`NAV HAS DME:${t}`,type:l.Bool}],[`nav_has_nav_${t}`,{name:`NAV HAS NAV:${t}`,type:l.Bool}],[`nav_cdi_${t}`,{name:`NAV CDI:${t}`,type:l.Number}],[`nav_dme_${t}`,{name:`NAV DME:${t}`,type:l.NM}],[`nav_radial_${t}`,{name:`NAV RADIAL:${t}`,type:l.Degree}],[`nav_radial_error_${t}`,{name:`NAV RADIAL ERROR:${t}`,type:l.Degree}],[`nav_ident_${t}`,{name:`NAV IDENT:${t}`,type:l.String}],[`nav_to_from_${t}`,{name:`NAV TOFROM:${t}`,type:l.Enum}],[`nav_localizer_${t}`,{name:`NAV HAS LOCALIZER:${t}`,type:l.Bool}],[`nav_localizer_crs_${t}`,{name:`NAV LOCALIZER:${t}`,type:l.Number}],[`nav_loc_airport_ident_${t}`,{name:`NAV LOC AIRPORT IDENT:${t}`,type:l.String}],[`nav_loc_runway_designator_${t}`,{name:`NAV LOC RUNWAY DESIGNATOR:${t}`,type:l.Number}],[`nav_loc_runway_number_${t}`,{name:`NAV LOC RUNWAY NUMBER:${t}`,type:l.Number}],[`nav_glideslope_${t}`,{name:`NAV HAS GLIDE SLOPE:${t}`,type:l.Bool}],[`nav_gs_error_${t}`,{name:`NAV GLIDE SLOPE ERROR:${t}`,type:l.Degree}],[`nav_raw_gs_${t}`,{name:`NAV RAW GLIDE SLOPE:${t}`,type:l.Degree}],[`nav_lla_${t}`,{name:`NAV VOR LATLONALT:${t}`,type:l.LLA}],[`nav_dme_lla_${t}`,{name:`NAV DME LATLONALT:${t}`,type:l.LLA}],[`nav_gs_lla_${t}`,{name:`NAV GS LATLONALT:${t}`,type:l.LLA}],[`nav_magvar_${t}`,{name:`NAV MAGVAR:${t}`,type:l.Degree}]]}static createAdfRadioDefinitions(t){return[[`adf_signal_${t}`,{name:`ADF SIGNAL:${t}`,type:l.Number}],[`adf_bearing_${t}`,{name:`ADF RADIAL:${t}`,type:l.Degree}],[`adf_lla_${t}`,{name:`ADF LATLONALT:${t}`,type:l.LLA}]]}}ri.simvars=new Map([...ri.createNavRadioDefinitions(1),...ri.createNavRadioDefinitions(2),...ri.createNavRadioDefinitions(3),...ri.createNavRadioDefinitions(4),...ri.createAdfRadioDefinitions(1),...ri.createAdfRadioDefinitions(2),["gps_dtk",{name:"GPS WP DESIRED TRACK",type:l.Degree}],["gps_xtk",{name:"GPS WP CROSS TRK",type:l.NM}],["gps_wp",{name:"GPS WP NEXT ID",type:l.NM}],["gps_wp_bearing",{name:"GPS WP BEARING",type:l.Degree}],["gps_wp_distance",{name:"GPS WP DISTANCE",type:l.NM}],["mkr_bcn_state_simvar",{name:"MARKER BEACON STATE",type:l.Number}],["gps_obs_active_simvar",{name:"GPS OBS ACTIVE",type:l.Bool}],["gps_obs_value_simvar",{name:"GPS OBS VALUE",type:l.Degree}]]),function(t){t[t.Nav=0]="Nav",t[t.Gps=1]="Gps",t[t.Adf=2]="Adf"}(_e||(_e={}));class ai extends _{constructor(t,e=void 0){super(ai.simvars,t,e),this.flightStarted=!1,this.avBusList=["elec_av1_bus","elec_av2_bus"];for(const e of this.avBusList)t.getTopicSubscriberCount(e)&&this.subscribed.add(e);t.getSubscriber().on("event_bus_topic_first_sub").handle((t=>{this.avBusList.includes(t)&&this.subscribed.add(t)}));const s=ot.get().sub((t=>{t!==GameState.briefing&&t!==GameState.ingame||(s.destroy(),this.flightStarted=!0)}),!1,!0);s.resume(!0)}onUpdate(){this.flightStarted&&(super.onUpdate(),this.av1BusLogic&&this.subscribed.has("elec_av1_bus")&&this.publish("elec_av1_bus",0!==this.av1BusLogic.getValue()),this.av2BusLogic&&this.subscribed.has("elec_av2_bus")&&this.publish("elec_av2_bus",0!==this.av2BusLogic.getValue()))}setAv1Bus(t){this.av1BusLogic=t}setAv2Bus(t){this.av2BusLogic=t}}ai.simvars=new Map([["elec_master_battery",{name:"ELECTRICAL MASTER BATTERY:#index#",type:l.Bool,indexed:!0}],["elec_circuit_avionics_on",{name:"CIRCUIT AVIONICS ON:#index#",type:l.Bool,indexed:!0}],["elec_circuit_navcom1_on",{name:"CIRCUIT NAVCOM1 ON",type:l.Bool}],["elec_circuit_navcom2_on",{name:"CIRCUIT NAVCOM2 ON",type:l.Bool}],["elec_circuit_navcom3_on",{name:"CIRCUIT NAVCOM3 ON",type:l.Bool}],["elec_bus_main_v",{name:"ELECTRICAL MAIN BUS VOLTAGE:#index#",type:l.Volts,indexed:!0}],["elec_bus_main_a",{name:"ELECTRICAL MAIN BUS AMPS:#index#",type:l.Amps,indexed:!0}],["elec_bus_avionics_v",{name:"ELECTRICAL AVIONICS BUS VOLTAGE",type:l.Volts}],["elec_bus_avionics_a",{name:"ELECTRICAL AVIONICS BUS AMPS",type:l.Amps}],["elec_bus_genalt_1_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:1",type:l.Volts}],["elec_bus_genalt_2_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:2",type:l.Volts}],["elec_bus_genalt_3_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:3",type:l.Volts}],["elec_bus_genalt_4_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:4",type:l.Volts}],["elec_bus_genalt_5_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:5",type:l.Volts}],["elec_bus_genalt_6_v",{name:"ELECTRICAL GENALT BUS VOLTAGE:6",type:l.Volts}],["elec_bus_genalt_1_a",{name:"ELECTRICAL GENALT BUS AMPS:1",type:l.Amps}],["elec_bus_genalt_2_a",{name:"ELECTRICAL GENALT BUS AMPS:2",type:l.Amps}],["elec_bus_genalt_3_a",{name:"ELECTRICAL GENALT BUS AMPS:3",type:l.Amps}],["elec_bus_genalt_4_a",{name:"ELECTRICAL GENALT BUS AMPS:4",type:l.Amps}],["elec_bus_genalt_5_a",{name:"ELECTRICAL GENALT BUS AMPS:5",type:l.Amps}],["elec_bus_genalt_6_a",{name:"ELECTRICAL GENALT BUS AMPS:6",type:l.Amps}],["elec_bat_a",{name:"ELECTRICAL BATTERY LOAD:#index#",type:l.Amps,indexed:!0}],["elec_bat_v",{name:"ELECTRICAL BATTERY VOLTAGE:#index#",type:l.Amps,indexed:!0}],["elec_ext_power_available",{name:"EXTERNAL POWER AVAILABLE:#index#",type:l.Bool,indexed:!0}],["elec_ext_power_on",{name:"EXTERNAL POWER ON:#index#",type:l.Bool,indexed:!0}],["elec_apu_gen_switch",{name:"APU GENERATOR SWITCH:#index#",type:l.Bool,indexed:!0}],["elec_apu_gen_active",{name:"APU GENERATOR ACTIVE:#index#",type:l.Bool,indexed:!0}],["elec_eng_gen_switch",{name:"GENERAL ENG MASTER ALTERNATOR:#index#",type:l.Bool,indexed:!0}],["elec_circuit_on",{name:"CIRCUIT ON:#index#",type:l.Bool,indexed:!0}],["elec_circuit_switch_on",{name:"CIRCUIT SWITCH ON:#index#",type:l.Bool,indexed:!0}]]),function(t){t[t.Piston=0]="Piston",t[t.Jet=1]="Jet",t[t.None=2]="None",t[t.HeloTurbine=3]="HeloTurbine",t[t.Unsupported=4]="Unsupported",t[t.Turboprop=5]="Turboprop"}(be||(be={})),function(t){t[t.CountingDown=0]="CountingDown",t[t.CountingUp=1]="CountingUp"}(Te||(Te={})),function(t){t.WAAS="WAAS",t.EGNOS="EGNOS",t.GAGAN="GAGAN",t.MSAS="MSAS"}(Se||(Se={})),function(t){t.None="None",t.Unreachable="Unreachable",t.Acquired="Acquired",t.Faulty="Faulty",t.DataCollected="DataCollected",t.InUse="InUse",t.InUseDiffApplied="InUseDiffApplied"}(Ce||(Ce={})),function(t){t.Searching="Searching",t.Acquiring="Acquiring",t.SolutionAcquired="SolutionAcquired",t.DiffSolutionAcquired="DiffSolutionAcquired"}(Re||(Re={})),function(t){t.Disabled="Disabled",t.Inactive="Inactive",t.Active="Active"}(Ee||(Ee={})),new Set([Ce.DataCollected,Ce.InUse,Ce.InUseDiffApplied]),new Set([Ce.Acquired,Ce.DataCollected,Ce.InUse,Ce.InUseDiffApplied]),function(t){t[t.OFF=0]="OFF",t[t.BARO=1]="BARO",t[t.RA=2]="RA",t[t.TEMP_COMP_BARO=3]="TEMP_COMP_BARO"}(Pe||(Pe={}));class oi extends _{constructor(t){super(oi.simvars,t)}}oi.simvars=new Map([["decision_height_feet",{name:"DECISION HEIGHT",type:l.Feet}],["decision_altitude_feet",{name:"DECISION ALTITUDE MSL",type:l.Feet}],["minimums_mode",{name:"L:WT_MINIMUMS_MODE",type:l.Number}]]);class ci extends _{constructor(t,e,s){const i=[["pitot_heat_switch_on",{name:"PITOT HEAT SWITCH",type:l.Bool}]],n=new Map(ci.nonIndexedSimVars);for(const[t,s]of i)for(let i=1;i<=e;i++)n.set(`${t}_${i}`,{name:`${s.name}:${i}`,type:s.type,map:s.map});super(n,t,s)}}ci.nonIndexedSimVars=[["pitot_heat_on",{name:"PITOT HEAT",type:l.Bool}],["pitot_icing_pct",{name:"PITOT ICE PCT",type:l.Percent}]];class hi extends _{onUpdate(){super.onUpdate()}constructor(t,e=void 0){super(hi.simvars,t,e)}}hi.simvars=new Map([["cabin_altitude",{name:"PRESSURIZATION CABIN ALTITUDE",type:l.Feet}],["cabin_altitude_rate",{name:"PRESSURIZATION CABIN ALTITUDE RATE",type:l.FPM}],["pressure_diff",{name:"PRESSURIZATION PRESSURE DIFFERENTIAL",type:l.PSI}]]);class li{constructor(){this.timer=null}isPending(){return null!==this.timer}schedule(t,e){this.clear(),this.timer=setTimeout((()=>{this.timer=null,t()}),e)}clear(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)}}!function(t){t[t.OFF=0]="OFF",t[t.STBY=1]="STBY",t[t.TEST=2]="TEST",t[t.ON=3]="ON",t[t.ALT=4]="ALT",t[t.GROUND=5]="GROUND"}(Ie||(Ie={})),new wt(0,0),function(t){t[t.Warning=0]="Warning",t[t.Caution=1]="Caution",t[t.Advisory=2]="Advisory",t[t.SafeOp=3]="SafeOp"}(Ne||(Ne={})),function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.In=2]="In"}(we||(we={}));class ui{constructor(t){this.context=void 0,this.contextType=void 0,this.props=t}onBeforeRender(){}onAfterRender(t){}destroy(){}getContext(t){if(void 0!==this.context&&void 0!==this.contextType){const e=this.contextType.indexOf(t);return this.context[e]}throw new Error("Could not find the provided context type.")}}class di{constructor(){this._instance=null}get instance(){if(null!==this._instance)return this._instance;throw new Error("Instance was null.")}set instance(t){this._instance=t}getOrDefault(){return this._instance}}class pi{constructor(t){this.defaultValue=t,this.Provider=t=>new fi(t,this)}}class fi extends ui{constructor(t,e){super(t),this.parent=e}render(){var t;const e=null!==(t=this.props.children)&&void 0!==t?t:[];return Le.buildComponent(Le.Fragment,this.props,...e)}}!function(t){const e={circle:!0,clipPath:!0,"color-profile":!0,cursor:!0,defs:!0,desc:!0,ellipse:!0,g:!0,image:!0,line:!0,linearGradient:!0,marker:!0,mask:!0,path:!0,pattern:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,svg:!0,text:!0,tspan:!0};function s(t){return t.children}function i(t,e){let s=null;if(null!=e&&e.length>0){s=[];for(const r of e)if(null!==r)if(r instanceof Array){const e=i(t,r);null!==e&&s.push(...e)}else if("object"==typeof r)if("isSubscribable"in r){const t={instance:r,children:null,props:null,root:void 0};r.sub((e=>{void 0!==t.root&&(t.root.nodeValue=""===e||null==e?" ":e.toString())})),s.push(t)}else s.push(r);else"string"!=typeof r&&"number"!=typeof r||s.push(n(r))}return s}function n(t){return{instance:t,children:null,props:null}}function r(t,e,s=we.In){if(t.instance instanceof HTMLElement||t.instance instanceof SVGElement)null!==e&&a(t,s,e);else if(t.children&&t.children.length>0&&null!==e){const i=t.instance;if(null!==i&&void 0!==i.onBeforeRender&&i.onBeforeRender(),s===we.After)for(let i=t.children.length-1;i>=0;i--)void 0!==t.children[i]&&null!==t.children[i]&&a(t.children[i],s,e);else for(let i=0;i{if(null==t)return!1;const e=t.instance;if(null!==e&&void 0!==e.contextType){const t=e.contextType.indexOf(n.parent);if(t>=0&&(void 0===e.context&&(e.context=[]),e.context[t].set(n.props.value)),e instanceof fi&&e!==n&&e.parent===n.parent)return!0}return!1})),null!==i&&void 0!==i.onAfterRender){const e=window._pluginSystem;i.onAfterRender(t),void 0!==e&&e.onComponentRendered(t)}}}function a(t,e,s){var i,n,o,c,h,l;if(t.instance instanceof HTMLElement||t.instance instanceof SVGElement){switch(e){case we.In:s.appendChild(t.instance),t.root=null!==(i=s.lastChild)&&void 0!==i?i:void 0;break;case we.Before:s.insertAdjacentElement("beforebegin",t.instance),t.root=null!==(n=s.previousSibling)&&void 0!==n?n:void 0;break;case we.After:s.insertAdjacentElement("afterend",t.instance),t.root=null!==(o=s.nextSibling)&&void 0!==o?o:void 0}if(null!==t.children)for(const e of t.children)a(e,we.In,t.instance)}else if("string"==typeof t.instance||"object"==typeof t.instance&&null!==t.instance&&"isSubscribable"in t.instance){let i;switch("string"==typeof t.instance?i=t.instance:(i=t.instance.get(),""===i&&(i=" ")),e){case we.In:s.insertAdjacentHTML("beforeend",i),t.root=null!==(c=s.lastChild)&&void 0!==c?c:void 0;break;case we.Before:s.insertAdjacentHTML("beforebegin",i),t.root=null!==(h=s.previousSibling)&&void 0!==h?h:void 0;break;case we.After:s.insertAdjacentHTML("afterend",i),t.root=null!==(l=s.nextSibling)&&void 0!==l?l:void 0}}else if(Array.isArray(t))if(e===we.After)for(let i=t.length-1;i>=0;i--)r(t[i],s,e);else for(let i=0;i{e===ue.Added?s.classList.add(i):s.classList.remove(i)}),!0);else if("style"===t&&"object"==typeof e&&"isSubscribableMap"in e)e.sub(((t,e,i,n)=>{switch(e){case le.Added:case le.Changed:s.style.setProperty(i,n);break;case le.Deleted:s.style.setProperty(i,null)}}),!0);else if("object"==typeof e&&"isSubscribable"in e)"style"===t&&e instanceof ei?e.sub(((t,e,i)=>{s.style.setProperty(e.toString(),i)}),!0):e.sub((e=>{s.setAttribute(t,e)}),!0);else if("class"===t&&"object"==typeof e)for(const t in e){if(0===t.trim().length)continue;const i=e[t];"object"==typeof i&&"isSubscribable"in i?i.sub((e=>{s.classList.toggle(t,!!e)}),!0):s.classList.toggle(t,!!i)}else if("style"===t&&"object"==typeof e)for(const t in e){if(0===t.trim().length)continue;const i=e[t];"object"==typeof i&&"isSubscribable"in i?i.sub((e=>{s.style.setProperty(t,null!=e?e:"")}),!0):s.style.setProperty(t,null!=i?i:"")}else s.setAttribute(t,e)}a={instance:s,props:n,children:null},a.children=i(a,r)}else if("function"==typeof t)if(null!==r&&null===n?n={children:r}:null!==n&&(n.children=r),"function"==typeof t&&t.name===s.name){let e=t(n);for(;e&&1===e.length&&Array.isArray(e[0]);)e=e[0];a={instance:null,props:n,children:null},e&&(a.children=i(a,e))}else{let e;const s=window._pluginSystem;try{e=t(n)}catch(i){let r;void 0!==s&&(r=s.onComponentCreating(t,n)),e=void 0!==r?r:new t(n)}null!==n&&null!==n.ref&&void 0!==n.ref&&(n.ref.instance=e),void 0!==e.contextType&&(e.context=e.contextType.map((t=>at.create(t.defaultValue)))),void 0!==s&&s.onComponentCreated(e),a={instance:e,props:n,children:[e.render()]}}return a},t.createChildNodes=i,t.createStaticContentNode=n,t.render=r,t.renderBefore=function(t,e){r(t,e,we.Before)},t.renderAfter=function(t,e){r(t,e,we.After)},t.remove=function(t){null!==t&&t.remove()},t.createRef=function(){return new di},t.createContext=function(t){return new pi(t)},t.visitNodes=o,t.parseCssClassesFromString=function(t,e){return t.split(" ").filter((t=>""!==t&&(void 0===e||e(t))))},t.bindCssClassSet=function(t,e,s){const i=new Set(s);return!0===e.isSubscribableSet?function(t,e,s){return 0===s.size?e.sub(((e,s,i)=>{s===ue.Added?t.add(i):t.delete(i)}),!0):e.sub(((e,i,n)=>{s.has(n)||(i===ue.Added?t.add(n):t.delete(n))}),!0)}(t,e,i):function(t,e,s){const i=[];for(const n in e){if(s.has(n))continue;const r=e[n];"object"==typeof r?i.push(r.sub(t.toggle.bind(t,n),!0)):!0===r?t.add(n):t.delete(n)}return i}(t,e,i)},t.addCssClassesToRecord=function(e,s,i=!0,n){if(""===s)return e;if("string"==typeof s&&(s=t.parseCssClassesFromString(s,n),n=void 0),"function"==typeof s[Symbol.iterator])for(const t of s)!i&&void 0!==e[t]||n&&!n(t)||(e[t]=!0);else for(const t in s)!i&&void 0!==e[t]||n&&!n(t)||(e[t]=s[t]);return e},t.bindStyleMap=function(t,e,s){const i=new Set(s);return!0===e.isSubscribableMap?function(t,e,s){return 0===s.size?e.pipe(t):e.sub(((e,i,n,r)=>{if(!s.has(n))switch(i){case le.Added:case le.Changed:t.setValue(n,r);break;case le.Deleted:t.delete(n)}}),!0)}(t,e,i):e instanceof ei?function(t,e,s){return e.sub(((e,i,n)=>{s.has(i)||(n?t.setValue(i,n):t.delete(i))}),!0)}(t,e,i):function(t,e,s){const i=[];for(const n in e){if(s.has(n))continue;const r=e[n];"object"==typeof r?i.push(r.sub((e=>{e?t.setValue(n,e):t.delete(n)}),!0)):r?t.setValue(n,r):t.delete(n)}return i}(t,e,i)},t.shallowDestroy=function(e){t.visitNodes(e,(t=>t!==e&&t.instance instanceof ui&&(t.instance.destroy(),!0)))},t.EmptyHandler=()=>{}}(Le||(Le={})),Le.Fragment;class mi extends ui{constructor(){var t,e,s,i,n,r,a,o;super(...arguments),this.modeFlags=this.props.mode===EBingMode.HORIZON?4:0,this.isListenerRegistered=!1,this.imgRef=Le.createRef(),this.uid=0,this._isBound=!1,this._isAwake=!0,this.isDestroyed=!1,this.pos=new LatLong(0,0),this.radius=10,this.resolution=null!==(t=this.props.resolution)&&void 0!==t?t:Pt.create(Tt.create(mi.DEFAULT_RESOLUTION,mi.DEFAULT_RESOLUTION)),this.earthColors=null!==(e=this.props.earthColors)&&void 0!==e?e:Js.create(Is.create(2,(()=>mi.hexaToRGBColor("#000000")))),this.earthColorsElevationRange=null!==(s=this.props.earthColorsElevationRange)&&void 0!==s?s:Pt.create(Tt.create(0,3e4)),this.skyColor=null!==(i=this.props.skyColor)&&void 0!==i?i:at.create(mi.hexaToRGBColor("#000000")),this.reference=null!==(n=this.props.reference)&&void 0!==n?n:at.create(EBingReference.SEA),this.wxrMode=null!==(r=this.props.wxrMode)&&void 0!==r?r:at.create({mode:EWeatherRadar.OFF,arcRadians:.5}),this.wxrColors=null!==(a=this.props.wxrColors)&&void 0!==a?a:Js.create(Array.from(mi.DEFAULT_WEATHER_COLORS)),this.isoLines=null!==(o=this.props.isoLines)&&void 0!==o?o:at.create(!1),this.wxrColorsArray=[],this.wxrRateArray=[],this.resolutionHandler=t=>{Coherent.call("SET_MAP_RESOLUTION",this.uid,t[0],t[1]),this.positionRadiusInhibitFramesRemaining=mi.POSITION_RADIUS_INHIBIT_FRAMES,this.positionRadiusInhibitTimer.isPending()||this.positionRadiusInhibitTimer.schedule(this.processPendingPositionRadius,0)},this.earthColorsHandler=()=>{const t=this.earthColors.getArray();t.length<2||Coherent.call("SET_MAP_HEIGHT_COLORS",this.uid,t)},this.earthColorsElevationRangeHandler=()=>{const t=this.earthColors.getArray();if(t.length<2)return;const e=this.earthColorsElevationRange.get(),s=t.length-1,i=(e[1]-e[0])/Math.max(s-1,1),n=e[0]-i,r=e[1]+i;Coherent.call("SET_MAP_ALTITUDE_RANGE",this.uid,n,r)},this.skyColorHandler=t=>{Coherent.call("SET_MAP_CLEAR_COLOR",this.uid,t)},this.referenceHandler=t=>{const e=this.modeFlags|(t===EBingReference.PLANE?1:0);this.mapListener.trigger("JS_BIND_BINGMAP",this.props.id,e)},this.wxrModeHandler=t=>{Coherent.call("SHOW_MAP_WEATHER",this.uid,t.mode,t.arcRadians)},this.wxrColorsHandler=()=>{const t=this.wxrColors.getArray();if(0!==t.length){this.wxrColorsArray.length=t.length,this.wxrRateArray.length=t.length;for(let e=0;e{Coherent.call("SHOW_MAP_ISOLINES",this.uid,t)},this.setCurrentMapParamsTimer=null,this.positionRadiusInhibitFramesRemaining=0,this.isPositionRadiusPending=!1,this.positionRadiusInhibitTimer=new li,this.processPendingPositionRadius=()=>{this.isPositionRadiusPending&&Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius),--this.positionRadiusInhibitFramesRemaining>0?this.positionRadiusInhibitTimer.schedule(this.processPendingPositionRadius,0):this.isPositionRadiusPending=!1},this.onListenerBound=(t,e)=>{if(!this.isDestroyed&&t.friendlyName===this.props.id){if(this.binder=t,this.uid=e,this._isBound)return;this._isBound=!0,Coherent.call("SHOW_MAP",e,!0);const s=!this._isAwake;this.earthColorsSub=this.earthColors.sub((()=>{this.earthColorsHandler(),this.earthColorsElevationRangeHandler()}),!0,s),this.earthColorsElevationRangeSub=this.earthColorsElevationRange.sub(this.earthColorsElevationRangeHandler,!0,s),this.skyColorSub=this.skyColor.sub(this.skyColorHandler,!0,s),this.referenceSub=this.reference.sub(this.referenceHandler,!0,s),this.wxrModeSub=this.wxrMode.sub(this.wxrModeHandler,!0,s),this.wxrColorsSub=this.wxrColors.sub(this.wxrColorsHandler,!0,s),this.resolutionSub=this.resolution.sub(this.resolutionHandler,!0,s),this.isoLinesSub=this.isoLines.sub(this.isoLinesHandler,!0,s),4!==this.modeFlags&&Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius),this.props.onBoundCallback&&this.props.onBoundCallback(this)}},this.onMapUpdate=(t,e)=>{void 0!==this.binder&&this.uid===t&&null!==this.imgRef.instance&&this.imgRef.instance.src!==e&&(this.imgRef.instance.src=e)},this.setCurrentMapParams=()=>{this.setPositionRadius(this.pos,this.radius)}}isBound(){return this._isBound}isAwake(){return this._isAwake}onAfterRender(){if(window.IsDestroying)return void this.destroy();const t=ot.get(),e=t.get();e===GameState.briefing||e===GameState.ingame?this.registerListener():this.gameStateSub=t.sub((t=>{var e;this.isDestroyed||t!==GameState.briefing&&t!==GameState.ingame||(null===(e=this.gameStateSub)||void 0===e||e.destroy(),this.registerListener())})),window.addEventListener("OnDestroy",this.destroy.bind(this))}registerListener(){var t;(null!==(t=this.props.delay)&&void 0!==t?t:0)>0?setTimeout((()=>{this.isDestroyed||(this.mapListener=RegisterViewListener("JS_LISTENER_MAPS",this.onListenerRegistered.bind(this)))}),this.props.delay):this.mapListener=RegisterViewListener("JS_LISTENER_MAPS",this.onListenerRegistered.bind(this))}onListenerRegistered(){this.isDestroyed||this.isListenerRegistered||(this.mapListener.on("MapBinded",this.onListenerBound),this.mapListener.on("MapUpdated",this.onMapUpdate),this.isListenerRegistered=!0,this.mapListener.trigger("JS_BIND_BINGMAP",this.props.id,this.modeFlags))}wake(){var t,e,s,i,n,r,a,o;this._isAwake=!0,this._isBound&&(this.setCurrentMapParams(),4!==this.modeFlags&&(this.setCurrentMapParamsTimer=setInterval(this.setCurrentMapParams,200)),null===(t=this.earthColorsSub)||void 0===t||t.resume(!0),null===(e=this.earthColorsElevationRangeSub)||void 0===e||e.resume(!0),null===(s=this.skyColorSub)||void 0===s||s.resume(!0),null===(i=this.referenceSub)||void 0===i||i.resume(!0),null===(n=this.wxrModeSub)||void 0===n||n.resume(!0),null===(r=this.wxrColorsSub)||void 0===r||r.resume(!0),null===(a=this.resolutionSub)||void 0===a||a.resume(!0),null===(o=this.isoLinesSub)||void 0===o||o.resume(!0))}sleep(){var t,e,s,i,n,r,a,o;this._isAwake=!1,this._isBound&&(null!==this.setCurrentMapParamsTimer&&clearInterval(this.setCurrentMapParamsTimer),null===(t=this.earthColorsSub)||void 0===t||t.pause(),null===(e=this.earthColorsElevationRangeSub)||void 0===e||e.pause(),null===(s=this.skyColorSub)||void 0===s||s.pause(),null===(i=this.referenceSub)||void 0===i||i.pause(),null===(n=this.wxrModeSub)||void 0===n||n.pause(),null===(r=this.wxrColorsSub)||void 0===r||r.pause(),null===(a=this.resolutionSub)||void 0===a||a.pause(),null===(o=this.isoLinesSub)||void 0===o||o.pause())}setPositionRadius(t,e){this.pos=t,this.radius=Math.max(e,10),this._isBound&&this._isAwake&&(this.positionRadiusInhibitFramesRemaining>0?this.isPositionRadiusPending=!0:Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius))}render(){var t;return Le.buildComponent("img",{ref:this.imgRef,src:"",style:"position: absolute; left: 0; top: 0; width: 100%; height: 100%;",class:null!==(t=this.props.class)&&void 0!==t?t:""})}destroy(){var t,e,s,i,n,r,a,o,c,h,l,u,d;this.isDestroyed=!0,this._isBound=!1,null!==this.setCurrentMapParamsTimer&&clearInterval(this.setCurrentMapParamsTimer),null===(t=this.gameStateSub)||void 0===t||t.destroy(),null===(e=this.earthColorsSub)||void 0===e||e.destroy(),null===(s=this.earthColorsElevationRangeSub)||void 0===s||s.destroy(),null===(i=this.skyColorSub)||void 0===i||i.destroy(),null===(n=this.referenceSub)||void 0===n||n.destroy(),null===(r=this.wxrModeSub)||void 0===r||r.destroy(),null===(a=this.wxrColorsSub)||void 0===a||a.destroy(),null===(o=this.resolutionSub)||void 0===o||o.destroy(),null===(c=this.isoLinesSub)||void 0===c||c.destroy(),null===(h=this.mapListener)||void 0===h||h.off("MapBinded",this.onListenerBound),null===(l=this.mapListener)||void 0===l||l.off("MapUpdated",this.onMapUpdate),null===(u=this.mapListener)||void 0===u||u.trigger("JS_UNBIND_BINGMAP",this.props.id),this.isListenerRegistered=!1,this.imgRef.instance.src="",null===(d=this.imgRef.instance.parentNode)||void 0===d||d.removeChild(this.imgRef.instance),super.destroy()}resetImgSrc(){const t=this.imgRef.getOrDefault();if(null!==t){const e=t.src;t.src="",t.src=e}}static hexaToRGBColor(t){const e=t;let s=0;"#"===e[0]&&(s=1);const i=parseInt(e.substr(0+s,2),16),n=parseInt(e.substr(2+s,2),16),r=parseInt(e.substr(4+s,2),16);return mi.rgbColor(i,n,r)}static rgbToHexaColor(t,e=!0){const s=Math.floor(t%16777216/65536),i=Math.floor(t%65536/256);return`${e?"#":""}${(t%256).toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}static rgbColor(t,e,s){return 65536*s+256*e+t}static hexaToRGBAColor(t){const e=t;let s=0;"#"===e[0]&&(s=1);const i=parseInt(e.substr(0+s,2),16),n=parseInt(e.substr(2+s,2),16),r=parseInt(e.substr(4+s,2),16),a=parseInt(e.substr(6+s,2),16);return mi.rgbaColor(i,n,r,a)}static rgbaToHexaColor(t,e=!0){const s=Math.floor(t%4294967296/16777216),i=Math.floor(t%16777216/65536),n=Math.floor(t%65536/256);return`${e?"#":""}${(t%256).toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}static rgbaColor(t,e,s,i){return 16777216*i+65536*s+256*e+t}static createEarthColorsArray(t,e,s=0,i=3e4,n=61){const r=[mi.hexaToRGBColor(t)],a=new Avionics.Curve;a.interpolationFunction=Avionics.CurveTool.StringColorRGBInterpolation;for(let t=0;tt.toFixed(0),unitFormatter:(t,e)=>e.name[0],useMinusSign:!1,forceSign:!1,nanString:""},function(t){t.NORTH="N",t.SOUTH="S",t.WEST="W",t.EAST="E"}(De||(De={})),function(t){t.MostRecent="MostRecent",t.First="First",t.Last="Last",t.None="None"}(Oe||(Oe={})),function(t){t.First="First",t.Last="Last",t.Next="Next",t.Prev="Prev",t.None="None"}(Ue||(Ue={})),function(t){t[t.Position=1]="Position",t[t.Altitude=2]="Altitude",t[t.Heading=4]="Heading",t[t.Pitch=8]="Pitch",t[t.Roll=16]="Roll",t[t.Offset=32]="Offset",t[t.ProjectedSize=64]="ProjectedSize",t[t.Fov=128]="Fov",t[t.FovEndpoints=256]="FovEndpoints",t[t.PitchScaleFactor=512]="PitchScaleFactor",t[t.HeadingScaleFactor=1024]="HeadingScaleFactor",t[t.ScaleFactor=2048]="ScaleFactor",t[t.ProjectedOffset=4096]="ProjectedOffset",t[t.OffsetCenterProjected=8192]="OffsetCenterProjected"}(Ve||(Ve={})),Ve.PitchScaleFactor,Ve.HeadingScaleFactor,Tt.create(),St.create(),new wt(0,0),St.create(),St.create(),function(t){t[t.None=0]="None",t[t.Ingress=1]="Ingress",t[t.Base=2]="Base",t[t.Egress=4]="Egress",t[t.All=7]="All"}(xe||(xe={})),new wt(0,0),new wt(0,0),new Lt(new Float64Array(3),0);class gi{constructor(t){this.params=new Float64Array(t),this.cachedParams=new Float64Array(t)}resolve(){return void 0!==this.stringValue&&Ct.equals(this.params,this.cachedParams)||(Ct.copy(this.params,this.cachedParams),this.stringValue=this.buildString(this.params)),this.stringValue}}class yi extends gi{constructor(){super(yi.DEFAULT_PARAMS)}set(t,e,s,i,n,r){let a;"number"==typeof t?a=t:[a,s,e,i,n,r]=t.getParameters(),this.params[0]=a,this.params[1]=e,this.params[2]=s,this.params[3]=i,this.params[4]=n,this.params[5]=r}buildString(t){return`matrix(${t.join(", ")})`}}yi.DEFAULT_PARAMS=[1,0,0,1,0,0];class vi extends gi{constructor(t){super(vi.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`rotate(${t[0]}${this.unit})`}}vi.DEFAULT_PARAMS=[0];class _i extends gi{constructor(t){super(_i.DEFAULT_PARAMS),this.unit=t}set(t,e,s,i,n=0){this.params[0]=t,this.params[1]=e,this.params[2]=s,this.params[3]=0===n?i:ut.round(i,n)}buildString(t){return`rotate3d(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}${this.unit})`}}_i.DEFAULT_PARAMS=[0,0,1,0];class bi extends gi{constructor(t){super(bi.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`translateX(${t[0]}${this.unit})`}}bi.DEFAULT_PARAMS=[0];class Ti extends gi{constructor(t){super(Ti.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`translateY(${t[0]}${this.unit})`}}Ti.DEFAULT_PARAMS=[0];class Si extends gi{constructor(t){super(Si.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`translateZ(${t[0]}${this.unit})`}}Si.DEFAULT_PARAMS=[0];class Ci extends gi{constructor(t,e=t){super(Ci.DEFAULT_PARAMS),this.unitX=t,this.unitY=e}set(t,e,s=0,i=s){this.params[0]=0===s?t:ut.round(t,s),this.params[1]=0===i?e:ut.round(e,i)}buildString(t){return`translate(${t[0]}${this.unitX}, ${t[1]}${this.unitY})`}}Ci.DEFAULT_PARAMS=[0,0];class Ri extends gi{constructor(t,e=t,s=t){super(Ri.DEFAULT_PARAMS),this.unitX=t,this.unitY=e,this.unitZ=s}set(t,e,s,i=0,n=i,r=i){this.params[0]=0===i?t:ut.round(t,i),this.params[1]=0===n?e:ut.round(e,n),this.params[2]=0===r?s:ut.round(s,r)}buildString(t){return`translate3d(${t[0]}${this.unitX}, ${t[1]}${this.unitY}, ${t[2]}${this.unitZ})`}}Ri.DEFAULT_PARAMS=[0,0,0];class Ei extends gi{constructor(){super(Ei.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`scaleX(${t[0]})`}}Ei.DEFAULT_PARAMS=[1];class Pi extends gi{constructor(){super(Pi.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`scaleY(${t[0]})`}}Pi.DEFAULT_PARAMS=[1];class Ii extends gi{constructor(){super(Ii.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:ut.round(t,e)}buildString(t){return`scaleZ(${t[0]})`}}Ii.DEFAULT_PARAMS=[1];class Ni extends gi{constructor(){super(Ni.DEFAULT_PARAMS)}set(t,e,s=0,i=s){this.params[0]=0===s?t:ut.round(t,s),this.params[1]=0===i?e:ut.round(e,i)}buildString(t){return`scale(${t[0]}, ${t[1]})`}}Ni.DEFAULT_PARAMS=[1,1];class wi extends gi{constructor(){super(wi.DEFAULT_PARAMS)}set(t,e,s,i=0,n=i,r=i){this.params[0]=0===i?t:ut.round(t,i),this.params[1]=0===n?e:ut.round(e,n),this.params[2]=0===r?s:ut.round(e,r)}buildString(t){return`scale3d(${t[0]}, ${t[1]}, ${t[2]})`}}wi.DEFAULT_PARAMS=[1,1,1];class Li{constructor(...t){this.stringValues=[],this.transforms=t}getChild(t){if(t<0||t>=this.transforms.length)throw new RangeError;return this.transforms[t]}resolve(){let t=!1;for(let e=0;e=i[e]&&s[e]<=i[e+2]){r=s;break}}for(let t=0;t<4;t++)if(s&1<=i[e]&&s[e]<=i[e+2]){a=s;break}}}else{for(let t=0;t<4;t++)if(this.prevPointOutcode&1<=e&&l<=o){const e=m[A];e.point[n]=h[i],e.point[r]=l;const o=n*Math.PI/2+(null!=p?p:p=Math.acos(ut.clamp(u/s,-1,1)))*t;e.radial=(o+a)%a,A++}}{const l=c-d;if(l>=e&&l<=o){const e=m[A];e.point[n]=h[i],e.point[r]=l;const o=n*Math.PI/2-(null!=p?p:p=Math.acos(ut.clamp(u/s,-1,1)))*t;e.radial=(o+a)%a,A++}}}}if(A>1){for(let t=A;t=0){let i=c;for(let a=0;a=i){i=0;break}const l=y+h*o;g?this.consumer.moveTo(c.point[0],c.point[1]):this.consumer.arc(t,e,s,y,l,r),g=!g,y=l,i=(n-y)*o}}g?f===Ge.Inside&&this.consumer.moveTo(p[0],p[1]):this.consumer.arc(t,e,s,y,n,r),Tt.copy(p,this.prevPoint),this.prevPointOutcode=f}closePath(){isNaN(this.firstPoint[0])||this.lineTo(this.firstPoint[0],this.firstPoint[1])}reset(){Tt.set(NaN,NaN,this.firstPoint),Tt.set(NaN,NaN,this.prevPoint),this.prevPointOutcode=0}getOutcode(t,e){const s=this.bounds.get();let i=0;return ts[2]&&(i|=Ge.Right),es[3]&&(i|=Ge.Bottom),i}onBoundsChanged(){const t=this.bounds.get();St.set(1,0,-t[0],this.boundsLines[0]),St.set(0,1,-t[1],this.boundsLines[1]),St.set(1,0,-t[2],this.boundsLines[2]),St.set(0,1,-t[3],this.boundsLines[3]),this.isBoundingRectNonZero=t[0]({point:new Float64Array(2),radial:1/0})));class xi extends Ui{constructor(t,e,s,i,n){super(t),this.projection=e,this.firstPoint=new wt(NaN,NaN),this.prevPoint=new wt(NaN,NaN),this.prevPointProjected=new Float64Array(2),this.resampleHandler=this.onResampled.bind(this),this.resampler=s instanceof Ds?s:new Ds(s,i,n)}getProjection(){return this.projection}setProjection(t){this.projection=t}beginPath(){this.reset(),this.consumer.beginPath()}moveTo(t,e){if(!isFinite(t)||!isFinite(e))return;isNaN(this.firstPoint.lat)&&this.firstPoint.set(e,t),this.prevPoint.set(e,t);const s=this.projection.project(this.prevPoint,this.prevPointProjected);this.consumer.moveTo(s[0],s[1])}lineTo(t,e){if(!isFinite(t)||!isFinite(e))return;if(!isNaN(this.prevPoint.lat)&&this.prevPoint.equals(e,t))return;if(isNaN(this.prevPoint.lat))return void this.moveTo(t,e);const s=xi.geoPointCache[0].set(e,t),i=xi.geoCircleCache[0].setAsGreatCircle(this.prevPoint,s);if(!isFinite(i.center[0]))throw new Error(`Cannot unambiguously path a great circle from ${this.prevPoint.lat} lat, ${this.prevPoint.lon} lon to ${e} lat, ${t} lon`);this.resampler.resample(this.projection,i,this.prevPoint,s,this.resampleHandler),this.prevPoint.set(e,t)}bezierCurveTo(){throw new Error("GeodesicResamplerStream: bezierCurveTo() is not supported")}quadraticCurveTo(){throw new Error("GeodesicResamplerStream: quadraticCurveTo() is not supported")}arc(t,e,s,i,n,r){if(!(isFinite(t)&&isFinite(e)&&isFinite(s)&&isFinite(i)&&isFinite(n)))return;if(0===s||Math.abs(i-n)<=Lt.ANGULAR_TOLERANCE*Avionics.Utils.RAD2DEG)return;if(ut.diffAngle(i*Avionics.Utils.DEG2RAD,n*Avionics.Utils.DEG2RAD,!1)<=Lt.ANGULAR_TOLERANCE){const a=i+180*Math.sign(n-i);return this.arc(t,e,s,i,a,r),void this.arc(t,e,s,a,n,r)}const a=xi.geoPointCache[1].set(e,t),o=xi.geoPointCache[2],c=xi.geoPointCache[3];if(Math.abs(e)>=90-Lt.ANGULAR_TOLERANCE*Avionics.Utils.RAD2DEG){const t=Math.sign(e)*(ut.HALF_PI-s)*Avionics.Utils.RAD2DEG;o.set(t,i),c.set(t,n)}else a.offset(i,s,o),a.offset(n,s,c);if(isNaN(o.lat)||isNaN(o.lon)||isNaN(c.lat)||isNaN(c.lon))return;isNaN(this.prevPoint.lat)?this.moveTo(o.lon,o.lat):o.equals(this.prevPoint)||this.lineTo(o.lon,o.lat);const h=xi.geoCircleCache[0].set(a,s);r||h.reverse(),this.resampler.resample(this.projection,h,o,c,this.resampleHandler),this.prevPoint.set(c)}closePath(){isNaN(this.firstPoint.lat)||this.lineTo(this.firstPoint.lon,this.firstPoint.lat)}reset(){this.firstPoint.set(NaN,NaN),this.prevPoint.set(NaN,NaN)}onResampled(t){switch(t.type){case"start":return;case"line":this.consumer.lineTo(t.projected[0],t.projected[1]);break;case"arc":this.consumer.arc(t.projectedArcCenter[0],t.projectedArcCenter[1],t.projectedArcRadius,t.projectedArcStartAngle,t.projectedArcEndAngle,t.projectedArcStartAngle>t.projectedArcEndAngle)}Tt.copy(t.projected,this.prevPointProjected)}}xi.geoPointCache=[new wt(0,0),new wt(0,0),new wt(0,0),new wt(0,0)],xi.geoCircleCache=[new Lt(new Float64Array(3),0)];class Gi extends Ui{constructor(){super(...arguments),this.transform=new Rt,this.concatCache=[],this.scale=1,this.rotation=0}addTranslation(t,e,s="after"){const i=Gi.transformCache[0].toTranslation(t,e);return"before"===s?(this.concatCache[0]=i,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=i),Rt.concat(this.transform,this.concatCache),this}addScale(t,e="after"){const s=Gi.transformCache[0].toScale(t,t);return"before"===e?(this.concatCache[0]=s,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=s),Rt.concat(this.transform,this.concatCache),this.updateScaleRotation(),this}addRotation(t,e="after"){const s=Gi.transformCache[0].toRotation(t);return"before"===e?(this.concatCache[0]=s,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=s),Rt.concat(this.transform,this.concatCache),this.updateScaleRotation(),this}resetTransform(){return this.transform.toIdentity(),this.updateScaleRotation(),this}beginPath(){this.consumer.beginPath()}moveTo(t,e){const s=this.applyTransform(t,e);this.consumer.moveTo(s[0],s[1])}lineTo(t,e){const s=this.applyTransform(t,e);this.consumer.lineTo(s[0],s[1])}bezierCurveTo(t,e,s,i,n,r){const a=this.applyTransform(t,e);t=a[0],e=a[1];const o=this.applyTransform(s,i);s=o[0],i=o[1];const c=this.applyTransform(n,r);n=c[0],r=c[1],this.consumer.bezierCurveTo(t,e,s,i,n,r)}quadraticCurveTo(t,e,s,i){const n=this.applyTransform(t,e);t=n[0],e=n[1];const r=this.applyTransform(s,i);s=r[0],i=r[1],this.consumer.quadraticCurveTo(t,e,s,i)}arc(t,e,s,i,n,r){const a=this.applyTransform(t,e);this.consumer.arc(a[0],a[1],s*this.scale,i+this.rotation,n+this.rotation,r)}closePath(){this.consumer.closePath()}updateScaleRotation(){const t=this.transform.getParameters();this.scale=Math.sqrt(t[0]*t[0]+t[3]*t[3]),this.rotation=Math.atan2(t[3],t[0])}applyTransform(t,e){const s=Tt.set(t,e,Gi.vec2Cache[0]);return this.transform.apply(s,s)}}Gi.vec2Cache=[new Float64Array(2)],Gi.transformCache=[new Rt];class ki extends Ui{constructor(){super(...arguments),this.stack=[]}push(t){var e;t.setConsumer(null!==(e=this.stack[this.stack.length-1])&&void 0!==e?e:this.consumer),this.stack.push(t)}pop(){const t=this.stack.pop();return null==t||t.setConsumer(Oi.INSTANCE),t}unshift(t){const e=this.stack[0];null==e||e.setConsumer(t),t.setConsumer(this.consumer),this.stack.unshift(t)}shift(){var t;const e=this.stack.shift();return null==e||e.setConsumer(Oi.INSTANCE),null===(t=this.stack[0])||void 0===t||t.setConsumer(this.consumer),e}setConsumer(t){var e;null===(e=this.stack[0])||void 0===e||e.setConsumer(t),super.setConsumer(t)}beginPath(){var t;(null!==(t=this.stack[this.stack.length-1])&&void 0!==t?t:this.consumer).beginPath()}moveTo(t,e){var s;(null!==(s=this.stack[this.stack.length-1])&&void 0!==s?s:this.consumer).moveTo(t,e)}lineTo(t,e){var s;(null!==(s=this.stack[this.stack.length-1])&&void 0!==s?s:this.consumer).lineTo(t,e)}bezierCurveTo(t,e,s,i,n,r){var a;(null!==(a=this.stack[this.stack.length-1])&&void 0!==a?a:this.consumer).bezierCurveTo(t,e,s,i,n,r)}quadraticCurveTo(t,e,s,i){var n;(null!==(n=this.stack[this.stack.length-1])&&void 0!==n?n:this.consumer).quadraticCurveTo(t,e,s,i)}arc(t,e,s,i,n,r){var a;(null!==(a=this.stack[this.stack.length-1])&&void 0!==a?a:this.consumer).arc(t,e,s,i,n,r)}closePath(){this.stack[this.stack.length-1].closePath()}}new Lt(new Float64Array(3),0),new Lt(new Float64Array(3),0);class Bi extends Ui{constructor(t,e,s,i,n){super(t),this.postStack=new ki(t),this.projectionStream=s instanceof Ds?new xi(this.postStack,e,s):new xi(this.postStack,e,s,i,n),this.preStack=new ki(this.projectionStream)}getProjection(){return this.projectionStream.getProjection()}setProjection(t){this.projectionStream.setProjection(t)}pushPreProjected(t){this.preStack.push(t)}popPreProjected(){return this.preStack.pop()}unshiftPreProjected(t){this.preStack.unshift(t)}shiftPreProjected(){return this.preStack.shift()}pushPostProjected(t){this.postStack.push(t)}popPostProjected(){return this.postStack.pop()}unshiftPostProjected(t){this.postStack.unshift(t)}shiftPostProjected(){return this.postStack.shift()}setConsumer(t){this.postStack.setConsumer(t),super.setConsumer(t)}beginPath(){this.preStack.beginPath()}moveTo(t,e){this.preStack.moveTo(t,e)}lineTo(t,e){this.preStack.lineTo(t,e)}bezierCurveTo(t,e,s,i,n,r){this.preStack.bezierCurveTo(t,e,s,i,n,r)}quadraticCurveTo(t,e,s,i){this.preStack.quadraticCurveTo(t,e,s,i)}arc(t,e,s,i,n,r){this.preStack.arc(t,e,s,i,n,r)}closePath(){this.preStack.closePath()}}class Hi extends ui{constructor(){super(...arguments),this._isVisible=!0}isVisible(){return this._isVisible}setVisible(t){this._isVisible!==t&&(this._isVisible=t,this.onVisibilityChanged(t))}onVisibilityChanged(t){}onAttached(){}onWake(){}onSleep(){}onMapProjectionChanged(t,e){}onUpdated(t,e){}onDetached(){}}!function(t){t[t.Target=1]="Target",t[t.Center=2]="Center",t[t.TargetProjected=4]="TargetProjected",t[t.Range=8]="Range",t[t.RangeEndpoints=16]="RangeEndpoints",t[t.ScaleFactor=32]="ScaleFactor",t[t.Rotation=64]="Rotation",t[t.ProjectedSize=128]="ProjectedSize",t[t.ProjectedResolution=256]="ProjectedResolution"}(ke||(ke={})),gt.GA_RADIAN.convertTo(1,gt.NMILE),new wt(0,0),new wt(0,0),St.create(),new wt(0,0),new wt(0,0),Tt.create(),Tt.create(),St.create(),St.create(),new wt(0,0),new Rt,new Rt,new wt(0,0),function(t){t.HeadingUp="HeadingUp",t.TrackUp="TrackUp",t.MapUp="MapUp"}(Be||(Be={}));class Wi{constructor(t,e,s){this.canvas=t,this.context=e,this.isDisplayed=s}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}reset(){const t=this.canvas.width;this.canvas.width=0,this.canvas.width=t}}class ji extends Hi{constructor(){super(...arguments),this.displayCanvasRef=Le.createRef(),this.width=0,this.height=0,this.displayCanvasContext=null,this.isInit=!1}get display(){if(!this._display)throw new Error("MapCanvasLayer: attempted to access display before it was initialized");return this._display}get buffer(){if(!this._buffer)throw new Error("MapCanvasLayer: attempted to access buffer before it was initialized");return this._buffer}tryGetDisplay(){return this._display}tryGetBuffer(){return this._buffer}getWidth(){return this.width}getHeight(){return this.height}setWidth(t){t!==this.width&&(this.width=t,this.isInit&&this.updateCanvasSize())}setHeight(t){t!==this.height&&(this.height=t,this.isInit&&this.updateCanvasSize())}copyBufferToDisplay(){this.isInit&&this.props.useBuffer&&this.display.context.drawImage(this.buffer.canvas,0,0,this.width,this.height)}onAfterRender(){this.displayCanvasContext=this.displayCanvasRef.instance.getContext("2d")}onVisibilityChanged(t){this.isInit&&this.updateCanvasVisibility()}updateFromVisibility(){this.display.canvas.style.display=this.isVisible()?"block":"none"}onAttached(){this.initCanvasInstances(),this.isInit=!0,this.updateCanvasVisibility(),this.updateCanvasSize()}initCanvasInstances(){if(this._display=this.createCanvasInstance(this.displayCanvasRef.instance,this.displayCanvasContext,!0),this.props.useBuffer){const t=document.createElement("canvas"),e=t.getContext("2d");this._buffer=this.createCanvasInstance(t,e,!1)}}createCanvasInstance(t,e,s){return new Wi(t,e,s)}updateCanvasSize(){const t=this.display.canvas;if(t.width=this.width,t.height=this.height,t.style.width=`${this.width}px`,t.style.height=`${this.height}px`,this._buffer){const t=this._buffer.canvas;t.width=this.width,t.height=this.height}}updateCanvasVisibility(){this.display.canvas.style.display=this.isVisible()?"block":"none"}render(){var t;return Le.buildComponent("canvas",{ref:this.displayCanvasRef,class:null!==(t=this.props.class)&&void 0!==t?t:"",width:"0",height:"0",style:"position: absolute;"})}}class $i extends ji{onAttached(){super.onAttached(),this.updateFromProjectedSize(this.props.mapProjection.getProjectedSize())}updateFromProjectedSize(t){this.setWidth(t[0]),this.setHeight(t[1]);const e=this.display.canvas;e.style.left="0px",e.style.top="0px"}onMapProjectionChanged(t,e){lt.isAll(e,ke.ProjectedSize)&&this.updateFromProjectedSize(t.getProjectedSize())}}class Yi{constructor(){this._center=new wt(0,0),this._scaleFactor=1,this._rotation=0}get center(){return this._center.readonly}get scaleFactor(){return this._scaleFactor}get rotation(){return this._rotation}syncWithMapProjection(t){this._center.set(t.getCenter()),this._scaleFactor=t.getScaleFactor(),this._rotation=t.getRotation()}syncWithReference(t){this._center.set(t.center),this._scaleFactor=t.scaleFactor,this._rotation=t.rotation}}class zi{constructor(){this._scale=0,this._rotation=0,this._translation=new Float64Array(2),this._margin=0,this._marginRemaining=0}get scale(){return this._scale}get rotation(){return this._rotation}get translation(){return this._translation}get margin(){return this._margin}get marginRemaining(){return this._marginRemaining}update(t,e,s){this._scale=t.getScaleFactor()/e.scaleFactor,this._rotation=t.getRotation()-e.rotation,t.project(e.center,this._translation),Tt.sub(this._translation,t.getCenterProjected(),this._translation),this._margin=s*this._scale,this._marginRemaining=this._margin-Math.max(Math.abs(this._translation[0]),Math.abs(this._translation[1]))}copyFrom(t){this._scale=t.scale,this._rotation=t.rotation,this._translation.set(t.translation),this._margin=t.margin}}class qi extends Wi{constructor(t,e,s,i){super(t,e,s),this.getReferenceMargin=i,this._reference=new Yi,this._transform=new zi,this._isInvalid=!1,this._geoProjection=new Ms,this.canvasTransform=Fi.create(Mi.concat(Mi.scale(),Mi.translate("px"),Mi.rotate("rad"))),this.canvasTransform.sub((t=>{this.canvas.style.transform=t}),!0)}get reference(){return this._reference}get transform(){return this._transform}get isInvalid(){return this._isInvalid}get geoProjection(){return this._geoProjection}syncWithMapProjection(t){const e=Tt.set(this.canvas.width/2,this.canvas.height/2,qi.tempVec2_1);this._reference.syncWithMapProjection(t),this._geoProjection.copyParametersFrom(t.getGeoProjection()).setTranslation(e),this._transform.update(t,this.reference,this.getReferenceMargin()),this._isInvalid=!1,this.isDisplayed&&this.transformCanvasElement()}syncWithCanvasInstance(t){this._reference.syncWithReference(t.reference),this._geoProjection.copyParametersFrom(t.geoProjection),this._transform.copyFrom(t.transform),this._isInvalid=t.isInvalid,this.isDisplayed&&!this._isInvalid&&this.transformCanvasElement()}updateTransform(t){if(this._transform.update(t,this.reference,this.getReferenceMargin()),!this._isInvalid){const e=t.getScaleFactor()/this._reference.scaleFactor;this._isInvalid=e>=qi.SCALE_INVALIDATION_THRESHOLD||e<=1/qi.SCALE_INVALIDATION_THRESHOLD||this._transform.marginRemaining<0}this.isDisplayed&&!this._isInvalid&&this.transformCanvasElement()}transformCanvasElement(){const t=this.transform,e=t.translation[0]/t.scale,s=t.translation[1]/t.scale;this.canvasTransform.transform.getChild(0).set(t.scale,t.scale,.001),this.canvasTransform.transform.getChild(1).set(e,s,.1),this.canvasTransform.transform.getChild(2).set(t.rotation,1e-4),this.canvasTransform.resolve()}invalidate(){this._isInvalid=!0,this.clear()}}qi.SCALE_INVALIDATION_THRESHOLD=1.2,qi.tempVec2_1=new Float64Array(2);class Ki extends ji{constructor(t){super(t),this.size=0,this.referenceMargin=0,this.needUpdateTransforms=!1,this.props.overdrawFactor=Math.max(1,this.props.overdrawFactor)}getSize(){return this.size}getReferenceMargin(){return this.referenceMargin}onAttached(){super.onAttached(),this.updateFromProjectedSize(this.props.mapProjection.getProjectedSize()),this.needUpdateTransforms=!0}createCanvasInstance(t,e,s){return new qi(t,e,s,this.getReferenceMargin.bind(this))}updateFromProjectedSize(t){const e=t[0],s=t[1],i=Math.hypot(e,s);this.size=i*this.props.overdrawFactor,this.referenceMargin=(this.size-i)/2,this.setWidth(this.size),this.setHeight(this.size);const n=(e-this.size)/2,r=(s-this.size)/2,a=this.display.canvas;a.style.left=`${n}px`,a.style.top=`${r}px`}onMapProjectionChanged(t,e){var s;lt.isAll(e,ke.ProjectedSize)&&(this.updateFromProjectedSize(t.getProjectedSize()),this.display.invalidate(),null===(s=this.tryGetBuffer())||void 0===s||s.invalidate()),this.needUpdateTransforms=!0}onUpdated(t,e){super.onUpdated(t,e),this.needUpdateTransforms&&this.updateTransforms()}updateTransforms(){var t;const e=this.props.mapProjection;this.display.updateTransform(e),null===(t=this.tryGetBuffer())||void 0===t||t.updateTransform(e),this.needUpdateTransforms=!1}}class Xi extends Hi{constructor(){var t,e;super(...arguments),this.canvasLayerRef=Le.createRef(),this.clipBoundsSub=It.createFromVector(new Float64Array(4)),this.facLoader=new xt(Gs.getRepository(this.props.bus),(async()=>{this.searchSession=new Ws(this.props.lodBoundaryCache,await this.facLoader.startNearestSearchSession(z.Boundary),.5),this.isAttached&&this.scheduleSearch(0,!0)})),this.searchedAirspaces=new Map,this.searchDebounceDelay=null!==(t=this.props.searchDebounceDelay)&&void 0!==t?t:Xi.DEFAULT_SEARCH_DEBOUNCE_DELAY,this.renderTimeBudget=null!==(e=this.props.renderTimeBudget)&&void 0!==e?e:Xi.DEFAULT_RENDER_TIME_BUDGET,this.activeRenderProcess=null,this.renderTaskQueueHandler={renderTimeBudget:this.renderTimeBudget,onStarted(){},canContinue(t,e,s){return s{const e=t.asUnit(gt.METER);(ethis.lastDesiredSearchRadius)&&this.scheduleSearch(0,!1)})),this.props.maxSearchItemCount.sub((()=>{this.scheduleSearch(0,!1)})),this.initModuleListeners(),this.isAttached=!0,this.searchSession&&this.scheduleSearch(0,!0)}initModuleListeners(){const t=this.props.model.getModule("airspace");for(const e of Object.values(t.show))e.sub(this.onAirspaceTypeShowChanged.bind(this))}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e),lt.isAll(e,ke.ProjectedSize)&&this.updateClipBounds()}updateClipBounds(){const t=this.canvasLayerRef.instance.getSize();this.clipBoundsSub.set(-Xi.CLIP_BOUNDS_BUFFER,-Xi.CLIP_BOUNDS_BUFFER,t+Xi.CLIP_BOUNDS_BUFFER,t+Xi.CLIP_BOUNDS_BUFFER)}scheduleSearch(t,e){this.searchSession&&(this.searchDebounceTimer=t,this.isSearchScheduled=!0,this.needRefilter||(this.needRefilter=e))}scheduleRender(){this.isRenderScheduled=!0}async searchAirspaces(t){this.isSearchBusy=!0;const e=this.props.mapProjection.getCenter(),s=this.canvasLayerRef.instance.display.canvas.width*Math.SQRT2;this.lastDesiredSearchRadius=gt.GA_RADIAN.convertTo(this.props.mapProjection.getProjectedResolution()*s/2,gt.METER),this.lastSearchRadius=Math.min(this.props.maxSearchRadius.get().asUnit(gt.METER),this.lastDesiredSearchRadius);const i=this.searchSession;t&&i.setFilter(this.getBoundaryFilter());const n=await i.searchNearest(e.lat,e.lon,this.lastSearchRadius,this.props.maxSearchItemCount.get());for(let t=0;t0&&a0}selectLod(t){const e=this.props.lodBoundaryCache.lodDistanceThresholds;let s=e.length-1;for(;s>=0&&!(2*t>=e[s]);)s--;return s}cleanUpRender(){this.canvasLayerRef.instance.buffer.reset(),this.activeRenderProcess=null}renderAirspacesToDisplay(){const t=this.canvasLayerRef.instance.display,e=this.canvasLayerRef.instance.buffer;t.clear(),t.syncWithCanvasInstance(e),this.canvasLayerRef.instance.copyBufferToDisplay()}onRenderPaused(){this.isDisplayInvalidated&&this.renderAirspacesToDisplay()}onRenderFinished(){this.renderAirspacesToDisplay(),this.cleanUpRender(),this.isDisplayInvalidated=!1}onRenderAborted(){this.cleanUpRender()}onAirspaceTypeShowChanged(){this.scheduleSearch(0,!0)}render(){return Le.buildComponent(Ki,{ref:this.canvasLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,useBuffer:!0,overdrawFactor:Math.SQRT2})}}Xi.DEFAULT_SEARCH_DEBOUNCE_DELAY=500,Xi.DEFAULT_RENDER_TIME_BUDGET=.2,Xi.BACKGROUND_RENDER_MARGIN_THRESHOLD=.1,Xi.CLIP_BOUNDS_BUFFER=10,Xi.geoPointCache=[new wt(0,0)],Xi.vec2Cache=[new Float64Array(2)];class Qi{static formatNumber(t,e){if(isNaN(t))return e.nanString;const{precision:s,roundFunc:i,maxDigits:n,forceDecimalZeroes:r,pad:a,showCommas:o,useMinusSign:c,forceSign:h,hideSign:l,cache:u}=e,d=t<0?-1:1,p=Math.abs(t);let f=p;if(0!==s&&(f=i(p/s)*s),u){if(void 0!==e.cachedString&&e.cachedNumber===f)return e.cachedString;e.cachedNumber=f}const m=-1===d?c?"−":"-":"+";let A;if(0!=s){const t=`${s}`,e=t.indexOf(".");A=e>=0?f.toFixed(t.length-e-1):`${f}`}else A=`${p}`;let g=A.indexOf(".");if(!r&&g>=0&&(A=A.replace(Qi.TRAILING_ZERO_REGEX,""),A.indexOf(".")==A.length-1&&(A=A.substring(0,A.length-1))),g=A.indexOf("."),g>=0&&A.length-1>n){const t=Math.max(n-g,0),e=Math.pow(.1,t);A=(i(p/e)*e).toFixed(t)}if(0===a?A=A.replace(Qi.LEADING_ZERO_REGEX,"."):a>1&&(g=A.indexOf("."),g<0&&(g=A.length),A=A.padStart(a+A.length-g,"0")),o){const t=A.split(".");t[0]=t[0].replace(Qi.COMMAS_REGEX,","),A=t.join(".")}return l||!h&&"+"===m||(A=m+A),u&&(e.cachedString=A),A}static resolveOptions(t){var e,s;const i=Object.assign({},t);for(const t in Qi.DEFAULT_OPTIONS)null!==(e=(s=i)[t])&&void 0!==e||(s[t]=Qi.DEFAULT_OPTIONS[t]);return i.roundFunc=Qi.roundFuncs[i.round],i}static create(t){const e=Qi.resolveOptions(t);return t=>Qi.formatNumber(t,e)}}Qi.DEFAULT_OPTIONS={precision:0,round:0,maxDigits:1/0,forceDecimalZeroes:!0,pad:1,showCommas:!1,useMinusSign:!1,forceSign:!1,hideSign:!1,nanString:"NaN",cache:!1},Qi.roundFuncs={[-1]:Math.floor,0:Math.round,1:Math.ceil},Qi.TRAILING_ZERO_REGEX=/0+$/,Qi.LEADING_ZERO_REGEX=/^0\./,Qi.COMMAS_REGEX=/\B(?=(\d{3})+(?!\d))/g;class Zi{constructor(t=0){this.svgPath="",this.firstPoint=new Float64Array([NaN,NaN]),this.prevPoint=new Float64Array([NaN,NaN]),this.precision=t,this.formatter=Qi.create({precision:t,forceDecimalZeroes:!1})}getSvgPath(){return this.svgPath.trim()}getPrecision(){return this.precision}setPrecision(t){this.precision=Math.abs(t),this.formatter=Qi.create({precision:this.precision,forceDecimalZeroes:!1})}beginPath(){this.reset()}moveTo(t,e){isFinite(t)&&isFinite(e)&&(isNaN(this.firstPoint[0])&&Tt.set(t,e,this.firstPoint),this.svgPath+=`M ${this.formatter(t)} ${this.formatter(e)} `,Tt.set(t,e,this.prevPoint))}lineTo(t,e){isFinite(t)&&isFinite(e)&&(isNaN(this.prevPoint[0])?this.moveTo(t,e):(this.svgPath+=`L ${this.formatter(t)} ${this.formatter(e)} `,Tt.set(t,e,this.prevPoint)))}bezierCurveTo(t,e,s,i,n,r){isFinite(n)&&isFinite(r)&&isFinite(t)&&isFinite(e)&&isFinite(s)&&isFinite(i)&&(isNaN(this.prevPoint[0])?this.moveTo(n,r):(this.svgPath+=`C ${this.formatter(t)} ${this.formatter(e)} ${this.formatter(s)} ${this.formatter(i)} ${this.formatter(n)} ${this.formatter(r)} `,Tt.set(n,r,this.prevPoint)))}quadraticCurveTo(t,e,s,i){isFinite(s)&&isFinite(i)&&isFinite(t)&&isFinite(e)&&(isNaN(this.prevPoint[0])?this.moveTo(s,i):(this.svgPath+=`Q ${this.formatter(t)} ${this.formatter(e)} ${this.formatter(s)} ${this.formatter(i)} `,Tt.set(s,i,this.prevPoint)))}arc(t,e,s,i,n,r){if(!(isFinite(t)&&isFinite(e)&&isFinite(s)&&isFinite(i)&&isFinite(n)))return;const a=r?-1:1;if(Math.sign(n-i)!==a){n=i+(r?ut.diffAngle(n,i):ut.diffAngle(i,n))*a}const o=Math.min(ut.TWO_PI,(n-i)*a);if(o===ut.TWO_PI){const n=i+Math.PI*a;return this.arc(t,e,s,i,n,r),void this.arc(t,e,s,n,i,r)}const c=Tt.add(Tt.set(t,e,Zi.vec2Cache[0]),Tt.setFromPolar(s,i,Zi.vec2Cache[2]),Zi.vec2Cache[0]);isNaN(this.prevPoint[0])?this.moveTo(c[0],c[1]):Tt.equals(this.prevPoint,c)||this.lineTo(c[0],c[1]);const h=Tt.add(Tt.set(t,e,Zi.vec2Cache[1]),Tt.setFromPolar(s,n,Zi.vec2Cache[2]),Zi.vec2Cache[1]),l=this.formatter(s);this.svgPath+=`A ${l} ${l} 0 ${o>Math.PI?1:0} ${r?0:1} ${this.formatter(h[0])} ${this.formatter(h[1])} `,Tt.copy(h,this.prevPoint)}closePath(){isNaN(this.firstPoint[0])||this.lineTo(this.firstPoint[0],this.firstPoint[1])}reset(){Tt.set(NaN,NaN,this.firstPoint),Tt.set(NaN,NaN,this.prevPoint),this.svgPath=""}}Zi.vec2Cache=[new Float64Array(2),new Float64Array(2),new Float64Array(2),new Float64Array(2)];class Ji{}Ji.TargetControl="targetControlModerator",Ji.RotationControl="rotationControlModerator",Ji.RangeControl="rangeControlModerator",Ji.ClockUpdate="clockUpdate",Ji.OwnAirplaneProps="ownAirplaneProps",Ji.AutopilotProps="autopilotProps",Ji.AltitudeArc="altitudeArc",Ji.TerrainColors="terrainColors",Ji.Weather="weather",Ji.FollowAirplane="followAirplane",Ji.Rotation="rotation",Ji.OwnAirplaneIcon="ownAirplaneIcon",Ji.OwnAirplaneIconOrientation="ownAirplaneIconOrientation",Ji.TextLayer="text",Ji.TextManager="textManager",Ji.Bing="bing",Ji.WaypointRenderer="waypointRenderer",Ji.IconFactory="iconFactory",Ji.LabelFactory="labelFactory",Ji.NearestWaypoints="nearestWaypoints",Ji.FlightPlan="flightPlan",Ji.FlightPlanner="flightPlanner",Ji.FlightPathRenderer="flightPathRenderer",Ji.Airspace="airspace",Ji.AirspaceManager="airspaceRenderManager",Ji.Traffic="traffic",Ji.DataIntegrity="dataIntegrity",Ji.PlanAirportsLayer="plan-airports",Ji.WaypointDisplayController="WaypointDisplayController";class tn extends Hi{constructor(){var t,e,s,i,n,r,a,o;super(...arguments),this.layerRef=Le.createRef(),this.arcAngularWidth=(null!==(t=this.props.arcAngularWidth)&&void 0!==t?t:tn.DEFAULT_ARC_ANGULAR_WIDTH)*Avionics.Utils.DEG2RAD,this.arcRadius=null!==(e=this.props.arcRadius)&&void 0!==e?e:tn.DEFAULT_ARC_RADIUS,this.strokeWidth=null!==(s=this.props.strokeWidth)&&void 0!==s?s:tn.DEFAULT_STROKE_WIDTH,this.strokeStyle=null!==(i=this.props.strokeStyle)&&void 0!==i?i:tn.DEFAULT_STROKE_STYLE,this.strokeLineCap=null!==(n=this.props.strokeLineCap)&&void 0!==n?n:tn.DEFAULT_STROKE_LINECAP,this.outlineWidth=null!==(r=this.props.outlineWidth)&&void 0!==r?r:tn.DEFAULT_OUTLINE_WIDTH,this.outlineStyle=null!==(a=this.props.outlineStyle)&&void 0!==a?a:tn.DEFAULT_OUTLINE_STYLE,this.outlineLineCap=null!==(o=this.props.outlineLineCap)&&void 0!==o?o:tn.DEFAULT_OUTLINE_LINECAP,this.ownAirplanePropsModule=this.props.model.getModule(Ji.OwnAirplaneProps),this.autopilotModule=this.props.model.getModule(Ji.AutopilotProps),this.vsPrecisionFpm="isSubscribable"in this.props.verticalSpeedPrecision?this.vsPrecisionMap=this.props.verticalSpeedPrecision.map((t=>t.asUnit(gt.FPM))):at.create(this.props.verticalSpeedPrecision.asUnit(gt.FPM)),this.vsThresholdFpm="isSubscribable"in this.props.verticalSpeedThreshold?this.vsThresholdMap=this.props.verticalSpeedThreshold.map((t=>t.asUnit(gt.FPM))):at.create(this.props.verticalSpeedThreshold.asUnit(gt.FPM)),this.altDevThresholdFeet="isSubscribable"in this.props.altitudeDeviationThreshold?this.altDevThresholdMap=this.props.altitudeDeviationThreshold.map((t=>t.asUnit(gt.FOOT))):at.create(this.props.altitudeDeviationThreshold.asUnit(gt.FOOT)),this.vsFpm=this.ownAirplanePropsModule.verticalSpeed.map((t=>t.asUnit(gt.FPM))),this.vsFpmQuantized=bt.create((([t,e])=>Math.round(t/e)*e),this.vsFpm,this.vsPrecisionFpm),this.projectedPlanePosition=Pt.create(Tt.create()),this.projectPlanePositionHandler=()=>{const t=this.props.mapProjection.project(this.ownAirplanePropsModule.position.get(),tn.vec2Cache[0]);this.projectedPlanePosition.set(t)},this.isArcVisibleDynamic=bt.create((([t,e,s,i,n])=>{if(Math.abs(t)=n&&r*t>0}),this.vsFpmQuantized,this.ownAirplanePropsModule.altitude,this.autopilotModule.selectedAltitude,this.vsThresholdFpm,this.altDevThresholdFeet).pause(),this.projectedArcPosition=Pt.create(Tt.create()),this.projectedArcAngle=at.create(0),this.needUpdate=!1,this.subscriptions=[]}onVisibilityChanged(t){var e;null===(e=this.layerRef.getOrDefault())||void 0===e||e.setVisible(t),t&&(this.needUpdate=!0)}onAttached(){var t,e;this.layerRef.instance.onAttached(),this.subscriptions.push(this.ownAirplanePropsModule.position.sub(this.projectPlanePositionHandler));const s=()=>{this.needUpdate=!0},i=this.props.model.getModule(Ji.AltitudeArc),n=this.props.model.getModule(Ji.DataIntegrity);this.isArcVisibleStatic=bt.create((([t,e,s])=>t&&e&&s),i.show,null!==(t=null==n?void 0:n.gpsSignalValid)&&void 0!==t?t:at.create(!0),null!==(e=null==n?void 0:n.adcSignalValid)&&void 0!==e?e:at.create(!0));const r=this.isArcVisibleDynamic.sub((t=>{this.setVisible(t)}),!1,!0);this.isArcVisibleStatic.sub((t=>{t?(this.isArcVisibleDynamic.resume(),r.resume(!0)):(this.isArcVisibleDynamic.pause(),r.pause(),this.setVisible(!1))}),!0),this.subscriptions.push(this.projectedPlanePosition.sub(s),this.ownAirplanePropsModule.trackTrue.sub(s),this.ownAirplanePropsModule.groundSpeed.sub(s),this.ownAirplanePropsModule.altitude.sub(s)),this.vsFpmQuantized.sub(s),this.subscriptions.push(this.autopilotModule.selectedAltitude.sub(s,!0)),this.layerRef.instance.setVisible(this.isVisible())}onMapProjectionChanged(t,e){this.layerRef.instance.onMapProjectionChanged(t,e),this.projectPlanePositionHandler(),this.needUpdate=!0}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.ownAirplanePropsModule.trackTrue.get(),e=this.ownAirplanePropsModule.groundSpeed.get(),s=this.ownAirplanePropsModule.altitude.get(),i=this.autopilotModule.selectedAltitude.get(),n=this.vsFpmQuantized.get(),r=(i.asUnit(gt.FOOT)-s.asUnit(gt.FOOT))/n,a=e.asUnit(gt.FPM)*r,o=gt.FOOT.convertTo(a,gt.GA_RADIAN)/this.props.mapProjection.getProjectedResolution(),c=t*Avionics.Utils.DEG2RAD+this.props.mapProjection.getRotation()-ut.HALF_PI,h=this.projectedPlanePosition.get(),l=Tt.add(Tt.setFromPolar(o,c,tn.vec2Cache[0]),h,tn.vec2Cache[0]);this.projectedArcPosition.set(l),this.projectedArcAngle.set(c),this.layerRef.instance.onUpdated(),this.needUpdate=!1}render(){const t={ref:this.layerRef,model:this.props.model,mapProjection:this.props.mapProjection,arcAngularWidth:this.arcAngularWidth,arcRadius:this.arcRadius,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,strokeLineCap:this.strokeLineCap,outlineWidth:this.outlineWidth,outlineStyle:this.outlineStyle,outlineLineCap:this.outlineLineCap,projectedArcPosition:this.projectedArcPosition,projectedArcAngle:this.projectedArcAngle,class:this.props.class};return"canvas"===this.props.renderMethod?Le.buildComponent(en,Object.assign({},t)):Le.buildComponent(sn,Object.assign({},t))}destroy(){var t,e,s,i,n;null===(t=this.layerRef.getOrDefault())||void 0===t||t.destroy(),null===(e=this.vsPrecisionMap)||void 0===e||e.destroy(),null===(s=this.vsThresholdMap)||void 0===s||s.destroy(),null===(i=this.altDevThresholdMap)||void 0===i||i.destroy(),this.vsFpm.destroy(),null===(n=this.isArcVisibleStatic)||void 0===n||n.destroy(),this.isArcVisibleDynamic.destroy(),this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}tn.DEFAULT_ARC_ANGULAR_WIDTH=60,tn.DEFAULT_ARC_RADIUS=64,tn.DEFAULT_STROKE_WIDTH=2,tn.DEFAULT_STROKE_STYLE="cyan",tn.DEFAULT_STROKE_LINECAP="butt",tn.DEFAULT_OUTLINE_WIDTH=1,tn.DEFAULT_OUTLINE_STYLE="#505050",tn.DEFAULT_OUTLINE_LINECAP="butt",tn.vec2Cache=[new Float64Array(2),new Float64Array(2)];class en extends Hi{constructor(){super(...arguments),this.arcHalfAngularWidth=this.props.arcAngularWidth/2,this.totalArcThickness=this.props.strokeWidth+2*this.props.outlineWidth,this.canvasLayerRef=Le.createRef(),this.subscriptions=[],this.needUpdate=!1}onVisibilityChanged(t){var e,s;t?this.needUpdate=!0:null===(s=null===(e=this.canvasLayerRef.getOrDefault())||void 0===e?void 0:e.tryGetDisplay())||void 0===s||s.clear()}onAttached(){this.canvasLayerRef.instance.onAttached();const t=()=>{this.needUpdate=!0};this.subscriptions.push(this.props.projectedArcPosition.sub(t,!1),this.props.projectedArcAngle.sub(t,!1)),this.needUpdate=!0}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e)}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.props.projectedArcPosition.get(),e=this.canvasLayerRef.instance.display;e.clear();const s=this.props.mapProjection.getProjectedSize(),i=t[0],n=t[1],r=2*this.props.arcRadius;if(i<=-r||i>=s[0]+r||n<=-r||n>=s[1]+r)return;e.context.beginPath();const a=this.props.projectedArcAngle.get(),o=Tt.add(Tt.setFromPolar(-this.props.arcRadius,a,en.vec2Cache[0]),t,en.vec2Cache[0]),c=Tt.add(Tt.setFromPolar(this.props.arcRadius,a-this.arcHalfAngularWidth,en.vec2Cache[1]),o,en.vec2Cache[1]);e.context.moveTo(c[0],c[1]),e.context.arc(o[0],o[1],this.props.arcRadius,a-this.arcHalfAngularWidth,a+this.arcHalfAngularWidth),this.props.outlineWidth>0&&(e.context.lineWidth=this.totalArcThickness,e.context.strokeStyle=this.props.outlineStyle,e.context.lineCap=this.props.outlineLineCap,e.context.stroke()),this.props.strokeWidth>0&&(e.context.lineWidth=this.props.strokeWidth,e.context.strokeStyle=this.props.strokeStyle,e.context.lineCap=this.props.strokeLineCap,e.context.stroke()),this.needUpdate=!1}render(){return Le.buildComponent($i,{ref:this.canvasLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,class:this.props.class})}destroy(){var t;null===(t=this.canvasLayerRef.getOrDefault())||void 0===t||t.destroy(),this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}en.vec2Cache=[new Float64Array(2),new Float64Array(2)];class sn extends Hi{constructor(){super(...arguments),this.arcHalfAngularWidth=this.props.arcAngularWidth/2,this.totalArcThickness=this.props.strokeWidth+2*this.props.outlineWidth,this.width=this.props.arcRadius*(1-Math.cos(this.arcHalfAngularWidth))+this.totalArcThickness+2,this.height=2*this.props.arcRadius*Math.sin(Math.min(this.arcHalfAngularWidth,ut.HALF_PI))+this.totalArcThickness+2,this.svgStyle=ei.create({display:"",position:"absolute",left:this.totalArcThickness/2+1-this.width+"px",top:-this.height/2+"px",width:`${this.width}px`,height:`${this.height}px`,transform:"translate3d(0px, 0px, 0px) rotate(0rad)","transform-origin":`${this.width-(this.totalArcThickness/2+1)}px ${this.height/2}px`}),this.svgTransform=Mi.concat(Mi.translate3d("px"),Mi.rotate("rad")),this.needUpdate=!1,this.subscriptions=[]}onVisibilityChanged(t){t?this.needUpdate=!0:this.svgStyle.set("display","none")}onAttached(){const t=()=>{this.needUpdate=!0};this.subscriptions.push(this.props.projectedArcPosition.sub(t,!1),this.props.projectedArcAngle.sub(t,!1))}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.props.projectedArcPosition.get(),e=this.props.mapProjection.getProjectedSize(),s=t[0],i=t[1],n=2*this.props.arcRadius;s<=-n||s>=e[0]+n||i<=-n||i>=e[1]+n?this.svgStyle.set("display","none"):(this.svgStyle.set("display",""),this.svgTransform.getChild(0).set(s,i,0,.1),this.svgTransform.getChild(1).set(this.props.projectedArcAngle.get(),1e-4),this.svgStyle.set("transform",this.svgTransform.resolve())),this.needUpdate=!1}render(){const t=new Zi(.01),e=new Gi(t);e.beginPath(),e.addRotation(-this.arcHalfAngularWidth).addTranslation(-this.props.arcRadius,0),e.moveTo(this.props.arcRadius,0),e.arc(0,0,this.props.arcRadius,0,this.props.arcAngularWidth);const s=t.getSvgPath();return Le.buildComponent("svg",{viewBox:`${this.totalArcThickness/2+1-this.width} ${-this.height/2} ${this.width} ${this.height}`,style:this.svgStyle,class:this.props.class},Le.buildComponent("path",{d:s,fill:"none",stroke:this.props.outlineStyle,"stroke-width":this.totalArcThickness,"stroke-linecap":this.props.outlineLineCap}),Le.buildComponent("path",{d:s,fill:"none",stroke:this.props.strokeStyle,"stroke-width":this.props.strokeWidth,"stroke-linecap":this.props.strokeLineCap}))}destroy(){this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}class nn extends $i{constructor(){var t,e,s,i,n,r;super(...arguments),this.strokeWidth=null!==(t=this.props.strokeWidth)&&void 0!==t?t:nn.DEFAULT_STROKE_WIDTH,this.strokeStyle=null!==(e=this.props.strokeStyle)&&void 0!==e?e:nn.DEFAULT_STROKE_STYLE,this.strokeDash=null!==(s=this.props.strokeDash)&&void 0!==s?s:nn.DEFAULT_STROKE_DASH,this.outlineWidth=null!==(i=this.props.outlineWidth)&&void 0!==i?i:nn.DEFAULT_OUTLINE_WIDTH,this.outlineStyle=null!==(n=this.props.outlineStyle)&&void 0!==n?n:nn.DEFAULT_OUTLINE_STYLE,this.outlineDash=null!==(r=this.props.outlineDash)&&void 0!==r?r:nn.DEFAULT_OUTLINE_DASH,this.vec=new Float64Array([0,0]),this.isUpdateScheduled=!1}onAttached(){super.onAttached(),this.props.start.sub((()=>{this.scheduleUpdate()})),this.props.end.sub((()=>{this.scheduleUpdate()})),this.scheduleUpdate()}onMapProjectionChanged(t,e){super.onMapProjectionChanged(t,e),this.scheduleUpdate()}scheduleUpdate(){this.isUpdateScheduled=!0}onUpdated(t,e){if(super.onUpdated(t,e),this.isUpdateScheduled){this.display.clear();const t=this.props.start.get(),e=this.props.end.get();if(null!==t&&null!==e){const[s,i]=t instanceof Float64Array?t:this.props.mapProjection.project(t,this.vec),[n,r]=e instanceof Float64Array?e:this.props.mapProjection.project(e,this.vec);this.drawLine(s,i,n,r)}this.isUpdateScheduled=!1}}drawLine(t,e,s,i){const n=this.display.context;n.beginPath(),n.moveTo(t,e),n.lineTo(s,i),this.outlineWidth>0&&this.stroke(n,this.strokeWidth+2*this.outlineWidth,this.outlineStyle,this.outlineDash),this.strokeWidth>0&&this.stroke(n,this.strokeWidth,this.strokeStyle,this.strokeDash)}stroke(t,e,s,i){t.lineWidth=e,t.strokeStyle=s,t.setLineDash(i),t.stroke()}}nn.DEFAULT_STROKE_WIDTH=2,nn.DEFAULT_STROKE_STYLE="white",nn.DEFAULT_STROKE_DASH=[],nn.DEFAULT_OUTLINE_WIDTH=0,nn.DEFAULT_OUTLINE_STYLE="black",nn.DEFAULT_OUTLINE_DASH=[];class rn extends Hi{constructor(){var t;super(...arguments),this.canvasLayerRef=Le.createRef(),this.searchDebounceDelay=null!==(t=this.props.searchDebounceDelay)&&void 0!==t?t:500,this.facLoader=new xt(Gs.getRepository(this.props.bus),this.onFacilityLoaderInitialized.bind(this)),this.searchRadius=0,this.searchMargin=0,this.userFacilityHasChanged=!1,this.icaosToRender=new Set,this.cachedRenderedWaypoints=new Map,this.isInit=!1,this.facilityRepoSubs=[]}onFacilityLoaderInitialized(){Promise.all([this.facLoader.startNearestSearchSession(z.Airport),this.facLoader.startNearestSearchSession(z.Vor),this.facLoader.startNearestSearchSession(z.Ndb),this.facLoader.startNearestSearchSession(z.Intersection),this.facLoader.startNearestSearchSession(z.User)]).then((t=>{const[e,s,i,n,r]=t;this.onSessionsStarted(e,s,i,n,r)}))}onSessionsStarted(t,e,s,i,n){const r=this.processSearchResults.bind(this);this.facilitySearches={[z.Airport]:new an(t,r),[z.Vor]:new an(e,r),[z.Ndb]:new an(s,r),[z.Intersection]:new an(i,r),[z.User]:new an(n,r)};const a=this.props.bus.getSubscriber();this.facilityRepoSubs.push(a.on("facility_added").handle((t=>{Dt.isFacility(t.icao,Y.USR)&&(this.userFacilityHasChanged=!0)})),a.on("facility_changed").handle((t=>{Dt.isFacility(t.icao,Y.USR)&&(this.userFacilityHasChanged=!0)})),a.on("facility_removed").handle((t=>{Dt.isFacility(t.icao,Y.USR)&&(this.userFacilityHasChanged=!0)}))),this.props.onSessionsStarted&&this.props.onSessionsStarted(t,e,s,i,n),this.isInit&&this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}onAttached(){super.onAttached(),this.canvasLayerRef.instance.onAttached(),this.doInit(),this.isInit=!0,this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}doInit(){this.initWaypointRenderer(),this.updateSearchRadius()}getSearchCenter(){return this.props.getSearchCenter?this.props.getSearchCenter(this.props.mapProjection):this.props.mapProjection.getCenter()}initWaypointRenderer(){this.props.initRenderer&&this.props.initRenderer(this.props.waypointRenderer,this.canvasLayerRef.instance)}refreshWaypoints(){this.tryRefreshAllSearches(void 0,void 0,!0),this.cachedRenderedWaypoints.forEach((t=>{this.props.deregisterWaypoint(t,this.props.waypointRenderer)})),this.cachedRenderedWaypoints.forEach((t=>{this.props.registerWaypoint(t,this.props.waypointRenderer)}))}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e),lt.isAny(e,ke.Range|ke.RangeEndpoints|ke.ProjectedSize)?(this.updateSearchRadius(),this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)):lt.isAll(e,ke.Center)&&this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}updateSearchRadius(){let t=Tt.abs(this.props.mapProjection.getProjectedSize())*this.props.mapProjection.getProjectedResolution()/2;t=Math.max(t,gt.NMILE.convertTo(5,gt.GA_RADIAN)),this.searchRadius=t*rn.SEARCH_RADIUS_OVERDRAW_FACTOR,this.searchMargin=t*(rn.SEARCH_RADIUS_OVERDRAW_FACTOR-1)}onUpdated(t,e){var s;if(this.userFacilityHasChanged){const t=null===(s=this.facilitySearches)||void 0===s?void 0:s[z.User];void 0!==t&&(this.userFacilityHasChanged=!1,this.scheduleSearchRefresh(z.User,t,this.getSearchCenter(),this.searchRadius))}this.updateSearches(e)}updateSearches(t){this.facilitySearches&&(this.facilitySearches[z.Airport].update(t),this.facilitySearches[z.Vor].update(t),this.facilitySearches[z.Ndb].update(t),this.facilitySearches[z.Intersection].update(t),this.facilitySearches[z.User].update(t))}tryRefreshAllSearches(t,e,s){null!=t||(t=this.getSearchCenter()),null!=e||(e=this.searchRadius),this._tryRefreshAllSearches(t,e,s)}tryRefreshSearch(t,e,s,i){null!=e||(e=this.getSearchCenter()),null!=s||(s=this.searchRadius),this._tryRefreshSearch(t,e,s,i)}_tryRefreshAllSearches(t,e,s){this._tryRefreshSearch(z.Airport,t,e,s),this._tryRefreshSearch(z.Vor,t,e,s),this._tryRefreshSearch(z.Ndb,t,e,s),this._tryRefreshSearch(z.Intersection,t,e,s),this._tryRefreshSearch(z.User,t,e,s)}_tryRefreshSearch(t,e,s,i){const n=this.facilitySearches&&this.facilitySearches[t];if(!n||!i&&!this.shouldRefreshSearch(t,e,s))return;const r=this.props.searchRadiusLimit?this.props.searchRadiusLimit(t,e,s):void 0;void 0!==r&&isFinite(r)&&(s=Math.min(s,Math.max(0,r))),(i||n.lastRadius!==s||n.lastCenter.distance(e)>=this.searchMargin)&&this.scheduleSearchRefresh(t,n,e,s)}shouldRefreshSearch(t,e,s){return!this.props.shouldRefreshSearch||this.props.shouldRefreshSearch(t,e,s)}scheduleSearchRefresh(t,e,s,i){const n=this.props.searchItemLimit?this.props.searchItemLimit(t,s,i):100;e.scheduleRefresh(s,i,n,this.searchDebounceDelay)}processSearchResults(t){if(!t)return;const e=t.added.length;for(let s=0;s{t.destroy()})),super.destroy()}}rn.SEARCH_RADIUS_OVERDRAW_FACTOR=Math.SQRT2;class an{get lastCenter(){return this._lastCenter.readonly}get lastRadius(){return this._lastRadius}constructor(t,e){this.session=t,this.refreshCallback=e,this._lastCenter=new wt(0,0),this._lastRadius=0,this.maxItemCount=0,this.refreshDebounceTimer=0,this.isRefreshScheduled=!1}scheduleRefresh(t,e,s,i){this._lastCenter.set(t),this._lastRadius=e,this.maxItemCount=s,this.isRefreshScheduled||(this.refreshDebounceTimer=i,this.isRefreshScheduled=!0)}update(t){this.isRefreshScheduled&&(this.refreshDebounceTimer=Math.max(0,this.refreshDebounceTimer-t),0===this.refreshDebounceTimer&&(this.refresh(),this.isRefreshScheduled=!1))}async refresh(){const t=await this.session.searchNearest(this._lastCenter.lat,this._lastCenter.lon,gt.GA_RADIAN.convertTo(this._lastRadius,gt.METER),this.maxItemCount);this.refreshCallback(t)}}class on extends Hi{constructor(){super(...arguments),this.imageFilePath=yt.isSubscribable(this.props.imageFilePath)?this.props.imageFilePath.map(_t.identity()):this.props.imageFilePath,this.style=ei.create({display:"",position:"absolute",left:"0px",top:"0px",width:"0px",height:"0px",transform:"translate3d(0, 0, 0) rotate(0deg)","transform-origin":"50% 50%"}),this.ownAirplanePropsModule=this.props.model.getModule("ownAirplaneProps"),this.ownAirplaneIconModule=this.props.model.getModule("ownAirplaneIcon"),this.iconSize=yt.toSubscribable(this.props.iconSize,!0),this.iconAnchor=yt.toSubscribable(this.props.iconAnchor,!0),this.iconOffset=Tt.create(),this.visibilityBounds=Ct.create(4),this.iconTransform=Mi.concat(Mi.translate3d("px"),Mi.rotate("deg")),this.isGsAboveTrackThreshold=this.ownAirplanePropsModule.groundSpeed.map((t=>t.asUnit(gt.KNOT)>=5)).pause(),this.showIcon=!0,this.isInsideVisibilityBounds=!0,this.planeRotation=0,this.needUpdateVisibility=!1,this.needUpdatePositionRotation=!1}onVisibilityChanged(t){this.needUpdateVisibility=!0,this.needUpdatePositionRotation=this.showIcon=t&&this.ownAirplaneIconModule.show.get()}onAttached(){this.showSub=this.ownAirplaneIconModule.show.sub((t=>{this.needUpdateVisibility=!0,this.needUpdatePositionRotation=this.showIcon=t&&this.isVisible()})),this.positionSub=this.ownAirplanePropsModule.position.sub((()=>{this.needUpdatePositionRotation=this.showIcon})),this.headingSub=this.ownAirplanePropsModule.hdgTrue.sub((t=>{this.planeRotation=t,this.needUpdatePositionRotation=this.showIcon}),!1,!0),this.trackSub=this.ownAirplanePropsModule.trackTrue.sub((t=>{this.planeRotation=t,this.needUpdatePositionRotation=this.showIcon}),!1,!0),this.trackThresholdSub=this.isGsAboveTrackThreshold.sub((t=>{t?(this.headingSub.pause(),this.trackSub.resume(!0)):(this.trackSub.pause(),this.headingSub.resume(!0))}),!1,!0),this.iconSizeSub=this.iconSize.sub((t=>{this.style.set("width",`${t}px`),this.style.set("height",`${t}px`),this.updateOffset()}),!0),this.iconAnchorSub=this.iconAnchor.sub((()=>{this.updateOffset()})),this.orientationSub=this.ownAirplaneIconModule.orientation.sub((t=>{switch(t){case Be.HeadingUp:this.isGsAboveTrackThreshold.pause(),this.trackThresholdSub.pause(),this.trackSub.pause(),this.headingSub.resume(!0);break;case Be.TrackUp:this.headingSub.pause(),this.trackSub.pause(),this.isGsAboveTrackThreshold.resume(),this.trackThresholdSub.resume(!0);break;default:this.needUpdatePositionRotation=this.showIcon,this.isGsAboveTrackThreshold.pause(),this.trackThresholdSub.pause(),this.headingSub.pause(),this.trackSub.pause(),this.planeRotation=0}}),!0),this.needUpdateVisibility=!0,this.needUpdatePositionRotation=!0}updateOffset(){const t=this.iconAnchor.get();this.iconOffset.set(t),Tt.multScalar(this.iconOffset,-this.iconSize.get(),this.iconOffset),this.style.set("left",`${this.iconOffset[0]}px`),this.style.set("top",`${this.iconOffset[1]}px`),this.style.set("transform-origin",`${100*t[0]}% ${100*t[1]}%`),this.updateVisibilityBounds()}updateVisibilityBounds(){const t=this.iconSize.get(),e=Math.max(Math.hypot(this.iconOffset[0],this.iconOffset[1]),Math.hypot(this.iconOffset[0]+t,this.iconOffset[1]),Math.hypot(this.iconOffset[0]+t,this.iconOffset[1]+t),Math.hypot(this.iconOffset[0],this.iconOffset[1]+t))+50,s=this.props.mapProjection.getProjectedSize();this.visibilityBounds[0]=-e,this.visibilityBounds[1]=-e,this.visibilityBounds[2]=s[0]+e,this.visibilityBounds[3]=s[1]+e,this.needUpdatePositionRotation=this.showIcon}onMapProjectionChanged(t,e){lt.isAll(e,ke.ProjectedSize)&&this.updateVisibilityBounds(),this.needUpdatePositionRotation=this.showIcon}onUpdated(t,e){this.needUpdatePositionRotation?(this.updateIconPositionRotation(),this.needUpdatePositionRotation=!1,this.needUpdateVisibility=!1):this.needUpdateVisibility&&(this.updateIconVisibility(),this.needUpdateVisibility=!1)}updateIconVisibility(){this.style.set("display",this.isInsideVisibilityBounds&&this.showIcon?"":"none")}updateIconPositionRotation(){const t=this.props.mapProjection.project(this.ownAirplanePropsModule.position.get(),on.vec2Cache[0]);if(this.isInsideVisibilityBounds=this.props.mapProjection.isInProjectedBounds(t,this.visibilityBounds),this.isInsideVisibilityBounds){let e;switch(this.ownAirplaneIconModule.orientation.get()){case Be.HeadingUp:case Be.TrackUp:e=this.planeRotation+this.props.mapProjection.getRotation()*Avionics.Utils.RAD2DEG;break;default:e=0}this.iconTransform.getChild(0).set(t[0],t[1],0,.1),this.iconTransform.getChild(1).set(e,.1),this.style.set("transform",this.iconTransform.resolve())}this.updateIconVisibility()}render(){var t;return Le.buildComponent("img",{src:this.imageFilePath,class:null!==(t=this.props.class)&&void 0!==t?t:"",style:this.style})}destroy(){var t,e,s,i,n,r,a,o;yt.isSubscribable(this.imageFilePath)&&this.imageFilePath.destroy(),this.isGsAboveTrackThreshold.destroy(),null===(t=this.showSub)||void 0===t||t.destroy(),null===(e=this.positionSub)||void 0===e||e.destroy(),null===(s=this.headingSub)||void 0===s||s.destroy(),null===(i=this.trackSub)||void 0===i||i.destroy(),null===(n=this.trackThresholdSub)||void 0===n||n.destroy(),null===(r=this.iconSizeSub)||void 0===r||r.destroy(),null===(a=this.iconAnchorSub)||void 0===a||a.destroy(),null===(o=this.orientationSub)||void 0===o||o.destroy(),super.destroy()}}on.vec2Cache=[Tt.create()],function(t){t.Undefined="Undefined",t.NorthUp="NorthUp",t.TrackUp="TrackUp",t.HeadingUp="HeadingUp",t.DtkUp="DtkUp"}(He||(He={})),function(t){t.Normal="Normal",t.FlightPlan="FlightPlan"}(We||(We={}));class cn extends Hi{constructor(){var t;super(...arguments),this.instanceId=cn.instanceId++,this.flightPathLayerRef=Le.createRef(),this.waypointLayerRef=Le.createRef(),this.defaultRoleId=null!==(t=this.props.waypointRenderer.getRoleFromName(We.FlightPlan))&&void 0!==t?t:0,this.planModule=this.props.model.getModule(Ji.FlightPlan),this.waypointPrefix=`${cn.WAYPOINT_PREFIX}_${this.instanceId}`,this.legWaypoints=new Map,this.waypointsUpdating=!1,this.waypointId=0,this.facLoader=new xt(Gs.getRepository(this.props.bus)),this.facWaypointCache=Zs.getCache(this.props.bus),this.clipBounds=It.create(new Float64Array(4)),this.clippedPathStream=new Vi(Oi.INSTANCE,this.clipBounds),this.pathStreamStack=new Bi(Oi.INSTANCE,this.props.mapProjection.getGeoProjection(),Math.PI/12,.25,8),this.updateScheduled=!1}onAttached(){this.flightPathLayerRef.instance.onAttached(),this.waypointLayerRef.instance.onAttached(),this.pathStreamStack.pushPostProjected(this.clippedPathStream),this.pathStreamStack.setConsumer(this.flightPathLayerRef.instance.display.context),this.initWaypointRenderer(),this.planModule.getPlanSubjects(this.props.planIndex).flightPlan.sub((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).planCalculated.on((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).planChanged.on((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).activeLeg.sub((()=>this.updateScheduled=!0)),this.props.waypointRenderer.onRolesAdded.on((()=>this.initWaypointRenderer())),super.onAttached()}initWaypointRenderer(){let t=!1;const e=this.props.waypointRenderer.getRoleNamesByGroup(`${We.FlightPlan}_${this.props.planIndex}`);for(let s=0;s{var n,r,a,o,c,h;t.draw(this.props.mapProjection,i.context,e),this.needHandleOffscaleOob&&(t.isOffScale?(null===(n=this.props.oobIntruders)||void 0===n||n.delete(t.intruder),null===(r=this.props.offScaleIntruders)||void 0===r||r.add(t.intruder)):this.props.mapProjection.isInProjectedBounds(t.projectedPos,s)?(null===(c=this.props.offScaleIntruders)||void 0===c||c.delete(t.intruder),null===(h=this.props.oobIntruders)||void 0===h||h.delete(t.intruder)):(null===(a=this.props.offScaleIntruders)||void 0===a||a.delete(t.intruder),null===(o=this.props.oobIntruders)||void 0===o||o.add(t.intruder)))})):this.needHandleOffscaleOob&&this.intruderIcons[r.alertLevel].forEach((t=>{var e,s;null===(e=this.props.offScaleIntruders)||void 0===e||e.delete(t.intruder),null===(s=this.props.oobIntruders)||void 0===s||s.delete(t.intruder)}))}}updateVisibility(){const t=this.trafficModule.tcas.getOperatingMode();this.setVisible(this.trafficModule.show.get()&&(t===$e.TAOnly||t===$e.TA_RA||t===$e.Test))}onIntruderAdded(t){const e=this.props.iconFactory(t,this.props.context);this.intruderIcons[t.alertLevel.get()].set(t,e)}onIntruderRemoved(t){var e,s;null===(e=this.props.offScaleIntruders)||void 0===e||e.delete(t),null===(s=this.props.oobIntruders)||void 0===s||s.delete(t),this.intruderIcons[t.alertLevel.get()].delete(t)}onIntruderAlertLevelChanged(t){let e,s=this.intruderIcons[e=Ye.None].get(t);null!=s||(s=this.intruderIcons[e=Ye.ProximityAdvisory].get(t)),null!=s||(s=this.intruderIcons[e=Ye.TrafficAdvisory].get(t)),null!=s||(s=this.intruderIcons[e=Ye.ResolutionAdvisory].get(t)),s&&(this.intruderIcons[e].delete(t),this.intruderIcons[t.alertLevel.get()].set(t,s))}render(){var t;return Le.buildComponent($i,{ref:this.iconLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,class:null!==(t=this.props.class)&&void 0!==t?t:""})}}hn.DRAW_GROUPS=[{alertLevelVisFlag:Ke.Other,alertLevel:Ye.None},{alertLevelVisFlag:Ke.ProximityAdvisory,alertLevel:Ye.ProximityAdvisory},{alertLevelVisFlag:Ke.TrafficAdvisory,alertLevel:Ye.TrafficAdvisory},{alertLevelVisFlag:Ke.ResolutionAdvisory,alertLevel:Ye.ResolutionAdvisory}],new wt(0,0),function(t){t[t.Warning=0]="Warning",t[t.Caution=1]="Caution",t[t.Test=2]="Test",t[t.SoundOnly=3]="SoundOnly"}(Xe||(Xe={})),function(t){t[t.Triangle=1]="Triangle"}(Qe||(Qe={})),function(t){t[t.End=1]="End"}(Ze||(Ze={})),function(t){t[t.End=1]="End",t[t.Right=2]="Right"}(Je||(Je={})),function(t){t[t.None=1]="None"}(ts||(ts={})),function(t){t[t.Right=2]="Right"}(es||(es={})),function(t){t.Circular="Circular",t.Horizontal="Horizontal",t.DoubleHorizontal="DoubleHorizontal",t.Vertical="Vertical",t.DoubleVertical="DoubleVertical",t.Text="Text",t.ColumnGroup="ColumnGroup",t.Column="Column",t.Cylinder="Cylinder",t.TwinCylinder="TwinCylinder"}(ss||(ss={})),function(t){t[t.New=0]="New",t[t.Acked=1]="Acked"}(is||(is={})),function(t){t.Inactive="Inactive",t.Armed="Armed",t.Active="Active"}(ns||(ns={}));class ln{constructor(){this.onActivate=()=>{},this.onArm=()=>{},this.state=ns.Inactive}activate(){}deactivate(){}update(){}arm(){}}ln.instance=new ln,function(t){t[t.NONE=0]="NONE",t[t.PITCH=1]="PITCH",t[t.VS=2]="VS",t[t.FLC=3]="FLC",t[t.ALT=4]="ALT",t[t.PATH=5]="PATH",t[t.GP=6]="GP",t[t.GS=7]="GS",t[t.CAP=8]="CAP",t[t.TO=9]="TO",t[t.GA=10]="GA",t[t.FPA=11]="FPA",t[t.FLARE=12]="FLARE",t[t.LEVEL=13]="LEVEL"}(rs||(rs={})),function(t){t[t.NONE=0]="NONE",t[t.ROLL=1]="ROLL",t[t.LEVEL=2]="LEVEL",t[t.GPSS=3]="GPSS",t[t.HEADING=4]="HEADING",t[t.VOR=5]="VOR",t[t.LOC=6]="LOC",t[t.BC=7]="BC",t[t.ROLLOUT=8]="ROLLOUT",t[t.NAV=9]="NAV",t[t.TO=10]="TO",t[t.GA=11]="GA",t[t.HEADING_HOLD=12]="HEADING_HOLD",t[t.TRACK=13]="TRACK",t[t.TRACK_HOLD=14]="TRACK_HOLD",t[t.FMS_LOC=15]="FMS_LOC",t[t.TO_LOC=16]="TO_LOC"}(as||(as={})),function(t){t[t.NONE=0]="NONE",t[t.ALTS=1]="ALTS",t[t.ALTV=2]="ALTV"}(os||(os={})),function(t){t[t.Disabled=0]="Disabled",t[t.Enabled_Inactive=1]="Enabled_Inactive",t[t.Enabled_Active=2]="Enabled_Active"}(cs||(cs={})),function(t){t[t.None=0]="None",t[t.PathArmed=1]="PathArmed",t[t.PathActive=2]="PathActive",t[t.PathInvalid=3]="PathInvalid"}(hs||(hs={})),function(t){t[t.None=0]="None",t[t.GSArmed=1]="GSArmed",t[t.GSActive=2]="GSActive",t[t.GPArmed=3]="GPArmed",t[t.GPActive=4]="GPActive"}(ls||(ls={})),function(t){t[t.None=0]="None",t[t.Selected=1]="Selected",t[t.VNAV=2]="VNAV"}(us||(us={})),function(t){t.Available="Available",t.InvalidLegs="InvalidLegs"}(ds||(ds={})),function(t){t.VerticalDeviation="L:WTAP_VNav_Vertical_Deviation",t.TargetAltitude="L:WTAP_VNav_Target_Altitude",t.PathMode="L:WTAP_VNav_Path_Mode",t.VNAVState="L:WTAP_VNav_State",t.PathAvailable="L:WTAP_VNav_Path_Available",t.CaptureType="L:WTAP_VNav_Alt_Capture_Type",t.TODDistance="L:WTAP_VNav_Distance_To_TOD",t.BODDistance="L:WTAP_VNav_Distance_To_BOD",t.TODLegIndex="L:WTAP_VNav_TOD_Leg_Index",t.TODDistanceInLeg="L:WTAP_VNav_TOD_Distance_In_Leg",t.BODLegIndex="L:WTAP_VNav_BOD_Leg_Index",t.TOCDistance="L:WTAP_VNav_Distance_To_TOC",t.BOCDistance="L:WTAP_VNav_Distance_To_BOC",t.TOCLegIndex="L:WTAP_VNav_TOC_Leg_Index",t.TOCDistanceInLeg="L:WTAP_VNav_TOC_Distance_In_Leg",t.BOCLegIndex="L:WTAP_VNav_BOC_Leg_Index",t.CurrentConstraintLegIndex="L:WTAP_VNav_Constraint_Leg_Index",t.CurrentConstraintAltitude="L:WTAP_VNav_Constraint_Altitude",t.NextConstraintAltitude="L:WTAP_VNav_Next_Constraint_Altitude",t.FPA="L:WTAP_VNav_FPA",t.RequiredVS="L:WTAP_VNAV_Required_VS",t.GPApproachMode="L:WTAP_GP_Approach_Mode",t.GPVerticalDeviation="L:WTAP_GP_Vertical_Deviation",t.GPDistance="L:WTAP_GP_Distance",t.GPFpa="L:WTAP_GP_FPA",t.GPRequiredVS="L:WTAP_GP_Required_VS",t.GPServiceLevel="L:WTAP_GP_Service_Level"}(ps||(ps={})),function(t){t.Intercept="Intercept",t.Tracking="Tracking"}(fs||(fs={}));class un{constructor(t,e=!1,s=un.DEFAULT_MIN_INTENSITY,i=un.DEFAULT_MAX_INTENSITY){this.simTime=h.create(null,0),this.ppos=new Float64Array(3),this.altitude=0,this.needRecalcAuto=!0,this.lastSimTime=0,this.paused=!1,this._intensity=at.create(0),this.intensity=this._intensity,this._autoMinIntensity=s,this._autoMaxIntensity=i,this.needRecalcAuto=!0;const n=t.getSubscriber();this.simTime.setConsumer(n.on("simTime")),this.pposSub=n.on("gps-position").atFrequency(un.AUTO_UPDATE_REALTIME_FREQ).handle(this.onPPosChanged.bind(this)),this.updateSub=n.on("realTime").atFrequency(un.AUTO_UPDATE_REALTIME_FREQ).handle(this.onUpdate.bind(this)),this.setPaused(e)}get autoMaxIntensity(){return this._autoMaxIntensity}set autoMaxIntensity(t){this._autoMaxIntensity=t,this.needRecalcAuto=!0}get autoMinIntensity(){return this._autoMinIntensity}set autoMinIntensity(t){this._autoMinIntensity=t,this.needRecalcAuto=!0}setPaused(t){t!==this.paused&&(this.paused=t,t?(this.updateSub.pause(),this.pposSub.pause(),this.simTime.pause(),this.needRecalcAuto=!1):(this.needRecalcAuto=!0,this.simTime.resume(),this.pposSub.resume(!0),this.updateSub.resume(!0)))}onPPosChanged(t){const e=wt.sphericalToCartesian(t.lat,t.long,un.tempVec3);St.dot(e,this.ppos)>=.999999875&&Math.abs(t.alt-this.altitude)<=60||(St.copy(e,this.ppos),this.altitude=t.alt,this.needRecalcAuto=!0)}onUpdate(){const t=this.simTime.get();this.needRecalcAuto||(this.needRecalcAuto=Math.abs(t-this.lastSimTime)>=un.AUTO_UPDATE_SIMTIME_THRESHOLD),this.needRecalcAuto&&(this.needRecalcAuto=!1,this.updateAutoBacklightIntensity(t))}updateAutoBacklightIntensity(t){this.lastSimTime=t;const e=un.calculateSubSolarPoint(t,un.tempVec3),s=Math.acos(ut.clamp(St.dot(this.ppos,e),-1,1)),i=ut.HALF_PI+Math.acos(1/(1+gt.METER.convertTo(Math.max(0,this.altitude),gt.GA_RADIAN)));this._intensity.set(ut.lerp(i-s,un.AUTO_MIN_SOLAR_HORIZON_ANGLE_RAD,un.AUTO_MAX_SOLAR_HORIZON_ANGLE_RAD,this._autoMinIntensity,this._autoMaxIntensity,!0,!0))}static calculateSubSolarPoint(t,e){const s=2*Math.PI,i=(t-un.EPOCH)/un.DAY,n=i-Math.floor(i),r=4.895055+.01720279*i,a=6.240041+.01720197*i,o=r+.033423*Math.sin(a)+349e-6*Math.sin(2*a),c=.40910518-6.98e-9*i,h=Math.atan2(Math.cos(c)*Math.sin(o),Math.cos(o)),l=Math.asin(Math.sin(c)*Math.sin(o)),u=.159155*(((r-h)%s+3*Math.PI)%s-Math.PI),d=l*Avionics.Utils.RAD2DEG,p=-15*(n-.5+u)*24;return wt.sphericalToCartesian(d,p,e)}}un.AUTO_MAX_SOLAR_HORIZON_ANGLE=4,un.AUTO_MIN_SOLAR_HORIZON_ANGLE=-6,un.AUTO_MAX_SOLAR_HORIZON_ANGLE_RAD=un.AUTO_MAX_SOLAR_HORIZON_ANGLE*Avionics.Utils.DEG2RAD,un.AUTO_MIN_SOLAR_HORIZON_ANGLE_RAD=un.AUTO_MIN_SOLAR_HORIZON_ANGLE*Avionics.Utils.DEG2RAD,un.AUTO_UPDATE_REALTIME_FREQ=10,un.AUTO_UPDATE_SIMTIME_THRESHOLD=6e4,un.EPOCH=9466848e5,un.DAY=864e5,un.DEFAULT_MIN_INTENSITY=0,un.DEFAULT_MAX_INTENSITY=1,un.tempVec3=new Float64Array(3),function(t){t.DTK="L:WTAP_LNav_DTK",t.XTK="L:WTAP_LNav_XTK",t.IsTracking="L:WTAP_LNav_Is_Tracking",t.TrackedLegIndex="L:WTAP_LNav_Tracked_Leg_Index",t.TransitionMode="L:WTAP_LNav_Transition_Mode",t.TrackedVectorIndex="L:WTAP_LNav_Tracked_Vector_Index",t.CourseToSteer="L:WTAP_LNav_Course_To_Steer",t.IsSuspended="L:WTAP_LNav_Is_Suspended",t.LegDistanceAlong="L:WTAP_LNav_Leg_Distance_Along",t.LegDistanceRemaining="L:WTAP_LNav_Leg_Distance_Remaining",t.VectorDistanceAlong="L:WTAP_LNav_Vector_Distance_Along",t.VectorDistanceRemaining="L:WTAP_LNav_Vector_Distance_Remaining",t.VectorAnticipationDistance="L:WTAP_LNav_Vector_Anticipation_Distance",t.AlongTrackSpeed="L:WTAP_LNav_Along_Track_Speed"}(ms||(ms={})),function(t){t[t.None=0]="None",t[t.Ingress=1]="Ingress",t[t.Egress=2]="Egress",t[t.Unsuspend=3]="Unsuspend"}(As||(As={})),gt.GA_RADIAN.convertTo(Lt.ANGULAR_TOLERANCE,gt.METER),function(t){t.Intercept="Intercept",t.Tracking="Tracking"}(gs||(gs={})),function(t){t.DTKTrue="L:WT_LNavData_DTK_True",t.DTKMagnetic="L:WT_LNavData_DTK_Mag",t.XTK="L:WT_LNavData_XTK",t.CDIScale="L:WT_LNavData_CDI_Scale",t.WaypointBearingTrue="L:WT_LNavData_Waypoint_Bearing_True",t.WaypointBearingMagnetic="L:WT_LNavData_Waypoint_Bearing_Mag",t.WaypointDistance="L:WT_LNavData_Waypoint_Distance",t.DestinationDistance="L:WT_LNavData_Destination_Distance"}(ys||(ys={})),function(t){t.Active="L:WTAP_LNav_Obs_Active",t.Course="L:WTAP_LNav_Obs_Course"}(vs||(vs={})),function(t){t[t.None=0]="None",t[t.ZeroIncDec=1]="ZeroIncDec",t[t.NonZeroIncDec=2]="NonZeroIncDec",t[t.TransformedSet=4]="TransformedSet",t[t.All=-1]="All"}(_s||(_s={})),function(t){t[t.LATERAL=0]="LATERAL",t[t.VERTICAL=1]="VERTICAL",t[t.APPROACH=2]="APPROACH"}(bs||(bs={})),function(t){t[t.None=0]="None",t[t.APActive=1]="APActive",t[t.YawDamper=2]="YawDamper",t[t.Heading=4]="Heading",t[t.Nav=8]="Nav",t[t.NavArmed=16]="NavArmed",t[t.Approach=32]="Approach",t[t.ApproachArmed=64]="ApproachArmed",t[t.Backcourse=128]="Backcourse",t[t.BackcourseArmed=256]="BackcourseArmed",t[t.Alt=512]="Alt",t[t.AltS=1024]="AltS",t[t.AltV=2048]="AltV",t[t.VS=4096]="VS",t[t.FLC=8192]="FLC",t[t.GP=16384]="GP",t[t.GPArmed=32768]="GPArmed",t[t.GS=65536]="GS",t[t.GSArmed=131072]="GSArmed",t[t.Path=262144]="Path",t[t.PathArmed=524288]="PathArmed",t[t.PathInvalid=1048576]="PathInvalid",t[t.Pitch=2097152]="Pitch",t[t.Roll=4194304]="Roll",t[t.VNAV=8388608]="VNAV",t[t.ATSpeed=16777216]="ATSpeed",t[t.ATMach=33554432]="ATMach",t[t.ATArmed=67108864]="ATArmed",t[t.FD=134217728]="FD"}(Ts||(Ts={})),function(t){t.None="None",t.Speed="Speed",t.Power="Power",t.ThrottlePos="ThrottlePos"}(Ss||(Ss={})),function(t){t[t.Singleton=0]="Singleton",t[t.Transient=1]="Transient"}(Cs||(Cs={})),Cs.Singleton,new wt(0,0),function(t){t.Climb="CLB",t.Cruise="CLZ",t.Descent="DSC"}(Rs||(Rs={})),function(t){t.Off="Off",t.Initializing="Initializing",t.On="On",t.Failed="Failed"}(Es||(Es={}));BaseInstrument;class dn extends ui{constructor(t){super(t),this.cycleRef=Le.createRef(),this.toTopRef=Le.createRef(),this.reloadRef=Le.createRef(),this.switchPosRef=Le.createRef(),this.buttonName=ti.create(0,(t=>1===t?"/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png":2===t?"/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png":"")),this.cycle=()=>{0===this.props.page?SimVar.SetSimVarValue("L:KH_FE_FPLAN_P1","bool",!0):1===this.props.page&&SimVar.SetSimVarValue("L:KH_FE_FPLAN_P1","bool",!1)},this.toTop=()=>{this.props.containerRef.instance&&(this.props.containerRef.instance.scrollTop=0)},this.switchPosition=()=>{1===this.props.position.get()?SimVar.SetSimVarValue("L:KH_FE_FPLAN_BOARD","number",2):2===this.props.position.get()&&SimVar.SetSimVarValue("L:KH_FE_FPLAN_BOARD","number",1)},this.render=()=>Le.buildComponent("div",{id:"KH_CTRL"},1===this.props.page&&Le.buildComponent("div",{ref:this.cycleRef,class:"button"},Le.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"})),Le.buildComponent("div",{ref:this.toTopRef,class:"button d90"},Le.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"})),Le.buildComponent("div",{ref:this.reloadRef,class:"button"},Le.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/cloud.png"})),Le.buildComponent("div",{ref:this.switchPosRef,class:"button"},Le.buildComponent("img",{class:"icon",src:this.buttonName})),0===this.props.page&&Le.buildComponent("div",{ref:this.cycleRef,class:"button d180"},Le.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"}))),this.onAfterRender=()=>{this.cycleRef.instance.onclick=this.cycle,this.toTopRef.instance.onclick=this.toTop,this.reloadRef.instance.onclick=this.props.reload,this.switchPosRef.instance.onclick=this.switchPosition},t.position.sub((t=>this.buttonName.set(t)))}}class pn extends ui{constructor(t){super(t),this.containerRef=Le.createRef(),this.ofpRef=Le.createRef(),this.defineDragScroll=(t=!0,e=!0)=>{if(!this.containerRef.instance)return;let s={top:0,left:0,x:0,y:0};const i=i=>{const n=i.clientX-s.x,r=i.clientY-s.y;e&&(this.containerRef.instance.scrollTop=s.top-r),t&&(this.containerRef.instance.scrollLeft=s.left-n)},n=t=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n),document.removeEventListener("mouseleave",n)};this.containerRef.instance.addEventListener("mousedown",(t=>{s={left:this.containerRef.instance.scrollLeft,top:this.containerRef.instance.scrollTop,x:t.clientX,y:t.clientY},document.addEventListener("mousemove",i),document.addEventListener("mouseup",n),document.removeEventListener("mouseleave",n)}))},this.render=()=>Le.buildComponent(Le.Fragment,null,Le.buildComponent("div",{ref:this.containerRef,id:"KH_FE_FPLAN"},Le.buildComponent("div",{ref:this.ofpRef,id:"OFP"})),Le.buildComponent(dn,{containerRef:this.containerRef,position:this.props.position,reload:this.props.reload,page:0})),this.onAfterRender=()=>{this.defineDragScroll(),this.props.content.sub((t=>{this.ofpRef.instance.innerHTML=t}))}}}class fn extends ui{constructor(t){super(t),this.containerRef=Le.createRef(),this.defineDragScroll=(t=!0,e=!0)=>{if(!this.containerRef.instance)return;let s={top:0,left:0,x:0,y:0};const i=i=>{const n=i.clientX-s.x,r=i.clientY-s.y;e&&(this.containerRef.instance.scrollTop=s.top-r),t&&(this.containerRef.instance.scrollLeft=s.left-n)},n=t=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n),document.removeEventListener("mouseleave",n)};this.containerRef.instance.addEventListener("mousedown",(t=>{s={left:this.containerRef.instance.scrollLeft,top:this.containerRef.instance.scrollTop,x:t.clientX,y:t.clientY},document.addEventListener("mousemove",i),document.addEventListener("mouseup",n),document.addEventListener("mouseleave",n)}))},this.render=()=>Le.buildComponent(Le.Fragment,null,Le.buildComponent("div",{ref:this.containerRef,id:"KH_FE_FPLAN",class:"p2"},Le.buildComponent("div",{id:"TLR"},Le.buildComponent("div",null,Le.buildComponent("pre",null,this.props.content)))),Le.buildComponent(dn,{containerRef:this.containerRef,position:this.props.position,reload:this.props.reload,page:1})),this.onAfterRender=()=>{this.defineDragScroll()}}}class mn extends BaseInstrument{get templateID(){return"kh-fe-fplan"}get isInteractive(){return!0}constructor(){super(),this.bus=new n,this.newDataPublisher=new _(new Map([["newData",{name:"L:KH_FE_FPLAN_NEW_DATA",type:l.Bool}],["position",{name:"L:KH_FE_FPLAN_BOARD",type:l.Number}]]),this.bus),this.contentOFP=at.create(""),this.contentTLR=at.create(""),this.position=at.create(0),this.sbID="",this.getSB=async()=>{try{const t=await fetch(`https://www.simbrief.com/api/xml.fetcher.php?username=${this.sbID}&json=1`);if(t.ok)try{const e=await t.json();let s=e.text.plan_html;s=s.replace(/href=".*?"/g,""),this.contentOFP.set(s),this.contentTLR.set(e.text.tlr_section)}catch(t){console.error("JSON DECODE ERR",t)}}catch(t){console.error("FETCH ERR",t)}},this.reloadSB=()=>{SimVar.SetSimVarValue("L:KH_FE_FPLAN_NEW_DATA","bool",1)};const t=GetStoredData("FSS_B727_EFB_CONFIG_PREFLIGHT");try{this.sbID=JSON.parse(t).simBriefId}catch(t){console.error("Failed loading config.",t)}}Update(){super.Update(),this.newDataPublisher.onUpdate()}connectedCallback(){var t;super.connectedCallback(),this.newDataPublisher.startPublish();const e=this.bus.getSubscriber();e.on("newData").handle((t=>{t&&(SimVar.SetSimVarValue("L:KH_FE_FPLAN_NEW_DATA","bool",0),this.getSB())})),e.on("position").handle((t=>{this.position.set(t)}));const s=new URL(null!==(t=this.getAttribute("Url"))&&void 0!==t?t:"").searchParams.get("type");Le.render(Le.buildComponent(Le.Fragment,null,"ofp"===s&&Le.buildComponent(pn,{content:this.contentOFP,position:this.position,reload:this.reloadSB}),"tlr"===s&&Le.buildComponent(fn,{content:this.contentTLR,position:this.position,reload:this.reloadSB})),document.getElementById("root"))}}registerInstrument("kh-fe-fplan",mn); diff --git a/2020/pnpm-lock.yaml b/2020/pnpm-lock.yaml deleted file mode 100644 index df130a1..0000000 --- a/2020/pnpm-lock.yaml +++ /dev/null @@ -1,1998 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@microsoft/msfs-sdk': - specifier: ^0.8.0 - version: 0.8.0 - '@microsoft/msfs-types': - specifier: ^1.14.6 - version: 1.14.6 - '@rollup/plugin-node-resolve': - specifier: ^16.0.0 - version: 16.0.0(rollup@2.79.2) - '@rollup/plugin-terser': - specifier: ^0.4.4 - version: 0.4.4(rollup@2.79.2) - '@rollup/plugin-typescript': - specifier: ^12.1.2 - version: 12.1.2(rollup@2.79.2)(tslib@2.8.1)(typescript@5.7.3) - autoprefixer: - specifier: ^10.4.20 - version: 10.4.20(postcss@8.5.1) - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - postcss-import: - specifier: ^16.1.0 - version: 16.1.0(postcss@8.5.1) - prettier: - specifier: ^3.4.2 - version: 3.4.2 - prettier-plugin-organize-imports: - specifier: ^4.1.0 - version: 4.1.0(prettier@3.4.2)(typescript@5.7.3) - rollup: - specifier: '2' - version: 2.79.2 - rollup-plugin-cleaner: - specifier: ^1.0.0 - version: 1.0.0(rollup@2.79.2) - rollup-plugin-copy: - specifier: ^3.5.0 - version: 3.5.0 - rollup-plugin-import-css: - specifier: ^3.5.8 - version: 3.5.8(rollup@2.79.2) - rollup-plugin-postcss: - specifier: ^4.0.2 - version: 4.0.2(postcss@8.5.1) - sass: - specifier: ^1.83.4 - version: 1.83.4 - tslib: - specifier: ^2.8.1 - version: 2.8.1 - typescript: - specifier: ^5.7.3 - version: 5.7.3 - -packages: - - '@jridgewell/gen-mapping@0.3.8': - resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} - engines: {node: '>=6.0.0'} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/source-map@0.3.6': - resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} - - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - - '@microsoft/msfs-sdk@0.8.0': - resolution: {integrity: sha512-8dDatqOvuj8NTV1bnVDBxHHKm156ugm5r10wMW2+sxC7L1EOJJudVkzbpNdmakzt3DVruKs7KkGpW4Zc6CVW3A==} - - '@microsoft/msfs-types@1.14.6': - resolution: {integrity: sha512-p2dmrxMpnurr7lOFRKjLCysxR6bb+MWJmRvYQkaExq7qBc8bu98WgI14X8W+pf2g0rlH69cN+uP9Kvz/dnPDuw==} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@parcel/watcher-android-arm64@2.5.1': - resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [android] - - '@parcel/watcher-darwin-arm64@2.5.1': - resolution: {integrity: sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [darwin] - - '@parcel/watcher-darwin-x64@2.5.1': - resolution: {integrity: sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [darwin] - - '@parcel/watcher-freebsd-x64@2.5.1': - resolution: {integrity: sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [freebsd] - - '@parcel/watcher-linux-arm-glibc@2.5.1': - resolution: {integrity: sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==} - engines: {node: '>= 10.0.0'} - cpu: [arm] - os: [linux] - - '@parcel/watcher-linux-arm-musl@2.5.1': - resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} - engines: {node: '>= 10.0.0'} - cpu: [arm] - os: [linux] - - '@parcel/watcher-linux-arm64-glibc@2.5.1': - resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [linux] - - '@parcel/watcher-linux-arm64-musl@2.5.1': - resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [linux] - - '@parcel/watcher-linux-x64-glibc@2.5.1': - resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [linux] - - '@parcel/watcher-linux-x64-musl@2.5.1': - resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [linux] - - '@parcel/watcher-win32-arm64@2.5.1': - resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} - engines: {node: '>= 10.0.0'} - cpu: [arm64] - os: [win32] - - '@parcel/watcher-win32-ia32@2.5.1': - resolution: {integrity: sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==} - engines: {node: '>= 10.0.0'} - cpu: [ia32] - os: [win32] - - '@parcel/watcher-win32-x64@2.5.1': - resolution: {integrity: sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==} - engines: {node: '>= 10.0.0'} - cpu: [x64] - os: [win32] - - '@parcel/watcher@2.5.1': - resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} - engines: {node: '>= 10.0.0'} - - '@rollup/plugin-node-resolve@16.0.0': - resolution: {integrity: sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-terser@0.4.4': - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-typescript@12.1.2': - resolution: {integrity: sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.14.0||^3.0.0||^4.0.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - - '@rollup/pluginutils@5.1.4': - resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@trysound/sax@0.2.0': - resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} - engines: {node: '>=10.13.0'} - - '@types/estree@1.0.6': - resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - - '@types/fs-extra@8.1.5': - resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} - - '@types/glob@7.2.0': - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} - - '@types/minimatch@5.1.2': - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - - '@types/node@22.13.0': - resolution: {integrity: sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==} - - '@types/resolve@1.20.2': - resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - - acorn@8.14.0: - resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} - engines: {node: '>=0.4.0'} - hasBin: true - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - - autoprefixer@10.4.20: - resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} - engines: {node: ^10 || ^12 || >=14} - hasBin: true - peerDependencies: - postcss: ^8.1.0 - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - boolbase@1.0.0: - resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - browserslist@4.24.4: - resolution: {integrity: sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - - caniuse-api@3.0.0: - resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - - caniuse-lite@1.0.30001696: - resolution: {integrity: sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chokidar@4.0.3: - resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} - engines: {node: '>= 14.16.0'} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - colord@2.9.3: - resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} - - colorette@1.4.0: - resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} - - commander@2.20.3: - resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - - commander@7.2.0: - resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} - engines: {node: '>= 10'} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concat-with-sourcemaps@1.1.0: - resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==} - - cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - css-declaration-sorter@6.4.1: - resolution: {integrity: sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==} - engines: {node: ^10 || ^12 || >=14} - peerDependencies: - postcss: ^8.0.9 - - css-select@4.3.0: - resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} - - css-tree@1.1.3: - resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} - engines: {node: '>=8.0.0'} - - css-what@6.1.0: - resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} - engines: {node: '>= 6'} - - cssesc@3.0.0: - resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} - engines: {node: '>=4'} - hasBin: true - - cssnano-preset-default@5.2.14: - resolution: {integrity: sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - cssnano-utils@3.1.0: - resolution: {integrity: sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - cssnano@5.1.15: - resolution: {integrity: sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - csso@4.2.0: - resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} - engines: {node: '>=8.0.0'} - - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - - detect-libc@1.0.3: - resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} - engines: {node: '>=0.10'} - hasBin: true - - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - - dom-serializer@1.4.1: - resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} - - domelementtype@2.3.0: - resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - - domhandler@4.3.1: - resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} - engines: {node: '>= 4'} - - domutils@2.8.0: - resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} - - electron-to-chromium@1.5.90: - resolution: {integrity: sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==} - - entities@2.2.0: - resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} - - escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} - - estree-walker@0.6.1: - resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - eventemitter3@4.0.7: - resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} - - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} - - fastq@1.19.0: - resolution: {integrity: sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - fraction.js@4.3.7: - resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} - - fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - generic-names@4.0.0: - resolution: {integrity: sha512-ySFolZQfw9FoDb3ed9d80Cm9f0+r7qj+HJkWjeD9RBfpxEVTlVhol+gvaQB/78WbwYfbnNh8nWHHBSlg072y6A==} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@10.0.1: - resolution: {integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==} - engines: {node: '>=8'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - icss-replace-symbols@1.1.0: - resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==} - - icss-utils@5.1.0: - resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - immutable@5.0.3: - resolution: {integrity: sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==} - - import-cwd@3.0.0: - resolution: {integrity: sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==} - engines: {node: '>=8'} - - import-from@3.0.0: - resolution: {integrity: sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==} - engines: {node: '>=8'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} - engines: {node: '>= 0.4'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@3.0.1: - resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} - engines: {node: '>=0.10.0'} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - - lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - - loader-utils@3.3.1: - resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} - engines: {node: '>= 12.13.0'} - - lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - - lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - - lodash.uniq@4.5.0: - resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} - - mdn-data@2.0.14: - resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - nanoid@3.3.8: - resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-addon-api@7.1.1: - resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} - - node-releases@2.0.19: - resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - - normalize-range@0.1.2: - resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} - engines: {node: '>=0.10.0'} - - normalize-url@6.1.0: - resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} - engines: {node: '>=10'} - - nth-check@2.1.1: - resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - p-finally@1.0.0: - resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} - engines: {node: '>=4'} - - p-queue@6.6.2: - resolution: {integrity: sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==} - engines: {node: '>=8'} - - p-timeout@3.2.0: - resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} - engines: {node: '>=8'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - - pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - - pify@5.0.0: - resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} - engines: {node: '>=10'} - - postcss-calc@8.2.4: - resolution: {integrity: sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==} - peerDependencies: - postcss: ^8.2.2 - - postcss-colormin@5.3.1: - resolution: {integrity: sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-convert-values@5.1.3: - resolution: {integrity: sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-comments@5.1.2: - resolution: {integrity: sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-duplicates@5.1.0: - resolution: {integrity: sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-empty@5.1.1: - resolution: {integrity: sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-overridden@5.1.0: - resolution: {integrity: sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-import@16.1.0: - resolution: {integrity: sha512-7hsAZ4xGXl4MW+OKEWCnF6T5jqBw80/EE9aXg1r2yyn1RsVEU8EtKXbijEODa+rg7iih4bKf7vlvTGYR4CnPNg==} - engines: {node: '>=18.0.0'} - peerDependencies: - postcss: ^8.0.0 - - postcss-load-config@3.1.4: - resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} - engines: {node: '>= 10'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - - postcss-merge-longhand@5.1.7: - resolution: {integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-merge-rules@5.1.4: - resolution: {integrity: sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-font-values@5.1.0: - resolution: {integrity: sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-gradients@5.1.1: - resolution: {integrity: sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-params@5.1.4: - resolution: {integrity: sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-selectors@5.2.1: - resolution: {integrity: sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-modules-extract-imports@3.1.0: - resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-local-by-default@4.2.0: - resolution: {integrity: sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-scope@3.2.1: - resolution: {integrity: sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-values@4.0.0: - resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules@4.3.1: - resolution: {integrity: sha512-ItUhSUxBBdNamkT3KzIZwYNNRFKmkJrofvC2nWab3CPKhYBQ1f27XXh1PAPE27Psx58jeelPsxWB/+og+KEH0Q==} - peerDependencies: - postcss: ^8.0.0 - - postcss-normalize-charset@5.1.0: - resolution: {integrity: sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-display-values@5.1.0: - resolution: {integrity: sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-positions@5.1.1: - resolution: {integrity: sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-repeat-style@5.1.1: - resolution: {integrity: sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-string@5.1.0: - resolution: {integrity: sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-timing-functions@5.1.0: - resolution: {integrity: sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-unicode@5.1.1: - resolution: {integrity: sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-url@5.1.0: - resolution: {integrity: sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-whitespace@5.1.1: - resolution: {integrity: sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-ordered-values@5.1.3: - resolution: {integrity: sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-reduce-initial@5.1.2: - resolution: {integrity: sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-reduce-transforms@5.1.0: - resolution: {integrity: sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-selector-parser@6.1.2: - resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} - engines: {node: '>=4'} - - postcss-selector-parser@7.0.0: - resolution: {integrity: sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==} - engines: {node: '>=4'} - - postcss-svgo@5.1.0: - resolution: {integrity: sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-unique-selectors@5.1.1: - resolution: {integrity: sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.5.1: - resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} - engines: {node: ^10 || ^12 || >=14} - - prettier-plugin-organize-imports@4.1.0: - resolution: {integrity: sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==} - peerDependencies: - prettier: '>=2.0' - typescript: '>=2.9' - vue-tsc: ^2.1.0 - peerDependenciesMeta: - vue-tsc: - optional: true - - prettier@3.4.2: - resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} - engines: {node: '>=14'} - hasBin: true - - promise.series@0.2.0: - resolution: {integrity: sha512-VWQJyU2bcDTgZw8kpfBpB/ejZASlCrzwz5f2hjb/zlujOEB4oeiAhHygAWq8ubsX2GVkD4kCU5V2dwOTaCY5EQ==} - engines: {node: '>=0.12'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - - read-cache@1.0.0: - resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} - - readdirp@4.1.1: - resolution: {integrity: sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==} - engines: {node: '>= 14.18.0'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} - engines: {node: '>= 0.4'} - hasBin: true - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - rollup-plugin-cleaner@1.0.0: - resolution: {integrity: sha512-q+Zf9estkFwGede9QzmbkhKeuXzlliOvcICVNzBHAs5xYPPs1XLtfin5TMU2tC2EYjmfaF97saY9MnQM6Og4eA==} - engines: {node: '>= 8.0'} - peerDependencies: - rollup: '> 1.0' - - rollup-plugin-copy@3.5.0: - resolution: {integrity: sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==} - engines: {node: '>=8.3'} - - rollup-plugin-import-css@3.5.8: - resolution: {integrity: sha512-a3YsZnwHz66mRHCKHjaPCSfWczczvS/HTkgDc+Eogn0mt/0JZXz0WjK0fzM5WwBpVtOqHB4/gHdmEY40ILsaVg==} - engines: {node: '>=16'} - peerDependencies: - rollup: ^2.x.x || ^3.x.x || ^4.x.x - - rollup-plugin-postcss@4.0.2: - resolution: {integrity: sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w==} - engines: {node: '>=10'} - peerDependencies: - postcss: 8.x - - rollup-pluginutils@2.8.2: - resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - - rollup@2.79.2: - resolution: {integrity: sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==} - engines: {node: '>=10.0.0'} - hasBin: true - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safe-identifier@0.4.2: - resolution: {integrity: sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==} - - sass@1.83.4: - resolution: {integrity: sha512-B1bozCeNQiOgDcLd33e2Cs2U60wZwjUUXzh900ZyQF5qUasvMdDZYbQ566LJu7cqR+sAHlAfO6RMkaID5s6qpA==} - engines: {node: '>=14.0.0'} - hasBin: true - - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - - smob@1.5.0: - resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==} - - source-map-js@1.2.1: - resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} - engines: {node: '>=0.10.0'} - - source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} - - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - - stable@0.1.8: - resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} - deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' - - string-hash@1.1.3: - resolution: {integrity: sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==} - - style-inject@0.3.0: - resolution: {integrity: sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw==} - - stylehacks@5.1.1: - resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - - svgo@2.8.0: - resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} - engines: {node: '>=10.13.0'} - hasBin: true - - terser@5.37.0: - resolution: {integrity: sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==} - engines: {node: '>=10'} - hasBin: true - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - typescript@5.7.3: - resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.20.0: - resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} - - universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - - update-browserslist-db@1.1.2: - resolution: {integrity: sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - yaml@1.10.2: - resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} - engines: {node: '>= 6'} - -snapshots: - - '@jridgewell/gen-mapping@0.3.8': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/source-map@0.3.6': - dependencies: - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/sourcemap-codec@1.5.0': {} - - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 - - '@microsoft/msfs-sdk@0.8.0': {} - - '@microsoft/msfs-types@1.14.6': {} - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.0 - - '@parcel/watcher-android-arm64@2.5.1': - optional: true - - '@parcel/watcher-darwin-arm64@2.5.1': - optional: true - - '@parcel/watcher-darwin-x64@2.5.1': - optional: true - - '@parcel/watcher-freebsd-x64@2.5.1': - optional: true - - '@parcel/watcher-linux-arm-glibc@2.5.1': - optional: true - - '@parcel/watcher-linux-arm-musl@2.5.1': - optional: true - - '@parcel/watcher-linux-arm64-glibc@2.5.1': - optional: true - - '@parcel/watcher-linux-arm64-musl@2.5.1': - optional: true - - '@parcel/watcher-linux-x64-glibc@2.5.1': - optional: true - - '@parcel/watcher-linux-x64-musl@2.5.1': - optional: true - - '@parcel/watcher-win32-arm64@2.5.1': - optional: true - - '@parcel/watcher-win32-ia32@2.5.1': - optional: true - - '@parcel/watcher-win32-x64@2.5.1': - optional: true - - '@parcel/watcher@2.5.1': - dependencies: - detect-libc: 1.0.3 - is-glob: 4.0.3 - micromatch: 4.0.8 - node-addon-api: 7.1.1 - optionalDependencies: - '@parcel/watcher-android-arm64': 2.5.1 - '@parcel/watcher-darwin-arm64': 2.5.1 - '@parcel/watcher-darwin-x64': 2.5.1 - '@parcel/watcher-freebsd-x64': 2.5.1 - '@parcel/watcher-linux-arm-glibc': 2.5.1 - '@parcel/watcher-linux-arm-musl': 2.5.1 - '@parcel/watcher-linux-arm64-glibc': 2.5.1 - '@parcel/watcher-linux-arm64-musl': 2.5.1 - '@parcel/watcher-linux-x64-glibc': 2.5.1 - '@parcel/watcher-linux-x64-musl': 2.5.1 - '@parcel/watcher-win32-arm64': 2.5.1 - '@parcel/watcher-win32-ia32': 2.5.1 - '@parcel/watcher-win32-x64': 2.5.1 - optional: true - - '@rollup/plugin-node-resolve@16.0.0(rollup@2.79.2)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@2.79.2) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-module: 1.0.0 - resolve: 1.22.10 - optionalDependencies: - rollup: 2.79.2 - - '@rollup/plugin-terser@0.4.4(rollup@2.79.2)': - dependencies: - serialize-javascript: 6.0.2 - smob: 1.5.0 - terser: 5.37.0 - optionalDependencies: - rollup: 2.79.2 - - '@rollup/plugin-typescript@12.1.2(rollup@2.79.2)(tslib@2.8.1)(typescript@5.7.3)': - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@2.79.2) - resolve: 1.22.10 - typescript: 5.7.3 - optionalDependencies: - rollup: 2.79.2 - tslib: 2.8.1 - - '@rollup/pluginutils@5.1.4(rollup@2.79.2)': - dependencies: - '@types/estree': 1.0.6 - estree-walker: 2.0.2 - picomatch: 4.0.2 - optionalDependencies: - rollup: 2.79.2 - - '@trysound/sax@0.2.0': {} - - '@types/estree@1.0.6': {} - - '@types/fs-extra@8.1.5': - dependencies: - '@types/node': 22.13.0 - - '@types/glob@7.2.0': - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 22.13.0 - - '@types/minimatch@5.1.2': {} - - '@types/node@22.13.0': - dependencies: - undici-types: 6.20.0 - - '@types/resolve@1.20.2': {} - - acorn@8.14.0: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - array-union@2.1.0: {} - - autoprefixer@10.4.20(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001696 - fraction.js: 4.3.7 - normalize-range: 0.1.2 - picocolors: 1.1.1 - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - balanced-match@1.0.2: {} - - boolbase@1.0.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - browserslist@4.24.4: - dependencies: - caniuse-lite: 1.0.30001696 - electron-to-chromium: 1.5.90 - node-releases: 2.0.19 - update-browserslist-db: 1.1.2(browserslist@4.24.4) - - buffer-from@1.1.2: {} - - caniuse-api@3.0.0: - dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001696 - lodash.memoize: 4.1.2 - lodash.uniq: 4.5.0 - - caniuse-lite@1.0.30001696: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chokidar@4.0.3: - dependencies: - readdirp: 4.1.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - colord@2.9.3: {} - - colorette@1.4.0: {} - - commander@2.20.3: {} - - commander@7.2.0: {} - - concat-map@0.0.1: {} - - concat-with-sourcemaps@1.1.0: - dependencies: - source-map: 0.6.1 - - cross-env@7.0.3: - dependencies: - cross-spawn: 7.0.6 - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - css-declaration-sorter@6.4.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - css-select@4.3.0: - dependencies: - boolbase: 1.0.0 - css-what: 6.1.0 - domhandler: 4.3.1 - domutils: 2.8.0 - nth-check: 2.1.1 - - css-tree@1.1.3: - dependencies: - mdn-data: 2.0.14 - source-map: 0.6.1 - - css-what@6.1.0: {} - - cssesc@3.0.0: {} - - cssnano-preset-default@5.2.14(postcss@8.5.1): - dependencies: - css-declaration-sorter: 6.4.1(postcss@8.5.1) - cssnano-utils: 3.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-calc: 8.2.4(postcss@8.5.1) - postcss-colormin: 5.3.1(postcss@8.5.1) - postcss-convert-values: 5.1.3(postcss@8.5.1) - postcss-discard-comments: 5.1.2(postcss@8.5.1) - postcss-discard-duplicates: 5.1.0(postcss@8.5.1) - postcss-discard-empty: 5.1.1(postcss@8.5.1) - postcss-discard-overridden: 5.1.0(postcss@8.5.1) - postcss-merge-longhand: 5.1.7(postcss@8.5.1) - postcss-merge-rules: 5.1.4(postcss@8.5.1) - postcss-minify-font-values: 5.1.0(postcss@8.5.1) - postcss-minify-gradients: 5.1.1(postcss@8.5.1) - postcss-minify-params: 5.1.4(postcss@8.5.1) - postcss-minify-selectors: 5.2.1(postcss@8.5.1) - postcss-normalize-charset: 5.1.0(postcss@8.5.1) - postcss-normalize-display-values: 5.1.0(postcss@8.5.1) - postcss-normalize-positions: 5.1.1(postcss@8.5.1) - postcss-normalize-repeat-style: 5.1.1(postcss@8.5.1) - postcss-normalize-string: 5.1.0(postcss@8.5.1) - postcss-normalize-timing-functions: 5.1.0(postcss@8.5.1) - postcss-normalize-unicode: 5.1.1(postcss@8.5.1) - postcss-normalize-url: 5.1.0(postcss@8.5.1) - postcss-normalize-whitespace: 5.1.1(postcss@8.5.1) - postcss-ordered-values: 5.1.3(postcss@8.5.1) - postcss-reduce-initial: 5.1.2(postcss@8.5.1) - postcss-reduce-transforms: 5.1.0(postcss@8.5.1) - postcss-svgo: 5.1.0(postcss@8.5.1) - postcss-unique-selectors: 5.1.1(postcss@8.5.1) - - cssnano-utils@3.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - cssnano@5.1.15(postcss@8.5.1): - dependencies: - cssnano-preset-default: 5.2.14(postcss@8.5.1) - lilconfig: 2.1.0 - postcss: 8.5.1 - yaml: 1.10.2 - - csso@4.2.0: - dependencies: - css-tree: 1.1.3 - - deepmerge@4.3.1: {} - - detect-libc@1.0.3: - optional: true - - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - - dom-serializer@1.4.1: - dependencies: - domelementtype: 2.3.0 - domhandler: 4.3.1 - entities: 2.2.0 - - domelementtype@2.3.0: {} - - domhandler@4.3.1: - dependencies: - domelementtype: 2.3.0 - - domutils@2.8.0: - dependencies: - dom-serializer: 1.4.1 - domelementtype: 2.3.0 - domhandler: 4.3.1 - - electron-to-chromium@1.5.90: {} - - entities@2.2.0: {} - - escalade@3.2.0: {} - - estree-walker@0.6.1: {} - - estree-walker@2.0.2: {} - - eventemitter3@4.0.7: {} - - fast-glob@3.3.3: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 - - fastq@1.19.0: - dependencies: - reusify: 1.0.4 - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - fraction.js@4.3.7: {} - - fs-extra@8.1.0: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - - fs.realpath@1.0.0: {} - - fsevents@2.3.3: - optional: true - - function-bind@1.1.2: {} - - generic-names@4.0.0: - dependencies: - loader-utils: 3.3.1 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@10.0.1: - dependencies: - '@types/glob': 7.2.0 - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.3 - glob: 7.2.3 - ignore: 5.3.2 - merge2: 1.4.1 - slash: 3.0.0 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - icss-replace-symbols@1.1.0: {} - - icss-utils@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - ignore@5.3.2: {} - - immutable@5.0.3: {} - - import-cwd@3.0.0: - dependencies: - import-from: 3.0.0 - - import-from@3.0.0: - dependencies: - resolve-from: 5.0.0 - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - is-core-module@2.16.1: - dependencies: - hasown: 2.0.2 - - is-extglob@2.1.1: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-module@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@3.0.1: {} - - isexe@2.0.0: {} - - jsonfile@4.0.0: - optionalDependencies: - graceful-fs: 4.2.11 - - lilconfig@2.1.0: {} - - loader-utils@3.3.1: {} - - lodash.camelcase@4.3.0: {} - - lodash.memoize@4.1.2: {} - - lodash.uniq@4.5.0: {} - - mdn-data@2.0.14: {} - - merge2@1.4.1: {} - - micromatch@4.0.8: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - nanoid@3.3.8: {} - - node-addon-api@7.1.1: - optional: true - - node-releases@2.0.19: {} - - normalize-range@0.1.2: {} - - normalize-url@6.1.0: {} - - nth-check@2.1.1: - dependencies: - boolbase: 1.0.0 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - p-finally@1.0.0: {} - - p-queue@6.6.2: - dependencies: - eventemitter3: 4.0.7 - p-timeout: 3.2.0 - - p-timeout@3.2.0: - dependencies: - p-finally: 1.0.0 - - path-is-absolute@1.0.1: {} - - path-key@3.1.1: {} - - path-parse@1.0.7: {} - - path-type@4.0.0: {} - - picocolors@1.1.1: {} - - picomatch@2.3.1: {} - - picomatch@4.0.2: {} - - pify@2.3.0: {} - - pify@5.0.0: {} - - postcss-calc@8.2.4(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-selector-parser: 6.1.2 - postcss-value-parser: 4.2.0 - - postcss-colormin@5.3.1(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - caniuse-api: 3.0.0 - colord: 2.9.3 - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-convert-values@5.1.3(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-discard-comments@5.1.2(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-discard-duplicates@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-discard-empty@5.1.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-discard-overridden@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-import@16.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - read-cache: 1.0.0 - resolve: 1.22.10 - - postcss-load-config@3.1.4(postcss@8.5.1): - dependencies: - lilconfig: 2.1.0 - yaml: 1.10.2 - optionalDependencies: - postcss: 8.5.1 - - postcss-merge-longhand@5.1.7(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - stylehacks: 5.1.1(postcss@8.5.1) - - postcss-merge-rules@5.1.4(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - caniuse-api: 3.0.0 - cssnano-utils: 3.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-selector-parser: 6.1.2 - - postcss-minify-font-values@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-minify-gradients@5.1.1(postcss@8.5.1): - dependencies: - colord: 2.9.3 - cssnano-utils: 3.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-minify-params@5.1.4(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - cssnano-utils: 3.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-minify-selectors@5.2.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-selector-parser: 6.1.2 - - postcss-modules-extract-imports@3.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-modules-local-by-default@4.2.0(postcss@8.5.1): - dependencies: - icss-utils: 5.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-selector-parser: 7.0.0 - postcss-value-parser: 4.2.0 - - postcss-modules-scope@3.2.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-selector-parser: 7.0.0 - - postcss-modules-values@4.0.0(postcss@8.5.1): - dependencies: - icss-utils: 5.1.0(postcss@8.5.1) - postcss: 8.5.1 - - postcss-modules@4.3.1(postcss@8.5.1): - dependencies: - generic-names: 4.0.0 - icss-replace-symbols: 1.1.0 - lodash.camelcase: 4.3.0 - postcss: 8.5.1 - postcss-modules-extract-imports: 3.1.0(postcss@8.5.1) - postcss-modules-local-by-default: 4.2.0(postcss@8.5.1) - postcss-modules-scope: 3.2.1(postcss@8.5.1) - postcss-modules-values: 4.0.0(postcss@8.5.1) - string-hash: 1.1.3 - - postcss-normalize-charset@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - - postcss-normalize-display-values@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-positions@5.1.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-repeat-style@5.1.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-string@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-timing-functions@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-unicode@5.1.1(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-url@5.1.0(postcss@8.5.1): - dependencies: - normalize-url: 6.1.0 - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-normalize-whitespace@5.1.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-ordered-values@5.1.3(postcss@8.5.1): - dependencies: - cssnano-utils: 3.1.0(postcss@8.5.1) - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-reduce-initial@5.1.2(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - caniuse-api: 3.0.0 - postcss: 8.5.1 - - postcss-reduce-transforms@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - - postcss-selector-parser@6.1.2: - dependencies: - cssesc: 3.0.0 - util-deprecate: 1.0.2 - - postcss-selector-parser@7.0.0: - dependencies: - cssesc: 3.0.0 - util-deprecate: 1.0.2 - - postcss-svgo@5.1.0(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-value-parser: 4.2.0 - svgo: 2.8.0 - - postcss-unique-selectors@5.1.1(postcss@8.5.1): - dependencies: - postcss: 8.5.1 - postcss-selector-parser: 6.1.2 - - postcss-value-parser@4.2.0: {} - - postcss@8.5.1: - dependencies: - nanoid: 3.3.8 - picocolors: 1.1.1 - source-map-js: 1.2.1 - - prettier-plugin-organize-imports@4.1.0(prettier@3.4.2)(typescript@5.7.3): - dependencies: - prettier: 3.4.2 - typescript: 5.7.3 - - prettier@3.4.2: {} - - promise.series@0.2.0: {} - - queue-microtask@1.2.3: {} - - randombytes@2.1.0: - dependencies: - safe-buffer: 5.2.1 - - read-cache@1.0.0: - dependencies: - pify: 2.3.0 - - readdirp@4.1.1: {} - - resolve-from@5.0.0: {} - - resolve@1.22.10: - dependencies: - is-core-module: 2.16.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - - reusify@1.0.4: {} - - rimraf@2.7.1: - dependencies: - glob: 7.2.3 - - rollup-plugin-cleaner@1.0.0(rollup@2.79.2): - dependencies: - rimraf: 2.7.1 - rollup: 2.79.2 - - rollup-plugin-copy@3.5.0: - dependencies: - '@types/fs-extra': 8.1.5 - colorette: 1.4.0 - fs-extra: 8.1.0 - globby: 10.0.1 - is-plain-object: 3.0.1 - - rollup-plugin-import-css@3.5.8(rollup@2.79.2): - dependencies: - '@rollup/pluginutils': 5.1.4(rollup@2.79.2) - rollup: 2.79.2 - - rollup-plugin-postcss@4.0.2(postcss@8.5.1): - dependencies: - chalk: 4.1.2 - concat-with-sourcemaps: 1.1.0 - cssnano: 5.1.15(postcss@8.5.1) - import-cwd: 3.0.0 - p-queue: 6.6.2 - pify: 5.0.0 - postcss: 8.5.1 - postcss-load-config: 3.1.4(postcss@8.5.1) - postcss-modules: 4.3.1(postcss@8.5.1) - promise.series: 0.2.0 - resolve: 1.22.10 - rollup-pluginutils: 2.8.2 - safe-identifier: 0.4.2 - style-inject: 0.3.0 - transitivePeerDependencies: - - ts-node - - rollup-pluginutils@2.8.2: - dependencies: - estree-walker: 0.6.1 - - rollup@2.79.2: - optionalDependencies: - fsevents: 2.3.3 - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - safe-buffer@5.2.1: {} - - safe-identifier@0.4.2: {} - - sass@1.83.4: - dependencies: - chokidar: 4.0.3 - immutable: 5.0.3 - source-map-js: 1.2.1 - optionalDependencies: - '@parcel/watcher': 2.5.1 - - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - slash@3.0.0: {} - - smob@1.5.0: {} - - source-map-js@1.2.1: {} - - source-map-support@0.5.21: - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - - source-map@0.6.1: {} - - stable@0.1.8: {} - - string-hash@1.1.3: {} - - style-inject@0.3.0: {} - - stylehacks@5.1.1(postcss@8.5.1): - dependencies: - browserslist: 4.24.4 - postcss: 8.5.1 - postcss-selector-parser: 6.1.2 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - supports-preserve-symlinks-flag@1.0.0: {} - - svgo@2.8.0: - dependencies: - '@trysound/sax': 0.2.0 - commander: 7.2.0 - css-select: 4.3.0 - css-tree: 1.1.3 - csso: 4.2.0 - picocolors: 1.1.1 - stable: 0.1.8 - - terser@5.37.0: - dependencies: - '@jridgewell/source-map': 0.3.6 - acorn: 8.14.0 - commander: 2.20.3 - source-map-support: 0.5.21 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - tslib@2.8.1: {} - - typescript@5.7.3: {} - - undici-types@6.20.0: {} - - universalify@0.1.2: {} - - update-browserslist-db@1.1.2(browserslist@4.24.4): - dependencies: - browserslist: 4.24.4 - escalade: 3.2.0 - picocolors: 1.1.1 - - util-deprecate@1.0.2: {} - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - wrappy@1.0.2: {} - - yaml@1.10.2: {} diff --git a/2020/tsconfig.json b/2020/tsconfig.json deleted file mode 100644 index d18e596..0000000 --- a/2020/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "incremental": true, /* Enables incremental builds */ - "target": "es2017", /* Specifies the ES2017 target, compatible with Coherent GT */ - "module": "es2015", /* Ensures that modules are at least es2015 */ - "strict": true, /* Enables strict type checking, highly recommended but optional */ - "esModuleInterop": true, /* Emits additional JS to work with CommonJS modules */ - "skipLibCheck": true, /* Skip type checking on library .d.ts files */ - "forceConsistentCasingInFileNames": true, /* Ensures correct import casing */ - "moduleResolution": "node", /* Enables compatibility with MSFS SDK bare global imports */ - "jsxFactory": "FSComponent.buildComponent", /* Required for FSComponent framework JSX */ - "jsxFragmentFactory": "FSComponent.Fragment", /* Required for FSComponent framework JSX */ - "jsx": "react" /* Required for FSComponent framework JSX */ - } -} diff --git a/2024/.prettierrc.cjs b/2024/.prettierrc.cjs deleted file mode 100644 index 11e342d..0000000 --- a/2024/.prettierrc.cjs +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - printWidth: 120, - tabWidth: 2, - semi: true, - trailingComma: 'es5', - singleQuote: true, - arrowParens: 'always', - plugins: ['prettier-plugin-organize-imports'], -}; diff --git a/2024/Gauge/src/assets/fonts/Consolas.ttf b/2024/Gauge/src/assets/fonts/Consolas.ttf deleted file mode 100644 index bb988e8..0000000 Binary files a/2024/Gauge/src/assets/fonts/Consolas.ttf and /dev/null differ diff --git a/2024/Gauge/src/assets/img/compass.png b/2024/Gauge/src/assets/img/compass.png deleted file mode 100644 index 600e82a..0000000 Binary files a/2024/Gauge/src/assets/img/compass.png and /dev/null differ diff --git a/2024/Gauge/src/assets/img/wrench.png b/2024/Gauge/src/assets/img/wrench.png deleted file mode 100644 index 5784ffa..0000000 Binary files a/2024/Gauge/src/assets/img/wrench.png and /dev/null differ diff --git a/2024/Gauge/src/components/controls/controls.scss b/2024/Gauge/src/components/controls/controls.scss deleted file mode 100644 index 0c1134a..0000000 --- a/2024/Gauge/src/components/controls/controls.scss +++ /dev/null @@ -1,30 +0,0 @@ -#KH_CTRL { - height: 80px; - display: flex; - justify-content: space-around; - align-items: center; - - .button { - border-radius: 5px; - border: solid 1px #000; - padding-left: 7px; - padding-right: 7px; - - .icon { - width: 30px; - margin-top: 6px; - } - - &:hover:not([disabled]) { - background-color: var(--buttonHoverColor); - } - - &.d180 { - transform: rotate(180deg); - } - - &.d90 { - transform: rotate(90deg); - } - } -} diff --git a/2024/Gauge/src/components/controls/controls.tsx b/2024/Gauge/src/components/controls/controls.tsx deleted file mode 100644 index ec8e381..0000000 --- a/2024/Gauge/src/components/controls/controls.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { - ComponentProps, - ComputedSubject, - DisplayComponent, - FSComponent, - NodeReference, - Subscribable, - VNode, -} from '@microsoft/msfs-sdk'; - -import './controls.scss'; - -interface ControlsProps extends ComponentProps { - containerRef: NodeReference; - reload: () => void; - position: Subscribable; - page: number; -} - -export class Controls extends DisplayComponent { - private cycleRef = FSComponent.createRef(); - private toTopRef = FSComponent.createRef(); - private reloadRef = FSComponent.createRef(); - private switchPosRef = FSComponent.createRef(); - private buttonName = ComputedSubject.create(0, (val) => { - if (val === 1) return '/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png'; - else if (val === 2) return '/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png'; - return ''; - }); - - constructor(props: ControlsProps) { - super(props); - - props.position.sub((p) => this.buttonName.set(p)); - } - - private cycle = (): void => { - if (this.props.page === 0) SimVar.SetSimVarValue('L:KH_FE_FPLAN_P1', 'bool', true); - else if (this.props.page === 1) SimVar.SetSimVarValue('L:KH_FE_FPLAN_P1', 'bool', false); - }; - - private toTop = (): void => { - if (!this.props.containerRef.instance) return; - - this.props.containerRef.instance.scrollTop = 0; - }; - - private switchPosition = (): void => { - if (this.props.position.get() === 1) SimVar.SetSimVarValue('L:KH_FE_FPLAN_BOARD', 'number', 2); - else if (this.props.position.get() === 2) SimVar.SetSimVarValue('L:KH_FE_FPLAN_BOARD', 'number', 1); - }; - - public render = (): VNode => ( -
- {this.props.page === 1 && ( -
- -
- )} -
- -
-
- -
-
- -
- {this.props.page === 0 && ( -
- -
- )} -
- ); - - public onAfterRender = (): void => { - this.cycleRef.instance.onclick = this.cycle; - this.toTopRef.instance.onclick = this.toTop; - this.reloadRef.instance.onclick = this.props.reload; - this.switchPosRef.instance.onclick = this.switchPosition; - }; -} diff --git a/2024/Gauge/src/components/ofp/ofp.tsx b/2024/Gauge/src/components/ofp/ofp.tsx deleted file mode 100644 index b51e032..0000000 --- a/2024/Gauge/src/components/ofp/ofp.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { ComponentProps, DisplayComponent, FSComponent, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Controls } from '../controls/controls'; - -interface OFPProps extends ComponentProps { - content: Subscribable; - reload: () => void; - position: Subscribable; -} - -export class OFP extends DisplayComponent { - private containerRef = FSComponent.createRef(); - private ofpRef = FSComponent.createRef(); - - constructor(props: OFPProps) { - super(props); - } - - private defineDragScroll = (horizontalScroll = true, verticalScroll = true): void => { - if (!this.containerRef.instance) return; - - let pos = { top: 0, left: 0, x: 0, y: 0 }; - - const mouseDownHandler = (e: MouseEvent) => { - pos = { - left: this.containerRef.instance.scrollLeft, - top: this.containerRef.instance.scrollTop, - x: e.clientX, - y: e.clientY, - }; - document.addEventListener('mousemove', mouseMoveHandler); - document.addEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - const mouseMoveHandler = (e: MouseEvent) => { - const dx = e.clientX - pos.x; - const dy = e.clientY - pos.y; - - if (verticalScroll) { - this.containerRef.instance.scrollTop = pos.top - dy; - } - if (horizontalScroll) { - this.containerRef.instance.scrollLeft = pos.left - dx; - } - }; - - const mouseUpHandler = (e: MouseEvent) => { - document.removeEventListener('mousemove', mouseMoveHandler); - document.removeEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - this.containerRef.instance.addEventListener('mousedown', mouseDownHandler); - }; - - public render = (): VNode => ( - <> -
-
-
- - - ); - - public onAfterRender = (): void => { - this.defineDragScroll(); - - this.props.content.sub((content) => { - this.ofpRef.instance.innerHTML = content; - }); - }; -} diff --git a/2024/Gauge/src/components/tlr/tlr.tsx b/2024/Gauge/src/components/tlr/tlr.tsx deleted file mode 100644 index 9f210da..0000000 --- a/2024/Gauge/src/components/tlr/tlr.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { ComponentProps, DisplayComponent, FSComponent, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Controls } from '../controls/controls'; - -interface TLRProps extends ComponentProps { - content: Subscribable; - reload: () => void; - position: Subscribable; -} - -export class TLR extends DisplayComponent { - private containerRef = FSComponent.createRef(); - - constructor(props: TLRProps) { - super(props); - } - - private defineDragScroll = (horizontalScroll = true, verticalScroll = true): void => { - if (!this.containerRef.instance) return; - - let pos = { top: 0, left: 0, x: 0, y: 0 }; - - const mouseDownHandler = (e: MouseEvent) => { - pos = { - left: this.containerRef.instance.scrollLeft, - top: this.containerRef.instance.scrollTop, - x: e.clientX, - y: e.clientY, - }; - document.addEventListener('mousemove', mouseMoveHandler); - document.addEventListener('mouseup', mouseUpHandler); - document.addEventListener('mouseleave', mouseUpHandler); - }; - - const mouseMoveHandler = (e: MouseEvent) => { - const dx = e.clientX - pos.x; - const dy = e.clientY - pos.y; - - if (verticalScroll) { - this.containerRef.instance.scrollTop = pos.top - dy; - } - if (horizontalScroll) { - this.containerRef.instance.scrollLeft = pos.left - dx; - } - }; - - const mouseUpHandler = (e: MouseEvent) => { - document.removeEventListener('mousemove', mouseMoveHandler); - document.removeEventListener('mouseup', mouseUpHandler); - document.removeEventListener('mouseleave', mouseUpHandler); - }; - - this.containerRef.instance.addEventListener('mousedown', mouseDownHandler); - }; - - public render = (): VNode => ( - <> -
-
-
-
{this.props.content}
-
-
-
- - - ); - - public onAfterRender = (): void => { - this.defineDragScroll(); - }; -} diff --git a/2024/Gauge/src/index.html b/2024/Gauge/src/index.html deleted file mode 100644 index 58665b4..0000000 --- a/2024/Gauge/src/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/2024/Gauge/src/index.scss b/2024/Gauge/src/index.scss deleted file mode 100644 index fbb3190..0000000 --- a/2024/Gauge/src/index.scss +++ /dev/null @@ -1,68 +0,0 @@ -@font-face { - font-family: 'Consolas'; - src: url('./assets/fonts/Consolas.ttf') format('truetype'); - font-weight: 100; - font-style: normal; -} - -::-webkit-scrollbar { - width: 10px; -} - -::-webkit-scrollbar-track { - background: lightgray; -} - -::-webkit-scrollbar-thumb { - background: gray; - height: 200px; -} - -::-webkit-scrollbar-thumb:hover { - background: darkgray; -} - -#root { - --buttonHoverColor: lightgray; - --fss-select-hover: lightgray; - /* No idea why, zero. I looked at the EFB.css and it has 100%, but doing so screws this over hard */ - width: 594px; - height: 100%; - background-image: url(../EFB/Images/bg.png); - background-size: 100% 100%; - color: #000; - font-size: 25px; - padding: 3vw; - - #KH_FE_FPLAN { - height: calc(100vh - 6vw - 180px); - width: 100%; - margin-top: 100px; - margin-bottom: 3vw; - overflow-y: scroll; - overflow-x: hidden; - - #TLR div, - #OFP div { - line-height: unset !important; - font-size: unset !important; - } - - #TLR pre, - #OFP pre { - white-space: pre; - line-height: 14px; - font-size: 13px; - font-family: 'Consolas' !important; - } - - #OFP img { - width: 100%; - } - - &.p2 { - height: calc(100vh - 6vw - 240px); - margin-top: 160px; - } - } -} diff --git a/2024/Gauge/src/index.tsx b/2024/Gauge/src/index.tsx deleted file mode 100644 index 2362269..0000000 --- a/2024/Gauge/src/index.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/// -/// - -import { EventBus, FSComponent, SimVarPublisher, SimVarValueType, Subject } from '@microsoft/msfs-sdk'; -import { OFP } from './components/ofp/ofp'; -import { TLR } from './components/tlr/tlr'; - -import './index.scss'; - -export interface NewDataEvents { - newData: boolean; - position: number; -} - -class KH_FE_FPLAN extends BaseInstrument { - private readonly bus = new EventBus(); - private readonly newDataPublisher = new SimVarPublisher( - new Map([ - ['newData', { name: 'L:KH_FE_FPLAN_NEW_DATA', type: SimVarValueType.Bool }], - ['position', { name: 'L:KH_FE_FPLAN_BOARD', type: SimVarValueType.Number }], - ]), - this.bus - ); - private contentOFP = Subject.create(''); - private contentTLR = Subject.create(''); - private position = Subject.create(0); - - private sbID = ''; - - get templateID(): string { - return 'kh-fe-fplan'; - } - - get isInteractive() { - return true; - } - - constructor() { - super(); - - const config = GetStoredData('FSS_B727_EFB_CONFIG_PREFLIGHT'); - try { - this.sbID = JSON.parse(config).simBriefId; - } catch (e) { - console.error('Failed loading config.', e); - } - } - - private getSB = async (): Promise => { - try { - const res = await fetch(`https://www.simbrief.com/api/xml.fetcher.php?username=${this.sbID}&json=1`); - if (res.ok) { - try { - const data = await res.json(); - - let ofp: string = data.text.plan_html; - ofp = ofp.replace(/href=".*?"/g, ''); - - this.contentOFP.set(ofp); - this.contentTLR.set(data.text.tlr_section); - } catch (e) { - console.error('JSON DECODE ERR', e); - } - } - } catch (e) { - console.error('FETCH ERR', e); - } - }; - - private reloadSB = (): void => { - SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 1); - }; - - protected Update(): void { - super.Update(); - - this.newDataPublisher.onUpdate(); - } - - public connectedCallback(): void { - super.connectedCallback(); - - this.newDataPublisher.startPublish(); - const sub = this.bus.getSubscriber(); - sub.on('newData').handle((flag) => { - if (!flag) return; - SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 0); - this.getSB(); - }); - sub.on('position').handle((position) => { - this.position.set(position); - }); - - const url = new URL(this.getAttribute('Url') ?? ''); - const type = url.searchParams.get('type'); - - FSComponent.render( - <> - {type === 'ofp' && } - {type === 'tlr' && } - , - document.getElementById('root') - ); - } -} - -registerInstrument('kh-fe-fplan', KH_FE_FPLAN); diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG deleted file mode 100644 index a72db9e..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml deleted file mode 100644 index 078116b..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_DECAL0 \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG deleted file mode 100644 index 8b7dbba..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml deleted file mode 100644 index 756c672..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_METAL_ROUGH_AOtrue \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG deleted file mode 100644 index 447e1b0..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml deleted file mode 100644 index 9652891..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_NORMAL \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG deleted file mode 100644 index ffc0aea..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png deleted file mode 100644 index ffc0aea..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml deleted file mode 100644 index 078116b..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_DECAL0 \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml deleted file mode 100644 index 078116b..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_DECAL0 \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG deleted file mode 100644 index 6e8ad2a..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png deleted file mode 100644 index 6e8ad2a..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml deleted file mode 100644 index 756c672..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_METAL_ROUGH_AOtrue \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml deleted file mode 100644 index 756c672..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_METAL_ROUGH_AOtrue \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG deleted file mode 100644 index 93f3834..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png deleted file mode 100644 index 93f3834..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml deleted file mode 100644 index f0cde24..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_EMISSIVE \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml deleted file mode 100644 index f0cde24..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_EMISSIVE \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG deleted file mode 100644 index dbcd27a..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png deleted file mode 100644 index dbcd27a..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml deleted file mode 100644 index 9652891..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_NORMAL \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml deleted file mode 100644 index 9652891..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml +++ /dev/null @@ -1 +0,0 @@ -MTL_BITMAP_NORMAL \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg deleted file mode 100644 index 2f476ba..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[models] -normal=sb-fplan.xml \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin deleted file mode 100644 index 59fcf1f..0000000 Binary files a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin and /dev/null differ diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf deleted file mode 100644 index a155800..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf +++ /dev/null @@ -1,2588 +0,0 @@ -{ - "asset": { - "extensions": { - "ASOBO_normal_map_convention": { - "tangent_space_convention": "DirectX" - } - }, - "generator": "Khronos glTF Blender I/O v3.6.28 and Asobo Studio MSFS2024 Blender I/O v1.3.2 with Blender v3.6.19", - "version": "2.0" - }, - "extensionsUsed": [ - "ASOBO_normal_map_convention", - "ASOBO_unique_id", - "ASOBO_material_invisible", - "ASOBO_material_shadow_options", - "ASOBO_tags" - ], - "scene": 0, - "scenes": [ - { - "name": "Scene", - "nodes": [ - 31 - ] - } - ], - "nodes": [ - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_BOARD_CLICK" - } - }, - "mesh": 0, - "name": "KH_FE_FPLAN_BOARD_CLICK", - "rotation": [ - 0.7071068286895752, - 0, - 0, - 0.7071068286895752 - ], - "scale": [ - 0.05919208377599716, - 0.018007492646574974, - 0.01716664806008339 - ], - "translation": [ - 0.0007727742195129395, - 0.12721025943756104, - 0.0047774538397789 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P2" - } - }, - "mesh": 1, - "name": "KH_FE_FPLAN_P2", - "translation": [ - 0, - -0.010025441646575928, - 0.0016529858112335205 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_9" - } - }, - "mesh": 2, - "name": "KH_FE_FPLAN_P1_9", - "rotation": [ - 0.7071067690849304, - 2.081224749424281e-15, - -2.5121479332521068e-14, - 0.7071067690849304 - ], - "translation": [ - -1.9967102105056256e-07, - 0.0329994261264801, - -6.639704679400893e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_9" - } - }, - "mesh": 3, - "name": "KH_FE_FPLAN_P1_B_9", - "rotation": [ - 5.3385093679025886e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.3385093679025886e-08 - ], - "translation": [ - -1.9967102105056256e-07, - 0.0329994261264801, - -6.639704679400893e-07 - ] - }, - { - "children": [ - 2, - 3 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE008" - } - }, - "name": "KH_BONE008", - "rotation": [ - 2.890080213546753e-05, - 0, - 1.1254996934439987e-11, - 1 - ], - "translation": [ - -8.051988231727591e-08, - 0.03300037980079651, - -1.1184558843524428e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_8" - } - }, - "mesh": 4, - "name": "KH_FE_FPLAN_P1_8", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.4012360338711005e-07, - 0.03300014138221741, - -3.063057420149562e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_8" - } - }, - "mesh": 5, - "name": "KH_FE_FPLAN_P1_B_8", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012360338711005e-07, - 0.03300014138221741, - -3.063057420149562e-06 - ] - }, - { - "children": [ - 4, - 5, - 6 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE007" - } - }, - "name": "KH_BONE007", - "translation": [ - -8.051955546761747e-08, - 0.03299993276596069, - -6.416187261493178e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_7" - } - }, - "mesh": 6, - "name": "KH_FE_FPLAN_P1_7", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.401242002430081e-07, - 0.032999902963638306, - -6.34168145552394e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_7" - } - }, - "mesh": 7, - "name": "KH_FE_FPLAN_P1_B_7", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.401242002430081e-07, - 0.032999902963638306, - -6.34168145552394e-07 - ] - }, - { - "children": [ - 7, - 8, - 9 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE006" - } - }, - "name": "KH_BONE006", - "translation": [ - -8.052012390180607e-08, - 0.03299969434738159, - 1.7127647424786119e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_6" - } - }, - "mesh": 8, - "name": "KH_FE_FPLAN_P1_6", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.9972944187429675e-07, - 0.032999277114868164, - 1.7723693872540025e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_6" - } - }, - "mesh": 9, - "name": "KH_FE_FPLAN_P1_B_6", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012479709890613e-07, - 0.032999277114868164, - 1.7723693872540025e-06 - ] - }, - { - "children": [ - 10, - 11, - 12 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE005" - } - }, - "name": "KH_BONE005", - "translation": [ - -8.051976863043819e-08, - 0.03299999237060547, - -3.6069498037250014e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_5" - } - }, - "mesh": 10, - "name": "KH_FE_FPLAN_P1_5", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.9972812026480824e-07, - 0.03299999237060547, - -5.588804469880415e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_5" - } - }, - "mesh": 11, - "name": "KH_FE_FPLAN_P1_B_5", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012347548941761e-07, - 0.03299999237060547, - -5.588804015133064e-06 - ] - }, - { - "children": [ - 13, - 14, - 15 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE004" - } - }, - "name": "KH_BONE004", - "translation": [ - -8.051988231727591e-08, - 0.03300023078918457, - 6.473317171185045e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_4" - } - }, - "mesh": 12, - "name": "KH_FE_FPLAN_P1_4", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.9972915765720245e-07, - 0.033000290393829346, - 6.324305559246568e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_4" - } - }, - "mesh": 13, - "name": "KH_FE_FPLAN_P1_B_4", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012451288181182e-07, - 0.033000290393829346, - 6.324305559246568e-07 - ] - }, - { - "children": [ - 16, - 17, - 18 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE003" - } - }, - "name": "KH_BONE003", - "translation": [ - -8.051954125676275e-08, - 0.03299975395202637, - -8.204326604754897e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_3" - } - }, - "mesh": 14, - "name": "KH_FE_FPLAN_P1_3", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.99728830807544e-07, - 0.03299969434738159, - -8.05531499281642e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_3" - } - }, - "mesh": 15, - "name": "KH_FE_FPLAN_P1_B_3", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012418603215337e-07, - 0.03299969434738159, - -8.05531499281642e-07 - ] - }, - { - "children": [ - 19, - 20, - 21 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE002" - } - }, - "name": "KH_BONE002", - "translation": [ - -8.052010969095136e-08, - 0.033000290393829346, - -3.808483768352744e-07 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_2" - } - }, - "mesh": 16, - "name": "KH_FE_FPLAN_P1_2", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.997284613253214e-07, - 0.03300034999847412, - -2.3403511022479506e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_2" - } - }, - "mesh": 17, - "name": "KH_FE_FPLAN_P1_B_2", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.4012381654993078e-07, - 0.03300034999847412, - -2.3403511022479506e-06 - ] - }, - { - "children": [ - 22, - 23, - 24 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE001" - } - }, - "name": "KH_BONE001", - "translation": [ - -8.051976152501084e-08, - 0.033000051975250244, - 1.966084482774022e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_1" - } - }, - "mesh": 18, - "name": "KH_FE_FPLAN_P1_1", - "rotation": [ - 0.7071067690849304, - -2.5121478909004595e-15, - -2.5121478909004595e-15, - 0.7071067690849304 - ], - "translation": [ - -1.9972998188677593e-07, - 0.033000051975250244, - 3.910685791197466e-06 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_P1_B_1" - } - }, - "mesh": 19, - "name": "KH_FE_FPLAN_P1_B_1", - "rotation": [ - 5.338508657359853e-08, - -0.7071067690849304, - 0.7071067690849304, - 5.338507236274381e-08 - ], - "translation": [ - -1.401253371113853e-07, - 0.03299999237060547, - 3.9181368265417404e-06 - ] - }, - { - "children": [ - 25, - 26, - 27 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_BONE" - } - }, - "name": "KH_BONE", - "rotation": [ - 1.9470719792025193e-07, - 0, - -1, - 0 - ], - "translation": [ - 0.8823389410972595, - -2.2633979320526123, - 18.878217697143555 - ] - }, - { - "extensions": { - "ASOBO_unique_id": { - "id": "TARGET" - } - }, - "name": "TARGET", - "rotation": [ - 1.9470719792025193e-07, - 0, - -1, - 0 - ], - "translation": [ - 0.8823389410972595, - -2.5603978633880615, - 18.878217697143555 - ] - }, - { - "children": [ - 28, - 29 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_RIG" - } - }, - "name": "KH_RIG", - "translation": [ - -0.8823389410972595, - 2.401921033859253, - -18.876070022583008 - ] - }, - { - "children": [ - 0, - 1, - 30 - ], - "extensions": { - "ASOBO_unique_id": { - "id": "KH_FE_FPLAN_BOARD" - } - }, - "mesh": 20, - "name": "KH_FE_FPLAN_BOARD", - "rotation": [ - -0.07845910638570786, - 0, - 0, - 0.9969174265861511 - ], - "translation": [ - 0.8823389410972595, - 0.5709999799728394, - 19.02309799194336 - ] - } - ], - "animations": [ - { - "channels": [ - { - "sampler": 0, - "target": { - "node": 31, - "path": "translation" - } - }, - { - "sampler": 1, - "target": { - "node": 31, - "path": "rotation" - } - } - ], - "name": "KH_FE_FPLAN_BOARD", - "samplers": [ - { - "input": 70, - "interpolation": "LINEAR", - "output": 71 - }, - { - "input": 70, - "interpolation": "LINEAR", - "output": 72 - } - ] - }, - { - "channels": [ - { - "sampler": 0, - "target": { - "node": 25, - "path": "rotation" - } - }, - { - "sampler": 1, - "target": { - "node": 22, - "path": "rotation" - } - }, - { - "sampler": 2, - "target": { - "node": 19, - "path": "rotation" - } - }, - { - "sampler": 3, - "target": { - "node": 16, - "path": "rotation" - } - }, - { - "sampler": 4, - "target": { - "node": 13, - "path": "rotation" - } - }, - { - "sampler": 5, - "target": { - "node": 10, - "path": "rotation" - } - }, - { - "sampler": 6, - "target": { - "node": 7, - "path": "rotation" - } - }, - { - "sampler": 7, - "target": { - "node": 4, - "path": "rotation" - } - }, - { - "sampler": 8, - "target": { - "node": 29, - "path": "translation" - } - }, - { - "sampler": 9, - "target": { - "node": 29, - "path": "rotation" - } - } - ], - "name": "KH_FE_FPLAN", - "samplers": [ - { - "input": 73, - "interpolation": "LINEAR", - "output": 74 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 75 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 76 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 77 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 78 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 79 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 80 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 81 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 82 - }, - { - "input": 73, - "interpolation": "LINEAR", - "output": 83 - } - ] - } - ], - "materials": [ - { - "doubleSided": true, - "emissiveFactor": [ - 0, - 0, - 0 - ], - "extensions": { - "ASOBO_material_invisible": { - "enabled": true - }, - "ASOBO_material_shadow_options": { - "noCastShadow": true - } - }, - "extras": {}, - "name": "KH_CLICKSPOT", - "pbrMetallicRoughness": { - "baseColorFactor": [ - 1, - 1, - 1, - 1 - ], - "metallicFactor": 1, - "roughnessFactor": 1 - } - }, - { - "emissiveFactor": [ - 0, - 0, - 0 - ], - "extensions": { - "ASOBO_tags": { - "tags": [ - "Collision" - ] - } - }, - "extras": {}, - "name": "$KH_FE_FPLAN_P2", - "pbrMetallicRoughness": { - "baseColorFactor": [ - 1, - 1, - 1, - 1 - ], - "metallicFactor": 1, - "roughnessFactor": 1 - } - }, - { - "emissiveFactor": [ - 0, - 0, - 0 - ], - "extras": {}, - "name": "$KH_FE_FPLAN_P1", - "pbrMetallicRoughness": { - "baseColorFactor": [ - 1, - 1, - 1, - 1 - ], - "metallicFactor": 1, - "roughnessFactor": 1 - } - }, - { - "emissiveFactor": [ - 0, - 0, - 0 - ], - "extras": {}, - "name": "KH_FE_FPLAN_P1_BACK", - "normalTexture": { - "index": 0, - "scale": 1 - }, - "occlusionTexture": { - "index": 1 - }, - "pbrMetallicRoughness": { - "baseColorFactor": [ - 1, - 1, - 1, - 1 - ], - "baseColorTexture": { - "index": 2 - }, - "metallicFactor": 1, - "metallicRoughnessTexture": { - "index": 1 - }, - "roughnessFactor": 1 - } - }, - { - "emissiveFactor": [ - 0, - 0, - 0 - ], - "emissiveTexture": { - "index": 3 - }, - "extras": {}, - "name": "FSS_B727_Pilot_Panelx", - "normalTexture": { - "index": 4, - "scale": 1 - }, - "occlusionTexture": { - "index": 5 - }, - "pbrMetallicRoughness": { - "baseColorFactor": [ - 1, - 1, - 1, - 1 - ], - "baseColorTexture": { - "index": 6 - }, - "metallicFactor": 1, - "metallicRoughnessTexture": { - "index": 5 - }, - "roughnessFactor": 1 - } - } - ], - "meshes": [ - { - "name": "KH_FE_FPLAN_BOARD_CLICK", - "primitives": [ - { - "attributes": { - "POSITION": 0, - "NORMAL": 1, - "TEXCOORD_0": 2 - }, - "indices": 3, - "material": 0 - } - ] - }, - { - "name": "KH_FE_FPLAN_P2", - "primitives": [ - { - "attributes": { - "POSITION": 4, - "NORMAL": 5, - "TEXCOORD_0": 6 - }, - "indices": 7, - "material": 1 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_9", - "primitives": [ - { - "attributes": { - "POSITION": 8, - "NORMAL": 9, - "TEXCOORD_0": 10 - }, - "indices": 11, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_9", - "primitives": [ - { - "attributes": { - "POSITION": 12, - "NORMAL": 13, - "TEXCOORD_0": 14 - }, - "indices": 11, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_8", - "primitives": [ - { - "attributes": { - "POSITION": 15, - "NORMAL": 16, - "TEXCOORD_0": 17 - }, - "indices": 18, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_8", - "primitives": [ - { - "attributes": { - "POSITION": 19, - "NORMAL": 20, - "TEXCOORD_0": 21 - }, - "indices": 18, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_7", - "primitives": [ - { - "attributes": { - "POSITION": 22, - "NORMAL": 23, - "TEXCOORD_0": 24 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_7", - "primitives": [ - { - "attributes": { - "POSITION": 26, - "NORMAL": 27, - "TEXCOORD_0": 28 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_6", - "primitives": [ - { - "attributes": { - "POSITION": 29, - "NORMAL": 30, - "TEXCOORD_0": 31 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_6", - "primitives": [ - { - "attributes": { - "POSITION": 32, - "NORMAL": 33, - "TEXCOORD_0": 34 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_5", - "primitives": [ - { - "attributes": { - "POSITION": 35, - "NORMAL": 36, - "TEXCOORD_0": 37 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_5", - "primitives": [ - { - "attributes": { - "POSITION": 38, - "NORMAL": 39, - "TEXCOORD_0": 40 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_4", - "primitives": [ - { - "attributes": { - "POSITION": 41, - "NORMAL": 42, - "TEXCOORD_0": 43 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_4", - "primitives": [ - { - "attributes": { - "POSITION": 44, - "NORMAL": 45, - "TEXCOORD_0": 46 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_3", - "primitives": [ - { - "attributes": { - "POSITION": 47, - "NORMAL": 48, - "TEXCOORD_0": 49 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_3", - "primitives": [ - { - "attributes": { - "POSITION": 50, - "NORMAL": 51, - "TEXCOORD_0": 52 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_2", - "primitives": [ - { - "attributes": { - "POSITION": 53, - "NORMAL": 54, - "TEXCOORD_0": 55 - }, - "indices": 25, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_2", - "primitives": [ - { - "attributes": { - "POSITION": 56, - "NORMAL": 57, - "TEXCOORD_0": 58 - }, - "indices": 25, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_1", - "primitives": [ - { - "attributes": { - "POSITION": 59, - "NORMAL": 60, - "TEXCOORD_0": 61 - }, - "indices": 62, - "material": 2 - } - ] - }, - { - "name": "KH_FE_FPLAN_P1_B_1", - "primitives": [ - { - "attributes": { - "POSITION": 63, - "NORMAL": 64, - "TEXCOORD_0": 65 - }, - "indices": 62, - "material": 3 - } - ] - }, - { - "name": "KH_FE_FPLAN_BOARD", - "primitives": [ - { - "attributes": { - "POSITION": 66, - "NORMAL": 67, - "TEXCOORD_0": 68 - }, - "indices": 69, - "material": 4 - } - ] - } - ], - "textures": [ - { - "sampler": 0, - "source": 0 - }, - { - "sampler": 0, - "source": 1 - }, - { - "sampler": 0, - "source": 2 - }, - { - "sampler": 0, - "source": 3 - }, - { - "sampler": 0, - "source": 4 - }, - { - "sampler": 0, - "source": 5 - }, - { - "sampler": 0, - "source": 6 - } - ], - "images": [ - { - "mimeType": "image/png", - "name": "FSS_727_GENERAL_NORM.PNG", - "uri": "FSS_727_GENERAL_NORM.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_727_GENERAL_COMP.PNG", - "uri": "FSS_727_GENERAL_COMP.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_727_COCKPIT_DECAL_ALBD.PNG", - "uri": "FSS_727_COCKPIT_DECAL_ALBD.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_B727_PILOT_PANEL_EMIS.PNG", - "uri": "FSS_B727_PILOT_PANEL_EMIS.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_B727_PILOT_PANEL_NORM.PNG", - "uri": "FSS_B727_PILOT_PANEL_NORM.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_B727_PILOT_PANEL_COMP.PNG", - "uri": "FSS_B727_PILOT_PANEL_COMP.PNG" - }, - { - "mimeType": "image/png", - "name": "FSS_B727_PILOT_PANEL_ALBD.PNG", - "uri": "FSS_B727_PILOT_PANEL_ALBD.PNG" - } - ], - "skins": [ - { - "inverseBindMatrices": 84, - "joints": [ - 28, - 25, - 22, - 19, - 16, - 13, - 10, - 7, - 4, - 29 - ], - "name": "KH_RIG" - } - ], - "accessors": [ - { - "bufferView": 0, - "componentType": 5126, - "count": 4, - "max": [ - 1, - 0, - 1 - ], - "min": [ - -1, - 0, - -1 - ], - "type": "VEC3" - }, - { - "bufferView": 1, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 2, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 3, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500000417232513, - 0.1485000103712082, - 4.527312924551552e-08 - ], - "min": [ - -0.10500000417232513, - -0.1485000103712082, - -4.527312924551552e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 5, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 7, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - 0, - 0.032999999821186066 - ], - "min": [ - -0.10499998182058334, - -1.6027504323723463e-10, - 0 - ], - "type": "VEC3" - }, - { - "bufferView": 9, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 10, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 11, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 12, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - 0, - 0.032999999821186066 - ], - "min": [ - -0.10499998182058334, - -1.6027504323723463e-10, - 0 - ], - "type": "VEC3" - }, - { - "bufferView": 13, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 14, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 15, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - -1.6027504323723463e-10, - 0.03299976885318756 - ], - "min": [ - -0.10499998182058334, - -3.2055008647446925e-10, - -2.3096799850463867e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 16, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 17, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 18, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 19, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - -1.6027504323723463e-10, - 0.03299976885318756 - ], - "min": [ - -0.10499998182058334, - -3.2055008647446925e-10, - -2.3096799850463867e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 20, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 21, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 22, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - -3.2055008647446925e-10, - 0.03300001472234726 - ], - "min": [ - -0.10499998182058334, - -4.808251574672795e-10, - 1.4901161193847656e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 23, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 24, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 25, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 26, - "componentType": 5126, - "count": 4, - "max": [ - 0.10499998182058334, - -3.2055008647446925e-10, - 0.03300001472234726 - ], - "min": [ - -0.10499998182058334, - -4.808251574672795e-10, - 1.4901161193847656e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 27, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 28, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 29, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -4.808251574672795e-10, - 0.032999783754348755 - ], - "min": [ - -0.10499992221593857, - -6.411001729489385e-10, - -2.1606683731079102e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 30, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 31, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 32, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -4.808251574672795e-10, - 0.032999783754348755 - ], - "min": [ - -0.10499992221593857, - -6.411001729489385e-10, - -2.1606683731079102e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 33, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 34, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 35, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -6.411001729489385e-10, - 0.03300026059150696 - ], - "min": [ - -0.10499992221593857, - -8.013752439417487e-10, - 2.682209014892578e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 36, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 37, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 38, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -6.411001729489385e-10, - 0.03300026059150696 - ], - "min": [ - -0.10499992221593857, - -8.013752439417487e-10, - 2.682209014892578e-07 - ], - "type": "VEC3" - }, - { - "bufferView": 39, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 40, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 41, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -8.013752439417487e-10, - 0.03300003707408905 - ], - "min": [ - -0.10499992221593857, - -9.61650314934559e-10, - 2.9802322387695312e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 42, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 43, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 44, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -8.013752439417487e-10, - 0.03300003707408905 - ], - "min": [ - -0.10499992221593857, - -9.61650314934559e-10, - 2.9802322387695312e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 45, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 46, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 47, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -9.61650314934559e-10, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.1219254414385205e-09, - 4.470348358154297e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 48, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 49, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 50, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -9.61650314934559e-10, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.1219254414385205e-09, - 4.470348358154297e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 51, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 52, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 53, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -1.1219254414385205e-09, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.2822004569201795e-09, - 5.960464477539063e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 54, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 55, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 56, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -1.1219254414385205e-09, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.2822004569201795e-09, - 5.960464477539063e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 57, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 58, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 59, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -1.2822004569201795e-09, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.4424754724018385e-09, - 5.960464477539063e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 60, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 61, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 62, - "componentType": 5123, - "count": 6, - "type": "SCALAR" - }, - { - "bufferView": 63, - "componentType": 5126, - "count": 4, - "max": [ - 0.10500004142522812, - -1.2822004569201795e-09, - 0.033000051975250244 - ], - "min": [ - -0.10499992221593857, - -1.4424754724018385e-09, - 5.960464477539063e-08 - ], - "type": "VEC3" - }, - { - "bufferView": 64, - "componentType": 5126, - "count": 4, - "type": "VEC3" - }, - { - "bufferView": 65, - "componentType": 5126, - "count": 4, - "type": "VEC2" - }, - { - "bufferView": 66, - "componentType": 5126, - "count": 2305, - "max": [ - 0.10764703899621964, - 0.15674053132534027, - 0.007609423249959946 - ], - "min": [ - -0.1076275110244751, - -0.15923617780208588, - -0.001331819104962051 - ], - "type": "VEC3" - }, - { - "bufferView": 67, - "componentType": 5126, - "count": 2305, - "type": "VEC3" - }, - { - "bufferView": 68, - "componentType": 5126, - "count": 2305, - "type": "VEC2" - }, - { - "bufferView": 69, - "componentType": 5123, - "count": 6297, - "type": "SCALAR" - }, - { - "bufferView": 70, - "componentType": 5126, - "count": 60, - "max": [ - 2.4583333333333335 - ], - "min": [ - 0 - ], - "type": "SCALAR" - }, - { - "bufferView": 71, - "componentType": 5126, - "count": 60, - "type": "VEC3" - }, - { - "bufferView": 72, - "componentType": 5126, - "count": 60, - "type": "VEC4" - }, - { - "bufferView": 73, - "componentType": 5126, - "count": 11, - "max": [ - 0.4166666666666667 - ], - "min": [ - 0 - ], - "type": "SCALAR" - }, - { - "bufferView": 74, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 75, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 76, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 77, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 78, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 79, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 80, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 81, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 82, - "componentType": 5126, - "count": 11, - "type": "VEC3" - }, - { - "bufferView": 83, - "componentType": 5126, - "count": 11, - "type": "VEC4" - }, - { - "bufferView": 84, - "componentType": 5126, - "count": 10, - "type": "MAT4" - } - ], - "bufferViews": [ - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 0, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 48, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 96, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 128, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 140, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 188, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 236, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 268, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 280, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 328, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 376, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 408, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 420, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 468, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 516, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 548, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 596, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 644, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 676, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 688, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 736, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 784, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 816, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 864, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 912, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 944, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 956, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1004, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1052, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1084, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1132, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1180, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1212, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1260, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1308, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1340, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1388, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1436, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1468, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1516, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1564, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1596, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1644, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1692, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1724, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1772, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1820, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1852, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1900, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 1948, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 1980, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2028, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 2076, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2108, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2156, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 2204, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2236, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2284, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 2332, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2364, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2412, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 2460, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12, - "byteOffset": 2492, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2504, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 48, - "byteOffset": 2552, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 32, - "byteOffset": 2600, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 27660, - "byteOffset": 2632, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 27660, - "byteOffset": 30292, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 18440, - "byteOffset": 57952, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 12594, - "byteOffset": 76392, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 240, - "byteOffset": 88988 - }, - { - "buffer": 0, - "byteLength": 720, - "byteOffset": 89228 - }, - { - "buffer": 0, - "byteLength": 960, - "byteOffset": 89948 - }, - { - "buffer": 0, - "byteLength": 44, - "byteOffset": 90908 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 90952 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 91128 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 91304 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 91480 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 91656 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 91832 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 92008 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 92184 - }, - { - "buffer": 0, - "byteLength": 132, - "byteOffset": 92360 - }, - { - "buffer": 0, - "byteLength": 176, - "byteOffset": 92492 - }, - { - "buffer": 0, - "byteLength": 640, - "byteOffset": 92668 - } - ], - "samplers": [ - { - "magFilter": 9729, - "minFilter": 9987 - } - ], - "buffers": [ - { - "byteLength": 93308, - "uri": "sb-fplan.bin" - } - ] -} \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml deleted file mode 100644 index eb45167..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg b/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg deleted file mode 100644 index 92e6f5a..0000000 --- a/2024/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[VERSION] -Major = 1 -Minor = 0 - -[FLTSIM.0] -title = fss-aircraft-boeing-727-200f-sb-fplan -model = "" -texture = "" -animation = "" -sound = "" -soundai = "" - -[GENERAL] -category = SimpleObject \ No newline at end of file diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js deleted file mode 100644 index 140ef54..0000000 --- a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js +++ /dev/null @@ -1,189 +0,0 @@ -const j6_0xca47fd = (function () { - let _0x29bb3f = !![]; - return function (_0x1eef08, _0x3f53d2) { - const _0x1fc5ed = _0x29bb3f - ? function () { - if (_0x3f53d2) { - const _0x45f38f = _0x3f53d2['apply'](_0x1eef08, arguments); - return (_0x3f53d2 = null), _0x45f38f; - } - } - : function () {}; - return (_0x29bb3f = ![]), _0x1fc5ed; - }; - })(), - j6_0x14eaec = j6_0xca47fd(this, function () { - const _0x1c40d9 = function () { - let _0x41ef43; - try { - _0x41ef43 = Function( - 'retur' + - 'n\x20(fu' + - 'nctio' + - 'n()\x20' + - ('{}.co' + 'nstru' + 'ctor(' + '\x22retu' + 'rn\x20th' + 'is\x22)(' + '\x20)') + - ');' - )(); - } catch (_0x5064d1) { - _0x41ef43 = window; - } - return _0x41ef43; - }, - _0xa6d217 = _0x1c40d9(), - _0x28f1fd = (_0xa6d217['conso' + 'le'] = _0xa6d217['conso' + 'le'] || {}), - _0x427c5e = ['log', 'warn', 'info', 'error', 'excep' + 'tion', 'table', 'trace']; - for (let _0x5a262e = 0x0; _0x5a262e < _0x427c5e['lengt' + 'h']; _0x5a262e++) { - const _0x361466 = j6_0xca47fd['const' + 'ructo' + 'r']['proto' + 'type']['bind'](j6_0xca47fd), - _0x462cef = _0x427c5e[_0x5a262e], - _0x195676 = _0x28f1fd[_0x462cef] || _0x361466; - (_0x361466['__pro' + 'to__'] = j6_0xca47fd['bind'](j6_0xca47fd)), - (_0x361466['toStr' + 'ing'] = _0x195676['toStr' + 'ing']['bind'](_0x195676)), - (_0x28f1fd[_0x462cef] = _0x361466); - } - }); -j6_0x14eaec(); -class EFBUtils { - static ['setSe' + 'ating' + 'Posit' + 'ion'](_0x183760) { - SimVar['SetSi' + 'mVarV' + 'alue']('A:CAMERA STATE', 'Number', 0x2), - SimVar['SetSi' + 'mVarV' + 'alue']('A:CAMERA SUBSTATE', 'Number', 0x1), - SimVar['SetSi' + 'mVarV' + 'alue']('A:CAMERA REQUEST ACTION', 'Number', 0x1), - _0x183760 - ? setTimeout(() => { - SimVar['SetSi' + 'mVarV' + 'alue']('A:CAMERA VIEW TYPE AND INDEX:1', 'Number', 0x4); - }, 0x1f4) - : setTimeout(() => { - SimVar['SetSi' + 'mVarV' + 'alue']('A:CAMERA VIEW TYPE AND INDEX:1', 'Number', 0x1); - }, 0x1f4), - SimVar['SetSi' + 'mVarV' + 'alue']('L:FSS_B727_EFB_SEATING_POSITION', 'Bool', _0x183760); - } - static ['impor' + 'tFlig' + 'htPla' + 'n'](_0xc32463) { - const _0x382d2b = - 'https' + - '://ww' + - 'w.sim' + - 'brief' + - '.com/' + - 'api/x' + - 'ml.fe' + - 'tcher' + - '.php?' + - 'usern' + - 'ame=' + - _0xc32463; - return fetch(_0x382d2b) - ['then']((_0x2cc7e3) => { - return _0x2cc7e3['text'](); - }) - ['then']((_0x26b60a) => { - const _0x58169d = new DOMParser(), - _0x7997e1 = _0x58169d['parse' + 'FromS' + 'tring'](_0x26b60a, 'text/xml'); - let _0x21dfa5 = {}; - const _0x300c26 = _0x7997e1['query' + 'Selec' + 'tor']('fetch > status'); - _0x300c26 && (_0x21dfa5['statu' + 's'] = _0x300c26['inner' + 'HTML']); - const _0x202d4b = _0x7997e1['query' + 'Selec' + 'tor']('params > units'); - _0x202d4b && (_0x21dfa5['units'] = _0x202d4b['inner' + 'HTML']); - const _0x2b5b6f = _0x7997e1['query' + 'Selec' + 'tor']('origin > icao_code'); - _0x2b5b6f && (_0x21dfa5['origi' + 'n'] = _0x2b5b6f['inner' + 'HTML']); - const _0x37322c = _0x7997e1['query' + 'Selec' + 'tor']('destination > icao_code'); - _0x37322c && (_0x21dfa5['desti' + 'natio' + 'n'] = _0x37322c['inner' + 'HTML']); - const _0x4f66aa = _0x7997e1['query' + 'Selec' + 'tor']('aircraft > icaocode'); - _0x4f66aa && (_0x21dfa5['aircr' + 'aft'] = _0x4f66aa['inner' + 'HTML']); - const _0x3e15f6 = _0x7997e1['query' + 'Selec' + 'tor']('fuel > plan_ramp'); - _0x3e15f6 && (_0x21dfa5['fuel'] = parseFloat(_0x3e15f6['inner' + 'HTML'])); - const _0x53c20f = _0x7997e1['query' + 'Selec' + 'tor']('weights > payload'); - - /* KHOFMANN START */ - // This is only to allow the new gauges to auto fetch the plan - SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 1); - /* KHOFMANN END */ - - return _0x53c20f && (_0x21dfa5['paylo' + 'ad'] = parseFloat(_0x53c20f['inner' + 'HTML'])), _0x21dfa5; - }); - } - static ['meter' + 'ToFee' + 't'](_0x945b59) { - return _0x945b59 * 3.28084; - } - static ['feetT' + 'oMete' + 'r'](_0x433b0d) { - return _0x433b0d * 0.3048; - } - static ['feetT' + 'oNaut' + 'icalM' + 'ile'](_0x51576c) { - return _0x51576c * 0.000164579; - } - static ['lbsTo' + 'Kg'](_0x2d9367) { - return _0x2d9367 * 0.453592; - } - static ['gtn75' + '0Inst' + 'alled']() { - return !!SimVar['GetSi' + 'mVarV' + 'alueF' + 'ast']('L:PMS50_GTN750_INSTALLED', 'Bool'); - } - static ['gtnxi' + 'Insta' + 'lled']() { - return !!SimVar['GetSi' + 'mVarV' + 'alueF' + 'ast']('L:TDSGTNXI_INSTALLED', 'Bool'); - } - static ['diffA' + 'ndSet' + 'Value'](_0x2e7fbe, _0xaeb6de) { - _0x2e7fbe['value'] != _0xaeb6de && (_0x2e7fbe['value'] = _0xaeb6de); - } - static ['diffA' + 'ndAdd' + 'Attri' + 'bute'](_0x2a092d, _0x29db47, _0x56d461) { - const _0x47c464 = !!_0x2a092d['getAt' + 'tribu' + 'te'](_0x29db47); - _0x56d461 - ? !_0x47c464 && _0x2a092d['setAt' + 'tribu' + 'te'](_0x29db47, !![]) - : _0x47c464 && _0x2a092d['remov' + 'eAttr' + 'ibute'](_0x29db47); - } - static ['genSh' + 'uffle' + 'dArra' + 'y'](_0x493b5a) { - return Array['from'](Array(_0x493b5a)['keys']())['sort'](() => Math['rando' + 'm']() - 0.5); - } - static ['setIn' + 'putOn' + 'Chang' + 'e'](_0x344d78, _0x4988f3) { - (_0x344d78['onkey' + 'press'] = (_0xb39586) => { - const _0x252e2b = _0xb39586['which']; - _0x252e2b === 0xd && _0xb39586['srcEl' + 'ement']['blur'](); - }), - (_0x344d78['onblu' + 'r'] = (_0x27045f) => { - _0x4988f3(_0x27045f['srcEl' + 'ement']); - }); - } - static ['setWi' + 'ndInp' + 'ut'](_0x1d7d59, _0x3174de) { - EFBUtils['setIn' + 'putOn' + 'Chang' + 'e'](_0x1d7d59, (_0x2632cd) => { - let _0xe0907b = 0x0, - _0x46f45b = 0x0; - if (_0x2632cd['value']) { - const _0xc0d1bd = _0x2632cd['value']['split']('/'); - if (_0xc0d1bd['lengt' + 'h'] > 0x1) - (_0xe0907b = parseInt(_0xc0d1bd[0x0])), - (_0x46f45b = parseInt(_0xc0d1bd[0x1])), - isNaN(_0xe0907b) && (_0xe0907b = 0x0), - isNaN(_0x46f45b) && (_0x46f45b = 0x0); - else - _0xc0d1bd['lengt' + 'h'] > 0x0 && - ((_0xe0907b = parseInt(_0xc0d1bd[0x0])), isNaN(_0xe0907b) && (_0xe0907b = 0x0)); - } - (_0xe0907b = Math['max'](Math['min'](_0xe0907b, 0x168), 0x0)), - (_0x46f45b = Math['max'](Math['min'](_0x46f45b, 0x63), 0x0)), - (_0x2632cd['value'] = - _0xe0907b['toStr' + 'ing']()['padSt' + 'art'](0x3, '0') + - '/' + - _0x46f45b['toStr' + 'ing']()['padSt' + 'art'](0x2, '0')), - _0x3174de({ dir: _0xe0907b, speed: _0x46f45b }); - }); - } - static ['setQN' + 'HInpu' + 't'](_0x303325, _0x509c84) { - EFBUtils['setIn' + 'putOn' + 'Chang' + 'e'](_0x303325, (_0xc37bc3) => { - let _0x338a95 = 0x0; - _0xc37bc3['value'] && ((_0x338a95 = parseFloat(_0xc37bc3['value'])), isNaN(_0x338a95) && (_0x338a95 = 0x0)), - (_0xc37bc3['value'] = _0x338a95['toFix' + 'ed'](0x2)), - _0x509c84(_0x338a95); - }); - } - static ['setTe' + 'mpInp' + 'ut'](_0x3f84c5, _0x5692e2) { - EFBUtils['setIn' + 'putOn' + 'Chang' + 'e'](_0x3f84c5, (_0x506059) => { - let _0x40003b = 0x0; - _0x506059['value'] && ((_0x40003b = parseInt(_0x506059['value'])), isNaN(_0x40003b) && (_0x40003b = 0x0)), - (_0x506059['value'] = _0x40003b), - _0x5692e2({ tempF: _0x40003b, tempC: EFBUtils['fahre' + 'nheit' + 'ToCel' + 'cius'](_0x40003b) }); - }); - } - static ['fahre' + 'nheit' + 'ToCel' + 'cius'](_0x5a890b) { - return (_0x5a890b - 0x20) * (0x5 / 0x9); - } - static ['isOSR']() { - const _0x4e6689 = SimVar['GetSi' + 'mVarV' + 'alue']('A:TITLE', 'String'); - return _0x4e6689['toLow' + 'erCas' + 'e']()['inclu' + 'des']('oil spill response'); - } -} diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf deleted file mode 100644 index bb988e8..0000000 Binary files a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/fonts/Consolas.ttf and /dev/null differ diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png deleted file mode 100644 index 600e82a..0000000 Binary files a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png and /dev/null differ diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png deleted file mode 100644 index 5784ffa..0000000 Binary files a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png and /dev/null differ diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css deleted file mode 100644 index ef664e2..0000000 --- a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.css +++ /dev/null @@ -1 +0,0 @@ -#KH_CTRL{align-items:center;display:flex;height:80px;justify-content:space-around}#KH_CTRL .button{border:1px solid #000;border-radius:5px;padding-left:7px;padding-right:7px}#KH_CTRL .button .icon{margin-top:6px;width:30px}#KH_CTRL .button:hover:not([disabled]){background-color:var(--buttonHoverColor)}#KH_CTRL .button.d180{transform:rotate(180deg)}#KH_CTRL .button.d90{transform:rotate(90deg)}@font-face{font-family:Consolas;font-style:normal;font-weight:100;src:url(assets/fonts/Consolas.ttf) format("truetype")}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:#d3d3d3}::-webkit-scrollbar-thumb{background:gray;height:200px}::-webkit-scrollbar-thumb:hover{background:#a9a9a9}#root{--buttonHoverColor:#d3d3d3;--fss-select-hover:#d3d3d3;background-image:url(../EFB/Images/bg.png);background-size:100% 100%;color:#000;font-size:25px;height:100%;padding:3vw;width:594px}#root #KH_FE_FPLAN{height:calc(100vh - 6vw - 180px);margin-bottom:3vw;margin-top:100px;overflow-x:hidden;overflow-y:scroll;width:100%}#root #KH_FE_FPLAN #OFP div,#root #KH_FE_FPLAN #TLR div{font-size:unset!important;line-height:unset!important}#root #KH_FE_FPLAN #OFP pre,#root #KH_FE_FPLAN #TLR pre{font-family:Consolas!important;font-size:13px;line-height:14px;white-space:pre}#root #KH_FE_FPLAN #OFP img{width:100%}#root #KH_FE_FPLAN.p2{height:calc(100vh - 6vw - 240px);margin-top:160px} \ No newline at end of file diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html deleted file mode 100644 index 58665b4..0000000 --- a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js b/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js deleted file mode 100644 index 083f91c..0000000 --- a/2024/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/index.js +++ /dev/null @@ -1 +0,0 @@ -class t{constructor(t,e,i){this.handler=t,this.initialNotifyFunc=e,this.onDestroy=i,this.isAlive=!0,this.isPaused=!1,this.canInitialNotify=void 0!==e}initialNotify(){if(!this.isAlive)throw new Error("HandlerSubscription: cannot notify a dead Subscription.");this.initialNotifyFunc&&this.initialNotifyFunc(this)}pause(){if(!this.isAlive)throw new Error("Subscription: cannot pause a dead Subscription.");return this.isPaused=!0,this}resume(t=!1){if(!this.isAlive)throw new Error("Subscription: cannot resume a dead Subscription.");return this.isPaused?(this.isPaused=!1,t&&this.initialNotify(),this):this}destroy(){this.isAlive&&(this.isAlive=!1,this.isPaused=!0,this.onDestroy&&this.onDestroy(this))}}class e{constructor(t,e={},i){this.subscribe=t,this.state=e,this.currentHandler=i,this.isConsumer=!0}handle(t,e=!1){let s;return s=void 0!==this.currentHandler?e=>{this.currentHandler(e,this.state,t)}:t,new i(this.subscribe(s,e))}atFrequency(t,i=!0){const s={previousTime:Date.now(),firstRun:i};return new e(this.subscribe,s,this.getAtFrequencyHandler(t))}getAtFrequencyHandler(t){const e=1e3/t;return(t,i,s)=>{const r=Date.now(),n=r-i.previousTime;if(e<=n||i.firstRun){for(;i.previousTime+e{const r=e,n=Math.pow(10,t),a=Math.round(r*n)/n;i.hasLastValue&&a===i.lastValue||(i.hasLastValue=!0,i.lastValue=a,this.with(a,s))}}whenChangedBy(t){return new e(this.subscribe,{lastValue:0,hasLastValue:!1},this.getWhenChangedByHandler(t))}getWhenChangedByHandler(t){return(e,i,s)=>{const r=e,n=Math.abs(r-i.lastValue);(!i.hasLastValue||n>=t)&&(i.hasLastValue=!0,i.lastValue=r,this.with(e,s))}}whenChanged(){return new e(this.subscribe,{lastValue:"",hasLastValue:!1},this.getWhenChangedHandler())}getWhenChangedHandler(){return(t,e,i)=>{e.hasLastValue&&e.lastValue===t||(e.hasLastValue=!0,e.lastValue=t,this.with(t,i))}}onlyAfter(t){return new e(this.subscribe,{previousTime:Date.now()},this.getOnlyAfterHandler(t))}getOnlyAfterHandler(t){return(e,i,s)=>{Date.now()-i.previousTime>t&&(i.previousTime+=t,this.with(e,s))}}with(t,e){void 0!==this.currentHandler?this.currentHandler(t,this.state,e):e(t)}}class i{get isAlive(){return this.sub.isAlive}get isPaused(){return this.sub.isPaused}get canInitialNotify(){return this.sub.canInitialNotify}constructor(t){this.sub=t}pause(){return this.sub.pause(),this}resume(t=!1){return this.sub.resume(t),this}destroy(){this.sub.destroy()}}class s{constructor(t){this.bus=t}on(t){return new e(((e,i)=>this.bus.on(t,e,i)))}}class r{constructor(t=!1,e=!0){this._topicSubsMap=new Map,this._wildcardSubs=new Array,this._wildcardNotifyDepth=0,this._eventCache=new Map,this.onWildcardSubDestroyedFunc=this.onWildcardSubDestroyed.bind(this),this._busId=Math.floor(2147483647*Math.random());const i="undefined"==typeof RegisterGenericDataListener?o:c;this._busSync=new i(this.pub.bind(this),this._busId),!0===e&&(this.syncEvent("event_bus","resync_request",!1),this.on("event_bus",(t=>{"resync_request"==t&&this.resyncEvents()})))}on(e,i,s=!1){let r=this._topicSubsMap.get(e);void 0===r&&(r={handlerSubscriptions:[],notifyDepth:0},this._topicSubsMap.set(e,r),this.pub("event_bus_topic_first_sub",e,!1,!1));const n=new t(i,(t=>{const i=this._eventCache.get(e);void 0!==i&&t.handler(i.data)}),(t=>{r&&!r.notifyDepth&&r.handlerSubscriptions.splice(r.handlerSubscriptions.indexOf(t),1)}));return r.handlerSubscriptions.push(n),s?n.pause():n.initialNotify(),n}onAll(e){const i=new t(e,void 0,this.onWildcardSubDestroyedFunc);return this._wildcardSubs.push(i),i}pub(t,e,i=!1,s=!0){s&&this._eventCache.set(t,{data:e,synced:i});const r=this._topicSubsMap.get(t);if(void 0!==r){let n=!1;const a=r.notifyDepth;r.notifyDepth=a+1;const o=r.handlerSubscriptions,c=o.length;for(let a=0;at.isAlive));r.handlerSubscriptions=t}}i&&this.syncEvent(t,e,s);let n=!1;this._wildcardNotifyDepth++;const a=this._wildcardSubs.length;for(let i=0;it.isAlive)))}onWildcardSubDestroyed(t){0===this._wildcardNotifyDepth&&this._wildcardSubs.splice(this._wildcardSubs.indexOf(t),1)}resyncEvents(){for(const[t,e]of this._eventCache)e.synced&&this.syncEvent(t,e.data,!0)}syncEvent(t,e,i){this._busSync.sendEvent(t,e,i)}getPublisher(){return this}getSubscriber(){return new s(this)}getTopicSubscriberCount(t){var e,i;return null!==(i=null===(e=this._topicSubsMap.get(t))||void 0===e?void 0:e.handlerSubscriptions.length)&&void 0!==i?i:0}forEachSubscribedTopic(t){this._topicSubsMap.forEach(((e,i)=>{e.handlerSubscriptions.length>0&&t(i,e.handlerSubscriptions.length)}))}}class n{constructor(t,e){this.isPaused=!1,this.lastEventSynced=-1,this.dataPackageQueue=[],this.recvEventCb=t,this.busId=e,this.hookReceiveEvent();const i=()=>{if(!this.isPaused&&this.dataPackageQueue.length>0){const t={busId:this.busId,packagedId:Math.floor(1e9*Math.random()),data:this.dataPackageQueue};this.executeSync(t)?this.dataPackageQueue.length=0:console.warn("Failed to send sync data package")}requestAnimationFrame(i)};requestAnimationFrame(i)}processEventsReceived(t){this.busId!==t.busId&&this.lastEventSynced!==t.packagedId&&(this.lastEventSynced=t.packagedId,t.data.forEach((t=>{try{this.recvEventCb(t.topic,void 0!==t.data?t.data:void 0,!1,t.isCached)}catch(t){console.error(t),t instanceof Error&&console.error(t.stack)}})))}sendEvent(t,e,i){const s={topic:t,data:e,isCached:i};this.dataPackageQueue.push(s)}}class a extends n{executeSync(t){try{return this.listener.triggerToAllSubscribers(a.EB_KEY,JSON.stringify(t)),!0}catch(t){return!1}}hookReceiveEvent(){this.listener=RegisterViewListener(a.EB_LISTENER_KEY,void 0,!0),this.listener.on(a.EB_KEY,(t=>{try{const e=JSON.parse(t);this.processEventsReceived(e)}catch(t){console.error(t)}}))}}a.EB_KEY="eb.evt",a.EB_LISTENER_KEY="JS_LISTENER_SIMVARS";class o extends n{executeSync(t){try{return LaunchFlowEvent("ON_MOUSERECT_HTMLEVENT",o.EB_LISTENER_KEY,this.busId.toString(),JSON.stringify(t)),!0}catch(t){return!1}}hookReceiveEvent(){Coherent.on("OnInteractionEvent",((t,e)=>{0!==e.length&&e[0]===o.EB_LISTENER_KEY&&e[2]&&this.processEventsReceived(JSON.parse(e[2]))}))}}o.EB_LISTENER_KEY="EB_EVENTS";class c extends n{executeSync(t){try{return this.listener.send(c.EB_KEY,t),!0}catch(t){return!1}}hookReceiveEvent(){this.isPaused=!0,this.listener=RegisterGenericDataListener((()=>{this.listener.onDataReceived(c.EB_KEY,(t=>{try{this.processEventsReceived(t)}catch(t){console.error(t)}})),this.isPaused=!1}))}}c.EB_KEY="wt.eb.evt",c.EB_LISTENER_KEY="JS_LISTENER_GENERICDATA";class h{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e){this.canInitialNotify=!0,this.consumerHandler=this.onEventConsumed.bind(this),this.needSetDefaultValue=!1,this._isAlive=!0,this._isPaused=!1,this.value=e,this.sub=null==t?void 0:t.handle(this.consumerHandler)}onEventConsumed(t){this.needSetDefaultValue&&(this.needSetDefaultValue=!1,delete this.defaultValue),this.value=t}get(){return this.value}setConsumer(t){var e;return this._isAlive?(this.needSetDefaultValue=!1,delete this.defaultValue,null===(e=this.sub)||void 0===e||e.destroy(),this.sub=null==t?void 0:t.handle(this.consumerHandler,this._isPaused),this):this}setConsumerWithDefault(t,e){var i;return this._isAlive?(this.defaultValue=e,this.needSetDefaultValue=!0,null===(i=this.sub)||void 0===i||i.destroy(),this.sub=null==t?void 0:t.handle(this.consumerHandler,this._isPaused),!this._isPaused&&this.needSetDefaultValue&&(this.value=this.defaultValue,this.needSetDefaultValue=!1,delete this.defaultValue),this):this}reset(t,e=null){return this._isAlive?(this.value=t,this.setConsumer(e)):this}pause(){var t;return this._isPaused||(null===(t=this.sub)||void 0===t||t.pause(),this._isPaused=!0),this}resume(){var t;return this._isPaused?(this._isPaused=!1,null===(t=this.sub)||void 0===t||t.resume(!0),this.needSetDefaultValue&&(this.value=this.defaultValue,this.needSetDefaultValue=!1,delete this.defaultValue),this):this}destroy(){var t;this._isAlive=!1,null===(t=this.sub)||void 0===t||t.destroy()}static create(t,e){return new h(t,e)}}var l;!function(t){t.Amps="Amperes",t.Bool="bool",t.Celsius="celsius",t.CubicInches="cubic inches",t.Degree="degrees",t.DegreesPerSecond="degrees per second",t.Enum="enum",t.Farenheit="farenheit",t.Feet="feet",t.FPM="feet per minute",t.FtLb="Foot pounds",t.GAL="gallons",t.GPH="gph",t.Hertz="hertz",t.Hours="Hours",t.HPA="hectopascals",t.Inches="inches",t.InHG="inches of mercury",t.KHz="KHz",t.Knots="knots",t.LBS="pounds",t.Liters="liters",t.LLA="latlonalt",t.Mach="mach",t.MB="Millibars",t.Meters="meters",t.MetersPerSecond="meters per second",t.MetersPerSecondSquared="meters per second squared",t.MillimetersWater="millimeters of water",t.MHz="MHz",t.NM="nautical mile",t.Number="number",t.Percent="percent",t.PercentOver100="percent over 100",t.PerSecond="per second",t.Position="position",t.Position16k="position 16k",t.Position32k="position 32k",t.Pounds="pounds",t.PPH="Pounds per hour",t.PSI="psi",t.Radians="radians",t.RadiansPerSecond="radians per second",t.Rankine="rankine",t.RPM="Rpm",t.Seconds="seconds",t.SlugsPerCubicFoot="slug per cubic foot",t.String="string",t.Volts="Volts"}(l||(l={}));const u=new RegExp(/latlonalt/i),d=new RegExp(/latlonaltpbh/i),p=new RegExp(/pbh/i),g=new RegExp(/pid_struct/i),f=new RegExp(/xyz/i),m=new RegExp(/string/i),A=new RegExp(/boolean|bool/i),y=new RegExp(/number/i),S="";var v,b,T,R,_,C,E,P,I,N,F,w,D,M,L,O,V,U,G,x,k,H,B,W,$,j,Y,z,q,X,K,Q,Z,J,tt,et,it,st,rt,nt,at,ot,ct,ht,lt,ut,dt,pt,gt,ft,mt,At,yt,St,vt,bt,Tt,Rt,_t,Ct,Et,Pt,It,Nt,Ft,wt,Dt,Mt,Lt,Ot,Vt,Ut,Gt,xt,kt,Ht,Bt,Wt,$t,jt,Yt,zt,qt,Xt,Kt,Qt,Zt,Jt,te,ee,ie,se,re,ne,ae,oe,ce,he,le,ue,de,pe,ge,fe,me,Ae,ye,Se,ve,be,Te,Re,_e,Ce,Ee,Pe,Ie,Ne,Fe,we,De,Me,Le,Oe,Ve,Ue,Ge,xe,ke,He,Be,We,$e,je,Ye,ze,qe,Xe,Ke,Qe,Ze;function Je(t,e=!1){return y.test(t)?v.Number:m.test(t)?v.String:u.test(t)?v.LatLongAlt:d.test(t)?v.LatLongAltPbh:p.test(t)?v.PitchBankHeading:g.test(t)?v.PidStruct:f.test(t)?v.XYZ:A.test(t)&&e?v.Boolean:v.Number}function ti(t){try{if(t.registeredID>=0)switch(t.structType){case v.Number:return simvar.getValueReg(t.registeredID);case v.String:return simvar.getValueReg_String(t.registeredID);case v.LatLongAlt:return new LatLongAlt(simvar.getValue_LatLongAlt(t.name,S));case v.LatLongAltPbh:return new LatLongAltPBH(simvar.getValue_LatLongAltPBH(t.name,S));case v.PitchBankHeading:return new PitchBankHeading(simvar.getValue_PBH(t.name,S));case v.PidStruct:return new PID_STRUCT(simvar.getValue_PID_STRUCT(t.name,S));case v.XYZ:return new XYZ(simvar.getValue_XYZ(t.name,S));case v.Boolean:return!!simvar.getValueReg(t.registeredID);default:return null}}catch(e){console.warn("ERROR ",e," GetSimVarValue "+t.name+" structType : "+t.structType)}return null}!function(t){t[t.Number=0]="Number",t[t.String=1]="String",t[t.LatLongAlt=2]="LatLongAlt",t[t.LatLongAltPbh=3]="LatLongAltPbh",t[t.PitchBankHeading=4]="PitchBankHeading",t[t.PidStruct=5]="PidStruct",t[t.XYZ=6]="XYZ",t[t.Boolean=7]="Boolean"}(v||(v={})),SimVar.GetSimVarValue=(t,e,i="")=>{try{if(simvar){let s;const r=SimVar.GetRegisteredId(t,e,i);return r>=0&&(s=y.test(e)?simvar.getValueReg(r):m.test(e)?simvar.getValueReg_String(r):u.test(e)?new LatLongAlt(simvar.getValue_LatLongAlt(t,i)):d.test(e)?new LatLongAltPBH(simvar.getValue_LatLongAltPBH(t,i)):p.test(e)?new PitchBankHeading(simvar.getValue_PBH(t,i)):g.test(e)?new PID_STRUCT(simvar.getValue_PID_STRUCT(t,i)):f.test(e)?new XYZ(simvar.getValue_XYZ(t,i)):simvar.getValueReg(r)),s}console.warn("SimVar handler is not defined ("+t+")")}catch(i){return console.warn("ERROR ",i," GetSimVarValue "+t+" unit : "+e),null}return null},SimVar.SetSimVarValue=(t,e,i,s="")=>{if(null==i)return console.warn(t+" : Trying to set a null value"),Promise.resolve();try{if(simvar){const r=SimVar.GetRegisteredId(t,e,s);if(r>=0)return m.test(e)?Coherent.call("setValueReg_String",r,i):A.test(e)?Coherent.call("setValueReg_Bool",r,!!i):y.test(e)?Coherent.call("setValueReg_Number",r,i):u.test(e)?Coherent.call("setValue_LatLongAlt",t,i,s):d.test(e)?Coherent.call("setValue_LatLongAltPBH",t,i,s):p.test(e)?Coherent.call("setValue_PBH",t,i,s):g.test(e)?Coherent.call("setValue_PID_STRUCT",t,i,s):f.test(e)?Coherent.call("setValue_XYZ",t,i,s):Coherent.call("setValueReg_Number",r,i)}else console.warn("SimVar handler is not defined")}catch(t){console.warn("error SetSimVarValue "+t)}return Promise.resolve()},SimVar.GetSimVarValue,SimVar.SetSimVarValue;class ei{constructor(t,e=void 0){this.bus=t,this.publisher=this.bus.getPublisher(),this.publishActive=!1,this.pacer=e}startPublish(){this.publishActive=!0}stopPublish(){this.publishActive=!1}isPublishing(){return this.publishActive}onUpdate(){}publish(t,e,i=!1,s=!0){!this.publishActive||this.pacer&&!this.pacer.canPublish(t,e)||this.publisher.pub(t,e,i,s)}}class ii extends ei{constructor(t,e,i){super(e,i),this.resolvedSimVars=new Map,this.indexedSimVars=new Map,this.subscribed=new Map;for(const[e,i]of t)i.indexed?this.indexedSimVars.set(e,{name:i.name,type:i.type,map:i.map,indexes:!0===i.indexed?void 0:new Set(i.indexed),defaultIndex:i.defaultIndex}):this.resolvedSimVars.set(e,Object.assign({},i));const s=this.handleSubscribedTopic.bind(this);this.bus.forEachSubscribedTopic(s),this.bus.getSubscriber().on("event_bus_topic_first_sub").handle(s)}handleSubscribedTopic(t){this.resolvedSimVars.has(t)?this.onTopicSubscribed(t):this.tryMatchIndexedSubscribedTopic(t)}tryMatchIndexedSubscribedTopic(t){var e;if(0===this.indexedSimVars.size)return;let i=this.indexedSimVars.get(t);if(i){if(null!==i.defaultIndex){const s=this.resolveIndexedSimVar(t,i,null!==(e=i.defaultIndex)&&void 0!==e?e:1);void 0!==s&&this.onTopicSubscribed(s)}return}if(!ii.INDEXED_REGEX.test(t))return;const s=t.match(ii.INDEXED_REGEX),[,r,n]=s;if(i=this.indexedSimVars.get(r),i){const t=this.resolveIndexedSimVar(r,i,parseInt(n));void 0!==t&&this.onTopicSubscribed(t)}}resolveIndexedSimVar(t,e,i){null!=i||(i=1);const s=`${t}_${i}`;if(this.resolvedSimVars.has(s))return s;const r=void 0===e.defaultIndex?1:e.defaultIndex;return void 0===e.indexes||e.indexes.has(i)?(this.resolvedSimVars.set(s,{name:e.name.replace("#index#",`${null!=i?i:1}`),type:e.type,map:e.map,unsuffixedTopic:r===i?t:void 0}),s):void 0}onTopicSubscribed(t){if(this.subscribed.has(t))return;const e=this.resolvedSimVars.get(t);e.registeredDef=function(t,e=!1){return{name:t.name,registeredID:SimVar.GetRegisteredId(t.name,t.type,S),structType:Je(t.type,e)}}(e,!0),this.subscribed.set(t,e),this.publishActive&&this.publishTopic(t,e)}onUpdate(){for(const t of this.subscribed)this.publishTopic(t[0],t[1])}publishTopic(t,e){if(e){const i=this.getValueFromEntry(e);this.publish(t,i),e.unsuffixedTopic&&this.publish(e.unsuffixedTopic,i)}}getValue(t){const e=this.resolvedSimVars.get(t);if(void 0!==e)return this.getValueFromEntry(e)}getValueFromEntry(t){return void 0===t.map?ti(t.registeredDef):t.map(ti(t.registeredDef))}}ii.INDEXED_REGEX=/(.*)_(0|[1-9]\d*)$/;class si extends t{constructor(t,e,i,s){let r,n;"function"==typeof s?(r=t=>{e.set(i(t,e.get()))},n=s):(r=t=>{e.set(t)},n=i),super(r,(e=>{e.handler(t.get())}),n)}}class ri{constructor(){this.isSubscribable=!0,this.notifyDepth=0,this.initialNotifyFunc=this.notifySubscription.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}sub(e,i=!1,s=!1){const r=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(r),s?r.pause():i&&r.initialNotify(),r}notify(){const t=0===this.notifyDepth;let e=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isPaused||this.notifySubscription(this.singletonSub)}catch(t){console.error(`AbstractSubscribable: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(t)if(this.singletonSub)e=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}notifySubscription(t){t.handler(this.get())}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}map(t,e,i,s){return new ni(this,t,null!=e?e:ri.DEFAULT_EQUALITY_FUNC,i,s)}pipe(t,e,i){let s,r;return"function"==typeof e?(s=new si(this,t,e,this.onSubDestroyedFunc),r=null!=i&&i):(s=new si(this,t,this.onSubDestroyedFunc),r=null!=e&&e),this.addSubscription(s),r?s.pause():s.initialNotify(),s}}ri.DEFAULT_EQUALITY_FUNC=(t,e)=>t===e;class ni extends ri{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,i,s,r){super(),this.input=t,this.mapFunc=e,this.equalityFunc=i,this.canInitialNotify=!0,this._isAlive=!0,this._isPaused=!1,r&&s?(this.value=r,s(this.value,this.mapFunc(this.input.get())),this.mutateFunc=t=>{s(this.value,t)}):(this.value=this.mapFunc(this.input.get()),this.mutateFunc=t=>{this.value=t}),this.inputSub=this.input.sub((t=>{this.updateValue(t)}),!0)}updateValue(t){const e=this.mapFunc(t,this.value);this.equalityFunc(this.value,e)||(this.mutateFunc(e),this.notify())}get(){return this.value}pause(){if(!this._isAlive)throw new Error("MappedSubscribable: cannot pause a dead subscribable");return this._isPaused||(this.inputSub.pause(),this._isPaused=!0),this}resume(){if(!this._isAlive)throw new Error("MappedSubscribable: cannot resume a dead subscribable");return this._isPaused?(this._isPaused=!1,this.inputSub.resume(!0),this):this}destroy(){this._isAlive=!1,this.inputSub.destroy()}}!function(t){t[t.Any=0]="Any",t[t.Number=1]="Number",t[t.String=2]="String"}(b||(b={})),function(t){t.set=function(t,e){SetStoredData(t,JSON.stringify(e))},t.get=function(t){try{const e=GetStoredData(t);return JSON.parse(e)}catch(t){return}},t.remove=function(t){DeleteStoredData(t)}}(T||(T={}));class ai extends ri{constructor(t,e,i){super(),this.value=t,this.equalityFunc=e,this.mutateFunc=i,this.isMutableSubscribable=!0}static create(t,e,i){return new ai(t,null!=e?e:ai.DEFAULT_EQUALITY_FUNC,i)}notifySub(t){t(this.value)}set(t){this.equalityFunc(t,this.value)||(this.mutateFunc?this.mutateFunc(this.value,t):this.value=t,this.notify())}apply(t){if("object"!=typeof this.value||null===this.value)return;let e=!1;for(const i in t)if(e=t[i]!==this.value[i],e)break;Object.assign(this.value,t),e&&this.notify()}notify(){super.notify()}get(){return this.value}}class oi{constructor(){this.gameState=ai.create(void 0),window.document.addEventListener("OnVCockpitPanelAttributesChanged",this.onAttributesChanged.bind(this)),this.onAttributesChanged()}onAttributesChanged(){var t;if(null===(t=window.parent)||void 0===t?void 0:t.document.body.hasAttribute("gamestate")){const t=window.parent.document.body.getAttribute("gamestate");if(null!==t){const e=GameState[t];return void(e===GameState.ingame&&this.gameState.get()!==GameState.ingame?setTimeout((()=>{setTimeout((()=>{const t=window.parent.document.body.getAttribute("gamestate");null!==t&&this.gameState.set(GameState[t])}))})):this.gameState.set(e))}}this.gameState.set(void 0)}static get(){var t;return(null!==(t=oi.INSTANCE)&&void 0!==t?t:oi.INSTANCE=new oi).gameState}}class ci{static pressureAir(t,e){return e*ci.R_AIR*(t+273.15)/100}static densityAir(t,e){return 100*t/(ci.R_AIR*(e+273.15))}static temperatureAir(t,e){return 100*t/(ci.R_AIR*e)-273.15}static soundSpeedAir(t){return Math.sqrt(401.8798068394*(t+273.15))}static totalPressureRatioAir(t){return Math.pow(1+.2*t*t,3.5)}static totalTemperatureRatioAir(t,e=1){return 1+.2*e*t*t}static isaTemperature(t){return t<11e3?15+-.0065*Math.max(t,-610):t<2e4?-56.5:t<32e3?.001*(t-2e4)-56.5:t<47e3?.0028*(t-32e3)-44.5:t<51e3?-2.5:t<71e3?-.0028*(t-51e3)-2.5:-.002*(Math.min(t,8e4)-71e3)-58.5}static isaPressure(t){return t<-610?1088.707021458965:t<=11e3?1013.25*Math.pow(1-225577e-10*t,5.2558):t<=2e4?226.32547681422847*Math.exp(-157686e-9*(t-11e3)):t<=32e3?54.7512459834976*Math.pow(1+461574e-11*(t-2e4),-34.1627):t<=47e3?8.68079131804552*Math.pow(1+122458e-10*(t-32e3),-12.201):t<=51e3?1.1091650294132658*Math.exp(-126225e-9*(t-47e3)):t<=71e3?.6694542213945832*Math.pow(1-103455e-10*(t-51e3),12.201):t<=8e4?.03956893750841349*Math.pow(1-931749e-11*(t-71e3),17.0814):.008864013902895545}static isaAltitude(t){return t>1088.707021458965?-610:t>226.32547681422847?-44330.76067152236*(Math.pow(t/1013.25,.1902659918566155)-1):t>54.7512459834976?-6341.717083317479*Math.log(t/226.32547681422847)+11e3:t>8.68079131804552?216649.9846178511*(Math.pow(t/54.7512459834976,-.02927169105486393)-1)+2e4:t>1.1091650294132658?81660.6509987098*(Math.pow(t/8.68079131804552,-.08196049504139005)-1)+32e3:t>.6694542213945832?-7922.360863537334*Math.log(t/1.1091650294132658)+47e3:t>.03956893750841349?-96660.38374172345*(Math.pow(t/.6694542213945832,.08196049504139005)-1)+51e3:t>.008864013902895545?-107325.0414006347*(Math.pow(t/.03956893750841349,.05854321074385004)-1)+71e3:8e4}static isaDensity(t,e=0){return ci.densityAir(ci.isaPressure(t),ci.isaTemperature(t)+e)}static soundSpeedIsa(t,e=0){return this.soundSpeedAir(ci.isaTemperature(t)+e)}static baroPressureAltitudeOffset(t){return 44330.76067152236*(Math.pow(t/1013.25,.1902659918566155)-1)}static altitudeOffsetBaroPressure(t){return 1013.25*Math.pow(1+225577e-10*t,5.2558)}static tasToMach(t,e){return t/e}static tasToMachIsa(t,e,i=0){return t/ci.soundSpeedIsa(e,i)}static machToTas(t,e){return t*e}static machToTasIsa(t,e,i=0){return t*ci.soundSpeedIsa(e,i)}static casToMach(t,e){const i=t/ci.SOUND_SPEED_SEA_LEVEL_ISA,s=1013.25*(Math.pow(1+.2*i*i,3.5)-1);return Math.sqrt(5*(Math.pow(s/e+1,2/7)-1))}static casToMachIsa(t,e){return ci.casToMach(t,ci.isaPressure(e))}static machToCas(t,e){const i=e*(Math.pow(1+.2*t*t,3.5)-1);return ci.SOUND_SPEED_SEA_LEVEL_ISA*Math.sqrt(5*(Math.pow(i/1013.25+1,2/7)-1))}static machToCasIsa(t,e){return ci.machToCas(t,ci.isaPressure(e))}static casToTas(t,e,i){return ci.casToMach(t,e)*ci.soundSpeedAir(i)}static casToTasIsa(t,e,i=0){return ci.casToMachIsa(t,e)*ci.soundSpeedIsa(e,i)}static tasToCas(t,e,i){return ci.machToCas(t/ci.soundSpeedAir(i),e)}static tasToCasIsa(t,e,i=0){return ci.machToCasIsa(t/ci.soundSpeedIsa(e,i),e)}static tasToEas(t,e){return t*Math.sqrt(e/ci.DENSITY_SEA_LEVEL_ISA)}static tasToEasIsa(t,e,i=0){return ci.tasToEas(t,ci.isaDensity(e,i))}static easToTas(t,e){return t*Math.sqrt(ci.DENSITY_SEA_LEVEL_ISA/e)}static easToTasIsa(t,e,i=0){return ci.easToTas(t,ci.isaDensity(e,i))}static machToEas(t,e){return ci.SOUND_SPEED_SEA_LEVEL_ISA*t*Math.sqrt(e/1013.25)}static machToEasIsa(t,e){return ci.machToEas(t,ci.isaPressure(e))}static easToMach(t,e){return t*Math.sqrt(1013.25/e)/ci.SOUND_SPEED_SEA_LEVEL_ISA}static easToMachIsa(t,e){return ci.easToMach(t,ci.isaPressure(e))}static casToEas(t,e){const i=t/ci.SOUND_SPEED_SEA_LEVEL_ISA,s=1013.25*(Math.pow(1+.2*i*i,3.5)-1);return ci.SOUND_SPEED_SEA_LEVEL_ISA*Math.sqrt(5*e/1013.25*(Math.pow(s/e+1,2/7)-1))}static casToEasIsa(t,e){return ci.casToEas(t,ci.isaPressure(e))}static easToCas(t,e){return ci.machToCas(ci.easToMach(t,e),e)}static easToCasIsa(t,e){return ci.easToCas(t,ci.isaPressure(e))}static flowCoefFromForce(t,e,i,s){return t/((void 0===s?100*i:.5*i*s*s)*e)}static flowForceFromCoef(t,e,i,s){return t*(void 0===s?100*i:.5*i*s*s)*e}static thrustCorrectionFactor(t,e){return 1/(e/1013.25*ci.totalPressureRatioAir(t))}}ci.R=8.314462618153,ci.R_AIR=287.057,ci.GAMMA_AIR=1.4,ci.SOUND_SPEED_SEA_LEVEL_ISA=340.2964,ci.DENSITY_SEA_LEVEL_ISA=ci.isaDensity(0),ci.liftCoefficient=ci.flowCoefFromForce,ci.lift=ci.flowForceFromCoef,ci.dragCoefficient=ci.flowCoefFromForce,ci.drag=ci.flowForceFromCoef;class hi{constructor(t,e){this._number=t,this._unit=e,this.readonly=new li(this)}get number(){return this._number}get unit(){return this._unit}toNumberOfThisUnit(t,e){return"number"!=typeof t&&this.unit.canConvert(t.unit)?this.unit.convertFrom(t.number,t.unit):"number"!=typeof t||e&&!this.unit.canConvert(e)?void 0:e?this.unit.convertFrom(t,e):t}set(t,e){const i=this.toNumberOfThisUnit(t,e);if(void 0!==i)return this._number=i,this;throw new Error("Invalid unit conversion attempted.")}add(t,e,i){const s=e instanceof hi,r=this.toNumberOfThisUnit(t,s?void 0:e);if(void 0!==r){let t=s?e:i;return t?t.set(this.number+r,this.unit):(t=this,this._number+=r),t}throw new Error("Invalid unit conversion attempted.")}subtract(t,e,i){const s=e instanceof hi,r=this.toNumberOfThisUnit(t,s?void 0:e);if(void 0!==r){let t=s?e:i;return t?t.set(this.number-r,this.unit):(t=this,this._number-=r),t}throw new Error("Invalid unit conversion attempted.")}scale(t,e){return e?e.set(this.number*t,this.unit):(this._number*=t,this)}ratio(t,e){const i=this.toNumberOfThisUnit(t,e);if(i)return this.number/i;throw new Error("Invalid unit conversion attempted.")}abs(t){return t?t.set(Math.abs(this.number),this.unit):(this._number=Math.abs(this._number),this)}asUnit(t){return this.unit.convertTo(this.number,t)}compare(t,e){const i=this.toNumberOfThisUnit(t,e);if(void 0===i)throw new Error("Invalid unit conversion attempted.");const s=this.number-i;return Math.abs(s)<1e-14?0:Math.sign(s)}equals(t,e){const i=this.toNumberOfThisUnit(t,e);if(void 0===i)return!1;if(isNaN(i)&&this.isNaN())return!0;const s=this.number-i;return!isNaN(s)&&Math.abs(s)<1e-14}isNaN(){return isNaN(this.number)}copy(){return new hi(this.number,this.unit)}}class li{constructor(t){this.source=t}get number(){return this.source.number}get unit(){return this.source.unit}add(t,e,i){const s=e instanceof hi?e:i;return"number"==typeof t?this.source.add(t,e,s):this.source.add(t,s)}subtract(t,e,i){const s=e instanceof hi?e:i;return"number"==typeof t?this.source.subtract(t,e,s):this.source.subtract(t,s)}scale(t,e){return this.source.scale(t,e)}ratio(t,e){return"number"==typeof t?this.source.ratio(t,e):this.source.ratio(t)}abs(t){return this.source.abs(t)}asUnit(t){return this.source.asUnit(t)}compare(t,e){return"number"==typeof t?this.source.compare(t,e):this.source.compare(t)}equals(t,e){return"number"==typeof t?this.source.equals(t,e):this.source.equals(t)}isNaN(){return this.source.isNaN()}copy(){return this.source.copy()}}class ui{constructor(t){this.name=t}canConvert(t){return this.family===t.family}createNumber(t){return new hi(t,this)}equals(t){return this.family===t.family&&this.name===t.name}}class di extends ui{constructor(t,e,i,s=0){super(e),this.family=t,this.scaleFactor=i,this.zeroOffset=s}canConvert(t){return t instanceof di&&super.canConvert(t)}convertTo(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${this.name} to ${e.name}.`);return(t+this.zeroOffset)*(this.scaleFactor/e.scaleFactor)-e.zeroOffset}convertFrom(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${e.name} to ${this.name}.`);return(t+e.zeroOffset)*(e.scaleFactor/this.scaleFactor)-this.zeroOffset}}class pi extends ui{constructor(t,e,i,s){if(void 0===s){s="";let t=0;for(;t0){for(s+=" per ",t=0;tt.family.localeCompare(e.family))),this.denominator.sort(((t,e)=>t.family.localeCompare(e.family))),this.scaleFactor=this.getScaleFactor()}getScaleFactor(){let t=1;return t=this.numerator.reduce(((t,e)=>t*e.scaleFactor),t),t=this.denominator.reduce(((t,e)=>t/e.scaleFactor),t),t}canConvert(t){return t instanceof pi&&super.canConvert(t)}convertTo(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${this.name} to ${e.name}.`);return t*(this.scaleFactor/e.scaleFactor)}convertFrom(t,e){if(!this.canConvert(e))throw new Error(`Invalid conversion from ${e.name} to ${this.name}.`);return t*(e.scaleFactor/this.scaleFactor)}}!function(t){t.Distance="distance",t.Angle="angle",t.Duration="duration",t.Weight="weight",t.Mass="weight",t.Volume="volume",t.Pressure="pressure",t.Temperature="temperature",t.TemperatureDelta="temperature_delta",t.Speed="speed",t.Acceleration="acceleration",t.WeightFlux="weight_flux",t.MassFlux="weight_flux",t.VolumeFlux="volume_flux",t.Density="density",t.Force="force",t.DistancePerWeight="distance_per_weight",t.DistanceRatio="distance_ratio",t.WeightPerDistance="weight_per_distance"}(R||(R={}));class gi{}gi.METER=new di(R.Distance,"meter",1),gi.CENTIMETER=new di(R.Distance,"centimeter",.01),gi.KILOMETER=new di(R.Distance,"kilometer",1e3),gi.INCH=new di(R.Distance,"inch",.0254),gi.FOOT=new di(R.Distance,"foot",.3048),gi.MILE=new di(R.Distance,"mile",1609.34),gi.NMILE=new di(R.Distance,"nautical mile",1852),gi.GA_RADIAN=new di(R.Distance,"great arc radian",6378100),gi.G_METER=new di(R.Distance,"9.80665 meter",9.80665),gi.RADIAN=new di(R.Angle,"radian",1),gi.DEGREE=new di(R.Angle,"degree",Math.PI/180),gi.ARC_MIN=new di(R.Angle,"minute",Math.PI/180/60),gi.ARC_SEC=new di(R.Angle,"second",Math.PI/180/3600),gi.MILLISECOND=new di(R.Duration,"millisecond",.001),gi.SECOND=new di(R.Duration,"second",1),gi.MINUTE=new di(R.Duration,"minute",60),gi.HOUR=new di(R.Duration,"hour",3600),gi.KILOGRAM=new di(R.Weight,"kilogram",1),gi.POUND=new di(R.Weight,"pound",.453592),gi.SLUG=new di(R.Weight,"slug",14.5939),gi.TON=new di(R.Weight,"ton",907.185),gi.TONNE=new di(R.Weight,"tonne",1e3),gi.LITER_FUEL=new di(R.Weight,"liter",.80283679),gi.GALLON_FUEL=new di(R.Weight,"gallon",3.0390664),gi.LITER_AUTOGAS_FUEL=new di(R.Weight,"liter",.71895832),gi.GALLON_AUTOGAS_FUEL=new di(R.Weight,"gallon",2.721552),gi.IMP_GALLON_FUEL=new di(R.Weight,"imperial gallon",3.6497683),gi.LITER=new di(R.Volume,"liter",1),gi.GALLON=new di(R.Volume,"gallon",3.78541),gi.HPA=new di(R.Pressure,"hectopascal",1),gi.MB=new di(R.Pressure,"millibar",1),gi.ATM=new di(R.Pressure,"atmosphere",1013.25),gi.IN_HG=new di(R.Pressure,"inch of mercury",33.8639),gi.MM_HG=new di(R.Pressure,"millimeter of mercury",1.33322),gi.PSI=new di(R.Pressure,"pound per square inch",68.9476),gi.KELVIN=new di(R.Temperature,"kelvin",1,0),gi.CELSIUS=new di(R.Temperature,"° Celsius",1,273.15),gi.FAHRENHEIT=new di(R.Temperature,"° Fahrenheit",5/9,459.67),gi.RANKINE=new di(R.Temperature,"° Rankine",5/9,0),gi.DELTA_CELSIUS=new di(R.TemperatureDelta,"Δ° Celsius",1),gi.DELTA_FAHRENHEIT=new di(R.TemperatureDelta,"Δ° Fahrenheit",5/9),gi.KNOT=new pi(R.Speed,[gi.NMILE],[gi.HOUR],"knot"),gi.KPH=new pi(R.Speed,[gi.KILOMETER],[gi.HOUR]),gi.MPH=new pi(R.Speed,[gi.MILE],[gi.HOUR]),gi.MPM=new pi(R.Speed,[gi.METER],[gi.MINUTE]),gi.MPS=new pi(R.Speed,[gi.METER],[gi.SECOND]),gi.FPM=new pi(R.Speed,[gi.FOOT],[gi.MINUTE]),gi.FPS=new pi(R.Speed,[gi.FOOT],[gi.SECOND]),gi.MPM_PER_SEC=new pi(R.Acceleration,[gi.METER],[gi.MINUTE,gi.SECOND]),gi.MPS_PER_SEC=new pi(R.Acceleration,[gi.METER],[gi.SECOND,gi.SECOND]),gi.FPM_PER_SEC=new pi(R.Acceleration,[gi.FOOT],[gi.MINUTE,gi.SECOND]),gi.FPS_PER_SEC=new pi(R.Acceleration,[gi.FOOT],[gi.SECOND,gi.SECOND]),gi.KNOT_PER_SEC=new pi(R.Acceleration,[gi.NMILE],[gi.HOUR,gi.SECOND]),gi.G_ACCEL=new pi(R.Acceleration,[gi.G_METER],[gi.SECOND,gi.SECOND]),gi.KGH=new pi(R.WeightFlux,[gi.KILOGRAM],[gi.HOUR]),gi.PPH=new pi(R.WeightFlux,[gi.POUND],[gi.HOUR]),gi.LPH_FUEL=new pi(R.WeightFlux,[gi.LITER_FUEL],[gi.HOUR]),gi.GPH_FUEL=new pi(R.WeightFlux,[gi.GALLON_FUEL],[gi.HOUR]),gi.IGPH_FUEL=new pi(R.WeightFlux,[gi.IMP_GALLON_FUEL],[gi.HOUR]),gi.SLUG_PER_FT3=new pi(R.Density,[gi.SLUG],[gi.FOOT,gi.FOOT,gi.FOOT]),gi.KG_PER_M3=new pi(R.Density,[gi.KILOGRAM],[gi.METER,gi.METER,gi.METER]),gi.NEWTON=new pi(R.Force,[gi.KILOGRAM,gi.METER],[gi.SECOND,gi.SECOND]),gi.POUND_FORCE=new pi(R.Force,[gi.POUND,gi.G_METER],[gi.SECOND,gi.SECOND]),gi.MILE_PER_GALLON_FUEL=new pi(R.DistancePerWeight,[gi.MILE],[gi.GALLON_FUEL]),gi.NMILE_PER_GALLON_FUEL=new pi(R.DistancePerWeight,[gi.NMILE],[gi.GALLON_FUEL]),gi.FOOT_PER_NMILE=new pi(R.DistanceRatio,[gi.FOOT],[gi.NMILE]);class fi extends ii{constructor(t,e){var i,s,r,n,a,o,c,h;super(new Map([["indicated_alt",{name:"INDICATED ALTITUDE:#index#",type:l.Feet,indexed:!0}],["altimeter_baro_setting_inhg",{name:"KOHLSMAN SETTING HG:#index#",type:l.InHG,indexed:!0}],["altimeter_baro_setting_mb",{name:"KOHLSMAN SETTING MB:#index#",type:l.MB,indexed:!0}],["altimeter_baro_preselect_raw",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,indexed:!0}],["altimeter_baro_preselect_inhg",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,map:t=>gi.HPA.convertTo(t/16,gi.IN_HG),indexed:!0}],["altimeter_baro_preselect_mb",{name:"L:XMLVAR_Baro#index#_SavedPressure",type:l.Number,map:t=>t/16,indexed:!0}],["altimeter_baro_is_std",{name:"L:XMLVAR_Baro#index#_ForcedToSTD",type:l.Bool,indexed:!0}],["radio_alt",{name:"RADIO HEIGHT",type:l.Feet}],["pressure_alt",{name:"PRESSURE ALTITUDE",type:l.Feet}],["vertical_speed",{name:"VERTICAL SPEED",type:l.FPM}],["ambient_density",{name:"AMBIENT DENSITY",type:l.SlugsPerCubicFoot}],["isa_temp_c",{name:"STANDARD ATM TEMPERATURE",type:l.Celsius}],["ram_air_temp_c",{name:"TOTAL AIR TEMPERATURE",type:l.Celsius}],["ambient_wind_velocity",{name:"AMBIENT WIND VELOCITY",type:l.Knots}],["ambient_wind_direction",{name:"AMBIENT WIND DIRECTION",type:l.Degree}],["on_ground",{name:"SIM ON GROUND",type:l.Bool}],["aoa",{name:"INCIDENCE ALPHA",type:l.Degree}],["stall_aoa",{name:"STALL ALPHA",type:l.Degree}],["zero_lift_aoa",{name:"ZERO LIFT ALPHA",type:l.Degree}],["density_alt",{name:"DENSITY ALTITUDE",type:l.Feet}],["dynamic_pressure_inhg",{name:"DYNAMIC PRESSURE",type:l.InHG}]]),t,e),this.registeredSimVarIds={mach:SimVar.GetRegisteredId("AIRSPEED MACH",l.Mach,""),ambientPressure:SimVar.GetRegisteredId("AMBIENT PRESSURE",l.InHG,""),ambientTemperature:SimVar.GetRegisteredId("AMBIENT TEMPERATURE",l.Celsius,"")},null!==(i=this.needPublish)&&void 0!==i||(this.needPublish={mach_number:!1,ambient_pressure_inhg:!1,ambient_temp_c:!1}),null!==(s=this.needPublishIasTopics)&&void 0!==s||(this.needPublishIasTopics=new Map),null!==(r=this.needRetrievePressure)&&void 0!==r||(this.needRetrievePressure=!1),null!==(n=this.needRetrieveTemperature)&&void 0!==n||(this.needRetrieveTemperature=!1),null!==(a=this.needRetrieveMach)&&void 0!==a||(this.needRetrieveMach=!1),null!==(o=this.pressure)&&void 0!==o||(this.pressure=1013.25),null!==(c=this.temperature)&&void 0!==c||(this.temperature=0),null!==(h=this.mach)&&void 0!==h||(this.mach=0)}handleSubscribedTopic(t){var e,i;null!==(e=this.needPublish)&&void 0!==e||(this.needPublish={mach_number:!1,ambient_pressure_inhg:!1,ambient_temp_c:!1}),null!==(i=this.needPublishIasTopics)&&void 0!==i||(this.needPublishIasTopics=new Map),this.resolvedSimVars.has(t)||t in this.needPublish||fi.TOPIC_REGEXES.ias.test(t)||fi.TOPIC_REGEXES.tas.test(t)||fi.TOPIC_REGEXES.indicated_mach_number.test(t)||fi.TOPIC_REGEXES.indicated_tas.test(t)||fi.TOPIC_REGEXES.mach_to_kias_factor.test(t)||fi.TOPIC_REGEXES.tas_to_ias_factor.test(t)||fi.TOPIC_REGEXES.indicated_mach_to_kias_factor.test(t)||fi.TOPIC_REGEXES.indicated_tas_to_ias_factor.test(t)?this.onTopicSubscribed(t):this.tryMatchIndexedSubscribedTopic(t)}onTopicSubscribed(t){if(t in this.needPublish)switch(this.needPublish[t]=!0,t){case"ambient_pressure_inhg":this.needRetrievePressure=!0,this.publishActive&&this.retrieveAmbientPressure(!0);break;case"ambient_temp_c":this.needRetrieveTemperature=!0,this.publishActive&&this.retrieveAmbientTemperature(!0);break;case"mach_number":this.needRetrieveMach=!0,this.publishActive&&this.retrieveMach(!0)}else if(fi.TOPIC_REGEXES.ias.test(t)){const e=t.match(fi.TOPIC_REGEXES.ias)[1],i=e?parseInt(e):-1,s=this.getOrCreateIasTopicEntry(i);s.iasTopic=i<0?"ias":`ias_${i}`,this.publishActive&&this.retrieveIas(s,!0)}else if(fi.TOPIC_REGEXES.tas.test(t)){const e=t.match(fi.TOPIC_REGEXES.tas)[1],i=e?parseInt(e):-1,s=this.getOrCreateIasTopicEntry(i);s.tasTopic=i<0?"tas":`tas_${i}`,this.publishActive&&this.retrieveTas(s,!0)}else if(fi.TOPIC_REGEXES.indicated_mach_number.test(t)){const e=t.match(fi.TOPIC_REGEXES.indicated_mach_number)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0;const s=this.getOrCreateIasTopicEntry(i);s.indicatedMachTopic=i<0?"indicated_mach_number":`indicated_mach_number_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveIas(s,!1),this.retrieveIndicatedMach(s,!0))}else if(fi.TOPIC_REGEXES.indicated_tas.test(t)){const e=t.match(fi.TOPIC_REGEXES.indicated_tas)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const s=this.getOrCreateIasTopicEntry(i);s.indicatedTasTopic=i<0?"indicated_tas":`indicated_tas_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(s,!1),this.retrieveIndicatedTas(s,!0))}else if(fi.TOPIC_REGEXES.mach_to_kias_factor.test(t)){const e=t.match(fi.TOPIC_REGEXES.mach_to_kias_factor)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveMach=!0;const s=this.getOrCreateIasTopicEntry(i);s.machToKiasTopic=i<0?"mach_to_kias_factor":`mach_to_kias_factor_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveMach(!1),this.retrieveIas(s,!1),this.publishMachToKias(s))}else if(fi.TOPIC_REGEXES.tas_to_ias_factor.test(t)){const e=t.match(fi.TOPIC_REGEXES.tas_to_ias_factor)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const s=this.getOrCreateIasTopicEntry(i);s.tasToIasTopic=i<0?"tas_to_ias_factor":`tas_to_ias_factor_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(s,!1),this.retrieveTas(s,!1),this.publishTasToIas(s))}else if(fi.TOPIC_REGEXES.indicated_mach_to_kias_factor.test(t)){const e=t.match(fi.TOPIC_REGEXES.indicated_mach_to_kias_factor)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0;const s=this.getOrCreateIasTopicEntry(i);s.indicatedMachToKiasTopic=i<0?"indicated_mach_to_kias_factor":`indicated_mach_to_kias_factor_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveIas(s,!1),this.retrieveIndicatedMach(s,!1),this.publishIndicatedMachToKias(s))}else if(fi.TOPIC_REGEXES.indicated_tas_to_ias_factor.test(t)){const e=t.match(fi.TOPIC_REGEXES.indicated_tas_to_ias_factor)[1],i=e?parseInt(e):-1;this.needRetrievePressure=!0,this.needRetrieveTemperature=!0;const s=this.getOrCreateIasTopicEntry(i);s.indicatedTasToIasTopic=i<0?"indicated_tas_to_ias_factor":`indicated_tas_to_ias_factor_${i}`,this.publishActive&&(this.retrieveAmbientPressure(!1),this.retrieveAmbientTemperature(!1),this.retrieveIas(s,!1),this.retrieveIndicatedTas(s,!1),this.publishIndicatedTasToIas(s))}else super.onTopicSubscribed(t)}getOrCreateIasTopicEntry(t){let e=this.needPublishIasTopics.get(t);return e||(e={iasSimVarId:SimVar.GetRegisteredId(t<0?"AIRSPEED INDICATED:1":`AIRSPEED INDICATED:${t}`,l.Knots,""),tasSimVarId:SimVar.GetRegisteredId(t<0?"AIRSPEED TRUE:1":`AIRSPEED TRUE:${t}`,l.Knots,""),kias:0,iasMps:0,ktas:0,indicatedMach:0,indicatedTas:0},this.needPublishIasTopics.set(t,e)),e}onUpdate(){if(!SimVar.GetSimVarValue("IS SLEW ACTIVE","bool")){this.needRetrievePressure&&this.retrieveAmbientPressure(this.needPublish.ambient_pressure_inhg),this.needRetrieveTemperature&&this.retrieveAmbientTemperature(this.needPublish.ambient_temp_c),this.needRetrieveMach&&this.retrieveMach(this.needPublish.mach_number);for(const t of this.needPublishIasTopics.values())this.retrieveIas(t,!0),(t.tasTopic||t.tasToIasTopic)&&this.retrieveTas(t,!0),(t.indicatedMachTopic||t.indicatedMachToKiasTopic)&&this.retrieveIndicatedMach(t,!0),(t.indicatedTasTopic||t.indicatedTasToIasTopic)&&this.retrieveIndicatedTas(t,!0),this.publishMachToKias(t),this.publishTasToIas(t),this.publishIndicatedMachToKias(t),this.publishIndicatedTasToIas(t);super.onUpdate()}}retrieveAmbientPressure(t){const e=SimVar.GetSimVarValueFastReg(this.registeredSimVarIds.ambientPressure);this.pressure=gi.IN_HG.convertTo(e,gi.HPA),t&&this.publish("ambient_pressure_inhg",e)}retrieveAmbientTemperature(t){this.temperature=SimVar.GetSimVarValueFastReg(this.registeredSimVarIds.ambientTemperature),t&&this.publish("ambient_temp_c",this.temperature)}retrieveMach(t){this.mach=SimVar.GetSimVarValueFastReg(this.registeredSimVarIds.mach),t&&this.publish("mach_number",this.mach)}retrieveIas(t,e){t.kias=SimVar.GetSimVarValueFastReg(t.iasSimVarId),t.iasMps=gi.KNOT.convertTo(t.kias,gi.MPS),e&&t.iasTopic&&this.publish(t.iasTopic,t.kias)}retrieveTas(t,e){t.ktas=SimVar.GetSimVarValueFastReg(t.tasSimVarId),e&&t.tasTopic&&this.publish(t.tasTopic,t.ktas)}retrieveIndicatedMach(t,e){t.indicatedMach=ci.casToMach(t.iasMps,this.pressure),e&&t.indicatedMachTopic&&this.publish(t.indicatedMachTopic,t.indicatedMach)}retrieveIndicatedTas(t,e){t.indicatedTas=gi.MPS.convertTo(ci.casToTas(t.iasMps,this.pressure,this.temperature),gi.KNOT),e&&t.indicatedTasTopic&&this.publish(t.indicatedTasTopic,t.indicatedTas)}publishMachToKias(t){if(!t.machToKiasTopic)return;const e=t.kias<1||0===this.mach?1.943844492440605*ci.machToCas(1,this.pressure):t.kias/this.mach;this.publish(t.machToKiasTopic,isFinite(e)?e:1)}publishTasToIas(t){if(!t.tasToIasTopic)return;const e=t.kias<1||0===t.ktas?1/ci.casToTas(1,this.pressure,this.temperature):t.kias/t.ktas;this.publish(t.tasToIasTopic,isFinite(e)?e:1)}publishIndicatedMachToKias(t){if(!t.indicatedMachToKiasTopic)return;const e=t.kias<1||0===t.indicatedMach?1.943844492440605*ci.machToCas(1,this.pressure):t.kias/t.indicatedMach;this.publish(t.indicatedMachToKiasTopic,isFinite(e)?e:1)}publishIndicatedTasToIas(t){if(!t.indicatedTasToIasTopic)return;const e=t.kias<1||0===t.indicatedTas?1/ci.casToTas(1,this.pressure,this.temperature):t.kias/t.indicatedTas;this.publish(t.indicatedTasToIasTopic,isFinite(e)?e:1)}}fi.TOPIC_REGEXES={ias:/^ias(?:_(0|(?:[1-9])\d*))?$/,tas:/^tas(?:_(0|(?:[1-9])\d*))?$/,indicated_mach_number:/^indicated_mach_number(?:_(0|(?:[1-9])\d*))?$/,indicated_tas:/^indicated_tas(?:_(0|(?:[1-9])\d*))?$/,mach_to_kias_factor:/^mach_to_kias_factor(?:_(0|(?:[1-9])\d*))?$/,tas_to_ias_factor:/^tas_to_ias_factor(?:_(0|(?:[1-9])\d*))?$/,indicated_mach_to_kias_factor:/^indicated_mach_to_kias_factor(?:_(0|(?:[1-9])\d*))?$/,indicated_tas_to_ias_factor:/^indicated_tas_to_ias_factor(?:_(0|(?:[1-9])\d*))?$/},function(t){t[t.Down=-1]="Down",t[t.Nearest=0]="Nearest",t[t.Up=1]="Up"}(_||(_={}));class mi{static clamp(t,e,i){return Math.max(e,Math.min(i,t))}static round(t,e=1){return Math.round(t/e)*e}static ceil(t,e=1){return Math.ceil(t/e)*e}static floor(t,e=1){return Math.floor(t/e)*e}static normalizeAngle(t,e=0){return((t-e)%mi.TWO_PI+mi.TWO_PI)%mi.TWO_PI+e}static normalizeAngleDeg(t,e=0){return((t-e)%360+360)%360+e}static angularDistance(t,e,i){const s=i<0?-1:1,r=mi.normalizeAngle((e-t)*s);return 0===i?Math.min(r,mi.TWO_PI-r):r}static angularDistanceDeg(t,e,i){const s=i<0?-1:1,r=mi.normalizeAngleDeg((e-t)*s);return 0===i?Math.min(r,360-r):r}static diffAngle(t,e,i=!0){return mi.angularDistance(t,e,i?1:0)}static diffAngleDeg(t,e,i=!0){return mi.angularDistanceDeg(t,e,i?1:0)}static lerp(t,e,i,s,r,n=!1,a=!1){if(e!==i&&s!==r){return mi.clamp((t-e)/(i-e),n?0:-1/0,a?1:1/0)*(r-s)+s}return s}static lerpVector(t,e,i,s,r,n,a=!1,o=!1){const c=Math.min(r.length,n.length,t.length);for(let h=0;h32)throw new Error(`Invalid index ${t} for bit flag. Index must be between 0 and 32.`);return 1<t===e||isNaN(t)&&isNaN(e),yi.NEVER_EQUALITY=()=>!1;class Si{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,i,s,r){this.target=e,this.onOrphaned=i,this.sourceMap=s,this.pipeMap=r,this._isAlive=!0,this._isPaused=!0,this.canInitialNotify=!0,this.isPipePaused=!0,this.sourceSub=t.sub(this.onSourceChanged.bind(this),!1,!0)}onSourceChanged(t){var e;null===(e=this.pipe)||void 0===e||e.destroy();const i=this.sourceMap(t);i?this.pipeMap?this.pipe=i.pipe(this.target,this.pipeMap,this.isPipePaused):this.pipe=i.pipe(this.target,this.isPipePaused):(this.pipe=void 0,!this.isPipePaused&&this.onOrphaned&&this.onOrphaned(this.target))}pause(){var t;if(!this._isAlive)throw new Error("Subscription: cannot pause a dead Subscription.");return this._isPaused=!0,this.isPipePaused=!0,this.sourceSub.pause(),null===(t=this.pipe)||void 0===t||t.pause(),this}resume(t=!1){if(!this._isAlive)throw new Error("Subscription: cannot resume a dead Subscription.");return this._isPaused?(this._isPaused=!1,this.sourceSub.resume(!0),this.isPipePaused=!1,this.pipe?this.pipe.resume(t):t&&this.onOrphaned&&this.onOrphaned(this.target),this):this}destroy(){var t;this._isAlive&&(this._isAlive=!1,this.sourceSub.destroy(),null===(t=this.pipe)||void 0===t||t.destroy(),this.pipe=void 0)}}class vi{static identity(){return t=>t}static not(){return t=>!t}static or(){return t=>t.length>0&&t.includes(!0)}static nor(){return t=>!t.includes(!0)}static and(){return t=>t.length>0&&!t.includes(!1)}static nand(){return t=>t.length<1||t.includes(!1)}static negate(){return t=>-t}static abs(){return Math.abs}static min(){return t=>Math.min(...t)}static max(){return t=>Math.max(...t)}static count(t){return vi.reduce(((e,i)=>t(i)?e+1:e),0)}static sum(){return vi.reduce(((t,e)=>t+e),0)}static average(){return t=>{const e=t.length;let i=0;for(let s=0;si.reduce(t,e)}static withPrecision(t,e=_.Nearest){const i=e>0?mi.ceil:e<0?mi.floor:mi.round;return"object"==typeof t?e=>{const s=t.get();return i(e,s)}:e=>i(e,t)}static withPrecisionHysteresis(t,e,i=_.Nearest){let s,r,n,a,o;return"number"==typeof e?s=r=Math.max(0,e):(s=Math.max(0,e[0]),r=Math.max(0,e[1])),i>0?(n=mi.ceil,a=-(t+s),o=r):i<0?(n=mi.floor,a=-s,o=t+r):(n=mi.round,a=-(.5*t+s),o=.5*t+r),vi.withPrecisionHysteresisHelper(t,n,a,o,i<=0)}static withPrecisionHysteresisHelper(t,e,i,s,r){return r?(r,n)=>void 0!==n&&isFinite(r)?r=n+s?e(r,t):n:e(r,t):(r,n)=>void 0!==n&&isFinite(r)?r<=n+i||r>n+s?e(r,t):n:e(r,t)}static changedBy(t){return yi.isSubscribable(t)?(e,i)=>void 0===i||Math.abs(e-i)>=t.get()?e:i:(e,i)=>void 0===i||Math.abs(e-i)>=t?e:i}}class bi extends ri{get isAlive(){return this._isAlive}get isPaused(){return this._isPaused}constructor(t,e,i,s,...r){super(),this.mapFunc=t,this.equalityFunc=e,this.canInitialNotify=!0,this._isAlive=!0,this._isPaused=!1,this.inputs=r,this.inputValues=r.map((t=>t.get())),s&&i?(this.value=s,i(this.value,this.mapFunc(this.inputValues,void 0)),this.mutateFunc=t=>{i(this.value,t)}):(this.value=this.mapFunc(this.inputValues,void 0),this.mutateFunc=t=>{this.value=t}),this.inputSubs=this.inputs.map(((t,e)=>t.sub((t=>{this.inputValues[e]=t,this.updateValue()}))))}static create(...t){let e,i,s,r;return"function"==typeof t[0]?(e=t.shift(),i="function"==typeof t[0]?t.shift():ri.DEFAULT_EQUALITY_FUNC,"function"==typeof t[0]&&(s=t.shift(),r=t.shift())):(e=bi.IDENTITY_MAP,i=bi.NEVER_EQUALS),new bi(e,i,s,r,...t)}updateValue(){const t=this.mapFunc(this.inputValues,this.value);this.equalityFunc(this.value,t)||(this.mutateFunc(t),this.notify())}get(){return this.value}pause(){if(!this._isAlive)throw new Error("MappedSubject: cannot pause a dead subject");if(this._isPaused)return this;for(let t=0;t!1;class Ti{static create(t,e){const i=new Float64Array(2);return void 0!==t&&void 0!==e&&(i[0]=t,i[1]=e),i}static theta(t){return Math.atan2(t[1],t[0])}static set(t,e,i){return i[0]=t,i[1]=e,i}static setFromPolar(t,e,i){return i[0]=t*Math.cos(e),i[1]=t*Math.sin(e),i}static add(t,e,i){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}static sub(t,e,i){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}static dot(t,e){return t[0]*e[0]+t[1]*e[1]}static det(t,e){return t[0]*e[1]-t[1]*e[0]}static multScalar(t,e,i){return i[0]=t[0]*e,i[1]=t[1]*e,i}static abs(t){return Math.hypot(t[0],t[1])}static normalize(t,e){const i=Ti.abs(t);return e[0]=t[0]/i,e[1]=t[1]/i,e}static normal(t,e,i=!1){const s=t[0],r=t[1];return i?(e[0]=-r,e[1]=s):(e[0]=r,e[1]=-s),e}static distance(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}static angle(t,e){const i=Ti.abs(t)*Ti.abs(e);return 0===i?NaN:Ti.unitAngle(t,e)/i}static unitAngle(t,e){return Math.acos(mi.clamp(Ti.dot(t,e),-1,1))}static equals(t,e){return t[0]===e[0]&&t[1]===e[1]}static isFinite(t){return isFinite(t[0])&&isFinite(t[1])}static copy(t,e){return Ti.set(t[0],t[1],e)}static pointWithinPolygon(t,e){let i=0,s=0,r=0,n=0,a=0,o=0,c=null,h=null;const l=e[0],u=e[1],d=t.length-1;if(c=t[0],c[0]!==t[d][0]&&c[1]!==t[d][1])throw new Error("First and last coordinates in a ring must be the same");r=c[0]-l,n=c[1]-u;for(let d=0;d0&&o>0)c=h,n=o,r=c[0]-l;else{if(a=h[0]-e[0],o>0&&n<=0){if(s=r*o-a*n,s>0)i+=1;else if(0===s)return}else if(n>0&&o<=0){if(s=r*o-a*n,s<0)i+=1;else if(0===s)return}else if(0===o&&n<0){if(s=r*o-a*n,0===s)return}else if(0===n&&o<0){if(s=r*o-a*n,0===s)return}else if(0===n&&0===o){if(a<=0&&r>=0)return;if(r<=0&&a>=0)return}c=h,n=o,r=a}return i%2!=0}}class Ri{static create(t,e,i){const s=new Float64Array(3);return void 0!==t&&void 0!==e&&void 0!==i&&(s[0]=t,s[1]=e,s[2]=i),s}static theta(t){return Math.atan2(Math.hypot(t[0],t[1]),t[2])}static phi(t){return Math.atan2(t[1],t[0])}static set(t,e,i,s){return s[0]=t,s[1]=e,s[2]=i,s}static setFromSpherical(t,e,i,s){const r=Math.sin(e);return s[0]=t*r*Math.cos(i),s[1]=t*r*Math.sin(i),s[2]=t*Math.cos(e),s}static add(t,e,i){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i[2]=t[2]+e[2],i}static sub(t,e,i){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],i}static dot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}static cross(t,e,i){const s=t[0],r=t[1],n=t[2],a=e[0],o=e[1],c=e[2];return i[0]=r*c-n*o,i[1]=n*a-s*c,i[2]=s*o-r*a,i}static multScalar(t,e,i){return i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e,i}static abs(t){return Math.hypot(t[0],t[1],t[2])}static setMagnitude(t,e,i){const s=Ri.abs(t),r=0===s?NaN:e/s;return i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i}static normalize(t,e){const i=Ri.abs(t);return e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i,e}static distance(t,e){return Math.hypot(e[0]-t[0],e[1]-t[0],e[2]-t[2])}static angle(t,e){const i=Ri.abs(t)*Ri.abs(e);return 0===i?NaN:Ri.unitAngle(t,e)/i}static unitAngle(t,e){return Math.acos(mi.clamp(Ri.dot(t,e),-1,1))}static equals(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}static isFinite(t){return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])}static copy(t,e){return Ri.set(t[0],t[1],t[2],e)}}class _i{static create(t,...e){const i=new Float64Array(t);for(let s=0;sthis.value.length)throw new RangeError(`VecNSubject: Cannot set ${i.length} components on a vector of length ${this.value.length}`);let s=!0;const r=i.length;for(let t=0;t=t.length)throw new RangeError;return t[e]}static peekAt(t,e){return e<0&&(e+=t.length),t[e]}static first(t){if(0===t.length)throw new RangeError;return t[0]}static peekFirst(t){return t[0]}static last(t){if(0===t.length)throw new RangeError;return t[t.length-1]}static peekLast(t){return t[t.length-1]}static includes(t,e,i){return t.includes(e,i)}static equals(t,e,i=Ni.STRICT_EQUALS){if(t.length!==e.length)return!1;for(let s=0;s0)){const r=s?-1:1;for(;a+r>=0&&a+re.length>t?e.length:t),0)}}Ni.STRICT_EQUALS=(t,e)=>t===e;class Fi{}Fi.ANGULAR_TOLERANCE=1e-7;class wi{constructor(t){this.source=t}get lat(){return this.source.lat}get lon(){return this.source.lon}isValid(){return this.source.isValid()}distance(t,e){return"number"==typeof t?this.source.distance(t,e):this.source.distance(t)}distanceRhumb(t,e){return"number"==typeof t?this.source.distanceRhumb(t,e):this.source.distanceRhumb(t)}bearingTo(t,e){return"number"==typeof t?this.source.bearingTo(t,e):this.source.bearingTo(t)}bearingFrom(t,e){return"number"==typeof t?this.source.bearingFrom(t,e):this.source.bearingFrom(t)}bearingRhumb(t,e){return"number"==typeof t?this.source.bearingRhumb(t,e):this.source.bearingRhumb(t)}offset(t,e,i){if(!i)throw new Error("Cannot mutate a read-only GeoPoint.");return this.source.offset(t,e,i)}offsetRhumb(t,e,i){if(!i)throw new Error("Cannot mutate a read-only GeoPoint.");return this.source.offsetRhumb(t,e,i)}antipode(t){if(!t)throw new Error("Cannot mutate a read-only GeoPoint.");return this.source.antipode(t)}toCartesian(t){return this.source.toCartesian(t)}equals(t,e,i){return"number"==typeof t?this.source.equals(t,e,i):this.source.equals(t,e)}copy(t){return this.source.copy(t)}}class Di{constructor(t,e){this._lat=0,this._lon=0,this.set(t,e),this.readonly=new wi(this)}get lat(){return this._lat}get lon(){return this._lon}static asLatLonInterface(t,e){return"number"==typeof t?Di.tempGeoPoint.set(t,e):t}static asVec3(t,e,i){return"number"==typeof t?Ri.set(t,e,i,Di.tempVec3):t}isValid(){return isFinite(this._lat)&&isFinite(this._lon)}set(t,e){let i,s;return"number"==typeof t?(i=t,s=e):(i=t.lat,s=t.lon),i=mi.normalizeAngleDeg(i,-180),s=mi.normalizeAngleDeg(s,-180),Math.abs(i)>90&&(i=180-i,i=mi.normalizeAngleDeg(i,-180),s+=180,s=mi.normalizeAngleDeg(s,-180)),this._lat=i,this._lon=s,this}setFromCartesian(t,e,i){const s=Di.asVec3(t,e,i),r=Ri.theta(s),n=Ri.phi(s);return this.set(90-r*Avionics.Utils.RAD2DEG,n*Avionics.Utils.RAD2DEG)}distance(t,e){const i=Di.asLatLonInterface(t,e);return Di.distance(this.lat,this.lon,i.lat,i.lon)}distanceRhumb(t,e){const i=Di.asLatLonInterface(t,e);return Di.distanceRhumb(this.lat,this.lon,i.lat,i.lon)}bearingTo(t,e){const i=Di.asLatLonInterface(t,e);return Di.initialBearing(this.lat,this.lon,i.lat,i.lon)}bearingFrom(t,e){const i=Di.asLatLonInterface(t,e);return Di.finalBearing(i.lat,i.lon,this.lat,this.lon)}bearingRhumb(t,e){const i=Di.asLatLonInterface(t,e);return Di.bearingRhumb(this.lat,this.lon,i.lat,i.lon)}offset(t,e,i){let s,r;if(90===Math.abs(this.lat))s=this.lat+e*Avionics.Utils.RAD2DEG,r=this.lon+t*(this.lat>0?-1:1);else{const i=this.lat*Avionics.Utils.DEG2RAD,n=this.lon*Avionics.Utils.DEG2RAD,a=Math.sin(i),o=Math.cos(i),c=Math.sin(t*Avionics.Utils.DEG2RAD),h=Math.cos(t*Avionics.Utils.DEG2RAD),l=e,u=Math.sin(l),d=Math.cos(l),p=Math.asin(a*d+o*u*h),g=Math.atan2(c*u*o,d-a*Math.sin(p));s=p*Avionics.Utils.RAD2DEG,r=(n+g)*Avionics.Utils.RAD2DEG}return(null!=i?i:this).set(s,r)}offsetRhumb(t,e,i){const s=this.lat*Avionics.Utils.DEG2RAD,r=this.lon*Avionics.Utils.DEG2RAD,n=t*Avionics.Utils.DEG2RAD;let a,o=s+e*Math.cos(n);if(Math.abs(o)>=Math.PI/2)o=90*Math.sign(o),a=0;else{const t=Di.deltaPsi(s,o),i=Di.rhumbCorrection(t,s,o);a=r+e*Math.sin(n)/i,o*=Avionics.Utils.RAD2DEG,a*=Avionics.Utils.RAD2DEG}return(null!=i?i:this).set(o,a)}antipode(t){return(null!=t?t:this).set(-this._lat,this._lon+180)}toCartesian(t){return Di.sphericalToCartesian(this,t)}equals(t,e,i){const s=Di.asLatLonInterface(t,e);if(s){if(isNaN(this._lat)&&isNaN(this._lon)&&isNaN(s.lat)&&isNaN(s.lon))return!0;const r="number"==typeof t?i:e,n=this.distance(s);return!isNaN(n)&&n<=(null!=r?r:Di.EQUALITY_TOLERANCE)}return!1}copy(t){return t?t.set(this.lat,this.lon):new Di(this.lat,this.lon)}static sphericalToCartesian(t,e,i){const s=Di.asLatLonInterface(t,e),r=(90-s.lat)*Avionics.Utils.DEG2RAD,n=s.lon*Avionics.Utils.DEG2RAD;return Ri.setFromSpherical(1,r,n,null!=i?i:e)}static equals(t,e,i,s,r){return t instanceof Float64Array?Di.distance(t,e)<=(null!=i?i:Di.EQUALITY_TOLERANCE):"number"==typeof t?Di.distance(t,e,i,s)<=(null!=r?r:Di.EQUALITY_TOLERANCE):Di.distance(t,e)<=(null!=i?i:Di.EQUALITY_TOLERANCE)}static distance(t,e,i,s){if(t instanceof Float64Array)return Ri.unitAngle(t,e);{let r,n,a,o;"number"==typeof t?(r=t,n=e,a=i,o=s):(r=t.lat,n=t.lon,a=e.lat,o=e.lon),r*=Avionics.Utils.DEG2RAD,n*=Avionics.Utils.DEG2RAD,a*=Avionics.Utils.DEG2RAD,o*=Avionics.Utils.DEG2RAD;const c=Math.sin((a-r)/2),h=Math.sin((o-n)/2),l=c*c+Math.cos(r)*Math.cos(a)*h*h;return 2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}}static distanceRhumb(t,e,i,s){let r,n,a,o;if("number"==typeof t)r=t*Avionics.Utils.DEG2RAD,n=e*Avionics.Utils.DEG2RAD,a=i*Avionics.Utils.DEG2RAD,o=s*Avionics.Utils.DEG2RAD;else if(t instanceof Float64Array){const i=Di.tempGeoPoint.setFromCartesian(t);r=i.lat,n=i.lon;const s=Di.tempGeoPoint.setFromCartesian(e);a=s.lat,o=s.lon}else r=t.lat,n=t.lon,a=e.lat,o=e.lon;const c=a-r;let h=o-n;const l=Di.deltaPsi(r,a),u=Di.rhumbCorrection(l,r,a);return Math.abs(h)>Math.PI&&(h+=2*-Math.sign(h)*Math.PI),Math.sqrt(c*c+u*u*h*h)}static initialBearing(t,e,i,s){t*=Avionics.Utils.DEG2RAD,i*=Avionics.Utils.DEG2RAD,e*=Avionics.Utils.DEG2RAD,s*=Avionics.Utils.DEG2RAD;const r=Math.cos(i),n=Math.cos(t)*Math.sin(i)-Math.sin(t)*r*Math.cos(s-e),a=Math.sin(s-e)*r;if(Math.abs(n)<1e-14&&Math.abs(a)<1e-14)return NaN;return(Math.atan2(a,n)*Avionics.Utils.RAD2DEG+360)%360}static finalBearing(t,e,i,s){return(Di.initialBearing(i,s,t,e)+180)%360}static bearingRhumb(t,e,i,s){t*=Avionics.Utils.DEG2RAD,i*=Avionics.Utils.DEG2RAD,e*=Avionics.Utils.DEG2RAD;let r=(s*=Avionics.Utils.DEG2RAD)-e;const n=Di.deltaPsi(t,i);return Math.abs(r)>Math.PI&&(r+=2*-Math.sign(r)*Math.PI),Math.atan2(r,n)*Avionics.Utils.RAD2DEG}static deltaPsi(t,e){return Math.log(Math.tan(e/2+Math.PI/4)/Math.tan(t/2+Math.PI/4))}static rhumbCorrection(t,e,i){return Math.abs(t)>1e-12?(i-e)/t:Math.cos(e)}}Di.EQUALITY_TOLERANCE=Fi.ANGULAR_TOLERANCE,Di.tempVec3=new Float64Array(3),Di.tempGeoPoint=new Di(0,0);class Mi{constructor(t,e){this._center=Ri.create(),this._radius=0,this._sinRadius=0,this.set(t,e)}get center(){return this._center}get radius(){return this._radius}isValid(){return Ri.isFinite(this._center)&&isFinite(this._radius)}isGreatCircle(){return this._radius===Math.PI/2}arcLength(t){return this._sinRadius*t}angularWidth(t){return t/this._sinRadius}set(t,e){return t instanceof Float64Array?0===Ri.abs(t)?Ri.set(NaN,NaN,NaN,this._center):Ri.normalize(t,this._center):Di.sphericalToCartesian(t,this._center),this._setRadius(e)}_set(t,e){return Ri.copy(t,this._center),this._radius=Math.abs(e)%Math.PI,this._sinRadius=Math.sin(this._radius),this}_setRadius(t){return this._radius=Math.abs(t)%Math.PI,this._sinRadius=Math.sin(this._radius),this}setAsGreatCircle(t,e){return Mi._getGreatCircleNormal(t,e,this._center),this._setRadius(Math.PI/2)}reverse(){return Ri.multScalar(this._center,-1,this._center),this._radius=Math.PI-this._radius,this}distanceToCenter(t){return t=t instanceof Float64Array?Ri.normalize(t,Mi.vec3Cache[0]):Di.sphericalToCartesian(t,Mi.vec3Cache[0]),Ri.unitAngle(t,this._center)}closest(t,e){t instanceof Float64Array||(t=Di.sphericalToCartesian(t,Mi.vec3Cache[0]));const i=Ri.multScalar(this._center,Math.cos(this._radius),Mi.vec3Cache[1]),s=Ri.dot(Ri.sub(t,i,Mi.vec3Cache[2]),this._center),r=Ri.sub(t,Ri.multScalar(this._center,s,Mi.vec3Cache[2]),Mi.vec3Cache[2]);if(0===Ri.dot(r,r)||1===Math.abs(Ri.dot(r,this._center)))return e instanceof Di?e.set(NaN,NaN):Ri.set(NaN,NaN,NaN,e);const n=Ri.multScalar(Ri.normalize(Ri.sub(r,i,Mi.vec3Cache[2]),Mi.vec3Cache[2]),this._sinRadius,Mi.vec3Cache[2]),a=Ri.add(i,n,Mi.vec3Cache[2]);return e instanceof Float64Array?Ri.normalize(a,e):e.setFromCartesian(a)}distance(t){return this.distanceToCenter(t)-this._radius}includes(t,e=Mi.ANGULAR_TOLERANCE){const i=this.distance(t);return Math.abs(i)=mi.TWO_PI-s||o<=s?0:o}distanceAlong(t,e,i=Mi.ANGULAR_TOLERANCE,s=0){return this.arcLength(this.angleAlong(t,e,i,this.angularWidth(s)))}bearingAt(t,e=Mi.ANGULAR_TOLERANCE){if(t instanceof Float64Array||(t=Di.sphericalToCartesian(t,Mi.vec3Cache[1])),e=0?1:-1)*Avionics.Utils.RAD2DEG-90+360)%360}offsetDistanceAlong(t,e,i,s=Mi.ANGULAR_TOLERANCE){const r=e/Math.sin(this.radius);return this._offsetAngleAlong(t,r,i,s)}offsetAngleAlong(t,e,i,s=Mi.ANGULAR_TOLERANCE){return this._offsetAngleAlong(t,e,i,s)}_offsetAngleAlong(t,e,i,s=Mi.ANGULAR_TOLERANCE){if(t instanceof Float64Array||(t=Di.sphericalToCartesian(t,Mi.vec3Cache[3])),si)throw new Error(`GeoCircle::rotate(): the specified pivot does not lie on this circle (distance of ${s} vs tolerance of ${i}).`);const r=s<=Math.min(i,Mi.ANGULAR_TOLERANCE)?t:this.closest(t,Mi.vec3Cache[0]);if(!Ri.isFinite(r))throw new Error("GeoCircle::rotate(): the specified pivot cannot be projected onto this circle because it is equidistant to all points on the circle.");if(Math.abs(e)<=Mi.ANGULAR_TOLERANCE||this._sinRadius<=Mi.ANGULAR_TOLERANCE)return this;const n=Ri.copy(this._center,Mi.vec3Cache[5]);return Ri.copy(r,this._center),this.offsetAngleAlong(n,-e,this._center,Math.PI),this}intersection(t,e){const i=this._center,s=t._center,r=this._radius,n=t._radius,a=Ri.dot(i,s),o=a*a;if(1===o)return 0;const c=(Math.cos(r)-a*Math.cos(n))/(1-o),h=(Math.cos(n)-a*Math.cos(r))/(1-o),l=Ri.add(Ri.multScalar(i,c,Mi.vec3Cache[0]),Ri.multScalar(s,h,Mi.vec3Cache[1]),Mi.vec3Cache[0]),u=Ri.dot(l,l);if(u>1)return 0;const d=Ri.cross(i,s,Mi.vec3Cache[1]),p=Ri.dot(d,d);if(0===p)return 0;const g=Math.sqrt((1-u)/p);let f=1;return e[0]||(e[0]=new Float64Array(3)),e[0].set(d),Ri.multScalar(e[0],g,e[0]),Ri.add(e[0],l,e[0]),g>0&&(e[1]||(e[1]=new Float64Array(3)),e[1].set(d),Ri.multScalar(e[1],-g,e[1]),Ri.add(e[1],l,e[1]),f++),f}intersectionGeoPoint(t,e){const i=this.intersection(t,Mi.intersectionCache);for(let t=0;t1)return 0;const d=Ri.cross(i,s,Mi.vec3Cache[1]),p=Ri.dot(d,d);if(0===p)return 0;const g=Math.sin(e);return(1-u)/p>g*g?2:1}static createFromPoint(t,e){return new Mi(Di.sphericalToCartesian(t,Mi.vec3Cache[0]),e)}static createGreatCircle(t,e){return new Mi(Mi._getGreatCircleNormal(t,e,Mi.vec3Cache[0]),Math.PI/2)}static createGreatCircleFromPointBearing(t,e){return new Mi(Mi.getGreatCircleNormalFromPointBearing(t,e,Mi.vec3Cache[0]),Math.PI/2)}static getGreatCircleNormal(t,e,i){return Mi._getGreatCircleNormal(t,e,i)}static _getGreatCircleNormal(t,e,i){return"number"==typeof e?Mi.getGreatCircleNormalFromPointBearing(t,e,i):e instanceof Mi?Mi.getGreatCircleNormalFromCircle(t,e,i):Mi.getGreatCircleNormalFromPoints(t,e,i)}static getGreatCircleNormalFromPoints(t,e,i){return t instanceof Float64Array||(t=Di.sphericalToCartesian(t,Mi.vec3Cache[0])),e instanceof Float64Array||(e=Di.sphericalToCartesian(e,Mi.vec3Cache[1])),Ri.normalize(Ri.cross(t,e,i),i)}static getGreatCircleNormalFromPointBearing(t,e,i){t instanceof Float64Array&&(t=Mi.geoPointCache[0].setFromCartesian(t));const s=t.lat*Avionics.Utils.DEG2RAD,r=t.lon*Avionics.Utils.DEG2RAD;e*=Avionics.Utils.DEG2RAD;const n=Math.sin(s),a=Math.sin(r),o=Math.cos(r),c=Math.sin(e),h=Math.cos(e),l=a*h-n*o*c,u=-o*h-n*a*c,d=Math.cos(s)*c;return Ri.set(l,u,d,i)}static getGreatCircleNormalFromCircle(t,e,i){const s=e.closest(t,Mi.vec3Cache[0]);return Ri.isFinite(s)?e.isGreatCircle()?Ri.copy(e.center,i):Ri.normalize(Ri.cross(Ri.cross(s,e._center,i),s,i),i):Ri.set(NaN,NaN,NaN,i)}}Mi.ANGULAR_TOLERANCE=Fi.ANGULAR_TOLERANCE,Mi.NORTH_POLE=Ri.create(0,0,1),Mi.geoPointCache=[new Di(0,0)],Mi.vec3Cache=Ni.create(6,(()=>Ri.create())),Mi.intersectionCache=[Ri.create(),Ri.create()];class Li{static clamp(t,e,i){return Math.min(Math.max(t,e),i)}static normalizeHeading(t){return isFinite(t)?(t%360+360)%360:(console.error(`normalizeHeading: Invalid heading: ${t}`),NaN)}static reciprocateHeading(t){return Li.normalizeHeading(t+180)}static turnRadius(t,e){return Math.pow(t,2)/(11.26*Math.tan(e*Avionics.Utils.DEG2RAD))/3.2808399}static bankAngle(t,e){const i=.51444444*t;return Math.atan(Math.pow(i,2)/(9.80665*e))*Avionics.Utils.RAD2DEG}static headingToGroundTrack(t,e,i,s){if(0===s)return t;const r=e*Math.cos(t*Avionics.Utils.DEG2RAD)-s*Math.cos(i*Avionics.Utils.DEG2RAD),n=e*Math.sin(t*Avionics.Utils.DEG2RAD)-s*Math.sin(i*Avionics.Utils.DEG2RAD);return 0===r&&0===n?NaN:mi.normalizeAngleDeg(Math.atan2(n,r)*Avionics.Utils.RAD2DEG)}static getTurnDirection(t,e){return Li.normalizeHeading(e-t)>180?"left":"right"}static polarToDegreesNorth(t){return Li.normalizeHeading(180/Math.PI*(Math.PI/2-t))}static degreesNorthToPolar(t){return Li.normalizeHeading(t-90)/(180/Math.PI)}static calculateArcDistance(t,e,i){const s=(e-t+360)%360*Avionics.Utils.DEG2RAD,r=gi.GA_RADIAN.convertTo(1,gi.METER);return s*Math.sin(i/r)*r}static circleIntersection(t,e,i,s,r,n,a,o){const c=i-t,h=s-e,l=c*c+h*h,u=2*(c*(t-r)+h*(e-n)),d=u*u-4*l*((t-r)*(t-r)+(e-n)*(e-n)-a*a);if(l<1e-7||d<0)return o.x1=NaN,o.x2=NaN,o.y1=NaN,o.y2=NaN,0;if(0==d){const i=-u/(2*l);return o.x1=t+i*c,o.y1=e+i*h,o.x2=NaN,o.y2=NaN,1}{const i=(-u+Math.sqrt(d))/(2*l);o.x1=t+i*c,o.y1=e+i*h;const s=(-u-Math.sqrt(d))/(2*l);return o.x2=t+s*c,o.y2=e+s*h,2}}static northAngle(t,e,i,s){return Li.polarToDegreesNorth(Math.atan2(s-e,i-t))}static bearingIsBetween(t,e,i){const s=this.normalizeHeading(i-e),r=this.normalizeHeading(t-e);return r>=0&&r<=s}static headingToAngle(t,e){return Li.normalizeHeading(t+("left"===e?90:-90))}static angleToHeading(t,e){return Li.normalizeHeading(t+("left"===e?-90:90))}static windCorrectionAngle(t,e,i,s){const r=s*Math.sin(t*Math.PI/180-i*Math.PI/180);return 180*Math.asin(r/e)/Math.PI}static crossTrack(t,e,i){const s=Li.geoCircleCache[0].setAsGreatCircle(t,e);return isNaN(s.center[0])?NaN:gi.GA_RADIAN.convertTo(s.distance(i),gi.NMILE)}static alongTrack(t,e,i){const s=Li.geoCircleCache[0].setAsGreatCircle(t,e);if(isNaN(s.center[0]))return NaN;const r=s.distanceAlong(t,s.closest(i,Li.vec3Cache[0]));return gi.GA_RADIAN.convertTo((r+Math.PI)%(2*Math.PI)-Math.PI,gi.NMILE)}static desiredTrack(t,e,i){const s=Li.geoCircleCache[0].setAsGreatCircle(t,e);return isNaN(s.center[0])?NaN:s.bearingAt(s.closest(i,Li.vec3Cache[0]))}static desiredTrackArc(t,e,i){const s=Li.geoPointCache[0].set(i).bearingFrom(t);return Li.angleToHeading(s,e)}static percentAlongTrackArc(t,e,i,s,r){const n="right"===s?1:-1,a=((e-t)*n+360)%360;return((Li.geoPointCache[0].set(i).bearingTo(r)-(t+a/2*n+360)%360+540)%360-180)*n/a+.5}static positionAlongArc(t,e,i,s,r,n){const a=gi.GA_RADIAN.convertTo(Math.sin(gi.METER.convertTo(i,gi.GA_RADIAN)),gi.METER),o=gi.RADIAN.convertTo(r/a,gi.DEGREE),c="right"===s?t+o:t-o;return e.offset(Li.normalizeHeading(c),gi.METER.convertTo(i,gi.GA_RADIAN),n),n}static crossTrackArc(t,e,i){return gi.METER.convertTo(e,gi.NMILE)-gi.GA_RADIAN.convertTo(Li.geoPointCache[0].set(i).distance(t),gi.NMILE)}static diffAngle(t,e){let i=e-t;for(;i>180;)i-=360;for(;i<=-180;)i+=360;return i}static napierSide(t,e,i,s){return 2*Math.atan(Math.tan(.5*(t-e))*(Math.sin(.5*(i+s))/Math.sin(.5*(i-s))))}static normal(t,e,i){const s=Li.headingToAngle(t,e),r=Li.degreesNorthToPolar(s);i[0]=Math.cos(r),i[1]=Math.sin(r)}}Li.vec3Cache=[new Float64Array(3)],Li.geoPointCache=[new Di(0,0),new Di(0,0)],Li.geoCircleCache=[new Mi(new Float64Array(3),0)];class Oi{static get(t,e){return Oi.getMagVar(t,e)}static magneticToTrue(t,e,i){return Li.normalizeHeading(t+("number"==typeof e&&void 0===i?e:Oi.getMagVar(e,i)))}static trueToMagnetic(t,e,i){return Li.normalizeHeading(t-("number"==typeof e&&void 0===i?e:Oi.getMagVar(e,i)))}static getMagVar(t,e){if("undefined"==typeof Facilities)return 0;let i,s;return"number"==typeof t?(i=t,s=e):(i=t.lat,s=t.lon),Facilities.getMagVar(i,s)}}!function(t){t[t.None=2]="None",t[t.Rain=4]="Rain",t[t.Snow=8]="Snow"}(C||(C={}));class Vi extends ii{constructor(t,e){const i=[["anti_ice_engine_switch_on",{name:"ENG ANTI ICE",type:l.Bool}],["anti_ice_prop_switch_on",{name:"PROP DEICE SWITCH",type:l.Bool}]],s=new Map(Vi.nonIndexedSimVars),r=SimVar.GetSimVarValue("NUMBER OF ENGINES",l.Number);for(const[t,e]of i)for(let i=1;i<=r;i++)s.set(`${t}_${i}`,{name:`${e.name}:${i}`,type:e.type,map:e.map});super(s,t,e)}}Vi.nonIndexedSimVars=[["anti_ice_structural_switch_on",{name:"STRUCTURAL DEICE SWITCH",type:l.Bool}],["anti_ice_windshield_switch_on",{name:"WINDSHIELD DEICE SWITCH",type:l.Bool}],["anti_ice_structural_ice_pct",{name:"STRUCTURAL ICE PCT",type:l.Percent}]],function(t){t[t.Heading=0]="Heading",t[t.Nav=1]="Nav",t[t.Alt=2]="Alt",t[t.Bank=3]="Bank",t[t.WingLevel=4]="WingLevel",t[t.Vs=5]="Vs",t[t.Flc=6]="Flc",t[t.Pitch=7]="Pitch",t[t.Approach=8]="Approach",t[t.Backcourse=9]="Backcourse",t[t.Glideslope=10]="Glideslope",t[t.VNav=11]="VNav"}(E||(E={}));class Ui extends ii{constructor(t,e=void 0){super(Ui.simvars,t,e)}}Ui.simvars=new Map([["ap_master_status",{name:"AUTOPILOT MASTER",type:l.Bool}],["ap_yd_status",{name:"AUTOPILOT YAW DAMPER",type:l.Bool}],["ap_disengage_status",{name:"AUTOPILOT DISENGAGED",type:l.Bool}],["ap_heading_hold",{name:"AUTOPILOT HEADING LOCK",type:l.Bool}],["ap_nav_hold",{name:"AUTOPILOT NAV1 LOCK",type:l.Bool}],["ap_bank_hold",{name:"AUTOPILOT BANK HOLD",type:l.Bool}],["ap_max_bank_id",{name:"AUTOPILOT MAX BANK ID",type:l.Number}],["ap_max_bank_value",{name:"AUTOPILOT MAX BANK",type:l.Degree}],["ap_wing_lvl_hold",{name:"AUTOPILOT WING LEVELER",type:l.Bool}],["ap_approach_hold",{name:"AUTOPILOT APPROACH HOLD",type:l.Bool}],["ap_backcourse_hold",{name:"AUTOPILOT BACKCOURSE HOLD",type:l.Bool}],["ap_vs_hold",{name:"AUTOPILOT VERTICAL HOLD",type:l.Bool}],["ap_flc_hold",{name:"AUTOPILOT FLIGHT LEVEL CHANGE",type:l.Bool}],["ap_alt_hold",{name:"AUTOPILOT ALTITUDE LOCK",type:l.Bool}],["ap_glideslope_hold",{name:"AUTOPILOT GLIDESLOPE HOLD",type:l.Bool}],["ap_pitch_hold",{name:"AUTOPILOT PITCH HOLD",type:l.Bool}],["ap_toga_hold",{name:"AUTOPILOT TAKEOFF POWER ACTIVE",type:l.Bool}],["ap_heading_selected",{name:"AUTOPILOT HEADING LOCK DIR:#index#",type:l.Degree,indexed:!0}],["ap_altitude_selected",{name:"AUTOPILOT ALTITUDE LOCK VAR:#index#",type:l.Feet,indexed:!0}],["ap_pitch_selected",{name:"AUTOPILOT PITCH HOLD REF",type:l.Degree}],["ap_vs_selected",{name:"AUTOPILOT VERTICAL HOLD VAR:#index#",type:l.FPM,indexed:!0}],["ap_fpa_selected",{name:"L:WT_AP_FPA_Target:#index#",type:l.Degree,indexed:!0}],["ap_ias_selected",{name:"AUTOPILOT AIRSPEED HOLD VAR:#index#",type:l.Knots,indexed:!0}],["ap_mach_selected",{name:"AUTOPILOT MACH HOLD VAR:#index#",type:l.Number,indexed:!0}],["ap_selected_speed_is_mach",{name:"AUTOPILOT MANAGED SPEED IN MACH",type:l.Bool}],["ap_selected_speed_is_manual",{name:"L:XMLVAR_SpeedIsManuallySet",type:l.Bool}],["flight_director_bank",{name:"AUTOPILOT FLIGHT DIRECTOR BANK",type:l.Degree}],["flight_director_pitch",{name:"AUTOPILOT FLIGHT DIRECTOR PITCH",type:l.Degree}],["flight_director_is_active_1",{name:"AUTOPILOT FLIGHT DIRECTOR ACTIVE:1",type:l.Bool}],["flight_director_is_active_2",{name:"AUTOPILOT FLIGHT DIRECTOR ACTIVE:2",type:l.Bool}],["vnav_active",{name:"L:XMLVAR_VNAVButtonValue",type:l.Bool}]]),function(t){t[t.OFF=0]="OFF",t[t.TO=1]="TO",t[t.FROM=2]="FROM"}(P||(P={})),function(t){t[t.Inactive=0]="Inactive",t[t.Outer=1]="Outer",t[t.Middle=2]="Middle",t[t.Inner=3]="Inner"}(I||(I={})),function(t){t.Com="COM",t.Nav="NAV",t.Adf="ADF"}(N||(N={})),function(t){t[t.Active=0]="Active",t[t.Standby=1]="Standby"}(F||(F={})),function(t){t[t.Spacing25Khz=0]="Spacing25Khz",t[t.Spacing833Khz=1]="Spacing833Khz"}(w||(w={}));class Gi extends ii{constructor(t,e=void 0){super(Gi.simvars,t,e)}static createNavRadioDefinitions(t){return[[`nav_signal_${t}`,{name:`NAV SIGNAL:${t}`,type:l.Number}],[`nav_obs_${t}`,{name:`NAV OBS:${t}`,type:l.Degree}],[`nav_has_dme_${t}`,{name:`NAV HAS DME:${t}`,type:l.Bool}],[`nav_has_nav_${t}`,{name:`NAV HAS NAV:${t}`,type:l.Bool}],[`nav_cdi_${t}`,{name:`NAV CDI:${t}`,type:l.Number}],[`nav_dme_${t}`,{name:`NAV DME:${t}`,type:l.NM}],[`nav_radial_${t}`,{name:`NAV RADIAL:${t}`,type:l.Degree}],[`nav_radial_error_${t}`,{name:`NAV RADIAL ERROR:${t}`,type:l.Degree}],[`nav_ident_${t}`,{name:`NAV IDENT:${t}`,type:l.String}],[`nav_to_from_${t}`,{name:`NAV TOFROM:${t}`,type:l.Enum}],[`nav_localizer_${t}`,{name:`NAV HAS LOCALIZER:${t}`,type:l.Bool}],[`nav_localizer_crs_${t}`,{name:`NAV LOCALIZER:${t}`,type:l.Number}],[`nav_loc_airport_ident_${t}`,{name:`NAV LOC AIRPORT IDENT:${t}`,type:l.String}],[`nav_loc_runway_designator_${t}`,{name:`NAV LOC RUNWAY DESIGNATOR:${t}`,type:l.Number}],[`nav_loc_runway_number_${t}`,{name:`NAV LOC RUNWAY NUMBER:${t}`,type:l.Number}],[`nav_glideslope_${t}`,{name:`NAV HAS GLIDE SLOPE:${t}`,type:l.Bool}],[`nav_gs_error_${t}`,{name:`NAV GLIDE SLOPE ERROR:${t}`,type:l.Degree}],[`nav_raw_gs_${t}`,{name:`NAV RAW GLIDE SLOPE:${t}`,type:l.Degree}],[`nav_lla_${t}`,{name:`NAV VOR LATLONALT:${t}`,type:l.LLA}],[`nav_dme_lla_${t}`,{name:`NAV DME LATLONALT:${t}`,type:l.LLA}],[`nav_gs_lla_${t}`,{name:`NAV GS LATLONALT:${t}`,type:l.LLA}],[`nav_magvar_${t}`,{name:`NAV MAGVAR:${t}`,type:l.Degree}]]}static createAdfRadioDefinitions(t){return[[`adf_signal_${t}`,{name:`ADF SIGNAL:${t}`,type:l.Number}],[`adf_bearing_${t}`,{name:`ADF RADIAL:${t}`,type:l.Degree}],[`adf_lla_${t}`,{name:`ADF LATLONALT:${t}`,type:l.LLA}]]}}Gi.simvars=new Map([...Gi.createNavRadioDefinitions(1),...Gi.createNavRadioDefinitions(2),...Gi.createNavRadioDefinitions(3),...Gi.createNavRadioDefinitions(4),...Gi.createAdfRadioDefinitions(1),...Gi.createAdfRadioDefinitions(2),["gps_dtk",{name:"GPS WP DESIRED TRACK",type:l.Degree}],["gps_xtk",{name:"GPS WP CROSS TRK",type:l.NM}],["gps_wp",{name:"GPS WP NEXT ID",type:l.NM}],["gps_wp_bearing",{name:"GPS WP BEARING",type:l.Degree}],["gps_wp_distance",{name:"GPS WP DISTANCE",type:l.NM}],["mkr_bcn_state_simvar",{name:"MARKER BEACON STATE",type:l.Number}],["gps_obs_active_simvar",{name:"GPS OBS ACTIVE",type:l.Bool}],["gps_obs_value_simvar",{name:"GPS OBS VALUE",type:l.Degree}]]),function(t){t[t.Nav=0]="Nav",t[t.Gps=1]="Gps",t[t.Adf=2]="Adf"}(D||(D={})),function(t){t[t.Piston=0]="Piston",t[t.Jet=1]="Jet",t[t.None=2]="None",t[t.HeloTurbine=3]="HeloTurbine",t[t.Unsupported=4]="Unsupported",t[t.Turboprop=5]="Turboprop"}(M||(M={})),function(t){t[t.CountingDown=0]="CountingDown",t[t.CountingUp=1]="CountingUp"}(L||(L={})),function(t){t[t.None=0]="None",t[t.Gated=1]="Gated",t[t.Raw=2]="Raw",t[t.True=4]="True",t[t.Magnetic=8]="Magnetic"}(O||(O={})),function(t){t.Added="Added",t.Deleted="Deleted"}(V||(V={})),function(t){t.WAAS="WAAS",t.EGNOS="EGNOS",t.GAGAN="GAGAN",t.MSAS="MSAS"}(U||(U={})),function(t){t[t.None=0]="None",t[t.Unreachable=1]="Unreachable",t[t.Acquired=2]="Acquired",t[t.Faulty=3]="Faulty",t[t.DataCollected=4]="DataCollected",t[t.InUse=5]="InUse",t[t.InUseDiffApplied=6]="InUseDiffApplied"}(G||(G={})),function(t){t.Searching="Searching",t.Acquiring="Acquiring",t.SolutionAcquired="SolutionAcquired",t.DiffSolutionAcquired="DiffSolutionAcquired"}(x||(x={})),function(t){t.Disabled="Disabled",t.Inactive="Inactive",t.Active="Active"}(k||(k={})),new Set([G.DataCollected,G.InUse,G.InUseDiffApplied]),new Set([G.Acquired,G.DataCollected,G.InUse,G.InUseDiffApplied]),function(t){t[t.OFF=0]="OFF",t[t.BARO=1]="BARO",t[t.RA=2]="RA",t[t.TEMP_COMP_BARO=3]="TEMP_COMP_BARO"}(H||(H={}));class xi extends ii{constructor(t){super(xi.simvars,t)}}xi.simvars=new Map([["decision_height_feet",{name:"DECISION HEIGHT",type:l.Feet}],["decision_altitude_feet",{name:"DECISION ALTITUDE MSL",type:l.Feet}],["minimums_mode",{name:"L:WT_MINIMUMS_MODE",type:l.Number}]]);class ki extends ii{constructor(t,e,i){const s=[["pitot_heat_switch_on",{name:"PITOT HEAT SWITCH",type:l.Bool}]],r=new Map(ki.nonIndexedSimVars);for(const[t,i]of s)for(let s=1;s<=e;s++)r.set(`${t}_${s}`,{name:`${i.name}:${s}`,type:i.type,map:i.map});super(r,t,i)}}ki.nonIndexedSimVars=[["pitot_heat_on",{name:"PITOT HEAT",type:l.Bool}],["pitot_icing_pct",{name:"PITOT ICE PCT",type:l.Percent}]];class Hi extends ii{onUpdate(){super.onUpdate()}constructor(t,e=void 0){super(Hi.simvars,t,e)}}Hi.simvars=new Map([["cabin_altitude",{name:"PRESSURIZATION CABIN ALTITUDE",type:l.Feet}],["cabin_altitude_rate",{name:"PRESSURIZATION CABIN ALTITUDE RATE",type:l.FPM}],["pressure_diff",{name:"PRESSURIZATION PRESSURE DIFFERENTIAL",type:l.PSI}]]);class Bi{constructor(){this.timer=null}isPending(){return null!==this.timer}schedule(t,e){this.clear(),this.timer=setTimeout((()=>{this.timer=null,t()}),e)}clear(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)}}!function(t){t[t.OFF=0]="OFF",t[t.STBY=1]="STBY",t[t.TEST=2]="TEST",t[t.ON=3]="ON",t[t.ALT=4]="ALT",t[t.GROUND=5]="GROUND"}(B||(B={})),new Di(0,0),function(t){t[t.Warning=0]="Warning",t[t.Caution=1]="Caution",t[t.Advisory=2]="Advisory",t[t.SafeOp=3]="SafeOp"}(W||(W={})),function(t){t.Added="Added",t.Removed="Removed",t.Cleared="Cleared"}($||($={}));class Wi{constructor(){this.notifyDepth=0,this.initialNotifyFunc=this.initialNotify.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}sub(e,i=!1,s=!1){const r=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(r),s?r.pause():i&&r.initialNotify(),r}get(t){const e=this.getArray();if(t>e.length-1)throw new Error("Index out of range");return e[t]}tryGet(t){return this.getArray()[t]}notify(t,e,i){const s=0===this.notifyDepth;let r=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isAlive&&!this.singletonSub.isPaused&&this.singletonSub.handler(t,e,i,this.getArray())}catch(t){console.error(`AbstractSubscribableArray: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(s)if(this.singletonSub)r=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}initialNotify(t){const e=this.getArray();t.handler(0,$.Added,e,e)}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}}class $i extends Wi{get length(){return this.array.length}constructor(t){super(),this.array=t}static create(t=[]){return new $i(t)}insert(t,e){void 0===e||e>this.array.length-1?(e=this.array.length,this.array.push(t)):this.array.splice(e,0,t),this.notify(e,$.Added,t)}insertRange(t=0,e){this.array.splice(t,0,...e),this.notify(t,$.Added,e)}removeAt(t){const e=this.array.splice(t,1);this.notify(t,$.Removed,e[0])}removeItem(t){const e=this.array.indexOf(t);return e>-1&&(this.removeAt(e),!0)}set(t){this.clear(),this.insertRange(0,t)}clear(){this.array.length=0,this.notify(0,$.Cleared)}getArray(){return this.array}}class ji{constructor(t){this.obj=t,this.isSubscribable=!0,this.isMutableSubscribable=!0,this.subs=[],this.notifyDepth=0,this.initialNotifyFunc=this.initialNotify.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}static create(t){return new ji(t)}get(){return this.obj}sub(e,i=!1,s=!1){const r=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.addSubscription(r),s?r.pause():i&&r.initialNotify(),r}addSubscription(t){this.subs?this.subs.push(t):this.singletonSub?(this.subs=[this.singletonSub,t],delete this.singletonSub):this.singletonSub=t}set(t,e){if("object"==typeof t)for(const e in t)e in this.obj&&this.set(e,t[e]);else{const i=this.obj[t];e!==i&&(this.obj[t]=e,this.notify(t,i))}}notify(t,e){const i=0===this.notifyDepth;let s=!1;if(this.notifyDepth++,this.singletonSub){try{this.singletonSub.isAlive&&!this.singletonSub.isPaused&&this.singletonSub.handler(this.obj,t,this.obj[t],e)}catch(t){console.error(`ObjectSubject: error in handler: ${t}`),t instanceof Error&&console.error(t.stack)}if(i)if(this.singletonSub)s=!this.singletonSub.isAlive;else if(this.subs)for(let t=0;tt.isAlive))))}initialNotify(t){for(const e in this.obj){const i=this.obj[e];t.handler(this.obj,e,i,i)}}onSubDestroyed(t){if(0===this.notifyDepth)if(this.singletonSub===t)delete this.singletonSub;else if(this.subs){const e=this.subs.indexOf(t);e>=0&&this.subs.splice(e,1)}}map(t,e,i,s){const r=(e,i)=>t(e[0],i);return i?bi.create(r,e,i,s,this):bi.create(r,null!=e?e:ri.DEFAULT_EQUALITY_FUNC,this)}pipe(t,e,i){let s,r;return"function"==typeof e?(s=new si(this,t,e,this.onSubDestroyedFunc),r=null!=i&&i):(s=new si(this,t,this.onSubDestroyedFunc),r=null!=e&&e),this.subs.push(s),r?s.pause():s.initialNotify(),s}}!function(t){t.Added="Added",t.Changed="Changed",t.Deleted="Deleted"}(j||(j={})),function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.In=2]="In"}(Y||(Y={}));class Yi{constructor(t){this.context=void 0,this.contextType=void 0,this.props=t}onBeforeRender(){}onAfterRender(t){}destroy(){}getContext(t){if(void 0!==this.context&&void 0!==this.contextType){const e=this.contextType.indexOf(t);return this.context[e]}throw new Error("Could not find the provided context type.")}}class zi{constructor(){this._instance=null}get instance(){if(null!==this._instance)return this._instance;throw new Error("Instance was null.")}set instance(t){this._instance=t}getOrDefault(){return this._instance}}class qi{constructor(t){this.defaultValue=t,this.Provider=t=>new Xi(t,this)}}class Xi extends Yi{constructor(t,e){super(t),this.parent=e}render(){var t;const e=null!==(t=this.props.children)&&void 0!==t?t:[];return z.buildComponent(z.Fragment,this.props,...e)}}!function(t){const e={circle:!0,clipPath:!0,"color-profile":!0,cursor:!0,defs:!0,desc:!0,ellipse:!0,g:!0,image:!0,line:!0,linearGradient:!0,marker:!0,mask:!0,path:!0,pattern:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,svg:!0,text:!0,tspan:!0};function i(t){return t.children}function s(t){return t.startsWith("xlink:")?"http://www.w3.org/1999/xlink":null}function r(t,e){let i=null;if(null!=e&&e.length>0){i=[];for(const s of e)if(null!==s)if(s instanceof Array){const e=r(t,s);null!==e&&i.push(...e)}else if("object"==typeof s)if("isSubscribable"in s){const t={instance:s,children:null,props:null,root:void 0};s.sub((e=>{void 0!==t.root&&(t.root.nodeValue=""===e||null==e?" ":e.toString())})),i.push(t)}else i.push(s);else"string"!=typeof s&&"number"!=typeof s||i.push(n(s))}return i}function n(t){return{instance:t,children:null,props:null}}function a(t,e,i=Y.In){if(t.instance instanceof HTMLElement||t.instance instanceof SVGElement)null!==e&&o(t,i,e);else if(t.children&&t.children.length>0&&null!==e){const s=t.instance;if(null!==s&&void 0!==s.onBeforeRender&&s.onBeforeRender(),i===Y.After)for(let s=t.children.length-1;s>=0;s--)void 0!==t.children[s]&&null!==t.children[s]&&o(t.children[s],i,e);else for(let s=0;s{if(null==t)return!1;const e=t.instance;if(null!==e&&void 0!==e.contextType){const t=e.contextType.indexOf(r.parent);if(t>=0&&(void 0===e.context&&(e.context=[]),e.context[t].set(r.props.value)),e instanceof Xi&&e!==r&&e.parent===r.parent)return!0}return!1})),null!==s&&void 0!==s.onAfterRender){const e=window._pluginSystem;s.onAfterRender(t),void 0!==e&&e.onComponentRendered(t)}}}function o(t,e,i){var s,r,n,c,h,l;if(t.instance instanceof HTMLElement||t.instance instanceof SVGElement){switch(e){case Y.In:i.appendChild(t.instance),t.root=null!==(s=i.lastChild)&&void 0!==s?s:void 0;break;case Y.Before:i.insertAdjacentElement("beforebegin",t.instance),t.root=null!==(r=i.previousSibling)&&void 0!==r?r:void 0;break;case Y.After:i.insertAdjacentElement("afterend",t.instance),t.root=null!==(n=i.nextSibling)&&void 0!==n?n:void 0}if(null!==t.children)for(const e of t.children)o(e,Y.In,t.instance)}else if("string"==typeof t.instance||"object"==typeof t.instance&&null!==t.instance&&"isSubscribable"in t.instance){let s;switch("string"==typeof t.instance?s=t.instance:(s=t.instance.get(),""===s&&(s=" ")),e){case Y.In:i.insertAdjacentHTML("beforeend",s),t.root=null!==(c=i.lastChild)&&void 0!==c?c:void 0;break;case Y.Before:i.insertAdjacentHTML("beforebegin",s),t.root=null!==(h=i.previousSibling)&&void 0!==h?h:void 0;break;case Y.After:i.insertAdjacentHTML("afterend",s),t.root=null!==(l=i.nextSibling)&&void 0!==l?l:void 0}}else if(Array.isArray(t))if(e===Y.After)for(let s=t.length-1;s>=0;s--)a(t[s],i,e);else for(let s=0;s{e===V.Added?i.classList.add(s):i.classList.remove(s)}),!0);else if("style"===t&&"object"==typeof e&&"isSubscribableMap"in e)e.sub(((t,e,s,r)=>{switch(e){case j.Added:case j.Changed:i.style.setProperty(s,r);break;case j.Deleted:i.style.setProperty(s,null)}}),!0);else if("object"==typeof e&&"isSubscribable"in e)if("style"===t&&e instanceof ji)e.sub(((t,e,s)=>{i.style.setProperty(e.toString(),s)}),!0);else{const r=s(t);null!==r?e.sub((e=>{i.setAttributeNS(r,t,e)}),!0):e.sub((e=>{i.setAttribute(t,e)}),!0)}else if("class"===t&&"object"==typeof e)for(const t in e){if(0===t.trim().length)continue;const s=e[t];"object"==typeof s&&"isSubscribable"in s?s.sub((e=>{i.classList.toggle(t,!!e)}),!0):i.classList.toggle(t,!!s)}else if("style"===t&&"object"==typeof e)for(const t in e){if(0===t.trim().length)continue;const s=e[t];"object"==typeof s&&"isSubscribable"in s?s.sub((e=>{i.style.setProperty(t,null!=e?e:"")}),!0):i.style.setProperty(t,null!=s?s:"")}else{const r=s(t);null!==r?i.setAttributeNS(r,t,e):i.setAttribute(t,e)}}o={instance:i,props:n,children:null},o.children=r(o,a)}else if("function"==typeof t)if(null!==a&&null===n?n={children:a}:null!==n&&(n.children=a),"function"==typeof t&&t.name===i.name){let e=t(n);for(;e&&1===e.length&&Array.isArray(e[0]);)e=e[0];o={instance:null,props:n,children:null},e&&(o.children=r(o,e))}else{let e;const i=window._pluginSystem;try{e=t(n)}catch(s){let r;void 0!==i&&(r=i.onComponentCreating(t,n)),e=void 0!==r?r:new t(n)}null!==n&&null!==n.ref&&void 0!==n.ref&&(n.ref.instance=e),void 0!==e.contextType&&(e.context=e.contextType.map((t=>ai.create(t.defaultValue)))),void 0!==i&&i.onComponentCreated(e),o={instance:e,props:n,children:[e.render()]}}return o},t.createChildNodes=r,t.createStaticContentNode=n,t.render=a,t.renderBefore=function(t,e){a(t,e,Y.Before)},t.renderAfter=function(t,e){a(t,e,Y.After)},t.remove=function(t){null!==t&&t.remove()},t.createRef=function(){return new zi},t.createContext=function(t){return new qi(t)},t.visitNodes=c,t.parseCssClassesFromString=function(t,e){return t.split(" ").filter((t=>""!==t&&(void 0===e||e(t))))},t.bindCssClassSet=function(t,e,i){const s=new Set(i);return!0===e.isSubscribableSet?function(t,e,i){return 0===i.size?e.sub(((e,i,s)=>{i===V.Added?t.add(s):t.delete(s)}),!0):e.sub(((e,s,r)=>{i.has(r)||(s===V.Added?t.add(r):t.delete(r))}),!0)}(t,e,s):function(t,e,i){const s=[];for(const r in e){if(i.has(r))continue;const n=e[r];"object"==typeof n?s.push(n.sub(t.toggle.bind(t,r),!0)):!0===n?t.add(r):t.delete(r)}return s}(t,e,s)},t.addCssClassesToRecord=function(e,i,s=!0,r){if(""===i)return e;if("string"==typeof i&&(i=t.parseCssClassesFromString(i,r),r=void 0),"function"==typeof i[Symbol.iterator])for(const t of i)!s&&void 0!==e[t]||r&&!r(t)||(e[t]=!0);else for(const t in i)!s&&void 0!==e[t]||r&&!r(t)||(e[t]=i[t]);return e},t.bindStyleMap=function(t,e,i){const s=new Set(i);return!0===e.isSubscribableMap?function(t,e,i){return 0===i.size?e.pipe(t):e.sub(((e,s,r,n)=>{if(!i.has(r))switch(s){case j.Added:case j.Changed:t.setValue(r,n);break;case j.Deleted:t.delete(r)}}),!0)}(t,e,s):e instanceof ji?function(t,e,i){return e.sub(((e,s,r)=>{i.has(s)||(r?t.setValue(s,r):t.delete(s))}),!0)}(t,e,s):function(t,e,i){const s=[];for(const r in e){if(i.has(r))continue;const n=e[r];"object"==typeof n?s.push(n.sub((e=>{e?t.setValue(r,e):t.delete(r)}),!0)):n?t.setValue(r,n):t.delete(r)}return s}(t,e,s)},t.shallowDestroy=function(e){t.visitNodes(e,(t=>t!==e&&t.instance instanceof Yi&&(t.instance.destroy(),!0)))},t.EmptyHandler=()=>{}}(z||(z={})),z.Fragment;class Ki extends Yi{constructor(){var t,e,i,s,r,n,a,o;super(...arguments),this.bingFlags=this.getBingFlags(EBingReference.SEA),this.isListenerRegistered=!1,this.imgRef=z.createRef(),this.uid=0,this._isBound=!1,this._isAwake=!0,this.isDestroyed=!1,this.pos=new LatLong(0,0),this.radius=10,this.resolution=null!==(t=this.props.resolution)&&void 0!==t?t:Pi.create(Ti.create(Ki.DEFAULT_RESOLUTION,Ki.DEFAULT_RESOLUTION)),this.earthColors=null!==(e=this.props.earthColors)&&void 0!==e?e:$i.create(Ni.create(2,(()=>Ki.hexaToRGBColor("#000000")))),this.earthColorsElevationRange=null!==(i=this.props.earthColorsElevationRange)&&void 0!==i?i:Pi.create(Ti.create(0,3e4)),this.skyColor=null!==(s=this.props.skyColor)&&void 0!==s?s:ai.create(Ki.hexaToRGBColor("#000000")),this.reference=null!==(r=this.props.reference)&&void 0!==r?r:ai.create(EBingReference.SEA),this.wxrMode=null!==(n=this.props.wxrMode)&&void 0!==n?n:ai.create({mode:EWeatherRadar.OFF,arcRadians:.5}),this.wxrColors=null!==(a=this.props.wxrColors)&&void 0!==a?a:$i.create(Array.from(Ki.DEFAULT_WEATHER_COLORS)),this.isoLines=null!==(o=this.props.isoLines)&&void 0!==o?o:ai.create(!1),this.wxrColorsArray=[],this.wxrRateArray=[],this.resolutionHandler=t=>{Coherent.call("SET_MAP_RESOLUTION",this.uid,t[0],t[1]),this.positionRadiusInhibitFramesRemaining=Ki.POSITION_RADIUS_INHIBIT_FRAMES,this.positionRadiusInhibitTimer.isPending()||this.positionRadiusInhibitTimer.schedule(this.processPendingPositionRadius,0)},this.earthColorsHandler=()=>{const t=this.earthColors.getArray();t.length<2||Coherent.call("SET_MAP_HEIGHT_COLORS",this.uid,t)},this.earthColorsElevationRangeHandler=()=>{const t=this.earthColors.getArray();if(t.length<2)return;const e=this.earthColorsElevationRange.get(),i=t.length-1,s=(e[1]-e[0])/Math.max(i-1,1),r=e[0]-s,n=e[1]+s;Coherent.call("SET_MAP_ALTITUDE_RANGE",this.uid,r,n)},this.skyColorHandler=t=>{Coherent.call("SET_MAP_CLEAR_COLOR",this.uid,t)},this.referenceHandler=t=>{this.bingFlags=this.getBingFlags(t),this.mapListener.trigger("JS_BIND_BINGMAP",this.props.id,this.bingFlags)},this.wxrModeHandler=t=>{Coherent.call("SHOW_MAP_WEATHER",this.uid,t.mode,t.arcRadians)},this.wxrColorsHandler=()=>{const t=this.wxrColors.getArray();if(0!==t.length){this.wxrColorsArray.length=t.length,this.wxrRateArray.length=t.length;for(let e=0;e{Coherent.call("SHOW_MAP_ISOLINES",this.uid,t)},this.setCurrentMapParamsTimer=null,this.positionRadiusInhibitFramesRemaining=0,this.isPositionRadiusPending=!1,this.positionRadiusInhibitTimer=new Bi,this.processPendingPositionRadius=()=>{this.isPositionRadiusPending&&Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius),--this.positionRadiusInhibitFramesRemaining>0?this.positionRadiusInhibitTimer.schedule(this.processPendingPositionRadius,0):this.isPositionRadiusPending=!1},this.onMapBound=(t,e)=>{if(!this.isDestroyed&&t.friendlyName===this.props.id){if(this.binder=t,this.uid=e,this._isBound)return;this._isBound=!0,Coherent.call("SHOW_MAP",e,!0);const i=!this._isAwake;this.earthColorsSub=this.earthColors.sub((()=>{this.earthColorsHandler(),this.earthColorsElevationRangeHandler()}),!0,i),this.earthColorsElevationRangeSub=this.earthColorsElevationRange.sub(this.earthColorsElevationRangeHandler,!0,i),this.skyColorSub=this.skyColor.sub(this.skyColorHandler,!0,i),this.referenceSub=this.reference.sub(this.referenceHandler,!0,i),this.wxrModeSub=this.wxrMode.sub(this.wxrModeHandler,!0,i),this.wxrColorsSub=this.wxrColors.sub(this.wxrColorsHandler,!0,i),this.resolutionSub=this.resolution.sub(this.resolutionHandler,!0,i),this.isoLinesSub=this.isoLines.sub(this.isoLinesHandler,!0,i),Ai.isAll(this.bingFlags,BingMapsFlags.FL_BINGMAP_3D)||Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius),this.props.onBoundCallback&&this.props.onBoundCallback(this)}},this.onMapUpdate=(t,e)=>{void 0!==this.binder&&this.uid===t&&null!==this.imgRef.instance&&this.imgRef.instance.src!==e&&(this.imgRef.instance.src=e)},this.setCurrentMapParams=()=>{this.setPositionRadius(this.pos,this.radius)}}isBound(){return this._isBound}isAwake(){return this._isAwake}onAfterRender(){if(window.IsDestroying)return void this.destroy();const t=oi.get(),e=t.get();e===GameState.briefing||e===GameState.ingame?this.registerListener():this.gameStateSub=t.sub((t=>{var e;this.isDestroyed||t!==GameState.briefing&&t!==GameState.ingame||(null===(e=this.gameStateSub)||void 0===e||e.destroy(),this.registerListener())})),window.addEventListener("OnDestroy",this.destroy.bind(this))}registerListener(){var t;(null!==(t=this.props.delay)&&void 0!==t?t:0)>0?setTimeout((()=>{this.isDestroyed||(this.mapListener=RegisterViewListener("JS_LISTENER_MAPS",this.onListenerRegistered.bind(this)))}),this.props.delay):this.mapListener=RegisterViewListener("JS_LISTENER_MAPS",this.onListenerRegistered.bind(this))}onListenerRegistered(){this.isDestroyed||this.isListenerRegistered||(this.mapListener.on("MapBinded",this.onMapBound),this.mapListener.on("MapUpdated",this.onMapUpdate),this.isListenerRegistered=!0,this.mapListener.trigger("JS_BIND_BINGMAP",this.props.id,this.bingFlags))}getBingFlags(t){let e=0;return this.props.mode===EBingMode.HORIZON?e|=BingMapsFlags.FL_BINGMAP_3D:this.props.mode===EBingMode.TOPVIEW&&(e|=BingMapsFlags.FL_BINGMAP_3D|BingMapsFlags.FL_BINGMAP_3D_TOPVIEW),t===EBingReference.PLANE?e|=BingMapsFlags.FL_BINGMAP_REF_PLANE:t===EBingReference.AERIAL&&(e|=BingMapsFlags.FL_BINGMAP_REF_AERIAL),e}wake(){var t,e,i,s,r,n,a,o;this._isAwake=!0,this._isBound&&(this.setCurrentMapParams(),Ai.isAll(this.bingFlags,BingMapsFlags.FL_BINGMAP_3D)||(this.setCurrentMapParamsTimer=setInterval(this.setCurrentMapParams,200)),null===(t=this.earthColorsSub)||void 0===t||t.resume(!0),null===(e=this.earthColorsElevationRangeSub)||void 0===e||e.resume(!0),null===(i=this.skyColorSub)||void 0===i||i.resume(!0),null===(s=this.referenceSub)||void 0===s||s.resume(!0),null===(r=this.wxrModeSub)||void 0===r||r.resume(!0),null===(n=this.wxrColorsSub)||void 0===n||n.resume(!0),null===(a=this.resolutionSub)||void 0===a||a.resume(!0),null===(o=this.isoLinesSub)||void 0===o||o.resume(!0))}sleep(){var t,e,i,s,r,n,a,o;this._isAwake=!1,this._isBound&&(null!==this.setCurrentMapParamsTimer&&clearInterval(this.setCurrentMapParamsTimer),null===(t=this.earthColorsSub)||void 0===t||t.pause(),null===(e=this.earthColorsElevationRangeSub)||void 0===e||e.pause(),null===(i=this.skyColorSub)||void 0===i||i.pause(),null===(s=this.referenceSub)||void 0===s||s.pause(),null===(r=this.wxrModeSub)||void 0===r||r.pause(),null===(n=this.wxrColorsSub)||void 0===n||n.pause(),null===(a=this.resolutionSub)||void 0===a||a.pause(),null===(o=this.isoLinesSub)||void 0===o||o.pause())}setPositionRadius(t,e){this.pos=t,this.radius=Math.max(e,10),this._isBound&&this._isAwake&&(this.positionRadiusInhibitFramesRemaining>0?this.isPositionRadiusPending=!0:Coherent.call("SET_MAP_PARAMS",this.uid,this.pos,this.radius))}render(){var t;return z.buildComponent("img",{ref:this.imgRef,src:"",style:"position: absolute; left: 0; top: 0; width: 100%; height: 100%;",class:null!==(t=this.props.class)&&void 0!==t?t:""})}destroy(){var t,e,i,s,r,n,a,o,c,h,l,u,d;this.isDestroyed=!0,this._isBound=!1,null!==this.setCurrentMapParamsTimer&&clearInterval(this.setCurrentMapParamsTimer),null===(t=this.gameStateSub)||void 0===t||t.destroy(),null===(e=this.earthColorsSub)||void 0===e||e.destroy(),null===(i=this.earthColorsElevationRangeSub)||void 0===i||i.destroy(),null===(s=this.skyColorSub)||void 0===s||s.destroy(),null===(r=this.referenceSub)||void 0===r||r.destroy(),null===(n=this.wxrModeSub)||void 0===n||n.destroy(),null===(a=this.wxrColorsSub)||void 0===a||a.destroy(),null===(o=this.resolutionSub)||void 0===o||o.destroy(),null===(c=this.isoLinesSub)||void 0===c||c.destroy(),null===(h=this.mapListener)||void 0===h||h.off("MapBinded",this.onMapBound),null===(l=this.mapListener)||void 0===l||l.off("MapUpdated",this.onMapUpdate),this.props.skipUnbindOnDestroy||null===(u=this.mapListener)||void 0===u||u.trigger("JS_UNBIND_BINGMAP",this.props.id),this.isListenerRegistered=!1,this.imgRef.instance.src="",null===(d=this.imgRef.instance.parentNode)||void 0===d||d.removeChild(this.imgRef.instance),super.destroy()}resetImgSrc(){const t=this.imgRef.getOrDefault();if(null!==t){const e=t.src;t.src="",t.src=e}}static hexaToRGBColor(t){const e=t;let i=0;"#"===e[0]&&(i=1);const s=parseInt(e.substr(0+i,2),16),r=parseInt(e.substr(2+i,2),16),n=parseInt(e.substr(4+i,2),16);return Ki.rgbColor(s,r,n)}static rgbToHexaColor(t,e=!0){const i=Math.floor(t%16777216/65536),s=Math.floor(t%65536/256);return`${e?"#":""}${(t%256).toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}static rgbColor(t,e,i){return 65536*i+256*e+t}static hexaToRGBAColor(t){const e=t;let i=0;"#"===e[0]&&(i=1);const s=parseInt(e.substr(0+i,2),16),r=parseInt(e.substr(2+i,2),16),n=parseInt(e.substr(4+i,2),16),a=parseInt(e.substr(6+i,2),16);return Ki.rgbaColor(s,r,n,a)}static rgbaToHexaColor(t,e=!0){const i=Math.floor(t%4294967296/16777216),s=Math.floor(t%16777216/65536),r=Math.floor(t%65536/256);return`${e?"#":""}${(t%256).toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}static rgbaColor(t,e,i,s){return 16777216*s+65536*i+256*e+t}static createEarthColorsArray(t,e,i=0,s=3e4,r=61){const n=[Ki.hexaToRGBColor(t)],a=new Avionics.Curve;a.interpolationFunction=Avionics.CurveTool.StringColorRGBInterpolation;for(let t=0;tt.toFixed(0),unitFormatter:(t,e)=>e.name[0],useMinusSign:!1,forceSign:!1,nanString:""},function(t){t.NORTH="N",t.SOUTH="S",t.WEST="W",t.EAST="E"}(K||(K={})),function(t){t.MostRecent="MostRecent",t.First="First",t.Last="Last",t.None="None"}(Q||(Q={})),function(t){t.First="First",t.Last="Last",t.Next="Next",t.Prev="Prev",t.None="None"}(Z||(Z={}));class Zi{constructor(){this.subs=[],this.notifyDepth=0,this.onSubDestroyedFunc=this.onSubDestroyed.bind(this)}on(e,i=!1){const s=new t(e,void 0,this.onSubDestroyedFunc);return this.subs.push(s),i&&s.pause(),s}clear(){this.notifyDepth++;for(let t=0;tt.isAlive)))}onSubDestroyed(t){0===this.notifyDepth&&this.subs.splice(this.subs.indexOf(t),1)}}!function(t){t[t.Position=1]="Position",t[t.Altitude=2]="Altitude",t[t.Heading=4]="Heading",t[t.Pitch=8]="Pitch",t[t.Roll=16]="Roll",t[t.Offset=32]="Offset",t[t.ProjectedSize=64]="ProjectedSize",t[t.Fov=128]="Fov",t[t.FovEndpoints=256]="FovEndpoints",t[t.PitchScaleFactor=512]="PitchScaleFactor",t[t.HeadingScaleFactor=1024]="HeadingScaleFactor",t[t.ScaleFactor=2048]="ScaleFactor",t[t.ProjectedOffset=4096]="ProjectedOffset",t[t.OffsetCenterProjected=8192]="OffsetCenterProjected"}(J||(J={})),J.PitchScaleFactor,J.HeadingScaleFactor,Ti.create(),Ri.create(),new Di(0,0),Ri.create(),Ri.create(),function(t){t.Airport="APT",t.Intersection="INT",t.VOR="VOR",t.NDB="NDB",t.USR="USR",t.RWY="RWY",t.VIS="VIS"}(tt||(tt={})),function(t){t[t.None=0]="None",t[t.ATIS=1]="ATIS",t[t.Multicom=2]="Multicom",t[t.Unicom=3]="Unicom",t[t.CTAF=4]="CTAF",t[t.Ground=5]="Ground",t[t.Tower=6]="Tower",t[t.Clearance=7]="Clearance",t[t.Approach=8]="Approach",t[t.Departure=9]="Departure",t[t.Center=10]="Center",t[t.FSS=11]="FSS",t[t.AWOS=12]="AWOS",t[t.ASOS=13]="ASOS",t[t.CPT=14]="CPT",t[t.GCO=15]="GCO"}(et||(et={})),function(t){t[t.None=0]="None",t[t.Cat1=1]="Cat1",t[t.Cat2=2]="Cat2",t[t.Cat3=3]="Cat3",t[t.Localizer=4]="Localizer",t[t.Igs=5]="Igs",t[t.LdaNoGs=6]="LdaNoGs",t[t.LdaWithGs=7]="LdaWithGs",t[t.SdfNoGs=8]="SdfNoGs",t[t.SdfWithGs=9]="SdfWithGs"}(it||(it={})),function(t){t[t.APPROACH_TYPE_VISUAL=99]="APPROACH_TYPE_VISUAL"}(st||(st={})),function(t){t.Undefined="",t.Gps="GPS",t.Vor="VOR",t.Ndb="NDB",t.Ils="ILS",t.Loc="LOC",t.Sdf="SDF",t.Lda="LDA",t.VorDme="VORDME",t.NdbDme="NDBDME",t.Rnav="RNAV",t.LocBackcourse="BLOC",t.GeneratedVisual="GENVIS"}(rt||(rt={})),function(t){t[t.None=0]="None",t[t.IAF=1]="IAF",t[t.IF=2]="IF",t[t.MAP=4]="MAP",t[t.FAF=8]="FAF",t[t.MAHP=16]="MAHP"}(nt||(nt={})),function(t){t[t.None=0]="None",t[t.LNAV=1]="LNAV",t[t.LNAVVNAV=2]="LNAVVNAV",t[t.LP=4]="LP",t[t.LPV=8]="LPV"}(at||(at={})),function(t){t[t.Minimal=0]="Minimal",t[t.Approaches=1]="Approaches",t[t.Departures=2]="Departures",t[t.Arrivals=4]="Arrivals",t[t.Frequencies=8]="Frequencies",t[t.Gates=16]="Gates",t[t.HoldingPatterns=32]="HoldingPatterns",t[t.Runways=64]="Runways",t[t.All=127]="All"}(ot||(ot={})),function(t){t[t.None=0]="None",t[t.HardSurface=1]="HardSurface",t[t.SoftSurface=2]="SoftSurface",t[t.AllWater=3]="AllWater",t[t.HeliportOnly=4]="HeliportOnly",t[t.Private=5]="Private"}(ct||(ct={})),function(t){t[t.None=0]="None",t[t.HardSurface=2]="HardSurface",t[t.SoftSurface=4]="SoftSurface",t[t.AllWater=8]="AllWater",t[t.HeliportOnly=16]="HeliportOnly",t[t.Private=32]="Private"}(ht||(ht={})),function(t){t[t.None=0]="None",t[t.Named=1]="Named",t[t.Unnamed=2]="Unnamed",t[t.Vor=3]="Vor",t[t.NDB=4]="NDB",t[t.Offroute=5]="Offroute",t[t.IAF=6]="IAF",t[t.FAF=7]="FAF",t[t.RNAV=8]="RNAV",t[t.VFR=9]="VFR"}(lt||(lt={})),function(t){t[t.None=0]="None",t[t.X=88]="X",t[t.Y=89]="Y"}(ut||(ut={})),function(t){t[t.RADIAL_RADIAL=0]="RADIAL_RADIAL",t[t.RADIAL_DISTANCE=1]="RADIAL_DISTANCE",t[t.LAT_LONG=2]="LAT_LONG"}(dt||(dt={})),function(t){t[t.Unknown=0]="Unknown",t[t.AF=1]="AF",t[t.CA=2]="CA",t[t.CD=3]="CD",t[t.CF=4]="CF",t[t.CI=5]="CI",t[t.CR=6]="CR",t[t.DF=7]="DF",t[t.FA=8]="FA",t[t.FC=9]="FC",t[t.FD=10]="FD",t[t.FM=11]="FM",t[t.HA=12]="HA",t[t.HF=13]="HF",t[t.HM=14]="HM",t[t.IF=15]="IF",t[t.PI=16]="PI",t[t.RF=17]="RF",t[t.TF=18]="TF",t[t.VA=19]="VA",t[t.VD=20]="VD",t[t.VI=21]="VI",t[t.VM=22]="VM",t[t.VR=23]="VR",t[t.Discontinuity=99]="Discontinuity",t[t.ThruDiscontinuity=100]="ThruDiscontinuity"}(pt||(pt={})),function(t){t[t.Unused=0]="Unused",t[t.At=1]="At",t[t.AtOrAbove=2]="AtOrAbove",t[t.AtOrBelow=3]="AtOrBelow",t[t.Between=4]="Between"}(gt||(gt={})),function(t){t[t.Unused=0]="Unused",t[t.At=1]="At",t[t.AtOrAbove=2]="AtOrAbove",t[t.AtOrBelow=3]="AtOrBelow",t[t.Between=4]="Between"}(ft||(ft={})),function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Either=3]="Either"}(mt||(mt={})),function(t){t[t.None=0]="None",t[t.Victor=1]="Victor",t[t.Jet=2]="Jet",t[t.Both=3]="Both"}(At||(At={})),function(t){t[t.CompassPoint=0]="CompassPoint",t[t.MH=1]="MH",t[t.H=2]="H",t[t.HH=3]="HH"}(yt||(yt={})),function(t){t[t.Unknown=0]="Unknown",t[t.VOR=1]="VOR",t[t.VORDME=2]="VORDME",t[t.DME=3]="DME",t[t.TACAN=4]="TACAN",t[t.VORTAC=5]="VORTAC",t[t.ILS=6]="ILS",t[t.VOT=7]="VOT"}(St||(St={})),function(t){t[t.Concrete=0]="Concrete",t[t.Grass=1]="Grass",t[t.WaterFSX=2]="WaterFSX",t[t.GrassBumpy=3]="GrassBumpy",t[t.Asphalt=4]="Asphalt",t[t.ShortGrass=5]="ShortGrass",t[t.LongGrass=6]="LongGrass",t[t.HardTurf=7]="HardTurf",t[t.Snow=8]="Snow",t[t.Ice=9]="Ice",t[t.Urban=10]="Urban",t[t.Forest=11]="Forest",t[t.Dirt=12]="Dirt",t[t.Coral=13]="Coral",t[t.Gravel=14]="Gravel",t[t.OilTreated=15]="OilTreated",t[t.SteelMats=16]="SteelMats",t[t.Bituminous=17]="Bituminous",t[t.Brick=18]="Brick",t[t.Macadam=19]="Macadam",t[t.Planks=20]="Planks",t[t.Sand=21]="Sand",t[t.Shale=22]="Shale",t[t.Tarmac=23]="Tarmac",t[t.WrightFlyerTrack=24]="WrightFlyerTrack",t[t.Ocean=26]="Ocean",t[t.Water=27]="Water",t[t.Pond=28]="Pond",t[t.Lake=29]="Lake",t[t.River=30]="River",t[t.WasteWater=31]="WasteWater",t[t.Paint=32]="Paint"}(vt||(vt={})),function(t){t[t.Unknown=0]="Unknown",t[t.None=1]="None",t[t.PartTime=2]="PartTime",t[t.FullTime=3]="FullTime",t[t.Frequency=4]="Frequency"}(bt||(bt={})),function(t){t[t.Uknown=0]="Uknown",t[t.Public=1]="Public",t[t.Military=2]="Military",t[t.Private=3]="Private"}(Tt||(Tt={})),function(t){t[t.Unknown=0]="Unknown",t[t.No=1]="No",t[t.Yes=2]="Yes"}(Rt||(Rt={})),function(t){t[t.Unknown=0]="Unknown",t[t.Terminal=1]="Terminal",t[t.LowAlt=2]="LowAlt",t[t.HighAlt=3]="HighAlt",t[t.ILS=4]="ILS",t[t.VOT=5]="VOT"}(_t||(_t={})),function(t){t[t.All=0]="All",t[t.Airport=1]="Airport",t[t.Intersection=2]="Intersection",t[t.Vor=3]="Vor",t[t.Ndb=4]="Ndb",t[t.Boundary=5]="Boundary",t[t.User=6]="User",t[t.Visual=7]="Visual",t[t.AllExceptVisual=8]="AllExceptVisual"}(Ct||(Ct={})),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.ClassA=2]="ClassA",t[t.ClassB=3]="ClassB",t[t.ClassC=4]="ClassC",t[t.ClassD=5]="ClassD",t[t.ClassE=6]="ClassE",t[t.ClassF=7]="ClassF",t[t.ClassG=8]="ClassG",t[t.Tower=9]="Tower",t[t.Clearance=10]="Clearance",t[t.Ground=11]="Ground",t[t.Departure=12]="Departure",t[t.Approach=13]="Approach",t[t.MOA=14]="MOA",t[t.Restricted=15]="Restricted",t[t.Prohibited=16]="Prohibited",t[t.Warning=17]="Warning",t[t.Alert=18]="Alert",t[t.Danger=19]="Danger",t[t.NationalPark=20]="NationalPark",t[t.ModeC=21]="ModeC",t[t.Radar=22]="Radar",t[t.Training=23]="Training"}(Et||(Et={})),function(t){t[t.Unknown=0]="Unknown",t[t.MSL=1]="MSL",t[t.AGL=2]="AGL",t[t.Unlimited=3]="Unlimited"}(Pt||(Pt={})),function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.Line=2]="Line",t[t.Origin=3]="Origin",t[t.ArcCW=4]="ArcCW",t[t.ArcCCW=5]="ArcCCW",t[t.Circle=6]="Circle"}(It||(It={})),function(t){t.None="",t.Airport="A",t.Vor="V",t.Ndb="N",t.Waypoint="W",t.Runway="R",t.User="U",t.VisualApproach="S"}(Nt||(Nt={}));class Ji{static isValue(t){return"object"==typeof t&&null!==t&&"JS_ICAO"===t.__Type}static value(t,e,i,s){return{__Type:"JS_ICAO",type:t,region:e,airport:i,ident:s}}static emptyValue(){return Ji.EMPTY_ICAO_VALUE}static isValueEmpty(t){return""===t.type&&""===t.region&&""===t.airport&&""===t.ident}static copyValue(t){return Object.assign({},t)}static stringV1ToValue(t){return Ji.value(t.substring(0,1).trim(),t.substring(1,3).trim(),t.substring(3,7).trim(),Ji.getIdentFromStringV1(t))}static stringV2ToValue(t){return Ji.value(t.substring(0,1).trim(),t.substring(1,3).trim(),t.substring(3,11).trim(),Ji.getIdentFromStringV2(t))}static valueToStringV1(t){if(Ji.isValueEmpty(t))return Ji.EMPTY_V1;if(t.type.length>1)throw new Error(`ICAO: cannot convert IcaoValue to V1 string - invalid type '${t.type}'`);if(t.region.length>2)throw new Error(`ICAO: cannot convert IcaoValue to V1 string - invalid region '${t.region}'`);if(t.airport.length>4)throw new Error(`ICAO: cannot convert IcaoValue to V1 string - invalid airport '${t.airport}'`);return`${t.type}${t.type===Nt.Airport?" ":t.region.padEnd(2," ")}${t.airport.padEnd(4," ")}${t.ident.padEnd(5," ")}`}static tryValueToStringV1(t){return Ji.isValueEmpty(t)||t.type.length>1||t.region.length>2||t.airport.length>4?Ji.EMPTY_V1:`${t.type}${t.type===Nt.Airport?" ":t.region.padEnd(2," ")}${t.airport.padEnd(4," ")}${t.ident.padEnd(5," ")}`}static valueToStringV2(t){if(Ji.isValueEmpty(t))return Ji.EMPTY_V2;if(t.type.length>1)throw new Error(`ICAO: cannot convert IcaoValue to V2 string - invalid type '${t.type}'`);if(t.region.length>2)throw new Error(`ICAO: cannot convert IcaoValue to V2 string - invalid region '${t.region}'`);if(t.airport.length>8)throw new Error(`ICAO: cannot convert IcaoValue to V2 string - invalid airport '${t.airport}'`);return`${t.type}${t.region.padEnd(2," ")}${t.airport.padEnd(8," ")}${t.ident.padEnd(8," ")}`}static tryValueToStringV2(t){return Ji.isValueEmpty(t)||t.type.length>1||t.region.length>2||t.airport.length>8?Ji.EMPTY_V2:`${t.type}${t.region.padEnd(2," ")}${t.airport.padEnd(8," ")}${t.ident.padEnd(8," ")}`}static valueEquals(t,e){return t.type===e.type&&(t.type===Nt.Airport||t.region===e.region)&&t.airport===e.airport&&t.ident===e.ident}static getRegionCodeFromStringV1(t){return t.substring(1,3).trim()}static getRegionCodeFromStringV2(t){return t.substring(1,3).trim()}static getAirportIdentFromStringV1(t){return t.substring(3,7).trim()}static getAirportIdentFromStringV2(t){return t.substring(3,11).trim()}static getIdentFromStringV1(t){return t.substring(7).trim()}static getIdentFromStringV2(t){return t.substring(11).trim()}static isIcaoTypeFacility(t,e){switch(t){case"A":return void 0===e||e===tt.Airport;case"W":return void 0===e||e===tt.Intersection;case"V":return void 0===e||e===tt.VOR;case"N":return void 0===e||e===tt.NDB;case"U":return void 0===e||e===tt.USR;case"R":return void 0===e||e===tt.RWY;case"S":return void 0===e||e===tt.VIS;default:return!1}}static isValueFacility(t,e){return Ji.isIcaoTypeFacility(t.type,e)}static isStringV1Facility(t,e){return Ji.isIcaoTypeFacility(t[0],e)}static isStringV2Facility(t,e){return Ji.isIcaoTypeFacility(t[0],e)}static getFacilityTypeFromIcaoType(t){switch(t){case"A":return tt.Airport;case"W":return tt.Intersection;case"V":return tt.VOR;case"N":return tt.NDB;case"U":return tt.USR;case"R":return tt.RWY;case"S":return tt.VIS;default:throw new Error(`ICAO: cannot convert ICAO type to facility type - unknown ICAO type: ${t}`)}}static getFacilityTypeFromValue(t){return Ji.getFacilityTypeFromIcaoType(t.type)}static getFacilityTypeFromStringV1(t){return Ji.getFacilityTypeFromIcaoType(t[0])}static getFacilityTypeFromStringV2(t){return Ji.getFacilityTypeFromIcaoType(t[0])}static getUid(t){let e=t.__cachedUid;return void 0!==e||(e=Ji.isValueEmpty(t)?"":`${t.type}\n${t.type===Nt.Airport?"":t.region}\n${t.airport}\n${t.ident}`,t.__cachedUid=e),e}}Ji.EMPTY_V1=" ",Ji.EMPTY_V2=" ",Ji.emptyIcao=Ji.EMPTY_V1,Ji.EMPTY_ICAO_VALUE=Ji.value("","","",""),Ji.getRegionCode=Ji.getRegionCodeFromStringV1,Ji.getAssociatedAirportIdent=Ji.getAirportIdentFromStringV1,Ji.getIdent=Ji.getIdentFromStringV1,Ji.isFacility=Ji.isStringV1Facility,Ji.getFacilityType=Ji.getFacilityTypeFromStringV1;class ts{static isFacilityType(t,e){return"JS_FacilityIntersection"===t.__Type?e===tt.Intersection:Ji.isFacility(t.icao,e)}static getMagVar(t){return ts.isFacilityType(t,tt.VOR)?-t.magneticVariation:Oi.get(t.lat,t.lon)}static getLatLonFromRadialDistance(t,e,i,s){return ts.geoPointCache[0].set(t).offset(Oi.magneticToTrue(e,ts.getMagVar(t)),gi.NMILE.convertTo(i,gi.GA_RADIAN),s)}static getLatLonFromRadialRadial(t,e,i,s,r){const n=ts.getMagVar(t),a=ts.getMagVar(i),o=ts.geoCircleCache[0].setAsGreatCircle(t,Oi.magneticToTrue(e,n)),c=ts.geoCircleCache[1].setAsGreatCircle(i,Oi.magneticToTrue(s,a)),h=o.includes(i),l=c.includes(t);if(h&&l)return r.set(NaN,NaN);if(h)return o.angleAlong(t,i,Math.PI)=this.maxDepth)return y;const S=Ri.set(r,n,a,this.vec3Cache[0]),v=Ri.set(u,d,p,this.vec3Cache[1]),b=e.angleAlong(S,v,Math.PI);if(b<=Mi.ANGULAR_TOLERANCE)return y;const T=e.offsetAngleAlong(S,b/2,this.vec3Cache[2]),R=Ti.set(o,c,this.vec2Cache[0]),_=Ti.set(g,f,this.vec2Cache[1]),C=Ti.sub(_,R,this.vec2Cache[2]),E=Ti.dot(C,C),P=this.geoPointCache[0].setFromCartesian(T),I=t.project(P,this.vec2Cache[2]),N=P.lat,F=P.lon,w=T[0],D=T[1],M=T[2],L=I[0],O=I[1],V=g-o,U=f-c,G=o*o-g*g+c*c-f*f,x=L-o,k=O-c,H=o*o-L*L+c*c-O*O,B=2*(V*k-U*x);if(B*B/4/E>this.dpTolSq){const t=(U*H-G*k)/B,e=(G*x-V*H)/B,i=Math.hypot(t-o,e-c),s=Ri.set(V,U,0,this.vec3Cache[3]),r=Ri.set(L-t,O-e,0,this.vec3Cache[4]),n=Ri.cross(s,r,this.vec3Cache[4]);y.vectorType="arc",y.arcCenterX=t,y.arcCenterY=e,y.arcRadius=i,y.isArcCounterClockwise=n[2]>0}else y.vectorType="line";if(Ri.dot(S,T)>this.cosMinDistance){if("line"===y.vectorType)return y;const i=e.offsetAngleAlong(S,b/4,this.geoPointCache[0]),s=t.project(i,this.vec2Cache[0]);let r=Math.hypot(s[0]-y.arcCenterX,s[1]-y.arcCenterY);if((r-y.arcRadius)*(r-y.arcRadius)<=this.dpTolSq&&(e.offsetAngleAlong(S,3*b/4,i),t.project(i,s),r=Math.hypot(s[0]-y.arcCenterX,s[1]-y.arcCenterY),(r-y.arcRadius)*(r-y.arcRadius)<=this.dpTolSq))return y}return y=this.resampleHelper(t,e,i,s,r,n,a,o,c,N,F,w,D,M,L,O,m,A+1,y),this.callHandler(m,N,F,L,O,y),y.index++,y.prevX=L,y.prevY=O,this.resampleHelper(t,e,N,F,w,D,M,L,O,h,l,u,d,p,g,f,m,A+1,y)}callHandler(t,e,i,s,r,n){let a;"line"===n.vectorType?a=this.lineVector:(a=this.arcVector,Ti.set(n.arcCenterX,n.arcCenterY,a.projectedArcCenter),a.projectedArcRadius=n.arcRadius,a.projectedArcStartAngle=Math.atan2(n.prevY-n.arcCenterY,n.prevX-n.arcCenterX),a.projectedArcEndAngle=Math.atan2(r-n.arcCenterY,s-n.arcCenterX),a.projectedArcEndAnglemi.HALF_PI?"right":"left"}static getVectorTurnRadius(t){return Math.min(t.radius,Math.PI-t.radius)}static getVectorInitialCourse(t){return os.setGeoCircleFromVector(t,os.geoCircleCache[0]).bearingAt(os.geoPointCache[0].set(t.startLat,t.startLon),Math.PI)}static getVectorFinalCourse(t){return os.setGeoCircleFromVector(t,os.geoCircleCache[0]).bearingAt(os.geoPointCache[0].set(t.endLat,t.endLon),Math.PI)}static getLegDesiredTurnDirection(t){return t.turnDirection===mt.Left?"left":t.turnDirection===mt.Right?"right":void 0}static getLegFinalPosition(t,e){if(void 0!==t.endLat&&void 0!==t.endLon)return e.set(t.endLat,t.endLon)}static getLegFinalCourse(t){if(t.flightPath.length>0){const e=t.flightPath[t.flightPath.length-1];return this.getVectorFinalCourse(e)}}static getTurnCircle(t,e,i,s){return s.set(t,e),"right"===i&&s.reverse(),s}static reverseTurnCircle(t,e){return e.set(Ri.multScalar(t.center,-1,os.vec3Cache[0]),Math.PI-t.radius)}static getTurnDirectionFromCircle(t){return t.radius>mi.HALF_PI?"right":"left"}static getTurnRadiusFromCircle(t){return Math.min(t.radius,Math.PI-t.radius)}static getTurnCenterFromCircle(t,e){return t.radius>mi.HALF_PI?e instanceof Float64Array?Ri.multScalar(t.center,-1,e):e.setFromCartesian(-t.center[0],-t.center[1],-t.center[2]):e instanceof Float64Array?Ri.copy(t.center,e):e.setFromCartesian(t.center)}static getShortestTurnDirection(t,e){const i=mi.angularDistanceDeg(t,e,1);return 0===i||180===i?void 0:i>180?"left":"right"}static pathAngleDistance(t,e,i,s,r=Fi.ANGULAR_TOLERANCE){if(i instanceof Float64Array||(i=Di.sphericalToCartesian(i,os.vec3Cache[0])),!t.includes(i,r)||!e.includes(i,r))throw Error("FlightPathUtils::pathAngleDistance(): the specified point does not lie on both the initial and final paths");const n=t.isGreatCircle()?t.center:Mi.getGreatCircleNormal(i,t,os.vec3Cache[1]);if(!Ri.isFinite(n))return NaN;const a=e.isGreatCircle()?e.center:Mi.getGreatCircleNormal(i,e,os.vec3Cache[2]);if(!Ri.isFinite(a))return NaN;const o=Ri.unitAngle(n,a),c=Ri.normalize(Ri.cross(n,i,os.vec3Cache[3]),os.vec3Cache[1]);if(!Ri.isFinite(c))return NaN;if(null===s)return o;const h=Math.sign(Ri.dot(c,a));return"right"===s?mi.normalizeAngle(o*h):mi.normalizeAngle(o*h*-1)}static getGreatCircleTangentToPath(t,e,i){return i.setAsGreatCircle(t,e)}static getGreatCircleTangentToVector(t,e,i){const s=os.setGeoCircleFromVector(e,os.geoCircleCache[0]);return i.setAsGreatCircle(t,s)}static getTurnCircleStartingFromPath(t,e,i,s,r){t instanceof Float64Array||(t=Di.sphericalToCartesian(t,os.vec3Cache[0]));const n="left"===s?i:Math.PI-i,a=Ri.cross(t,e.center,os.vec3Cache[1]),o=os.geoCircleCache[0].set(a,mi.HALF_PI).offsetDistanceAlong(t,n,os.vec3Cache[1],Math.PI);return r.set(o,n)}static getAlongArcSignedDistance(t,e,i,s,r=Mi.ANGULAR_TOLERANCE){const n=t.angleAlong(e,s,Math.PI);if(Math.min(n,mi.TWO_PI-n)<=r)return 0;const a=t.angleAlong(e,i,Math.PI);return t.arcLength((n-a/2+Math.PI)%mi.TWO_PI-Math.PI+a/2)}static getAlongArcNormalizedDistance(t,e,i,s,r=Mi.ANGULAR_TOLERANCE){const n=t.angleAlong(e,s,Math.PI);if(Math.min(n,mi.TWO_PI-n)<=r)return 0;const a=t.angleAlong(e,i,Math.PI);return Math.min(a,mi.TWO_PI-a)<=r?n>=Math.PI?-1/0:1/0:((n-a/2+Math.PI)%mi.TWO_PI-Math.PI)/a+.5}static isPointAlongArc(t,e,i,s,r=!0,n=Fi.ANGULAR_TOLERANCE){const a=t.angularWidth(n);if("number"!=typeof i&&(i=t.angleAlong(e,i,Math.PI,a)),r&&Math.abs(i)>=mi.TWO_PI-a)return!0;const o=t.angleAlong(e,s,Math.PI);if(r&&o>=mi.TWO_PI-a)return!0;const c=(o-i)*(i>=0?1:-1);return r?c<=a:c<-a}static projectVelocityToCircle(t,e,i,s){if(s.radius<=Mi.ANGULAR_TOLERANCE)return NaN;if(0===t)return 0;e instanceof Float64Array||(e=Di.sphericalToCartesian(e,os.vec3Cache[0]));const r="number"==typeof i?os.geoCircleCache[0].setAsGreatCircle(e,i):i.isGreatCircle()?i:os.geoCircleCache[0].setAsGreatCircle(e,os.geoCircleCache[0].setAsGreatCircle(i.center,e).center),n=r.encircles(s.center)?1:-1,a=Ri.copy(r.center,os.vec3Cache[1]),o=os.geoCircleCache[0].setAsGreatCircle(s.center,e).center,c=Ri.dot(o,a);return t*Math.sqrt(1-mi.clamp(c*c,0,1))*n}static resolveIngressToEgress(t){var e,i,s,r,n,a,o,c,h,l,u,d;const p=t.ingressToEgress;let g=0,f=Math.max(0,t.ingressJoinIndex);const m=t.ingress[t.ingress.length-1],A=t.flightPath[t.ingressJoinIndex],y=t.egress[0],S=t.flightPath[t.egressJoinIndex];if(m&&A){const s=os.geoPointCache[0].set(m.endLat,m.endLon),r=os.geoPointCache[1].set(A.startLat,A.startLon),n=t.ingressJoinIndex===t.egressJoinIndex&&y?os.geoPointCache[2].set(y.startLat,y.startLon):os.geoPointCache[2].set(A.endLat,A.endLon),a=os.setGeoCircleFromVector(A,os.geoCircleCache[0]),h=os.getAlongArcNormalizedDistance(a,r,n,s),l=Fi.ANGULAR_TOLERANCE/gi.METER.convertTo(A.distance,gi.GA_RADIAN);h<1-l&&(h>l?(a.closest(s,s),os.setVectorFromCircle(null!==(e=p[o=g++])&&void 0!==e?e:p[o]=os.createEmptyVector(),a,s,n,A.flags,A.heading,A.isHeadingTrue)):Object.assign(null!==(i=p[c=g++])&&void 0!==i?i:p[c]=os.createEmptyVector(),A)),f++}const v=Math.min(t.flightPath.length,t.egressJoinIndex<0?1/0:t.egressJoinIndex);for(let e=f;eo&&(a<1-o?(s.closest(t,t),os.setVectorFromCircle(null!==(r=p[l=g++])&&void 0!==r?r:p[l]=os.createEmptyVector(),s,e,t,S.flags,S.heading,S.isHeadingTrue)):Object.assign(null!==(n=p[u=g++])&&void 0!==n?n:p[u]=os.createEmptyVector(),S))}else Object.assign(null!==(a=p[d=g++])&&void 0!==a?a:p[d]=os.createEmptyVector(),S);return p.length=g,t}}os.vec3Cache=Ni.create(4,(()=>Ri.create())),os.geoPointCache=Ni.create(3,(()=>new Di(0,0))),os.geoCircleCache=Ni.create(1,(()=>new Mi(Ri.create(),0))),new Di(0,0),Ni.create(1,(()=>Ri.create())),Ni.create(3,(()=>new Di(0,0))),Ni.create(1,(()=>new Mi(Ri.create(),0))),Ni.create(4,(()=>Ri.create())),Ni.create(2,(()=>new Mi(Ri.create(),0))),Ni.create(5,(()=>Ri.create())),Ni.create(3,(()=>new Mi(Ri.create(),0))),Ri.create(),Ri.create(),Ni.create(4,(()=>Ri.create())),Ni.create(10,(()=>new Di(0,0))),Ni.create(1,(()=>new Mi(Ri.create(),0))),Ri.create(),Ri.create(),Ni.create(1,(()=>new Mi(Ri.create(),0))),Ni.create(4,(()=>Ri.create())),Ni.create(1,(()=>new Di(0,0))),Ni.create(2,(()=>new Mi(Ri.create(),0))),Ni.create(8,(()=>Ri.create())),Ni.create(5,(()=>new Mi(Ri.create(),0))),Ni.create(5,(()=>Ri.create())),Ni.create(4,(()=>new Mi(Ri.create(),0))),Ni.create(6,(()=>Ri.create())),Ri.create(),Ri.create(),pt.AF,pt.RF,pt.PI,Ni.create(5,(()=>Ri.create())),Ni.create(3,(()=>new Mi(Ri.create(),0))),pt.CA,pt.FA,pt.VA,pt.VA,pt.VD,pt.VI,pt.VM,pt.VR,pt.CR,pt.VR,pt.HA,pt.HF,pt.HM,pt.FM,pt.VM,pt.Discontinuity,pt.ThruDiscontinuity,function(t){t.Default="Default",t.GroundSpeed="GroundSpeed",t.TrueAirspeed="TrueAirspeed",t.TrueAirspeedPlusWind="TrueAirspeedPlusWind",t.Custom="Custom"}(Dt||(Dt={})),function(t){t.None="None",t.Automatic="Automatic",t.Custom="Custom"}(Mt||(Mt={})),function(t){t.Origin="Origin",t.Departure="Departure",t.Enroute="Enroute",t.Arrival="Arrival",t.Approach="Approach",t.Destination="Destination",t.MissedApproach="MissedApproach",t.RandomDirectTo="RandomDirectTo"}(Lt||(Lt={}));class cs{constructor(t,e,i,s=Lt.Enroute,r){this.segmentIndex=t,this.offset=e,this.legs=i,this.segmentType=s,this.airway=r}}cs.Empty=new cs(-1,-1,[]),function(t){t[t.None=0]="None",t[t.DirectTo=1]="DirectTo",t[t.MissedApproach=2]="MissedApproach",t[t.Obs=4]="Obs",t[t.VectorsToFinal=8]="VectorsToFinal",t[t.VectorsToFinalFaf=16]="VectorsToFinalFaf"}(Ot||(Ot={})),function(t){t.Climb="Climb",t.Descent="Descent"}(Vt||(Vt={})),function(t){t[t.IAS=0]="IAS",t[t.MACH=1]="MACH"}(Ut||(Ut={})),function(t){t.Added="Added",t.Removed="Removed",t.Changed="Changed"}(Gt||(Gt={})),function(t){t.Added="Added",t.Removed="Removed",t.Changed="Changed",t.Inserted="Inserted"}(xt||(xt={})),function(t){t.Lateral="Lateral",t.Vertical="Vertical",t.Calculating="Calculating"}(kt||(kt={})),function(t){t.OriginAdded="OriginAdded",t.OriginRemoved="OriginRemoved",t.DestinationAdded="DestinationAdded",t.DestinationRemoved="DestinationRemoved"}(Ht||(Ht={})),function(t){t.None="",t.InitialClimb="InitialClimb",t.StraightOut="Straight",t.Pattern="Pattern",t.PatternIntoDownwind="PatternDownwind",t.Downwind="Downwind",t.Base="Base",t.BaseIntoPattern="BasePattern",t.Overhead="Overhead"}(Bt||(Bt={})),function(t){t.None="",t.Final="Final",t.LongFinal="LongFinal",t.Base="Base",t.Downwind="Downwind",t.DownwindFromInside="DownwindInside",t.Downwind45="Downwind45",t.DownwindSecond45="DownwindSec45",t.Teardrop="Teardrop",t.ReverseTeardrop="RevTeardrop"}(Wt||(Wt={})),function(t){t[t.Unknown=1]="Unknown",t[t.Hard=2]="Hard",t[t.Soft=4]="Soft",t[t.Water=8]="Water"}($t||($t={}));class hs{static emptyIdentifier(){return{__Type:"JS_RunwayIdentifier",number:"",designator:""}}static toEmptyIdentifier(t){return t.number="",t.designator="",t}static getIdentifierFromOneWayRunway(t,e=hs.emptyIdentifier()){return e.number=hs.getNumberString(t.direction),e.designator=hs.getDesignatorLetter(t.runwayDesignator),e}static getNumberString(t){var e;return null!==(e=hs.RUNWAY_NUMBER_STRINGS[t])&&void 0!==e?e:""}static getDesignatorLetter(t,e=!1){const i=hs.RUNWAY_DESIGNATOR_LETTERS[t];return e?i.toLowerCase():i}static createEmptyOneWayRunway(){return{parentRunwayIndex:-1,designation:"",direction:36,runwayDesignator:RunwayDesignator.RUNWAY_DESIGNATOR_NONE,course:0,elevation:0,elevationEnd:0,gradient:0,latitude:0,longitude:0,length:0,width:0,startThresholdLength:0,endThresholdLength:0,surface:vt.Concrete,lighting:bt.Unknown}}static getOneWayRunwaysFromAirport(t){const e=[];return t.runways.map(((t,e)=>hs.getOneWayRunways(t,e))).forEach((t=>{e.push(t[0]),e.push(t[1])})),e.sort(hs.sortRunways),e}static getOneWayRunways(t,e){const i=[],s=t.designation.split("-");for(let r=0;rt.designation===e));if(i)return i}}static matchOneWayRunwayFromIdent(t,e){return hs.matchOneWayRunwayFromDesignation(t,e.substr(2).trim())}static getProceduresForRunway(t,e){const i=new Array,s=e.designation.split("-");for(let t=0;t-1)return t.frequencies[e]}}static getBcFrequency(t,e,i){const s=hs.getOppositeOneWayRunway(t,e,i);if(s)return hs.getLocFrequency(t,s)}static getOppositeOneWayRunway(t,e,i){const s=Math.round(Li.normalizeHeading(10*(e+18))/10);let r=RunwayDesignator.RUNWAY_DESIGNATOR_NONE;switch(i){case RunwayDesignator.RUNWAY_DESIGNATOR_LEFT:r=RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT;break;case RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT:r=RunwayDesignator.RUNWAY_DESIGNATOR_LEFT;break;default:r=i}return hs.matchOneWayRunway(t,s,r)}static sortRunways(t,e){if(t.direction===e.direction){let i=0;-1!=t.designation.indexOf("L")?i=1:-1!=t.designation.indexOf("C")?i=2:-1!=t.designation.indexOf("R")&&(i=3);let s=0;return-1!=e.designation.indexOf("L")?s=1:-1!=e.designation.indexOf("C")?s=2:-1!=e.designation.indexOf("R")&&(s=3),i-s}return t.direction-e.direction}static getRunwayFacilityIcaoValue(t,e){const i="JS_ICAO"===t.__Type?t:t.icaoStruct;return Ji.value(Nt.Runway,"",i.ident,`RW${e.designation}`)}static getRunwayFacilityIcao(t,e){return`R ${("string"==typeof t?t:t.icao).substring(7,11)}RW${e.designation.padEnd(3," ")}`}static createRunwayFacility(t,e){const i=hs.getRunwayFacilityIcao(t,e);return{icao:i,icaoStruct:Ji.stringV1ToValue(i),name:`Runway ${e.designation}`,region:t.region,city:t.city,lat:e.latitude,lon:e.longitude,runway:e}}static getRunwayCode(t){const e=Math.round(t);return String.fromCharCode(48+e+(e>9?7:0))}static getSurfaceCategory(t){const e="object"==typeof t?t.surface:t;return this.SURFACES_HARD.includes(e)?$t.Hard:this.SURFACES_SOFT.includes(e)?$t.Soft:this.SURFACES_WATER.includes(e)?$t.Water:$t.Unknown}}hs.RUNWAY_NUMBER_STRINGS=["",...Ni.create(36,(t=>`${t+1}`.padStart(2,"0"))),"N","NE","E","SE","S","SW","W","NW"],hs.RUNWAY_DESIGNATOR_LETTERS={[RunwayDesignator.RUNWAY_DESIGNATOR_NONE]:"",[RunwayDesignator.RUNWAY_DESIGNATOR_LEFT]:"L",[RunwayDesignator.RUNWAY_DESIGNATOR_RIGHT]:"R",[RunwayDesignator.RUNWAY_DESIGNATOR_CENTER]:"C",[RunwayDesignator.RUNWAY_DESIGNATOR_WATER]:"W",[RunwayDesignator.RUNWAY_DESIGNATOR_A]:"A",[RunwayDesignator.RUNWAY_DESIGNATOR_B]:"B"},hs.SURFACES_HARD=[vt.Asphalt,vt.Bituminous,vt.Brick,vt.Concrete,vt.Ice,vt.Macadam,vt.Paint,vt.Planks,vt.SteelMats,vt.Tarmac,vt.Urban],hs.SURFACES_SOFT=[vt.Coral,vt.Dirt,vt.Forest,vt.Grass,vt.GrassBumpy,vt.Gravel,vt.HardTurf,vt.LongGrass,vt.OilTreated,vt.Sand,vt.Shale,vt.ShortGrass,vt.Snow,vt.WrightFlyerTrack],hs.SURFACES_WATER=[vt.WaterFSX,vt.Lake,vt.Ocean,vt.Pond,vt.River,vt.WasteWater,vt.Water],hs.tempGeoPoint=new Di(0,0),function(t){t[t.None=0]="None",t[t.Ingress=1]="Ingress",t[t.Base=2]="Base",t[t.Egress=4]="Egress",t[t.All=7]="All"}(jt||(jt={})),new Di(0,0),new Di(0,0),new Mi(new Float64Array(3),0);class ls{constructor(t){this.params=new Float64Array(t),this.cachedParams=new Float64Array(t)}resolve(){return void 0!==this.stringValue&&_i.equals(this.params,this.cachedParams)||(_i.copy(this.params,this.cachedParams),this.stringValue=this.buildString(this.params)),this.stringValue}}class us extends ls{constructor(){super(us.DEFAULT_PARAMS)}set(t,e,i,s,r,n){let a;"number"==typeof t?a=t:[a,i,e,s,r,n]=t.getParameters(),this.params[0]=a,this.params[1]=e,this.params[2]=i,this.params[3]=s,this.params[4]=r,this.params[5]=n}buildString(t){return`matrix(${t.join(", ")})`}}us.DEFAULT_PARAMS=[1,0,0,1,0,0];class ds extends ls{constructor(t){super(ds.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`rotate(${t[0]}${this.unit})`}}ds.DEFAULT_PARAMS=[0];class ps extends ls{constructor(t){super(ps.DEFAULT_PARAMS),this.unit=t}set(t,e,i,s,r=0){this.params[0]=t,this.params[1]=e,this.params[2]=i,this.params[3]=0===r?s:mi.round(s,r)}buildString(t){return`rotate3d(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}${this.unit})`}}ps.DEFAULT_PARAMS=[0,0,1,0];class gs extends ls{constructor(t){super(gs.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`translateX(${t[0]}${this.unit})`}}gs.DEFAULT_PARAMS=[0];class fs extends ls{constructor(t){super(fs.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`translateY(${t[0]}${this.unit})`}}fs.DEFAULT_PARAMS=[0];class ms extends ls{constructor(t){super(ms.DEFAULT_PARAMS),this.unit=t}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`translateZ(${t[0]}${this.unit})`}}ms.DEFAULT_PARAMS=[0];class As extends ls{constructor(t,e=t){super(As.DEFAULT_PARAMS),this.unitX=t,this.unitY=e}set(t,e,i=0,s=i){this.params[0]=0===i?t:mi.round(t,i),this.params[1]=0===s?e:mi.round(e,s)}buildString(t){return`translate(${t[0]}${this.unitX}, ${t[1]}${this.unitY})`}}As.DEFAULT_PARAMS=[0,0];class ys extends ls{constructor(t,e=t,i=t){super(ys.DEFAULT_PARAMS),this.unitX=t,this.unitY=e,this.unitZ=i}set(t,e,i,s=0,r=s,n=s){this.params[0]=0===s?t:mi.round(t,s),this.params[1]=0===r?e:mi.round(e,r),this.params[2]=0===n?i:mi.round(i,n)}buildString(t){return`translate3d(${t[0]}${this.unitX}, ${t[1]}${this.unitY}, ${t[2]}${this.unitZ})`}}ys.DEFAULT_PARAMS=[0,0,0];class Ss extends ls{constructor(){super(Ss.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`scaleX(${t[0]})`}}Ss.DEFAULT_PARAMS=[1];class vs extends ls{constructor(){super(vs.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`scaleY(${t[0]})`}}vs.DEFAULT_PARAMS=[1];class bs extends ls{constructor(){super(bs.DEFAULT_PARAMS)}set(t,e=0){this.params[0]=0===e?t:mi.round(t,e)}buildString(t){return`scaleZ(${t[0]})`}}bs.DEFAULT_PARAMS=[1];class Ts extends ls{constructor(){super(Ts.DEFAULT_PARAMS)}set(t,e,i=0,s=i){this.params[0]=0===i?t:mi.round(t,i),this.params[1]=0===s?e:mi.round(e,s)}buildString(t){return`scale(${t[0]}, ${t[1]})`}}Ts.DEFAULT_PARAMS=[1,1];class Rs extends ls{constructor(){super(Rs.DEFAULT_PARAMS)}set(t,e,i,s=0,r=s,n=s){this.params[0]=0===s?t:mi.round(t,s),this.params[1]=0===r?e:mi.round(e,r),this.params[2]=0===n?i:mi.round(e,n)}buildString(t){return`scale3d(${t[0]}, ${t[1]}, ${t[2]})`}}Rs.DEFAULT_PARAMS=[1,1,1];class _s{constructor(...t){this.stringValues=[],this.transforms=t}getChild(t){if(t<0||t>=this.transforms.length)throw new RangeError;return this.transforms[t]}resolve(){let t=!1;for(let e=0;e=s[e]&&i[e]<=s[e+2]){n=i;break}}for(let t=0;t<4;t++)if(i&1<=s[e]&&i[e]<=s[e+2]){a=i;break}}}else{for(let t=0;t<4;t++)if(this.prevPointOutcode&1<=e&&l<=o){const e=f[m];e.point[r]=h[s],e.point[n]=l;const o=r*Math.PI/2+(null!=p?p:p=Math.acos(mi.clamp(u/i,-1,1)))*t;e.radial=(o+a)%a,m++}}{const l=c-d;if(l>=e&&l<=o){const e=f[m];e.point[r]=h[s],e.point[n]=l;const o=r*Math.PI/2-(null!=p?p:p=Math.acos(mi.clamp(u/i,-1,1)))*t;e.radial=(o+a)%a,m++}}}}if(m>1){for(let t=m;t=0){let s=c;for(let a=0;a=s){s=0;break}const l=y+h*o;A?this.consumer.moveTo(c.point[0],c.point[1]):this.consumer.arc(t,e,i,y,l,n),A=!A,y=l,s=(r-y)*o}}A?g===Yt.Inside&&this.consumer.moveTo(p[0],p[1]):this.consumer.arc(t,e,i,y,r,n),Ti.copy(p,this.prevPoint),this.prevPointOutcode=g}closePath(){isNaN(this.firstPoint[0])||this.lineTo(this.firstPoint[0],this.firstPoint[1])}reset(){Ti.set(NaN,NaN,this.firstPoint),Ti.set(NaN,NaN,this.prevPoint),this.prevPointOutcode=0}getOutcode(t,e){const i=this.bounds.get();let s=0;return ti[2]&&(s|=Yt.Right),ei[3]&&(s|=Yt.Bottom),s}onBoundsChanged(){const t=this.bounds.get();Ri.set(1,0,-t[0],this.boundsLines[0]),Ri.set(0,1,-t[1],this.boundsLines[1]),Ri.set(1,0,-t[2],this.boundsLines[2]),Ri.set(0,1,-t[3],this.boundsLines[3]),this.isBoundingRectNonZero=t[0]({point:new Float64Array(2),radial:1/0})));class ws extends Ns{constructor(t,e,i,s,r){super(t),this.projection=e,this.firstPoint=new Di(NaN,NaN),this.prevPoint=new Di(NaN,NaN),this.prevPointProjected=new Float64Array(2),this.resampleHandler=this.onResampled.bind(this),this.resampler=i instanceof rs?i:new rs(i,s,r)}getProjection(){return this.projection}setProjection(t){this.projection=t}beginPath(){this.reset(),this.consumer.beginPath()}moveTo(t,e){if(!isFinite(t)||!isFinite(e))return;isNaN(this.firstPoint.lat)&&this.firstPoint.set(e,t),this.prevPoint.set(e,t);const i=this.projection.project(this.prevPoint,this.prevPointProjected);this.consumer.moveTo(i[0],i[1])}lineTo(t,e){if(!isFinite(t)||!isFinite(e))return;if(!isNaN(this.prevPoint.lat)&&this.prevPoint.equals(e,t))return;if(isNaN(this.prevPoint.lat))return void this.moveTo(t,e);const i=ws.geoPointCache[0].set(e,t),s=ws.geoCircleCache[0].setAsGreatCircle(this.prevPoint,i);if(!isFinite(s.center[0]))throw new Error(`Cannot unambiguously path a great circle from ${this.prevPoint.lat} lat, ${this.prevPoint.lon} lon to ${e} lat, ${t} lon`);this.resampler.resample(this.projection,s,this.prevPoint,i,this.resampleHandler),this.prevPoint.set(e,t)}bezierCurveTo(){throw new Error("GeodesicResamplerStream: bezierCurveTo() is not supported")}quadraticCurveTo(){throw new Error("GeodesicResamplerStream: quadraticCurveTo() is not supported")}arc(t,e,i,s,r,n){if(!(isFinite(t)&&isFinite(e)&&isFinite(i)&&isFinite(s)&&isFinite(r)))return;if(0===i||Math.abs(s-r)<=Mi.ANGULAR_TOLERANCE*Avionics.Utils.RAD2DEG)return;if(mi.diffAngle(s*Avionics.Utils.DEG2RAD,r*Avionics.Utils.DEG2RAD,!1)<=Mi.ANGULAR_TOLERANCE){const a=s+180*Math.sign(r-s);return this.arc(t,e,i,s,a,n),void this.arc(t,e,i,a,r,n)}const a=ws.geoPointCache[1].set(e,t),o=ws.geoPointCache[2],c=ws.geoPointCache[3];if(Math.abs(e)>=90-Mi.ANGULAR_TOLERANCE*Avionics.Utils.RAD2DEG){const t=Math.sign(e)*(mi.HALF_PI-i)*Avionics.Utils.RAD2DEG;o.set(t,s),c.set(t,r)}else a.offset(s,i,o),a.offset(r,i,c);if(isNaN(o.lat)||isNaN(o.lon)||isNaN(c.lat)||isNaN(c.lon))return;isNaN(this.prevPoint.lat)?this.moveTo(o.lon,o.lat):o.equals(this.prevPoint)||this.lineTo(o.lon,o.lat);const h=ws.geoCircleCache[0].set(a,i);n||h.reverse(),this.resampler.resample(this.projection,h,o,c,this.resampleHandler),this.prevPoint.set(c)}closePath(){isNaN(this.firstPoint.lat)||this.lineTo(this.firstPoint.lon,this.firstPoint.lat)}reset(){this.firstPoint.set(NaN,NaN),this.prevPoint.set(NaN,NaN)}onResampled(t){switch(t.type){case"start":return;case"line":this.consumer.lineTo(t.projected[0],t.projected[1]);break;case"arc":this.consumer.arc(t.projectedArcCenter[0],t.projectedArcCenter[1],t.projectedArcRadius,t.projectedArcStartAngle,t.projectedArcEndAngle,t.projectedArcStartAngle>t.projectedArcEndAngle)}Ti.copy(t.projected,this.prevPointProjected)}}ws.geoPointCache=[new Di(0,0),new Di(0,0),new Di(0,0),new Di(0,0)],ws.geoCircleCache=[new Mi(new Float64Array(3),0)];class Ds extends Ns{constructor(){super(...arguments),this.transform=new Ci,this.concatCache=[],this.scale=1,this.rotation=0}addTranslation(t,e,i="after"){const s=Ds.transformCache[0].toTranslation(t,e);return"before"===i?(this.concatCache[0]=s,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=s),Ci.concat(this.transform,this.concatCache),this}addScale(t,e="after"){const i=Ds.transformCache[0].toScale(t,t);return"before"===e?(this.concatCache[0]=i,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=i),Ci.concat(this.transform,this.concatCache),this.updateScaleRotation(),this}addRotation(t,e="after"){const i=Ds.transformCache[0].toRotation(t);return"before"===e?(this.concatCache[0]=i,this.concatCache[1]=this.transform):(this.concatCache[0]=this.transform,this.concatCache[1]=i),Ci.concat(this.transform,this.concatCache),this.updateScaleRotation(),this}resetTransform(){return this.transform.toIdentity(),this.updateScaleRotation(),this}beginPath(){this.consumer.beginPath()}moveTo(t,e){const i=this.applyTransform(t,e);this.consumer.moveTo(i[0],i[1])}lineTo(t,e){const i=this.applyTransform(t,e);this.consumer.lineTo(i[0],i[1])}bezierCurveTo(t,e,i,s,r,n){const a=this.applyTransform(t,e);t=a[0],e=a[1];const o=this.applyTransform(i,s);i=o[0],s=o[1];const c=this.applyTransform(r,n);r=c[0],n=c[1],this.consumer.bezierCurveTo(t,e,i,s,r,n)}quadraticCurveTo(t,e,i,s){const r=this.applyTransform(t,e);t=r[0],e=r[1];const n=this.applyTransform(i,s);i=n[0],s=n[1],this.consumer.quadraticCurveTo(t,e,i,s)}arc(t,e,i,s,r,n){const a=this.applyTransform(t,e);this.consumer.arc(a[0],a[1],i*this.scale,s+this.rotation,r+this.rotation,n)}closePath(){this.consumer.closePath()}updateScaleRotation(){const t=this.transform.getParameters();this.scale=Math.sqrt(t[0]*t[0]+t[3]*t[3]),this.rotation=Math.atan2(t[3],t[0])}applyTransform(t,e){const i=Ti.set(t,e,Ds.vec2Cache[0]);return this.transform.apply(i,i)}}Ds.vec2Cache=[new Float64Array(2)],Ds.transformCache=[new Ci];class Ms extends Ns{constructor(){super(...arguments),this.stack=[]}push(t){var e;t.setConsumer(null!==(e=this.stack[this.stack.length-1])&&void 0!==e?e:this.consumer),this.stack.push(t)}pop(){const t=this.stack.pop();return null==t||t.setConsumer(Is.INSTANCE),t}unshift(t){const e=this.stack[0];null==e||e.setConsumer(t),t.setConsumer(this.consumer),this.stack.unshift(t)}shift(){var t;const e=this.stack.shift();return null==e||e.setConsumer(Is.INSTANCE),null===(t=this.stack[0])||void 0===t||t.setConsumer(this.consumer),e}setConsumer(t){var e;null===(e=this.stack[0])||void 0===e||e.setConsumer(t),super.setConsumer(t)}beginPath(){var t;(null!==(t=this.stack[this.stack.length-1])&&void 0!==t?t:this.consumer).beginPath()}moveTo(t,e){var i;(null!==(i=this.stack[this.stack.length-1])&&void 0!==i?i:this.consumer).moveTo(t,e)}lineTo(t,e){var i;(null!==(i=this.stack[this.stack.length-1])&&void 0!==i?i:this.consumer).lineTo(t,e)}bezierCurveTo(t,e,i,s,r,n){var a;(null!==(a=this.stack[this.stack.length-1])&&void 0!==a?a:this.consumer).bezierCurveTo(t,e,i,s,r,n)}quadraticCurveTo(t,e,i,s){var r;(null!==(r=this.stack[this.stack.length-1])&&void 0!==r?r:this.consumer).quadraticCurveTo(t,e,i,s)}arc(t,e,i,s,r,n){var a;(null!==(a=this.stack[this.stack.length-1])&&void 0!==a?a:this.consumer).arc(t,e,i,s,r,n)}closePath(){this.stack[this.stack.length-1].closePath()}}new Mi(new Float64Array(3),0),new Mi(new Float64Array(3),0);class Ls extends Ns{constructor(t,e,i,s,r){super(t),this.postStack=new Ms(t),this.projectionStream=i instanceof rs?new ws(this.postStack,e,i):new ws(this.postStack,e,i,s,r),this.preStack=new Ms(this.projectionStream)}getProjection(){return this.projectionStream.getProjection()}setProjection(t){this.projectionStream.setProjection(t)}pushPreProjected(t){this.preStack.push(t)}popPreProjected(){return this.preStack.pop()}unshiftPreProjected(t){this.preStack.unshift(t)}shiftPreProjected(){return this.preStack.shift()}pushPostProjected(t){this.postStack.push(t)}popPostProjected(){return this.postStack.pop()}unshiftPostProjected(t){this.postStack.unshift(t)}shiftPostProjected(){return this.postStack.shift()}setConsumer(t){this.postStack.setConsumer(t),super.setConsumer(t)}beginPath(){this.preStack.beginPath()}moveTo(t,e){this.preStack.moveTo(t,e)}lineTo(t,e){this.preStack.lineTo(t,e)}bezierCurveTo(t,e,i,s,r,n){this.preStack.bezierCurveTo(t,e,i,s,r,n)}quadraticCurveTo(t,e,i,s){this.preStack.quadraticCurveTo(t,e,i,s)}arc(t,e,i,s,r,n){this.preStack.arc(t,e,i,s,r,n)}closePath(){this.preStack.closePath()}}class Os{constructor(t,e){this.computeFn=e,this.isSubscribable=!0,this.isMutableSubscribable=!0,this.subs=[],this.notifyDepth=0,this.initialNotifyFunc=this.notifySubscription.bind(this),this.onSubDestroyedFunc=this.onSubDestroyed.bind(this),this.rawValue=t,this.value=e(t)}static create(t,e){return new Os(t,e)}set(t){this.rawValue=t;const e=this.computeFn(t);e!==this.value&&(this.value=e,this.notify())}get(){return this.value}getRaw(){return this.rawValue}sub(e,i=!1,s=!1){const r=new t(e,this.initialNotifyFunc,this.onSubDestroyedFunc);return this.subs.push(r),s?r.pause():i&&r.initialNotify(),r}notify(){let t=!1;this.notifyDepth++;const e=this.subs.length;for(let i=0;it.isAlive)))}notifySubscription(t){t.handler(this.value,this.rawValue)}onSubDestroyed(t){0===this.notifyDepth&&this.subs.splice(this.subs.indexOf(t),1)}map(t,e,i,s){const r=(e,i)=>t(e[0],i);return i?bi.create(r,e,i,s,this):bi.create(r,null!=e?e:ri.DEFAULT_EQUALITY_FUNC,this)}pipe(t,e,i){let s,r;return"function"==typeof e?(s=new si(this,t,e,this.onSubDestroyedFunc),r=null!=i&&i):(s=new si(this,t,this.onSubDestroyedFunc),r=null!=e&&e),this.subs.push(s),r?s.pause():s.initialNotify(),s}}class Vs extends Yi{constructor(){super(...arguments),this._isVisible=!0}isVisible(){return this._isVisible}setVisible(t){this._isVisible!==t&&(this._isVisible=t,this.onVisibilityChanged(t))}onVisibilityChanged(t){}onAttached(){}onWake(){}onSleep(){}onMapProjectionChanged(t,e){}onUpdated(t,e){}onDetached(){}}!function(t){t[t.Target=1]="Target",t[t.Center=2]="Center",t[t.TargetProjected=4]="TargetProjected",t[t.Range=8]="Range",t[t.RangeEndpoints=16]="RangeEndpoints",t[t.ScaleFactor=32]="ScaleFactor",t[t.Rotation=64]="Rotation",t[t.ProjectedSize=128]="ProjectedSize",t[t.ProjectedResolution=256]="ProjectedResolution"}(zt||(zt={})),gi.GA_RADIAN.convertTo(1,gi.NMILE),new Di(0,0),new Di(0,0),Ri.create(),new Di(0,0),new Di(0,0),Ti.create(),Ti.create(),Ri.create(),Ri.create(),new Di(0,0),new Ci,new Ci,new Di(0,0),function(t){t.HeadingUp="HeadingUp",t.TrackUp="TrackUp",t.MapUp="MapUp"}(qt||(qt={}));class Us{constructor(t,e,i){this.canvas=t,this.context=e,this.isDisplayed=i}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}reset(){const t=this.canvas.width;this.canvas.width=0,this.canvas.width=t}}class Gs extends Vs{constructor(){super(...arguments),this.displayCanvasRef=z.createRef(),this.width=0,this.height=0,this.displayCanvasContext=null,this.isInit=!1}get display(){if(!this._display)throw new Error("MapCanvasLayer: attempted to access display before it was initialized");return this._display}get buffer(){if(!this._buffer)throw new Error("MapCanvasLayer: attempted to access buffer before it was initialized");return this._buffer}tryGetDisplay(){return this._display}tryGetBuffer(){return this._buffer}getWidth(){return this.width}getHeight(){return this.height}setWidth(t){t!==this.width&&(this.width=t,this.isInit&&this.updateCanvasSize())}setHeight(t){t!==this.height&&(this.height=t,this.isInit&&this.updateCanvasSize())}copyBufferToDisplay(){this.isInit&&this.props.useBuffer&&this.display.context.drawImage(this.buffer.canvas,0,0,this.width,this.height)}onAfterRender(){this.displayCanvasContext=this.displayCanvasRef.instance.getContext("2d")}onVisibilityChanged(t){this.isInit&&this.updateCanvasVisibility()}updateFromVisibility(){this.display.canvas.style.display=this.isVisible()?"block":"none"}onAttached(){this.initCanvasInstances(),this.isInit=!0,this.updateCanvasVisibility(),this.updateCanvasSize()}initCanvasInstances(){if(this._display=this.createCanvasInstance(this.displayCanvasRef.instance,this.displayCanvasContext,!0),this.props.useBuffer){const t=document.createElement("canvas"),e=t.getContext("2d");this._buffer=this.createCanvasInstance(t,e,!1)}}createCanvasInstance(t,e,i){return new Us(t,e,i)}updateCanvasSize(){const t=this.display.canvas;if(t.width=this.width,t.height=this.height,t.style.width=`${this.width}px`,t.style.height=`${this.height}px`,this._buffer){const t=this._buffer.canvas;t.width=this.width,t.height=this.height}}updateCanvasVisibility(){this.display.canvas.style.display=this.isVisible()?"block":"none"}render(){var t;return z.buildComponent("canvas",{ref:this.displayCanvasRef,class:null!==(t=this.props.class)&&void 0!==t?t:"",width:"0",height:"0",style:"position: absolute;"})}}class xs extends Gs{onAttached(){super.onAttached(),this.updateFromProjectedSize(this.props.mapProjection.getProjectedSize())}updateFromProjectedSize(t){this.setWidth(t[0]),this.setHeight(t[1]);const e=this.display.canvas;e.style.left="0px",e.style.top="0px"}onMapProjectionChanged(t,e){Ai.isAll(e,zt.ProjectedSize)&&this.updateFromProjectedSize(t.getProjectedSize())}}class ks{static parseFacilitiesCycle(t,e){const i=t.match(ks.MSFS_DATE_RANGE_REGEX);if(null===i)return void console.warn("AiracUtils: Failed to parse facilitiesDateRange",t);const[,s,r,n,a,o]=i,c=new Date(`${s}-${r}-${o} UTC`),h=new Date(`${n}-${a}-${o} UTC`);c.getTime()>h.getTime()&&c.setUTCFullYear(c.getUTCFullYear()-1);const l=c.getTime(),u=void 0!==e?e:{};return ks.fillCycleFromEffectiveTimestamp(l,u)}static getOffsetCycle(t,e,i){const s=t.effectiveTimestamp+e*ks.CYCLE_DURATION,r=void 0!==i?i:{};return ks.fillCycleFromEffectiveTimestamp(s,r)}static getCycleNumber(t){ks.dateCache.setTime(t);const e=t-Date.UTC(ks.dateCache.getUTCFullYear(),0,1);return Math.trunc(e/ks.CYCLE_DURATION)+1}static getCurrentCycle(t,e){const i=t.getTime()-ks.DATUM_CYCLE_TIMESTAMP,s=Math.floor(i/ks.CYCLE_DURATION),r=ks.DATUM_CYCLE_TIMESTAMP+s*ks.CYCLE_DURATION,n=void 0!==e?e:{};return ks.fillCycleFromEffectiveTimestamp(r,n)}static fillCycleFromEffectiveTimestamp(t,e){return ks.dateCache.setTime(t),e.effectiveTimestamp=t,e.expirationTimestamp=t+ks.CYCLE_DURATION,e.cycle=ks.getCycleNumber(t),e.cycleString=e.cycle.toString().padStart(2,"0"),e.ident=`${(ks.dateCache.getUTCFullYear()%100).toString().padStart(2,"0")}${e.cycleString}`,e}}ks.dateCache=new Date,ks.CYCLE_DURATION=24192e5,ks.MSFS_DATE_RANGE_REGEX=/([A-Z]{3})(\d\d?)([A-Z]{3})(\d\d?)\/(\d\d)/,ks.DATUM_CYCLE_TIMESTAMP=Date.UTC(2024,0,25),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.ClassA=2]="ClassA",t[t.ClassB=3]="ClassB",t[t.ClassC=4]="ClassC",t[t.ClassD=5]="ClassD",t[t.ClassE=6]="ClassE",t[t.ClassF=7]="ClassF",t[t.ClassG=8]="ClassG",t[t.Tower=9]="Tower",t[t.Clearance=10]="Clearance",t[t.Ground=11]="Ground",t[t.Departure=12]="Departure",t[t.Approach=13]="Approach",t[t.MOA=14]="MOA",t[t.Restricted=15]="Restricted",t[t.Prohibited=16]="Prohibited",t[t.Warning=17]="Warning",t[t.Alert=18]="Alert",t[t.Danger=19]="Danger",t[t.Nationalpark=20]="Nationalpark",t[t.ModeC=21]="ModeC",t[t.Radar=22]="Radar",t[t.Training=23]="Training",t[t.Max=24]="Max"}(Xt||(Xt={})),function(t){t[t.LogicOn=1]="LogicOn",t[t.APOn=2]="APOn",t[t.FDOn=4]="FDOn",t[t.FLC=8]="FLC",t[t.Alt=16]="Alt",t[t.AltArm=32]="AltArm",t[t.GS=64]="GS",t[t.GSArm=128]="GSArm",t[t.Pitch=256]="Pitch",t[t.VS=512]="VS",t[t.Heading=1024]="Heading",t[t.Nav=2048]="Nav",t[t.NavArm=4096]="NavArm",t[t.WingLevel=8192]="WingLevel",t[t.Attitude=16384]="Attitude",t[t.ThrottleSpd=32768]="ThrottleSpd",t[t.ThrottleMach=65536]="ThrottleMach",t[t.ATArm=131072]="ATArm",t[t.YD=262144]="YD",t[t.EngineRPM=524288]="EngineRPM",t[t.TOGAPower=1048576]="TOGAPower",t[t.Autoland=2097152]="Autoland",t[t.TOGAPitch=4194304]="TOGAPitch",t[t.Bank=8388608]="Bank",t[t.FBW=16777216]="FBW",t[t.AvionicsManaged=33554432]="AvionicsManaged",t[t.None=-2147483648]="None"}(Kt||(Kt={})),function(t){t.Custom="Custom",t.Airport="Airport",t.NDB="NDB",t.VOR="VOR",t.Intersection="Intersection",t.Runway="Runway",t.User="User",t.Visual="Visual",t.FlightPlan="FlightPlan",t.VNAV="VNAV"}(Qt||(Qt={}));class Hs{equals(t){return this.uid===t.uid}}class Bs extends Hs{constructor(t,e){super(),this.bus=e,this.isFacilityWaypoint=!0,this._facility=ai.create(t),this._location=es.create(new Di(t.lat,t.lon)),this._type=Bs.getType(t);const i=Ji.getFacilityTypeFromValue(t.icaoStruct);i!==tt.VIS&&i!==tt.USR||(this.facChangeSub=this.bus.getSubscriber().on(`facility_changed_${Ji.getUid(t.icaoStruct)}`).handle((t=>{this._facility.set(t),this._location.set(t.lat,t.lon)})))}get location(){return this._location}get uid(){return Ji.getUid(this.facility.get().icaoStruct)}get type(){return this._type}get facility(){return this._facility}static getType(t){switch(Ji.getFacilityTypeFromValue(t.icaoStruct)){case tt.Airport:return Qt.Airport;case tt.Intersection:return Qt.Intersection;case tt.NDB:return Qt.NDB;case tt.RWY:return Qt.Runway;case tt.USR:return Qt.User;case tt.VIS:return Qt.Visual;case tt.VOR:return Qt.VOR;default:return Qt.User}}}class Ws extends Hs{get location(){return this._location}get uid(){return this._uid}get type(){return Qt.FlightPlan}constructor(t,e,i,s,r){super(),"number"==typeof t?(this._location=es.create(new Di(t,e)),this._uid=`${Ws.UID_PREFIX}_${s}`,this.leg=i,this.ident=r):(this._location=t,this._uid=`${Ws.UID_PREFIX}_${i}`,this.leg=e,this.ident=s)}}Ws.UID_PREFIX="FLPTH";class $s extends Hs{get type(){return Qt.VNAV}get location(){return this._location}get uid(){return this._uid}constructor(t,e,i,s){super(),this.ident=s,this._uid=i,this._location=es.create(this.getWaypointLocation(t,e,new Di(0,0)))}setLocation(t,e){this._location.set(this.getWaypointLocation(t,e,$s.geoPointCache[0]))}getWaypointLocation(t,e,i){var s,r;if(void 0!==t.calculated){const n=[...t.calculated.ingress,...t.calculated.ingressToEgress,...t.calculated.egress];let a=n.length-1;for(;a>=0;){const t=n[a],s=t.distance;if(s>=e){const s=Di.sphericalToCartesian(t.endLat,t.endLon,$s.vec3Cache[0]);return os.setGeoCircleFromVector(t,$s.geoCircleCache[0]).offsetDistanceAlong(s,gi.METER.convertTo(-e,gi.GA_RADIAN),i,Math.PI)}e-=s,a--}n.length>0?i.set(n[0].startLat,n[0].startLon):i.set(null!==(s=t.calculated.endLat)&&void 0!==s?s:0,null!==(r=t.calculated.endLon)&&void 0!==r?r:0)}return i}}$s.vec3Cache=[new Float64Array(3)],$s.geoPointCache=[new Di(0,0)],$s.geoCircleCache=[new Mi(new Float64Array(3),0)];class js{constructor(t,e){this.bus=t,this.size=e,this.cache=new Map}get(t){const e=js.getFacilityKey(t);let i=this.cache.get(e);return i||(i=new Bs(t,this.bus),this.addToCache(e,i)),i}addToCache(t,e){this.cache.set(t,e),this.cache.size>this.size&&this.cache.delete(this.cache.keys().next().value)}static getCache(t){var e;return null!==(e=js.INSTANCE)&&void 0!==e?e:js.INSTANCE=new js(t,1e3)}static getFacilityKey(t){return ts.isFacilityType(t,tt.Intersection)&&Ji.getFacilityType(t.icao)!==tt.Intersection?`mismatch.${t.icao}`:t.icao}}class Ys{get size(){return this.tree.length}constructor(t){this.comparator=t,this.tree=[]}findMin(){return this.tree[0]}removeMin(){if(0===this.tree.length)return;const t=this.tree[0];return this.swap(0,this.tree.length-1),this.tree.length--,this.heapifyDown(0),t}insert(t){return this.tree.push(t),this.heapifyUp(this.tree.length-1),this}insertAndRemoveMin(t){return 0===this.tree.length||this.comparator(t,this.tree[0])<=0?t:this.removeMinAndInsert(t)}removeMinAndInsert(t){const e=this.tree[0];return this.tree[0]=t,this.heapifyDown(0),e}clear(){return this.tree.length=0,this}heapifyUp(t){let e=Ys.parent(t);for(;e>=0&&this.comparator(this.tree[t],this.tree[e])<0;)this.swap(e,t),t=e,e=Ys.parent(t)}heapifyDown(t){const e=this.tree.length;for(;t0&&(r|=1),s0&&(r|=2),3===r&&(r=this.comparator(this.tree[i],this.tree[s])<=0?1:2),0===r)break;const n=1===r?i:s;this.swap(t,n),t=n}}swap(t,e){const i=this.tree[t];this.tree[t]=this.tree[e],this.tree[e]=i}static parent(t){return t-1>>1}static left(t){return 2*t+1}static right(t){return 2*t+2}}class zs{get size(){return this.elements.length}constructor(t,e){if(this.keyFunc=e,this.elements=[],this.keys=[],this.nodes=[],this.minDepth=-1,this.maxDepth=-1,this.dimensionCount=Math.trunc(t),this.dimensionCount<2)throw new Error(`KdTree: cannot create a tree with ${this.dimensionCount} dimensions.`);this.indexArrays=Array.from({length:this.dimensionCount+1},(()=>[])),this.indexSortFuncs=Array.from({length:this.dimensionCount},((t,e)=>(t,i)=>{const s=this.keys[t],r=this.keys[i];for(let t=0;tr[i])return 1}return 0})),this.keyCache=[new Float64Array(this.dimensionCount)]}searchKey(t,e,i,s,r){if("number"==typeof i)return this.doResultsSearch(void 0,t,e,i,s,r);this.doVisitorSearch(void 0,t,e,i)}search(t,e,i,s,r){const n=this.keyFunc(t,this.keyCache[0]);if("number"==typeof i)return this.doResultsSearch(t,n,e,i,s,r);this.doVisitorSearch(t,n,e,i)}doVisitorSearch(t,e,i,s){this.searchTree(t,e,i,0,0,((t,e,i,r,n,a)=>s(e,i,r,n,a)),((t,e,i)=>e+t*i>=0))}doResultsSearch(t,e,i,s,r,n){if(s<=0)return r.length=0,r;const a=new Ys(((t,i)=>zs.distance(e,this.keys[i],this.dimensionCount)-zs.distance(e,this.keys[t],this.dimensionCount)));this.searchTree(t,e,i,0,0,((t,e,i,r,o,c)=>(n&&!n(e,i,r,o,c)||(a.size===s?a.insertAndRemoveMin(t):a.insert(t)),!0)),((t,i,r)=>{let n=i;return a.size===s&&(n=Math.min(n,zs.distance(e,this.keys[a.findMin()],this.dimensionCount))),n+t*r>=0})),r.length=a.size;for(let t=r.length-1;t>=0;t--)r[t]=this.elements[a.removeMin()];return r}searchTree(t,e,i,s,r,n,a){const o=this.nodes[s];if(void 0===o)return!0;const c=this.keys[o],h=zs.distance(e,c,this.dimensionCount);if(h<=i&&!n(o,this.elements[o],c,h,e,t))return!1;const l=e[r]-c[r],u=(r+1)%this.dimensionCount,d=zs.lesser(s),p=zs.greater(s);return!(void 0!==this.nodes[d]&&a(l,i,-1)&&!this.searchTree(t,e,i,d,u,n,a))&&!(void 0!==this.nodes[p]&&a(l,i,1)&&!this.searchTree(t,e,i,p,u,n,a))}insert(t){const e=this.insertElementInTree(t)+1;this.maxDepth=Math.max(this.maxDepth,e),e===this.minDepth+1&&(this.minDepth=zs.depth(this.nodes.indexOf(void 0,zs.leastIndexAtDepth(Math.max(0,this.minDepth))))),this.maxDepth+1>2*(this.minDepth+1)&&this.rebuild()}insertAll(t){for(const e of t){this.elements.push(e),this.keys.push(this.keyFunc(e,new Float64Array(this.dimensionCount)));const t=this.elements.length-1;for(let e=0;e=i&&(this.nodes[zs.lesser(t)]=n[e]),void(r>1}static lesser(t){return 2*t+1}static greater(t){return 2*t+2}static leastIndexAtDepth(t){return 1<{const i=this.keyFunc(t,qs.vec3Cache[0]);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e}))}search(t,e,i,s,r,n){let a,o,c,h,l;"number"==typeof t?(a=Di.sphericalToCartesian(t,e,qs.vec3Cache[1]),o=i,c=s,h=r,l=n):t instanceof Float64Array?(a=t,o=e,c=i,h=s,l=r):(a=Di.sphericalToCartesian(t,qs.vec3Cache[1]),o=e,c=i,h=s,l=r);const u=Math.sqrt(2*(1-Math.cos(Utils.Clamp(o,0,Math.PI))));if("number"==typeof c)return this.doResultsSearch(a,u,c,h,l);this.doVisitorSearch(a,u,c)}doVisitorSearch(t,e,i){this.cartesianTree.searchKey(t,e,((e,s)=>{const r=Ri.set(s[0],s[1],s[2],qs.vec3Cache[2]),n=Di.distance(r,t);return i(e,r,n,t)}))}doResultsSearch(t,e,i,s,r){const n=r?(e,i)=>{const s=Ri.set(i[0],i[1],i[2],qs.vec3Cache[2]),n=Di.distance(s,t);return r(e,s,n,t)}:void 0;return this.cartesianTree.searchKey(t,e,i,s,n)}insert(t){this.cartesianTree.insert(t)}insertAll(t){this.cartesianTree.insertAll(t)}remove(t){return this.cartesianTree.remove(t)}removeAll(t){return this.cartesianTree.removeAll(t)}removeAndInsert(t,e){this.cartesianTree.removeAndInsert(t,e)}rebuild(){this.cartesianTree.rebuild()}clear(){this.cartesianTree.clear()}}qs.vec3Cache=[new Float64Array(3),new Float64Array(3),new Float64Array(3),new Float64Array(3)],new Mi(new Float64Array(3),0),new Ys(((t,e)=>e.distanceToFarthestVector-t.distanceToFarthestVector)),function(t){t.Struct="Struct",t.StringV1="StringV1"}(Zt||(Zt={}));class Xs{constructor(t,e){this._waypoints=[],this._name=t,this._type=e}get name(){return this._name}get type(){return this._type}get waypoints(){return this._waypoints}set waypoints(t){this._waypoints=t}}tt.Airport,Ct.Airport,tt.Intersection,Ct.Intersection,tt.NDB,Ct.Ndb,tt.VOR,Ct.Vor,tt.USR,Ct.User,tt.VIS,Ct.Visual;class Ks{constructor(t,e=()=>{}){this.facilityRepo=t,this.onInitialized=e,void 0===Ks.facilityListener&&(Ks.facilityListener=RegisterViewListener("JS_LISTENER_FACILITY",(()=>{Ks.facilityListener.on("SendAirport",Ks.onFacilityReceived),Ks.facilityListener.on("SendIntersection",Ks.onFacilityReceived),Ks.facilityListener.on("SendVor",Ks.onFacilityReceived),Ks.facilityListener.on("SendNdb",Ks.onFacilityReceived),Ks.facilityListener.on("NearestSearchCompleted",Ks.onNearestSearchCompleted),Ks.facilityListener.on("NearestSearchCompletedWithStruct",Ks.onNearestSearchCompleted),setTimeout((()=>Ks.init()),2e3)}),!0)),this.awaitInitialization().then((()=>this.onInitialized()))}static init(){Ks.isInitialized=!0;for(const t of this.initPromiseResolveQueue)t();this.initPromiseResolveQueue.length=0}awaitInitialization(){return Ks.isInitialized?Promise.resolve():new Promise((t=>{Ks.initPromiseResolveQueue.push(t)}))}tryGetFacility(t,e,i){return this._tryGetFacility(t,e,i)}async getFacility(t,e,i){"string"==typeof e&&(e=Ji.stringV1ToValue(e));const s=await this._tryGetFacility(t,e,i);if(null===s)throw new Error(`FacilityLoader: facility could not be retrieved for ICAO ${Ji.tryValueToStringV2(e)}`);return s}getFacilities(t,e){return Promise.all(t.map((t=>Ji.isValueFacility(t)?this._tryGetFacility(Ji.getFacilityTypeFromValue(t),t,e):null)))}getFacilitiesOfType(t,e,i){return Promise.all(e.map((e=>Ji.isValueFacility(e)?this._tryGetFacility(t,e,i):null)))}async _tryGetFacility(t,e,i){switch(t){case tt.USR:case tt.RWY:case tt.VIS:return this.getFacilityFromRepo(t,e);case tt.Airport:return this.getFacilityFromCoherent(t,e,null!=i?i:ot.All);case tt.VOR:case tt.NDB:case tt.Intersection:return this.getFacilityFromCoherent(t,e);default:return console.warn(`FacilityLoader: facility request for facility type ${t} is unsupported.`),null}}async getFacilityFromRepo(t,e){const i=this.facilityRepo.get(e);if(i)return i;if(t===tt.RWY)try{const t=await this.getFacility(tt.Airport,Ji.value(Nt.Airport,"","",e.airport)),i=hs.matchOneWayRunwayFromIdent(t,e.ident);if(i){const e=hs.createRunwayFacility(t,i);return this.facilityRepo.add(e),e}}catch(t){}return console.warn(`FacilityLoader: facility ${Ji.tryValueToStringV2(e)} could not be found.`),null}async getFacilityFromCoherent(t,e,i=0){const s=Ji.getFacilityTypeFromValue(e)!==t;let r=Ks.requestQueue,n=Ks.facCache;s&&(r=Ks.mismatchRequestQueue,n=Ks.typeMismatchFacCache),Ks.isInitialized||await this.awaitInitialization();const a=Ji.getUid(e),o=n.get(a);if(void 0!==o){if(t!==tt.Airport||Ai.isAll(o.loadedDataFlags,i))return o;i|=o.loadedDataFlags}const c=Date.now(),h=r.get(a);return void 0===h||c-h.timeStamp>1e4?(void 0!==h&&(console.warn(`FacilityLoader: facility request for ${Ji.tryValueToStringV2(e)} has timed out.`),h.resolve(null)),this.dispatchCoherentFacilityRequest(r,void 0,t,e,i)):t!==tt.Airport||(null!=i||(i=0),Ai.isAll(h.airportDataFlags,i))?h.promise:this.dispatchCoherentFacilityRequest(r,h,t,e,i|h.airportDataFlags)}dispatchCoherentFacilityRequest(t,e,i,s,r=0){const n=Ji.getUid(s),a=i===tt.Airport;let o;const c={promise:new Promise((c=>{o=e?t=>{e.resolve(t),c(t)}:c;(a?Coherent.call(Ks.coherentLoadFacilityCalls[i],s,null!=r?r:ot.All):Coherent.call(Ks.coherentLoadFacilityCalls[i],s)).then((e=>{e||(console.warn(`FacilityLoader: facility ${Ji.tryValueToStringV2(s)} could not be found.`),o(null),t.delete(n))}))})),timeStamp:Date.now(),resolve:o,airportDataFlags:r};return t.set(n,c),c.promise}async tryGetAirway(t,e,i){return this._tryGetAirway(t,e,i)}async getAirway(t,e,i){"string"==typeof i&&(i=Ji.stringV1ToValue(i));const s=await this._tryGetAirway(t,e,i);if(s)return s;throw new Error(`FacilityLoader: airway ${t} could not be found on waypoint ${Ji.tryValueToStringV2(i)}.`)}async _tryGetAirway(t,e,i){if(Ks.airwayCache.has(t)){const e=Ks.airwayCache.get(t);if(void 0!==(null==e?void 0:e.waypoints.find((t=>Ji.valueEquals(t.icaoStruct,i)))))return e}const s=await this.getFacility(tt.Intersection,i),r=s.routes.find((e=>e.name===t));if(void 0!==r){const i=new rr(s,r,this);if(await i.startBuild()===Jt.COMPLETE){const s=i.waypoints;if(null!==s){const i=new Xs(t,e);return i.waypoints=s,Ks.addToAirwayCache(i),i}}}return null}async startNearestSearchSessionWithIcaoStructs(t){switch(t){case Ct.User:case Ct.Visual:return this.startRepoNearestSearchSession(t,Zt.Struct);case Ct.AllExceptVisual:return this.startCoherentNearestSearchSession(Ct.All,Zt.Struct);default:return this.startCoherentNearestSearchSession(t,Zt.Struct)}}async startNearestSearchSession(t){switch(t){case Ct.User:case Ct.Visual:return this.startRepoNearestSearchSession(t,Zt.StringV1);case Ct.AllExceptVisual:return this.startCoherentNearestSearchSession(Ct.All,Zt.StringV1);default:return this.startCoherentNearestSearchSession(t,Zt.StringV1)}}async startCoherentNearestSearchSession(t,e){Ks.isInitialized||await this.awaitInitialization();const i=await Coherent.call(e===Zt.Struct?"START_NEAREST_SEARCH_SESSION_WITH_STRUCT":"START_NEAREST_SEARCH_SESSION",t);let s;switch(t){case Ct.Airport:s=new Js(i,e);break;case Ct.Intersection:s=new tr(i,e);break;case Ct.Vor:s=new er(i,e);break;case Ct.Boundary:s=new ir(i);break;default:s=new Zs(i,e)}return Ks.searchSessions.set(i,s),s}startRepoNearestSearchSession(t,e){const i=Ks.repoSearchSessionId--;switch(t){case Ct.User:return new sr(this.facilityRepo,i,tt.USR,e);case Ct.Visual:return new sr(this.facilityRepo,i,tt.VIS,e);default:throw new Error}}async getMetar(t){Ks.isInitialized||await this.awaitInitialization();const e="string"==typeof t?t:t.icaoStruct.ident,i=await Coherent.call("GET_METAR_BY_IDENT",e);return Ks.cleanMetar(i)}async searchMetar(t,e){Ks.isInitialized||await this.awaitInitialization();const i=await Coherent.call("GET_METAR_BY_LATLON",t,e);return Ks.cleanMetar(i)}static cleanMetar(t){var e;if(""!==t.icao)return t.windSpeed<0&&delete t.windSpeed,t.maxWindDir<0&&delete t.maxWindDir,t.minWindDir<0&&delete t.minWindDir,t.windDir<0&&delete t.windDir,t.gust<0&&delete t.gust,null!==(e=t.cavok)&&void 0!==e||(t.cavok=!1),null===t.vis&&delete t.vis,null===t.vertVis&&delete t.vertVis,-2147483648===t.temp&&delete t.temp,-2147483648===t.dew&&delete t.dew,t.altimeterA<0&&delete t.altimeterA,t.altimeterQ<0&&delete t.altimeterQ,t.slp<0&&delete t.slp,t}async getTaf(t){Ks.isInitialized||await this.awaitInitialization();const e="string"==typeof t?t:t.icaoStruct.ident,i=await Coherent.call("GET_TAF_BY_IDENT",e);return Ks.cleanTaf(i)}async searchTaf(t,e){Ks.isInitialized||await this.awaitInitialization();const i=await Coherent.call("GET_TAF_BY_LATLON",t,e);return Ks.cleanTaf(i)}static cleanTaf(t){var e;if(""!==t.icao){for(const e of t.conditionChangeGroups)e.windSpeed<0&&delete e.windSpeed,e.windDir<0&&delete e.windDir,e.gust<0&&delete e.gust,null===e.vis&&delete e.vis,null===e.vertVis&&delete e.vertVis;return t.windSpeed<0&&delete t.windSpeed,t.maxWindDir<0&&delete t.maxWindDir,t.minWindDir<0&&delete t.minWindDir,t.windDir<0&&delete t.windDir,t.gust<0&&delete t.gust,null!==(e=t.cavok)&&void 0!==e||(t.cavok=!1),null===t.vis&&delete t.vis,null===t.vertVis&&delete t.vertVis,t.altimeterA<0&&delete t.altimeterA,t.altimeterQ<0&&delete t.altimeterQ,t.slp<0&&delete t.slp,t}}async searchByIdentWithIcaoStructs(t,e,i=40){let s;if(Ks.isInitialized||await this.awaitInitialization(),t!==Ct.User&&t!==Ct.Visual){const r=t===Ct.AllExceptVisual?Ct.All:t;s=await Coherent.call("SEARCH_BY_IDENT_WITH_STRUCT",e,r,i)}else s=[];const r=Ks.facRepositorySearchTypes[t];return r&&this.facilityRepo.forEach((t=>{const i=t.icaoStruct.ident;i===e?s.unshift(t.icaoStruct):i.startsWith(e)&&s.push(t.icaoStruct)}),r),s}async searchByIdent(t,e,i=40){let s;if(Ks.isInitialized||await this.awaitInitialization(),t!==Ct.User&&t!==Ct.Visual){const r=t===Ct.AllExceptVisual?Ct.All:t;s=await Coherent.call("SEARCH_BY_IDENT",e,r,i)}else s=[];const r=Ks.facRepositorySearchTypes[t];return r&&this.facilityRepo.forEach((t=>{const i=Ji.getIdent(t.icao);i===e?s.unshift(t.icao):i.startsWith(e)&&s.push(t.icao)}),r),s}async findNearestFacilitiesByIdent(t,e,i,s,r=40){const n=await this.searchByIdentWithIcaoStructs(t,e,r);if(!n)return[];const a=[];for(let t=0;t1?(o.sort(((t,e)=>Di.distance(i,s,t.lat,t.lon)-Di.distance(i,s,e.lat,e.lon))),o):1===o.length?o:[]}static onFacilityReceived(t){const e="JS_FacilityIntersection"===t.__Type&&t.icaoStruct.type!==Nt.Waypoint,i=e?Ks.mismatchRequestQueue:Ks.requestQueue,s=Ji.getUid(t.icaoStruct),r=i.get(s);if(void 0!==r){if(ts.isFacilityType(t,tt.Airport)&&!Ai.isAll(t.loadedDataFlags,r.airportDataFlags))return;r.resolve(t),Ks.addToFacilityCache(t,e),i.delete(s)}}static onNearestSearchCompleted(t){const e=Ks.searchSessions.get(t.sessionId);e instanceof Qs&&e.onSearchCompleted(t)}static addToFacilityCache(t,e){const i=e?Ks.typeMismatchFacCache:Ks.facCache;i.set(Ji.getUid(t.icaoStruct),t),i.size>Ks.MAX_FACILITY_CACHE_ITEMS&&i.delete(i.keys().next().value)}static addToAirwayCache(t){Ks.airwayCache.set(t.name,t),Ks.airwayCache.size>Ks.MAX_AIRWAY_CACHE_ITEMS&&Ks.airwayCache.delete(Ks.airwayCache.keys().next().value)}static getDatabaseCycles(){if(void 0===Ks.databaseCycleCache){const t=SimVar.GetGameVarValue("FLIGHT NAVDATA DATE RANGE",l.String);let e=ks.parseFacilitiesCycle(t);void 0===e&&(console.error("FacilityLoader: Could not get facility database AIRAC cycle! Falling back to current cycle."),e=ks.getCurrentCycle(new Date));const i=ks.getOffsetCycle(e,-1),s=ks.getOffsetCycle(e,1);Ks.databaseCycleCache={previous:i,current:e,next:s}}return Ks.databaseCycleCache}}Ks.MAX_FACILITY_CACHE_ITEMS=1e3,Ks.MAX_AIRWAY_CACHE_ITEMS=1e3,Ks.coherentLoadFacilityCalls={[tt.Airport]:"LOAD_AIRPORT_FROM_STRUCT",[tt.VOR]:"LOAD_VOR_FROM_STRUCT",[tt.NDB]:"LOAD_NDB_FROM_STRUCT",[tt.Intersection]:"LOAD_INTERSECTION_FROM_STRUCT"},Ks.requestQueue=new Map,Ks.mismatchRequestQueue=new Map,Ks.facCache=new Map,Ks.typeMismatchFacCache=new Map,Ks.airwayCache=new Map,Ks.searchSessions=new Map,Ks.facRepositorySearchTypes={[Ct.All]:[tt.USR,tt.VIS],[Ct.User]:[tt.USR],[Ct.Visual]:[tt.VIS],[Ct.AllExceptVisual]:[tt.USR]},Ks.repoSearchSessionId=-1,Ks.isInitialized=!1,Ks.initPromiseResolveQueue=[];class Qs{constructor(t){this.sessionId=t,this.searchRequestResolves=new Map,this.searchResultQueue=[],this.isDequeueActive=!1}searchNearest(t,e,i,s){return new Promise((r=>{Coherent.call("SEARCH_NEAREST",this.sessionId,t,e,i,s).then((t=>{this.searchRequestResolves.set(t,r),this.dequeueResults()}))}))}onSearchCompleted(t){this.searchResultQueue.push(t),this.dequeueResults()}dequeueResults(){if(!this.isDequeueActive){for(this.isDequeueActive=!0;this.searchResultQueue.length>0;){const t=this.searchResultQueue[0],e=this.searchRequestResolves.get(t.searchId);if(!e)break;this.searchResultQueue.shift(),this.searchRequestResolves.delete(t.searchId),e(t)}this.isDequeueActive=!1}}}class Zs extends Qs{constructor(t,e){super(t),this.icaoDataType=e}}class Js extends Zs{setAirportFilter(t,e){Coherent.call("SET_NEAREST_AIRPORT_FILTER",this.sessionId,t?1:0,e)}setExtendedAirportFilters(t,e,i,s){Coherent.call("SET_NEAREST_EXTENDED_AIRPORT_FILTERS",this.sessionId,t,e,i,s)}}Js.Defaults={ShowClosed:!1,ClassMask:Ai.union(Ai.createFlag(ct.HardSurface),Ai.createFlag(ct.SoftSurface),Ai.createFlag(ct.AllWater),Ai.createFlag(ct.HeliportOnly),Ai.createFlag(ct.Private)),SurfaceTypeMask:2147483647,ApproachTypeMask:2147483647,MinimumRunwayLength:0,ToweredMask:3};class tr extends Zs{setIntersectionFilter(t,e=!0){Coherent.call("SET_NEAREST_INTERSECTION_FILTER",this.sessionId,t,e?1:0)}}tr.Defaults={TypeMask:Ai.union(Ai.createFlag(lt.Named),Ai.createFlag(lt.Unnamed),Ai.createFlag(lt.Offroute),Ai.createFlag(lt.IAF),Ai.createFlag(lt.FAF))};class er extends Zs{setVorFilter(t,e){Coherent.call("SET_NEAREST_VOR_FILTER",this.sessionId,t,e)}}er.Defaults={ClassMask:Ai.union(Ai.createFlag(_t.Terminal),Ai.createFlag(_t.HighAlt),Ai.createFlag(_t.LowAlt)),TypeMask:Ai.union(Ai.createFlag(St.VOR),Ai.createFlag(St.DME),Ai.createFlag(St.VORDME),Ai.createFlag(St.VORTAC),Ai.createFlag(St.TACAN))};class ir extends Qs{setBoundaryFilter(t){Coherent.call("SET_NEAREST_BOUNDARY_FILTER",this.sessionId,t)}}class sr{constructor(t,e,i,s){this.repo=t,this.sessionId=e,this.facilityType=i,this.icaoDataType=s,this.filter=void 0,this.cachedResults=new Map,this.searchId=0}searchNearest(t,e,i,s){const r=gi.METER.convertTo(i,gi.GA_RADIAN),n=this.repo.search(this.facilityType,t,e,r,s,[],this.filter),a=[];if(this.icaoDataType===Zt.Struct)for(let t=0;tJi.valueEquals(t.icaoStruct,r)))){const t=await this.facilityLoader.getFacility(tt.Intersection,r);e(t);const n=t.routes.find((t=>t.name===s.name));void 0!==n?s=n:i=!0}else i=!0}}async _stepForward(){if(null!==this._waypointsArray)return this._step(!0,this._waypointsArray.push.bind(this._waypointsArray))}async _stepBackward(){if(null!==this._waypointsArray)return this._step(!1,this._waypointsArray.unshift.bind(this._waypointsArray))}startBuild(){return this.hasStarted?Promise.reject(new Error("Airway builder has already started building.")):new Promise((t=>{this._hasStarted=!0,null!==this._waypointsArray&&(this._waypointsArray.push(this._initialWaypoint),Promise.all([this._stepForward(),this._stepBackward()]).then((()=>{this._isDone=!0,t(Jt.COMPLETE)})).catch((()=>{this._isDone=!0,t(Jt.PARTIAL)})))}))}}!function(t){t.Add="Add",t.Remove="Remove",t.DumpRequest="DumpRequest",t.DumpResponse="DumpResponse"}(te||(te={}));class nr{constructor(t){this.bus=t,this.publisher=this.bus.getPublisher(),this.repos=new Map,this.trees={[tt.USR]:new qs(nr.treeKeyFunc),[tt.VIS]:new qs(nr.treeKeyFunc)},this.ignoreSync=!1,t.getSubscriber().on(nr.SYNC_TOPIC).handle(this.onSyncEvent.bind(this)),this.pubSyncEvent({type:te.DumpRequest,uid:this.lastDumpRequestUid=Math.random()*Number.MAX_SAFE_INTEGER})}size(t){var e,i;let s=0;if(void 0===t)for(const t of this.repos.values())s+=t.size;else for(let r=0;rJi.isValue(t)?t:t.icaoStruct))})}forEach(t,e){var i;if(void 0===e)for(const e of this.repos.values())e.forEach(t);else for(let s=0;sts.isFacilityType(t,tt.USR)));if(r.length>0){const t=i.filter((t=>ts.isFacilityType(t,tt.USR)));this.trees[tt.USR].removeAndInsert(t,r)}const n=t.filter((t=>ts.isFacilityType(t,tt.VIS)));if(n.length>0){const t=i.filter((t=>ts.isFacilityType(t,tt.VIS)));this.trees[tt.VIS].removeAndInsert(t,n)}for(let t=0;tts.isFacilityType(t,tt.USR)));i.length>0&&this.trees[tt.USR].removeAll(i);const s=e.filter((t=>ts.isFacilityType(t,tt.VIS)));s.length>0&&this.trees[tt.VIS].removeAll(s);for(let t=0;te.push(t))),this.pubSyncEvent({type:te.DumpResponse,uid:t.uid,facs:e})}}}static getRepository(t){var e;return null!==(e=nr.INSTANCE)&&void 0!==e?e:nr.INSTANCE=new nr(t)}}nr.SYNC_TOPIC="facilityrepo_sync",nr.treeKeyFunc=(t,e)=>Di.sphericalToCartesian(t,e),function(t){t[t.Undefined=-1]="Undefined",t[t.Knot=0]="Knot",t[t.MeterPerSecond=1]="MeterPerSecond",t[t.KilometerPerHour=2]="KilometerPerHour"}(ee||(ee={})),function(t){t[t.Undefined=-1]="Undefined",t[t.Meter=0]="Meter",t[t.StatuteMile=1]="StatuteMile"}(ie||(ie={})),function(t){t[t.SkyClear=0]="SkyClear",t[t.Clear=1]="Clear",t[t.NoSignificant=2]="NoSignificant",t[t.Few=3]="Few",t[t.Scattered=4]="Scattered",t[t.Broken=5]="Broken",t[t.Overcast=6]="Overcast"}(se||(se={})),function(t){t[t.Unspecified=-1]="Unspecified",t[t.ToweringCumulus=0]="ToweringCumulus",t[t.Cumulonimbus=1]="Cumulonimbus",t[t.AltocumulusCastellanus=2]="AltocumulusCastellanus"}(re||(re={})),function(t){t[t.None=0]="None",t[t.Mist=1]="Mist",t[t.Duststorm=2]="Duststorm",t[t.Dust=3]="Dust",t[t.Drizzle=4]="Drizzle",t[t.FunnelCloud=5]="FunnelCloud",t[t.Fog=6]="Fog",t[t.Smoke=7]="Smoke",t[t.Hail=8]="Hail",t[t.SmallHail=9]="SmallHail",t[t.Haze=10]="Haze",t[t.IceCrystals=11]="IceCrystals",t[t.IcePellets=12]="IcePellets",t[t.DustSandWhorls=13]="DustSandWhorls",t[t.Spray=14]="Spray",t[t.Rain=15]="Rain",t[t.Sand=16]="Sand",t[t.SnowGrains=17]="SnowGrains",t[t.Shower=18]="Shower",t[t.Snow=19]="Snow",t[t.Squalls=20]="Squalls",t[t.Sandstorm=21]="Sandstorm",t[t.UnknownPrecip=22]="UnknownPrecip",t[t.VolcanicAsh=23]="VolcanicAsh"}(ne||(ne={})),function(t){t[t.Light=-1]="Light",t[t.Normal=0]="Normal",t[t.Heavy=1]="Heavy"}(ae||(ae={})),function(t){t[t.Undefined=-1]="Undefined",t[t.LIFR=0]="LIFR",t[t.IFR=1]="IFR",t[t.MVFR=2]="MVFR",t[t.VFR=3]="VFR"}(oe||(oe={})),function(t){t[t.Undefined=-1]="Undefined",t[t.FM=0]="FM",t[t.TEMPO=1]="TEMPO",t[t.PROB=2]="PROB",t[t.BECMG=3]="BECMG",t[t.RMK=4]="RMK"}(ce||(ce={})),function(t){t[t.Direct=0]="Direct",t[t.Teardrop=1]="Teardrop",t[t.Parallel=2]="Parallel",t[t.None=3]="None"}(he||(he={})),function(t){t[t.Faa=0]="Faa",t[t.Icao=1]="Icao"}(le||(le={})),new Map([[Ct.Airport,tt.Airport],[Ct.Intersection,tt.Intersection],[Ct.Vor,tt.VOR],[Ct.Ndb,tt.NDB],[Ct.User,tt.USR]]);class ar extends Wi{constructor(t,e){super(),this.innerSubscription=t,this.sortFunc=(t,e)=>this.pos.distance(t)-this.pos.distance(e),this.facilities=[],this.derivedMaxItems=0,this.searchInProgress=!1,this.pos=new Di(0,0),this.diffMap=new Map,this.updatePromiseResolves=[],this.absoluteMaxItems=yi.toSubscribable(e,!0)}get length(){return this.facilities.length}getArray(){return this.facilities}get started(){return this.innerSubscription.started}awaitStart(){return this.innerSubscription.awaitStart()}start(){return this.innerSubscription.start()}update(t,e,i,s){return new Promise((r=>{this.updatePromiseResolves.push(r),this.searchInProgress||this.doUpdate(t,e,i,s)}))}async doUpdate(t,e,i,s){if(this.searchInProgress=!0,this.pos.set(t,e),(s=Math.max(0,s))>this.derivedMaxItems&&(this.derivedMaxItems=s),await this.innerSubscription.update(t,e,i,this.derivedMaxItems),this.innerSubscription.length>s)this.derivedMaxItems=Math.max(Math.round(this.derivedMaxItems-this.derivedMaxItems*ar.RAMP_DOWN_FACTOR),s);else{const r=this.absoluteMaxItems.get();for(;this.innerSubscription.lengths)if(s>1){const t=Array.from(this.innerSubscription.getArray()).sort(this.sortFunc);t.length=s,this.diffAndNotify(t)}else 1===s?this.diffAndNotify([this.findNearest(this.innerSubscription.getArray())]):this.diffAndNotify(ar.EMPTY_ARRAY);else this.diffAndNotify(this.innerSubscription.getArray());this.searchInProgress=!1,this.updatePromiseResolves.forEach((t=>{t()})),this.updatePromiseResolves.length=0}findNearest(t){let e=t[0],i=this.pos.distance(e);for(let s=1;s=0;t--){const e=this.facilities[t];this.diffMap.has(e.icao)?this.diffMap.delete(e.icao):(this.facilities.splice(t,1),this.notify(t,$.Removed,e))}for(const t of this.diffMap.values())this.facilities.push(t),this.notify(this.facilities.length-1,$.Added,t);this.diffMap.clear()}}}ar.RAMP_UP_FACTOR=1.33,ar.RAMP_DOWN_FACTOR=.1,ar.EMPTY_ARRAY=[],new Zi,new Zi;class or{constructor(t){this.tasks=t,this.head=0}hasNext(){return this.head()=>{n.added[e]=this.cache.get(t)}));return await new Promise((t=>{new cr(new or(a),new lr(this.frameBudget,t)).start()})),n}setFilter(t){this.session.setBoundaryFilter(t)}}class lr{constructor(t,e){this.frameBudget=t,this.resolve=e}onStarted(){}canContinue(t,e,i){return i{this.canvas.style.transform=t}),!0)}get reference(){return this._reference}get transform(){return this._transform}get isInvalid(){return this._isInvalid}get geoProjection(){return this._geoProjection}syncWithMapProjection(t){const e=Ti.set(this.canvas.width/2,this.canvas.height/2,pr.tempVec2_1);this._reference.syncWithMapProjection(t),this._geoProjection.copyParametersFrom(t.getGeoProjection()).setTranslation(e),this._transform.update(t,this.reference,this.getReferenceMargin()),this._isInvalid=!1,this.isDisplayed&&this.transformCanvasElement()}syncWithCanvasInstance(t){this._reference.syncWithReference(t.reference),this._geoProjection.copyParametersFrom(t.geoProjection),this._transform.copyFrom(t.transform),this._isInvalid=t.isInvalid,this.isDisplayed&&!this._isInvalid&&this.transformCanvasElement()}updateTransform(t){if(this._transform.update(t,this.reference,this.getReferenceMargin()),!this._isInvalid){const e=t.getScaleFactor()/this._reference.scaleFactor;this._isInvalid=e>=pr.SCALE_INVALIDATION_THRESHOLD||e<=1/pr.SCALE_INVALIDATION_THRESHOLD||this._transform.marginRemaining<0}this.isDisplayed&&!this._isInvalid&&this.transformCanvasElement()}transformCanvasElement(){const t=this.transform,e=t.translation[0]/t.scale,i=t.translation[1]/t.scale;this.canvasTransform.transform.getChild(0).set(t.scale,t.scale,.001),this.canvasTransform.transform.getChild(1).set(e,i,.1),this.canvasTransform.transform.getChild(2).set(t.rotation,1e-4),this.canvasTransform.resolve()}invalidate(){this._isInvalid=!0,this.clear()}}pr.SCALE_INVALIDATION_THRESHOLD=1.2,pr.tempVec2_1=new Float64Array(2);class gr extends Gs{constructor(t){super(t),this.size=0,this.referenceMargin=0,this.needUpdateTransforms=!1,this.props.overdrawFactor=Math.max(1,this.props.overdrawFactor)}getSize(){return this.size}getReferenceMargin(){return this.referenceMargin}onAttached(){super.onAttached(),this.updateFromProjectedSize(this.props.mapProjection.getProjectedSize()),this.needUpdateTransforms=!0}createCanvasInstance(t,e,i){return new pr(t,e,i,this.getReferenceMargin.bind(this))}updateFromProjectedSize(t){const e=t[0],i=t[1],s=Math.hypot(e,i);this.size=s*this.props.overdrawFactor,this.referenceMargin=(this.size-s)/2,this.setWidth(this.size),this.setHeight(this.size);const r=(e-this.size)/2,n=(i-this.size)/2,a=this.display.canvas;a.style.left=`${r}px`,a.style.top=`${n}px`}onMapProjectionChanged(t,e){var i;Ai.isAll(e,zt.ProjectedSize)&&(this.updateFromProjectedSize(t.getProjectedSize()),this.display.invalidate(),null===(i=this.tryGetBuffer())||void 0===i||i.invalidate()),this.needUpdateTransforms=!0}onUpdated(t,e){super.onUpdated(t,e),this.needUpdateTransforms&&this.updateTransforms()}updateTransforms(){var t;const e=this.props.mapProjection;this.display.updateTransform(e),null===(t=this.tryGetBuffer())||void 0===t||t.updateTransform(e),this.needUpdateTransforms=!1}}class fr extends Vs{constructor(){var t,e;super(...arguments),this.canvasLayerRef=z.createRef(),this.clipBoundsSub=Ii.createFromVector(new Float64Array(4)),this.facLoader=new Ks(nr.getRepository(this.props.bus),(async()=>{this.searchSession=new hr(this.props.lodBoundaryCache,await this.facLoader.startNearestSearchSession(Ct.Boundary),.5),this.isAttached&&this.scheduleSearch(0,!0)})),this.searchedAirspaces=new Map,this.searchDebounceDelay=null!==(t=this.props.searchDebounceDelay)&&void 0!==t?t:fr.DEFAULT_SEARCH_DEBOUNCE_DELAY,this.renderTimeBudget=null!==(e=this.props.renderTimeBudget)&&void 0!==e?e:fr.DEFAULT_RENDER_TIME_BUDGET,this.activeRenderProcess=null,this.renderTaskQueueHandler={renderTimeBudget:this.renderTimeBudget,onStarted(){},canContinue(t,e,i){return i{const e=t.asUnit(gi.METER);(ethis.lastDesiredSearchRadius)&&this.scheduleSearch(0,!1)})),this.props.maxSearchItemCount.sub((()=>{this.scheduleSearch(0,!1)})),this.initModuleListeners(),this.isAttached=!0,this.searchSession&&this.scheduleSearch(0,!0)}initModuleListeners(){const t=this.props.model.getModule("airspace");for(const e of Object.values(t.show))e.sub(this.onAirspaceTypeShowChanged.bind(this))}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e),Ai.isAll(e,zt.ProjectedSize)&&this.updateClipBounds()}updateClipBounds(){const t=this.canvasLayerRef.instance.getSize();this.clipBoundsSub.set(-fr.CLIP_BOUNDS_BUFFER,-fr.CLIP_BOUNDS_BUFFER,t+fr.CLIP_BOUNDS_BUFFER,t+fr.CLIP_BOUNDS_BUFFER)}scheduleSearch(t,e){this.searchSession&&(this.searchDebounceTimer=t,this.isSearchScheduled=!0,this.needRefilter||(this.needRefilter=e))}scheduleRender(){this.isRenderScheduled=!0}async searchAirspaces(t){this.isSearchBusy=!0;const e=this.props.mapProjection.getCenter(),i=this.canvasLayerRef.instance.display.canvas.width*Math.SQRT2;this.lastDesiredSearchRadius=gi.GA_RADIAN.convertTo(this.props.mapProjection.getProjectedResolution()*i/2,gi.METER),this.lastSearchRadius=Math.min(this.props.maxSearchRadius.get().asUnit(gi.METER),this.lastDesiredSearchRadius);const s=this.searchSession;t&&s.setFilter(this.getBoundaryFilter());const r=await s.searchNearest(e.lat,e.lon,this.lastSearchRadius,this.props.maxSearchItemCount.get());for(let t=0;t0&&a0}selectLod(t){const e=this.props.lodBoundaryCache.lodDistanceThresholds;let i=e.length-1;for(;i>=0&&!(2*t>=e[i]);)i--;return i}cleanUpRender(){this.canvasLayerRef.instance.buffer.reset(),this.activeRenderProcess=null}renderAirspacesToDisplay(){const t=this.canvasLayerRef.instance.display,e=this.canvasLayerRef.instance.buffer;t.clear(),t.syncWithCanvasInstance(e),this.canvasLayerRef.instance.copyBufferToDisplay()}onRenderPaused(){this.isDisplayInvalidated&&this.renderAirspacesToDisplay()}onRenderFinished(){this.renderAirspacesToDisplay(),this.cleanUpRender(),this.isDisplayInvalidated=!1}onRenderAborted(){this.cleanUpRender()}onAirspaceTypeShowChanged(){this.scheduleSearch(0,!0)}render(){return z.buildComponent(gr,{ref:this.canvasLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,useBuffer:!0,overdrawFactor:Math.SQRT2})}}fr.DEFAULT_SEARCH_DEBOUNCE_DELAY=500,fr.DEFAULT_RENDER_TIME_BUDGET=.2,fr.BACKGROUND_RENDER_MARGIN_THRESHOLD=.1,fr.CLIP_BOUNDS_BUFFER=10,fr.geoPointCache=[new Di(0,0)],fr.vec2Cache=[new Float64Array(2)];class mr{static formatNumber(t,e){if(isNaN(t))return e.cachedNumber=void 0,e.cachedString=void 0,e.nanString;if(!isFinite(t))return e.cachedNumber=void 0,e.cachedString=void 0,t>0?e.posInfinityString:e.negInfinityString;const{precision:i,roundFunc:s,hysteresisOffsetLower:r,hysteresisOffsetUpper:n,maxDigits:a,forceDecimalZeroes:o,pad:c,showCommas:h,useMinusSign:l,forceSign:u,hideSign:d,cache:p}=e;if(void 0!==e.cachedNumber&&void 0!==e.cachedString&&(0!==r||0!==n))if(e.round>0){if(t>e.cachedNumber+r&&t<=e.cachedNumber+n)return e.cachedString}else if(t>=e.cachedNumber+r&&t=0?f.toFixed(t.length-e-1):`${f}`}else m=`${f}`;let A=m.indexOf(".");!o&&A>=0&&(m=m.replace(mr.TRAILING_ZERO_REGEX,""),m.indexOf(".")==m.length-1&&(m=m.substring(0,m.length-1)));let y=!1,S=0;do{if(A=m.indexOf("."),0===c?A>0&&(m=m.replace(mr.LEADING_ZERO_REGEX,".")):c>1&&(A<0&&(A=m.length),A=0&&m.length-1>a){const t=Math.max(a-A,0),e=Math.pow(.1,t);g=s(g/e)*e,m=Math.abs(g).toFixed(t),y=0!==c||t>0}else y=!1;S++}while(y&&S<2);if(h){const t=m.split(".");t[0]=t[0].replace(mr.COMMAS_REGEX,","),m=t.join(".")}const v=-1===(g<0?-1:1)?l?"−":"-":"+";return d||!u&&"+"===v||(m=v+m),p&&(e.cachedString=m),m}static resolveOptions(t){var e;const i={};for(const s in mr.DEFAULT_OPTIONS)i[s]=null!==(e=null==t?void 0:t[s])&&void 0!==e?e:mr.DEFAULT_OPTIONS[s];let s,r;"number"==typeof i.hysteresis?s=r=Math.max(0,i.hysteresis):(s=Math.max(0,i.hysteresis[0]),r=Math.max(0,i.hysteresis[1])),delete i.hysteresis;const n=i;return n.round>0?(n.roundFunc=Math.ceil,n.hysteresisOffsetLower=-(n.precision+s),n.hysteresisOffsetUpper=r):n.round<0?(n.roundFunc=Math.floor,n.hysteresisOffsetLower=-s,n.hysteresisOffsetUpper=n.precision+r):(n.roundFunc=Math.round,n.hysteresisOffsetLower=-(.5*n.precision+s),n.hysteresisOffsetUpper=.5*n.precision+r),n.cache||(n.cache=0!==n.hysteresisOffsetLower||0!==n.hysteresisOffsetUpper),n}static create(t){const e=mr.resolveOptions(t);return t=>mr.formatNumber(t,e)}}mr.DEFAULT_OPTIONS={precision:0,round:_.Nearest,hysteresis:0,maxDigits:1/0,forceDecimalZeroes:!0,pad:1,showCommas:!1,useMinusSign:!1,forceSign:!1,hideSign:!1,nanString:"NaN",posInfinityString:"Infinity",negInfinityString:"-Infinity",cache:!1},mr.TRAILING_ZERO_REGEX=/0+$/,mr.LEADING_ZERO_REGEX=/^0\./,mr.COMMAS_REGEX=/\B(?=(\d{3})+(?!\d))/g;class Ar{constructor(t=0){this.svgPath="",this.firstPoint=new Float64Array([NaN,NaN]),this.prevPoint=new Float64Array([NaN,NaN]),this.precision=t,this.formatter=mr.create({precision:t,forceDecimalZeroes:!1})}getSvgPath(){return this.svgPath.trim()}getPrecision(){return this.precision}setPrecision(t){this.precision=Math.abs(t),this.formatter=mr.create({precision:this.precision,forceDecimalZeroes:!1})}beginPath(){this.reset()}moveTo(t,e){isFinite(t)&&isFinite(e)&&(isNaN(this.firstPoint[0])&&Ti.set(t,e,this.firstPoint),this.svgPath+=`M ${this.formatter(t)} ${this.formatter(e)} `,Ti.set(t,e,this.prevPoint))}lineTo(t,e){isFinite(t)&&isFinite(e)&&(isNaN(this.prevPoint[0])?this.moveTo(t,e):(this.svgPath+=`L ${this.formatter(t)} ${this.formatter(e)} `,Ti.set(t,e,this.prevPoint)))}bezierCurveTo(t,e,i,s,r,n){isFinite(r)&&isFinite(n)&&isFinite(t)&&isFinite(e)&&isFinite(i)&&isFinite(s)&&(isNaN(this.prevPoint[0])?this.moveTo(r,n):(this.svgPath+=`C ${this.formatter(t)} ${this.formatter(e)} ${this.formatter(i)} ${this.formatter(s)} ${this.formatter(r)} ${this.formatter(n)} `,Ti.set(r,n,this.prevPoint)))}quadraticCurveTo(t,e,i,s){isFinite(i)&&isFinite(s)&&isFinite(t)&&isFinite(e)&&(isNaN(this.prevPoint[0])?this.moveTo(i,s):(this.svgPath+=`Q ${this.formatter(t)} ${this.formatter(e)} ${this.formatter(i)} ${this.formatter(s)} `,Ti.set(i,s,this.prevPoint)))}arc(t,e,i,s,r,n){if(!(isFinite(t)&&isFinite(e)&&isFinite(i)&&isFinite(s)&&isFinite(r)))return;const a=n?-1:1;if(Math.sign(r-s)!==a){r=s+(n?mi.diffAngle(r,s):mi.diffAngle(s,r))*a}const o=Math.min(mi.TWO_PI,(r-s)*a);if(o===mi.TWO_PI){const r=s+Math.PI*a;return this.arc(t,e,i,s,r,n),void this.arc(t,e,i,r,s,n)}const c=Ti.add(Ti.set(t,e,Ar.vec2Cache[0]),Ti.setFromPolar(i,s,Ar.vec2Cache[2]),Ar.vec2Cache[0]);isNaN(this.prevPoint[0])?this.moveTo(c[0],c[1]):Ti.equals(this.prevPoint,c)||this.lineTo(c[0],c[1]);const h=Ti.add(Ti.set(t,e,Ar.vec2Cache[1]),Ti.setFromPolar(i,r,Ar.vec2Cache[2]),Ar.vec2Cache[1]),l=this.formatter(i);this.svgPath+=`A ${l} ${l} 0 ${o>Math.PI?1:0} ${n?0:1} ${this.formatter(h[0])} ${this.formatter(h[1])} `,Ti.copy(h,this.prevPoint)}closePath(){isNaN(this.firstPoint[0])||this.lineTo(this.firstPoint[0],this.firstPoint[1])}reset(){Ti.set(NaN,NaN,this.firstPoint),Ti.set(NaN,NaN,this.prevPoint),this.svgPath=""}}Ar.vec2Cache=[new Float64Array(2),new Float64Array(2),new Float64Array(2),new Float64Array(2)];class yr{}yr.TargetControl="targetControlModerator",yr.RotationControl="rotationControlModerator",yr.RangeControl="rangeControlModerator",yr.ClockUpdate="clockUpdate",yr.OwnAirplaneProps="ownAirplaneProps",yr.AutopilotProps="autopilotProps",yr.AltitudeArc="altitudeArc",yr.TerrainColors="terrainColors",yr.Weather="weather",yr.FollowAirplane="followAirplane",yr.Rotation="rotation",yr.OwnAirplaneIcon="ownAirplaneIcon",yr.OwnAirplaneIconOrientation="ownAirplaneIconOrientation",yr.TextLayer="text",yr.TextManager="textManager",yr.Bing="bing",yr.WaypointRenderer="waypointRenderer",yr.IconFactory="iconFactory",yr.LabelFactory="labelFactory",yr.NearestWaypoints="nearestWaypoints",yr.FlightPlan="flightPlan",yr.FlightPlanner="flightPlanner",yr.FlightPathRenderer="flightPathRenderer",yr.Airspace="airspace",yr.AirspaceManager="airspaceRenderManager",yr.Traffic="traffic",yr.DataIntegrity="dataIntegrity",yr.PlanAirportsLayer="plan-airports",yr.WaypointDisplayController="WaypointDisplayController";class Sr extends Vs{constructor(){var t,e,i,s,r,n,a,o;super(...arguments),this.layerRef=z.createRef(),this.arcAngularWidth=(null!==(t=this.props.arcAngularWidth)&&void 0!==t?t:Sr.DEFAULT_ARC_ANGULAR_WIDTH)*Avionics.Utils.DEG2RAD,this.arcRadius=null!==(e=this.props.arcRadius)&&void 0!==e?e:Sr.DEFAULT_ARC_RADIUS,this.strokeWidth=null!==(i=this.props.strokeWidth)&&void 0!==i?i:Sr.DEFAULT_STROKE_WIDTH,this.strokeStyle=null!==(s=this.props.strokeStyle)&&void 0!==s?s:Sr.DEFAULT_STROKE_STYLE,this.strokeLineCap=null!==(r=this.props.strokeLineCap)&&void 0!==r?r:Sr.DEFAULT_STROKE_LINECAP,this.outlineWidth=null!==(n=this.props.outlineWidth)&&void 0!==n?n:Sr.DEFAULT_OUTLINE_WIDTH,this.outlineStyle=null!==(a=this.props.outlineStyle)&&void 0!==a?a:Sr.DEFAULT_OUTLINE_STYLE,this.outlineLineCap=null!==(o=this.props.outlineLineCap)&&void 0!==o?o:Sr.DEFAULT_OUTLINE_LINECAP,this.ownAirplanePropsModule=this.props.model.getModule(yr.OwnAirplaneProps),this.autopilotModule=this.props.model.getModule(yr.AutopilotProps),this.vsPrecisionFpm="isSubscribable"in this.props.verticalSpeedPrecision?this.vsPrecisionMap=this.props.verticalSpeedPrecision.map((t=>t.asUnit(gi.FPM))):ai.create(this.props.verticalSpeedPrecision.asUnit(gi.FPM)),this.vsThresholdFpm="isSubscribable"in this.props.verticalSpeedThreshold?this.vsThresholdMap=this.props.verticalSpeedThreshold.map((t=>t.asUnit(gi.FPM))):ai.create(this.props.verticalSpeedThreshold.asUnit(gi.FPM)),this.altDevThresholdFeet="isSubscribable"in this.props.altitudeDeviationThreshold?this.altDevThresholdMap=this.props.altitudeDeviationThreshold.map((t=>t.asUnit(gi.FOOT))):ai.create(this.props.altitudeDeviationThreshold.asUnit(gi.FOOT)),this.vsFpm=this.ownAirplanePropsModule.verticalSpeed.map((t=>t.asUnit(gi.FPM))),this.vsFpmQuantized=bi.create((([t,e])=>Math.round(t/e)*e),this.vsFpm,this.vsPrecisionFpm),this.projectedPlanePosition=Pi.create(Ti.create()),this.projectPlanePositionHandler=()=>{const t=this.props.mapProjection.project(this.ownAirplanePropsModule.position.get(),Sr.vec2Cache[0]);this.projectedPlanePosition.set(t)},this.isArcVisibleDynamic=bi.create((([t,e,i,s,r])=>{if(Math.abs(t)=r&&n*t>0}),this.vsFpmQuantized,this.ownAirplanePropsModule.altitude,this.autopilotModule.selectedAltitude,this.vsThresholdFpm,this.altDevThresholdFeet).pause(),this.projectedArcPosition=Pi.create(Ti.create()),this.projectedArcAngle=ai.create(0),this.needUpdate=!1,this.subscriptions=[]}onVisibilityChanged(t){var e;null===(e=this.layerRef.getOrDefault())||void 0===e||e.setVisible(t),t&&(this.needUpdate=!0)}onAttached(){var t,e;this.layerRef.instance.onAttached(),this.subscriptions.push(this.ownAirplanePropsModule.position.sub(this.projectPlanePositionHandler));const i=()=>{this.needUpdate=!0},s=this.props.model.getModule(yr.AltitudeArc),r=this.props.model.getModule(yr.DataIntegrity);this.isArcVisibleStatic=bi.create((([t,e,i])=>t&&e&&i),s.show,null!==(t=null==r?void 0:r.gpsSignalValid)&&void 0!==t?t:ai.create(!0),null!==(e=null==r?void 0:r.adcSignalValid)&&void 0!==e?e:ai.create(!0));const n=this.isArcVisibleDynamic.sub((t=>{this.setVisible(t)}),!1,!0);this.isArcVisibleStatic.sub((t=>{t?(this.isArcVisibleDynamic.resume(),n.resume(!0)):(this.isArcVisibleDynamic.pause(),n.pause(),this.setVisible(!1))}),!0),this.subscriptions.push(this.projectedPlanePosition.sub(i),this.ownAirplanePropsModule.trackTrue.sub(i),this.ownAirplanePropsModule.groundSpeed.sub(i),this.ownAirplanePropsModule.altitude.sub(i)),this.vsFpmQuantized.sub(i),this.subscriptions.push(this.autopilotModule.selectedAltitude.sub(i,!0)),this.layerRef.instance.setVisible(this.isVisible())}onMapProjectionChanged(t,e){this.layerRef.instance.onMapProjectionChanged(t,e),this.projectPlanePositionHandler(),this.needUpdate=!0}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.ownAirplanePropsModule.trackTrue.get(),e=this.ownAirplanePropsModule.groundSpeed.get(),i=this.ownAirplanePropsModule.altitude.get(),s=this.autopilotModule.selectedAltitude.get(),r=this.vsFpmQuantized.get(),n=(s.asUnit(gi.FOOT)-i.asUnit(gi.FOOT))/r,a=e.asUnit(gi.FPM)*n,o=gi.FOOT.convertTo(a,gi.GA_RADIAN)/this.props.mapProjection.getProjectedResolution(),c=t*Avionics.Utils.DEG2RAD+this.props.mapProjection.getRotation()-mi.HALF_PI,h=this.projectedPlanePosition.get(),l=Ti.add(Ti.setFromPolar(o,c,Sr.vec2Cache[0]),h,Sr.vec2Cache[0]);this.projectedArcPosition.set(l),this.projectedArcAngle.set(c),this.layerRef.instance.onUpdated(),this.needUpdate=!1}render(){const t={ref:this.layerRef,model:this.props.model,mapProjection:this.props.mapProjection,arcAngularWidth:this.arcAngularWidth,arcRadius:this.arcRadius,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,strokeLineCap:this.strokeLineCap,outlineWidth:this.outlineWidth,outlineStyle:this.outlineStyle,outlineLineCap:this.outlineLineCap,projectedArcPosition:this.projectedArcPosition,projectedArcAngle:this.projectedArcAngle,class:this.props.class};return"canvas"===this.props.renderMethod?z.buildComponent(vr,Object.assign({},t)):z.buildComponent(br,Object.assign({},t))}destroy(){var t,e,i,s,r;null===(t=this.layerRef.getOrDefault())||void 0===t||t.destroy(),null===(e=this.vsPrecisionMap)||void 0===e||e.destroy(),null===(i=this.vsThresholdMap)||void 0===i||i.destroy(),null===(s=this.altDevThresholdMap)||void 0===s||s.destroy(),this.vsFpm.destroy(),null===(r=this.isArcVisibleStatic)||void 0===r||r.destroy(),this.isArcVisibleDynamic.destroy(),this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}Sr.DEFAULT_ARC_ANGULAR_WIDTH=60,Sr.DEFAULT_ARC_RADIUS=64,Sr.DEFAULT_STROKE_WIDTH=2,Sr.DEFAULT_STROKE_STYLE="cyan",Sr.DEFAULT_STROKE_LINECAP="butt",Sr.DEFAULT_OUTLINE_WIDTH=1,Sr.DEFAULT_OUTLINE_STYLE="#505050",Sr.DEFAULT_OUTLINE_LINECAP="butt",Sr.vec2Cache=[new Float64Array(2),new Float64Array(2)];class vr extends Vs{constructor(){super(...arguments),this.arcHalfAngularWidth=this.props.arcAngularWidth/2,this.totalArcThickness=this.props.strokeWidth+2*this.props.outlineWidth,this.canvasLayerRef=z.createRef(),this.subscriptions=[],this.needUpdate=!1}onVisibilityChanged(t){var e,i;t?this.needUpdate=!0:null===(i=null===(e=this.canvasLayerRef.getOrDefault())||void 0===e?void 0:e.tryGetDisplay())||void 0===i||i.clear()}onAttached(){this.canvasLayerRef.instance.onAttached();const t=()=>{this.needUpdate=!0};this.subscriptions.push(this.props.projectedArcPosition.sub(t,!1),this.props.projectedArcAngle.sub(t,!1)),this.needUpdate=!0}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e)}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.props.projectedArcPosition.get(),e=this.canvasLayerRef.instance.display;e.clear();const i=this.props.mapProjection.getProjectedSize(),s=t[0],r=t[1],n=2*this.props.arcRadius;if(s<=-n||s>=i[0]+n||r<=-n||r>=i[1]+n)return;e.context.beginPath();const a=this.props.projectedArcAngle.get(),o=Ti.add(Ti.setFromPolar(-this.props.arcRadius,a,vr.vec2Cache[0]),t,vr.vec2Cache[0]),c=Ti.add(Ti.setFromPolar(this.props.arcRadius,a-this.arcHalfAngularWidth,vr.vec2Cache[1]),o,vr.vec2Cache[1]);e.context.moveTo(c[0],c[1]),e.context.arc(o[0],o[1],this.props.arcRadius,a-this.arcHalfAngularWidth,a+this.arcHalfAngularWidth),this.props.outlineWidth>0&&(e.context.lineWidth=this.totalArcThickness,e.context.strokeStyle=this.props.outlineStyle,e.context.lineCap=this.props.outlineLineCap,e.context.stroke()),this.props.strokeWidth>0&&(e.context.lineWidth=this.props.strokeWidth,e.context.strokeStyle=this.props.strokeStyle,e.context.lineCap=this.props.strokeLineCap,e.context.stroke()),this.needUpdate=!1}render(){return z.buildComponent(xs,{ref:this.canvasLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,class:this.props.class})}destroy(){var t;null===(t=this.canvasLayerRef.getOrDefault())||void 0===t||t.destroy(),this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}vr.vec2Cache=[new Float64Array(2),new Float64Array(2)];class br extends Vs{constructor(){super(...arguments),this.arcHalfAngularWidth=this.props.arcAngularWidth/2,this.totalArcThickness=this.props.strokeWidth+2*this.props.outlineWidth,this.width=this.props.arcRadius*(1-Math.cos(this.arcHalfAngularWidth))+this.totalArcThickness+2,this.height=2*this.props.arcRadius*Math.sin(Math.min(this.arcHalfAngularWidth,mi.HALF_PI))+this.totalArcThickness+2,this.svgStyle=ji.create({display:"",position:"absolute",left:this.totalArcThickness/2+1-this.width+"px",top:-this.height/2+"px",width:`${this.width}px`,height:`${this.height}px`,transform:"translate3d(0px, 0px, 0px) rotate(0rad)","transform-origin":`${this.width-(this.totalArcThickness/2+1)}px ${this.height/2}px`}),this.svgTransform=Es.concat(Es.translate3d("px"),Es.rotate("rad")),this.needUpdate=!1,this.subscriptions=[]}onVisibilityChanged(t){t?this.needUpdate=!0:this.svgStyle.set("display","none")}onAttached(){const t=()=>{this.needUpdate=!0};this.subscriptions.push(this.props.projectedArcPosition.sub(t,!1),this.props.projectedArcAngle.sub(t,!1))}onUpdated(){if(!this.needUpdate||!this.isVisible())return;const t=this.props.projectedArcPosition.get(),e=this.props.mapProjection.getProjectedSize(),i=t[0],s=t[1],r=2*this.props.arcRadius;i<=-r||i>=e[0]+r||s<=-r||s>=e[1]+r?this.svgStyle.set("display","none"):(this.svgStyle.set("display",""),this.svgTransform.getChild(0).set(i,s,0,.1),this.svgTransform.getChild(1).set(this.props.projectedArcAngle.get(),1e-4),this.svgStyle.set("transform",this.svgTransform.resolve())),this.needUpdate=!1}render(){const t=new Ar(.01),e=new Ds(t);e.beginPath(),e.addRotation(-this.arcHalfAngularWidth).addTranslation(-this.props.arcRadius,0),e.moveTo(this.props.arcRadius,0),e.arc(0,0,this.props.arcRadius,0,this.props.arcAngularWidth);const i=t.getSvgPath();return z.buildComponent("svg",{viewBox:`${this.totalArcThickness/2+1-this.width} ${-this.height/2} ${this.width} ${this.height}`,style:this.svgStyle,class:this.props.class},z.buildComponent("path",{d:i,fill:"none",stroke:this.props.outlineStyle,"stroke-width":this.totalArcThickness,"stroke-linecap":this.props.outlineLineCap}),z.buildComponent("path",{d:i,fill:"none",stroke:this.props.strokeStyle,"stroke-width":this.props.strokeWidth,"stroke-linecap":this.props.strokeLineCap}))}destroy(){this.subscriptions.forEach((t=>t.destroy())),super.destroy()}}class Tr extends xs{constructor(){var t,e,i,s,r,n;super(...arguments),this.strokeWidth=null!==(t=this.props.strokeWidth)&&void 0!==t?t:Tr.DEFAULT_STROKE_WIDTH,this.strokeStyle=null!==(e=this.props.strokeStyle)&&void 0!==e?e:Tr.DEFAULT_STROKE_STYLE,this.strokeDash=null!==(i=this.props.strokeDash)&&void 0!==i?i:Tr.DEFAULT_STROKE_DASH,this.outlineWidth=null!==(s=this.props.outlineWidth)&&void 0!==s?s:Tr.DEFAULT_OUTLINE_WIDTH,this.outlineStyle=null!==(r=this.props.outlineStyle)&&void 0!==r?r:Tr.DEFAULT_OUTLINE_STYLE,this.outlineDash=null!==(n=this.props.outlineDash)&&void 0!==n?n:Tr.DEFAULT_OUTLINE_DASH,this.vec=new Float64Array([0,0]),this.isUpdateScheduled=!1}onAttached(){super.onAttached(),this.props.start.sub((()=>{this.scheduleUpdate()})),this.props.end.sub((()=>{this.scheduleUpdate()})),this.scheduleUpdate()}onMapProjectionChanged(t,e){super.onMapProjectionChanged(t,e),this.scheduleUpdate()}scheduleUpdate(){this.isUpdateScheduled=!0}onUpdated(t,e){if(super.onUpdated(t,e),this.isUpdateScheduled){this.display.clear();const t=this.props.start.get(),e=this.props.end.get();if(null!==t&&null!==e){const[i,s]=t instanceof Float64Array?t:this.props.mapProjection.project(t,this.vec),[r,n]=e instanceof Float64Array?e:this.props.mapProjection.project(e,this.vec);this.drawLine(i,s,r,n)}this.isUpdateScheduled=!1}}drawLine(t,e,i,s){const r=this.display.context;r.beginPath(),r.moveTo(t,e),r.lineTo(i,s),this.outlineWidth>0&&this.stroke(r,this.strokeWidth+2*this.outlineWidth,this.outlineStyle,this.outlineDash),this.strokeWidth>0&&this.stroke(r,this.strokeWidth,this.strokeStyle,this.strokeDash)}stroke(t,e,i,s){t.lineWidth=e,t.strokeStyle=i,t.setLineDash(s),t.stroke()}}Tr.DEFAULT_STROKE_WIDTH=2,Tr.DEFAULT_STROKE_STYLE="white",Tr.DEFAULT_STROKE_DASH=[],Tr.DEFAULT_OUTLINE_WIDTH=0,Tr.DEFAULT_OUTLINE_STYLE="black",Tr.DEFAULT_OUTLINE_DASH=[];class Rr extends Vs{constructor(){var t;super(...arguments),this.canvasLayerRef=z.createRef(),this.searchDebounceDelay=null!==(t=this.props.searchDebounceDelay)&&void 0!==t?t:500,this.facLoader=new Ks(nr.getRepository(this.props.bus),this.onFacilityLoaderInitialized.bind(this)),this.searchRadius=0,this.searchMargin=0,this.userFacilityHasChanged=!1,this.icaosToRender=new Set,this.cachedRenderedWaypoints=new Map,this.isInit=!1,this.facilityRepoSubs=[]}onFacilityLoaderInitialized(){Promise.all([this.facLoader.startNearestSearchSessionWithIcaoStructs(Ct.Airport),this.facLoader.startNearestSearchSessionWithIcaoStructs(Ct.Vor),this.facLoader.startNearestSearchSessionWithIcaoStructs(Ct.Ndb),this.facLoader.startNearestSearchSessionWithIcaoStructs(Ct.Intersection),this.facLoader.startNearestSearchSessionWithIcaoStructs(Ct.User)]).then((t=>{const[e,i,s,r,n]=t;this.onSessionsStarted(e,i,s,r,n)}))}onSessionsStarted(t,e,i,s,r){const n=this.processSearchResults.bind(this);this.facilitySearches={[Ct.Airport]:new _r(t,n),[Ct.Vor]:new _r(e,n),[Ct.Ndb]:new _r(i,n),[Ct.Intersection]:new _r(s,n),[Ct.User]:new _r(r,n)};const a=this.props.bus.getSubscriber();this.facilityRepoSubs.push(a.on("facility_added").handle((t=>{Ji.isValueFacility(t.icaoStruct,tt.USR)&&(this.userFacilityHasChanged=!0)})),a.on("facility_changed").handle((t=>{Ji.isValueFacility(t.icaoStruct,tt.USR)&&(this.userFacilityHasChanged=!0)})),a.on("facility_removed").handle((t=>{Ji.isValueFacility(t.icaoStruct,tt.USR)&&(this.userFacilityHasChanged=!0)}))),this.props.onSessionsStarted&&this.props.onSessionsStarted(t,e,i,s,r),this.isInit&&this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}onAttached(){super.onAttached(),this.canvasLayerRef.instance.onAttached(),this.doInit(),this.isInit=!0,this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}doInit(){this.initWaypointRenderer(),this.updateSearchRadius()}getSearchCenter(){return this.props.getSearchCenter?this.props.getSearchCenter(this.props.mapProjection):this.props.mapProjection.getCenter()}initWaypointRenderer(){this.props.initRenderer&&this.props.initRenderer(this.props.waypointRenderer,this.canvasLayerRef.instance)}refreshWaypoints(){this.tryRefreshAllSearches(void 0,void 0,!0),this.cachedRenderedWaypoints.forEach((t=>{this.props.deregisterWaypoint(t,this.props.waypointRenderer)})),this.cachedRenderedWaypoints.forEach((t=>{this.props.registerWaypoint(t,this.props.waypointRenderer)}))}onMapProjectionChanged(t,e){this.canvasLayerRef.instance.onMapProjectionChanged(t,e),Ai.isAny(e,zt.Range|zt.RangeEndpoints|zt.ProjectedSize)?(this.updateSearchRadius(),this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)):Ai.isAll(e,zt.Center)&&this._tryRefreshAllSearches(this.getSearchCenter(),this.searchRadius)}updateSearchRadius(){let t=Ti.abs(this.props.mapProjection.getProjectedSize())*this.props.mapProjection.getProjectedResolution()/2;t=Math.max(t,gi.NMILE.convertTo(5,gi.GA_RADIAN)),this.searchRadius=t*Rr.SEARCH_RADIUS_OVERDRAW_FACTOR,this.searchMargin=t*(Rr.SEARCH_RADIUS_OVERDRAW_FACTOR-1)}onUpdated(t,e){var i;if(this.userFacilityHasChanged){const t=null===(i=this.facilitySearches)||void 0===i?void 0:i[Ct.User];void 0!==t&&(this.userFacilityHasChanged=!1,this.scheduleSearchRefresh(Ct.User,t,this.getSearchCenter(),this.searchRadius))}this.updateSearches(e)}updateSearches(t){this.facilitySearches&&(this.facilitySearches[Ct.Airport].update(t),this.facilitySearches[Ct.Vor].update(t),this.facilitySearches[Ct.Ndb].update(t),this.facilitySearches[Ct.Intersection].update(t),this.facilitySearches[Ct.User].update(t))}tryRefreshAllSearches(t,e,i){null!=t||(t=this.getSearchCenter()),null!=e||(e=this.searchRadius),this._tryRefreshAllSearches(t,e,i)}tryRefreshSearch(t,e,i,s){null!=e||(e=this.getSearchCenter()),null!=i||(i=this.searchRadius),this._tryRefreshSearch(t,e,i,s)}_tryRefreshAllSearches(t,e,i){this._tryRefreshSearch(Ct.Airport,t,e,i),this._tryRefreshSearch(Ct.Vor,t,e,i),this._tryRefreshSearch(Ct.Ndb,t,e,i),this._tryRefreshSearch(Ct.Intersection,t,e,i),this._tryRefreshSearch(Ct.User,t,e,i)}_tryRefreshSearch(t,e,i,s){const r=this.facilitySearches&&this.facilitySearches[t];if(!r||!s&&!this.shouldRefreshSearch(t,e,i))return;const n=this.props.searchRadiusLimit?this.props.searchRadiusLimit(t,e,i):void 0;void 0!==n&&isFinite(n)&&(i=Math.min(i,Math.max(0,n))),(s||r.lastRadius!==i||r.lastCenter.distance(e)>=this.searchMargin)&&this.scheduleSearchRefresh(t,r,e,i)}shouldRefreshSearch(t,e,i){return!this.props.shouldRefreshSearch||this.props.shouldRefreshSearch(t,e,i)}scheduleSearchRefresh(t,e,i,s){const r=this.props.searchItemLimit?this.props.searchItemLimit(t,i,s):100;e.scheduleRefresh(i,s,r,this.searchDebounceDelay)}processSearchResults(t){if(!t)return;const e=t.added.length;for(let i=0;i{t.destroy()})),super.destroy()}}Rr.SEARCH_RADIUS_OVERDRAW_FACTOR=Math.SQRT2;class _r{get lastCenter(){return this._lastCenter.readonly}get lastRadius(){return this._lastRadius}constructor(t,e){this.session=t,this.refreshCallback=e,this._lastCenter=new Di(0,0),this._lastRadius=0,this.maxItemCount=0,this.refreshDebounceTimer=0,this.isRefreshScheduled=!1}scheduleRefresh(t,e,i,s){this._lastCenter.set(t),this._lastRadius=e,this.maxItemCount=i,this.isRefreshScheduled||(this.refreshDebounceTimer=s,this.isRefreshScheduled=!0)}update(t){this.isRefreshScheduled&&(this.refreshDebounceTimer=Math.max(0,this.refreshDebounceTimer-t),0===this.refreshDebounceTimer&&(this.refresh(),this.isRefreshScheduled=!1))}async refresh(){const t=await this.session.searchNearest(this._lastCenter.lat,this._lastCenter.lon,gi.GA_RADIAN.convertTo(this._lastRadius,gi.METER),this.maxItemCount);this.refreshCallback(t)}}class Cr extends Vs{constructor(){super(...arguments),this.imageFilePath=yi.isSubscribable(this.props.imageFilePath)?this.props.imageFilePath.map(vi.identity()):this.props.imageFilePath,this.style=ji.create({display:"",position:"absolute",left:"0px",top:"0px",width:"0px",height:"0px",transform:"translate3d(0, 0, 0) rotate(0deg)","transform-origin":"50% 50%"}),this.ownAirplanePropsModule=this.props.model.getModule("ownAirplaneProps"),this.ownAirplaneIconModule=this.props.model.getModule("ownAirplaneIcon"),this.iconSize=yi.toSubscribable(this.props.iconSize,!0),this.iconAnchor=yi.toSubscribable(this.props.iconAnchor,!0),this.iconOffset=Ti.create(),this.visibilityBounds=_i.create(4),this.iconTransform=Es.concat(Es.translate3d("px"),Es.rotate("deg")),this.isGsAboveTrackThreshold=this.ownAirplanePropsModule.groundSpeed.map((t=>t.asUnit(gi.KNOT)>=5)).pause(),this.showIcon=!0,this.isInsideVisibilityBounds=!0,this.planeRotation=0,this.needUpdateVisibility=!1,this.needUpdatePositionRotation=!1}onVisibilityChanged(t){this.needUpdateVisibility=!0,this.needUpdatePositionRotation=this.showIcon=t&&this.ownAirplaneIconModule.show.get()}onAttached(){this.showSub=this.ownAirplaneIconModule.show.sub((t=>{this.needUpdateVisibility=!0,this.needUpdatePositionRotation=this.showIcon=t&&this.isVisible()})),this.positionSub=this.ownAirplanePropsModule.position.sub((()=>{this.needUpdatePositionRotation=this.showIcon})),this.headingSub=this.ownAirplanePropsModule.hdgTrue.sub((t=>{this.planeRotation=t,this.needUpdatePositionRotation=this.showIcon}),!1,!0),this.trackSub=this.ownAirplanePropsModule.trackTrue.sub((t=>{this.planeRotation=t,this.needUpdatePositionRotation=this.showIcon}),!1,!0),this.trackThresholdSub=this.isGsAboveTrackThreshold.sub((t=>{t?(this.headingSub.pause(),this.trackSub.resume(!0)):(this.trackSub.pause(),this.headingSub.resume(!0))}),!1,!0),this.iconSizeSub=this.iconSize.sub((t=>{this.style.set("width",`${t}px`),this.style.set("height",`${t}px`),this.updateOffset()}),!0),this.iconAnchorSub=this.iconAnchor.sub((()=>{this.updateOffset()})),this.orientationSub=this.ownAirplaneIconModule.orientation.sub((t=>{switch(t){case qt.HeadingUp:this.isGsAboveTrackThreshold.pause(),this.trackThresholdSub.pause(),this.trackSub.pause(),this.headingSub.resume(!0);break;case qt.TrackUp:this.headingSub.pause(),this.trackSub.pause(),this.isGsAboveTrackThreshold.resume(),this.trackThresholdSub.resume(!0);break;default:this.needUpdatePositionRotation=this.showIcon,this.isGsAboveTrackThreshold.pause(),this.trackThresholdSub.pause(),this.headingSub.pause(),this.trackSub.pause(),this.planeRotation=0}}),!0),this.needUpdateVisibility=!0,this.needUpdatePositionRotation=!0}updateOffset(){const t=this.iconAnchor.get();this.iconOffset.set(t),Ti.multScalar(this.iconOffset,-this.iconSize.get(),this.iconOffset),this.style.set("left",`${this.iconOffset[0]}px`),this.style.set("top",`${this.iconOffset[1]}px`),this.style.set("transform-origin",`${100*t[0]}% ${100*t[1]}%`),this.updateVisibilityBounds()}updateVisibilityBounds(){const t=this.iconSize.get(),e=Math.max(Math.hypot(this.iconOffset[0],this.iconOffset[1]),Math.hypot(this.iconOffset[0]+t,this.iconOffset[1]),Math.hypot(this.iconOffset[0]+t,this.iconOffset[1]+t),Math.hypot(this.iconOffset[0],this.iconOffset[1]+t))+50,i=this.props.mapProjection.getProjectedSize();this.visibilityBounds[0]=-e,this.visibilityBounds[1]=-e,this.visibilityBounds[2]=i[0]+e,this.visibilityBounds[3]=i[1]+e,this.needUpdatePositionRotation=this.showIcon}onMapProjectionChanged(t,e){Ai.isAll(e,zt.ProjectedSize)&&this.updateVisibilityBounds(),this.needUpdatePositionRotation=this.showIcon}onUpdated(t,e){this.needUpdatePositionRotation?(this.updateIconPositionRotation(),this.needUpdatePositionRotation=!1,this.needUpdateVisibility=!1):this.needUpdateVisibility&&(this.updateIconVisibility(),this.needUpdateVisibility=!1)}updateIconVisibility(){this.style.set("display",this.isInsideVisibilityBounds&&this.showIcon?"":"none")}updateIconPositionRotation(){const t=this.props.mapProjection.project(this.ownAirplanePropsModule.position.get(),Cr.vec2Cache[0]);if(this.isInsideVisibilityBounds=this.props.mapProjection.isInProjectedBounds(t,this.visibilityBounds),this.isInsideVisibilityBounds){let e;switch(this.ownAirplaneIconModule.orientation.get()){case qt.HeadingUp:case qt.TrackUp:e=this.planeRotation+this.props.mapProjection.getRotation()*Avionics.Utils.RAD2DEG;break;default:e=0}this.iconTransform.getChild(0).set(t[0],t[1],0,.1),this.iconTransform.getChild(1).set(e,.1),this.style.set("transform",this.iconTransform.resolve())}this.updateIconVisibility()}render(){var t;return z.buildComponent("img",{src:this.imageFilePath,class:null!==(t=this.props.class)&&void 0!==t?t:"",style:this.style})}destroy(){var t,e,i,s,r,n,a,o;yi.isSubscribable(this.imageFilePath)&&this.imageFilePath.destroy(),this.isGsAboveTrackThreshold.destroy(),null===(t=this.showSub)||void 0===t||t.destroy(),null===(e=this.positionSub)||void 0===e||e.destroy(),null===(i=this.headingSub)||void 0===i||i.destroy(),null===(s=this.trackSub)||void 0===s||s.destroy(),null===(r=this.trackThresholdSub)||void 0===r||r.destroy(),null===(n=this.iconSizeSub)||void 0===n||n.destroy(),null===(a=this.iconAnchorSub)||void 0===a||a.destroy(),null===(o=this.orientationSub)||void 0===o||o.destroy(),super.destroy()}}Cr.vec2Cache=[Ti.create()],function(t){t.Undefined="Undefined",t.NorthUp="NorthUp",t.TrackUp="TrackUp",t.HeadingUp="HeadingUp",t.DtkUp="DtkUp"}(ue||(ue={})),function(t){t.Normal="Normal",t.FlightPlan="FlightPlan"}(de||(de={}));class Er extends Vs{constructor(){var t;super(...arguments),this.instanceId=Er.instanceId++,this.flightPathLayerRef=z.createRef(),this.waypointLayerRef=z.createRef(),this.defaultRoleId=null!==(t=this.props.waypointRenderer.getRoleFromName(de.FlightPlan))&&void 0!==t?t:0,this.planModule=this.props.model.getModule(yr.FlightPlan),this.waypointPrefix=`${Er.WAYPOINT_PREFIX}_${this.instanceId}`,this.legWaypoints=new Map,this.waypointsUpdating=!1,this.waypointId=0,this.facLoader=new Ks(nr.getRepository(this.props.bus)),this.facWaypointCache=js.getCache(this.props.bus),this.clipBounds=Ii.create(new Float64Array(4)),this.clippedPathStream=new Fs(Is.INSTANCE,this.clipBounds),this.pathStreamStack=new Ls(Is.INSTANCE,this.props.mapProjection.getGeoProjection(),Math.PI/12,.25,8),this.updateScheduled=!1}onAttached(){this.flightPathLayerRef.instance.onAttached(),this.waypointLayerRef.instance.onAttached(),this.pathStreamStack.pushPostProjected(this.clippedPathStream),this.pathStreamStack.setConsumer(this.flightPathLayerRef.instance.display.context),this.initWaypointRenderer(),this.planModule.getPlanSubjects(this.props.planIndex).flightPlan.sub((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).planCalculated.on((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).planChanged.on((()=>this.updateScheduled=!0)),this.planModule.getPlanSubjects(this.props.planIndex).activeLeg.sub((()=>this.updateScheduled=!0)),this.props.waypointRenderer.onRolesAdded.on((()=>this.initWaypointRenderer())),super.onAttached()}initWaypointRenderer(){let t=!1;const e=this.props.waypointRenderer.getRoleNamesByGroup(`${de.FlightPlan}_${this.props.planIndex}`);for(let i=0;i{var r,n,a,o,c,h;t.draw(this.props.mapProjection,s.context,e),this.needHandleOffscaleOob&&(t.isOffScale?(null===(r=this.props.oobIntruders)||void 0===r||r.delete(t.intruder),null===(n=this.props.offScaleIntruders)||void 0===n||n.add(t.intruder)):this.props.mapProjection.isInProjectedBounds(t.projectedPos,i)?(null===(c=this.props.offScaleIntruders)||void 0===c||c.delete(t.intruder),null===(h=this.props.oobIntruders)||void 0===h||h.delete(t.intruder)):(null===(a=this.props.offScaleIntruders)||void 0===a||a.delete(t.intruder),null===(o=this.props.oobIntruders)||void 0===o||o.add(t.intruder)))})):this.needHandleOffscaleOob&&this.intruderIcons[n.alertLevel].forEach((t=>{var e,i;null===(e=this.props.offScaleIntruders)||void 0===e||e.delete(t.intruder),null===(i=this.props.oobIntruders)||void 0===i||i.delete(t.intruder)}))}}updateVisibility(){const t=this.trafficModule.tcas.getOperatingMode();this.setVisible(this.trafficModule.show.get()&&(t===ge.TAOnly||t===ge.TA_RA||t===ge.Test))}onIntruderAdded(t){const e=this.props.iconFactory(t,this.props.context);this.intruderIcons[t.alertLevel.get()].set(t,e)}onIntruderRemoved(t){var e,i;null===(e=this.props.offScaleIntruders)||void 0===e||e.delete(t),null===(i=this.props.oobIntruders)||void 0===i||i.delete(t),this.intruderIcons[t.alertLevel.get()].delete(t)}onIntruderAlertLevelChanged(t){let e,i=this.intruderIcons[e=fe.None].get(t);null!=i||(i=this.intruderIcons[e=fe.ProximityAdvisory].get(t)),null!=i||(i=this.intruderIcons[e=fe.TrafficAdvisory].get(t)),null!=i||(i=this.intruderIcons[e=fe.ResolutionAdvisory].get(t)),i&&(this.intruderIcons[e].delete(t),this.intruderIcons[t.alertLevel.get()].set(t,i))}render(){var t;return z.buildComponent(xs,{ref:this.iconLayerRef,model:this.props.model,mapProjection:this.props.mapProjection,class:null!==(t=this.props.class)&&void 0!==t?t:""})}}Pr.DRAW_GROUPS=[{alertLevelVisFlag:ye.Other,alertLevel:fe.None},{alertLevelVisFlag:ye.ProximityAdvisory,alertLevel:fe.ProximityAdvisory},{alertLevelVisFlag:ye.TrafficAdvisory,alertLevel:fe.TrafficAdvisory},{alertLevelVisFlag:ye.ResolutionAdvisory,alertLevel:fe.ResolutionAdvisory}],new Di(0,0),function(t){t[t.Warning=0]="Warning",t[t.Caution=1]="Caution",t[t.Test=2]="Test",t[t.SoundOnly=3]="SoundOnly"}(Se||(Se={})),function(t){t[t.Triangle=1]="Triangle"}(ve||(ve={})),function(t){t[t.End=1]="End"}(be||(be={})),function(t){t[t.End=1]="End",t[t.Right=2]="Right"}(Te||(Te={})),function(t){t[t.None=1]="None"}(Re||(Re={})),function(t){t[t.Right=2]="Right"}(_e||(_e={})),function(t){t.Circular="Circular",t.Horizontal="Horizontal",t.DoubleHorizontal="DoubleHorizontal",t.Vertical="Vertical",t.DoubleVertical="DoubleVertical",t.Text="Text",t.ColumnGroup="ColumnGroup",t.Column="Column",t.Cylinder="Cylinder",t.TwinCylinder="TwinCylinder"}(Ce||(Ce={})),function(t){t[t.New=0]="New",t[t.Acked=1]="Acked"}(Ee||(Ee={})),function(t){t.Inactive="Inactive",t.Armed="Armed",t.Active="Active"}(Pe||(Pe={}));class Ir{constructor(){this.onActivate=()=>{},this.onArm=()=>{},this.state=Pe.Inactive}activate(){}deactivate(){}update(){}arm(){}}Ir.instance=new Ir,function(t){t[t.NONE=0]="NONE",t[t.PITCH=1]="PITCH",t[t.VS=2]="VS",t[t.FLC=3]="FLC",t[t.ALT=4]="ALT",t[t.PATH=5]="PATH",t[t.GP=6]="GP",t[t.GS=7]="GS",t[t.CAP=8]="CAP",t[t.TO=9]="TO",t[t.GA=10]="GA",t[t.FPA=11]="FPA",t[t.FLARE=12]="FLARE",t[t.LEVEL=13]="LEVEL"}(Ie||(Ie={})),function(t){t[t.NONE=0]="NONE",t[t.ROLL=1]="ROLL",t[t.LEVEL=2]="LEVEL",t[t.GPSS=3]="GPSS",t[t.HEADING=4]="HEADING",t[t.VOR=5]="VOR",t[t.LOC=6]="LOC",t[t.BC=7]="BC",t[t.ROLLOUT=8]="ROLLOUT",t[t.NAV=9]="NAV",t[t.TO=10]="TO",t[t.GA=11]="GA",t[t.HEADING_HOLD=12]="HEADING_HOLD",t[t.TRACK=13]="TRACK",t[t.TRACK_HOLD=14]="TRACK_HOLD",t[t.FMS_LOC=15]="FMS_LOC",t[t.TO_LOC=16]="TO_LOC"}(Ne||(Ne={})),function(t){t[t.NONE=0]="NONE",t[t.ALTS=1]="ALTS",t[t.ALTV=2]="ALTV"}(Fe||(Fe={})),function(t){t[t.Disabled=0]="Disabled",t[t.Enabled_Inactive=1]="Enabled_Inactive",t[t.Enabled_Active=2]="Enabled_Active"}(we||(we={})),function(t){t[t.None=0]="None",t[t.PathArmed=1]="PathArmed",t[t.PathActive=2]="PathActive",t[t.PathInvalid=3]="PathInvalid"}(De||(De={})),function(t){t[t.None=0]="None",t[t.GSArmed=1]="GSArmed",t[t.GSActive=2]="GSActive",t[t.GPArmed=3]="GPArmed",t[t.GPActive=4]="GPActive"}(Me||(Me={})),function(t){t[t.None=0]="None",t[t.Selected=1]="Selected",t[t.VNAV=2]="VNAV"}(Le||(Le={})),function(t){t.Available="Available",t.InvalidLegs="InvalidLegs"}(Oe||(Oe={})),function(t){t.VerticalDeviation="L:WTAP_VNav_Vertical_Deviation",t.TargetAltitude="L:WTAP_VNav_Target_Altitude",t.PathMode="L:WTAP_VNav_Path_Mode",t.VNAVState="L:WTAP_VNav_State",t.PathAvailable="L:WTAP_VNav_Path_Available",t.CaptureType="L:WTAP_VNav_Alt_Capture_Type",t.TODDistance="L:WTAP_VNav_Distance_To_TOD",t.BODDistance="L:WTAP_VNav_Distance_To_BOD",t.TODLegIndex="L:WTAP_VNav_TOD_Leg_Index",t.TODDistanceInLeg="L:WTAP_VNav_TOD_Distance_In_Leg",t.BODLegIndex="L:WTAP_VNav_BOD_Leg_Index",t.TOCDistance="L:WTAP_VNav_Distance_To_TOC",t.BOCDistance="L:WTAP_VNav_Distance_To_BOC",t.TOCLegIndex="L:WTAP_VNav_TOC_Leg_Index",t.TOCDistanceInLeg="L:WTAP_VNav_TOC_Distance_In_Leg",t.BOCLegIndex="L:WTAP_VNav_BOC_Leg_Index",t.CurrentConstraintLegIndex="L:WTAP_VNav_Constraint_Leg_Index",t.CurrentConstraintAltitude="L:WTAP_VNav_Constraint_Altitude",t.NextConstraintAltitude="L:WTAP_VNav_Next_Constraint_Altitude",t.FPA="L:WTAP_VNav_FPA",t.RequiredVS="L:WTAP_VNAV_Required_VS",t.GPApproachMode="L:WTAP_GP_Approach_Mode",t.GPVerticalDeviation="L:WTAP_GP_Vertical_Deviation",t.GPDistance="L:WTAP_GP_Distance",t.GPFpa="L:WTAP_GP_FPA",t.GPRequiredVS="L:WTAP_GP_Required_VS",t.GPServiceLevel="L:WTAP_GP_Service_Level"}(Ve||(Ve={}));class Nr{constructor(t,e=!1,i=Nr.DEFAULT_MIN_INTENSITY,s=Nr.DEFAULT_MAX_INTENSITY){this.simTime=h.create(null,0),this.ppos=new Float64Array(3),this.altitude=0,this.needRecalcAuto=!0,this.lastSimTime=0,this.paused=!1,this._intensity=ai.create(0),this.intensity=this._intensity,this._autoMinIntensity=i,this._autoMaxIntensity=s,this.needRecalcAuto=!0;const r=t.getSubscriber();this.simTime.setConsumer(r.on("simTime")),this.pposSub=r.on("gps-position").atFrequency(Nr.AUTO_UPDATE_REALTIME_FREQ).handle(this.onPPosChanged.bind(this)),this.updateSub=r.on("realTime").atFrequency(Nr.AUTO_UPDATE_REALTIME_FREQ).handle(this.onUpdate.bind(this)),this.setPaused(e)}get autoMaxIntensity(){return this._autoMaxIntensity}set autoMaxIntensity(t){this._autoMaxIntensity=t,this.needRecalcAuto=!0}get autoMinIntensity(){return this._autoMinIntensity}set autoMinIntensity(t){this._autoMinIntensity=t,this.needRecalcAuto=!0}setPaused(t){t!==this.paused&&(this.paused=t,t?(this.updateSub.pause(),this.pposSub.pause(),this.simTime.pause(),this.needRecalcAuto=!1):(this.needRecalcAuto=!0,this.simTime.resume(),this.pposSub.resume(!0),this.updateSub.resume(!0)))}onPPosChanged(t){const e=Di.sphericalToCartesian(t.lat,t.long,Nr.tempVec3);Ri.dot(e,this.ppos)>=.999999875&&Math.abs(t.alt-this.altitude)<=60||(Ri.copy(e,this.ppos),this.altitude=t.alt,this.needRecalcAuto=!0)}onUpdate(){const t=this.simTime.get();this.needRecalcAuto||(this.needRecalcAuto=Math.abs(t-this.lastSimTime)>=Nr.AUTO_UPDATE_SIMTIME_THRESHOLD),this.needRecalcAuto&&(this.needRecalcAuto=!1,this.updateAutoBacklightIntensity(t))}updateAutoBacklightIntensity(t){this.lastSimTime=t;const e=Nr.calculateSubSolarPoint(t,Nr.tempVec3),i=Math.acos(mi.clamp(Ri.dot(this.ppos,e),-1,1)),s=mi.HALF_PI+Math.acos(1/(1+gi.METER.convertTo(Math.max(0,this.altitude),gi.GA_RADIAN)));this._intensity.set(mi.lerp(s-i,Nr.AUTO_MIN_SOLAR_HORIZON_ANGLE_RAD,Nr.AUTO_MAX_SOLAR_HORIZON_ANGLE_RAD,this._autoMinIntensity,this._autoMaxIntensity,!0,!0))}static calculateSubSolarPoint(t,e){const i=2*Math.PI,s=(t-Nr.EPOCH)/Nr.DAY,r=s-Math.floor(s),n=4.895055+.01720279*s,a=6.240041+.01720197*s,o=n+.033423*Math.sin(a)+349e-6*Math.sin(2*a),c=.40910518-6.98e-9*s,h=Math.atan2(Math.cos(c)*Math.sin(o),Math.cos(o)),l=Math.asin(Math.sin(c)*Math.sin(o)),u=.159155*(((n-h)%i+3*Math.PI)%i-Math.PI),d=l*Avionics.Utils.RAD2DEG,p=-15*(r-.5+u)*24;return Di.sphericalToCartesian(d,p,e)}}Nr.AUTO_MAX_SOLAR_HORIZON_ANGLE=4,Nr.AUTO_MIN_SOLAR_HORIZON_ANGLE=-6,Nr.AUTO_MAX_SOLAR_HORIZON_ANGLE_RAD=Nr.AUTO_MAX_SOLAR_HORIZON_ANGLE*Avionics.Utils.DEG2RAD,Nr.AUTO_MIN_SOLAR_HORIZON_ANGLE_RAD=Nr.AUTO_MIN_SOLAR_HORIZON_ANGLE*Avionics.Utils.DEG2RAD,Nr.AUTO_UPDATE_REALTIME_FREQ=10,Nr.AUTO_UPDATE_SIMTIME_THRESHOLD=6e4,Nr.EPOCH=9466848e5,Nr.DAY=864e5,Nr.DEFAULT_MIN_INTENSITY=0,Nr.DEFAULT_MAX_INTENSITY=1,Nr.tempVec3=new Float64Array(3),function(t){t.Intercept="Intercept",t.Tracking="Tracking"}(Ue||(Ue={})),function(t){t.Intercept="Intercept",t.Tracking="Tracking"}(Ge||(Ge={})),function(t){t[t.None=0]="None",t[t.Ingress=1]="Ingress",t[t.Egress=2]="Egress",t[t.Unsuspend=3]="Unsuspend"}(xe||(xe={})),Mi.ANGULAR_TOLERANCE,gi.GA_RADIAN.convertTo(Mi.ANGULAR_TOLERANCE,gi.METER),function(t){t.Active="L:WTAP_LNav_Obs_Active",t.Course="L:WTAP_LNav_Obs_Course"}(ke||(ke={})),function(t){t.None="None",t.SmallToLarge="SmallToLarge",t.DynamicSmall="DynamicSmall"}(He||(He={})),function(t){t[t.None=0]="None",t[t.ZeroIncDec=1]="ZeroIncDec",t[t.NonZeroIncDec=2]="NonZeroIncDec",t[t.TransformedSet=4]="TransformedSet",t[t.All=-1]="All"}(Be||(Be={})),function(t){t[t.LATERAL=0]="LATERAL",t[t.VERTICAL=1]="VERTICAL",t[t.APPROACH=2]="APPROACH"}(We||(We={})),function(t){t[t.None=0]="None",t[t.APActive=1]="APActive",t[t.YawDamper=2]="YawDamper",t[t.Heading=4]="Heading",t[t.Nav=8]="Nav",t[t.NavArmed=16]="NavArmed",t[t.Approach=32]="Approach",t[t.ApproachArmed=64]="ApproachArmed",t[t.Backcourse=128]="Backcourse",t[t.BackcourseArmed=256]="BackcourseArmed",t[t.Alt=512]="Alt",t[t.AltS=1024]="AltS",t[t.AltV=2048]="AltV",t[t.VS=4096]="VS",t[t.FLC=8192]="FLC",t[t.GP=16384]="GP",t[t.GPArmed=32768]="GPArmed",t[t.GS=65536]="GS",t[t.GSArmed=131072]="GSArmed",t[t.Path=262144]="Path",t[t.PathArmed=524288]="PathArmed",t[t.PathInvalid=1048576]="PathInvalid",t[t.Pitch=2097152]="Pitch",t[t.Roll=4194304]="Roll",t[t.VNAV=8388608]="VNAV",t[t.ATSpeed=16777216]="ATSpeed",t[t.ATMach=33554432]="ATMach",t[t.ATArmed=67108864]="ATArmed",t[t.FD=134217728]="FD"}($e||($e={})),function(t){t.LateralArmed="L:WTAP_Lateral_Armed_Mode",t.LateralActive="L:WTAP_Lateral_Active_Mode",t.VerticalArmed="L:WTAP_Vertical_Armed_Mode",t.VerticalActive="L:WTAP_Vertical_Active_Mode"}(je||(je={})),function(t){t.None="None",t.Speed="Speed",t.Power="Power",t.ThrottlePos="ThrottlePos"}(Ye||(Ye={})),ai.create(!1),function(t){t[t.Sid=0]="Sid",t[t.Star=1]="Star",t[t.Approach=2]="Approach"}(ze||(ze={})),function(t){t.Lido="LIDO",t.Faa="FAA"}(qe||(qe={})),function(t){t.Actionable="Actionable",t.Branch="Branch",t.Note="Note",t.Title="Title",t.Link="Link",t.Spacer="Spacer"}(Xe||(Xe={})),function(t){t[t.None=0]="None",t[t.Sufficient=1]="Sufficient",t[t.Necessary=2]="Necessary"}(Ke||(Ke={})),function(t){t[t.Singleton=0]="Singleton",t[t.Transient=1]="Transient"}(Qe||(Qe={})),Qe.Singleton,function(t){t.Off="Off",t.Initializing="Initializing",t.On="On",t.Failed="Failed"}(Ze||(Ze={}));BaseInstrument;class Fr extends Yi{constructor(t){super(t),this.cycleRef=z.createRef(),this.toTopRef=z.createRef(),this.reloadRef=z.createRef(),this.switchPosRef=z.createRef(),this.buttonName=Os.create(0,(t=>1===t?"/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/compass.png":2===t?"/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/assets/img/wrench.png":"")),this.cycle=()=>{0===this.props.page?SimVar.SetSimVarValue("L:KH_FE_FPLAN_P1","bool",!0):1===this.props.page&&SimVar.SetSimVarValue("L:KH_FE_FPLAN_P1","bool",!1)},this.toTop=()=>{this.props.containerRef.instance&&(this.props.containerRef.instance.scrollTop=0)},this.switchPosition=()=>{1===this.props.position.get()?SimVar.SetSimVarValue("L:KH_FE_FPLAN_BOARD","number",2):2===this.props.position.get()&&SimVar.SetSimVarValue("L:KH_FE_FPLAN_BOARD","number",1)},this.render=()=>z.buildComponent("div",{id:"KH_CTRL"},1===this.props.page&&z.buildComponent("div",{ref:this.cycleRef,class:"button"},z.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"})),z.buildComponent("div",{ref:this.toTopRef,class:"button d90"},z.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"})),z.buildComponent("div",{ref:this.reloadRef,class:"button"},z.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/cloud.png"})),z.buildComponent("div",{ref:this.switchPosRef,class:"button"},z.buildComponent("img",{class:"icon",src:this.buttonName})),0===this.props.page&&z.buildComponent("div",{ref:this.cycleRef,class:"button d180"},z.buildComponent("img",{class:"icon",src:"/Pages/VCockpit/Instruments/FSS_B727/EFB/Images/get.png"}))),this.onAfterRender=()=>{this.cycleRef.instance.onclick=this.cycle,this.toTopRef.instance.onclick=this.toTop,this.reloadRef.instance.onclick=this.props.reload,this.switchPosRef.instance.onclick=this.switchPosition},t.position.sub((t=>this.buttonName.set(t)))}}class wr extends Yi{constructor(t){super(t),this.containerRef=z.createRef(),this.ofpRef=z.createRef(),this.defineDragScroll=(t=!0,e=!0)=>{if(!this.containerRef.instance)return;let i={top:0,left:0,x:0,y:0};const s=s=>{const r=s.clientX-i.x,n=s.clientY-i.y;e&&(this.containerRef.instance.scrollTop=i.top-n),t&&(this.containerRef.instance.scrollLeft=i.left-r)},r=t=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),document.removeEventListener("mouseleave",r)};this.containerRef.instance.addEventListener("mousedown",(t=>{i={left:this.containerRef.instance.scrollLeft,top:this.containerRef.instance.scrollTop,x:t.clientX,y:t.clientY},document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),document.removeEventListener("mouseleave",r)}))},this.render=()=>z.buildComponent(z.Fragment,null,z.buildComponent("div",{ref:this.containerRef,id:"KH_FE_FPLAN"},z.buildComponent("div",{ref:this.ofpRef,id:"OFP"})),z.buildComponent(Fr,{containerRef:this.containerRef,position:this.props.position,reload:this.props.reload,page:0})),this.onAfterRender=()=>{this.defineDragScroll(),this.props.content.sub((t=>{this.ofpRef.instance.innerHTML=t}))}}}class Dr extends Yi{constructor(t){super(t),this.containerRef=z.createRef(),this.defineDragScroll=(t=!0,e=!0)=>{if(!this.containerRef.instance)return;let i={top:0,left:0,x:0,y:0};const s=s=>{const r=s.clientX-i.x,n=s.clientY-i.y;e&&(this.containerRef.instance.scrollTop=i.top-n),t&&(this.containerRef.instance.scrollLeft=i.left-r)},r=t=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),document.removeEventListener("mouseleave",r)};this.containerRef.instance.addEventListener("mousedown",(t=>{i={left:this.containerRef.instance.scrollLeft,top:this.containerRef.instance.scrollTop,x:t.clientX,y:t.clientY},document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),document.addEventListener("mouseleave",r)}))},this.render=()=>z.buildComponent(z.Fragment,null,z.buildComponent("div",{ref:this.containerRef,id:"KH_FE_FPLAN",class:"p2"},z.buildComponent("div",{id:"TLR"},z.buildComponent("div",null,z.buildComponent("pre",null,this.props.content)))),z.buildComponent(Fr,{containerRef:this.containerRef,position:this.props.position,reload:this.props.reload,page:1})),this.onAfterRender=()=>{this.defineDragScroll()}}}class Mr extends BaseInstrument{get templateID(){return"kh-fe-fplan"}get isInteractive(){return!0}constructor(){super(),this.bus=new r,this.newDataPublisher=new ii(new Map([["newData",{name:"L:KH_FE_FPLAN_NEW_DATA",type:l.Bool}],["position",{name:"L:KH_FE_FPLAN_BOARD",type:l.Number}]]),this.bus),this.contentOFP=ai.create(""),this.contentTLR=ai.create(""),this.position=ai.create(0),this.sbID="",this.getSB=async()=>{try{const t=await fetch(`https://www.simbrief.com/api/xml.fetcher.php?username=${this.sbID}&json=1`);if(t.ok)try{const e=await t.json();let i=e.text.plan_html;i=i.replace(/href=".*?"/g,""),this.contentOFP.set(i),this.contentTLR.set(e.text.tlr_section)}catch(t){console.error("JSON DECODE ERR",t)}}catch(t){console.error("FETCH ERR",t)}},this.reloadSB=()=>{SimVar.SetSimVarValue("L:KH_FE_FPLAN_NEW_DATA","bool",1)};const t=GetStoredData("FSS_B727_EFB_CONFIG_PREFLIGHT");try{this.sbID=JSON.parse(t).simBriefId}catch(t){console.error("Failed loading config.",t)}}Update(){super.Update(),this.newDataPublisher.onUpdate()}connectedCallback(){var t;super.connectedCallback(),this.newDataPublisher.startPublish();const e=this.bus.getSubscriber();e.on("newData").handle((t=>{t&&(SimVar.SetSimVarValue("L:KH_FE_FPLAN_NEW_DATA","bool",0),this.getSB())})),e.on("position").handle((t=>{this.position.set(t)}));const i=new URL(null!==(t=this.getAttribute("Url"))&&void 0!==t?t:"").searchParams.get("type");z.render(z.buildComponent(z.Fragment,null,"ofp"===i&&z.buildComponent(wr,{content:this.contentOFP,position:this.position,reload:this.reloadSB}),"tlr"===i&&z.buildComponent(Dr,{content:this.contentTLR,position:this.position,reload:this.reloadSB})),document.getElementById("root"))}}registerInstrument("kh-fe-fplan",Mr); diff --git a/2024/package.json b/2024/package.json deleted file mode 100644 index d9fe0c7..0000000 --- a/2024/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan", - "version": "1.0.0", - "description": "Adds a new clipboard to view your imported SimBrief flightplan and takeoff/landing performance", - "main": "index.js", - "scripts": { - "dev": "npx rollup -c", - "prod": "cross-env NODE_ENV=production npx rollup -c" - }, - "type": "module", - "keywords": [], - "author": "khofmann", - "license": "", - "devDependencies": { - "@microsoft/msfs-sdk": "^2.0.5", - "@microsoft/msfs-types": "^1.14.6", - "@rollup/plugin-node-resolve": "^16.0.0", - "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^12.1.2", - "autoprefixer": "^10.4.20", - "cross-env": "^7.0.3", - "postcss-import": "^16.1.0", - "prettier": "^3.4.2", - "prettier-plugin-organize-imports": "^4.1.0", - "rollup": "2", - "rollup-plugin-cleaner": "^1.0.0", - "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-import-css": "^3.5.8", - "rollup-plugin-postcss": "^4.0.2", - "sass": "^1.83.4", - "tslib": "^2.8.1", - "typescript": "^5.7.3" - } -} diff --git a/2024/rollup.config.js b/2024/rollup.config.js deleted file mode 100644 index 71369e1..0000000 --- a/2024/rollup.config.js +++ /dev/null @@ -1,43 +0,0 @@ -import resolve from '@rollup/plugin-node-resolve'; -import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; -import autoprefixer from 'autoprefixer'; -import atImport from 'postcss-import'; -import cleaner from 'rollup-plugin-cleaner'; -import copy from 'rollup-plugin-copy'; -import postcss from 'rollup-plugin-postcss'; - -const { NODE_ENV: targetEnv = 'development' } = process.env; -const inDirBase = 'Gauge/src'; -const outDirBase = 'PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/KH_FE_FPLAN/'; - -export default { - input: `${inDirBase}/index.tsx`, - output: { - dir: outDirBase, - format: 'es', - sourcemap: targetEnv !== 'production', - }, - plugins: [ - cleaner({ - targets: [outDirBase], - }), - postcss({ - plugins: [autoprefixer(), atImport()], - extract: true, - use: ['sass'], - sourceMap: targetEnv !== 'production', - minimize: targetEnv === 'production', - }), - resolve(), - typescript(), - targetEnv === 'production' && terser(), - copy({ - targets: [ - { src: [`${inDirBase}/index.html`], dest: outDirBase }, - { src: [`${inDirBase}/assets/img/**`], dest: outDirBase + 'assets/img' }, - { src: [`${inDirBase}/assets/fonts/**`], dest: outDirBase + 'assets/fonts' }, - ], - }), - ], -}; diff --git a/Gauge/src/App.tsx b/Gauge/src/App.tsx new file mode 100644 index 0000000..b25be18 --- /dev/null +++ b/Gauge/src/App.tsx @@ -0,0 +1,89 @@ +import { FC, useEffect, useRef, useState } from 'react'; +import OFP from './components/ofp/ofp'; +import TLR from './components/tlr/tlr'; + +interface AppProps { + type: string; +} + +const App: FC = ({ type }) => { + const [contentOFP, setContentOFP] = useState(''); + const [contentTLR, setContentTLR] = useState(''); + const [page, setPage] = useState(0); + const [position, setPosition] = useState(1); + const loopRef = useRef(undefined); + + useEffect(() => { + loopRef.current = setInterval(() => { + const flag = SimVar.GetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool'); + if (flag) { + SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 0); + getSB(); + } + }, 100); + + return () => clearInterval(loopRef.current); + }); + + const sbID = () => { + const config = GetStoredData('FSS_B727_EFB_CONFIG_PREFLIGHT'); + try { + return JSON.parse(config).simBriefId as string; + } catch (e) { + console.error('Failed loading config.', e); + return null; + } + }; + + const getSB = async () => { + try { + const res = await fetch(`https://www.simbrief.com/api/xml.fetcher.php?username=${sbID()}&json=1`); + if (res.ok) { + try { + const data = await res.json(); + + let ofp: string = data.text.plan_html; + ofp = ofp.replace(/href=".*?"/g, ''); + + setContentOFP(ofp); + setContentTLR(data.text.tlr_section); + } catch (e) { + console.error('JSON DECODE ERR', e); + } + } + } catch (e) { + console.error('FETCH ERR', e); + } + }; + + const reloadSB = () => { + SimVar.SetSimVarValue('L:KH_FE_FPLAN_NEW_DATA', 'bool', 1); + }; + + return ( + <> + {type === 'ofp' && ( + + )} + {type === 'tlr' && ( + + )} + + ); +}; + +export default App; diff --git a/2020/Gauge/src/assets/fonts/Consolas.ttf b/Gauge/src/assets/fonts/Consolas.ttf similarity index 100% rename from 2020/Gauge/src/assets/fonts/Consolas.ttf rename to Gauge/src/assets/fonts/Consolas.ttf diff --git a/2020/Gauge/src/assets/img/compass.png b/Gauge/src/assets/img/compass.png similarity index 100% rename from 2020/Gauge/src/assets/img/compass.png rename to Gauge/src/assets/img/compass.png diff --git a/2020/Gauge/src/assets/img/wrench.png b/Gauge/src/assets/img/wrench.png similarity index 100% rename from 2020/Gauge/src/assets/img/wrench.png rename to Gauge/src/assets/img/wrench.png diff --git a/2020/Gauge/src/components/controls/controls.scss b/Gauge/src/components/controls/controls.scss similarity index 100% rename from 2020/Gauge/src/components/controls/controls.scss rename to Gauge/src/components/controls/controls.scss diff --git a/Gauge/src/components/controls/controls.tsx b/Gauge/src/components/controls/controls.tsx new file mode 100644 index 0000000..96d29ee --- /dev/null +++ b/Gauge/src/components/controls/controls.tsx @@ -0,0 +1,72 @@ +import { Dispatch, FC, RefObject, SetStateAction } from 'react'; +import './controls.scss'; + +interface ControlsProps { + containerRef: RefObject; + position: number; + page: number; + reload: () => void; + setPosition: Dispatch>; + setPage: Dispatch>; +} + +const Controls: FC = ({ containerRef, position, page, reload, setPosition, setPage }) => { + const cycle = () => { + setPage((prev) => { + const _new = (prev + 1) % 2; + SimVar.SetSimVarValue('KH_FE_FPLAN_P1', 'bool', _new); + return _new; + }); + }; + + const toTop = () => { + if (!containerRef.current) return; + + containerRef.current.scrollTop = 0; + }; + + const switchPosition = () => { + setPosition((prev) => { + let _new = prev; + if (position === 1) _new = 2; + else if (position === 2) _new = 1; + SimVar.SetSimVarValue('KH_FE_FPLAN_BOARD', 'number', _new); + return _new; + }); + }; + + return ( +
+ {page === 1 && ( +
+ +
+ )} +
+ +
+
+ +
+
+ +
+ {page === 0 && ( +
+ +
+ )} +
+ ); +}; + +export default Controls; diff --git a/Gauge/src/components/ofp/ofp.tsx b/Gauge/src/components/ofp/ofp.tsx new file mode 100644 index 0000000..015999f --- /dev/null +++ b/Gauge/src/components/ofp/ofp.tsx @@ -0,0 +1,79 @@ +import { createRef, Dispatch, FC, SetStateAction, useEffect } from 'react'; +import Controls from '../controls/controls'; + +interface TLRProps { + content: string; + position: number; + page: number; + reload: () => void; + setPosition: Dispatch>; + setPage: Dispatch>; +} + +const OFP: FC = ({ content, position, page, reload, setPosition, setPage }) => { + const containerRef = createRef(); + + const defineDragScroll = (horizontalScroll = true, verticalScroll = true) => { + if (!containerRef.current) return; + + let pos = { top: 0, left: 0, x: 0, y: 0 }; + + const mouseDownHandler = (e: MouseEvent) => { + if (!containerRef.current) return; + + pos = { + left: containerRef.current.scrollLeft, + top: containerRef.current.scrollTop, + x: e.clientX, + y: e.clientY, + }; + document.addEventListener('mousemove', mouseMoveHandler); + document.addEventListener('mouseup', mouseUpHandler); + document.addEventListener('mouseleave', mouseUpHandler); + }; + + const mouseMoveHandler = (e: MouseEvent) => { + if (!containerRef.current) return; + + const dx = e.clientX - pos.x; + const dy = e.clientY - pos.y; + + if (verticalScroll) { + containerRef.current.scrollTop = pos.top - dy; + } + if (horizontalScroll) { + containerRef.current.scrollLeft = pos.left - dx; + } + }; + + const mouseUpHandler = (e: MouseEvent) => { + document.removeEventListener('mousemove', mouseMoveHandler); + document.removeEventListener('mouseup', mouseUpHandler); + document.removeEventListener('mouseleave', mouseUpHandler); + }; + + containerRef.current.addEventListener('mousedown', mouseDownHandler); + }; + + useEffect(() => { + defineDragScroll(); + }, [containerRef.current]); + + return ( + <> +
+
+
+ + + ); +}; + +export default OFP; diff --git a/Gauge/src/components/tlr/tlr.tsx b/Gauge/src/components/tlr/tlr.tsx new file mode 100644 index 0000000..fcacd93 --- /dev/null +++ b/Gauge/src/components/tlr/tlr.tsx @@ -0,0 +1,83 @@ +import { createRef, Dispatch, FC, SetStateAction, useEffect } from 'react'; +import Controls from '../controls/controls'; + +interface TLRProps { + content: string; + position: number; + page: number; + reload: () => void; + setPosition: Dispatch>; + setPage: Dispatch>; +} + +const TLR: FC = ({ content, position, page, reload, setPosition, setPage }) => { + const containerRef = createRef(); + + const defineDragScroll = (horizontalScroll = true, verticalScroll = true) => { + if (!containerRef.current) return; + + let pos = { top: 0, left: 0, x: 0, y: 0 }; + + const mouseDownHandler = (e: MouseEvent) => { + if (!containerRef.current) return; + + pos = { + left: containerRef.current.scrollLeft, + top: containerRef.current.scrollTop, + x: e.clientX, + y: e.clientY, + }; + document.addEventListener('mousemove', mouseMoveHandler); + document.addEventListener('mouseup', mouseUpHandler); + document.addEventListener('mouseleave', mouseUpHandler); + }; + + const mouseMoveHandler = (e: MouseEvent) => { + if (!containerRef.current) return; + + const dx = e.clientX - pos.x; + const dy = e.clientY - pos.y; + + if (verticalScroll) { + containerRef.current.scrollTop = pos.top - dy; + } + if (horizontalScroll) { + containerRef.current.scrollLeft = pos.left - dx; + } + }; + + const mouseUpHandler = (e: MouseEvent) => { + document.removeEventListener('mousemove', mouseMoveHandler); + document.removeEventListener('mouseup', mouseUpHandler); + document.removeEventListener('mouseleave', mouseUpHandler); + }; + + containerRef.current.addEventListener('mousedown', mouseDownHandler); + }; + + useEffect(() => { + defineDragScroll(); + }, [containerRef.current]); + + return ( + <> +
+
+
+
{content}
+
+
+
+ + + ); +}; + +export default TLR; diff --git a/2020/Gauge/src/index.html b/Gauge/src/index.html similarity index 100% rename from 2020/Gauge/src/index.html rename to Gauge/src/index.html diff --git a/2020/Gauge/src/index.scss b/Gauge/src/index.scss similarity index 100% rename from 2020/Gauge/src/index.scss rename to Gauge/src/index.scss diff --git a/Gauge/src/index.tsx b/Gauge/src/index.tsx new file mode 100644 index 0000000..bf3b9f0 --- /dev/null +++ b/Gauge/src/index.tsx @@ -0,0 +1,54 @@ +/// +/// +/// +/// + +import { createRoot } from 'react-dom/client'; + +import App from './App'; +import './index.scss'; + +class KH_FE_FPLAN extends BaseInstrument { + get templateID(): string { + return 'kh-fe-fplan'; + } + + get isInteractive() { + return true; + } + + constructor() { + super(); + } + + protected Update(): void { + super.Update(); + } + + public connectedCallback(): void { + super.connectedCallback(); + + //@ts-expect-error + const url = new URL(this.getAttribute('Url') ?? ''); + const type = url.searchParams.get('type') ?? ''; + + const container = document.getElementById('root'); + if (container) { + const root = createRoot(container); + root.render(); + } + + /* + FSComponent.render( + <> + {type === 'ofp' && } + {type === 'tlr' && } + , + document.getElementById('root') + ); + */ + } +} + +//@ts-expect-error +registerInstrument('kh-fe-fplan', KH_FE_FPLAN); diff --git a/2020/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml similarity index 91% rename from 2020/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml rename to PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml index 7ce8db1..85da4ea 100644 --- a/2020/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml +++ b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml @@ -16,15 +16,15 @@ false - PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan\ContentInfo\ - ContentInfo\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan\ + PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20\ContentInfo\ + ContentInfo\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20\ Copy false - PackageSources\SimObjects\Airplanes\ + PackageSources\SimObjects\Airplanes-20\ SimObjects\Airplanes\ @@ -45,4 +45,3 @@ - diff --git a/2020/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan/ContentInfo/Thumbnail.jpg b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20/ContentInfo/Thumbnail.jpg similarity index 100% rename from 2020/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan/ContentInfo/Thumbnail.jpg rename to PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20/ContentInfo/Thumbnail.jpg diff --git a/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml new file mode 100644 index 0000000..f039e40 --- /dev/null +++ b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml @@ -0,0 +1,48 @@ + + + + MISC + FSS Boeing 727-200f SimBrief Flightplan + + khofmann + + + false + false + + + + ContentInfo + + false + + PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24\ContentInfo + ContentInfo\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24\ + + + Copy + + false + + PackageSources\SimObjects\Airplanes-24\ + SimObjects\Airplanes\ + + + Copy + + false + + PackageSources\html_ui\ + html_ui\ + + + SimObject + + false + + PackageSources\SimObjects\Misc\fss-aircraft-boeing-727-200f-sb-fplan\ + SimObjects\Misc\fss-aircraft-boeing-727-200f-sb-fplan\ + + + + diff --git a/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24/ContentInfo/Thumbnail.jpg b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24/ContentInfo/Thumbnail.jpg new file mode 100644 index 0000000..24e3301 Binary files /dev/null and b/PackageDefinitions/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24/ContentInfo/Thumbnail.jpg differ diff --git a/2020/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/model/B727_interior.xml b/PackageSources/SimObjects/Airplanes-20/FSS_Boeing_727_200F/model/B727_interior.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/model/B727_interior.xml rename to PackageSources/SimObjects/Airplanes-20/FSS_Boeing_727_200F/model/B727_interior.xml diff --git a/2020/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/panel/panel.cfg b/PackageSources/SimObjects/Airplanes-20/FSS_Boeing_727_200F/panel/panel.cfg similarity index 100% rename from 2020/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/panel/panel.cfg rename to PackageSources/SimObjects/Airplanes-20/FSS_Boeing_727_200F/panel/panel.cfg diff --git a/2024/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/model/B727_interior.xml b/PackageSources/SimObjects/Airplanes-24/FSS_Boeing_727_200F/model/B727_interior.xml similarity index 100% rename from 2024/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/model/B727_interior.xml rename to PackageSources/SimObjects/Airplanes-24/FSS_Boeing_727_200F/model/B727_interior.xml diff --git a/2024/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/panel/panel.cfg b/PackageSources/SimObjects/Airplanes-24/FSS_Boeing_727_200F/panel/panel.cfg similarity index 96% rename from 2024/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/panel/panel.cfg rename to PackageSources/SimObjects/Airplanes-24/FSS_Boeing_727_200F/panel/panel.cfg index e0dcadc..8934138 100644 --- a/2024/PackageSources/SimObjects/Airplanes/FSS_Boeing_727_200F/panel/panel.cfg +++ b/PackageSources/SimObjects/Airplanes-24/FSS_Boeing_727_200F/panel/panel.cfg @@ -35,32 +35,37 @@ pixel_size = 183, 149 texture = $CIVA_Screen_3 htmlgauge00 = FSS_B727/CIVA/CIVAScreen3.html, 0, 0, 183, 149 +; KHOFMANN START [VCockpit06] +background_color = 0,0,0 size_mm = 840, 1188 pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_7 -htmlgauge00 = FSS_B727/EFB/EFBAircraft.html, 0, 0, 840, 1188 +texture = $KH_FE_FPLAN_P1 +htmlgauge00= FSS_B727/KH_FE_FPLAN/index.html?type=ofp, 0, 0, 840, 1188 emissive = 0 [VCockpit07] -size_mm = 840, 1188 +background_color = 0,0,0 +size_mm = 210, 297 pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_5 -htmlgauge00 = FSS_B727/EFB/EFBOptions.html, 0, 0, 840, 1188 +texture = $KH_FE_FPLAN_P2 +htmlgauge00= FSS_B727/KH_FE_FPLAN/index.html?type=tlr, 0, 0, 840, 1188 emissive = 0 +; KHOFMANN END -[VCockpit08] -size_mm = 840, 1188 -pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_4 -htmlgauge00 = FSS_B727/EFB/EFBPreflight.html, 0, 0, 840, 1188 -emissive = 0 +# MSFS 2024 +#[VCockpit08] +#size_mm = 840, 1188 +#pixel_size = 840, 1188 +#texture = $EFB_CLIPBOARD_Screen_6 +#htmlgauge00 = FSS_B727/EFB/EFBCharts.html, 0, 0, 840, 1188 +#emissive = 0 [VCockpit09] size_mm = 840, 1188 pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_3 -htmlgauge00 = FSS_B727/EFB/EFBTakeoff.html, 0, 0, 840, 1188 +texture = $EFB_CLIPBOARD_Screen_1 +htmlgauge00 = FSS_B727/EFB/EFBLanding.html, 0, 0, 840, 1188 emissive = 0 [VCockpit10] @@ -73,36 +78,50 @@ emissive = 0 [VCockpit11] size_mm = 840, 1188 pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_1 -htmlgauge00 = FSS_B727/EFB/EFBLanding.html, 0, 0, 840, 1188 +texture = $EFB_CLIPBOARD_Screen_3 +htmlgauge00 = FSS_B727/EFB/EFBTakeoff.html, 0, 0, 840, 1188 emissive = 0 [VCockpit12] size_mm = 840, 1188 pixel_size = 840, 1188 -texture = $EFB_CLIPBOARD_Screen_6 -htmlgauge00 = FSS_B727/EFB/EFBCharts.html, 0, 0, 840, 1188 +texture = $EFB_CLIPBOARD_Screen_4 +htmlgauge00 = FSS_B727/EFB/EFBPreflight.html, 0, 0, 840, 1188 emissive = 0 [VCockpit13] +size_mm = 840, 1188 +pixel_size = 840, 1188 +texture = $EFB_CLIPBOARD_Screen_5 +htmlgauge00 = FSS_B727/EFB/EFBOptions.html, 0, 0, 840, 1188 +emissive = 0 + +[VCockpit14] +size_mm = 840, 1188 +pixel_size = 840, 1188 +texture = $EFB_CLIPBOARD_Screen_7 +htmlgauge00 = FSS_B727/EFB/EFBAircraft.html, 0, 0, 840, 1188 +emissive = 0 + +[VCockpit15] size_mm = 620, 610 pixel_size = 620, 610 texture = $STBY_ARTIFICIAL_HORIZON_Ball htmlgauge00 = NavSystems/AS1000_BackupDisplay/Attitude/AS1000_AttitudeBackup.html, 0,0, 620, 610 -[VCockpit14] +[VCockpit16] size_mm = 870, 860 pixel_size = 870, 860 texture = $artificial_horizon_screen_1 htmlgauge00 = FSS_B727/Attitude/AS1000_AttitudeBackup.html, 0,0, 870, 860 -[VCockpit15] +[VCockpit17] size_mm = 870, 860 pixel_size = 870, 860 texture = $artificial_horizon_screen_2 htmlgauge00 = FSS_B727/Attitude/AS1000_AttitudeBackup.html, 0,0, 870, 860 -[VCockpit16] +[VCockpit18] Background_color = 0,0,0 size_mm = 650,768 visible = 0 @@ -110,7 +129,7 @@ pixel_size = 650,768 texture = $GTN750_screen htmlgauge00= FSS_B727/pms50_gtn750_int/gtn750_int.html, 0, 0, 650,768 -[VCockpit17] +[VCockpit19] Background_color = 0,0,0 size_mm = 650,290 visible = 0 @@ -118,93 +137,75 @@ pixel_size = 650,290 texture = $GTN650_screen htmlgauge00= FSS_B727/pms50_gtn750_int/gtn650_int.html?index=2, 0, 0, 650,290 -[VCockpit18] +[VCockpit20] size_mm=0,0 pixel_size=0,0 texture=NO_TEXTURE background_color=42,42,40 htmlgauge00= FSS_B727/WT/v2/WTT1.html, 0,0,0,0 -[VCockpit19] +[VCockpit21] size_mm=0,0 pixel_size=0,0 texture=NO_TEXTURE background_color=42,42,40 htmlgauge00= FSS_B727/WT/v2/WTT2.html, 0,0,0,0 -[VCockpit20] +[VCockpit22] size_mm = 836, 646 pixel_size = 0, 0 texture = $GNSXLS_Screen htmlgauge00= FSS_B727/GNSXLS/GNSXLS.html, 0, 0, 836, 646 -[VCockpit21] +[VCockpit23] size_mm = 660, 1420 pixel_size = 0, 0 texture = $IPHONE_Screen htmlgauge00= FSS_B727/CrewCoordination/CrewCoordination.html, 0, 0, 660, 1420 -[VCockpit22] +[VCockpit24] size_mm = 650,768 pixel_size = 650,768 texture = $SCREEN_TDSGTNXI750 background_color=0,0,0 htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=Gauge/TDSGTNXiGaugeModule.wasm&wasm_gauge=GTNXI750U1, 0,0,650,768 -[VCockpit23] +[VCockpit25] size_mm = 378, 320 pixel_size = 378, 320 texture = $VHFCOMM_Screen_1 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=1&type=com, 0, 0, 378, 320 -[VCockpit24] +[VCockpit26] size_mm = 378, 320 pixel_size = 378, 320 texture = $VHFCOMM_Screen_2 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=2&type=com, 0, 0, 378, 320 -[VCockpit25] +[VCockpit27] size_mm = 378, 320 pixel_size = 378, 320 texture = $NAV_Screen_1 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=1&type=nav, 0, 0, 378, 320 -[VCockpit26] +[VCockpit28] size_mm = 378, 320 pixel_size = 378, 320 texture = $NAV_Screen_2 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=2&type=nav, 0, 0, 378, 320 -[VCockpit27] +[VCockpit29] size_mm = 378, 320 pixel_size = 378, 320 texture = $ADF_Screen_1 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=1&type=adf, 0, 0, 378, 320 -[VCockpit28] +[VCockpit30] size_mm = 378, 320 pixel_size = 378, 320 texture = $ADF_Screen_2 htmlgauge00= FSS_B727/RadioScreens/RadioScreens.html?index=2&type=adf, 0, 0, 378, 320 -; KHOFMANN START -[VCockpit29] -background_color = 0,0,0 -size_mm = 840, 1188 -pixel_size = 840, 1188 -texture = $KH_FE_FPLAN_P1 -htmlgauge00= FSS_B727/KH_FE_FPLAN/index.html?type=ofp, 0, 0, 840, 1188 -emissive = 0 - -[VCockpit30] -background_color = 0,0,0 -size_mm = 840, 1188 -pixel_size = 840, 1188 -texture = $KH_FE_FPLAN_P2 -htmlgauge00= FSS_B727/KH_FE_FPLAN/index.html?type=tlr, 0, 0, 840, 1188 -emissive = 0 -; KHOFMANN END - [VPainting01] size_mm = 2048,512 texture = $RegistrationNumber diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_COCKPIT_DECAL_ALBD.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_COMP.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_727_GENERAL_NORM.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.png.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_ALBD.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.png.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_COMP.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.png.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_EMIS.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.png.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/FSS_B727_PILOT_PANEL_NORM.PNG.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/model.cfg diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.bin diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.gltf diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/model/sb-fplan.xml diff --git a/2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg b/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg similarity index 100% rename from 2020/PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg rename to PackageSources/SimObjects/Misc/fss-aircraft-boeing-727-200f-sb-fplan/sim.cfg diff --git a/2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js b/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js similarity index 100% rename from 2020/PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js rename to PackageSources/html_ui/Pages/VCockpit/Instruments/FSS_B727/EFB/EFBUtils.js diff --git a/2020/package.json b/package.json similarity index 81% rename from 2020/package.json rename to package.json index a5f73ce..94a82d6 100644 --- a/2020/package.json +++ b/package.json @@ -12,14 +12,16 @@ "author": "khofmann", "license": "", "devDependencies": { - "@microsoft/msfs-sdk": "^0.8.0", "@microsoft/msfs-types": "^1.14.6", + "@rollup/plugin-commonjs": "^28.0.2", "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-replace": "^6.0.2", "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.2", + "@types/react": "^19.0.10", + "@types/react-dom": "^19.0.4", "autoprefixer": "^10.4.20", "cross-env": "^7.0.3", - "sass": "^1.83.4", "postcss-import": "^16.1.0", "prettier": "^3.4.2", "prettier-plugin-organize-imports": "^4.1.0", @@ -28,7 +30,12 @@ "rollup-plugin-copy": "^3.5.0", "rollup-plugin-import-css": "^3.5.8", "rollup-plugin-postcss": "^4.0.2", + "sass": "^1.83.4", "tslib": "^2.8.1", "typescript": "^5.7.3" + }, + "dependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0" } } diff --git a/2024/pnpm-lock.yaml b/pnpm-lock.yaml similarity index 94% rename from 2024/pnpm-lock.yaml rename to pnpm-lock.yaml index 608ee14..05d2bfe 100644 --- a/2024/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,22 +7,38 @@ settings: importers: .: + dependencies: + react: + specifier: ^19.0.0 + version: 19.0.0 + react-dom: + specifier: ^19.0.0 + version: 19.0.0(react@19.0.0) devDependencies: - '@microsoft/msfs-sdk': - specifier: ^2.0.5 - version: 2.0.5 '@microsoft/msfs-types': specifier: ^1.14.6 version: 1.14.6 + '@rollup/plugin-commonjs': + specifier: ^28.0.2 + version: 28.0.2(rollup@2.79.2) '@rollup/plugin-node-resolve': specifier: ^16.0.0 version: 16.0.0(rollup@2.79.2) + '@rollup/plugin-replace': + specifier: ^6.0.2 + version: 6.0.2(rollup@2.79.2) '@rollup/plugin-terser': specifier: ^0.4.4 version: 0.4.4(rollup@2.79.2) '@rollup/plugin-typescript': specifier: ^12.1.2 version: 12.1.2(rollup@2.79.2)(tslib@2.8.1)(typescript@5.7.3) + '@types/react': + specifier: ^19.0.10 + version: 19.0.10 + '@types/react-dom': + specifier: ^19.0.4 + version: 19.0.4(@types/react@19.0.10) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.5.1) @@ -86,9 +102,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@microsoft/msfs-sdk@2.0.5': - resolution: {integrity: sha512-7maXNMBx2Cp1RYPc3IJFIYU+E/HQOvk/aNVAm2FIYQwFDBlSnoR2Y5B9b7htFLuLDiBZPL1T/u5v3O9byvEY1A==} - '@microsoft/msfs-types@1.14.6': resolution: {integrity: sha512-p2dmrxMpnurr7lOFRKjLCysxR6bb+MWJmRvYQkaExq7qBc8bu98WgI14X8W+pf2g0rlH69cN+uP9Kvz/dnPDuw==} @@ -186,6 +199,15 @@ packages: resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} + '@rollup/plugin-commonjs@28.0.2': + resolution: {integrity: sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==} + engines: {node: '>=16.0.0 || 14 >= 14.17'} + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + '@rollup/plugin-node-resolve@16.0.0': resolution: {integrity: sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==} engines: {node: '>=14.0.0'} @@ -195,6 +217,15 @@ packages: rollup: optional: true + '@rollup/plugin-replace@6.0.2': + resolution: {integrity: sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + '@rollup/plugin-terser@0.4.4': resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} engines: {node: '>=14.0.0'} @@ -245,6 +276,14 @@ packages: '@types/node@22.13.0': resolution: {integrity: sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==} + '@types/react-dom@19.0.4': + resolution: {integrity: sha512-4fSQ8vWFkg+TGhePfUzVmat3eC14TXYSsiiDSLI0dVLsrm9gZFABjPy/Qu6TKgl1tq1Bu1yDsuQgY3A3DOjCcg==} + peerDependencies: + '@types/react': ^19.0.0 + + '@types/react@19.0.10': + resolution: {integrity: sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==} + '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -323,6 +362,9 @@ packages: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -382,6 +424,9 @@ packages: resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} engines: {node: '>=8.0.0'} + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -434,6 +479,14 @@ packages: fastq@1.19.0: resolution: {integrity: sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==} + fdir@6.4.3: + resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -536,6 +589,9 @@ packages: resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} engines: {node: '>=0.10.0'} + is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -559,6 +615,9 @@ packages: lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + mdn-data@2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} @@ -892,6 +951,15 @@ packages: randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + react-dom@19.0.0: + resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} + peerDependencies: + react: ^19.0.0 + + react@19.0.0: + resolution: {integrity: sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==} + engines: {node: '>=0.10.0'} + read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} @@ -961,6 +1029,9 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + scheduler@0.25.0: + resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} + serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} @@ -1088,8 +1159,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@microsoft/msfs-sdk@2.0.5': {} - '@microsoft/msfs-types@1.14.6': {} '@nodelib/fs.scandir@2.1.5': @@ -1165,6 +1234,18 @@ snapshots: '@parcel/watcher-win32-x64': 2.5.1 optional: true + '@rollup/plugin-commonjs@28.0.2(rollup@2.79.2)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@2.79.2) + commondir: 1.0.1 + estree-walker: 2.0.2 + fdir: 6.4.3(picomatch@4.0.2) + is-reference: 1.2.1 + magic-string: 0.30.17 + picomatch: 4.0.2 + optionalDependencies: + rollup: 2.79.2 + '@rollup/plugin-node-resolve@16.0.0(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 5.1.4(rollup@2.79.2) @@ -1175,6 +1256,13 @@ snapshots: optionalDependencies: rollup: 2.79.2 + '@rollup/plugin-replace@6.0.2(rollup@2.79.2)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@2.79.2) + magic-string: 0.30.17 + optionalDependencies: + rollup: 2.79.2 + '@rollup/plugin-terser@0.4.4(rollup@2.79.2)': dependencies: serialize-javascript: 6.0.2 @@ -1219,6 +1307,14 @@ snapshots: dependencies: undici-types: 6.20.0 + '@types/react-dom@19.0.4(@types/react@19.0.10)': + dependencies: + '@types/react': 19.0.10 + + '@types/react@19.0.10': + dependencies: + csstype: 3.1.3 + '@types/resolve@1.20.2': {} acorn@8.14.0: {} @@ -1293,6 +1389,8 @@ snapshots: commander@7.2.0: {} + commondir@1.0.1: {} + concat-map@0.0.1: {} concat-with-sourcemaps@1.1.0: @@ -1378,6 +1476,8 @@ snapshots: dependencies: css-tree: 1.1.3 + csstype@3.1.3: {} + deepmerge@4.3.1: {} detect-libc@1.0.3: @@ -1429,6 +1529,10 @@ snapshots: dependencies: reusify: 1.0.4 + fdir@6.4.3(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -1525,6 +1629,10 @@ snapshots: is-plain-object@3.0.1: {} + is-reference@1.2.1: + dependencies: + '@types/estree': 1.0.6 + isexe@2.0.0: {} jsonfile@4.0.0: @@ -1541,6 +1649,10 @@ snapshots: lodash.uniq@4.5.0: {} + magic-string@0.30.17: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + mdn-data@2.0.14: {} merge2@1.4.1: {} @@ -1830,6 +1942,13 @@ snapshots: dependencies: safe-buffer: 5.2.1 + react-dom@19.0.0(react@19.0.0): + dependencies: + react: 19.0.0 + scheduler: 0.25.0 + + react@19.0.0: {} + read-cache@1.0.0: dependencies: pify: 2.3.0 @@ -1911,6 +2030,8 @@ snapshots: optionalDependencies: '@parcel/watcher': 2.5.1 + scheduler@0.25.0: {} + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 diff --git a/2020/rollup.config.js b/rollup.config.js similarity index 76% rename from 2020/rollup.config.js rename to rollup.config.js index 71369e1..b4950f0 100644 --- a/2020/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,6 @@ +import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; import terser from '@rollup/plugin-terser'; import typescript from '@rollup/plugin-typescript'; import autoprefixer from 'autoprefixer'; @@ -19,6 +21,12 @@ export default { sourcemap: targetEnv !== 'production', }, plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify(targetEnv), + 'import.meta.env': true, + 'import.meta.env.MODE': JSON.stringify(targetEnv), + preventAssignment: true, + }), cleaner({ targets: [outDirBase], }), @@ -30,7 +38,10 @@ export default { minimize: targetEnv === 'production', }), resolve(), - typescript(), + typescript({ outputToFilesystem: false }), + commonjs({ + requireReturnsDefault: 'auto', + }), targetEnv === 'production' && terser(), copy({ targets: [ diff --git a/2024/tsconfig.json b/tsconfig.json similarity index 72% rename from 2024/tsconfig.json rename to tsconfig.json index d18e596..f359f57 100644 --- a/2024/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,6 @@ "skipLibCheck": true, /* Skip type checking on library .d.ts files */ "forceConsistentCasingInFileNames": true, /* Ensures correct import casing */ "moduleResolution": "node", /* Enables compatibility with MSFS SDK bare global imports */ - "jsxFactory": "FSComponent.buildComponent", /* Required for FSComponent framework JSX */ - "jsxFragmentFactory": "FSComponent.Fragment", /* Required for FSComponent framework JSX */ - "jsx": "react" /* Required for FSComponent framework JSX */ + "jsx": "react-jsx" /* Required for JSX */ } } diff --git a/2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.user similarity index 67% rename from 2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user rename to xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.user index 5909036..5ef241f 100644 --- a/2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.user @@ -1,6 +1,6 @@ - + diff --git a/2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml similarity index 95% rename from 2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml rename to xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml index 2dbd3ed..d4665e5 100644 --- a/2020/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml @@ -4,8 +4,7 @@ _PackageInt _PublishingGroupInt - PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml + PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-20.xml - diff --git a/2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.user similarity index 67% rename from 2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user rename to xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.user index 5909036..90e9817 100644 --- a/2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.user +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.user @@ -1,6 +1,6 @@ - + diff --git a/2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml similarity index 95% rename from 2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml rename to xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml index 2dbd3ed..3e0fd5b 100644 --- a/2024/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml @@ -4,8 +4,7 @@ _PackageInt _PublishingGroupInt - PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.xml + PackageDefinitions\xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml - diff --git a/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml.user b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml.user new file mode 100644 index 0000000..90e9817 --- /dev/null +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan-24.xml.user @@ -0,0 +1,9 @@ + + + + + + + false + + diff --git a/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.code-workspace b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.code-workspace index ad3d4bf..8aecc71 100644 --- a/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.code-workspace +++ b/xkhofmann-fss-aircraft-boeing-727-200f-sb-fplan.code-workspace @@ -6,6 +6,8 @@ ], "settings": { "cSpell.words": [ + "baseinstrument", + "datastorage", "Flightplan", "FLTSIM", "fplan", @@ -15,7 +17,9 @@ "KHOFMANN", "LODS", "msfs", + "simvar", "soundai", + "vcockpit", "xkhofmann" ] }