signalk-binnacle 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,4 +4,4 @@
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
- let e=Symbol(`Comlink.proxy`),t=Symbol(`Comlink.endpoint`),n=Symbol(`Comlink.releaseProxy`),r=Symbol(`Comlink.finalizer`),i=Symbol(`Comlink.thrown`),a=e=>typeof e==`object`&&!!e||typeof e==`function`,o=new Map([[`proxy`,{canHandle:t=>a(t)&&t[e],serialize(e){let{port1:t,port2:n}=new MessageChannel;return c(e,t),[n,[n]]},deserialize(e){return e.start(),d(e)}}],[`throw`,{canHandle:e=>a(e)&&i in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function s(e,t){for(let n of e)if(t===n||n===`*`||n instanceof RegExp&&n.test(t))return!0;return!1}function c(e,t=globalThis,n=[`*`]){t.addEventListener(`message`,function a(o){if(!o||!o.data)return;if(!s(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}let{id:l,type:d,path:f}=Object.assign({path:[]},o.data),p=(o.data.argumentList||[]).map(T),m;try{let t=f.slice(0,-1).reduce((e,t)=>e[t],e),n=f.reduce((e,t)=>e[t],e);switch(d){case`GET`:m=n;break;case`SET`:t[f.slice(-1)[0]]=T(o.data.value),m=!0;break;case`APPLY`:m=n.apply(t,p);break;case`CONSTRUCT`:m=C(new n(...p));break;case`ENDPOINT`:{let{port1:t,port2:n}=new MessageChannel;c(e,n),m=S(t,[t])}break;case`RELEASE`:m=void 0;break;default:return}}catch(e){m={value:e,[i]:0}}Promise.resolve(m).catch(e=>({value:e,[i]:0})).then(n=>{let[i,o]=w(n);t.postMessage(Object.assign(Object.assign({},i),{id:l}),o),d===`RELEASE`&&(t.removeEventListener(`message`,a),u(t),r in e&&typeof e[r]==`function`&&e[r]())}).catch(e=>{let[n,r]=w({value:TypeError(`Unserializable return value`),[i]:0});t.postMessage(Object.assign(Object.assign({},n),{id:l}),r)})}),t.start&&t.start()}function l(e){return e.constructor.name===`MessagePort`}function u(e){l(e)&&e.close()}function d(e,t){let n=new Map;return e.addEventListener(`message`,function(e){let{data:t}=e;if(!t||!t.id)return;let r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),v(e,n,[],t)}function f(e){if(e)throw Error(`Proxy has been released and is not useable`)}function p(e){return E(e,new Map,{type:`RELEASE`}).then(()=>{u(e)})}let m=new WeakMap,h=`FinalizationRegistry`in globalThis&&new FinalizationRegistry(e=>{let t=(m.get(e)||0)-1;m.set(e,t),t===0&&p(e)});function g(e,t){let n=(m.get(t)||0)+1;m.set(t,n),h&&h.register(e,t,e)}function _(e){h&&h.unregister(e)}function v(e,r,i=[],a=function(){}){let o=!1,s=new Proxy(a,{get(t,a){if(f(o),a===n)return()=>{_(s),p(e),r.clear(),o=!0};if(a===`then`){if(i.length===0)return{then:()=>s};let t=E(e,r,{type:`GET`,path:i.map(e=>e.toString())}).then(T);return t.then.bind(t)}return v(e,r,[...i,a])},set(t,n,a){f(o);let[s,c]=w(a);return E(e,r,{type:`SET`,path:[...i,n].map(e=>e.toString()),value:s},c).then(T)},apply(n,a,s){f(o);let c=i[i.length-1];if(c===t)return E(e,r,{type:`ENDPOINT`}).then(T);if(c===`bind`)return v(e,r,i.slice(0,-1));let[l,u]=b(s);return E(e,r,{type:`APPLY`,path:i.map(e=>e.toString()),argumentList:l},u).then(T)},construct(t,n){f(o);let[a,s]=b(n);return E(e,r,{type:`CONSTRUCT`,path:i.map(e=>e.toString()),argumentList:a},s).then(T)}});return g(s,e),s}function y(e){return Array.prototype.concat.apply([],e)}function b(e){let t=e.map(w);return[t.map(e=>e[0]),y(t.map(e=>e[1]))]}let x=new WeakMap;function S(e,t){return x.set(e,t),e}function C(t){return Object.assign(t,{[e]:!0})}function w(e){for(let[t,n]of o)if(n.canHandle(e)){let[r,i]=n.serialize(e);return[{type:`HANDLER`,name:t,value:r},i]}return[{type:`RAW`,value:e},x.get(e)||[]]}function T(e){switch(e.type){case`HANDLER`:return o.get(e.name).deserialize(e.value);case`RAW`:return e.value}}function E(e,t,n,r){return new Promise(i=>{let a=D();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function D(){return[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)}let O=typeof requestAnimationFrame==`function`?e=>{requestAnimationFrame(()=>e(Date.now()))}:e=>{setTimeout(()=>e(Date.now()),16)};var k=class{onFlush;#e=new Map;#t=new Map;#n=!1;#r;constructor(e=O){this.#r=e}put(e,t){this.#e.set(e,t),this.#i()}putVessel(e,t,n){let r=this.#t.get(e);r||(r=new Map,this.#t.set(e,r)),r.set(t,n),this.#i()}#i(){this.#n||(this.#n=!0,this.#r(e=>this.#a(e)))}#a(e){if(this.#n=!1,this.#e.size===0&&this.#t.size===0)return;let t=this.#e,n=this.#t;this.#e=new Map,this.#t=new Map,this.onFlush?.(t,n,e)}};function A(e,t=500,n=3e4){let r=Math.min(n,t*2**e);return Math.random()*r}function j(e,t){return e.includes(`?`)?`${e}&${t}`:`${e}?${t}`}var M=class{#e;#t;#n;#r=0;#i=!1;#a;constructor(e,t){this.#e=e,this.#t=t}connect(){this.#i=!1,this.#a&&clearTimeout(this.#a),this.#n?.close(),this.#s(`connecting`);let e=new WebSocket(j(this.#e,`subscribe=none`));this.#n=e,e.onopen=()=>{this.#n===e&&(this.#r=0,this.#s(`open`),this.#t.onOpen?.())},e.onmessage=t=>{this.#n===e&&this.#t.onDelta(t.data)},e.onclose=()=>{this.#n!==e||this.#i||this.#o()},e.onerror=()=>{this.#n===e&&e.close()}}send(e){this.#n?.readyState===WebSocket.OPEN&&this.#n.send(JSON.stringify(e))}disconnect(){this.#i=!0,this.#a&&clearTimeout(this.#a);let e=this.#n!==void 0;this.#n?.close(),this.#n=void 0,e&&this.#s(`closed`)}#o(){this.#s(`reconnecting`);let e=A(this.#r);this.#r+=1,this.#a=setTimeout(()=>{this.#i||this.connect()},e)}#s(e){this.#t.onState({phase:e,attempt:this.#r})}};let N={phase:`connecting`,attempt:0};function P(e,t){let n=e.context??`vessels.self`;for(let r of e.updates??[]){let e=r.values;if(Array.isArray(e))for(let r of e)t({context:n,path:r.path,value:r.value})}}var F=class{#e=new Map;#t;constructor(e){this.#t=e}add(e){let t=[];for(let n of e){let e=this.#i(n),r=`${e.context}|${e.path}`,i=this.#e.get(r);i?i.count+=1:(this.#e.set(r,{count:1,entry:e}),this.#o(e)),t.push(r)}return()=>this.#n(t)}remove(e,t){let n=t??`vessels.self`;for(let t of e)this.#r(`${n}|${t}`)}resubscribeAll(){let e=new Map;for(let{entry:t}of this.#e.values()){let n=e.get(t.context);n?n.push(this.#a(t)):e.set(t.context,[this.#a(t)])}for(let[t,n]of e)this.#t({context:t,subscribe:n})}#n(e){for(let t of e)this.#r(t)}#r(e){let t=this.#e.get(e);t&&(--t.count,!(t.count>0)&&(this.#e.delete(e),this.#t({context:t.entry.context,unsubscribe:[{path:t.entry.path}]})))}#i(e){return{context:e.context??`vessels.self`,path:e.path,period:e.period??1e3,minPeriod:e.minPeriod,policy:e.policy??`ideal`}}#a(e){let t={path:e.path,period:e.period,policy:e.policy};return e.minPeriod!==void 0&&(t.minPeriod=e.minPeriod),t}#o(e){this.#t({context:e.context,subscribe:[this.#a(e)]})}},I=class{#e;#t;#n=new k;#r;#i=N;#a;connect(e,t){this.#r=t,this.#e=new M(e,{onState:e=>{this.#i=e},onDelta:e=>this.#s(e),onOpen:()=>this.#t?.resubscribeAll()}),this.#t=new F(e=>this.#e?.send(e)),this.#n.onFlush=(e,t,n)=>{this.#r?.({self:e,ais:t,connection:this.#i,epoch:n})},this.#e.connect()}subscribe(e){this.#t?.add(e)}unsubscribe(e,t){this.#t?.remove(e,t)}publish(e){this.#e?.send(e)}disconnect(){this.#e?.disconnect()}#o(e){return e===`vessels.self`||e===this.#a}#s(e){let t;try{t=JSON.parse(e)}catch{return}if(!t.updates){typeof t.self==`string`&&(this.#a=t.self);return}P(t,e=>{this.#o(e.context)?this.#n.put(e.path,e.value):this.#n.putVessel(e.context,e.path,e.value)})}};c(new class{#e=new I;async connect(e,t){this.#e.connect(e,t)}async subscribe(e){this.#e.subscribe(e)}async unsubscribe(e,t){this.#e.unsubscribe(e,t)}async publish(e){this.#e.publish(e)}async disconnect(){this.#e.disconnect()}})})();
7
+ let e=Symbol(`Comlink.proxy`),t=Symbol(`Comlink.endpoint`),n=Symbol(`Comlink.releaseProxy`),r=Symbol(`Comlink.finalizer`),i=Symbol(`Comlink.thrown`),a=e=>typeof e==`object`&&!!e||typeof e==`function`,o=new Map([[`proxy`,{canHandle:t=>a(t)&&t[e],serialize(e){let{port1:t,port2:n}=new MessageChannel;return c(e,t),[n,[n]]},deserialize(e){return e.start(),d(e)}}],[`throw`,{canHandle:e=>a(e)&&i in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function s(e,t){for(let n of e)if(t===n||n===`*`||n instanceof RegExp&&n.test(t))return!0;return!1}function c(e,t=globalThis,n=[`*`]){t.addEventListener(`message`,function a(o){if(!o||!o.data)return;if(!s(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}let{id:l,type:d,path:f}=Object.assign({path:[]},o.data),p=(o.data.argumentList||[]).map(T),m;try{let t=f.slice(0,-1).reduce((e,t)=>e[t],e),n=f.reduce((e,t)=>e[t],e);switch(d){case`GET`:m=n;break;case`SET`:t[f.slice(-1)[0]]=T(o.data.value),m=!0;break;case`APPLY`:m=n.apply(t,p);break;case`CONSTRUCT`:m=C(new n(...p));break;case`ENDPOINT`:{let{port1:t,port2:n}=new MessageChannel;c(e,n),m=S(t,[t])}break;case`RELEASE`:m=void 0;break;default:return}}catch(e){m={value:e,[i]:0}}Promise.resolve(m).catch(e=>({value:e,[i]:0})).then(n=>{let[i,o]=w(n);t.postMessage(Object.assign(Object.assign({},i),{id:l}),o),d===`RELEASE`&&(t.removeEventListener(`message`,a),u(t),r in e&&typeof e[r]==`function`&&e[r]())}).catch(e=>{let[n,r]=w({value:TypeError(`Unserializable return value`),[i]:0});t.postMessage(Object.assign(Object.assign({},n),{id:l}),r)})}),t.start&&t.start()}function l(e){return e.constructor.name===`MessagePort`}function u(e){l(e)&&e.close()}function d(e,t){let n=new Map;return e.addEventListener(`message`,function(e){let{data:t}=e;if(!t||!t.id)return;let r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),v(e,n,[],t)}function f(e){if(e)throw Error(`Proxy has been released and is not useable`)}function p(e){return E(e,new Map,{type:`RELEASE`}).then(()=>{u(e)})}let m=new WeakMap,h=`FinalizationRegistry`in globalThis&&new FinalizationRegistry(e=>{let t=(m.get(e)||0)-1;m.set(e,t),t===0&&p(e)});function g(e,t){let n=(m.get(t)||0)+1;m.set(t,n),h&&h.register(e,t,e)}function _(e){h&&h.unregister(e)}function v(e,r,i=[],a=function(){}){let o=!1,s=new Proxy(a,{get(t,a){if(f(o),a===n)return()=>{_(s),p(e),r.clear(),o=!0};if(a===`then`){if(i.length===0)return{then:()=>s};let t=E(e,r,{type:`GET`,path:i.map(e=>e.toString())}).then(T);return t.then.bind(t)}return v(e,r,[...i,a])},set(t,n,a){f(o);let[s,c]=w(a);return E(e,r,{type:`SET`,path:[...i,n].map(e=>e.toString()),value:s},c).then(T)},apply(n,a,s){f(o);let c=i[i.length-1];if(c===t)return E(e,r,{type:`ENDPOINT`}).then(T);if(c===`bind`)return v(e,r,i.slice(0,-1));let[l,u]=b(s);return E(e,r,{type:`APPLY`,path:i.map(e=>e.toString()),argumentList:l},u).then(T)},construct(t,n){f(o);let[a,s]=b(n);return E(e,r,{type:`CONSTRUCT`,path:i.map(e=>e.toString()),argumentList:a},s).then(T)}});return g(s,e),s}function y(e){return Array.prototype.concat.apply([],e)}function b(e){let t=e.map(w);return[t.map(e=>e[0]),y(t.map(e=>e[1]))]}let x=new WeakMap;function S(e,t){return x.set(e,t),e}function C(t){return Object.assign(t,{[e]:!0})}function w(e){for(let[t,n]of o)if(n.canHandle(e)){let[r,i]=n.serialize(e);return[{type:`HANDLER`,name:t,value:r},i]}return[{type:`RAW`,value:e},x.get(e)||[]]}function T(e){switch(e.type){case`HANDLER`:return o.get(e.name).deserialize(e.value);case`RAW`:return e.value}}function E(e,t,n,r){return new Promise(i=>{let a=D();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function D(){return[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)}let O=typeof requestAnimationFrame==`function`?e=>{requestAnimationFrame(()=>e(Date.now()))}:e=>{setTimeout(()=>e(Date.now()),16)};var k=class{onFlush;#e=new Map;#t=new Map;#n=!1;#r;constructor(e=O){this.#r=e}put(e,t){this.#e.set(e,t),this.#i()}putVessel(e,t,n){let r=this.#t.get(e);r||(r=new Map,this.#t.set(e,r)),r.set(t,n),this.#i()}#i(){this.#n||(this.#n=!0,this.#r(e=>this.#a(e)))}#a(e){if(this.#n=!1,this.#e.size===0&&this.#t.size===0)return;let t=this.#e,n=this.#t;this.#e=new Map,this.#t=new Map,this.onFlush?.(t,n,e)}};function A(e,t=500,n=3e4){let r=Math.min(n,t*2**e);return Math.random()*r}function j(e,t){return e.includes(`?`)?`${e}&${t}`:`${e}?${t}`}var M=class{#e;#t;#n;#r=0;#i=!1;#a;constructor(e,t){this.#e=e,this.#t=t}connect(){this.#i=!1,this.#a&&clearTimeout(this.#a),this.#n?.close(),this.#s(`connecting`);let e=new WebSocket(j(this.#e,`subscribe=none`));this.#n=e,e.onopen=()=>{this.#n===e&&(this.#r=0,this.#s(`open`),this.#t.onOpen?.())},e.onmessage=t=>{this.#n===e&&this.#t.onDelta(t.data)},e.onclose=()=>{this.#n!==e||this.#i||this.#o()},e.onerror=()=>{this.#n===e&&e.close()}}send(e){this.#n?.readyState===WebSocket.OPEN&&this.#n.send(JSON.stringify(e))}disconnect(){this.#i=!0,this.#r=0,this.#a&&clearTimeout(this.#a);let e=this.#n!==void 0;this.#n?.close(),this.#n=void 0,e&&this.#s(`closed`)}#o(){this.#s(`reconnecting`);let e=A(this.#r);this.#r+=1,this.#a=setTimeout(()=>{this.#i||this.connect()},e)}#s(e){this.#t.onState({phase:e,attempt:this.#r})}};let N={phase:`connecting`,attempt:0};function P(e,t){let n=e.context??`vessels.self`;for(let r of e.updates??[]){let e=r.values;if(Array.isArray(e))for(let r of e)t({context:n,path:r.path,value:r.value})}}var F=class{#e=new Map;#t;constructor(e){this.#t=e}add(e){let t=[];for(let n of e){let e=this.#i(n),r=`${e.context}|${e.path}`,i=this.#e.get(r);i?i.count+=1:(this.#e.set(r,{count:1,entry:e}),this.#o(e)),t.push(r)}return()=>this.#n(t)}remove(e,t){let n=t??`vessels.self`;for(let t of e)this.#r(`${n}|${t}`)}resubscribeAll(){let e=new Map;for(let{entry:t}of this.#e.values()){let n=e.get(t.context);n?n.push(this.#a(t)):e.set(t.context,[this.#a(t)])}for(let[t,n]of e)this.#t({context:t,subscribe:n})}#n(e){for(let t of e)this.#r(t)}#r(e){let t=this.#e.get(e);t&&(--t.count,!(t.count>0)&&(this.#e.delete(e),this.#t({context:t.entry.context,unsubscribe:[{path:t.entry.path}]})))}#i(e){return{context:e.context??`vessels.self`,path:e.path,period:e.period??1e3,minPeriod:e.minPeriod,policy:e.policy??`ideal`}}#a(e){let t={path:e.path,period:e.period,policy:e.policy};return e.minPeriod!==void 0&&(t.minPeriod=e.minPeriod),t}#o(e){this.#t({context:e.context,subscribe:[this.#a(e)]})}},I=class{#e;#t;#n=new k;#r;#i=N;#a;connect(e,t){this.#r=t,this.#e=new M(e,{onState:e=>{this.#i=e},onDelta:e=>this.#s(e),onOpen:()=>this.#t?.resubscribeAll()}),this.#t=new F(e=>this.#e?.send(e)),this.#n.onFlush=(e,t,n)=>{this.#r?.({self:e,ais:t,connection:this.#i,epoch:n})},this.#e.connect()}subscribe(e){this.#t?.add(e)}unsubscribe(e,t){this.#t?.remove(e,t)}publish(e){this.#e?.send(e)}disconnect(){this.#e?.disconnect()}#o(e){return e===`vessels.self`||e===this.#a}#s(e){let t;try{t=JSON.parse(e)}catch{return}if(!t.updates){typeof t.self==`string`&&(this.#a=t.self);return}P(t,e=>{this.#o(e.context)?this.#n.put(e.path,e.value):this.#n.putVessel(e.context,e.path,e.value)})}};c(new class{#e=new I;async connect(e,t){this.#e.connect(e,t)}async subscribe(e){this.#e.subscribe(e)}async unsubscribe(e,t){this.#e.unsubscribe(e,t)}async publish(e){this.#e.publish(e)}async disconnect(){this.#e.disconnect()}})})();
package/public/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Binnacle</title>
7
- <script type="module" crossorigin src="/signalk-binnacle/assets/index-C1W-i7HT.js"></script>
7
+ <script type="module" crossorigin src="/signalk-binnacle/assets/index-FUyE0wpt.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/signalk-binnacle/assets/index-DYtJwohK.css">
9
9
  <link rel="manifest" href="/signalk-binnacle/manifest.webmanifest"></head>
10
10
  <body>
package/public/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,n={};const s=(s,i)=>(s=new URL(s+".js",i).href,n[s]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=n,document.head.appendChild(e)}else e=s,importScripts(s),n()}).then(()=>{let e=n[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(i,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(n[r])return;let t={};const o=e=>s(e,r),a={module:{uri:r},exports:t,require:o};n[r]=Promise.all(i.map(e=>a[e]||o(e))).then(e=>(l(...e),t))}}define(["./workbox-a85f4708"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"5c04eecdf75fab312f3fa2372137844d"},{url:"binnacle-icon.svg",revision:"6cfeff5603f0f12cf7a49d51ae36e763"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/sk.worker-ClcSsm5C.js",revision:null},{url:"assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2",revision:null},{url:"assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2",revision:null},{url:"assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2",revision:null},{url:"assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2",revision:null},{url:"assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2",revision:null},{url:"assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2",revision:null},{url:"assets/inter-latin-wght-normal-Dx4kXJAl.woff2",revision:null},{url:"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",revision:null},{url:"assets/inter-greek-wght-normal-CkhJZR-_.woff2",revision:null},{url:"assets/inter-greek-ext-wght-normal-DlzME5K_.woff2",revision:null},{url:"assets/inter-cyrillic-wght-normal-DqGufNeO.woff2",revision:null},{url:"assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2",revision:null},{url:"assets/index-DYtJwohK.css",revision:null},{url:"assets/index-C1W-i7HT.js",revision:null},{url:"binnacle-icon.svg",revision:"6cfeff5603f0f12cf7a49d51ae36e763"},{url:"manifest.webmanifest",revision:"08464a0863acdeeb8449227eb27917a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/signalk-binnacle/index.html"))),e.registerRoute(({url:e})=>"https://tiles.openfreemap.org"===e.origin,new e.CacheFirst({cacheName:"binnacle-basemap",plugins:[new e.ExpirationPlugin({maxEntries:4e3,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.pathname.startsWith("/signalk/pmtiles/"),new e.CacheFirst({cacheName:"binnacle-pmtiles",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:200,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200,206]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("open-meteo.com"),new e.NetworkFirst({cacheName:"binnacle-weather",networkTimeoutSeconds:8,plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:21600}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("rainviewer.com")&&e.pathname.endsWith(".json"),new e.NetworkFirst({cacheName:"binnacle-radar-index",networkTimeoutSeconds:6,plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:7200}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("rainviewer.com")&&e.pathname.endsWith(".png"),new e.CacheFirst({cacheName:"binnacle-radar-tiles",plugins:[new e.ExpirationPlugin({maxEntries:600,maxAgeSeconds:7200}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
1
+ if(!self.define){let e,n={};const s=(s,i)=>(s=new URL(s+".js",i).href,n[s]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=n,document.head.appendChild(e)}else e=s,importScripts(s),n()}).then(()=>{let e=n[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(i,r)=>{const l=e||("document"in self?document.currentScript.src:"")||location.href;if(n[l])return;let t={};const o=e=>s(e,l),a={module:{uri:l},exports:t,require:o};n[l]=Promise.all(i.map(e=>a[e]||o(e))).then(e=>(r(...e),t))}}define(["./workbox-a85f4708"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"0734da45d11310fe116c2c9120bcdcbd"},{url:"binnacle-icon.svg",revision:"6cfeff5603f0f12cf7a49d51ae36e763"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/sk.worker-CKgwC70D.js",revision:null},{url:"assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2",revision:null},{url:"assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2",revision:null},{url:"assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2",revision:null},{url:"assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2",revision:null},{url:"assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2",revision:null},{url:"assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2",revision:null},{url:"assets/inter-latin-wght-normal-Dx4kXJAl.woff2",revision:null},{url:"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",revision:null},{url:"assets/inter-greek-wght-normal-CkhJZR-_.woff2",revision:null},{url:"assets/inter-greek-ext-wght-normal-DlzME5K_.woff2",revision:null},{url:"assets/inter-cyrillic-wght-normal-DqGufNeO.woff2",revision:null},{url:"assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2",revision:null},{url:"assets/index-FUyE0wpt.js",revision:null},{url:"assets/index-DYtJwohK.css",revision:null},{url:"binnacle-icon.svg",revision:"6cfeff5603f0f12cf7a49d51ae36e763"},{url:"manifest.webmanifest",revision:"08464a0863acdeeb8449227eb27917a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/signalk-binnacle/index.html"))),e.registerRoute(({url:e})=>"https://tiles.openfreemap.org"===e.origin,new e.CacheFirst({cacheName:"binnacle-basemap",plugins:[new e.ExpirationPlugin({maxEntries:4e3,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.pathname.startsWith("/signalk/pmtiles/"),new e.CacheFirst({cacheName:"binnacle-pmtiles",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:200,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200,206]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("open-meteo.com"),new e.NetworkFirst({cacheName:"binnacle-weather",networkTimeoutSeconds:8,plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:21600}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("rainviewer.com")&&e.pathname.endsWith(".json"),new e.NetworkFirst({cacheName:"binnacle-radar-index",networkTimeoutSeconds:6,plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:7200}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(({url:e})=>e.hostname.endsWith("rainviewer.com")&&e.pathname.endsWith(".png"),new e.CacheFirst({cacheName:"binnacle-radar-tiles",plugins:[new e.ExpirationPlugin({maxEntries:600,maxAgeSeconds:7200}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});