From 3739ae00e3b51e17a059bcc23f48d35ae0089c29 Mon Sep 17 00:00:00 2001 From: vol4tim Date: Mon, 13 May 2024 08:14:30 +0000 Subject: [PATCH] deploy: 8131b13d8e3152b6406a69d06b02ce942fffc86b --- assets/{index.f3c401fe.js => index.b85cf2a6.js} | 2 +- index.html | 2 +- sw.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename assets/{index.f3c401fe.js => index.b85cf2a6.js} (99%) diff --git a/assets/index.f3c401fe.js b/assets/index.b85cf2a6.js similarity index 99% rename from assets/index.f3c401fe.js rename to assets/index.b85cf2a6.js index 6859ba0..67f6960 100644 --- a/assets/index.f3c401fe.js +++ b/assets/index.b85cf2a6.js @@ -94,7 +94,7 @@ You can find the project at: https://github.com/domoritz/leaflet-locatecontrol
${t} m/s
- `,iconSize:new L$2.Point(40,40)})}function iconCreateCircle(e){return new L$2.DivIcon({html:`
`,className:"marker-cluster",iconSize:new L$2.Point(40,40)})}function createMarkerBrand(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconBrand(t.sensor_id,r.rgb),data:t,typeMarker:"brand"})}function createMarkerArrow(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconArrow(t.data.windang,t.data.windspeed,r.basic),data:t,typeMarker:"arrow"})}function createMarkerCircle(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:iconCreateCircle(r),data:t,typeMarker:"circle"})}function createMarkerUser(e,t){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconMsg(t.data.type),data:t,typeMarker:"msg"})}function createMarker(e,t){const r=[e.geo.lat,e.geo.lng];let n;return sensors[e.sensor_id]?n=createMarkerBrand(r,e,t):e.data.windang?n=createMarkerArrow(r,e,t):e.model===4?n=createMarkerUser(r,e):n=createMarkerCircle(r,e,t),n}function updateMarker(e,t,r){if(e.options.typeMarker==="brand"?e.setIcon(createIconBrand(t.sensor_id,r.rgb)):e.options.typeMarker==="arrow"&&Object.prototype.hasOwnProperty.call(t.data,"windang")?e.setIcon(createIconArrow(t.data.windang,t.data.windspeed,r.basic)):e.setIcon(iconCreateCircle(r)),t.model===3){const n=[t.geo.lat,t.geo.lng];e.setLatLng(new L$2.LatLng(n[0],n[1]))}}async function addPoint(e){queue.add(t.bind(queue,e));async function t(r){try{if(r.model===1)console.log(r);else if(r.model===2){await addMarker(r);const n=new BroadcastChannel("sensors");n.postMessage(r),n.close()}else r.model===3?(await addMarker(r),await addPointPath(r)):r.model===4&&await addMarkerUser(r)}catch(n){console.log(n)}this.next()}}async function addMarker(e){const t={basic:"#a1a1a1",border:"#999",rgb:[161,161,161]};e.isEmpty||(t.basic=getColor(scale,e.value),t.border=getColorDarken(scale,e.value),t.rgb=getColorRGB(scale,e.value));const r=await findMarker(e.sensor_id);if(r)updateMarker(r,e,t);else{const n=createMarker(e,t);n.on("click",handlerClickMarker),markersLayer?markersLayer.addLayer(n):console.log("Not found markersLayer")}}async function moveMarkerTime(e,t,r=!1){let n;if(r?(n=await findMarkerMoved(e),n&&moveLayer&&markersLayer&&(moveLayer.removeLayer(n),markersLayer.addLayer(n))):(n=await findMarker(e),n&&moveLayer&&markersLayer?(markersLayer.removeLayer(n),moveLayer.addLayer(n)):n=await findMarkerMoved(e)),n){const o=[t.geo.lat,t.geo.lng];n.setLatLng(new L$2.LatLng(o[0],o[1]))}}const paths={};async function addPointPath(e){const t=e.isEmpty?"#bb4506":getColor(scale,e.value),r=[e.geo.lat,e.geo.lng],n=paths[e.sensor_id]||null;if(n){const o=n.getLatLngs();if(o[o.length-1].lat===Number(r[0])&&o[o.length-1].lng===Number(r[1]))return;o.length===1?n.arrowheads({yawn:30,fill:!0,frequency:"allvertices",size:"15px"}).setStyle({color:t}).addLatLng(r):n.setStyle({color:t}).addLatLng(r)}else{const o=L$2.polyline([r],{color:t,weight:2,opacity:.8,data:e});paths[e.sensor_id]=o}}async function showPath(e){const t=paths[e]||null;t&&pathsLayer&&pathsLayer.addLayer(t)}async function hidePath(e){const t=paths[e]||null;t&&pathsLayer&&pathsLayer.hasLayer(t)&&pathsLayer.removeLayer(t)}async function addMarkerUser(e){const t={basic:"#f99981",border:"#999",rgb:[161,161,161]};if(!await findMarker(e.sensor_id)){const n=createMarker(e,t);n.on("click",handlerClickMarker),messageTypes[e.data.type]&&messagesLayers[messageTypes[e.data.type]]&&messagesLayers[messageTypes[e.data.type]].addLayer(n)}}function clear(){if(markersLayer){markersLayer.clearLayers();const e=new BroadcastChannel("sensorsremoved");e.postMessage(!0),e.close()}pathsLayer&&pathsLayer.clearLayers();for(const e of Object.values(messagesLayers))e&&e.clearLayers()}function switchMessagesLayer(e,t=!1){for(const r of Object.values(messagesLayers))r&&(t?e.addLayer(r):e.removeLayer(r))}function bind$1(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(e=>t=>{const r=toString$7.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:isArray$3}=Array,isUndefined=typeOfTest("undefined");function isBuffer$1(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction$1(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer$1=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer$1(e.buffer),t}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=e=>e!==null&&typeof e=="object",isBoolean$1=e=>e===!0||e===!1,isPlainObject$2=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject$1(e)&&isFunction$1(e.pipe),isFormData=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||toString$7.call(e)===t||isFunction$1(e.toString)&&e.toString()===t)},isURLSearchParams=kindOfTest("URLSearchParams"),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),isArray$3(e))for(n=0,o=e.length;n{isPlainObject$2(e[n])&&isPlainObject$2(r)?e[n]=merge$2(e[n],r):isPlainObject$2(r)?e[n]=merge$2({},r):isArray$3(r)?e[n]=r.slice():e[n]=r};for(let r=0,n=arguments.length;r(forEach(t,(o,a)=>{r&&isFunction$1(o)?e[a]=bind$1(o,r):e[a]=o},{allOwnKeys:n}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject=(e,t,r,n)=>{let o,a,l;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)l=o[a],(!n||n(l,e,t))&&!c[l]&&(t[l]=e[l],c[l]=!0);e=r!==!1&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},toArray$2=e=>{if(!e)return null;if(isArray$3(e))return e;let t=e.length;if(!isNumber$1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},matchAll=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),hasOwnProperty$2=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),isRegExp$1=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};forEach(r,(o,a)=>{t(o,a,e)!==!1&&(n[a]=o)}),Object.defineProperties(e,n)},freezeMethods=e=>{reduceDescriptors(e,(t,r)=>{const n=e[r];if(!!isFunction$1(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},toObjectSet=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return isArray$3(e)?n(e):n(String(e).split(t)),r},noop$5=()=>{},toFiniteNumber=(e,t)=>(e=+e,Number.isFinite(e)?e:t),utils={isArray:isArray$3,isArrayBuffer:isArrayBuffer$1,isBuffer:isBuffer$1,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean:isBoolean$1,isObject:isObject$1,isPlainObject:isPlainObject$2,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp:isRegExp$1,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$2,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray:toArray$2,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$2,hasOwnProp:hasOwnProperty$2,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$5,toFiniteNumber};function AxiosError(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}utils.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(e,t,r,n,o,a)=>{const l=Object.create(prototype$1);return utils.toFlatObject(e,l,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),AxiosError.call(l,e.message,t,r,n,o),l.cause=e,l.name=e.name,a&&Object.assign(l,a),l};var browser$8=typeof self=="object"?self.FormData:window.FormData;function isVisitable(e){return utils.isPlainObject(e)||utils.isArray(e)}function removeBrackets(e){return utils.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){return e?e.concat(t).map(function(o,a){return o=removeBrackets(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function isFlatArray(e){return utils.isArray(e)&&!e.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(t){return/^is[A-Z]/.test(t)});function isSpecCompliant(e){return e&&utils.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function toFormData(e,t,r){if(!utils.isObject(e))throw new TypeError("target must be an object");t=t||new(browser$8||FormData),r=utils.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,O){return!utils.isUndefined(O[T])});const n=r.metaTokens,o=r.visitor||b,a=r.dots,l=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&isSpecCompliant(t);if(!utils.isFunction(o))throw new TypeError("visitor must be a function");function g(k){if(k===null)return"";if(utils.isDate(k))return k.toISOString();if(!u&&utils.isBlob(k))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(k)||utils.isTypedArray(k)?u&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function b(k,T,O){let $=k;if(k&&!O&&typeof k=="object"){if(utils.endsWith(T,"{}"))T=n?T:T.slice(0,-2),k=JSON.stringify(k);else if(utils.isArray(k)&&isFlatArray(k)||utils.isFileList(k)||utils.endsWith(T,"[]")&&($=utils.toArray(k)))return T=removeBrackets(T),$.forEach(function(N,H){!utils.isUndefined(N)&&t.append(l===!0?renderKey([T],H,a):l===null?T:T+"[]",g(N))}),!1}return isVisitable(k)?!0:(t.append(renderKey(O,T,a),g(k)),!1)}const x=[],E=Object.assign(predicates,{defaultVisitor:b,convertValue:g,isVisitable});function I(k,T){if(!utils.isUndefined(k)){if(x.indexOf(k)!==-1)throw Error("Circular reference detected in "+T.join("."));x.push(k),utils.forEach(k,function($,D){(!utils.isUndefined($)&&o.call(t,$,utils.isString(D)?D.trim():D,T,E))===!0&&I($,T?T.concat(D):[D])}),x.pop()}}if(!utils.isObject(e))throw new TypeError("data must be an object");return I(e),t}function encode$f(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,r){this._pairs.push([t,r])};prototype.toString=function(t){const r=t?function(n){return t.call(this,n,encode$f)}:encode$f;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function encode$e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t)return e;const n=e.indexOf("#");n!==-1&&(e=e.slice(0,n));const o=r&&r.encode||encode$e,a=utils.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(o);return a&&(e+=(e.indexOf("?")===-1?"?":"&")+a),e}class InterceptorManager{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils.forEach(this.handlers,function(n){n!==null&&t(n)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=FormData,isStandardBrowserEnv=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$1,Blob},isStandardBrowserEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,a){return platform.isNode&&utils.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n=r.length;return l=!l&&utils.isArray(o)?o.length:l,u?(utils.hasOwnProp(o,l)?o[l]=[o[l],n]:o[l]=n,!c):((!o[l]||!utils.isObject(o[l]))&&(o[l]=[]),t(r,n,o[l],a)&&utils.isArray(o[l])&&(o[l]=arrayToObject(o[l])),!c)}if(utils.isFormData(e)&&utils.isFunction(e.entries)){const r={};return utils.forEachEntry(e,(n,o)=>{t(parsePropPath(n),o,r,0)}),r}return null}function settle(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new AxiosError("Request failed with status code "+r.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(r,n,o,a,l,c){const u=[];u.push(r+"="+encodeURIComponent(n)),utils.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),utils.isString(a)&&u.push("path="+a),utils.isString(l)&&u.push("domain="+l),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){return e&&!isAbsoluteURL(t)?combineURLs(e,t):t}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(a){let l=a;return t&&(r.setAttribute("href",l),l=r.href),r.setAttribute("href",l),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(l){const c=utils.isString(l)?o(l):l;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function CanceledError(e,t,r){AxiosError.call(this,e??"canceled",AxiosError.ERR_CANCELED,t,r),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const ignoreDuplicateOf=utils.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let r,n,o;return e&&e.split(` + `,iconSize:new L$2.Point(40,40)})}function iconCreateCircle(e){return new L$2.DivIcon({html:`
`,className:"marker-cluster",iconSize:new L$2.Point(40,40)})}function createMarkerBrand(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconBrand(t.sensor_id,r.rgb),data:t,typeMarker:"brand"})}function createMarkerArrow(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconArrow(t.data.windang,t.data.windspeed,r.basic),data:t,typeMarker:"arrow"})}function createMarkerCircle(e,t,r){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:iconCreateCircle(r),data:t,typeMarker:"circle"})}function createMarkerUser(e,t){return L$2.marker(new L$2.LatLng(e[0],e[1]),{icon:createIconMsg(t.data.type),data:t,typeMarker:"msg"})}function createMarker(e,t){const r=[e.geo.lat,e.geo.lng];let n;return sensors[e.sensor_id]&&sensors[e.sensor_id].icon?n=createMarkerBrand(r,e,t):e.data.windang?n=createMarkerArrow(r,e,t):e.model===4?n=createMarkerUser(r,e):n=createMarkerCircle(r,e,t),n}function updateMarker(e,t,r){if(e.options.typeMarker==="brand"?e.setIcon(createIconBrand(t.sensor_id,r.rgb)):e.options.typeMarker==="arrow"&&Object.prototype.hasOwnProperty.call(t.data,"windang")?e.setIcon(createIconArrow(t.data.windang,t.data.windspeed,r.basic)):e.setIcon(iconCreateCircle(r)),t.model===3){const n=[t.geo.lat,t.geo.lng];e.setLatLng(new L$2.LatLng(n[0],n[1]))}}async function addPoint(e){queue.add(t.bind(queue,e));async function t(r){try{if(r.model===1)console.log(r);else if(r.model===2){await addMarker(r);const n=new BroadcastChannel("sensors");n.postMessage(r),n.close()}else r.model===3?(await addMarker(r),await addPointPath(r)):r.model===4&&await addMarkerUser(r)}catch(n){console.log(n)}this.next()}}async function addMarker(e){const t={basic:"#a1a1a1",border:"#999",rgb:[161,161,161]};e.isEmpty||(t.basic=getColor(scale,e.value),t.border=getColorDarken(scale,e.value),t.rgb=getColorRGB(scale,e.value));const r=await findMarker(e.sensor_id);if(r)updateMarker(r,e,t);else{const n=createMarker(e,t);n.on("click",handlerClickMarker),markersLayer?markersLayer.addLayer(n):console.log("Not found markersLayer")}}async function moveMarkerTime(e,t,r=!1){let n;if(r?(n=await findMarkerMoved(e),n&&moveLayer&&markersLayer&&(moveLayer.removeLayer(n),markersLayer.addLayer(n))):(n=await findMarker(e),n&&moveLayer&&markersLayer?(markersLayer.removeLayer(n),moveLayer.addLayer(n)):n=await findMarkerMoved(e)),n){const o=[t.geo.lat,t.geo.lng];n.setLatLng(new L$2.LatLng(o[0],o[1]))}}const paths={};async function addPointPath(e){const t=e.isEmpty?"#bb4506":getColor(scale,e.value),r=[e.geo.lat,e.geo.lng],n=paths[e.sensor_id]||null;if(n){const o=n.getLatLngs();if(o[o.length-1].lat===Number(r[0])&&o[o.length-1].lng===Number(r[1]))return;o.length===1?n.arrowheads({yawn:30,fill:!0,frequency:"allvertices",size:"15px"}).setStyle({color:t}).addLatLng(r):n.setStyle({color:t}).addLatLng(r)}else{const o=L$2.polyline([r],{color:t,weight:2,opacity:.8,data:e});paths[e.sensor_id]=o}}async function showPath(e){const t=paths[e]||null;t&&pathsLayer&&pathsLayer.addLayer(t)}async function hidePath(e){const t=paths[e]||null;t&&pathsLayer&&pathsLayer.hasLayer(t)&&pathsLayer.removeLayer(t)}async function addMarkerUser(e){const t={basic:"#f99981",border:"#999",rgb:[161,161,161]};if(!await findMarker(e.sensor_id)){const n=createMarker(e,t);n.on("click",handlerClickMarker),messageTypes[e.data.type]&&messagesLayers[messageTypes[e.data.type]]&&messagesLayers[messageTypes[e.data.type]].addLayer(n)}}function clear(){if(markersLayer){markersLayer.clearLayers();const e=new BroadcastChannel("sensorsremoved");e.postMessage(!0),e.close()}pathsLayer&&pathsLayer.clearLayers();for(const e of Object.values(messagesLayers))e&&e.clearLayers()}function switchMessagesLayer(e,t=!1){for(const r of Object.values(messagesLayers))r&&(t?e.addLayer(r):e.removeLayer(r))}function bind$1(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(e=>t=>{const r=toString$7.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:isArray$3}=Array,isUndefined=typeOfTest("undefined");function isBuffer$1(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction$1(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer$1=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer$1(e.buffer),t}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=e=>e!==null&&typeof e=="object",isBoolean$1=e=>e===!0||e===!1,isPlainObject$2=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject$1(e)&&isFunction$1(e.pipe),isFormData=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||toString$7.call(e)===t||isFunction$1(e.toString)&&e.toString()===t)},isURLSearchParams=kindOfTest("URLSearchParams"),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),isArray$3(e))for(n=0,o=e.length;n{isPlainObject$2(e[n])&&isPlainObject$2(r)?e[n]=merge$2(e[n],r):isPlainObject$2(r)?e[n]=merge$2({},r):isArray$3(r)?e[n]=r.slice():e[n]=r};for(let r=0,n=arguments.length;r(forEach(t,(o,a)=>{r&&isFunction$1(o)?e[a]=bind$1(o,r):e[a]=o},{allOwnKeys:n}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject=(e,t,r,n)=>{let o,a,l;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)l=o[a],(!n||n(l,e,t))&&!c[l]&&(t[l]=e[l],c[l]=!0);e=r!==!1&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},toArray$2=e=>{if(!e)return null;if(isArray$3(e))return e;let t=e.length;if(!isNumber$1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},matchAll=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),hasOwnProperty$2=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),isRegExp$1=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};forEach(r,(o,a)=>{t(o,a,e)!==!1&&(n[a]=o)}),Object.defineProperties(e,n)},freezeMethods=e=>{reduceDescriptors(e,(t,r)=>{const n=e[r];if(!!isFunction$1(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},toObjectSet=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return isArray$3(e)?n(e):n(String(e).split(t)),r},noop$5=()=>{},toFiniteNumber=(e,t)=>(e=+e,Number.isFinite(e)?e:t),utils={isArray:isArray$3,isArrayBuffer:isArrayBuffer$1,isBuffer:isBuffer$1,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean:isBoolean$1,isObject:isObject$1,isPlainObject:isPlainObject$2,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp:isRegExp$1,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$2,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray:toArray$2,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$2,hasOwnProp:hasOwnProperty$2,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$5,toFiniteNumber};function AxiosError(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}utils.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(e,t,r,n,o,a)=>{const l=Object.create(prototype$1);return utils.toFlatObject(e,l,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),AxiosError.call(l,e.message,t,r,n,o),l.cause=e,l.name=e.name,a&&Object.assign(l,a),l};var browser$8=typeof self=="object"?self.FormData:window.FormData;function isVisitable(e){return utils.isPlainObject(e)||utils.isArray(e)}function removeBrackets(e){return utils.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){return e?e.concat(t).map(function(o,a){return o=removeBrackets(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function isFlatArray(e){return utils.isArray(e)&&!e.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(t){return/^is[A-Z]/.test(t)});function isSpecCompliant(e){return e&&utils.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function toFormData(e,t,r){if(!utils.isObject(e))throw new TypeError("target must be an object");t=t||new(browser$8||FormData),r=utils.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,O){return!utils.isUndefined(O[T])});const n=r.metaTokens,o=r.visitor||b,a=r.dots,l=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&isSpecCompliant(t);if(!utils.isFunction(o))throw new TypeError("visitor must be a function");function g(k){if(k===null)return"";if(utils.isDate(k))return k.toISOString();if(!u&&utils.isBlob(k))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(k)||utils.isTypedArray(k)?u&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function b(k,T,O){let $=k;if(k&&!O&&typeof k=="object"){if(utils.endsWith(T,"{}"))T=n?T:T.slice(0,-2),k=JSON.stringify(k);else if(utils.isArray(k)&&isFlatArray(k)||utils.isFileList(k)||utils.endsWith(T,"[]")&&($=utils.toArray(k)))return T=removeBrackets(T),$.forEach(function(N,H){!utils.isUndefined(N)&&t.append(l===!0?renderKey([T],H,a):l===null?T:T+"[]",g(N))}),!1}return isVisitable(k)?!0:(t.append(renderKey(O,T,a),g(k)),!1)}const x=[],E=Object.assign(predicates,{defaultVisitor:b,convertValue:g,isVisitable});function I(k,T){if(!utils.isUndefined(k)){if(x.indexOf(k)!==-1)throw Error("Circular reference detected in "+T.join("."));x.push(k),utils.forEach(k,function($,D){(!utils.isUndefined($)&&o.call(t,$,utils.isString(D)?D.trim():D,T,E))===!0&&I($,T?T.concat(D):[D])}),x.pop()}}if(!utils.isObject(e))throw new TypeError("data must be an object");return I(e),t}function encode$f(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,r){this._pairs.push([t,r])};prototype.toString=function(t){const r=t?function(n){return t.call(this,n,encode$f)}:encode$f;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function encode$e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t)return e;const n=e.indexOf("#");n!==-1&&(e=e.slice(0,n));const o=r&&r.encode||encode$e,a=utils.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(o);return a&&(e+=(e.indexOf("?")===-1?"?":"&")+a),e}class InterceptorManager{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils.forEach(this.handlers,function(n){n!==null&&t(n)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=FormData,isStandardBrowserEnv=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$1,Blob},isStandardBrowserEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,a){return platform.isNode&&utils.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n=r.length;return l=!l&&utils.isArray(o)?o.length:l,u?(utils.hasOwnProp(o,l)?o[l]=[o[l],n]:o[l]=n,!c):((!o[l]||!utils.isObject(o[l]))&&(o[l]=[]),t(r,n,o[l],a)&&utils.isArray(o[l])&&(o[l]=arrayToObject(o[l])),!c)}if(utils.isFormData(e)&&utils.isFunction(e.entries)){const r={};return utils.forEachEntry(e,(n,o)=>{t(parsePropPath(n),o,r,0)}),r}return null}function settle(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new AxiosError("Request failed with status code "+r.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(r,n,o,a,l,c){const u=[];u.push(r+"="+encodeURIComponent(n)),utils.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),utils.isString(a)&&u.push("path="+a),utils.isString(l)&&u.push("domain="+l),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){return e&&!isAbsoluteURL(t)?combineURLs(e,t):t}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(a){let l=a;return t&&(r.setAttribute("href",l),l=r.href),r.setAttribute("href",l),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(l){const c=utils.isString(l)?o(l):l;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function CanceledError(e,t,r){AxiosError.call(this,e??"canceled",AxiosError.ERR_CANCELED,t,r),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const ignoreDuplicateOf=utils.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let r,n,o;return e&&e.split(` `).forEach(function(l){o=l.indexOf(":"),r=l.substring(0,o).trim().toLowerCase(),n=l.substring(o+1).trim(),!(!r||t[r]&&ignoreDuplicateOf[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},$internals=Symbol("internals"),$defaults=Symbol("defaults");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:String(e)}function parseTokens(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}function matchHeaderValue(e,t,r,n){if(utils.isFunction(n))return n.call(this,t,r);if(!!utils.isString(t)){if(utils.isString(n))return t.indexOf(n)!==-1;if(utils.isRegExp(n))return n.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function buildAccessors(e,t){const r=utils.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,a,l){return this[n].call(this,t,o,a,l)},configurable:!0})})}function findKey(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}function AxiosHeaders(e,t){e&&this.set(e),this[$defaults]=t||null}Object.assign(AxiosHeaders.prototype,{set:function(e,t,r){const n=this;function o(a,l,c){const u=normalizeHeader(l);if(!u)throw new Error("header name must be a non-empty string");const g=findKey(n,u);g&&c!==!0&&(n[g]===!1||c===!1)||(utils.isArray(a)?a=a.map(normalizeValue):a=normalizeValue(a),n[g||l]=a)}return utils.isPlainObject(e)?utils.forEach(e,(a,l)=>{o(a,l,t)}):o(t,e,r),this},get:function(e,t){if(e=normalizeHeader(e),!e)return;const r=findKey(this,e);if(r){const n=this[r];if(!t)return n;if(t===!0)return parseTokens(n);if(utils.isFunction(t))return t.call(this,n,r);if(utils.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,t){if(e=normalizeHeader(e),e){const r=findKey(this,e);return!!(r&&(!t||matchHeaderValue(this,this[r],r,t)))}return!1},delete:function(e,t){const r=this;let n=!1;function o(a){if(a=normalizeHeader(a),a){const l=findKey(r,a);l&&(!t||matchHeaderValue(r,r[l],l,t))&&(delete r[l],n=!0)}}return utils.isArray(e)?e.forEach(o):o(e),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const t=this,r={};return utils.forEach(this,(n,o)=>{const a=findKey(r,o);if(a){t[a]=normalizeValue(n),delete t[o];return}const l=e?formatHeader(o):String(o).trim();l!==o&&delete t[o],t[l]=normalizeValue(n),r[l]=!0}),this},toJSON:function(){const e=Object.create(null);return utils.forEach(Object.assign({},this[$defaults]||null,this),(t,r)=>{t==null||t===!1||(e[r]=utils.isArray(t)?t.join(", "):t)}),e}});Object.assign(AxiosHeaders,{from:function(e){return utils.isString(e)?new this(parseHeaders(e)):e instanceof this?e:new this(e)},accessor:function(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function o(a){const l=normalizeHeader(a);r[l]||(buildAccessors(n,a),r[l]=!0)}return utils.isArray(e)?e.forEach(o):o(e),this}});AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);utils.freezeMethods(AxiosHeaders.prototype);utils.freezeMethods(AxiosHeaders);function speedometer(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,a=0,l;return t=t!==void 0?t:1e3,function(u){const g=Date.now(),b=n[a];l||(l=g),r[o]=u,n[o]=g;let x=a,E=0;for(;x!==o;)E+=r[x++],x=x%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),g-l{const a=o.loaded,l=o.lengthComputable?o.total:void 0,c=a-r,u=n(c),g=a<=l;r=a;const b={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&g?(l-a)/u:void 0};b[t?"download":"upload"]=!0,e(b)}}function xhrAdapter(e){return new Promise(function(r,n){let o=e.data;const a=AxiosHeaders.from(e.headers).normalize(),l=e.responseType;let c;function u(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}utils.isFormData(o)&&platform.isStandardBrowserEnv&&a.setContentType(!1);let g=new XMLHttpRequest;if(e.auth){const I=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(I+":"+k))}const b=buildFullPath(e.baseURL,e.url);g.open(e.method.toUpperCase(),buildURL(b,e.params,e.paramsSerializer),!0),g.timeout=e.timeout;function x(){if(!g)return;const I=AxiosHeaders.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:I,config:e,request:g};settle(function($){r($),u()},function($){n($),u()},T),g=null}if("onloadend"in g?g.onloadend=x:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(x)},g.onabort=function(){!g||(n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const T=e.transitional||transitionalDefaults;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),n(new AxiosError(k,T.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,g)),g=null},platform.isStandardBrowserEnv){const I=(e.withCredentials||isURLSameOrigin(b))&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);I&&a.set(e.xsrfHeaderName,I)}o===void 0&&a.setContentType(null),"setRequestHeader"in g&&utils.forEach(a.toJSON(),function(k,T){g.setRequestHeader(T,k)}),utils.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),l&&l!=="json"&&(g.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&g.addEventListener("progress",progressEventReducer(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=I=>{!g||(n(!I||I.type?new CanceledError(null,e,g):I),g.abort(),g=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const E=parseProtocol(b);if(E&&platform.protocols.indexOf(E)===-1){n(new AxiosError("Unsupported protocol "+E+":",AxiosError.ERR_BAD_REQUEST,e));return}g.send(o||null)})}const adapters={http:xhrAdapter,xhr:xhrAdapter},adapters$1={getAdapter:e=>{if(utils.isString(e)){const t=adapters[e];if(!e)throw Error(utils.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return t}if(!utils.isFunction(e))throw new TypeError("adapter is not a function");return e},adapters},DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function getDefaultAdapter(){let e;return typeof XMLHttpRequest<"u"?e=adapters$1.getAdapter("xhr"):typeof process<"u"&&utils.kindOf(process)==="process"&&(e=adapters$1.getAdapter("http")),e}function stringifySafely(e,t,r){if(utils.isString(e))try{return(t||JSON.parse)(e),utils.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const defaults$1={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=utils.isObject(t);if(a&&utils.isHTMLForm(t)&&(t=new FormData(t)),utils.isFormData(t))return o&&o?JSON.stringify(formDataToJSON(t)):t;if(utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t))return t;if(utils.isArrayBufferView(t))return t.buffer;if(utils.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((c=utils.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return toFormData(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return a||o?(r.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function(t){const r=this.transitional||defaults$1.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(t&&utils.isString(t)&&(n&&!this.responseType||o)){const l=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(c){if(l)throw c.name==="SyntaxError"?AxiosError.from(c,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],function(t){defaults$1.headers[t]={}});utils.forEach(["post","put","patch"],function(t){defaults$1.headers[t]=utils.merge(DEFAULT_CONTENT_TYPE)});function transformData(e,t){const r=this||defaults$1,n=t||r,o=AxiosHeaders.from(n.headers);let a=n.data;return utils.forEach(e,function(c){a=c.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function isCancel(e){return!!(e&&e.__CANCEL__)}function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders.from(e.headers),e.data=transformData.call(e,e.transformRequest),(e.adapter||defaults$1.adapter)(e).then(function(n){return throwIfCancellationRequested(e),n.data=transformData.call(e,e.transformResponse,n),n.headers=AxiosHeaders.from(n.headers),n},function(n){return isCancel(n)||(throwIfCancellationRequested(e),n&&n.response&&(n.response.data=transformData.call(e,e.transformResponse,n.response),n.response.headers=AxiosHeaders.from(n.response.headers))),Promise.reject(n)})}function mergeConfig(e,t){t=t||{};const r={};function n(g,b){return utils.isPlainObject(g)&&utils.isPlainObject(b)?utils.merge(g,b):utils.isPlainObject(b)?utils.merge({},b):utils.isArray(b)?b.slice():b}function o(g){if(utils.isUndefined(t[g])){if(!utils.isUndefined(e[g]))return n(void 0,e[g])}else return n(e[g],t[g])}function a(g){if(!utils.isUndefined(t[g]))return n(void 0,t[g])}function l(g){if(utils.isUndefined(t[g])){if(!utils.isUndefined(e[g]))return n(void 0,e[g])}else return n(void 0,t[g])}function c(g){if(g in t)return n(e[g],t[g]);if(g in e)return n(void 0,e[g])}const u={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c};return utils.forEach(Object.keys(e).concat(Object.keys(t)),function(b){const x=u[b]||o,E=x(b);utils.isUndefined(E)&&x!==c||(r[b]=E)}),r}const VERSION$2="1.1.2",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(t,r,n){function o(a,l){return"[Axios v"+VERSION$2+"] Transitional option '"+a+"'"+l+(n?". "+n:"")}return(a,l,c)=>{if(t===!1)throw new AxiosError(o(l," has been removed"+(r?" in "+r:"")),AxiosError.ERR_DEPRECATED);return r&&!deprecatedWarnings[l]&&(deprecatedWarnings[l]=!0,console.warn(o(l," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,l,c):!0}};function assertOptions(e,t,r){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],l=t[a];if(l){const c=e[a],u=c===void 0||l(c,a,e);if(u!==!0)throw new AxiosError("option "+a+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new AxiosError("Unknown option "+a,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(t){this.defaults=t,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=mergeConfig(this.defaults,r);const n=r.transitional;n!==void 0&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r.method=(r.method||this.defaults.method||"get").toLowerCase();const o=r.headers&&utils.merge(r.headers.common,r.headers[r.method]);o&&utils.forEach(["delete","get","head","post","put","patch","common"],function(I){delete r.headers[I]}),r.headers=new AxiosHeaders(r.headers,o);const a=[];let l=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(r)===!1||(l=l&&I.synchronous,a.unshift(I.fulfilled,I.rejected))});const c=[];this.interceptors.response.forEach(function(I){c.push(I.fulfilled,I.rejected)});let u,g=0,b;if(!l){const E=[dispatchRequest.bind(this),void 0];for(E.unshift.apply(E,a),E.push.apply(E,c),b=E.length,u=Promise.resolve(r);g{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const l=new Promise(c=>{n.subscribe(c),a=c}).then(o);return l.cancel=function(){n.unsubscribe(a)},l},t(function(a,l,c){n.reason||(n.reason=new CanceledError(a,l,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new CancelToken(function(o){t=o}),cancel:t}}}function spread(e){return function(r){return e.apply(null,r)}}function isAxiosError(e){return utils.isObject(e)&&e.isAxiosError===!0}function createInstance(e){const t=new Axios(e),r=bind$1(Axios.prototype.request,t);return utils.extend(r,Axios.prototype,t,{allOwnKeys:!0}),utils.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return createInstance(mergeConfig(e,o))},r}const axios=createInstance(defaults$1);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION$2;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(t){return Promise.all(t)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.formToJSON=e=>formDataToJSON(utils.isHTMLForm(e)?new FormData(e):e);function getCityByPos(e,t,r="en"){return axios.get(`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${e}&lon=${t}&accept-language=${r}`).then(n=>{if(n.data.address){if(n.data.address.city)return n.data.address.city;if(n.data.address.town)return n.data.address.town;if(n.data.address.state)return n.data.address.state}return""}).catch(()=>"")}function getAddressByPos(e,t,r="en"){return axios.get(`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${e}&lon=${t}&accept-language=${r}`).then(n=>{if(n.data.address){const o={country:n.data.address.country||"",address:[]};return n.data.address.city?o.address.push(n.data.address.city):n.data.address.town&&o.address.push(n.data.address.town),n.data.address.road&&o.address.push(n.data.address.road),n.data.address.house_number&&o.address.push(n.data.address.house_number),o}return!1}).catch(()=>!1)}L.DomUtil.setTransform||(L.DomUtil.setTransform=function(e,t,r){var n=t||new L.Point(0,0);e.style[L.DomUtil.TRANSFORM]=(L.Browser.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(r?" scale("+r+")":"")});L.CanvasLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t){this._map=null,this._canvas=null,this._frame=null,this._delegate=null,L.setOptions(this,t)},delegate:function(t){return this._delegate=t,this},needRedraw:function(){return this._frame||(this._frame=L.Util.requestAnimFrame(this.drawLayer,this)),this},_onLayerDidResize:function(t){this._canvas.width=t.newSize.x,this._canvas.height=t.newSize.y},_onLayerDidMove:function(){var t=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,t),this.drawLayer()},getEvents:function(){var t={resize:this._onLayerDidResize,moveend:this._onLayerDidMove};return this._map.options.zoomAnimation&&L.Browser.any3d&&(t.zoomanim=this._animateZoom),t},onAdd:function(t){this._map=t,this._canvas=L.DomUtil.create("canvas","leaflet-layer"),this.tiles={};var r=this._map.getSize();this._canvas.width=r.x,this._canvas.height=r.y;var n=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(this._canvas,"leaflet-zoom-"+(n?"animated":"hide")),this.options.pane.appendChild(this._canvas),t.on(this.getEvents(),this);var o=this._delegate||this;o.onLayerDidMount&&o.onLayerDidMount(),this.needRedraw();var a=this;setTimeout(function(){a._onLayerDidMove()},0)},onRemove:function(t){var r=this._delegate||this;r.onLayerWillUnmount&&r.onLayerWillUnmount(),this.options.pane.removeChild(this._canvas),t.off(this.getEvents(),this),this._canvas=null},addTo:function(t){return t.addLayer(this),this},drawLayer:function(){var t=this._map.getSize(),r=this._map.getBounds(),n=this._map.getZoom(),o=this._map.options.crs.project(this._map.getCenter()),a=this._map.options.crs.project(this._map.containerPointToLatLng(this._map.getSize())),l=this._delegate||this;l.onDrawLayer&&l.onDrawLayer({layer:this,canvas:this._canvas,bounds:r,size:t,zoom:n,center:o,corner:a}),this._frame=null},_setTransform:function(t,r,n){var o=r||new L.Point(0,0);t.style[L.DomUtil.TRANSFORM]=(L.Browser.ie3d?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(n?" scale("+n+")":"")},_animateZoom:function(t){var r=this._map.getZoomScale(t.zoom),n=L.Layer?this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(),t.zoom,t.center):this._map._getCenterOffset(t.center)._multiplyBy(-r).subtract(this._map._getMapPanePos());L.DomUtil.setTransform(this._canvas,n,r)}});L.canvasLayer=function(e){return new L.CanvasLayer(e)};L.Control.Velocity=L.Control.extend({options:{position:"bottomleft",emptyString:"Unavailable",angleConvention:"bearingCCW",showCardinal:!1,speedUnit:"m/s",directionString:"Direction",speedString:"Speed",onAdd:null,onRemove:null},onAdd:function(t){return this._container=L.DomUtil.create("div","leaflet-control-velocity"),L.DomEvent.disableClickPropagation(this._container),t.on("mousemove",this._onMouseMove,this),this._container.innerHTML=this.options.emptyString,this.options.leafletVelocity.options.onAdd&&this.options.leafletVelocity.options.onAdd(),this._container},onRemove:function(t){t.off("mousemove",this._onMouseMove,this),this.options.leafletVelocity.options.onRemove&&this.options.leafletVelocity.options.onRemove()},vectorToSpeed:function(t,r,n){var o=Math.sqrt(Math.pow(t,2)+Math.pow(r,2));return n==="k/h"?this.meterSec2kilometerHour(o):n==="kt"?this.meterSec2Knots(o):n==="mph"?this.meterSec2milesHour(o):o},vectorToDegrees:function(t,r,n){n.endsWith("CCW")&&(r=r>0?r=-r:Math.abs(r));var o=Math.sqrt(Math.pow(t,2)+Math.pow(r,2)),a=Math.atan2(t/o,r/o),l=a*180/Math.PI+180;return(n==="bearingCW"||n==="meteoCCW")&&(l+=180,l>=360&&(l-=360)),l},degreesToCardinalDirection:function(t){var r="";return t>=0&&t<11.25||t>=348.75?r="N":t>=11.25&&t<33.75?r="NNW":t>=33.75&&t<56.25?r="NW":t>=56.25&&t<78.75?r="WNW":t>=78.25&&t<101.25?r="W":t>=101.25&&t<123.75?r="WSW":t>=123.75&&t<146.25?r="SW":t>=146.25&&t<168.75?r="SSW":t>=168.75&&t<191.25?r="S":t>=191.25&&t<213.75?r="SSE":t>=213.75&&t<236.25?r="SE":t>=236.25&&t<258.75?r="ESE":t>=258.75&&t<281.25?r="E":t>=281.25&&t<303.75?r="ENE":t>=303.75&&t<326.25?r="NE":t>=326.25&&t<348.75&&(r="NNE"),r},meterSec2Knots:function(t){return t/.514},meterSec2kilometerHour:function(t){return t*3.6},meterSec2milesHour:function(t){return t*2.23694},_onMouseMove:function(t){var r=this,n=this.options.leafletVelocity._map.containerPointToLatLng(L.point(t.containerPoint.x,t.containerPoint.y)),o=this.options.leafletVelocity._windy.interpolatePoint(n.lng,n.lat),a="";if(o&&!isNaN(o[0])&&!isNaN(o[1])&&o[2]){var l=r.vectorToDegrees(o[0],o[1],this.options.angleConvention),c=this.options.showCardinal?" (".concat(r.degreesToCardinalDirection(l),") "):"";a=" ".concat(this.options.velocityType," ").concat(this.options.directionString,": ").concat(l.toFixed(2),"\xB0").concat(c,", ").concat(this.options.velocityType," ").concat(this.options.speedString,": ").concat(r.vectorToSpeed(o[0],o[1],this.options.speedUnit).toFixed(2)," ").concat(this.options.speedUnit)}else a=this.options.emptyString;r._container.innerHTML=a}});L.Map.mergeOptions({positionControl:!1});L.Map.addInitHook(function(){this.options.positionControl&&(this.positionControl=new L.Control.MousePosition,this.addControl(this.positionControl))});L.control.velocity=function(e){return new L.Control.Velocity(e)};L.VelocityLayer=(L.Layer?L.Layer:L.Class).extend({options:{displayValues:!0,displayOptions:{velocityType:"Velocity",position:"bottomleft",emptyString:"No velocity data"},maxVelocity:10,colorScale:null,data:null},_map:null,_canvasLayer:null,_windy:null,_context:null,_timer:0,_mouseControl:null,initialize:function(t){L.setOptions(this,t)},onAdd:function(t){this._paneName=this.options.paneName||"overlayPane";var r=t._panes.overlayPane;t.getPane&&(r=t.getPane(this._paneName),r||(r=t.createPane(this._paneName))),this._canvasLayer=L.canvasLayer({pane:r}).delegate(this),this._canvasLayer.addTo(t),this._map=t},onRemove:function(t){this._destroyWind()},setData:function(t){this.options.data=t,this._windy&&(this._windy.setData(t),this._clearAndRestart()),this.fire("load")},setOpacity:function(t){this._canvasLayer.setOpacity(t)},setOptions:function(t){this.options=Object.assign(this.options,t),t.hasOwnProperty("displayOptions")&&(this.options.displayOptions=Object.assign(this.options.displayOptions,t.displayOptions),this._initMouseHandler(!0)),t.hasOwnProperty("data")&&(this.options.data=t.data),this._windy&&(this._windy.setOptions(t),t.hasOwnProperty("data")&&this._windy.setData(t.data),this._clearAndRestart()),this.fire("load")},onDrawLayer:function(t,r){var n=this;if(!this._windy){this._initWindy(this);return}!this.options.data||(this._timer&&clearTimeout(n._timer),this._timer=setTimeout(function(){n._startWindy()},750))},_startWindy:function(){var t=this._map.getBounds(),r=this._map.getSize();this._windy.start([[0,0],[r.x,r.y]],r.x,r.y,[[t._southWest.lng,t._southWest.lat],[t._northEast.lng,t._northEast.lat]])},_initWindy:function(t){var r=Object.assign({canvas:t._canvasLayer._canvas,map:this._map},t.options);this._windy=new Windy(r),this._context=this._canvasLayer._canvas.getContext("2d"),this._canvasLayer._canvas.classList.add("velocity-overlay"),this.onDrawLayer(),this._map.on("dragstart",t._windy.stop),this._map.on("dragend",t._clearAndRestart),this._map.on("zoomstart",t._windy.stop),this._map.on("zoomend",t._clearAndRestart),this._map.on("resize",t._clearWind),this._initMouseHandler(!1)},_initMouseHandler:function(t){if(t&&(this._map.removeControl(this._mouseControl),this._mouseControl=!1),!this._mouseControl&&this.options.displayValues){var r=this.options.displayOptions||{};r.leafletVelocity=this,this._mouseControl=L.control.velocity(r).addTo(this._map)}},_clearAndRestart:function(){this._context&&this._context.clearRect(0,0,3e3,3e3),this._windy&&this._startWindy()},_clearWind:function(){this._windy&&this._windy.stop(),this._context&&this._context.clearRect(0,0,3e3,3e3)},_destroyWind:function(){this._timer&&clearTimeout(this._timer),this._windy&&this._windy.stop(),this._context&&this._context.clearRect(0,0,3e3,3e3),this._mouseControl&&this._map.removeControl(this._mouseControl),this._mouseControl=null,this._windy=null,this._map.removeLayer(this._canvasLayer)}});L.velocityLayer=function(e){return new L.VelocityLayer(e)};var Windy=function(t){var r=t.minVelocity||0,n=t.maxVelocity||10,o=(t.velocityScale||.005)*(Math.pow(window.devicePixelRatio,1/3)||1),a=t.particleAge||90,l=t.lineWidth||1,c=t.particleMultiplier||1/300,u=Math.pow(window.devicePixelRatio,1/3)||1.6,g=t.frameRate||15,b=1e3/g,x=.97,E=["rgb(36,104, 180)","rgb(60,157, 194)","rgb(128,205,193 )","rgb(151,218,168 )","rgb(198,231,181)","rgb(238,247,217)","rgb(255,238,159)","rgb(252,217,125)","rgb(255,182,100)","rgb(252,150,75)","rgb(250,112,52)","rgb(245,64,32)","rgb(237,45,28)","rgb(220,24,32)","rgb(180,0,35)"],I=t.colorScale||E,k=[NaN,NaN,null],T,O,$=t.data,D,N,H,ie,ue,de,le,ce=function(oe){$=oe},ve=function(oe){oe.hasOwnProperty("minVelocity")&&(r=oe.minVelocity),oe.hasOwnProperty("maxVelocity")&&(n=oe.maxVelocity),oe.hasOwnProperty("velocityScale")&&(o=(oe.velocityScale||.005)*(Math.pow(window.devicePixelRatio,1/3)||1)),oe.hasOwnProperty("particleAge")&&(a=oe.particleAge),oe.hasOwnProperty("lineWidth")&&(l=oe.lineWidth),oe.hasOwnProperty("particleMultiplier")&&(c=oe.particleMultiplier),oe.hasOwnProperty("opacity")&&(x=+oe.opacity),oe.hasOwnProperty("frameRate")&&(g=oe.frameRate),b=1e3/g},ee=function(oe,pe,ke,Ne,ze,Xe){var Je=1-oe,rt=1-pe,qe=Je*rt,Ve=oe*rt,Ae=Je*pe,He=oe*pe,Ge=ke[0]*qe+Ne[0]*Ve+ze[0]*Ae+Xe[0]*He,Ze=ke[1]*qe+Ne[1]*Ve+ze[1]*Ae+Xe[1]*He;return[Ge,Ze,Math.sqrt(Ge*Ge+Ze*Ze)]},he=function(oe,pe){var ke=oe.data,Ne=pe.data;return{header:oe.header,data:function(Xe){return[ke[Xe],Ne[Xe]]},interpolate:ee}},ne=function(oe){var pe=null,ke=null;return oe.forEach(function(Ne){switch(Ne.header.parameterCategory+","+Ne.header.parameterNumber){case"1,2":case"2,2":pe=Ne;break;case"1,3":case"2,3":ke=Ne;break}}),he(pe,ke)},xe=function(oe,pe){var ke=!0;oe.length<2&&(ke=!1),ke||console.log("Windy Error: data must have at least two components (u,v)"),T=ne(oe);var Ne=T.header;if(Ne.hasOwnProperty("gridDefinitionTemplate")&&Ne.gridDefinitionTemplate!=0&&(ke=!1),ke||console.log("Windy Error: Only data with Latitude_Longitude coordinates is supported"),ke=!0,N=Ne.lo1,H=Ne.la1,ie=Ne.dx,ue=Ne.dy,de=Ne.nx,le=Ne.ny,Ne.hasOwnProperty("scanMode")){var ze=Ne.scanMode.toString(2);ze=("0"+ze).slice(-8);var Xe=ze.split("").map(Number).map(Boolean);Xe[0]&&(ie=-ie),Xe[1]&&(ue=-ue),Xe[2]&&(ke=!1),Xe[3]&&(ke=!1),Xe[4]&&(ke=!1),Xe[5]&&(ke=!1),Xe[6]&&(ke=!1),Xe[7]&&(ke=!1),ke||console.log("Windy Error: Data with scanMode: "+Ne.scanMode+" is not supported.")}D=new Date(Ne.refTime),D.setHours(D.getHours()+Ne.forecastTime),O=[];for(var Je=0,rt=Math.floor(de*ie)>=360,qe=0;qe1e3){setTimeout(Ae,25);return}Ue(rt,pe,Ne)})()},Fe,Oe=function(oe,pe){function ke(Ze,$e){return I.indexFor=function(me){return Math.max(0,Math.min(I.length-1,Math.round((me-Ze)/($e-Ze)*(I.length-1))))},I}var Ne=ke(r,n),ze=Ne.map(function(){return[]}),Xe=Math.round(oe.width*oe.height*c);se()&&(Xe*=u);for(var Je="rgba(0, 0, 0, ".concat(x,")"),rt=[],qe=0;qea&&(pe.randomize(Ze).age=0);var $e=Ze.x,me=Ze.y,Ee=pe($e,me),je=Ee[2];if(je===null)Ze.age=a;else{var nt=$e+Ee[0],ot=me+Ee[1];pe(nt,ot)[2]!==null?(Ze.xt=nt,Ze.yt=ot,ze[Ne.indexFor(je)].push(Ze)):(Ze.x=nt,Ze.y=ot)}Ze.age+=1})}var Ae=t.canvas.getContext("2d");Ae.lineWidth=l,Ae.fillStyle=Je,Ae.globalAlpha=.6;function He(){var Ze="lighter";Ae.globalCompositeOperation="destination-in",Ae.fillRect(oe.x,oe.y,oe.width,oe.height),Ae.globalCompositeOperation=Ze,Ae.globalAlpha=x===0?0:x*.9,ze.forEach(function($e,me){$e.length>0&&(Ae.beginPath(),Ae.strokeStyle=Ne[me],$e.forEach(function(Ee){Ae.moveTo(Ee.x,Ee.y),Ae.lineTo(Ee.xt,Ee.yt),Ee.x=Ee.xt,Ee.y=Ee.yt}),Ae.stroke())})}var Ge=Date.now();(function Ze(){Fe=requestAnimationFrame(Ze);var $e=Date.now(),me=$e-Ge;me>b&&(Ge=$e-me%b,Ve(),He())})()},be=function(oe,pe,ke,Ne){var ze={south:fe(Ne[0][1]),north:fe(Ne[1][1]),east:fe(Ne[1][0]),west:fe(Ne[0][0]),width:pe,height:ke};Re(),xe($,function(Xe){Le(Xe,Be(oe,pe,ke),ze,function(Je,rt){Ie.field=rt,Oe(Je,rt)})})},Re=function(){Ie.field&&Ie.field.release(),Fe&&cancelAnimationFrame(Fe)},Ie={params:t,start:be,stop:Re,createField:Ue,interpolatePoint:te,setData:ce,setOptions:ve};return Ie};window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)});const leafletVelocity="";let windLayer;function init$1(){return axios.get(config$2.WIND_PROVIDER).then(e=>{windLayer=L$2.velocityLayer({displayValues:!1,data:e.data,maxVelocity:15,velocityScale:.01,colorScale:["rgb(60,157,194)","rgb(128,205,193)","rgb(250,112,52)","rgb(245,64,32)"]})})}function switchLayer(e,t=!1){windLayer&&(t?e.addLayer(windLayer):e.removeLayer(windLayer))}const agents=["QmcQJV9CQ7UCHAtGw55urFS39knSVR2nocNVNv1N1BuWwG","QmYAesHYTymfXyXitPBaHLBrC3dfVrRESFd28gfnbyjo7e","QmQHzQqXe5npsyRfRFrSbjDHTKKRz1cULajerNZrJLAMsK","QmXzPWCya9xakMQY2YLdhscHHhQ7ojNhGJzuunC57FZnta","QmRohqPDqYVwttjxJrhQVtZJH9o5QFBja3NT62aAbNDVkX","QmRjxZ7ccJ5N2HgLmz5we9pezBvP7gDvx2BjDJSw6p1TCE","QmamWhrh3qqaRzbjcZ1Si9k8V2ytoJhhPDzVGyzEAtdUCc","QmZuyyMJRo5Cs4GkARbvkxrBbiP2oRUNpWc7dBmTACZg4T","12D3KooWP2yCMkb67Xj8EkDEDfzvEgMhR7kdun8MvDcvsqoUPmuD","12D3KooWRazGg1wMjjEFaaZGXseHpt3MXrU5oZS2idQZ6M4GPL4U","12D3KooWB7wQJuFyUQL1RjdkEwDQ82msxB4xsLCHHGdJLGxaqrmR","12D3KooWGQAxCSvgAbcVHXxuzaBgzie9HSUStjvnQRQBY2CTjnLU","12D3KooWKDUV8Je6EQLhKDsiQCgzQEDKBo8ukPcxYKmts47nST4D"];function getAgents(){return agents}function saveMapPosiotion(e,t,r){localStorage.setItem("map-position",JSON.stringify({zoom:e,lat:t,lng:r}))}function getMapPosiotion(){let e;try{e=JSON.parse(localStorage.getItem("map-position"))}catch(t){console.log(t)}return e||{zoom:config$2.MAP.zoom,lat:config$2.MAP.position.lat,lng:config$2.MAP.position.lng}}const Map_vue_vue_type_style_index_0_lang="",Map_vue_vue_type_style_index_1_scoped_7b9ea3ab_lang="",_export_sfc=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},_sfc_main$f={emits:["city","clickMarker","close"],props:["zoom","lat","lng","type","availableWind"],data(){return{locale:localStorage.getItem("locale")||this.$i18n.locale||"en",theme:window?.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark",store:useStore()}},methods:{listener({matches:e,media:t}){!e||(t==="(prefers-color-scheme: dark)"?this.theme="dark":t==="(prefers-color-scheme: light)"&&(this.theme="light"),setTheme(this.theme))}},computed:{route(){return this.$router}},unmounted(){removeMap()},async mounted(){window.matchMedia&&(window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.listener),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",this.listener)),this.zoom>9&&getCityByPos(this.lat,this.lng,this.locale).then(t=>{this.$emit("city",t)});const e=init$3([this.lat,this.lng],this.zoom,this.theme);e.on("zoomend",t=>{const r=t.target.getCenter();saveMapPosiotion(t.target.getZoom(),r.lat.toFixed(4),r.lng.toFixed(4)),this.$router.currentRoute.value.name==="main"&&this.$router.replace({name:"main",params:{provider:this.$route.params.provider||config$2.DEFAUL_TYPE_PROVIDER,type:this.$route.params.type||"pm10",zoom:t.target.getZoom(),lat:r.lat.toFixed(4),lng:r.lng.toFixed(4),sensor:this.$route.params.sensor}})}),e.on("moveend",t=>{const r=t.target.getCenter();t.target.getZoom()>9?getCityByPos(r.lat,r.lng,this.locale).then(o=>{this.$emit("city",o)}):this.$emit("city",""),saveMapPosiotion(t.target.getZoom(),r.lat.toFixed(4),r.lng.toFixed(4)),this.$router.currentRoute.value.name==="main"&&this.$router.replace({name:"main",params:{provider:this.$route.params.provider||config$2.DEFAUL_TYPE_PROVIDER,type:this.$route.params.type||"pm10",zoom:t.target.getZoom(),lat:r.lat.toFixed(4),lng:r.lng.toFixed(4),sensor:this.$route.params.sensor}}).catch(()=>{})}),init$2(e,this.type,t=>{this.$emit("clickMarker",t)}),this.availableWind&&await init$1()}};function _sfc_render$f(e,t,r,n,o,a){return openBlock(),createElementBlock("div",{class:normalizeClass([{inactive:o.store.isColored},"mapcontainer"]),id:"map"},null,2)}const Map$1=_export_sfc(_sfc_main$f,[["render",_sfc_render$f],["__scopeId","data-v-7b9ea3ab"]]),_sfc_main$e={data(){return{start:hooks().subtract(1,"days").format("YYYY-MM-DD"),end:hooks().format("YYYY-MM-DD"),maxDate:hooks().format("YYYY-MM-DD"),cities:{},city:"",timePeriod:[{title:this.$t("history.currentDay"),value:"24hours"},{title:this.$t("history.currentMonth"),value:"currentMonth"},{title:this.$t("history.chooseDates"),value:"chooseDates"}],period:"24hours"}},computed:{startTimestamp:function(){return Number(hooks(this.start+" 00:00:00","YYYY-MM-DD HH:mm:ss").format("X"))},endTimestamp:function(){return Number(hooks(this.end+" 23:59:59","YYYY-MM-DD HH:mm:ss").format("X"))},link(){return`${config$2.REMOTE_PROVIDER}api/sensor/csv/${this.startTimestamp}/${this.endTimestamp}/${this.city}`}},watch:{period(e){e==="24hours"?(this.start=hooks().format("YYYY-MM-DD"),this.end=hooks().format("YYYY-MM-DD")):e==="currentMonth"&&(this.start=hooks().subtract(1,"month").format("YYYY-MM-DD"),this.end=hooks().format("YYYY-MM-DD"))}},async created(){try{const e=await axios.get(`${config$2.REMOTE_PROVIDER}api/sensor/cities`);this.cities=e.data.result;const t=Object.keys(this.cities),r=Object.keys(this.cities[t[0]]);this.city=this.cities[t[0]][r[0]][0]}catch(e){console.log(e.message)}}},_hoisted_1$d=["action"],_hoisted_2$a=["label"],_hoisted_3$8=["value"],_hoisted_4$6=["value"],_hoisted_5$6={key:0,class:"flexline"},_hoisted_6$6=["max"],_hoisted_7$6=["max"],_hoisted_8$6=["value"];function _sfc_render$e(e,t,r,n,o,a){return openBlock(),createElementBlock("form",{action:a.link},[createBaseVNode("section",null,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>o.city=l),class:"block"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Object.keys(o.cities),(l,c)=>(openBlock(),createElementBlock("optgroup",{label:l,key:c},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Object.keys(o.cities[l]),(u,g)=>(openBlock(),createElementBlock(Fragment,{key:g},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.cities[l][u],(b,x)=>(openBlock(),createElementBlock("option",{value:b,key:x},toDisplayString$1(b),9,_hoisted_3$8))),128))],64))),128))],8,_hoisted_2$a))),128))],512),[[vModelSelect,o.city]])]),createBaseVNode("section",null,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>o.period=l),class:"block"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.timePeriod,l=>(openBlock(),createElementBlock("option",{value:l.value,key:l.value},toDisplayString$1(l.title),9,_hoisted_4$6))),128))],512),[[vModelSelect,o.period]])]),o.period==="chooseDates"?(openBlock(),createElementBlock("section",_hoisted_5$6,[withDirectives(createBaseVNode("input",{type:"date","onUpdate:modelValue":t[2]||(t[2]=l=>o.start=l),max:o.maxDate},null,8,_hoisted_6$6),[[vModelText,o.start]]),createTextVNode(" \u2013 "),withDirectives(createBaseVNode("input",{type:"date","onUpdate:modelValue":t[3]||(t[3]=l=>o.end=l),max:o.maxDate},null,8,_hoisted_7$6),[[vModelText,o.end]])])):createCommentVNode("",!0),createBaseVNode("section",null,[createBaseVNode("input",{type:"submit",value:e.$t("history.button"),class:"block"},null,8,_hoisted_8$6)])],8,_hoisted_1$d)}const HistoryImport=_export_sfc(_sfc_main$e,[["render",_sfc_render$e]]),_sfc_main$d={props:["current"],data(){return{type:this.current,measurements:Object.entries(measurements),store:useStore()}},computed:{availableunits(){let e=[];return this.store.sensors.forEach(t=>{Object.keys(t.data).forEach(r=>{e.push(r)})}),[...new Set(e)]},availableoptions(){let e=[];return this.availableunits.forEach(t=>{e.push({name:measurements[t].label,value:t})}),e}},watch:{type:async function(){await this.$router.push({name:"main",params:{provider:this.$route.params.provider||"realtime",type:this.type,zoom:this.$route.params.zoom,lat:this.$route.params.lat,lng:this.$route.params.lng,sensor:this.$route.params.sensor}}),this.$router.go(0)}}},_hoisted_1$c=["value"];function _sfc_render$d(e,t,r,n,o,a){return o.store.sensors.length>0?withDirectives((openBlock(),createElementBlock("select",{key:0,"onUpdate:modelValue":t[0]||(t[0]=l=>o.type=l)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.availableoptions,l=>(openBlock(),createElementBlock("option",{key:l.value,value:l.value},toDisplayString$1(l.name),9,_hoisted_1$c))),128))],512)),[[vModelSelect,o.type]]):createCommentVNode("",!0)}const Measures=_export_sfc(_sfc_main$d,[["render",_sfc_render$d]]);function IDBworkflow(e,t,r,n,o){const a=window.indexedDB||window.webkitIndexedDB;if(!a)return;let l=null;const c=a.open(e,t);c.addEventListener("error",u=>{console.warn(u)}),c.addEventListener("success",u=>{if(l=u.target.result,l.objectStoreNames.contains(r)){let g=l.transaction(r,n);g.addEventListener("error",x=>{console.warn(x)});const b=g.objectStore(r);o(b)}}),c.addEventListener("upgradeneeded",u=>{l=u.target.result;const g=u.oldVersion,b=u.newVersion||l.version;console.log("DB updated from version",g,"to",b),l.objectStoreNames.contains(r)||l.createObjectStore(r,{keyPath:"id",autoIncrement:!0})})}function IDBgettable(e,t,r){return new Promise(n=>{let o=[];IDBworkflow(e,t,r,"readonly",a=>{a.openCursor().addEventListener("success",l=>{const c=l.target.result;c?(o.push(c.value),c.continue()):n(o)})})})}const Bookmarks_vue_vue_type_style_index_0_scoped_f99092ea_lang="",_sfc_main$c={data(){return{bookmarks:[],store:useStore()}},methods:{async getbookmarks(){this.bookmarks=await IDBgettable(this.store.idbBookmarkDbname,this.store.idbBookmarkVDbver,this.store.idbBookmarkVDbtable)},deletebookmark(e){IDBworkflow(this.store.idbBookmarkDbname,this.store.idbBookmarkVDbver,this.store.idbBookmarkVDbtable,"readwrite",t=>{t.delete(e),this.getbookmarks()})}},mounted(){this.getbookmarks();const e=new BroadcastChannel(this.store.idbWatcherBroadcast);e.onmessage=t=>{t.data&&this.getbookmarks()}}},_hoisted_1$b=["href"],_hoisted_2$9={key:0,class:"name"},_hoisted_3$7=["onClick"];function _sfc_render$c(e,t,r,n,o,a){const l=resolveComponent("font-awesome-icon");return!o.bookmarks||o.bookmarks.length<1?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(e.$t("bookmarks.listempty")),1)],64)):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(o.bookmarks,c=>(openBlock(),createElementBlock("section",{key:c.id,class:"flexline"},[createBaseVNode("a",{href:c.link,target:"_blank"},[c.customName?(openBlock(),createElementBlock("b",_hoisted_2$9,toDisplayString$1(c.customName),1)):createCommentVNode("",!0),c.address?(openBlock(),createElementBlock("b",{key:1,class:normalizeClass(c.customName?"addresssm":"adresslg")},toDisplayString$1(c.address),3)):createCommentVNode("",!0)],8,_hoisted_1$b),createBaseVNode("button",{title:"Remove this sensor",onClick:withModifiers(u=>a.deletebookmark(c.id),["prevent"])},[createVNode(l,{icon:"fa-solid fa-xmark"})],8,_hoisted_3$7)]))),128))}const Bookmarks=_export_sfc(_sfc_main$c,[["render",_sfc_render$c],["__scopeId","data-v-f99092ea"]]),Footer_vue_vue_type_style_index_0_scoped_d82d0b02_lang="",_sfc_main$b={emits:["history"],props:["currentProvider","canHistory","type"],components:{HistoryImport,Measures,Bookmarks},data(){return{isActive:!1,isActiveMenu:!1,isMeasuresPopupOpen:!1,realtime:this.currentProvider==="realtime",wind:!1,messages:config$2.SHOW_MESSAGES,start:hooks().format("YYYY-MM-DD"),maxDate:hooks().format("YYYY-MM-DD"),store:useStore()}},computed:{startTimestamp:function(){return Number(hooks(this.start+" 00:00:00","YYYY-MM-DD HH:mm:ss").format("X"))},endTimestamp:function(){return Number(hooks(this.start+" 23:59:59","YYYY-MM-DD HH:mm:ss").format("X"))}},watch:{async realtime(e){await this.$router.push({name:"main",params:{provider:e?"realtime":"remote",type:this.$route.params.type,zoom:this.$route.params.zoom,lat:this.$route.params.lat,lng:this.$route.params.lng,sensor:this.$route.params.sensor}}),this.$router.go(0)},start(){this.getHistory()},canHistory:{handler(e){e&&this.getHistory()},immediate:!0},wind(e){switchLayer(instanceMap(),e)},messages(e){switchMessagesLayer(instanceMap(),e)}},methods:{toggleOpen(e){this[e]?(this[e]=!1,this.store.removeColorMap()):(this[e]=!0,this.store.colorMap())},toggleIsActive(){this.toggleOpen("isActive")},toggleMobileMenu(){this.toggleOpen("isActiveMenu")},toggleMeasurePopup(e){e.target.classList.contains("footer__close-popup")&&this.$refs.details.open?this.$refs.details.open=!1:this.toggleOpen("isMeasuresPopupOpen")},getHistory(){this.realtime||this.$emit("history",{start:this.startTimestamp,end:this.endTimestamp})}}},_withScopeId$6=e=>(pushScopeId("data-v-d82d0b02"),e=e(),popScopeId(),e),_hoisted_1$a={class:"mapcontrols"},_hoisted_2$8={style:{display:"none"}},_hoisted_3$6={class:"flexline"},_hoisted_4$5={id:"bookmarks",class:"popover-bottom-left",popover:""},_hoisted_5$5={class:"popovercontrol",popovertarget:"bookmarks"},_hoisted_6$5=["max","disabled"],_hoisted_7$5={class:"flexline"},_hoisted_8$5={id:"mapsettings",class:"popover-bottom-right",popover:""},_hoisted_9$5=["checked"],_hoisted_10$4={for:"realtime"},_hoisted_11$2=["disabled","checked"],_hoisted_12$2={for:"wind"},_hoisted_13$2=["checked"],_hoisted_14$2={for:"messages"},_hoisted_15$3=_withScopeId$6(()=>createBaseVNode("hr",null,null,-1)),_hoisted_16$2={class:"popovercontrol",popovertarget:"mapsettings"};function _sfc_render$b(e,t,r,n,o,a){const l=resolveComponent("Bookmarks"),c=resolveComponent("font-awesome-icon"),u=resolveComponent("Measures"),g=resolveComponent("HistoryImport");return openBlock(),createElementBlock("div",_hoisted_1$a,[createBaseVNode("div",_hoisted_2$8,toDisplayString$1(e.bufer),1),createBaseVNode("div",_hoisted_3$6,[createBaseVNode("div",_hoisted_4$5,[createBaseVNode("h3",null,toDisplayString$1(e.$t("bookmarks.listtitle")),1),createVNode(l)]),createBaseVNode("button",_hoisted_5$5,[createVNode(c,{icon:"fa-solid fa-bookmark"})]),withDirectives(createBaseVNode("input",{type:"date","onUpdate:modelValue":t[0]||(t[0]=b=>o.start=b),max:o.maxDate,disabled:r.currentProvider=="realtime"},null,8,_hoisted_6$5),[[vModelText,o.start]]),createVNode(u,{current:r.type.toLowerCase()},null,8,["current"])]),createBaseVNode("div",_hoisted_7$5,[createBaseVNode("div",_hoisted_8$5,[createBaseVNode("section",null,[withDirectives(createBaseVNode("input",{id:"realtime","onUpdate:modelValue":t[1]||(t[1]=b=>o.realtime=b),type:"checkbox",checked:o.realtime},null,8,_hoisted_9$5),[[vModelCheckbox,o.realtime]]),createBaseVNode("label",_hoisted_10$4,toDisplayString$1(e.$t("provider.realtime")),1)]),createBaseVNode("section",null,[withDirectives(createBaseVNode("input",{id:"wind","onUpdate:modelValue":t[2]||(t[2]=b=>o.wind=b),type:"checkbox",disabled:!o.realtime,checked:o.wind&&o.realtime},null,8,_hoisted_11$2),[[vModelCheckbox,o.wind]]),createBaseVNode("label",_hoisted_12$2,toDisplayString$1(e.$t("layer.wind")),1)]),createBaseVNode("section",null,[withDirectives(createBaseVNode("input",{id:"messages","onUpdate:modelValue":t[3]||(t[3]=b=>o.messages=b),type:"checkbox",checked:o.messages},null,8,_hoisted_13$2),[[vModelCheckbox,o.messages]]),createBaseVNode("label",_hoisted_14$2,toDisplayString$1(e.$t("layer.messages")),1)]),_hoisted_15$3,createBaseVNode("section",null,[createBaseVNode("h3",null,toDisplayString$1(e.$t("history.title")),1),createVNode(g)])]),createBaseVNode("button",_hoisted_16$2,[createVNode(c,{icon:"fa-solid fa-gear"})])])])}const Footer=_export_sfc(_sfc_main$b,[["render",_sfc_render$b],["__scopeId","data-v-d82d0b02"]]),_imports_0$1="/assets/app-icon-512.a5eb7b3f.png",Header_vue_vue_type_style_index_0_scoped_f461fbda_lang="",_sfc_main$a={data(){return{locale:localStorage.getItem("locale")||this.$i18n.locale||"en",store:useStore()}},watch:{locale(e){this.$i18n.locale=e,localStorage.setItem("locale",e)}},computed:{countPoints(){return this.store.sensors.length}}},_withScopeId$5=e=>(pushScopeId("data-v-f461fbda"),e=e(),popScopeId(),e),_hoisted_1$9={class:"flexline space-between"},_hoisted_2$7={class:"flexline align-start"},_hoisted_3$5=_withScopeId$5(()=>createBaseVNode("img",{alt:"App logo",src:_imports_0$1},null,-1)),_hoisted_4$4={key:0,class:"text-changabletheme"},_hoisted_5$4={class:"flexline"},_hoisted_6$4=_withScopeId$5(()=>createBaseVNode("option",{value:"en"},"English",-1)),_hoisted_7$4=_withScopeId$5(()=>createBaseVNode("option",{value:"ru"},"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",-1)),_hoisted_8$4=[_hoisted_6$4,_hoisted_7$4],_hoisted_9$4={id:"about",class:"popover-top-right",popover:""},_hoisted_10$3=createStaticVNode('

Web3 \u043E\u0442\u043A\u0440\u044B\u0442\u0430\u044F \u0441\u0435\u0442\u044C \u0434\u0430\u0442\u0447\u0438\u043A\u043E\u0432

\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 \u043E\u0442\u043A\u0440\u044B\u0442\u0443\u044E \u0441\u0435\u0442\u044C \u0434\u0430\u0442\u0447\u0438\u043A\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u043F\u043E\u0441\u0442\u0440\u043E\u0435\u043D\u0430 \u043D\u0430 open-source \u043F\u0440\u0438\u043D\u0446\u0438\u043F\u0430\u0445 \u0438 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u044D\u043D\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u0430\u043C\u0438 (\u0441\u043C. the free will of individuals). \u041A\u0430\u0440\u0442\u0430 \u043F\u0440\u0435\u0434\u043B\u0430\u0433\u0430\u0435\u0442 \u0434\u0432\u0430 \u0440\u0430\u0437\u043D\u044B\u0445 \u0443\u0440\u043E\u0432\u043D\u044F \u0434\u0435\u0446\u0435\u043D\u0442\u0440\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438: \u043F\u0440\u044F\u043C\u0430\u044F peer-to-peer \u0441\u0432\u044F\u0437\u044C \u0434\u0430\u0442\u0447\u0438\u043A\u043E\u0432 \u0438 \u0431\u043B\u043E\u043A\u0447\u0435\u0439\u043D \u0434\u043B\u044F \u0441\u0431\u043E\u0440\u0430 \u0438 \u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u0438\u0439 \u0441 \u0434\u0430\u0442\u0447\u0438\u043A\u043E\u0432. \u0422\u0443\u0442 \u043C\u043E\u0436\u043D\u043E \u043E\u0437\u043D\u0430\u043A\u043E\u043C\u0438\u0442\u044C\u0441\u044F \u0431\u043E\u043B\u0435\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E \u0441 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u043E\u0439.

\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u0441\u0432\u043E\u0439 \u0434\u0430\u0442\u0447\u0438\u043A \u043D\u0430 \u043A\u0430\u0440\u0442\u0443

\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0441\u043E\u0431\u0440\u0430\u0442\u044C \u0441\u0432\u043E\u0439 \u0434\u0430\u0442\u0447\u0438\u043A, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044F \u043A\u043E\u043C\u043F\u043B\u0435\u043A\u0442\u0443\u044E\u0449\u0438\u0435 \u043D\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u043C \u0440\u044B\u043D\u043A\u0435 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u0438\u043A\u0438, \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0434\u0430\u0442\u0447\u0438\u043A \u043D\u0430 \u043A\u0430\u0440\u0442\u0443. \u041C\u044B \u0441 \u0440\u0430\u0434\u043E\u0441\u0442\u044C\u044E \u043F\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u043C \u043D\u043E\u0432\u044B\u0445 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u043E\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u0441\u0442\u0432\u0430. \u041F\u0440\u0438\u0441\u043E\u0435\u0434\u0438\u043D\u044F\u0439\u0442\u0435\u0441\u044C!

\u0412\u0438\u0434\u0435\u043E-\u0438\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u044F \u043D\u0430 YouTube

',5),_hoisted_15$2=createStaticVNode('

Web3 public sensors map

Welcome to the decentralized opensource sensors map which operates with the sole intent of serving the free will of individuals, without any beneficiaries. It offers two distinct layers of decentralization at your choise: peer-to-peer connectivity for direct access to sensor data, and the federative concept for accumulating sensor data and displaying measurement history. Click here for further technical details.

Add your sensor on this map

You can assemble your own sensor using components available on the free market. Follow the instructions provided to connect your sensor to the map. We welcome your participation and look forward to expanding our community together. Join us today!

YouTube video guide

',5),_hoisted_20$2=_withScopeId$5(()=>createBaseVNode("hr",null,null,-1)),_hoisted_21$2={class:"navlinks"},_hoisted_22$2={href:"https://github.com/airalab/sensors.robonomics.network",target:"_blank",rel:"noopener"},_hoisted_23$2={class:"popovercontrol",popovertarget:"about"};function _sfc_render$a(e,t,r,n,o,a){const l=resolveComponent("router-link"),c=resolveComponent("font-awesome-icon");return openBlock(),createElementBlock("header",_hoisted_1$9,[createBaseVNode("div",_hoisted_2$7,[createVNode(l,{to:"/",class:"appicon"},{default:withCtx(()=>[_hoisted_3$5]),_:1}),a.countPoints>0?(openBlock(),createElementBlock("b",_hoisted_4$4,toDisplayString$1(e.$t("loadedsesnsors"))+": "+toDisplayString$1(a.countPoints),1)):createCommentVNode("",!0)]),createBaseVNode("div",_hoisted_5$4,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":t[0]||(t[0]=u=>o.locale=u)},_hoisted_8$4,512),[[vModelSelect,o.locale]]),createBaseVNode("div",_hoisted_9$4,[o.locale==="ru"?(openBlock(),createElementBlock(Fragment,{key:0},[_hoisted_10$3],64)):(openBlock(),createElementBlock(Fragment,{key:1},[_hoisted_15$2],64)),_hoisted_20$2,createBaseVNode("section",_hoisted_21$2,[createBaseVNode("a",_hoisted_22$2,toDisplayString$1(e.$t("links.github")),1),createVNode(l,{to:"/air-measurements"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(e.$t("links.measurement")),1)]),_:1}),createVNode(l,{to:"/privacy-policy"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(e.$t("links.privacy")),1)]),_:1})])]),createBaseVNode("button",_hoisted_23$2,[createVNode(c,{icon:"fa-solid fa-bars"})])])])}const Header=_export_sfc(_sfc_main$a,[["render",_sfc_render$a],["__scopeId","data-v-f461fbda"]]),_imports_0="/assets/sensors-world-app.8a0828bb.png",InstallPWA_vue_vue_type_style_index_0_scoped_b59a209f_lang="",_sfc_main$9={data(){return{deferredPrompt:null,isSupported:!1,db:null,isInstalled:"loading",isBrowserSupport:!0,browsers:{chrome:!1,safari:!1,firefox:!1,edge:!1,opera:!1}}},methods:{async getDb(){return new Promise((e,t)=>{let r=window.indexedDB.open("SensorsDB",1);r.onerror=n=>{console.log("Error opening db",n),t("Error")},r.onsuccess=n=>{e(n.target.result)},r.onupgradeneeded=n=>{n.target.result.createObjectStore("install",{autoIncrement:!0,keyPath:"id"})}})},async getData(){return new Promise(e=>{let t=this.db.transaction(["install"],"readonly");t.oncomplete=()=>{e(n)};let r=t.objectStore("install"),n=null;r.openCursor().onsuccess=o=>{let a=o.target.result;a&&(n=a.value,a.continue())}})},async addDataToDb(e=!1,t=!1){return new Promise(r=>{let n=this.db.transaction(["install"],"readwrite");n.oncomplete=()=>{r()};let o=n.objectStore("install");o.delete(1),o.add({id:1,removed:e,installed:t})})},async installApp(){if(this.addDataToDb(!1,!0),this.deferredPrompt!==null){this.deferredPrompt.prompt();const{outcome:e}=await this.deferredPrompt.userChoice;e==="accepted"&&(this.deferredPrompt=null,this.isSupported=!1,this.isInstalled="installed")}},removeInstall(){this.addDataToDb(!0,!1),this.isInstalled="removed"},checkBrowser(){let e=navigator.userAgent;this.browsers.chrome=e.indexOf("Chrome")>-1,this.browsers.firefox=e.indexOf("Firefox")>-1,this.browsers.safari=e.indexOf("Safari")>-1,this.browsers.chrome&&this.browsers.safari&&(this.browsers.safari=!1),this.browsers.opera=e.indexOf("OP")>-1,this.browsers.chrome&&this.browsers.opera&&(this.browsers.chrome=!1)}},async created(){this.db=await this.getDb(),this.isInstalled=await this.getData()?await this.getData():null},mounted(){window.addEventListener("beforeinstallprompt",e=>{this.isSupported=!0,this.deferredPrompt=e}),window.matchMedia("(display-mode: standalone)").matches?this.isSupported=!0:this.isSupported=!1,this.checkBrowser(),(this.browsers.safari||this.browsers.firefox||this.browsers.opera)&&(this.isBrowserSupport=!1)}},_withScopeId$4=e=>(pushScopeId("data-v-b59a209f"),e=e(),popScopeId(),e),_hoisted_1$8={key:0,class:"container install-pwa__container"},_hoisted_2$6={class:"install-pwa__content"},_hoisted_3$4=_withScopeId$4(()=>createBaseVNode("img",{src:_imports_0,alt:"sensors-cy-app"},null,-1)),_hoisted_4$3={class:"install-pwa__text"},_hoisted_5$3=_withScopeId$4(()=>createBaseVNode("h3",null,"Available as web application (PWA)",-1));function _sfc_render$9(e,t,r,n,o,a){return!o.isInstalled&&o.isBrowserSupport?(openBlock(),createElementBlock("div",_hoisted_1$8,[createBaseVNode("div",_hoisted_2$6,[_hoisted_3$4,createBaseVNode("div",_hoisted_4$3,[_hoisted_5$3,createBaseVNode("button",{onClick:t[0]||(t[0]=(...l)=>a.installApp&&a.installApp(...l)),class:"install-pwa__btn"},"Install")])]),createBaseVNode("button",{onClick:t[1]||(t[1]=(...l)=>a.removeInstall&&a.removeInstall(...l)),class:"install-pwa__remove"})])):createCommentVNode("",!0)}const InstallPWA=_export_sfc(_sfc_main$9,[["render",_sfc_render$9],["__scopeId","data-v-b59a209f"]]),MessagePopup_vue_vue_type_style_index_0_scoped_c5bfb7c2_lang="";function preloadImages(e,t){let r=0;const n={};function o(){if(r++,r==e.length){const a=[],l=[];for(const c of e)n[c]&&n[c]>0?(console.log(`Bad image ${c}`),l.push(c)):a.push(c);t(a,l)}}for(let a of e){let l=document.createElement("img");l.onload=()=>{n[a]=0,o()},l.onerror=()=>{n[a]||(n[a]=0),n[a]++,n[a]<3?l.src=a:o()},l.src=a}}const _sfc_main$8={props:["data"],data(){return{isImages:!1,images:[],badImages:[],imagesLoaded:!1,state:"neutral"}},computed:{dateMsg:function(){return hooks(this.data.timestamp,"X").format("DD.MM.YYYY HH:mm:ss")},classList(){return{["sensor-popup__header"]:!0,[`sensor-popup__header--${this.state}`]:this.state}}},watch:{data(){this.imagesLoad()}},created(){this.imagesLoad()},methods:{replaceWithBr(e){return e.replace(/\n/g,"
")},imagesLoad(){if(this.data.images&&this.data.images.length>0){this.images=[],this.badImages=[],this.imagesLoaded=!1,this.isImages=!0;const e=this.data.images.map(t=>`https://aira.mypinata.cloud/ipfs/${this.data.ipfs}/${t}`);preloadImages(e,(t,r)=>{t.length>0&&(this.images=t),r.length>0&&(this.badImages=r),this.imagesLoaded=!0})}else this.isImages=!1,this.images=[],this.badImages=[],this.imagesLoaded=!1}}},_hoisted_1$7={class:"container sensor-popup sensors-panel sensors-panel--center-right active popup-js"},_hoisted_2$5={class:"sensor-popup__header-icon"},_hoisted_3$3={class:"sensor-popup__header-wrapper"},_hoisted_4$2={class:"sensor-popup--subtitle"},_hoisted_5$2={ref:"content",class:"sensor-popup--content"},_hoisted_6$3=["innerHTML"],_hoisted_7$3={key:0},_hoisted_8$3=["href"],_hoisted_9$3=["src"],_hoisted_10$2=["href"];function _sfc_render$8(e,t,r,n,o,a){const l=resolveComponent("font-awesome-icon");return openBlock(),createElementBlock("div",_hoisted_1$7,[createBaseVNode("div",{class:normalizeClass(a.classList)},[createBaseVNode("div",_hoisted_2$5,[createVNode(l,{icon:"fa-solid fa-face-meh"})]),createBaseVNode("div",_hoisted_3$3,[createBaseVNode("h2",null,toDisplayString$1(e.$t("details.user"))+" "+toDisplayString$1(r.data.username),1),createBaseVNode("div",_hoisted_4$2,[createBaseVNode("span",null,[createVNode(l,{icon:"fa-solid fa-stopwatch"}),createTextVNode(" "+toDisplayString$1(a.dateMsg),1)])])])],2),createBaseVNode("div",_hoisted_5$2,[createBaseVNode("div",{innerHTML:a.replaceWithBr(r.data.message)},null,8,_hoisted_6$3),o.isImages?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("h2",null,toDisplayString$1(e.$t("details.photos")),1),o.imagesLoaded?(openBlock(),createElementBlock(Fragment,{key:1},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.images,(c,u)=>(openBlock(),createElementBlock("div",{key:u},[createBaseVNode("a",{href:c,target:"_blank"},[createBaseVNode("img",{style:{"max-width":"400px"},src:c},null,8,_hoisted_9$3)],8,_hoisted_8$3)]))),128)),createBaseVNode("template",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.badImages,(c,u)=>(openBlock(),createElementBlock("a",{key:u,href:c,target:"_blank"},toDisplayString$1(c),9,_hoisted_10$2))),128))])],64)):(openBlock(),createElementBlock("div",_hoisted_7$3,"..."))],64)):createCommentVNode("",!0)],512),createBaseVNode("a",{class:"popup__close",href:"javascript:;",onClick:t[0]||(t[0]=withModifiers(c=>e.$emit("close"),["stop","prevent"]))},[createVNode(l,{icon:"fa-solid fa-xmark"})])])}const MessagePopup=_export_sfc(_sfc_main$8,[["render",_sfc_render$8],["__scopeId","data-v-c5bfb7c2"]]),Bookmark_vue_vue_type_style_index_0_scoped_8cca7f79_lang="",_sfc_main$7={props:["address","link"],data(){return{IsBookmarked:!1,db:null,bookmarks:[],bookmarkid:null,bookmarkname:"",store:useStore()}},computed:{buttonclasses(){return{button:!0,["button-green"]:this.IsBookmarked}}},methods:{async findbookmark(){return(await IDBgettable(this.store.idbBookmarkDbname,this.store.idbBookmarkVDbver,this.store.idbBookmarkVDbtable)).find(t=>t.address===this.$props.address)},async addbookmark(){await this.findbookmark()?this.bookmarkid&&IDBworkflow(this.store.idbBookmarkDbname,this.store.idbBookmarkVDbver,this.store.idbBookmarkVDbtable,"readwrite",r=>{const n=r.get(this.bookmarkid);n.addEventListener("error",o=>{console.log(o)}),n.addEventListener("success",o=>{const a=o.target.result;a.customName=this.bookmarkname;const l=r.put(a);l.addEventListener("error",c=>{console.log(c)}),l.addEventListener("success",c=>{this.IsBookmarked=!0})})}):IDBworkflow(this.store.idbBookmarkDbname,this.store.idbBookmarkVDbver,this.store.idbBookmarkVDbtable,"readwrite",r=>{r.add({customName:this.bookmarkname,address:this.$props.address,link:this.$props.link}),this.IsBookmarked=!0});const t=new BroadcastChannel(this.store.idbWatcherBroadcast);t.postMessage(!0),t.close()}},async mounted(){const e=await this.findbookmark();e&&(this.IsBookmarked=!0,this.bookmarkid=e.id,this.bookmarkname=e.customName)}},_hoisted_1$6=["placeholder"],_hoisted_2$4=["disabled","area-label"];function _sfc_render$7(e,t,r,n,o,a){const l=resolveComponent("font-awesome-icon");return openBlock(),createElementBlock("form",{class:"flexline",onSubmit:t[2]||(t[2]=withModifiers((...c)=>a.addbookmark&&a.addbookmark(...c),["prevent"]))},[withDirectives(createBaseVNode("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=c=>o.bookmarkname=c),placeholder:e.$t("sensorpopup.bookmarkplaceholder"),onInput:t[1]||(t[1]=c=>o.IsBookmarked=!1)},null,40,_hoisted_1$6),[[vModelText,o.bookmarkname]]),createBaseVNode("button",{class:normalizeClass(a.buttonclasses),disabled:o.IsBookmarked,"area-label":e.$t("sensorpopup.bookmarkbutton")},[o.IsBookmarked?(openBlock(),createBlock(l,{key:1,icon:"fa-solid fa-check"})):(openBlock(),createBlock(l,{key:0,icon:"fa-solid fa-bookmark"}))],10,_hoisted_2$4)],32)}const Bookmark=_export_sfc(_sfc_main$7,[["render",_sfc_render$7],["__scopeId","data-v-8cca7f79"]]),Chart_vue_vue_type_style_index_0_lang="",_sfc_main$6={props:["log","measurement","sensor_id","model","type","units"],data(){const e=this;return{datacollection:null,options:{title:!1,chart:{type:"spline",height:400},xAxis:{type:"datetime",labels:{formatter:function(){return hooks(this.value,"X").format("HH:mm")}},title:!1},yAxis:{title:!1},tooltip:{shared:!0,crosshairs:!0,formatter:function(){if(e.model===3){const r=e.log.find(n=>n.timestamp===this.x);moveMarkerTime(e.sensor_id,r)}let t="";return this.points.forEach(r=>{t+=""+r.series.name+" = "+r.y+"
"}),""+hooks(this.x,"X").format("DD.MM.YYYY HH:mm:ss")+"
"+t}},plotOptions:{series:{events:{mouseOut:function(){if(e.model===3){const t=e.log[e.log.length-1];moveMarkerTime(e.sensor_id,t,!0)}},legendItemClick:function(t){let r=t;if(t||(r=e.store.currentActiveMeasure),t.target){r=t.target.name;let n=t.target.name;r==="temperature"?n="tmp":r==="humidity"&&(n="hm"),e.store.selectCurrentActiveMeasure(n.toUpperCase(),!0)}if(r){r==="TMP"?r="temperature":r==="HM"&&(r="humidity");const n=e.series.filter(o=>o.name===r.replace(".","").toLowerCase());e.toggleTabState(n[0])}}}}},series:[]},store:useStore()}},computed:{series:function(){if(this.log.length>0&&this.units&&this.units.length>0){const e=this.units.map(n=>n.toLowerCase()),t=[];for(let n of e)t.push({visible:n===this.measurement,name:n,zones:measurements[n.toLowerCase()].zones,lineWidth:1,data:[],options:{name:n}});return!t.find(n=>n.visible===!0)&&t.length>0&&(t[0].visible=!0),t}return[{name:this.measurement,color:"#e8b738",lineWidth:1,data:[],options:{name:this.measurement}}]},storeMeasures(){return this.store.currentActiveMeasure}},watch:{sensor_id:function(){this.fillData()},measurement:function(){this.fillData()},log:{immediate:!1,handler:function(e){this.fillData(),this.$nextTick(()=>{const t=this.$refs.chart.chart.series[0].points.length-e.length;if(t<0){let r=[this.measurement];(this.measurement==="pm10"||this.measurement==="pm25")&&(r=["pm10","pm25"]);const n=e.slice(t);for(const o in r)for(let a of n)this.addPoint(o,[Number(a.timestamp),Number(a.data[r[o]])])}})}},storeMeasures:{handler:function(){this.options.plotOptions.series.events.legendItemClick(this.store.currentActiveMeasure)},deep:!0}},methods:{fillData(){const e=this.series;for(const t in e)e[t].data=this.log.map(r=>(r.data=Object.fromEntries(Object.entries(r.data).map(([n,o])=>[n.toLowerCase(),o])),[Number(r.timestamp),Number(r.data[e[t].options.name])]));if(this.options.series=e,!this.store.currentActiveMeasure&&!this.$props.type&&this.store.selectCurrentActiveMeasure(this.options.series[0].name.toUpperCase(),!0),!this.store.currentActiveMeasure&&this.$props.type){let t=this.$props.type;this.$props.type==="temperature"?t="tmp":this.$props.type==="humidity"&&(t="hm"),this.store.selectCurrentActiveMeasure(t.toUpperCase(),!0)}},addPoint(e,t){this.$refs.chart.chart.series[e].addPoint(t,!0,!1)},toggleTabState(e){const t=this.$refs.chart.chart.series.filter(r=>r.name===e.name);this.$refs.chart.chart.series.length&&(this.$refs.chart.chart.series[t[0].index].name==="temperature"?this.store.addToggleState("TMP"):this.$refs.chart.chart.series[t[0].index].name==="humidity"?this.store.addToggleState("HM"):this.store.addToggleState(this.$refs.chart.chart.series[t[0].index].name.toUpperCase().replace(".","")),this.$refs.chart.chart.series[t[0].index].visible?this.$refs.chart.chart.series[t[0].index].hide():this.$refs.chart.chart.series[t[0].index].show())}},mounted(){this.fillData()}},_hoisted_1$5={style:{margin:"20px 0"}};function _sfc_render$6(e,t,r,n,o,a){const l=resolveComponent("highcharts");return openBlock(),createElementBlock("div",_hoisted_1$5,[createVNode(l,{options:o.options,ref:"chart"},null,8,["options"])])}const Chart=_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]),Copy_vue_vue_type_style_index_0_scoped_951f909f_lang="",_sfc_main$5={props:["msg","title","notify"],data(){return{successCopy:!1}},methods:{success(){this.$notify({position:"top right",text:this.notify})},showSuccessesCopy(){this.successCopy=!0,setTimeout(()=>{this.successCopy=!1},2e3)}}},_hoisted_1$4=["title"];function _sfc_render$5(e,t,r,n,o,a){const l=resolveComponent("font-awesome-icon"),c=resolveDirective("clipboard");return withDirectives((openBlock(),createElementBlock("a",{class:"nowrap copy",title:r.title},[renderSlot(e.$slots,"default",{},void 0,!0),o.successCopy?createCommentVNode("",!0):(openBlock(),createElementBlock("button",{key:0,class:"copy-btn",onClick:t[0]||(t[0]=(...u)=>a.showSuccessesCopy&&a.showSuccessesCopy(...u))})),o.successCopy?(openBlock(),createBlock(l,{key:1,icon:"fa-solid fa-check"})):createCommentVNode("",!0)],8,_hoisted_1$4)),[[c,r.msg,"copy"],[c,a.success,"success"]])}const Copy=_export_sfc(_sfc_main$5,[["render",_sfc_render$5],["__scopeId","data-v-951f909f"]]),SensorPopup_vue_vue_type_style_index_0_scoped_c2c50600_lang="",_sfc_main$4={emits:["close"],props:["type","currentProvider","point"],components:{Chart,Copy,Bookmark},data(){return{select:"",measurement:this.type,isShowPath:!1,store:useStore(),realtime:this.currentProvider==="realtime",start:hooks().format("YYYY-MM-DD"),maxDate:hooks().format("YYYY-MM-DD")}},computed:{locale(){return localStorage.getItem("locale")||this.$i18n.locale||"en"},address(){return this.point.address},donated_by(){return this.point.donated_by},geo(){return this.point.geo},log(){return this.point.log},model(){return this.point.model},sender(){return this.point.sender},sensor_id(){return this.point.sensor_id},units(){let e=[];return Object.keys(this.log).forEach(t=>{e.push(Object.keys(Object.values(this.log[t])[0]))}),[...new Set(e.flat())]},scales(){let e=[];return Object.keys(measurements).forEach(t=>{this.units.some(r=>r===t)&&e.push(measurements[t])}),e},addressformatted(){return this.address.country+", "+this.address.address.join(", ")},isLocationRussion(){return this.address.country==="\u0420\u043E\u0441\u0441\u0438\u044F"||this.address.country==="Russia"},measure(){return this.items.find(e=>this.select===e.text)},scale(){return generate$1(measurements[this.type.toLowerCase()].colors,measurements[this.type.toLowerCase()].range)},hasIcon(){return e=>measurements[e.toLowerCase()]&&measurements[e.toLowerCase()].icon},icon:function(){return e=>this.hasIcon(e)?measurements[e.toLowerCase()].icon:"vial"},items(){const e=[];for(const t of Object.keys(this.last.data)){let r=null;measurements[t.toLowerCase()]&&measurements[t.toLowerCase()].colors&&(r=generate$1(measurements[t.toLowerCase()].colors,measurements[t.toLowerCase()].range)),e.push({id:t,title:this.$filters.measurementFormat(this.last.data[t],t),text:this.$filters.measurement(t),state:getState(r,this.last.data[t],measurements[t.toLowerCase()]?measurements[t.toLowerCase()].states:void 0)})}return e},measurementFilter(e){return measurements[e.toLowerCase()]?.label||e},measurementFormat(e,t){return measurements[t.toLowerCase()]?`${toFixed(e)} ${measurements[t.toLowerCase()].unit}`:toFixed(e)},collapse(e){return e?e.slice(0,6)+"..."+e.slice(-4):""},linkSensor:function(){const e=this.$router.resolve({name:"main",params:{provider:this.$route.params.provider||config$2.DEFAUL_TYPE_PROVIDER,type:this.$route.params.type||"pm10",zoom:this.$route.params.zoom||config$2.MAP.zoom,lat:this.geo.lat,lng:this.geo.lng,sensor:this.sensor_id}});return new URL(e.href,window.location.origin).href},link:function(){return sensors[this.sensor_id]?sensors[this.sensor_id].link:""},icon:function(){return sensors[this.sensor_id]?sensors[this.sensor_id].icon:""},last:function(){return this.log[this.log.length-1]},date:function(){return hooks(this.last.timestamp,"X").format("DD.MM.YYYY HH:mm:ss")},startTimestamp:function(){return Number(hooks(this.start+" 00:00:00","YYYY-MM-DD HH:mm:ss").format("X"))},endTimestamp:function(){return Number(hooks(this.start+" 23:59:59","YYYY-MM-DD HH:mm:ss").format("X"))},sharable:function(){return navigator.share&&navigator.canShare}},methods:{shareData(){navigator.share({title:"Public Sensor Map",url:this.linkSensor?this.linkSensor:this.link}).then(()=>{console.log("Shared")}).catch(console.error)},getHistory(){this.realtime||this.$emit("history",{sensor_id:this.sensor_id,start:this.startTimestamp,end:this.endTimestamp})}},watch:{sensor_id(){this.isShowPath=!1},isShowPath(){this.isShowPath?showPath(this.sensor_id):hidePath(this.sensor_id)},start(){this.getHistory()}}},_withScopeId$3=e=>(pushScopeId("data-v-c2c50600"),e=e(),popScopeId(),e),_hoisted_1$3={class:"popup-js active"},_hoisted_2$3={class:"flexline clipoverflow"},_hoisted_3$2=["src"],_hoisted_4$1={class:"scrollable-y"},_hoisted_5$1={class:"flexline space-between"},_hoisted_6$2={class:"flexline"},_hoisted_7$2=["max","disabled"],_hoisted_8$2={key:0,class:"infoline flexline"},_hoisted_9$2={class:"infoline-title"},_hoisted_10$1={class:"infoline-info"},_hoisted_11$1={key:1,class:"infoline flexline"},_hoisted_12$1={class:"infoline-title"},_hoisted_13$1={class:"infoline-info"},_hoisted_14$1={key:2,class:"infoline flexline"},_hoisted_15$1={class:"infoline-title"},_hoisted_16$1={class:"infoline-info"},_hoisted_17$1=["href"],_hoisted_18$1={key:3,class:"infoline flexline"},_hoisted_19$1={class:"infoline-title"},_hoisted_20$1={class:"infoline-info"},_hoisted_21$1={key:4,class:"infoline flexline"},_hoisted_22$1={class:"infoline-title"},_hoisted_23$1=_withScopeId$3(()=>createBaseVNode("label",{for:"realtime"},null,-1)),_hoisted_24$1={class:"sensors-switcher-text"},_hoisted_25$1={class:"infoline-info"},_hoisted_26$1={key:0},_hoisted_27$1={class:"scalegrid"},_hoisted_28$1={key:0},_hoisted_29$1={key:1},_hoisted_30$1={class:"textsmall"};function _sfc_render$4(e,t,r,n,o,a){const l=resolveComponent("font-awesome-icon"),c=resolveComponent("Bookmark"),u=resolveComponent("Chart"),g=resolveComponent("Copy");return openBlock(),createElementBlock("div",_hoisted_1$3,[createBaseVNode("section",null,[createBaseVNode("h3",_hoisted_2$3,[a.icon?(openBlock(),createElementBlock("img",{key:0,src:a.icon,class:"icontitle"},null,8,_hoisted_3$2)):(openBlock(),createBlock(l,{key:1,icon:"fa-solid fa-location-dot"})),createTextVNode(" "+toDisplayString$1(a.addressformatted),1)])]),createBaseVNode("div",_hoisted_4$1,[createBaseVNode("section",_hoisted_5$1,[createBaseVNode("div",_hoisted_6$2,[withDirectives(createBaseVNode("input",{type:"date","onUpdate:modelValue":t[0]||(t[0]=b=>o.start=b),max:o.maxDate,disabled:r.currentProvider=="realtime"},null,8,_hoisted_7$2),[[vModelText,o.start]]),createVNode(c,{address:a.address.address&&a.address.address.join(", "),link:a.linkSensor},null,8,["address","link"])]),a.sharable?(openBlock(),createElementBlock("button",{key:0,onClick:t[1]||(t[1]=(...b)=>a.shareData&&a.shareData(...b)),class:"button"},[createVNode(l,{icon:"fa-solid fa-share-from-square"})])):createCommentVNode("",!0)]),createBaseVNode("section",null,[a.log.length>0?(openBlock(),createBlock(u,{key:0,model:a.model,log:a.log,measurement:o.measurement,sensor_id:a.sensor_id,type:r.type,units:a.units},null,8,["model","log","measurement","sensor_id","type","units"])):createCommentVNode("",!0)]),createBaseVNode("section",null,[createBaseVNode("h3",null,toDisplayString$1(e.$t("sensorpopup.infotitle")),1),a.sensor_id?(openBlock(),createElementBlock("div",_hoisted_8$2,[createBaseVNode("div",_hoisted_9$2,toDisplayString$1(e.$t("sensorpopup.infosensorid"))+":",1),createBaseVNode("div",_hoisted_10$1,[createTextVNode(toDisplayString$1(e.$filters.collapse(a.sensor_id))+" ",1),createVNode(g,{msg:a.sensor_id,title:`Sensor id: ${a.sensor_id}`,notify:e.$t("details.copied")},null,8,["msg","title","notify"])])])):createCommentVNode("",!0),a.geo?(openBlock(),createElementBlock("div",_hoisted_11$1,[createBaseVNode("div",_hoisted_12$1,toDisplayString$1(e.$t("sensorpopup.infosensorgeo"))+":",1),createBaseVNode("div",_hoisted_13$1,toDisplayString$1(a.geo.lat)+", "+toDisplayString$1(a.geo.lng),1)])):createCommentVNode("",!0),a.link?(openBlock(),createElementBlock("div",_hoisted_14$1,[createBaseVNode("div",_hoisted_15$1,toDisplayString$1(e.$t("sensorpopup.infosensorowner"))+":",1),createBaseVNode("div",_hoisted_16$1,[createBaseVNode("a",{href:a.link,rel:"noopener",target:"_blank"},toDisplayString$1(a.link),9,_hoisted_17$1)])])):createCommentVNode("",!0),a.donated_by?(openBlock(),createElementBlock("div",_hoisted_18$1,[createBaseVNode("div",_hoisted_19$1,toDisplayString$1(e.$t("sensorpopup.infosensordonated"))+":",1),createBaseVNode("div",_hoisted_20$1,toDisplayString$1(a.donated_by),1)])):createCommentVNode("",!0),a.model===3?(openBlock(),createElementBlock("div",_hoisted_21$1,[createBaseVNode("div",_hoisted_22$1,[_hoisted_23$1,createBaseVNode("span",_hoisted_24$1,toDisplayString$1(e.$t("details.showpath")),1),createTextVNode(":")]),createBaseVNode("div",_hoisted_25$1,[withDirectives(createBaseVNode("input",{type:"checkbox",id:"realtime","onUpdate:modelValue":t[2]||(t[2]=b=>o.isShowPath=b)},null,512),[[vModelCheckbox,o.isShowPath]])])])):createCommentVNode("",!0)]),a.units&&a.scales?(openBlock(),createElementBlock("section",_hoisted_26$1,[createBaseVNode("h3",null,toDisplayString$1(e.$t("scales.title")),1),createBaseVNode("div",_hoisted_27$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.scales,b=>(openBlock(),createElementBlock("div",{key:b.label},[b.zones&&(b.name||b.label)?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("p",null,[b.name?(openBlock(),createElementBlock("b",_hoisted_28$1,toDisplayString$1(a.locale==="en"?b.name.en:b.name.ru),1)):(openBlock(),createElementBlock("b",_hoisted_29$1,toDisplayString$1(b.label),1)),createTextVNode(" ("+toDisplayString$1(b.unit)+") ",1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(b.zones,x=>(openBlock(),createElementBlock(Fragment,{key:x.color},[x.color&&x.label?(openBlock(),createElementBlock("div",{key:0,class:"scales-color",style:normalizeStyle(`--color: ${x.color}`)},[createBaseVNode("b",null,toDisplayString$1(a.locale==="en"?x.label.en:x.label.ru),1),createTextVNode(" ("),x.value?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(e.$t("scales.upto"))+" "+toDisplayString$1(x.value),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString$1(e.$t("scales.above")),1)],64)),createTextVNode(") ")],4)):createCommentVNode("",!0)],64))),128))],64)):createCommentVNode("",!0)]))),128))])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_30$1,[a.isLocationRussion?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(e.$t("notice_with_fz")),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString$1(e.$t("notice_without_fz")),1)],64))])]),createBaseVNode("button",{onClick:t[3]||(t[3]=withModifiers(b=>e.$emit("close"),["prevent"])),"aria-label":"Close sensor",class:"close"},[createVNode(l,{icon:"fa-solid fa-xmark"})])])}const SensorPopup=_export_sfc(_sfc_main$4,[["render",_sfc_render$4],["__scopeId","data-v-c2c50600"]]);function asUint8Array(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function alloc(e=0){return globalThis.Buffer?.alloc!=null?asUint8Array(globalThis.Buffer.alloc(e)):new Uint8Array(e)}function allocUnsafe$2(e=0){return globalThis.Buffer?.allocUnsafe!=null?asUint8Array(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}const N1$2=Math.pow(2,7),N2$2=Math.pow(2,14),N3$2=Math.pow(2,21),N4$2=Math.pow(2,28),N5$2=Math.pow(2,35),N6$2=Math.pow(2,42),N7$2=Math.pow(2,49),MSB$4=128,REST$4=127;function encodingLength$2(e){if(eNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function encodeUint8Array(e,t,r=0){switch(encodingLength$2(e)){case 8:t[r++]=e&255|MSB$4,e/=128;case 7:t[r++]=e&255|MSB$4,e/=128;case 6:t[r++]=e&255|MSB$4,e/=128;case 5:t[r++]=e&255|MSB$4,e/=128;case 4:t[r++]=e&255|MSB$4,e>>>=7;case 3:t[r++]=e&255|MSB$4,e>>>=7;case 2:t[r++]=e&255|MSB$4,e>>>=7;case 1:{t[r++]=e&255,e>>>=7;break}default:throw new Error("unreachable")}return t}function encodeUint8ArrayList(e,t,r=0){switch(encodingLength$2(e)){case 8:t.set(r++,e&255|MSB$4),e/=128;case 7:t.set(r++,e&255|MSB$4),e/=128;case 6:t.set(r++,e&255|MSB$4),e/=128;case 5:t.set(r++,e&255|MSB$4),e/=128;case 4:t.set(r++,e&255|MSB$4),e>>>=7;case 3:t.set(r++,e&255|MSB$4),e>>>=7;case 2:t.set(r++,e&255|MSB$4),e>>>=7;case 1:{t.set(r++,e&255),e>>>=7;break}default:throw new Error("unreachable")}return t}function decodeUint8Array(e,t){let r=e[t],n=0;if(n+=r&REST$4,ro+a.length,0));const r=allocUnsafe$2(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return asUint8Array(r)}function equals$2(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r0&&this.appendAll(t)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...t){this.appendAll(t)}appendAll(t){let r=0;for(const n of t)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(isUint8ArrayList(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...t){this.prependAll(t)}prependAll(t){let r=0;for(const n of t.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(isUint8ArrayList(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(t){const r=findBufAndOffset(this.bufs,t);return r.buf[r.index]}set(t,r){const n=findBufAndOffset(this.bufs,t);n.buf[n.index]=r}write(t,r=0){if(t instanceof Uint8Array)for(let n=0;n0;)if(t>=this.bufs[0].byteLength)t-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(t),this.length-=t;break}}}slice(t,r){const{bufs:n,length:o}=this._subList(t,r);return concat$1(n,o)}subarray(t,r){const{bufs:n,length:o}=this._subList(t,r);return n.length===1?n[0]:concat$1(n,o)}sublist(t,r){const{bufs:n,length:o}=this._subList(t,r),a=new Uint8ArrayList;return a.length=o,a.bufs=n,a}_subList(t,r){if(t=t??0,r=r??this.length,t<0&&(t=this.length+t),r<0&&(r=this.length+r),t<0||r>this.length)throw new RangeError("index is out of bounds");if(t===r)return{bufs:[],length:0};if(t===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};const n=[];let o=0;for(let a=0;a=u)continue;const g=t>=c&&tc&&r<=u;if(g&&b){if(t===c&&r===u){n.push(l);break}const x=t-c;n.push(l.subarray(x,x+(r-t)));break}if(g){if(t===0){n.push(l);continue}n.push(l.subarray(t-c));continue}if(b){if(r===u){n.push(l);break}n.push(l.subarray(0,r-c));break}n.push(l)}return{bufs:n,length:r-t}}indexOf(t,r=0){if(!isUint8ArrayList(t)&&!(t instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const n=t instanceof Uint8Array?t:t.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;const o=n.byteLength;if(o===0)throw new TypeError("search must be at least 1 byte long");const a=256,l=new Int32Array(a);for(let x=0;x=0;E--){const I=this.get(x+E);if(n[E]!==I){b=Math.max(1,E-c[I]);break}}if(b===0)return x}return-1}getInt8(t){const r=this.subarray(t,t+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(t,r){const n=allocUnsafe$2(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,t)}getInt16(t,r){const n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(t,r,n){const o=alloc(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,r,n),this.write(o,t)}getInt32(t,r){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(t,r,n){const o=alloc(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,r,n),this.write(o,t)}getBigInt64(t,r){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(t,r,n){const o=alloc(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,r,n),this.write(o,t)}getUint8(t){const r=this.subarray(t,t+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(t,r){const n=allocUnsafe$2(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,t)}getUint16(t,r){const n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(t,r,n){const o=alloc(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,r,n),this.write(o,t)}getUint32(t,r){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(t,r,n){const o=alloc(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,r,n),this.write(o,t)}getBigUint64(t,r){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(t,r,n){const o=alloc(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,r,n),this.write(o,t)}getFloat32(t,r){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(t,r,n){const o=alloc(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,r,n),this.write(o,t)}getFloat64(t,r){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(t,r,n){const o=alloc(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,r,n),this.write(o,t)}equals(t){if(t==null||!(t instanceof Uint8ArrayList)||t.bufs.length!==this.bufs.length)return!1;for(let r=0;ro+a.byteLength,0)),n.length=r,n}}function isAsyncIterable$a(e){return e[Symbol.asyncIterator]!=null}const defaultEncoder=e=>{const t=encodingLength$2(e),r=allocUnsafe$2(t);return encode$d(e,r),defaultEncoder.bytes=t,r};defaultEncoder.bytes=0;function encode$c(e,t){t=t??{};const r=t.lengthEncoder??defaultEncoder;function*n(o){const a=r(o.byteLength);a instanceof Uint8Array?yield a:yield*a,o instanceof Uint8Array?yield o:yield*o}return isAsyncIterable$a(e)?async function*(){for await(const o of e)yield*n(o)}():function*(){for(const o of e)yield*n(o)}()}encode$c.single=(e,t)=>{t=t??{};const r=t.lengthEncoder??defaultEncoder;return new Uint8ArrayList(r(e.byteLength),e)};function assign$1(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}function createError(e,t,r){if(!e||typeof e=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof t=="object"&&(r=t,t=""),t&&(r.code=t);try{return assign$1(e,r)}catch{r.message=e.message,r.stack=e.stack;const o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(e)),assign$1(new o,r)}}var errCode=createError;const MAX_LENGTH_LENGTH=8,MAX_DATA_LENGTH=1024*1024*4;var ReadMode;(function(e){e[e.LENGTH=0]="LENGTH",e[e.DATA=1]="DATA"})(ReadMode||(ReadMode={}));const defaultDecoder=e=>{const t=decode$b(e);return defaultDecoder.bytes=encodingLength$2(t),t};defaultDecoder.bytes=0;function decode$a(e,t){const r=new Uint8ArrayList;let n=ReadMode.LENGTH,o=-1;const a=t?.lengthDecoder??defaultDecoder,l=t?.maxLengthLength??MAX_LENGTH_LENGTH,c=t?.maxDataLength??MAX_DATA_LENGTH;function*u(){for(;r.byteLength>0;){if(n===ReadMode.LENGTH)try{if(o=a(r),o<0)throw errCode(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(o>c)throw errCode(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");const g=a.bytes;r.consume(g),t?.onLength!=null&&t.onLength(o),n=ReadMode.DATA}catch(g){if(g instanceof RangeError){if(r.byteLength>l)throw errCode(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw g}if(n===ReadMode.DATA){if(r.byteLength0)throw errCode(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(const g of e)r.append(g),yield*u();if(r.byteLength>0)throw errCode(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}decode$a.fromReader=(e,t)=>{let r=1;const n=async function*(){for(;;)try{const{done:a,value:l}=await e.next(r);if(a===!0)return;l!=null&&(yield l)}catch(a){if(a.code==="ERR_UNDER_READ")return{done:!0,value:null};throw a}finally{r=1}}();return decode$a(n,{...t??{},onLength:a=>{r=a}})};function pDefer(){const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}class FixedFIFO{constructor(t){Ye(this,"buffer");Ye(this,"mask");Ye(this,"top");Ye(this,"btm");Ye(this,"next");if(!(t>0)||(t-1&t)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}push(t){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){const t=this.buffer[this.btm];if(t!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}isEmpty(){return this.buffer[this.btm]===void 0}}class FIFO{constructor(t={}){Ye(this,"size");Ye(this,"hwm");Ye(this,"head");Ye(this,"tail");this.hwm=t.splitLimit??16,this.head=new FixedFIFO(this.hwm),this.tail=this.head,this.size=0}calculateSize(t){return t?.byteLength!=null?t.byteLength:1}push(t){if(t?.value!=null&&(this.size+=this.calculateSize(t.value)),!this.head.push(t)){const r=this.head;this.head=r.next=new FixedFIFO(2*this.head.buffer.length),this.head.push(t)}}shift(){let t=this.tail.shift();if(t===void 0&&this.tail.next!=null){const r=this.tail.next;this.tail.next=null,this.tail=r,t=this.tail.shift()}return t?.value!=null&&(this.size-=this.calculateSize(t.value)),t}isEmpty(){return this.head.isEmpty()}}class AbortError$6 extends Error{constructor(r,n){super(r??"The operation was aborted");Ye(this,"type");Ye(this,"code");this.type="aborted",this.code=n??"ABORT_ERR"}}function pushable(e={}){return _pushable(r=>{const n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},e)}function pushableV(e={}){return _pushable(r=>{let n;const o=[];for(;!r.isEmpty()&&(n=r.shift(),n!=null);){if(n.error!=null)throw n.error;n.done===!1&&o.push(n.value)}return n==null?{done:!0}:{done:n.done===!0,value:o}},e)}function _pushable(e,t){t=t??{};let r=t.onEnd,n=new FIFO,o,a,l,c=pDefer();const u=async()=>{try{return n.isEmpty()?l?{done:!0}:await new Promise((O,$)=>{a=D=>{a=null,n.push(D);try{O(e(n))}catch(N){$(N)}return o}}):e(n)}finally{n.isEmpty()&&queueMicrotask(()=>{c.resolve(),c=pDefer()})}},g=O=>a!=null?a(O):(n.push(O),o),b=O=>(n=new FIFO,a!=null?a({error:O}):(n.push({error:O}),o)),x=O=>{if(l)return o;if(t?.objectMode!==!0&&O?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return g({done:!1,value:O})},E=O=>l?o:(l=!0,O!=null?b(O):g({done:!0})),I=()=>(n=new FIFO,E(),{done:!0}),k=O=>(E(O),{done:!0});if(o={[Symbol.asyncIterator](){return this},next:u,return:I,throw:k,push:x,end:E,get readableLength(){return n.size},onEmpty:async O=>{const $=O?.signal;if($?.throwIfAborted(),n.isEmpty())return;let D,N;$!=null&&(D=new Promise((H,ie)=>{N=()=>{ie(new AbortError$6)},$.addEventListener("abort",N)}));try{await Promise.race([c.promise,D])}finally{N!=null&&$!=null&&$?.removeEventListener("abort",N)}}},r==null)return o;const T=o;return o={[Symbol.asyncIterator](){return this},next(){return T.next()},throw(O){return T.throw(O),r!=null&&(r(O),r=void 0),{done:!0}},return(){return T.return(),r!=null&&(r(),r=void 0),{done:!0}},push:x,end(O){return T.end(O),r!=null&&(r(O),r=void 0),o},get readableLength(){return T.readableLength}},o}class CodeError$2 extends Error{constructor(r,n){super(r);Ye(this,"code");this.code=n}}class AbortError$5 extends CodeError$2{constructor(r){super(r,"ABORT_ERR");Ye(this,"type");this.type="aborted"}}function byteStream(e){const t=pushable();e.sink(t).catch(a=>{t.end(a)}),e.sink=async a=>{for await(const l of a)t.push(l);t.end()};let r=e.source;e.source[Symbol.iterator]!=null?r=e.source[Symbol.iterator]():e.source[Symbol.asyncIterator]!=null&&(r=e.source[Symbol.asyncIterator]());const n=new Uint8ArrayList;return{read:async(a,l)=>{l?.signal?.throwIfAborted();let c;const u=new Promise((g,b)=>{c=()=>{b(new AbortError$5("Read aborted"))},l?.signal?.addEventListener("abort",c)});try{if(a==null){const{done:b,value:x}=await Promise.race([r.next(),u]);return b===!0?new Uint8ArrayList:x}for(;n.byteLength{l?.signal?.throwIfAborted(),a instanceof Uint8Array?t.push(a):t.push(a.subarray()),await t.onEmpty(l)},unwrap:()=>{const a=e.source;return e.source=async function*(){yield*n,yield*a}(),e}}}class CodeError$1 extends Error{constructor(r,n){super(r);Ye(this,"code");this.code=n}}const defaultLengthDecoder=e=>decode$b(e);defaultLengthDecoder.bytes=0;function lpStream(e,t){const r=byteStream(e);return{read:async o=>{let a=-1;const l=new Uint8ArrayList,c=t?.lengthDecoder??defaultLengthDecoder;for(;;){l.append(await r.read(1,o));try{a=c(l)}catch(u){if(u instanceof RangeError)continue;throw u}if(a>-1)break;if(t?.maxLengthLength!=null&&l.byteLength>t.maxLengthLength)throw new CodeError$1("message length length too long","ERR_MSG_LENGTH_TOO_LONG")}if(t?.maxDataLength!=null&&a>t.maxDataLength)throw new CodeError$1("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(a,o)},write:async(o,a)=>{await r.write(encode$c.single(o,t),a)},unwrap:()=>r.unwrap()}}function pair(){const e=pDefer();let t=!1;return{sink:async r=>{if(t)throw new Error("already piped");t=!0,e.resolve(r)},source:async function*(){yield*await e.promise}()}}function duplexPair(){const e=pair(),t=pair();return[{source:e.source,sink:t.sink},{source:t.source,sink:e.sink}]}function isAsyncIterable$9(e){return e[Symbol.asyncIterator]!=null}function merge$1(...e){const t=[];for(const r of e)isAsyncIterable$9(r)||t.push(r);return t.length===e.length?function*(){for(const r of t)yield*r}():async function*(){const r=pushable({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(e.map(async n=>{for await(const o of n)r.push(o)})),r.end()}catch(n){r.end(n)}}),yield*r}()}function pipe(e,...t){if(e==null)throw new Error("Empty pipeline");if(isDuplex(e)){const n=e;e=()=>n.source}else if(isIterable(e)||isAsyncIterable$8(e)){const n=e;e=()=>n}const r=[e,...t];if(r.length>1&&isDuplex(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let t;for(;e.length>0;)t=e.shift()(t);return t},isAsyncIterable$8=e=>e?.[Symbol.asyncIterator]!=null,isIterable=e=>e?.[Symbol.iterator]!=null,isDuplex=e=>e==null?!1:e.sink!=null&&e.source!=null,duplexPipelineFn=e=>t=>{const r=e.sink(t);if(r?.then!=null){const n=pushable({objectMode:!0});r.then(()=>{n.end()},l=>{n.end(l)});let o;const a=e.source;if(isAsyncIterable$8(a))o=async function*(){yield*a,n.end()};else if(isIterable(a))o=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return merge$1(n,o())}return e.source},NOISE_MSG_MAX_LENGTH_BYTES=65535,NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=NOISE_MSG_MAX_LENGTH_BYTES-16,DUMP_SESSION_KEYS=Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS);/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const u8a$2=e=>e instanceof Uint8Array,u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),createView$1=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE$1)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes$2(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function toBytes$2(e){if(typeof e=="string"&&(e=utf8ToBytes$2(e)),!u8a$2(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}const isPlainObject$1=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function checkOpts(e,t){if(t!==void 0&&(typeof t!="object"||!isPlainObject$1(t)))throw new Error("options must be object or undefined");return Object.assign(e,t)}function ensureBytes$1(e,t){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof t=="number"&&e.length!==t)throw new Error(`Uint8Array length ${t} expected`)}function equalBytes$1(e,t){if(e.length!==t.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n>o&a),c=Number(r&a),u=n?4:0,g=n?0:4;e.setUint32(t+u,l,n),e.setUint32(t+g,c,n)}function number$3(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function bool(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function bytes$1(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function hash$2(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("hash must be wrapped by utils.wrapConstructor");number$3(e.outputLen),number$3(e.blockLen)}function exists$1(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function output$1(e,t){bytes$1(e);const r=t.outputLen;if(e.lengthe[t++]&255|(e[t++]&255)<<8;class Poly1305{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=toBytes$2(t),ensureBytes$1(t,32);const r=u8to16(t,0),n=u8to16(t,2),o=u8to16(t,4),a=u8to16(t,6),l=u8to16(t,8),c=u8to16(t,10),u=u8to16(t,12),g=u8to16(t,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|o<<6)&7939,this.r[3]=(o>>>7|a<<9)&8191,this.r[4]=(a>>>4|l<<12)&255,this.r[5]=l>>>1&8190,this.r[6]=(l>>>14|c<<2)&8191,this.r[7]=(c>>>11|u<<5)&8065,this.r[8]=(u>>>8|g<<8)&8191,this.r[9]=g>>>5&127;for(let b=0;b<8;b++)this.pad[b]=u8to16(t,16+2*b)}process(t,r,n=!1){const o=n?0:2048,{h:a,r:l}=this,c=l[0],u=l[1],g=l[2],b=l[3],x=l[4],E=l[5],I=l[6],k=l[7],T=l[8],O=l[9],$=u8to16(t,r+0),D=u8to16(t,r+2),N=u8to16(t,r+4),H=u8to16(t,r+6),ie=u8to16(t,r+8),ue=u8to16(t,r+10),de=u8to16(t,r+12),le=u8to16(t,r+14);let ce=a[0]+($&8191),ve=a[1]+(($>>>13|D<<3)&8191),ee=a[2]+((D>>>10|N<<6)&8191),he=a[3]+((N>>>7|H<<9)&8191),ne=a[4]+((H>>>4|ie<<12)&8191),xe=a[5]+(ie>>>1&8191),te=a[6]+((ie>>>14|ue<<2)&8191),ae=a[7]+((ue>>>11|de<<5)&8191),ge=a[8]+((de>>>8|le<<8)&8191),se=a[9]+(le>>>5|o),Se=0,Pe=Se+ce*c+ve*(5*O)+ee*(5*T)+he*(5*k)+ne*(5*I);Se=Pe>>>13,Pe&=8191,Pe+=xe*(5*E)+te*(5*x)+ae*(5*b)+ge*(5*g)+se*(5*u),Se+=Pe>>>13,Pe&=8191;let Ue=Se+ce*u+ve*c+ee*(5*O)+he*(5*T)+ne*(5*k);Se=Ue>>>13,Ue&=8191,Ue+=xe*(5*I)+te*(5*E)+ae*(5*x)+ge*(5*b)+se*(5*g),Se+=Ue>>>13,Ue&=8191;let Be=Se+ce*g+ve*u+ee*c+he*(5*O)+ne*(5*T);Se=Be>>>13,Be&=8191,Be+=xe*(5*k)+te*(5*I)+ae*(5*E)+ge*(5*x)+se*(5*b),Se+=Be>>>13,Be&=8191;let fe=Se+ce*b+ve*g+ee*u+he*c+ne*(5*O);Se=fe>>>13,fe&=8191,fe+=xe*(5*T)+te*(5*k)+ae*(5*I)+ge*(5*E)+se*(5*x),Se+=fe>>>13,fe&=8191;let ye=Se+ce*x+ve*b+ee*g+he*u+ne*c;Se=ye>>>13,ye&=8191,ye+=xe*(5*O)+te*(5*T)+ae*(5*k)+ge*(5*I)+se*(5*E),Se+=ye>>>13,ye&=8191;let Ce=Se+ce*E+ve*x+ee*b+he*g+ne*u;Se=Ce>>>13,Ce&=8191,Ce+=xe*c+te*(5*O)+ae*(5*T)+ge*(5*k)+se*(5*I),Se+=Ce>>>13,Ce&=8191;let Le=Se+ce*I+ve*E+ee*x+he*b+ne*g;Se=Le>>>13,Le&=8191,Le+=xe*u+te*c+ae*(5*O)+ge*(5*T)+se*(5*k),Se+=Le>>>13,Le&=8191;let Fe=Se+ce*k+ve*I+ee*E+he*x+ne*b;Se=Fe>>>13,Fe&=8191,Fe+=xe*g+te*u+ae*c+ge*(5*O)+se*(5*T),Se+=Fe>>>13,Fe&=8191;let Oe=Se+ce*T+ve*k+ee*I+he*E+ne*x;Se=Oe>>>13,Oe&=8191,Oe+=xe*b+te*g+ae*u+ge*c+se*(5*O),Se+=Oe>>>13,Oe&=8191;let be=Se+ce*O+ve*T+ee*k+he*I+ne*E;Se=be>>>13,be&=8191,be+=xe*x+te*b+ae*g+ge*u+se*c,Se+=be>>>13,be&=8191,Se=(Se<<2)+Se|0,Se=Se+Pe|0,Pe=Se&8191,Se=Se>>>13,Ue+=Se,a[0]=Pe,a[1]=Ue,a[2]=Be,a[3]=fe,a[4]=ye,a[5]=Ce,a[6]=Le,a[7]=Fe,a[8]=Oe,a[9]=be}finalize(){const{h:t,pad:r}=this,n=new Uint16Array(10);let o=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=o,o=t[c]>>>13,t[c]&=8191;t[0]+=o*5,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,n[0]=t[0]+5,o=n[0]>>>13,n[0]&=8191;for(let c=1;c<10;c++)n[c]=t[c]+o,o=n[c]>>>13,n[c]&=8191;n[9]-=1<<13;let a=(o^1)-1;for(let c=0;c<10;c++)n[c]&=a;a=~a;for(let c=0;c<10;c++)t[c]=t[c]&a|n[c];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let l=t[0]+r[0];t[0]=l&65535;for(let c=1;c<8;c++)l=(t[c]+r[c]|0)+(l>>>16)|0,t[c]=l&65535}update(t){assert.exists(this);const{buffer:r,blockLen:n}=this;t=toBytes$2(t);const o=t.length;for(let a=0;a>>0,t[a++]=n[l]>>>8;return t}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}}function wrapConstructorWithKey(e){const t=(n,o)=>e(o).update(toBytes$2(n)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}const poly1305=wrapConstructorWithKey(e=>new Poly1305(e)),sigma16=utf8ToBytes$2("expand 16-byte k"),sigma32=utf8ToBytes$2("expand 32-byte k"),sigma16_32=u32(sigma16),sigma32_32=u32(sigma32),isAligned32=e=>!(e.byteOffset%4),salsaBasic=e=>{const{core:t,rounds:r,counterRight:n,counterLen:o,allow128bitKeys:a,extendNonceFn:l,blockLen:c}=checkOpts({rounds:20,counterRight:!1,counterLen:8,allow128bitKeys:!0,blockLen:64},e);assert.number(o),assert.number(r),assert.number(c),assert.bool(n),assert.bool(a);const u=c/4;if(c%4!==0)throw new Error("Salsa/ChaCha: blockLen must be aligned to 4 bytes");return(g,b,x,E,I=0)=>{if(assert.bytes(g),assert.bytes(b),assert.bytes(x),E||(E=new Uint8Array(x.length)),assert.bytes(E),assert.number(I),I<0||I>=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");if(E.length=2**32-1)throw new Error("Salsa/ChaCha: counter overflow");const ee=Math.min(c,le-ce);if(ee===c&&de&&ue){const he=ce/4;if(ce%4!==0)throw new Error("Salsa/ChaCha: invalid block position");for(let ne=0;nee<>>32-t;function chachaCore(e,t,r,n,o,a=20){let l=e[0],c=e[1],u=e[2],g=e[3],b=t[0],x=t[1],E=t[2],I=t[3],k=t[4],T=t[5],O=t[6],$=t[7],D=o,N=r[0],H=r[1],ie=r[2],ue=l,de=c,le=u,ce=g,ve=b,ee=x,he=E,ne=I,xe=k,te=T,ae=O,ge=$,se=D,Se=N,Pe=H,Ue=ie;for(let fe=0;fe{e.update(t);const r=t.length%16;r&&e.update(ZERO.subarray(r))},computeTag=(e,t,r,n,o)=>{const a=e(t,r,new Uint8Array(32)),l=poly1305.create(a);o&&updatePadded(l,o),updatePadded(l,n);const c=new Uint8Array(16),u=createView$1(c);setBigUint64$1(u,0,BigInt(o?o.length:0),!0),setBigUint64$1(u,8,BigInt(n.length),!0),l.update(c);const g=l.digest();return a.fill(0),g},_poly1305_aead=e=>(t,r,n)=>(ensureBytes$1(t,32),ensureBytes$1(r),{tagLength:16,encrypt:(a,l)=>{const c=a.length,u=c+16;l?ensureBytes$1(l,u):l=new Uint8Array(u),e(t,r,a,l,1);const g=computeTag(e,t,r,l.subarray(0,-16),n);return l.set(g,c),l},decrypt:(a,l)=>{const c=a.length,u=c-16;if(c<16)throw new Error(`encrypted data must be at least ${16} bytes`);l?ensureBytes$1(l,u):l=new Uint8Array(u);const g=a.subarray(0,-16),b=a.subarray(-16),x=computeTag(e,t,r,g,n);if(!equalBytes$1(b,x))throw new Error("invalid tag");return e(t,r,g,l,1),l}}),chacha20poly1305=_poly1305_aead(chacha20);function number$2(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function bytes(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function hash$1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$2(e.outputLen),number$2(e.blockLen)}function exists(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function output(e,t){bytes(e);const r=t.outputLen;if(e.lengthe instanceof Uint8Array,createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),rotr=(e,t)=>e<<32-t|e>>>t,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes$1(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function toBytes$1(e){if(typeof e=="string"&&(e=utf8ToBytes$1(e)),!u8a$1(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function concatBytes$1(...e){const t=new Uint8Array(e.reduce((n,o)=>n+o.length,0));let r=0;return e.forEach(n=>{if(!u8a$1(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(e){const t=n=>e().update(toBytes$1(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function randomBytes$1(e=32){if(crypto$3&&typeof crypto$3.getRandomValues=="function")return crypto$3.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function setBigUint64(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),a=BigInt(4294967295),l=Number(r>>o&a),c=Number(r&a),u=n?4:0,g=n?0:4;e.setUint32(t+u,l,n),e.setUint32(t+g,c,n)}class SHA2 extends Hash{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=createView(this.buffer)}update(t){exists(this);const{view:r,buffer:n,blockLen:o}=this;t=toBytes$1(t);const a=t.length;for(let l=0;lo-l&&(this.process(n,0),l=0);for(let x=l;xb.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x>_32n&U32_MASK64)}:{h:Number(e>>_32n&U32_MASK64)|0,l:Number(e&U32_MASK64)|0}}function split(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<<_32n|BigInt(t>>>0),shrSH=(e,t,r)=>e>>>r,shrSL=(e,t,r)=>e<<32-r|t>>>r,rotrSH=(e,t,r)=>e>>>r|t<<32-r,rotrSL=(e,t,r)=>e<<32-r|t>>>r,rotrBH=(e,t,r)=>e<<64-r|t>>>r-32,rotrBL=(e,t,r)=>e>>>r-32|t<<64-r,rotr32H=(e,t)=>t,rotr32L=(e,t)=>e,rotlSH=(e,t,r)=>e<>>32-r,rotlSL=(e,t,r)=>t<>>32-r,rotlBH=(e,t,r)=>t<>>64-r,rotlBL=(e,t,r)=>e<>>64-r;function add(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const add3L=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5L=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),add5H=(e,t,r,n,o,a)=>t+r+n+o+a+(e/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},u64$1=u64,[SHA512_Kh,SHA512_Kl]=(()=>u64$1.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:a,Cl:l,Dh:c,Dl:u,Eh:g,El:b,Fh:x,Fl:E,Gh:I,Gl:k,Hh:T,Hl:O}=this;return[t,r,n,o,a,l,c,u,g,b,x,E,I,k,T,O]}set(t,r,n,o,a,l,c,u,g,b,x,E,I,k,T,O){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=a|0,this.Cl=l|0,this.Dh=c|0,this.Dl=u|0,this.Eh=g|0,this.El=b|0,this.Fh=x|0,this.Fl=E|0,this.Gh=I|0,this.Gl=k|0,this.Hh=T|0,this.Hl=O|0}process(t,r){for(let N=0;N<16;N++,r+=4)SHA512_W_H[N]=t.getUint32(r),SHA512_W_L[N]=t.getUint32(r+=4);for(let N=16;N<80;N++){const H=SHA512_W_H[N-15]|0,ie=SHA512_W_L[N-15]|0,ue=u64$1.rotrSH(H,ie,1)^u64$1.rotrSH(H,ie,8)^u64$1.shrSH(H,ie,7),de=u64$1.rotrSL(H,ie,1)^u64$1.rotrSL(H,ie,8)^u64$1.shrSL(H,ie,7),le=SHA512_W_H[N-2]|0,ce=SHA512_W_L[N-2]|0,ve=u64$1.rotrSH(le,ce,19)^u64$1.rotrBH(le,ce,61)^u64$1.shrSH(le,ce,6),ee=u64$1.rotrSL(le,ce,19)^u64$1.rotrBL(le,ce,61)^u64$1.shrSL(le,ce,6),he=u64$1.add4L(de,ee,SHA512_W_L[N-7],SHA512_W_L[N-16]),ne=u64$1.add4H(he,ue,ve,SHA512_W_H[N-7],SHA512_W_H[N-16]);SHA512_W_H[N]=ne|0,SHA512_W_L[N]=he|0}let{Ah:n,Al:o,Bh:a,Bl:l,Ch:c,Cl:u,Dh:g,Dl:b,Eh:x,El:E,Fh:I,Fl:k,Gh:T,Gl:O,Hh:$,Hl:D}=this;for(let N=0;N<80;N++){const H=u64$1.rotrSH(x,E,14)^u64$1.rotrSH(x,E,18)^u64$1.rotrBH(x,E,41),ie=u64$1.rotrSL(x,E,14)^u64$1.rotrSL(x,E,18)^u64$1.rotrBL(x,E,41),ue=x&I^~x&T,de=E&k^~E&O,le=u64$1.add5L(D,ie,de,SHA512_Kl[N],SHA512_W_L[N]),ce=u64$1.add5H(le,$,H,ue,SHA512_Kh[N],SHA512_W_H[N]),ve=le|0,ee=u64$1.rotrSH(n,o,28)^u64$1.rotrBH(n,o,34)^u64$1.rotrBH(n,o,39),he=u64$1.rotrSL(n,o,28)^u64$1.rotrBL(n,o,34)^u64$1.rotrBL(n,o,39),ne=n&a^n&c^a&c,xe=o&l^o&u^l&u;$=T|0,D=O|0,T=I|0,O=k|0,I=x|0,k=E|0,{h:x,l:E}=u64$1.add(g|0,b|0,ce|0,ve|0),g=c|0,b=u|0,c=a|0,u=l|0,a=n|0,l=o|0;const te=u64$1.add3L(ve,he,xe);n=u64$1.add3H(te,ce,ee,ne),o=te|0}({h:n,l:o}=u64$1.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:a,l}=u64$1.add(this.Bh|0,this.Bl|0,a|0,l|0),{h:c,l:u}=u64$1.add(this.Ch|0,this.Cl|0,c|0,u|0),{h:g,l:b}=u64$1.add(this.Dh|0,this.Dl|0,g|0,b|0),{h:x,l:E}=u64$1.add(this.Eh|0,this.El|0,x|0,E|0),{h:I,l:k}=u64$1.add(this.Fh|0,this.Fl|0,I|0,k|0),{h:T,l:O}=u64$1.add(this.Gh|0,this.Gl|0,T|0,O|0),{h:$,l:D}=u64$1.add(this.Hh|0,this.Hl|0,$|0,D|0),this.set(n,o,a,l,c,u,g,b,x,E,I,k,T,O,$,D)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512$3=wrapConstructor(()=>new SHA512);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$7=BigInt(1),_2n$4=BigInt(2),u8a=e=>e instanceof Uint8Array,hexes=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bytesToHex(e){if(!u8a(e))throw new Error("Uint8Array expected");let t="";for(let r=0;rn+o.length,0));let r=0;return e.forEach(n=>{if(!u8a(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}function equalBytes(e,t){if(e.length!==t.length)return!1;for(let r=0;r_0n$5;e>>=_1n$7,t+=1);return t}function bitGet(e,t){return e>>BigInt(t)&_1n$7}const bitSet=(e,t,r)=>e|(r?_1n$7:_0n$5)<(_2n$4<new Uint8Array(e),u8fr=e=>Uint8Array.from(e);function createHmacDrbg(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=u8n(e),o=u8n(e),a=0;const l=()=>{n.fill(1),o.fill(0),a=0},c=(...x)=>r(o,n,...x),u=(x=u8n())=>{o=c(u8fr([0]),x),n=c(),x.length!==0&&(o=c(u8fr([1]),x),n=c())},g=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let x=0;const E=[];for(;x{l(),u(x);let I;for(;!(I=E(g()));)u();return l(),I}}const validatorFns={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function validateObject(e,t,r={}){const n=(o,a,l)=>{const c=validatorFns[a];if(typeof c!="function")throw new Error(`Invalid validator "${a}", expected function`);const u=e[o];if(!(l&&u===void 0)&&!c(u,e))throw new Error(`Invalid param ${String(o)}=${u} (${typeof u}), expected ${a}`)};for(const[o,a]of Object.entries(t))n(o,a,!1);for(const[o,a]of Object.entries(r))n(o,a,!0);return e}const ut=Object.freeze(Object.defineProperty({__proto__:null,bytesToHex,numberToHexUnpadded,hexToNumber,hexToBytes,bytesToNumberBE,bytesToNumberLE,numberToBytesBE,numberToBytesLE,numberToVarBytesBE,ensureBytes,concatBytes,equalBytes,utf8ToBytes,bitLen,bitGet,bitSet,bitMask,createHmacDrbg,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$6=BigInt(1),_2n$3=BigInt(2),_3n$1=BigInt(3),_4n=BigInt(4),_5n$1=BigInt(5),_8n$1=BigInt(8);BigInt(9);BigInt(16);function mod(e,t){const r=e%t;return r>=_0n$4?r:t+r}function pow(e,t,r){if(r<=_0n$4||t<_0n$4)throw new Error("Expected power/modulo > 0");if(r===_1n$6)return _0n$4;let n=_1n$6;for(;t>_0n$4;)t&_1n$6&&(n=n*e%r),e=e*e%r,t>>=_1n$6;return n}function pow2(e,t,r){let n=e;for(;t-- >_0n$4;)n*=n,n%=r;return n}function invert(e,t){if(e===_0n$4||t<=_0n$4)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=mod(e,t),n=t,o=_0n$4,a=_1n$6;for(;r!==_0n$4;){const c=n/r,u=n%r,g=o-a*c;n=r,r=u,o=a,a=g}if(n!==_1n$6)throw new Error("invert: does not exist");return mod(o,t)}function tonelliShanks(e){const t=(e-_1n$6)/_2n$3;let r,n,o;for(r=e-_1n$6,n=0;r%_2n$3===_0n$4;r/=_2n$3,n++);for(o=_2n$3;o(mod(e,t)&_1n$6)===_1n$6,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=FIELD_FIELDS.reduce((n,o)=>(n[o]="function",n),t);return validateObject(e,r)}function FpPow(e,t,r){if(r<_0n$4)throw new Error("Expected power > 0");if(r===_0n$4)return e.ONE;if(r===_1n$6)return t;let n=e.ONE,o=t;for(;r>_0n$4;)r&_1n$6&&(n=e.mul(n,o)),o=e.sqr(o),r>>=_1n$6;return n}function FpInvertBatch(e,t){const r=new Array(t.length),n=t.reduce((a,l,c)=>e.is0(l)?a:(r[c]=a,e.mul(a,l)),e.ONE),o=e.inv(n);return t.reduceRight((a,l,c)=>e.is0(l)?a:(r[c]=e.mul(a,r[c]),e.mul(a,l)),o),r}function nLength(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Field(e,t,r=!1,n={}){if(e<=_0n$4)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:a}=nLength(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=FpSqrt(e),c=Object.freeze({ORDER:e,BITS:o,BYTES:a,MASK:bitMask(o),ZERO:_0n$4,ONE:_1n$6,create:u=>mod(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return _0n$4<=u&&uu===_0n$4,isOdd:u=>(u&_1n$6)===_1n$6,neg:u=>mod(-u,e),eql:(u,g)=>u===g,sqr:u=>mod(u*u,e),add:(u,g)=>mod(u+g,e),sub:(u,g)=>mod(u-g,e),mul:(u,g)=>mod(u*g,e),pow:(u,g)=>FpPow(c,u,g),div:(u,g)=>mod(u*invert(g,e),e),sqrN:u=>u*u,addN:(u,g)=>u+g,subN:(u,g)=>u-g,mulN:(u,g)=>u*g,inv:u=>invert(u,e),sqrt:n.sqrt||(u=>l(c,u)),invertBatch:u=>FpInvertBatch(c,u),cmov:(u,g,b)=>b?g:u,toBytes:u=>r?numberToBytesLE(u,a):numberToBytesBE(u,a),fromBytes:u=>{if(u.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${u.length}`);return r?bytesToNumberLE(u):bytesToNumberBE(u)}});return Object.freeze(c)}function FpSqrtEven(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function getFieldBytesLength(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function getMinHashLength(e){const t=getFieldBytesLength(e);return t+Math.ceil(t/2)}function mapHashToField(e,t,r=!1){const n=e.length,o=getFieldBytesLength(t),a=getMinHashLength(t);if(n<16||n1024)throw new Error(`expected ${a}-1024 bytes of input, got ${n}`);const l=r?bytesToNumberBE(e):bytesToNumberLE(e),c=mod(l,t-_1n$6)+_1n$6;return r?numberToBytesLE(c,o):numberToBytesBE(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$3=BigInt(0),_1n$5=BigInt(1);function wNAF(e,t){const r=(o,a)=>{const l=a.negate();return o?l:a},n=o=>{const a=Math.ceil(t/o)+1,l=2**(o-1);return{windows:a,windowSize:l}};return{constTimeNegate:r,unsafeLadder(o,a){let l=e.ZERO,c=o;for(;a>_0n$3;)a&_1n$5&&(l=l.add(c)),c=c.double(),a>>=_1n$5;return l},precomputeWindow(o,a){const{windows:l,windowSize:c}=n(a),u=[];let g=o,b=g;for(let x=0;x>=I,O>u&&(O-=E,l+=_1n$5);const $=T,D=T+Math.abs(O)-1,N=k%2!==0,H=O<0;O===0?b=b.add(r(N,a[$])):g=g.add(r(H,a[D]))}return{p:g,f:b}},wNAFCached(o,a,l,c){const u=o._WINDOW_SIZE||1;let g=a.get(o);return g||(g=this.precomputeWindow(o,u),u!==1&&a.set(o,c(g))),this.wNAF(u,g,l)}}}function validateBasic(e){return validateField(e.Fp),validateObject(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$4=BigInt(1),_2n$2=BigInt(2),_8n=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$2(e){const t=validateBasic(e);return validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function twistedEdwards(e){const t=validateOpts$2(e),{Fp:r,n,prehash:o,hash:a,randomBytes:l,nByteLength:c,h:u}=t,g=_2n$2<{try{return{isValid:!0,value:r.sqrt(se*r.inv(Se))}}catch{return{isValid:!1,value:_0n$2}}}),E=t.adjustScalarBytes||(se=>se),I=t.domain||((se,Se,Pe)=>{if(Se.length||Pe)throw new Error("Contexts/pre-hash are not supported");return se}),k=se=>typeof se=="bigint"&&_0n$2k(se)&&k(Se)&&sese===_0n$2||T(se,g);function $(se,Se){if(T(se,Se))return se;throw new Error(`Expected valid scalar < ${Se}, got ${typeof se} ${se}`)}function D(se){return se===_0n$2?se:$(se,n)}const N=new Map;function H(se){if(!(se instanceof ie))throw new Error("ExtendedPoint expected")}class ie{constructor(Se,Pe,Ue,Be){if(this.ex=Se,this.ey=Pe,this.ez=Ue,this.et=Be,!O(Se))throw new Error("x required");if(!O(Pe))throw new Error("y required");if(!O(Ue))throw new Error("z required");if(!O(Be))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Se){if(Se instanceof ie)throw new Error("extended point not allowed");const{x:Pe,y:Ue}=Se||{};if(!O(Pe)||!O(Ue))throw new Error("invalid affine point");return new ie(Pe,Ue,_1n$4,b(Pe*Ue))}static normalizeZ(Se){const Pe=r.invertBatch(Se.map(Ue=>Ue.ez));return Se.map((Ue,Be)=>Ue.toAffine(Pe[Be])).map(ie.fromAffine)}_setWindowSize(Se){this._WINDOW_SIZE=Se,N.delete(this)}assertValidity(){const{a:Se,d:Pe}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:Ue,ey:Be,ez:fe,et:ye}=this,Ce=b(Ue*Ue),Le=b(Be*Be),Fe=b(fe*fe),Oe=b(Fe*Fe),be=b(Ce*Se),Re=b(Fe*b(be+Le)),Ie=b(Oe+b(Pe*b(Ce*Le)));if(Re!==Ie)throw new Error("bad point: equation left != right (1)");const we=b(Ue*Be),oe=b(fe*ye);if(we!==oe)throw new Error("bad point: equation left != right (2)")}equals(Se){H(Se);const{ex:Pe,ey:Ue,ez:Be}=this,{ex:fe,ey:ye,ez:Ce}=Se,Le=b(Pe*Ce),Fe=b(fe*Be),Oe=b(Ue*Ce),be=b(ye*Be);return Le===Fe&&Oe===be}is0(){return this.equals(ie.ZERO)}negate(){return new ie(b(-this.ex),this.ey,this.ez,b(-this.et))}double(){const{a:Se}=t,{ex:Pe,ey:Ue,ez:Be}=this,fe=b(Pe*Pe),ye=b(Ue*Ue),Ce=b(_2n$2*b(Be*Be)),Le=b(Se*fe),Fe=Pe+Ue,Oe=b(b(Fe*Fe)-fe-ye),be=Le+ye,Re=be-Ce,Ie=Le-ye,we=b(Oe*Re),oe=b(be*Ie),pe=b(Oe*Ie),ke=b(Re*be);return new ie(we,oe,ke,pe)}add(Se){H(Se);const{a:Pe,d:Ue}=t,{ex:Be,ey:fe,ez:ye,et:Ce}=this,{ex:Le,ey:Fe,ez:Oe,et:be}=Se;if(Pe===BigInt(-1)){const Ve=b((fe-Be)*(Fe+Le)),Ae=b((fe+Be)*(Fe-Le)),He=b(Ae-Ve);if(He===_0n$2)return this.double();const Ge=b(ye*_2n$2*be),Ze=b(Ce*_2n$2*Oe),$e=Ze+Ge,me=Ae+Ve,Ee=Ze-Ge,je=b($e*He),nt=b(me*Ee),ot=b($e*Ee),dt=b(He*me);return new ie(je,nt,dt,ot)}const Re=b(Be*Le),Ie=b(fe*Fe),we=b(Ce*Ue*be),oe=b(ye*Oe),pe=b((Be+fe)*(Le+Fe)-Re-Ie),ke=oe-we,Ne=oe+we,ze=b(Ie-Pe*Re),Xe=b(pe*ke),Je=b(Ne*ze),rt=b(pe*ze),qe=b(ke*Ne);return new ie(Xe,Je,qe,rt)}subtract(Se){return this.add(Se.negate())}wNAF(Se){return le.wNAFCached(this,N,Se,ie.normalizeZ)}multiply(Se){const{p:Pe,f:Ue}=this.wNAF($(Se,n));return ie.normalizeZ([Pe,Ue])[0]}multiplyUnsafe(Se){let Pe=D(Se);return Pe===_0n$2?de:this.equals(de)||Pe===_1n$4?this:this.equals(ue)?this.wNAF(Pe).p:le.unsafeLadder(this,Pe)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return le.unsafeLadder(this,n).is0()}toAffine(Se){const{ex:Pe,ey:Ue,ez:Be}=this,fe=this.is0();Se==null&&(Se=fe?_8n:r.inv(Be));const ye=b(Pe*Se),Ce=b(Ue*Se),Le=b(Be*Se);if(fe)return{x:_0n$2,y:_1n$4};if(Le!==_1n$4)throw new Error("invZ was invalid");return{x:ye,y:Ce}}clearCofactor(){const{h:Se}=t;return Se===_1n$4?this:this.multiplyUnsafe(Se)}static fromHex(Se,Pe=!1){const{d:Ue,a:Be}=t,fe=r.BYTES;Se=ensureBytes("pointHex",Se,fe);const ye=Se.slice(),Ce=Se[fe-1];ye[fe-1]=Ce&-129;const Le=bytesToNumberLE(ye);Le===_0n$2||(Pe?$(Le,g):$(Le,r.ORDER));const Fe=b(Le*Le),Oe=b(Fe-_1n$4),be=b(Ue*Fe-Be);let{isValid:Re,value:Ie}=x(Oe,be);if(!Re)throw new Error("Point.fromHex: invalid y coordinate");const we=(Ie&_1n$4)===_1n$4,oe=(Ce&128)!==0;if(!Pe&&Ie===_0n$2&&oe)throw new Error("Point.fromHex: x=0 and x_0=1");return oe!==we&&(Ie=b(-Ie)),ie.fromAffine({x:Ie,y:Le})}static fromPrivateKey(Se){return ee(Se).point}toRawBytes(){const{x:Se,y:Pe}=this.toAffine(),Ue=numberToBytesLE(Pe,r.BYTES);return Ue[Ue.length-1]|=Se&_1n$4?128:0,Ue}toHex(){return bytesToHex(this.toRawBytes())}}ie.BASE=new ie(t.Gx,t.Gy,_1n$4,b(t.Gx*t.Gy)),ie.ZERO=new ie(_0n$2,_1n$4,_1n$4,_0n$2);const{BASE:ue,ZERO:de}=ie,le=wNAF(ie,c*8);function ce(se){return mod(se,n)}function ve(se){return ce(bytesToNumberLE(se))}function ee(se){const Se=c;se=ensureBytes("private key",se,Se);const Pe=ensureBytes("hashed private key",a(se),2*Se),Ue=E(Pe.slice(0,Se)),Be=Pe.slice(Se,2*Se),fe=ve(Ue),ye=ue.multiply(fe),Ce=ye.toRawBytes();return{head:Ue,prefix:Be,scalar:fe,point:ye,pointBytes:Ce}}function he(se){return ee(se).pointBytes}function ne(se=new Uint8Array,...Se){const Pe=concatBytes(...Se);return ve(a(I(Pe,ensureBytes("context",se),!!o)))}function xe(se,Se,Pe={}){se=ensureBytes("message",se),o&&(se=o(se));const{prefix:Ue,scalar:Be,pointBytes:fe}=ee(Se),ye=ne(Pe.context,Ue,se),Ce=ue.multiply(ye).toRawBytes(),Le=ne(Pe.context,Ce,fe,se),Fe=ce(ye+Le*Be);D(Fe);const Oe=concatBytes(Ce,numberToBytesLE(Fe,r.BYTES));return ensureBytes("result",Oe,c*2)}const te=VERIFY_DEFAULT;function ae(se,Se,Pe,Ue=te){const{context:Be,zip215:fe}=Ue,ye=r.BYTES;se=ensureBytes("signature",se,2*ye),Se=ensureBytes("message",Se),o&&(Se=o(Se));const Ce=bytesToNumberLE(se.slice(ye,2*ye));let Le,Fe,Oe;try{Le=ie.fromHex(Pe,fe),Fe=ie.fromHex(se.slice(0,ye),fe),Oe=ue.multiplyUnsafe(Ce)}catch{return!1}if(!fe&&Le.isSmallOrder())return!1;const be=ne(Be,Fe.toRawBytes(),Le.toRawBytes(),Se);return Fe.add(Le.multiplyUnsafe(be)).subtract(Oe).clearCofactor().equals(ie.ZERO)}return ue._setWindowSize(8),{CURVE:t,getPublicKey:he,sign:xe,verify:ae,ExtendedPoint:ie,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>l(r.BYTES),precompute(se=8,Se=ie.BASE){return Se._setWindowSize(se),Se.multiply(BigInt(3)),Se}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$3=BigInt(1);function validateOpts$1(e){return validateObject(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function montgomery(e){const t=validateOpts$1(e),{P:r}=t,n=N=>mod(N,r),o=t.montgomeryBits,a=Math.ceil(o/8),l=t.nByteLength,c=t.adjustScalarBytes||(N=>N),u=t.powPminus2||(N=>pow(N,r-BigInt(2),r));function g(N,H,ie){const ue=n(N*(H-ie));return H=n(H-ue),ie=n(ie+ue),[H,ie]}function b(N){if(typeof N=="bigint"&&_0n$1<=N&&N=_0n$1;te--){const ae=ue>>te&_1n$3;he^=ae,ne=g(he,le,ve),le=ne[0],ve=ne[1],ne=g(he,ce,ee),ce=ne[0],ee=ne[1],he=ae;const ge=le+ce,se=n(ge*ge),Se=le-ce,Pe=n(Se*Se),Ue=se-Pe,Be=ve+ee,fe=ve-ee,ye=n(fe*ge),Ce=n(Be*Se),Le=ye+Ce,Fe=ye-Ce;ve=n(Le*Le),ee=n(de*n(Fe*Fe)),le=n(se*Pe),ce=n(Ue*(se+n(x*Ue)))}ne=g(he,le,ve),le=ne[0],ve=ne[1],ne=g(he,ce,ee),ce=ne[0],ee=ne[1];const xe=u(ce);return n(le*xe)}function I(N){return numberToBytesLE(n(N),a)}function k(N){const H=ensureBytes("u coordinate",N,a);return l===a&&(H[l-1]&=127),bytesToNumberLE(H)}function T(N){const H=ensureBytes("scalar",N);if(H.length!==a&&H.length!==l)throw new Error(`Expected ${a} or ${l} bytes, got ${H.length}`);return bytesToNumberLE(c(H))}function O(N,H){const ie=k(H),ue=T(N),de=E(ie,ue);if(de===_0n$1)throw new Error("Invalid private or public key received");return I(de)}const $=I(t.Gu);function D(N){return O(N,$)}return{scalarMult:O,scalarMultBase:D,getSharedSecret:(N,H)=>O(N,H),getPublicKey:N=>D(N),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:$}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const _1n$2=BigInt(1),_2n$1=BigInt(2),_5n=BigInt(5),_10n=BigInt(10),_20n=BigInt(20),_40n=BigInt(40),_80n=BigInt(80);function ed25519_pow_2_252_3(e){const t=ED25519_P,n=e*e%t*e%t,o=pow2(n,_2n$1,t)*n%t,a=pow2(o,_1n$2,t)*e%t,l=pow2(a,_5n,t)*a%t,c=pow2(l,_10n,t)*l%t,u=pow2(c,_20n,t)*c%t,g=pow2(u,_40n,t)*u%t,b=pow2(g,_80n,t)*g%t,x=pow2(b,_80n,t)*g%t,E=pow2(x,_10n,t)*l%t;return{pow_p_5_8:pow2(E,_2n$1,t)*e%t,b2:n}}function adjustScalarBytes(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function uvRatio(e,t){const r=ED25519_P,n=mod(t*t*t,r),o=mod(n*n*t,r),a=ed25519_pow_2_252_3(e*o).pow_p_5_8;let l=mod(e*n*a,r);const c=mod(t*l*l,r),u=l,g=mod(l*ED25519_SQRT_M1,r),b=c===e,x=c===mod(-e,r),E=c===mod(-e*ED25519_SQRT_M1,r);return b&&(l=u),(x||E)&&(l=g),isNegativeLE(l,r)&&(l=mod(-l,r)),{isValid:b||x,value:l}}const Fp$1=Field(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Fp$1,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512$3,randomBytes:randomBytes$1,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults);function ed25519_domain(e,t,r){if(t.length>255)throw new Error("Context is too big");return concatBytes$1(utf8ToBytes$1("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}({...ed25519Defaults});({...ed25519Defaults});const x25519=(()=>montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=ED25519_P,{pow_p_5_8:r,b2:n}=ed25519_pow_2_252_3(e);return mod(pow2(r,BigInt(3),t)*n,t)},adjustScalarBytes,randomBytes:randomBytes$1}))(),ELL2_C1=(Fp$1.ORDER+BigInt(3))/BigInt(8);Fp$1.pow(_2n$1,ELL2_C1);Fp$1.sqrt(Fp$1.neg(Fp$1.ONE));(Fp$1.ORDER-BigInt(5))/BigInt(8);BigInt(486662);FpSqrtEven(Fp$1,Fp$1.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235");BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578");BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838");BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class HMAC extends Hash{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,hash$1(t);const n=toBytes$1(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(n.length>o?t.create().update(n).digest():n);for(let l=0;lnew HMAC(e,t).update(r).digest();hmac$1.create=(e,t)=>new HMAC(e,t);function extract(e,t,r){return hash$1(e),r===void 0&&(r=new Uint8Array(e.outputLen)),hmac$1(e,toBytes$1(r),toBytes$1(t))}const HKDF_COUNTER=new Uint8Array([0]),EMPTY_BUFFER=new Uint8Array;function expand(e,t,r,n=32){if(hash$1(e),number$2(n),n>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const o=Math.ceil(n/e.outputLen);r===void 0&&(r=EMPTY_BUFFER);const a=new Uint8Array(o*e.outputLen),l=hmac$1.create(e,t),c=l._cloneInto(),u=new Uint8Array(l.outputLen);for(let g=0;ge&t^~e&r,Maj=(e,t,r)=>e&t^e&r^t&r,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:t,B:r,C:n,D:o,E:a,F:l,G:c,H:u}=this;return[t,r,n,o,a,l,c,u]}set(t,r,n,o,a,l,c,u){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=a|0,this.F=l|0,this.G=c|0,this.H=u|0}process(t,r){for(let x=0;x<16;x++,r+=4)SHA256_W[x]=t.getUint32(r,!1);for(let x=16;x<64;x++){const E=SHA256_W[x-15],I=SHA256_W[x-2],k=rotr(E,7)^rotr(E,18)^E>>>3,T=rotr(I,17)^rotr(I,19)^I>>>10;SHA256_W[x]=T+SHA256_W[x-7]+k+SHA256_W[x-16]|0}let{A:n,B:o,C:a,D:l,E:c,F:u,G:g,H:b}=this;for(let x=0;x<64;x++){const E=rotr(c,6)^rotr(c,11)^rotr(c,25),I=b+E+Chi(c,u,g)+SHA256_K[x]+SHA256_W[x]|0,T=(rotr(n,2)^rotr(n,13)^rotr(n,22))+Maj(n,o,a)|0;b=g,g=u,u=c,c=l+I|0,l=a,a=o,o=n,n=I+T|0}n=n+this.A|0,o=o+this.B|0,a=a+this.C|0,l=l+this.D|0,c=c+this.E|0,u=u+this.F|0,g=g+this.G|0,b=b+this.H|0,this.set(n,o,a,l,c,u,g,b)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256$3=wrapConstructor(()=>new SHA256),pureJsCrypto={hashSHA256(e){return sha256$3(e)},getHKDF(e,t){const r=extract(sha256$3,t,e),o=expand(sha256$3,r,void 0,96),a=o.subarray(0,32),l=o.subarray(32,64),c=o.subarray(64,96);return[a,l,c]},generateX25519KeyPair(){const e=x25519.utils.randomPrivateKey();return{publicKey:x25519.getPublicKey(e),privateKey:e}},generateX25519KeyPairFromSeed(e){return{publicKey:x25519.getPublicKey(e),privateKey:e}},generateX25519SharedKey(e,t){return x25519.getSharedSecret(e,t)},chaCha20Poly1305Encrypt(e,t,r,n){return chacha20poly1305(n,t,r).encrypt(e)},chaCha20Poly1305Decrypt(e,t,r,n,o){return chacha20poly1305(n,t,r).decrypt(e,o)}},allocUnsafe$1=e=>globalThis.Buffer?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e),uint16BEEncode=e=>{const t=allocUnsafe$1(2);return new DataView(t.buffer,t.byteOffset,t.byteLength).setUint16(0,e,!1),t};uint16BEEncode.bytes=2;const uint16BEDecode=e=>{if(e.length<2)throw RangeError("Could not decode int16BE");return e instanceof Uint8Array?new DataView(e.buffer,e.byteOffset,e.byteLength).getUint16(0,!1):e.getUint16(0)};uint16BEDecode.bytes=2;function encode0(e){return concat$1([e.ne,e.ciphertext],e.ne.length+e.ciphertext.length)}function encode1(e){return concat$1([e.ne,e.ns,e.ciphertext],e.ne.length+e.ns.length+e.ciphertext.length)}function encode2(e){return concat$1([e.ns,e.ciphertext],e.ns.length+e.ciphertext.length)}function decode0(e){if(e.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:e.subarray(0,32),ciphertext:e.subarray(32,e.length),ns:new Uint8Array(0)}}function decode1(e){if(e.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:e.subarray(0,32),ns:e.subarray(32,80),ciphertext:e.subarray(80,e.length)}}function decode2(e){if(e.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:new Uint8Array(0),ns:e.subarray(0,48),ciphertext:e.subarray(48,e.length)}}const CHACHA_TAG_LENGTH=16;function encryptStream(e,t){return async function*(r){for await(const n of r)for(let o=0;on.length&&(a=n.length);const l=e.encrypt(n.subarray(o,a),e.session);t?.encryptedPackets.increment(),yield uint16BEEncode(l.byteLength),yield l}}}function decryptStream(e,t){return async function*(r){for await(const n of r)for(let o=0;on.length&&(a=n.length),a-CHACHA_TAG_LENGTH0;)c.push(g%a),g=g/a|0}for(o=0;e[o]===0&&o=0;--o)n+=t[c[o]]}if(r){var b=new RegExp(".{1,"+r+"}","g");n=n.match(b).join(`\r `)}return n};api$2.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=_reverseAlphabets[t];if(!r){r=_reverseAlphabets[t]=[];for(var n=0;n>=8;for(;g>0;)l.push(g&255),g>>=8}for(var b=0;e[b]===a&&b0;)a.push(c%n),c=c/n|0}var u="";for(r=0;e.at(r)===0&&r=0;--r)u+=t[a[r]];return u}var forge$l=forge$m,baseN=baseN$1,util$6=util$7.exports=forge$l.util=forge$l.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){util$6.nextTick=process.nextTick,typeof setImmediate=="function"?util$6.setImmediate=setImmediate:util$6.setImmediate=util$6.nextTick;return}if(typeof setImmediate=="function"){util$6.setImmediate=function(){return setImmediate.apply(void 0,arguments)},util$6.nextTick=function(c){return setImmediate(c)};return}if(util$6.setImmediate=function(c){setTimeout(c,0)},typeof window<"u"&&typeof window.postMessage=="function"){let c=function(u){if(u.source===window&&u.data===e){u.stopPropagation();var g=t.slice();t.length=0,g.forEach(function(b){b()})}};var l=c,e="forge.setImmediate",t=[];util$6.setImmediate=function(u){t.push(u),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",c,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),t=[];new MutationObserver(function(){var u=t.slice();t.length=0,u.forEach(function(g){g()})}).observe(o,{attributes:!0});var a=util$6.setImmediate;util$6.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),a(u)):(t.push(u),t.length===1&&o.setAttribute("a",n=!n))}}util$6.nextTick=util$6.setImmediate})();util$6.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;util$6.globalScope=function(){return util$6.isNodejs?commonjsGlobal$2:typeof self>"u"?window:self}();util$6.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};util$6.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};util$6.isArrayBufferView=function(e){return e&&util$6.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function _checkBitsParam(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}util$6.ByteBuffer=ByteStringBuffer;function ByteStringBuffer(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(util$6.isArrayBuffer(e)||util$6.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var r=0;r_MAX_CONSTRUCTED_STRING_LENGTH&&(this.data.substr(0,1),this._constructedStringLength=0)};util$6.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};util$6.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};util$6.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};util$6.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this};util$6.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};util$6.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(util$6.encodeUtf8(e))};util$6.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};util$6.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};util$6.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};util$6.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};util$6.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};util$6.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};util$6.ByteStringBuffer.prototype.putInt=function(e,t){_checkBitsParam(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)};util$6.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t};util$6.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t};util$6.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};util$6.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};util$6.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};util$6.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};util$6.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};util$6.ByteStringBuffer.prototype.copy=function(){var e=util$6.createBuffer(this.data);return e.read=this.read,e};util$6.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};util$6.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};util$6.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};util$6.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this};util$6.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};util$6.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};util$6.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};util$6.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};util$6.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};util$6.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};util$6.DataBuffer.prototype.putInt=function(e,t){_checkBitsParam(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};util$6.DataBuffer.prototype.putSignedInt=function(e,t){return _checkBitsParam(t),this.accommodate(t/8),e<0&&(e+=2<0);return t};util$6.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t};util$6.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};util$6.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};util$6.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};util$6.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};util$6.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};util$6.DataBuffer.prototype.copy=function(){return new util$6.DataBuffer(this)};util$6.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};util$6.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};util$6.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};util$6.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r};util$6.xorBytes=function(e,t,r){for(var n="",o="",a="",l=0,c=0;r>0;--r,++l)o=e.charCodeAt(l)^t.charCodeAt(l),c>=10&&(n+=a,a="",c=0),a+=String.fromCharCode(o),++c;return n+=a,n};util$6.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var _base64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_base64Idx=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],_base58="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";util$6.encode64=function(e,t){for(var r="",n="",o,a,l,c=0;c>2),r+=_base64.charAt((o&3)<<4|a>>4),isNaN(a)?r+="==":(r+=_base64.charAt((a&15)<<2|l>>6),r+=isNaN(l)?"=":_base64.charAt(l&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r `,r=r.substr(t));return n+=r,n};util$6.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,o,a,l=0;l>4),o!==64&&(t+=String.fromCharCode((n&15)<<4|o>>2),a!==64&&(t+=String.fromCharCode((o&3)<<6|a)));return t};util$6.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};util$6.decodeUtf8=function(e){return decodeURIComponent(escape(e))};util$6.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:baseN.encode,decode:baseN.decode}};util$6.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};util$6.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var o=r,a=0;a>2),r+=_base64.charAt((o&3)<<4|a>>4),isNaN(a)?r+="==":(r+=_base64.charAt((a&15)<<2|l>>6),r+=isNaN(l)?"=":_base64.charAt(l&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r diff --git a/index.html b/index.html index 697669c..9f5e239 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ Web3 public sensors map - + diff --git a/sw.js b/sw.js index 30bb1f6..b8b066d 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const n=(n,i)=>(n=new URL(n+".js",i).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(i,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>n(e,r),u={module:{uri:r},exports:o,require:a};s[r]=Promise.all(i.map((e=>u[e]||a(e)))).then((e=>(l(...e),o)))}}define(["./workbox-32a34f02"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"app-icon-120.png",revision:"ed33837fa042b725590fde3fe8c86bc5"},{url:"app-icon-192.png",revision:"99fdc63826bee0d9dfa81dbdde81593b"},{url:"app-icon-256.png",revision:"d8aa3b549b97e999d07ec2bce0b351a7"},{url:"app-icon-512-rounded.png",revision:"67c9eb98339ee497d04f7c8f76ce66c7"},{url:"app-icon-512.png",revision:"e395e111321876ac227cd8ca945111d0"},{url:"assets/app-icon-512.a5eb7b3f.png",revision:null},{url:"assets/atc.09cec0ab.png",revision:null},{url:"assets/ekovoz.af7d8a74.png",revision:null},{url:"assets/index.9394fe57.css",revision:null},{url:"assets/index.f3c401fe.js",revision:null},{url:"assets/location-arrow-solid.4871ebf4.svg",revision:null},{url:"assets/msg-air.abb754d3.js",revision:null},{url:"assets/msg-alert.804a179c.png",revision:null},{url:"assets/msg-alert.9404c396.js",revision:null},{url:"assets/msg-fire.faa011b0.js",revision:null},{url:"assets/msg-forest.a623a1f9.js",revision:null},{url:"assets/msg-gank.34a748fe.js",revision:null},{url:"assets/msg-gank.ef47b6e4.png",revision:null},{url:"assets/msg-garbage.b797b882.js",revision:null},{url:"assets/msg-notif.d72c5a6f.js",revision:null},{url:"assets/msg-notif.fbcb8f30.png",revision:null},{url:"assets/msg-parking.5da4fdeb.js",revision:null},{url:"assets/msg-parking.78bf40b4.png",revision:null},{url:"assets/msg-recycle.2ff7eefc.png",revision:null},{url:"assets/msg-recycle.eab79c00.js",revision:null},{url:"assets/msg-text.470fee8d.js",revision:null},{url:"assets/msg-water.b0066085.js",revision:null},{url:"assets/notosans-bold-webfont.b1ab6654.woff2",revision:null},{url:"assets/notosans-regular-webfont.7d4a5d04.woff2",revision:null},{url:"assets/notosansdisplay-black-webfont.9f247781.woff2",revision:null},{url:"assets/notosansdisplay-medium-webfont.5dca4cb1.woff2",revision:null},{url:"assets/sensors-world-app.8a0828bb.png",revision:null},{url:"assets/spinner-solid.7debe01f.svg",revision:null},{url:"assets/sun.d26ef6d1.png",revision:null},{url:"favicon.ico",revision:"8e319c9cafb31249891540cd51c6e8a0"},{url:"index.html",revision:"0a900232f19c549bb3a984e976884028"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"untitled folder/192.png",revision:"c077e8e3713cfb404346e7897c6fe85e"},{url:"untitled folder/256.png",revision:"7269f31dbeca5794e34aa525b9cfe383"},{url:"untitled folder/512.png",revision:"d19974ca79fd176170b76249657c7ab3"},{url:"untitled folder/icon512_rounded.png",revision:"c3539307f4aab29831b6cb2a94002add"},{url:"untitled folder/maskable-icon.png",revision:"0b1dc18370b9d45fbfabd7575ea1330d"},{url:"untitled folder/sensors-world-app.png",revision:"4080ed30224bdbd4648ca4ab3f8819fe"},{url:"app-icon-512.png",revision:"e395e111321876ac227cd8ca945111d0"},{url:"app-icon-512-rounded.png",revision:"67c9eb98339ee497d04f7c8f76ce66c7"},{url:"app-icon-256.png",revision:"d8aa3b549b97e999d07ec2bce0b351a7"},{url:"app-icon-192.png",revision:"99fdc63826bee0d9dfa81dbdde81593b"},{url:"manifest.webmanifest",revision:"b4f201b83436cddd66066a96d15118bb"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const n=(n,i)=>(n=new URL(n+".js",i).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(i,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>n(e,r),u={module:{uri:r},exports:o,require:a};s[r]=Promise.all(i.map((e=>u[e]||a(e)))).then((e=>(l(...e),o)))}}define(["./workbox-32a34f02"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"app-icon-120.png",revision:"ed33837fa042b725590fde3fe8c86bc5"},{url:"app-icon-192.png",revision:"99fdc63826bee0d9dfa81dbdde81593b"},{url:"app-icon-256.png",revision:"d8aa3b549b97e999d07ec2bce0b351a7"},{url:"app-icon-512-rounded.png",revision:"67c9eb98339ee497d04f7c8f76ce66c7"},{url:"app-icon-512.png",revision:"e395e111321876ac227cd8ca945111d0"},{url:"assets/app-icon-512.a5eb7b3f.png",revision:null},{url:"assets/atc.09cec0ab.png",revision:null},{url:"assets/ekovoz.af7d8a74.png",revision:null},{url:"assets/index.9394fe57.css",revision:null},{url:"assets/index.b85cf2a6.js",revision:null},{url:"assets/location-arrow-solid.4871ebf4.svg",revision:null},{url:"assets/msg-air.abb754d3.js",revision:null},{url:"assets/msg-alert.804a179c.png",revision:null},{url:"assets/msg-alert.9404c396.js",revision:null},{url:"assets/msg-fire.faa011b0.js",revision:null},{url:"assets/msg-forest.a623a1f9.js",revision:null},{url:"assets/msg-gank.34a748fe.js",revision:null},{url:"assets/msg-gank.ef47b6e4.png",revision:null},{url:"assets/msg-garbage.b797b882.js",revision:null},{url:"assets/msg-notif.d72c5a6f.js",revision:null},{url:"assets/msg-notif.fbcb8f30.png",revision:null},{url:"assets/msg-parking.5da4fdeb.js",revision:null},{url:"assets/msg-parking.78bf40b4.png",revision:null},{url:"assets/msg-recycle.2ff7eefc.png",revision:null},{url:"assets/msg-recycle.eab79c00.js",revision:null},{url:"assets/msg-text.470fee8d.js",revision:null},{url:"assets/msg-water.b0066085.js",revision:null},{url:"assets/notosans-bold-webfont.b1ab6654.woff2",revision:null},{url:"assets/notosans-regular-webfont.7d4a5d04.woff2",revision:null},{url:"assets/notosansdisplay-black-webfont.9f247781.woff2",revision:null},{url:"assets/notosansdisplay-medium-webfont.5dca4cb1.woff2",revision:null},{url:"assets/sensors-world-app.8a0828bb.png",revision:null},{url:"assets/spinner-solid.7debe01f.svg",revision:null},{url:"assets/sun.d26ef6d1.png",revision:null},{url:"favicon.ico",revision:"8e319c9cafb31249891540cd51c6e8a0"},{url:"index.html",revision:"bab6296d8fdaf96142c949da7c5338e7"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"untitled folder/192.png",revision:"c077e8e3713cfb404346e7897c6fe85e"},{url:"untitled folder/256.png",revision:"7269f31dbeca5794e34aa525b9cfe383"},{url:"untitled folder/512.png",revision:"d19974ca79fd176170b76249657c7ab3"},{url:"untitled folder/icon512_rounded.png",revision:"c3539307f4aab29831b6cb2a94002add"},{url:"untitled folder/maskable-icon.png",revision:"0b1dc18370b9d45fbfabd7575ea1330d"},{url:"untitled folder/sensors-world-app.png",revision:"4080ed30224bdbd4648ca4ab3f8819fe"},{url:"app-icon-512.png",revision:"e395e111321876ac227cd8ca945111d0"},{url:"app-icon-512-rounded.png",revision:"67c9eb98339ee497d04f7c8f76ce66c7"},{url:"app-icon-256.png",revision:"d8aa3b549b97e999d07ec2bce0b351a7"},{url:"app-icon-192.png",revision:"99fdc63826bee0d9dfa81dbdde81593b"},{url:"manifest.webmanifest",revision:"b4f201b83436cddd66066a96d15118bb"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));