@pennsieve-viz/tsviewer 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BFLibraryButton-BiLkvU6m.cjs → BFLibraryButton-BI_luZjc.cjs} +1 -1
- package/dist/{BFLibraryButton-C6aAhW1T.js → BFLibraryButton-BP-P5nDS.js} +1 -1
- package/dist/{IconSelection-DGTELjPb.cjs → IconSelection-B3B4x81f.cjs} +1 -1
- package/dist/{IconSelection-Bud2XLOy.js → IconSelection-DkGAJih_.js} +1 -1
- package/dist/{TSAnnotationCanvas-CMZHn8mY.js → TSAnnotationCanvas-CPNo-Z2t.js} +6 -5
- package/dist/TSAnnotationCanvas-Cq5fLEeQ.cjs +1 -0
- package/dist/TSAnnotationModal-BfpdK288.js +4429 -0
- package/dist/TSAnnotationModal-BvPKePsi.cjs +1 -0
- package/dist/{TSFilterModal-BtLOK_nq.js → TSFilterModal-BUuabfh0.js} +59 -55
- package/dist/TSFilterModal-DXfg6Vbt.cjs +1 -0
- package/dist/{TSScrubber-CTjzX-Xq.js → TSScrubber-BWay2z2E.js} +1 -1
- package/dist/{TSScrubber-DAnIUBuC.cjs → TSScrubber-DuOBdGF2.cjs} +1 -1
- package/dist/TSViewerCanvas-BDAfmQM_.cjs +11 -0
- package/dist/{TSViewerCanvas-DkKV70m8.js → TSViewerCanvas-DjV4CQ2G.js} +205 -209
- package/dist/{TSViewerLayerWindow-zI_48DIx.js → TSViewerLayerWindow-BuXB_NVG.js} +39 -36
- package/dist/TSViewerLayerWindow-C40On1cL.cjs +1 -0
- package/dist/TSViewerToolbar-CGLoEe3Z.cjs +1 -0
- package/dist/{TSViewerToolbar-BMZIlD4q.js → TSViewerToolbar-gOCiS_4U.js} +92 -88
- package/dist/{TsAnnotationDeleteDialog-Iwpo79Pe.js → TsAnnotationDeleteDialog-C3P2teV8.js} +82 -80
- package/dist/TsAnnotationDeleteDialog-Dr6JB0ms.cjs +1 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/base-C3K_VdPK.cjs +12 -0
- package/dist/base-Dd-o8fN6.js +1413 -0
- package/dist/el-button-B3mito7d.cjs +1 -0
- package/dist/el-button-DVykS1Of.js +769 -0
- package/dist/el-input-BQKTli-S.cjs +1 -0
- package/dist/el-input-BxM2cCbI.js +4667 -0
- package/dist/el-input-number-8Z4UFuyU.cjs +1 -0
- package/dist/el-input-number-DtWxZ2F-.js +265 -0
- package/dist/el-overlay-BJQNirx2.cjs +1 -0
- package/dist/el-overlay-DfCO_8B5.js +517 -0
- package/dist/{index-CGSfhm_E.cjs → index-CW1sKrzq.cjs} +1 -1
- package/dist/index-CiwHOd9w.cjs +1 -0
- package/dist/index-CtMh8Ff9.js +22 -0
- package/dist/{index-Cexzl5Xu.js → index-D41jNOo7.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{pathOr-Do2dduwx.js → pathOr-CSuna3IF.js} +1 -1
- package/dist/{pathOr-D0158Gk1.cjs → pathOr-DWeJPuhG.cjs} +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/TSAnnotationCanvas-C3-VI46n.cjs +0 -1
- package/dist/TSAnnotationModal-BcqWVXP_.js +0 -199
- package/dist/TSAnnotationModal-DskdoFo4.cjs +0 -1
- package/dist/TSFilterModal-DEOWfIi6.cjs +0 -1
- package/dist/TSViewerCanvas-Jbu-Kh9F.cjs +0 -11
- package/dist/TSViewerLayerWindow-wHkjTl6e.cjs +0 -1
- package/dist/TSViewerToolbar-C6yy7GJr.cjs +0 -1
- package/dist/TsAnnotationDeleteDialog-Be3AJIyo.cjs +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";const vue=require("vue"),pinia=require("pinia"),index=require("./index-CGSfhm_E.cjs");var head=index.nth(0),XFind=(function(){function f(c,v){this.xf=v,this.f=c,this.found=!1}return f.prototype["@@transducer/init"]=index._xfBase.init,f.prototype["@@transducer/result"]=function(c){return this.found||(c=this.xf["@@transducer/step"](c,void 0)),this.xf["@@transducer/result"](c)},f.prototype["@@transducer/step"]=function(c,v){return this.f(v)&&(this.found=!0,c=index._reduced(this.xf["@@transducer/step"](c,v))),c},f})(),_xfind=index._curry2(function(c,v){return new XFind(c,v)}),find=index._curry2(index._dispatchable(["find"],_xfind,function(c,v){for(var l=0,o=v.length;l<o;){if(c(v[l]))return v[l];l+=1}})),commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=f;function f(c,v){for(var l=new Array(arguments.length-1),o=0,i=2,e=!0;i<arguments.length;)l[o++]=arguments[i++];return new Promise(function(t,n){l[o]=function(s){if(e)if(e=!1,s)n(s);else{for(var u=new Array(arguments.length-1),a=0;a<u.length;)u[a++]=arguments[a];t.apply(null,u)}};try{c.apply(v||null,l)}catch(d){e&&(e=!1,n(d))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(f){var c=f;c.length=function(r){var t=r.length;if(!t)return 0;for(var n=0;--t%4>1&&r.charAt(t)==="=";)++n;return Math.ceil(r.length*3)/4-n};for(var v=new Array(64),l=new Array(123),o=0;o<64;)l[v[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;c.encode=function(r,t,n){for(var d=null,s=[],u=0,a=0,h;t<n;){var m=r[t++];switch(a){case 0:s[u++]=v[m>>2],h=(m&3)<<4,a=1;break;case 1:s[u++]=v[h|m>>4],h=(m&15)<<2,a=2;break;case 2:s[u++]=v[h|m>>6],s[u++]=v[m&63],a=0;break}u>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,s)),u=0)}return a&&(s[u++]=v[h],s[u++]=61,a===1&&(s[u++]=61)),d?(u&&d.push(String.fromCharCode.apply(String,s.slice(0,u))),d.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var i="invalid encoding";c.decode=function(r,t,n){for(var d=n,s=0,u,a=0;a<r.length;){var h=r.charCodeAt(a++);if(h===61&&s>1)break;if((h=l[h])===void 0)throw Error(i);switch(s){case 0:u=h,s=1;break;case 1:t[n++]=u<<2|(h&48)>>4,u=h,s=2;break;case 2:t[n++]=(u&15)<<4|(h&60)>>2,u=h,s=3;break;case 3:t[n++]=(u&3)<<6|h,s=0;break}}if(s===1)throw Error(i);return n-d},c.test=function(r){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=f;function f(){this._listeners={}}return f.prototype.on=function(v,l,o){return(this._listeners[v]||(this._listeners[v]=[])).push({fn:l,ctx:o||this}),this},f.prototype.off=function(v,l){if(v===void 0)this._listeners={};else if(l===void 0)this._listeners[v]=[];else for(var o=this._listeners[v],i=0;i<o.length;)o[i].fn===l?o.splice(i,1):++i;return this},f.prototype.emit=function(v){var l=this._listeners[v];if(l){for(var o=[],i=1;i<arguments.length;)o.push(arguments[i++]);for(i=0;i<l.length;)l[i].fn.apply(l[i++].ctx,o)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=f(f);function f(i){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),t=r[3]===128;function n(a,h,m){e[0]=a,h[m]=r[0],h[m+1]=r[1],h[m+2]=r[2],h[m+3]=r[3]}function d(a,h,m){e[0]=a,h[m]=r[3],h[m+1]=r[2],h[m+2]=r[1],h[m+3]=r[0]}i.writeFloatLE=t?n:d,i.writeFloatBE=t?d:n;function s(a,h){return r[0]=a[h],r[1]=a[h+1],r[2]=a[h+2],r[3]=a[h+3],e[0]}function u(a,h){return r[3]=a[h],r[2]=a[h+1],r[1]=a[h+2],r[0]=a[h+3],e[0]}i.readFloatLE=t?s:u,i.readFloatBE=t?u:s})():(function(){function e(t,n,d,s){var u=n<0?1:0;if(u&&(n=-n),n===0)t(1/n>0?0:2147483648,d,s);else if(isNaN(n))t(2143289344,d,s);else if(n>34028234663852886e22)t((u<<31|2139095040)>>>0,d,s);else if(n<11754943508222875e-54)t((u<<31|Math.round(n/1401298464324817e-60))>>>0,d,s);else{var a=Math.floor(Math.log(n)/Math.LN2),h=Math.round(n*Math.pow(2,-a)*8388608)&8388607;t((u<<31|a+127<<23|h)>>>0,d,s)}}i.writeFloatLE=e.bind(null,c),i.writeFloatBE=e.bind(null,v);function r(t,n,d){var s=t(n,d),u=(s>>31)*2+1,a=s>>>23&255,h=s&8388607;return a===255?h?NaN:u*(1/0):a===0?u*1401298464324817e-60*h:u*Math.pow(2,a-150)*(h+8388608)}i.readFloatLE=r.bind(null,l),i.readFloatBE=r.bind(null,o)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),t=r[7]===128;function n(a,h,m){e[0]=a,h[m]=r[0],h[m+1]=r[1],h[m+2]=r[2],h[m+3]=r[3],h[m+4]=r[4],h[m+5]=r[5],h[m+6]=r[6],h[m+7]=r[7]}function d(a,h,m){e[0]=a,h[m]=r[7],h[m+1]=r[6],h[m+2]=r[5],h[m+3]=r[4],h[m+4]=r[3],h[m+5]=r[2],h[m+6]=r[1],h[m+7]=r[0]}i.writeDoubleLE=t?n:d,i.writeDoubleBE=t?d:n;function s(a,h){return r[0]=a[h],r[1]=a[h+1],r[2]=a[h+2],r[3]=a[h+3],r[4]=a[h+4],r[5]=a[h+5],r[6]=a[h+6],r[7]=a[h+7],e[0]}function u(a,h){return r[7]=a[h],r[6]=a[h+1],r[5]=a[h+2],r[4]=a[h+3],r[3]=a[h+4],r[2]=a[h+5],r[1]=a[h+6],r[0]=a[h+7],e[0]}i.readDoubleLE=t?s:u,i.readDoubleBE=t?u:s})():(function(){function e(t,n,d,s,u,a){var h=s<0?1:0;if(h&&(s=-s),s===0)t(0,u,a+n),t(1/s>0?0:2147483648,u,a+d);else if(isNaN(s))t(0,u,a+n),t(2146959360,u,a+d);else if(s>17976931348623157e292)t(0,u,a+n),t((h<<31|2146435072)>>>0,u,a+d);else{var m;if(s<22250738585072014e-324)m=s/5e-324,t(m>>>0,u,a+n),t((h<<31|m/4294967296)>>>0,u,a+d);else{var R=Math.floor(Math.log(s)/Math.LN2);R===1024&&(R=1023),m=s*Math.pow(2,-R),t(m*4503599627370496>>>0,u,a+n),t((h<<31|R+1023<<20|m*1048576&1048575)>>>0,u,a+d)}}}i.writeDoubleLE=e.bind(null,c,0,4),i.writeDoubleBE=e.bind(null,v,4,0);function r(t,n,d,s,u){var a=t(s,u+n),h=t(s,u+d),m=(h>>31)*2+1,R=h>>>20&2047,g=4294967296*(h&1048575)+a;return R===2047?g?NaN:m*(1/0):R===0?m*5e-324*g:m*Math.pow(2,R-1075)*(g+4503599627370496)}i.readDoubleLE=r.bind(null,l,0,4),i.readDoubleBE=r.bind(null,o,4,0)})(),i}function c(i,e,r){e[r]=i&255,e[r+1]=i>>>8&255,e[r+2]=i>>>16&255,e[r+3]=i>>>24}function v(i,e,r){e[r]=i>>>24,e[r+1]=i>>>16&255,e[r+2]=i>>>8&255,e[r+3]=i&255}function l(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0}function o(i,e){return(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(f){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(f){var c=f;c.length=function(l){for(var o=0,i=0,e=0;e<l.length;++e)i=l.charCodeAt(e),i<128?o+=1:i<2048?o+=2:(i&64512)===55296&&(l.charCodeAt(e+1)&64512)===56320?(++e,o+=4):o+=3;return o},c.read=function(l,o,i){var e=i-o;if(e<1)return"";for(var r=null,t=[],n=0,d;o<i;)d=l[o++],d<128?t[n++]=d:d>191&&d<224?t[n++]=(d&31)<<6|l[o++]&63:d>239&&d<365?(d=((d&7)<<18|(l[o++]&63)<<12|(l[o++]&63)<<6|l[o++]&63)-65536,t[n++]=55296+(d>>10),t[n++]=56320+(d&1023)):t[n++]=(d&15)<<12|(l[o++]&63)<<6|l[o++]&63,n>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,t)),n=0);return r?(n&&r.push(String.fromCharCode.apply(String,t.slice(0,n))),r.join("")):String.fromCharCode.apply(String,t.slice(0,n))},c.write=function(l,o,i){for(var e=i,r,t,n=0;n<l.length;++n)r=l.charCodeAt(n),r<128?o[i++]=r:r<2048?(o[i++]=r>>6|192,o[i++]=r&63|128):(r&64512)===55296&&((t=l.charCodeAt(n+1))&64512)===56320?(r=65536+((r&1023)<<10)+(t&1023),++n,o[i++]=r>>18|240,o[i++]=r>>12&63|128,o[i++]=r>>6&63|128,o[i++]=r&63|128):(o[i++]=r>>12|224,o[i++]=r>>6&63|128,o[i++]=r&63|128);return i-e}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=f;function f(c,v,l){var o=l||8192,i=o>>>1,e=null,r=o;return function(n){if(n<1||n>i)return c(n);r+n>o&&(e=c(o),r=0);var d=v.call(e,r,r+=n);return r&7&&(r=(r|7)+1),d}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=c;var f=requireMinimal();function c(i,e){this.lo=i>>>0,this.hi=e>>>0}var v=c.zero=new c(0,0);v.toNumber=function(){return 0},v.zzEncode=v.zzDecode=function(){return this},v.length=function(){return 1};var l=c.zeroHash="\0\0\0\0\0\0\0\0";c.fromNumber=function(e){if(e===0)return v;var r=e<0;r&&(e=-e);var t=e>>>0,n=(e-t)/4294967296>>>0;return r&&(n=~n>>>0,t=~t>>>0,++t>4294967295&&(t=0,++n>4294967295&&(n=0))),new c(t,n)},c.from=function(e){if(typeof e=="number")return c.fromNumber(e);if(f.isString(e))if(f.Long)e=f.Long.fromString(e);else return c.fromNumber(parseInt(e,10));return e.low||e.high?new c(e.low>>>0,e.high>>>0):v},c.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,t=~this.hi>>>0;return r||(t=t+1>>>0),-(r+t*4294967296)}return this.lo+this.hi*4294967296},c.prototype.toLong=function(e){return f.Long?new f.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;return c.fromHash=function(e){return e===l?v:new c((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},c.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},c.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},c.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},c.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,t=this.hi>>>24;return t===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:t<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,(function(f){var c=f;c.asPromise=requireAspromise(),c.base64=requireBase64(),c.EventEmitter=requireEventemitter(),c.float=requireFloat(),c.inquire=requireInquire(),c.utf8=requireUtf8(),c.pool=requirePool(),c.LongBits=requireLongbits(),c.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),c.global=c.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal,c.emptyArray=Object.freeze?Object.freeze([]):[],c.emptyObject=Object.freeze?Object.freeze({}):{},c.isInteger=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i},c.isString=function(i){return typeof i=="string"||i instanceof String},c.isObject=function(i){return i&&typeof i=="object"},c.isset=c.isSet=function(i,e){var r=i[e];return r!=null&&i.hasOwnProperty(e)?typeof r!="object"||(Array.isArray(r)?r.length:Object.keys(r).length)>0:!1},c.Buffer=(function(){try{var o=c.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch{return null}})(),c._Buffer_from=null,c._Buffer_allocUnsafe=null,c.newBuffer=function(i){return typeof i=="number"?c.Buffer?c._Buffer_allocUnsafe(i):new c.Array(i):c.Buffer?c._Buffer_from(i):typeof Uint8Array>"u"?i:new Uint8Array(i)},c.Array=typeof Uint8Array<"u"?Uint8Array:Array,c.Long=c.global.dcodeIO&&c.global.dcodeIO.Long||c.global.Long||c.inquire("long"),c.key2Re=/^true|false|0|1$/,c.key32Re=/^-?(?:0|[1-9][0-9]*)$/,c.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,c.longToHash=function(i){return i?c.LongBits.from(i).toHash():c.LongBits.zeroHash},c.longFromHash=function(i,e){var r=c.LongBits.fromHash(i);return c.Long?c.Long.fromBits(r.lo,r.hi,e):r.toNumber(!!e)};function v(o,i,e){for(var r=Object.keys(i),t=0;t<r.length;++t)(o[r[t]]===void 0||!e)&&(o[r[t]]=i[r[t]]);return o}c.merge=v,c.lcFirst=function(i){return i.charAt(0).toLowerCase()+i.substring(1)};function l(o){function i(e,r){if(!(this instanceof i))return new i(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,i):Object.defineProperty(this,"stack",{value:new Error().stack||""}),r&&v(this,r)}return i.prototype=Object.create(Error.prototype,{constructor:{value:i,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return o},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),i}c.newError=l,c.ProtocolError=l("ProtocolError"),c.oneOfGetter=function(i){for(var e={},r=0;r<i.length;++r)e[i[r]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(e[t[n]]===1&&this[t[n]]!==void 0&&this[t[n]]!==null)return t[n]}},c.oneOfSetter=function(i){return function(e){for(var r=0;r<i.length;++r)i[r]!==e&&delete this[i[r]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var o=c.Buffer;if(!o){c._Buffer_from=c._Buffer_allocUnsafe=null;return}c._Buffer_from=o.from!==Uint8Array.from&&o.from||function(e,r){return new o(e,r)},c._Buffer_allocUnsafe=o.allocUnsafe||function(e){return new o(e)}}})(minimal)),minimal}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=t;var f=requireMinimal(),c,v=f.LongBits,l=f.base64,o=f.utf8;function i(R,g,y){this.fn=R,this.len=g,this.next=void 0,this.val=y}function e(){}function r(R){this.head=R.head,this.tail=R.tail,this.len=R.len,this.next=R.states}function t(){this.len=0,this.head=new i(e,0,0),this.tail=this.head,this.states=null}var n=function(){return f.Buffer?function(){return(t.create=function(){return new c})()}:function(){return new t}};t.create=n(),t.alloc=function(g){return new f.Array(g)},f.Array!==Array&&(t.alloc=f.pool(t.alloc,f.Array.prototype.subarray)),t.prototype._push=function(g,y,O){return this.tail=this.tail.next=new i(g,y,O),this.len+=y,this};function d(R,g,y){g[y]=R&255}function s(R,g,y){for(;R>127;)g[y++]=R&127|128,R>>>=7;g[y]=R}function u(R,g){this.len=R,this.next=void 0,this.val=g}u.prototype=Object.create(i.prototype),u.prototype.fn=s,t.prototype.uint32=function(g){return this.len+=(this.tail=this.tail.next=new u((g=g>>>0)<128?1:g<16384?2:g<2097152?3:g<268435456?4:5,g)).len,this},t.prototype.int32=function(g){return g<0?this._push(a,10,v.fromNumber(g)):this.uint32(g)},t.prototype.sint32=function(g){return this.uint32((g<<1^g>>31)>>>0)};function a(R,g,y){for(;R.hi;)g[y++]=R.lo&127|128,R.lo=(R.lo>>>7|R.hi<<25)>>>0,R.hi>>>=7;for(;R.lo>127;)g[y++]=R.lo&127|128,R.lo=R.lo>>>7;g[y++]=R.lo}t.prototype.uint64=function(g){var y=v.from(g);return this._push(a,y.length(),y)},t.prototype.int64=t.prototype.uint64,t.prototype.sint64=function(g){var y=v.from(g).zzEncode();return this._push(a,y.length(),y)},t.prototype.bool=function(g){return this._push(d,1,g?1:0)};function h(R,g,y){g[y]=R&255,g[y+1]=R>>>8&255,g[y+2]=R>>>16&255,g[y+3]=R>>>24}t.prototype.fixed32=function(g){return this._push(h,4,g>>>0)},t.prototype.sfixed32=t.prototype.fixed32,t.prototype.fixed64=function(g){var y=v.from(g);return this._push(h,4,y.lo)._push(h,4,y.hi)},t.prototype.sfixed64=t.prototype.fixed64,t.prototype.float=function(g){return this._push(f.float.writeFloatLE,4,g)},t.prototype.double=function(g){return this._push(f.float.writeDoubleLE,8,g)};var m=f.Array.prototype.set?function(g,y,O){y.set(g,O)}:function(g,y,O){for(var b=0;b<g.length;++b)y[O+b]=g[b]};return t.prototype.bytes=function(g){var y=g.length>>>0;if(!y)return this._push(d,1,0);if(f.isString(g)){var O=t.alloc(y=l.length(g));l.decode(g,O,0),g=O}return this.uint32(y)._push(m,y,g)},t.prototype.string=function(g){var y=o.length(g);return y?this.uint32(y)._push(o.write,y,g):this._push(d,1,0)},t.prototype.fork=function(){return this.states=new r(this),this.head=this.tail=new i(e,0,0),this.len=0,this},t.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(e,0,0),this.len=0),this},t.prototype.ldelim=function(){var g=this.head,y=this.tail,O=this.len;return this.reset().uint32(O),O&&(this.tail.next=g.next,this.tail=y,this.len+=O),this},t.prototype.finish=function(){for(var g=this.head.next,y=this.constructor.alloc(this.len),O=0;g;)g.fn(g.val,y,O),O+=g.len,g=g.next;return y},t._configure=function(R){c=R,t.create=n(),c._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=v;var f=requireWriter();(v.prototype=Object.create(f.prototype)).constructor=v;var c=requireMinimal();function v(){f.call(this)}v._configure=function(){v.alloc=c._Buffer_allocUnsafe,v.writeBytesBuffer=c.Buffer&&c.Buffer.prototype instanceof Uint8Array&&c.Buffer.prototype.set.name==="set"?function(i,e,r){e.set(i,r)}:function(i,e,r){if(i.copy)i.copy(e,r,0,i.length);else for(var t=0;t<i.length;)e[r++]=i[t++]}},v.prototype.bytes=function(i){c.isString(i)&&(i=c._Buffer_from(i,"base64"));var e=i.length>>>0;return this.uint32(e),e&&this._push(v.writeBytesBuffer,e,i),this};function l(o,i,e){o.length<40?c.utf8.write(o,i,e):i.utf8Write?i.utf8Write(o,e):i.write(o,e)}return v.prototype.string=function(i){var e=c.Buffer.byteLength(i);return this.uint32(e),e&&this._push(l,e,i),this},v._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var f=requireMinimal(),c,v=f.LongBits,l=f.utf8;function o(s,u){return RangeError("index out of range: "+s.pos+" + "+(u||1)+" > "+s.len)}function i(s){this.buf=s,this.pos=0,this.len=s.length}var e=typeof Uint8Array<"u"?function(u){if(u instanceof Uint8Array||Array.isArray(u))return new i(u);throw Error("illegal buffer")}:function(u){if(Array.isArray(u))return new i(u);throw Error("illegal buffer")},r=function(){return f.Buffer?function(a){return(i.create=function(m){return f.Buffer.isBuffer(m)?new c(m):e(m)})(a)}:e};i.create=r(),i.prototype._slice=f.Array.prototype.subarray||f.Array.prototype.slice,i.prototype.uint32=(function(){var u=4294967295;return function(){if(u=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(u=(u|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(u=(u|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(u=(u|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(u=(u|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return u;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return u}})(),i.prototype.int32=function(){return this.uint32()|0},i.prototype.sint32=function(){var u=this.uint32();return u>>>1^-(u&1)|0};function t(){var s=new v(0,0),u=0;if(this.len-this.pos>4){for(;u<4;++u)if(s.lo=(s.lo|(this.buf[this.pos]&127)<<u*7)>>>0,this.buf[this.pos++]<128)return s;if(s.lo=(s.lo|(this.buf[this.pos]&127)<<28)>>>0,s.hi=(s.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return s;u=0}else{for(;u<3;++u){if(this.pos>=this.len)throw o(this);if(s.lo=(s.lo|(this.buf[this.pos]&127)<<u*7)>>>0,this.buf[this.pos++]<128)return s}return s.lo=(s.lo|(this.buf[this.pos++]&127)<<u*7)>>>0,s}if(this.len-this.pos>4){for(;u<5;++u)if(s.hi=(s.hi|(this.buf[this.pos]&127)<<u*7+3)>>>0,this.buf[this.pos++]<128)return s}else for(;u<5;++u){if(this.pos>=this.len)throw o(this);if(s.hi=(s.hi|(this.buf[this.pos]&127)<<u*7+3)>>>0,this.buf[this.pos++]<128)return s}throw Error("invalid varint encoding")}i.prototype.bool=function(){return this.uint32()!==0};function n(s,u){return(s[u-4]|s[u-3]<<8|s[u-2]<<16|s[u-1]<<24)>>>0}i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return n(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return n(this.buf,this.pos+=4)|0};function d(){if(this.pos+8>this.len)throw o(this,8);return new v(n(this.buf,this.pos+=4),n(this.buf,this.pos+=4))}return i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var u=f.float.readFloatLE(this.buf,this.pos);return this.pos+=4,u},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var u=f.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,u},i.prototype.bytes=function(){var u=this.uint32(),a=this.pos,h=this.pos+u;if(h>this.len)throw o(this,u);if(this.pos+=u,Array.isArray(this.buf))return this.buf.slice(a,h);if(a===h){var m=f.Buffer;return m?m.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,a,h)},i.prototype.string=function(){var u=this.bytes();return l.read(u,0,u.length)},i.prototype.skip=function(u){if(typeof u=="number"){if(this.pos+u>this.len)throw o(this,u);this.pos+=u}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},i.prototype.skipType=function(s){switch(s){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(s=this.uint32()&7)!==4;)this.skipType(s);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+s+" at offset "+this.pos)}return this},i._configure=function(s){c=s,i.create=r(),c._configure();var u=f.Long?"toLong":"toNumber";f.merge(i.prototype,{int64:function(){return t.call(this)[u](!1)},uint64:function(){return t.call(this)[u](!0)},sint64:function(){return t.call(this).zzDecode()[u](!1)},fixed64:function(){return d.call(this)[u](!0)},sfixed64:function(){return d.call(this)[u](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=v;var f=requireReader();(v.prototype=Object.create(f.prototype)).constructor=v;var c=requireMinimal();function v(l){f.call(this,l)}return v._configure=function(){c.Buffer&&(v.prototype._slice=c.Buffer.prototype.slice)},v.prototype.string=function(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))},v._configure(),reader_buffer}var rpc={},service$1,hasRequiredService$1;function requireService$1(){if(hasRequiredService$1)return service$1;hasRequiredService$1=1,service$1=c;var f=requireMinimal();(c.prototype=Object.create(f.EventEmitter.prototype)).constructor=c;function c(v,l,o){if(typeof v!="function")throw TypeError("rpcImpl must be a function");f.EventEmitter.call(this),this.rpcImpl=v,this.requestDelimited=!!l,this.responseDelimited=!!o}return c.prototype.rpcCall=function v(l,o,i,e,r){if(!e)throw TypeError("request must be specified");var t=this;if(!r)return f.asPromise(v,t,l,o,i,e);if(!t.rpcImpl){setTimeout(function(){r(Error("already ended"))},0);return}try{return t.rpcImpl(l,o[t.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(d,s){if(d)return t.emit("error",d,l),r(d);if(s===null){t.end(!0);return}if(!(s instanceof i))try{s=i[t.responseDelimited?"decodeDelimited":"decode"](s)}catch(u){return t.emit("error",u,l),r(u)}return t.emit("data",s,l),r(null,s)})}catch(n){t.emit("error",n,l),setTimeout(function(){r(n)},0);return}},c.prototype.end=function(l){return this.rpcImpl&&(l||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service$1}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(f){var c=f;c.Service=requireService$1()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(f){var c=f;c.build="minimal",c.Writer=requireWriter(),c.BufferWriter=requireWriter_buffer(),c.Reader=requireReader(),c.BufferReader=requireReader_buffer(),c.util=requireMinimal(),c.rpc=requireRpc(),c.roots=requireRoots(),c.configure=v;function v(){c.util._configure(),c.Writer._configure(c.BufferWriter),c.Reader._configure(c.BufferReader)}v()})(indexMinimal)),indexMinimal}var types={},util={exports:{}},codegen_1,hasRequiredCodegen;function requireCodegen(){if(hasRequiredCodegen)return codegen_1;hasRequiredCodegen=1,codegen_1=f;function f(c,v){typeof c=="string"&&(v=c,c=void 0);var l=[];function o(e){if(typeof e!="string"){var r=i();if(f.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var t=Object.keys(e),n=new Array(t.length+1),d=new Array(t.length),s=0;s<t.length;)n[s]=t[s],d[s]=e[t[s++]];return n[s]=r,Function.apply(null,n).apply(null,d)}return Function(r)()}for(var u=new Array(arguments.length-1),a=0;a<u.length;)u[a]=arguments[++a];if(a=0,e=e.replace(/%([%dfijs])/g,function(m,R){var g=u[a++];switch(R){case"d":case"f":return String(Number(g));case"i":return String(Math.floor(g));case"j":return JSON.stringify(g);case"s":return String(g)}return"%"}),a!==u.length)throw Error("parameter count mismatch");return l.push(e),o}function i(e){return"function "+(e||v||"")+"("+(c&&c.join(",")||"")+`){
|
|
2
|
-
`+l.join(`
|
|
3
|
-
`)+`
|
|
4
|
-
}`}return o.toString=i,o}return f.verbose=!1,codegen_1}var fetch_1,hasRequiredFetch;function requireFetch(){if(hasRequiredFetch)return fetch_1;hasRequiredFetch=1,fetch_1=l;var f=requireAspromise(),c=requireInquire(),v=c("fs");function l(o,i,e){return typeof i=="function"?(e=i,i={}):i||(i={}),e?!i.xhr&&v&&v.readFile?v.readFile(o,function(t,n){return t&&typeof XMLHttpRequest<"u"?l.xhr(o,i,e):t?e(t):e(null,i.binary?n:n.toString("utf8"))}):l.xhr(o,i,e):f(l,this,o,i)}return l.xhr=function(i,e,r){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(t.readyState===4){if(t.status!==0&&t.status!==200)return r(Error("status "+t.status));if(e.binary){var d=t.response;if(!d){d=[];for(var s=0;s<t.responseText.length;++s)d.push(t.responseText.charCodeAt(s)&255)}return r(null,typeof Uint8Array<"u"?new Uint8Array(d):d)}return r(null,t.responseText)}},e.binary&&("overrideMimeType"in t&&t.overrideMimeType("text/plain; charset=x-user-defined"),t.responseType="arraybuffer"),t.open("GET",i),t.send()},fetch_1}var path={},hasRequiredPath;function requirePath(){return hasRequiredPath||(hasRequiredPath=1,(function(f){var c=f,v=c.isAbsolute=function(i){return/^(?:\/|\w+:)/.test(i)},l=c.normalize=function(i){i=i.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var e=i.split("/"),r=v(i),t="";r&&(t=e.shift()+"/");for(var n=0;n<e.length;)e[n]===".."?n>0&&e[n-1]!==".."?e.splice(--n,2):r?e.splice(n,1):++n:e[n]==="."?e.splice(n,1):++n;return t+e.join("/")};c.resolve=function(i,e,r){return r||(e=l(e)),v(e)?e:(r||(i=l(i)),(i=i.replace(/(?:\/|^)[^/]+$/,"")).length?l(i+"/"+e):e)}})(path)),path}var namespace,hasRequiredNamespace;function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=t;var f=requireObject();((t.prototype=Object.create(f.prototype)).constructor=t).className="Namespace";var c=requireField(),v=requireUtil(),l=requireOneof(),o,i,e;t.fromJSON=function(s,u){return new t(s,u.options).addJSON(u.nested)};function r(d,s){if(d&&d.length){for(var u={},a=0;a<d.length;++a)u[d[a].name]=d[a].toJSON(s);return u}}t.arrayToJSON=r,t.isReservedId=function(s,u){if(s){for(var a=0;a<s.length;++a)if(typeof s[a]!="string"&&s[a][0]<=u&&s[a][1]>u)return!0}return!1},t.isReservedName=function(s,u){if(s){for(var a=0;a<s.length;++a)if(s[a]===u)return!0}return!1};function t(d,s){f.call(this,d,s),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function n(d){d._nestedArray=null,d._lookupCache={};for(var s=d;s=s.parent;)s._lookupCache={};return d}return Object.defineProperty(t.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=v.toArray(this.nested))}}),t.prototype.toJSON=function(s){return v.toObject(["options",this.options,"nested",r(this.nestedArray,s)])},t.prototype.addJSON=function(s){var u=this;if(s)for(var a=Object.keys(s),h=0,m;h<a.length;++h)m=s[a[h]],u.add((m.fields!==void 0?o.fromJSON:m.values!==void 0?e.fromJSON:m.methods!==void 0?i.fromJSON:m.id!==void 0?c.fromJSON:t.fromJSON)(a[h],m));return this},t.prototype.get=function(s){return this.nested&&this.nested[s]||null},t.prototype.getEnum=function(s){if(this.nested&&this.nested[s]instanceof e)return this.nested[s].values;throw Error("no such enum: "+s)},t.prototype.add=function(s){if(!(s instanceof c&&s.extend!==void 0||s instanceof o||s instanceof l||s instanceof e||s instanceof i||s instanceof t))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var u=this.get(s.name);if(u)if(u instanceof t&&s instanceof t&&!(u instanceof o||u instanceof i)){for(var a=u.nestedArray,h=0;h<a.length;++h)s.add(a[h]);this.remove(u),this.nested||(this.nested={}),s.setOptions(u.options,!0)}else throw Error("duplicate name '"+s.name+"' in "+this)}this.nested[s.name]=s,this instanceof o||this instanceof i||this instanceof e||this instanceof c||s._edition||(s._edition=s._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var m=this;m=m.parent;)m._needsRecursiveFeatureResolution=!0,m._needsRecursiveResolve=!0;return s.onAdd(this),n(this)},t.prototype.remove=function(s){if(!(s instanceof f))throw TypeError("object must be a ReflectionObject");if(s.parent!==this)throw Error(s+" is not a member of "+this);return delete this.nested[s.name],Object.keys(this.nested).length||(this.nested=void 0),s.onRemove(this),n(this)},t.prototype.define=function(s,u){if(v.isString(s))s=s.split(".");else if(!Array.isArray(s))throw TypeError("illegal path");if(s&&s.length&&s[0]==="")throw Error("path must be relative");for(var a=this;s.length>0;){var h=s.shift();if(a.nested&&a.nested[h]){if(a=a.nested[h],!(a instanceof t))throw Error("path conflicts with non-namespace objects")}else a.add(a=new t(h))}return u&&a.addJSON(u),a},t.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var s=this.nestedArray,u=0;for(this.resolve();u<s.length;)s[u]instanceof t?s[u++].resolveAll():s[u++].resolve();return this._needsRecursiveResolve=!1,this},t.prototype._resolveFeaturesRecursive=function(s){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,s=this._edition||s,f.prototype._resolveFeaturesRecursive.call(this,s),this.nestedArray.forEach(u=>{u._resolveFeaturesRecursive(s)}),this):this},t.prototype.lookup=function(s,u,a){if(typeof u=="boolean"?(a=u,u=void 0):u&&!Array.isArray(u)&&(u=[u]),v.isString(s)&&s.length){if(s===".")return this.root;s=s.split(".")}else if(!s.length)return this;var h=s.join(".");if(s[0]==="")return this.root.lookup(s.slice(1),u);var m=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+h];if(m&&(!u||u.indexOf(m.constructor)>-1)||(m=this._lookupImpl(s,h),m&&(!u||u.indexOf(m.constructor)>-1)))return m;if(a)return null;for(var R=this;R.parent;){if(m=R.parent._lookupImpl(s,h),m&&(!u||u.indexOf(m.constructor)>-1))return m;R=R.parent}return null},t.prototype._lookupImpl=function(s,u){if(Object.prototype.hasOwnProperty.call(this._lookupCache,u))return this._lookupCache[u];var a=this.get(s[0]),h=null;if(a)s.length===1?h=a:a instanceof t&&(s=s.slice(1),h=a._lookupImpl(s,s.join(".")));else for(var m=0;m<this.nestedArray.length;++m)this._nestedArray[m]instanceof t&&(a=this._nestedArray[m]._lookupImpl(s,u))&&(h=a);return this._lookupCache[u]=h,h},t.prototype.lookupType=function(s){var u=this.lookup(s,[o]);if(!u)throw Error("no such type: "+s);return u},t.prototype.lookupEnum=function(s){var u=this.lookup(s,[e]);if(!u)throw Error("no such Enum '"+s+"' in "+this);return u},t.prototype.lookupTypeOrEnum=function(s){var u=this.lookup(s,[o,e]);if(!u)throw Error("no such Type or Enum '"+s+"' in "+this);return u},t.prototype.lookupService=function(s){var u=this.lookup(s,[i]);if(!u)throw Error("no such Service '"+s+"' in "+this);return u},t._configure=function(d,s,u){o=d,i=s,e=u},namespace}var mapfield,hasRequiredMapfield;function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=l;var f=requireField();((l.prototype=Object.create(f.prototype)).constructor=l).className="MapField";var c=requireTypes(),v=requireUtil();function l(o,i,e,r,t,n){if(f.call(this,o,i,r,void 0,void 0,t,n),!v.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}return l.fromJSON=function(i,e){return new l(i,e.id,e.keyType,e.type,e.options,e.comment)},l.prototype.toJSON=function(i){var e=i?!!i.keepComments:!1;return v.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if(c.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return f.prototype.resolve.call(this)},l.d=function(i,e,r){return typeof r=="function"?r=v.decorateType(r).name:r&&typeof r=="object"&&(r=v.decorateEnum(r).name),function(n,d){v.decorateType(n.constructor).add(new l(d,i,e,r))}},mapfield}var method,hasRequiredMethod;function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=v;var f=requireObject();((v.prototype=Object.create(f.prototype)).constructor=v).className="Method";var c=requireUtil();function v(l,o,i,e,r,t,n,d,s){if(c.isObject(r)?(n=r,r=t=void 0):c.isObject(t)&&(n=t,t=void 0),!(o===void 0||c.isString(o)))throw TypeError("type must be a string");if(!c.isString(i))throw TypeError("requestType must be a string");if(!c.isString(e))throw TypeError("responseType must be a string");f.call(this,l,n),this.type=o||"rpc",this.requestType=i,this.requestStream=r?!0:void 0,this.responseType=e,this.responseStream=t?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=d,this.parsedOptions=s}return v.fromJSON=function(o,i){return new v(o,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)},v.prototype.toJSON=function(o){var i=o?!!o.keepComments:!1;return c.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",i?this.comment:void 0,"parsedOptions",this.parsedOptions])},v.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),f.prototype.resolve.call(this))},method}var service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=o;var f=requireNamespace();((o.prototype=Object.create(f.prototype)).constructor=o).className="Service";var c=requireMethod(),v=requireUtil(),l=requireRpc();function o(e,r){f.call(this,e,r),this.methods={},this._methodsArray=null}o.fromJSON=function(r,t){var n=new o(r,t.options);if(t.methods)for(var d=Object.keys(t.methods),s=0;s<d.length;++s)n.add(c.fromJSON(d[s],t.methods[d[s]]));return t.nested&&n.addJSON(t.nested),t.edition&&(n._edition=t.edition),n.comment=t.comment,n._defaultEdition="proto3",n},o.prototype.toJSON=function(r){var t=f.prototype.toJSON.call(this,r),n=r?!!r.keepComments:!1;return v.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",f.arrayToJSON(this.methodsArray,r)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(o.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=v.toArray(this.methods))}});function i(e){return e._methodsArray=null,e}return o.prototype.get=function(r){return this.methods[r]||f.prototype.get.call(this,r)},o.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolve.call(this);for(var r=this.methodsArray,t=0;t<r.length;++t)r[t].resolve();return this},o.prototype._resolveFeaturesRecursive=function(r){return this._needsRecursiveFeatureResolution?(r=this._edition||r,f.prototype._resolveFeaturesRecursive.call(this,r),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(r)}),this):this},o.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof c?(this.methods[r.name]=r,r.parent=this,i(this)):f.prototype.add.call(this,r)},o.prototype.remove=function(r){if(r instanceof c){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,i(this)}return f.prototype.remove.call(this,r)},o.prototype.create=function(r,t,n){for(var d=new l.Service(r,t,n),s=0,u;s<this.methodsArray.length;++s){var a=v.lcFirst((u=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");d[a]=v.codegen(["r","c"],v.isReserved(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:u,q:u.resolvedRequestType.ctor,s:u.resolvedResponseType.ctor})}return d},service}var message,hasRequiredMessage;function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=c;var f=requireMinimal();function c(v){if(v)for(var l=Object.keys(v),o=0;o<l.length;++o)this[l[o]]=v[l[o]]}return c.create=function(l){return this.$type.create(l)},c.encode=function(l,o){return this.$type.encode(l,o)},c.encodeDelimited=function(l,o){return this.$type.encodeDelimited(l,o)},c.decode=function(l){return this.$type.decode(l)},c.decodeDelimited=function(l){return this.$type.decodeDelimited(l)},c.verify=function(l){return this.$type.verify(l)},c.fromObject=function(l){return this.$type.fromObject(l)},c.toObject=function(l,o){return this.$type.toObject(l,o)},c.prototype.toJSON=function(){return this.$type.toObject(this,f.toJSONOptions)},message}var decoder_1,hasRequiredDecoder;function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=o;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i){return"missing required '"+i.name+"'"}function o(i){for(var e=v.codegen(["r","l","e"],i.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(i.fieldsArray.filter(function(u){return u.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),r=0;r<i.fieldsArray.length;++r){var t=i._fieldsArray[r].resolve(),n=t.resolvedType instanceof f?"int32":t.type,d="m"+v.safeProp(t.name);e("case %i: {",t.id),t.map?(e("if(%s===util.emptyObject)",d)("%s={}",d)("var c2 = r.uint32()+r.pos"),c.defaults[t.keyType]!==void 0?e("k=%j",c.defaults[t.keyType]):e("k=null"),c.defaults[n]!==void 0?e("value=%j",c.defaults[n]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",t.keyType)("case 2:"),c.basic[n]===void 0?e("value=types[%i].decode(r,r.uint32())",r):e("value=r.%s()",n),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),c.long[t.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',d):e("%s[k]=value",d)):t.repeated?(e("if(!(%s&&%s.length))",d,d)("%s=[]",d),c.packed[n]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",d,n)("}else"),c.basic[n]===void 0?e(t.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",d,r):e("%s.push(r.%s())",d,n)):c.basic[n]===void 0?e(t.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",d,r):e("%s=r.%s()",d,n),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<i._fieldsArray.length;++r){var s=i._fieldsArray[r];s.required&&e("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})",l(s))}return e("return m")}return decoder_1}var verifier_1,hasRequiredVerifier;function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=i;var f=require_enum(),c=requireUtil();function v(e,r){return e.name+": "+r+(e.repeated&&r!=="array"?"[]":e.map&&r!=="object"?"{k:"+e.keyType+"}":"")+" expected"}function l(e,r,t,n){if(r.resolvedType)if(r.resolvedType instanceof f){e("switch(%s){",n)("default:")("return%j",v(r,"enum value"));for(var d=Object.keys(r.resolvedType.values),s=0;s<d.length;++s)e("case %i:",r.resolvedType.values[d[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",t,n)("if(e)")("return%j+e",r.name+".")("}");else switch(r.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",v(r,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",v(r,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",v(r,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",v(r,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",v(r,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",v(r,"buffer"));break}return e}function o(e,r,t){switch(r.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",t)("return%j",v(r,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",t)("return%j",v(r,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",t)("return%j",v(r,"boolean key"));break}return e}function i(e){var r=c.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=e.oneofsArray,n={};t.length&&r("var p={}");for(var d=0;d<e.fieldsArray.length;++d){var s=e._fieldsArray[d].resolve(),u="m"+c.safeProp(s.name);if(s.optional&&r("if(%s!=null&&m.hasOwnProperty(%j)){",u,s.name),s.map)r("if(!util.isObject(%s))",u)("return%j",v(s,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),o(r,s,"k[i]"),l(r,s,d,u+"[k[i]]")("}");else if(s.repeated)r("if(!Array.isArray(%s))",u)("return%j",v(s,"array"))("for(var i=0;i<%s.length;++i){",u),l(r,s,d,u+"[i]")("}");else{if(s.partOf){var a=c.safeProp(s.partOf.name);n[s.partOf.name]===1&&r("if(p%s===1)",a)("return%j",s.partOf.name+": multiple values"),n[s.partOf.name]=1,r("p%s=1",a)}l(r,s,d,u)}s.optional&&r("}")}return r("return null")}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,(function(f){var c=f,v=require_enum(),l=requireUtil();function o(e,r,t,n){var d=!1;if(r.resolvedType)if(r.resolvedType instanceof v){e("switch(d%s){",n);for(var s=r.resolvedType.values,u=Object.keys(s),a=0;a<u.length;++a)s[u[a]]===r.typeDefault&&!d&&(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),r.repeated||e("break"),d=!0),e("case%j:",u[a])("case %i:",s[u[a]])("m%s=%j",n,s[u[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",r.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,t,n);else{var h=!1;switch(r.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":h=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,h)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,h?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n);break}}return e}c.fromObject=function(r){var t=r.fieldsArray,n=l.codegen(["d"],r.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var d=0;d<t.length;++d){var s=t[d].resolve(),u=l.safeProp(s.name);s.map?(n("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),o(n,s,d,u+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),o(n,s,d,u+"[i]")("}")("}")):(s.resolvedType instanceof v||n("if(d%s!=null){",u),o(n,s,d,u),s.resolvedType instanceof v||n("}"))}return n("return m")};function i(e,r,t,n){if(r.resolvedType)r.resolvedType instanceof v?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,t,n,n,t,n,n):e("d%s=types[%i].toObject(m%s,o)",n,t,n);else{var d=!1;switch(r.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":d=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,d?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n);break}}return e}c.toObject=function(r){var t=r.fieldsArray.slice().sort(l.compareFieldsById);if(!t.length)return l.codegen()("return {}");for(var n=l.codegen(["m","o"],r.name+"$toObject")("if(!o)")("o={}")("var d={}"),d=[],s=[],u=[],a=0;a<t.length;++a)t[a].partOf||(t[a].resolve().repeated?d:t[a].map?s:u).push(t[a]);if(d.length){for(n("if(o.arrays||o.defaults){"),a=0;a<d.length;++a)n("d%s=[]",l.safeProp(d[a].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),a=0;a<s.length;++a)n("d%s={}",l.safeProp(s[a].name));n("}")}if(u.length){for(n("if(o.defaults){"),a=0;a<u.length;++a){var h=u[a],m=l.safeProp(h.name);if(h.resolvedType instanceof v)n("d%s=o.enums===String?%j:%j",m,h.resolvedType.valuesById[h.typeDefault],h.typeDefault);else if(h.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",h.typeDefault.low,h.typeDefault.high,h.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",m)("}else")("d%s=o.longs===String?%j:%i",m,h.typeDefault.toString(),h.typeDefault.toNumber());else if(h.bytes){var R="["+Array.prototype.slice.call(h.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",m,String.fromCharCode.apply(String,h.typeDefault))("else{")("d%s=%s",m,R)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",m,m)("}")}else n("d%s=%j",m,h.typeDefault)}n("}")}var g=!1;for(a=0;a<t.length;++a){var h=t[a],y=r._fieldsArray.indexOf(h),m=l.safeProp(h.name);h.map?(g||(g=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",m,m)("d%s={}",m)("for(var j=0;j<ks2.length;++j){"),i(n,h,y,m+"[ks2[j]]")("}")):h.repeated?(n("if(m%s&&m%s.length){",m,m)("d%s=[]",m)("for(var j=0;j<m%s.length;++j){",m),i(n,h,y,m+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",m,h.name),i(n,h,y,m),h.partOf&&n("if(o.oneofs)")("d%s=%j",l.safeProp(h.partOf.name),h.name)),n("}")}return n("return d")}})(converter)),converter}var wrappers={},hasRequiredWrappers;function requireWrappers(){return hasRequiredWrappers||(hasRequiredWrappers=1,(function(f){var c=f,v=requireMessage();c[".google.protobuf.Any"]={fromObject:function(l){if(l&&l["@type"]){var o=l["@type"].substring(l["@type"].lastIndexOf("/")+1),i=this.lookup(o);if(i){var e=l["@type"].charAt(0)==="."?l["@type"].slice(1):l["@type"];return e.indexOf("/")===-1&&(e="/"+e),this.create({type_url:e,value:i.encode(i.fromObject(l)).finish()})}}return this.fromObject(l)},toObject:function(l,o){var i="type.googleapis.com/",e="",r="";if(o&&o.json&&l.type_url&&l.value){r=l.type_url.substring(l.type_url.lastIndexOf("/")+1),e=l.type_url.substring(0,l.type_url.lastIndexOf("/")+1);var t=this.lookup(r);t&&(l=t.decode(l.value))}if(!(l instanceof this.ctor)&&l instanceof v){var n=l.$type.toObject(l,o),d=l.$type.fullName[0]==="."?l.$type.fullName.slice(1):l.$type.fullName;return e===""&&(e=i),r=e+d,n["@type"]=r,n}return this.toObject(l,o)}}})(wrappers)),wrappers}var type,hasRequiredType;function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=m;var f=requireNamespace();((m.prototype=Object.create(f.prototype)).constructor=m).className="Type";var c=require_enum(),v=requireOneof(),l=requireField(),o=requireMapfield(),i=requireService(),e=requireMessage(),r=requireReader(),t=requireWriter(),n=requireUtil(),d=requireEncoder(),s=requireDecoder(),u=requireVerifier(),a=requireConverter(),h=requireWrappers();function m(g,y){f.call(this,g,y),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(m.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var g=Object.keys(this.fields),y=0;y<g.length;++y){var O=this.fields[g[y]],b=O.id;if(this._fieldsById[b])throw Error("duplicate id "+b+" in "+this);this._fieldsById[b]=O}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=n.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=n.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(g){var y=g.prototype;y instanceof e||((g.prototype=new e).constructor=g,n.merge(g.prototype,y)),g.$type=g.prototype.$type=this,n.merge(g,e,!0),this._ctor=g;for(var O=0;O<this.fieldsArray.length;++O)this._fieldsArray[O].resolve();var b={};for(O=0;O<this.oneofsArray.length;++O)b[this._oneofsArray[O].resolve().name]={get:n.oneOfGetter(this._oneofsArray[O].oneof),set:n.oneOfSetter(this._oneofsArray[O].oneof)};O&&Object.defineProperties(g.prototype,b)}}}),m.generateConstructor=function(y){for(var O=n.codegen(["p"],y.name),b=0,k;b<y.fieldsArray.length;++b)(k=y._fieldsArray[b]).map?O("this%s={}",n.safeProp(k.name)):k.repeated&&O("this%s=[]",n.safeProp(k.name));return O("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function R(g){return g._fieldsById=g._fieldsArray=g._oneofsArray=null,delete g.encode,delete g.decode,delete g.verify,g}return m.fromJSON=function(y,O){var b=new m(y,O.options);b.extensions=O.extensions,b.reserved=O.reserved;for(var k=Object.keys(O.fields),F=0;F<k.length;++F)b.add((typeof O.fields[k[F]].keyType<"u"?o.fromJSON:l.fromJSON)(k[F],O.fields[k[F]]));if(O.oneofs)for(k=Object.keys(O.oneofs),F=0;F<k.length;++F)b.add(v.fromJSON(k[F],O.oneofs[k[F]]));if(O.nested)for(k=Object.keys(O.nested),F=0;F<k.length;++F){var I=O.nested[k[F]];b.add((I.id!==void 0?l.fromJSON:I.fields!==void 0?m.fromJSON:I.values!==void 0?c.fromJSON:I.methods!==void 0?i.fromJSON:f.fromJSON)(k[F],I))}return O.extensions&&O.extensions.length&&(b.extensions=O.extensions),O.reserved&&O.reserved.length&&(b.reserved=O.reserved),O.group&&(b.group=!0),O.comment&&(b.comment=O.comment),O.edition&&(b._edition=O.edition),b._defaultEdition="proto3",b},m.prototype.toJSON=function(y){var O=f.prototype.toJSON.call(this,y),b=y?!!y.keepComments:!1;return n.toObject(["edition",this._editionToJSON(),"options",O&&O.options||void 0,"oneofs",f.arrayToJSON(this.oneofsArray,y),"fields",f.arrayToJSON(this.fieldsArray.filter(function(k){return!k.declaringField}),y)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",O&&O.nested||void 0,"comment",b?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolveAll.call(this);var y=this.oneofsArray;for(b=0;b<y.length;)y[b++].resolve();for(var O=this.fieldsArray,b=0;b<O.length;)O[b++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(y){return this._needsRecursiveFeatureResolution?(y=this._edition||y,f.prototype._resolveFeaturesRecursive.call(this,y),this.oneofsArray.forEach(O=>{O._resolveFeatures(y)}),this.fieldsArray.forEach(O=>{O._resolveFeatures(y)}),this):this},m.prototype.get=function(y){return this.fields[y]||this.oneofs&&this.oneofs[y]||this.nested&&this.nested[y]||null},m.prototype.add=function(y){if(this.get(y.name))throw Error("duplicate name '"+y.name+"' in "+this);if(y instanceof l&&y.extend===void 0){if(this._fieldsById?this._fieldsById[y.id]:this.fieldsById[y.id])throw Error("duplicate id "+y.id+" in "+this);if(this.isReservedId(y.id))throw Error("id "+y.id+" is reserved in "+this);if(this.isReservedName(y.name))throw Error("name '"+y.name+"' is reserved in "+this);return y.parent&&y.parent.remove(y),this.fields[y.name]=y,y.message=this,y.onAdd(this),R(this)}return y instanceof v?(this.oneofs||(this.oneofs={}),this.oneofs[y.name]=y,y.onAdd(this),R(this)):f.prototype.add.call(this,y)},m.prototype.remove=function(y){if(y instanceof l&&y.extend===void 0){if(!this.fields||this.fields[y.name]!==y)throw Error(y+" is not a member of "+this);return delete this.fields[y.name],y.parent=null,y.onRemove(this),R(this)}if(y instanceof v){if(!this.oneofs||this.oneofs[y.name]!==y)throw Error(y+" is not a member of "+this);return delete this.oneofs[y.name],y.parent=null,y.onRemove(this),R(this)}return f.prototype.remove.call(this,y)},m.prototype.isReservedId=function(y){return f.isReservedId(this.reserved,y)},m.prototype.isReservedName=function(y){return f.isReservedName(this.reserved,y)},m.prototype.create=function(y){return new this.ctor(y)},m.prototype.setup=function(){for(var y=this.fullName,O=[],b=0;b<this.fieldsArray.length;++b)O.push(this._fieldsArray[b].resolve().resolvedType);this.encode=d(this)({Writer:t,types:O,util:n}),this.decode=s(this)({Reader:r,types:O,util:n}),this.verify=u(this)({types:O,util:n}),this.fromObject=a.fromObject(this)({types:O,util:n}),this.toObject=a.toObject(this)({types:O,util:n});var k=h[y];if(k){var F=Object.create(this);F.fromObject=this.fromObject,this.fromObject=k.fromObject.bind(F),F.toObject=this.toObject,this.toObject=k.toObject.bind(F)}return this},m.prototype.encode=function(y,O){return this.setup().encode(y,O)},m.prototype.encodeDelimited=function(y,O){return this.encode(y,O&&O.len?O.fork():O).ldelim()},m.prototype.decode=function(y,O){return this.setup().decode(y,O)},m.prototype.decodeDelimited=function(y){return y instanceof r||(y=r.create(y)),this.decode(y,y.uint32())},m.prototype.verify=function(y){return this.setup().verify(y)},m.prototype.fromObject=function(y){return this.setup().fromObject(y)},m.prototype.toObject=function(y,O){return this.setup().toObject(y,O)},m.d=function(y){return function(b){n.decorateType(b,y)}},type}var root,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=t;var f=requireNamespace();((t.prototype=Object.create(f.prototype)).constructor=t).className="Root";var c=requireField(),v=require_enum(),l=requireOneof(),o=requireUtil(),i,e,r;function t(u){f.call(this,"",u),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}t.fromJSON=function(a,h){return h||(h=new t),a.options&&h.setOptions(a.options),h.addJSON(a.nested).resolveAll()},t.prototype.resolvePath=o.path.resolve,t.prototype.fetch=o.fetch;function n(){}t.prototype.load=function u(a,h,m){typeof h=="function"&&(m=h,h=void 0);var R=this;if(!m)return o.asPromise(u,R,a,h);var g=m===n;function y(V,N){if(m){if(g)throw V;N&&N.resolveAll();var w=m;m=null,w(V,N)}}function O(V){var N=V.lastIndexOf("google/protobuf/");if(N>-1){var w=V.substring(N);if(w in r)return w}return null}function b(V,N){try{if(o.isString(N)&&N.charAt(0)==="{"&&(N=JSON.parse(N)),!o.isString(N))R.setOptions(N.options).addJSON(N.nested);else{e.filename=V;var w=e(N,R,h),E,C=0;if(w.imports)for(;C<w.imports.length;++C)(E=O(w.imports[C])||R.resolvePath(V,w.imports[C]))&&k(E);if(w.weakImports)for(C=0;C<w.weakImports.length;++C)(E=O(w.weakImports[C])||R.resolvePath(V,w.weakImports[C]))&&k(E,!0)}}catch(A){y(A)}!g&&!F&&y(null,R)}function k(V,N){if(V=O(V)||V,!(R.files.indexOf(V)>-1)){if(R.files.push(V),V in r){g?b(V,r[V]):(++F,setTimeout(function(){--F,b(V,r[V])}));return}if(g){var w;try{w=o.fs.readFileSync(V).toString("utf8")}catch(E){N||y(E);return}b(V,w)}else++F,R.fetch(V,function(E,C){if(--F,!!m){if(E){N?F||y(null,R):y(E);return}b(V,C)}})}}var F=0;o.isString(a)&&(a=[a]);for(var I=0,j;I<a.length;++I)(j=R.resolvePath("",a[I]))&&k(j);return g?(R.resolveAll(),R):(F||y(null,R),R)},t.prototype.loadSync=function(a,h){if(!o.isNode)throw Error("not supported");return this.load(a,h,n)},t.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(a){return"'extend "+a.extend+"' in "+a.parent.fullName}).join(", "));return f.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function s(u,a){var h=a.parent.lookup(a.extend);if(h){var m=new c(a.fullName,a.id,a.type,a.rule,void 0,a.options);return h.get(m.name)||(m.declaringField=a,a.extensionField=m,h.add(m)),!0}return!1}return t.prototype._handleAdd=function(a){if(a instanceof c)a.extend!==void 0&&!a.extensionField&&(s(this,a)||this.deferred.push(a));else if(a instanceof v)d.test(a.name)&&(a.parent[a.name]=a.values);else if(!(a instanceof l)){if(a instanceof i)for(var h=0;h<this.deferred.length;)s(this,this.deferred[h])?this.deferred.splice(h,1):++h;for(var m=0;m<a.nestedArray.length;++m)this._handleAdd(a._nestedArray[m]);d.test(a.name)&&(a.parent[a.name]=a)}(a instanceof i||a instanceof v||a instanceof c)&&(this._fullyQualifiedObjects[a.fullName]=a)},t.prototype._handleRemove=function(a){if(a instanceof c){if(a.extend!==void 0)if(a.extensionField)a.extensionField.parent.remove(a.extensionField),a.extensionField=null;else{var h=this.deferred.indexOf(a);h>-1&&this.deferred.splice(h,1)}}else if(a instanceof v)d.test(a.name)&&delete a.parent[a.name];else if(a instanceof f){for(var m=0;m<a.nestedArray.length;++m)this._handleRemove(a._nestedArray[m]);d.test(a.name)&&delete a.parent[a.name]}delete this._fullyQualifiedObjects[a.fullName]},t._configure=function(u,a,h){i=u,e=a,r=h},root}var hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util.exports;hasRequiredUtil=1;var f=util.exports=requireMinimal(),c=requireRoots(),v,l;f.codegen=requireCodegen(),f.fetch=requireFetch(),f.path=requirePath(),f.fs=f.inquire("fs"),f.toArray=function(n){if(n){for(var d=Object.keys(n),s=new Array(d.length),u=0;u<d.length;)s[u]=n[d[u++]];return s}return[]},f.toObject=function(n){for(var d={},s=0;s<n.length;){var u=n[s++],a=n[s++];a!==void 0&&(d[u]=a)}return d};var o=/\\/g,i=/"/g;f.isReserved=function(n){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(n)},f.safeProp=function(n){return!/^[$\w_]+$/.test(n)||f.isReserved(n)?'["'+n.replace(o,"\\\\").replace(i,'\\"')+'"]':"."+n},f.ucFirst=function(n){return n.charAt(0).toUpperCase()+n.substring(1)};var e=/_([a-z])/g;f.camelCase=function(n){return n.substring(0,1)+n.substring(1).replace(e,function(d,s){return s.toUpperCase()})},f.compareFieldsById=function(n,d){return n.id-d.id},f.decorateType=function(n,d){if(n.$type)return d&&n.$type.name!==d&&(f.decorateRoot.remove(n.$type),n.$type.name=d,f.decorateRoot.add(n.$type)),n.$type;v||(v=requireType());var s=new v(d||n.name);return f.decorateRoot.add(s),s.ctor=n,Object.defineProperty(n,"$type",{value:s,enumerable:!1}),Object.defineProperty(n.prototype,"$type",{value:s,enumerable:!1}),s};var r=0;return f.decorateEnum=function(n){if(n.$type)return n.$type;l||(l=require_enum());var d=new l("Enum"+r++,n);return f.decorateRoot.add(d),Object.defineProperty(n,"$type",{value:d,enumerable:!1}),d},f.setProperty=function(n,d,s,u){function a(h,m,R){var g=m.shift();if(g==="__proto__"||g==="prototype")return h;if(m.length>0)h[g]=a(h[g]||{},m,R);else{var y=h[g];if(y&&u)return h;y&&(R=[].concat(y).concat(R)),h[g]=R}return h}if(typeof n!="object")throw TypeError("dst must be an object");if(!d)throw TypeError("path must be specified");return d=d.split("."),a(n,d,s)},Object.defineProperty(f,"decorateRoot",{get:function(){return c.decorated||(c.decorated=new(requireRoot()))}}),util.exports}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(f){var c=f,v=requireUtil(),l=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(i,e){var r=0,t={};for(e|=0;r<i.length;)t[l[r+e]]=i[r++];return t}c.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),c.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",v.emptyArray,null]),c.long=o([0,0,0,1,1],7),c.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),c.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])})(types)),types}var field,hasRequiredField;function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=e;var f=requireObject();((e.prototype=Object.create(f.prototype)).constructor=e).className="Field";var c=require_enum(),v=requireTypes(),l=requireUtil(),o,i=/^required|optional|repeated$/;e.fromJSON=function(t,n){var d=new e(t,n.id,n.type,n.rule,n.extend,n.options,n.comment);return n.edition&&(d._edition=n.edition),d._defaultEdition="proto3",d};function e(r,t,n,d,s,u,a){if(l.isObject(d)?(a=s,u=d,d=s=void 0):l.isObject(s)&&(a=u,u=s,s=void 0),f.call(this,r,u),!l.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!l.isString(n))throw TypeError("type must be a string");if(d!==void 0&&!i.test(d=d.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==void 0&&!l.isString(s))throw TypeError("extend must be a string");d==="proto3_optional"&&(d="optional"),this.rule=d&&d!=="optional"?d:void 0,this.type=n,this.id=t,this.extend=s||void 0,this.repeated=d==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=l.Long?v.long[n]!==void 0:!1,this.bytes=n==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=a}return Object.defineProperty(e.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}}),Object.defineProperty(e.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(e.prototype,"delimited",{get:function(){return this.resolvedType instanceof o&&this._features.message_encoding==="DELIMITED"}}),Object.defineProperty(e.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}}),Object.defineProperty(e.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}}),e.prototype.setOption=function(t,n,d){return f.prototype.setOption.call(this,t,n,d)},e.prototype.toJSON=function(t){var n=t?!!t.keepComments:!1;return l.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",n?this.comment:void 0])},e.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=v.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof c&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof c)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=l.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var t;l.base64.test(this.typeDefault)?l.base64.decode(this.typeDefault,t=l.newBuffer(l.base64.length(this.typeDefault)),0):l.utf8.write(this.typeDefault,t=l.newBuffer(l.utf8.length(this.typeDefault)),0),this.typeDefault=t}return this.map?this.defaultValue=l.emptyObject:this.repeated?this.defaultValue=l.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),f.prototype.resolve.call(this)},e.prototype._inferLegacyProtoFeatures=function(t){if(t!=="proto2"&&t!=="proto3")return{};var n={};if(this.rule==="required"&&(n.field_presence="LEGACY_REQUIRED"),this.parent&&v.defaults[this.type]===void 0){var d=this.parent.get(this.type.split(".").pop());d&&d instanceof o&&d.group&&(n.message_encoding="DELIMITED")}return this.getOption("packed")===!0?n.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(n.repeated_field_encoding="EXPANDED"),n},e.prototype._resolveFeatures=function(t){return f.prototype._resolveFeatures.call(this,this._edition||t)},e.d=function(t,n,d,s){return typeof n=="function"?n=l.decorateType(n).name:n&&typeof n=="object"&&(n=l.decorateEnum(n).name),function(a,h){l.decorateType(a.constructor).add(new e(h,t,n,d,{default:s}))}},e._configure=function(t){o=t},field}var oneof,hasRequiredOneof;function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=l;var f=requireObject();((l.prototype=Object.create(f.prototype)).constructor=l).className="OneOf";var c=requireField(),v=requireUtil();function l(i,e,r,t){if(Array.isArray(e)||(r=e,e=void 0),f.call(this,i,r),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=t}l.fromJSON=function(e,r){return new l(e,r.oneof,r.options,r.comment)},l.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return v.toObject(["options",this.options,"oneof",this.oneof,"comment",r?this.comment:void 0])};function o(i){if(i.parent)for(var e=0;e<i.fieldsArray.length;++e)i.fieldsArray[e].parent||i.parent.add(i.fieldsArray[e])}return l.prototype.add=function(e){if(!(e instanceof c))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},l.prototype.remove=function(e){if(!(e instanceof c))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),r=this.oneof.indexOf(e.name),r>-1&&this.oneof.splice(r,1),e.partOf=null,this},l.prototype.onAdd=function(e){f.prototype.onAdd.call(this,e);for(var r=this,t=0;t<this.oneof.length;++t){var n=e.get(this.oneof[t]);n&&!n.partOf&&(n.partOf=r,r.fieldsArray.push(n))}o(this)},l.prototype.onRemove=function(e){for(var r=0,t;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);f.prototype.onRemove.call(this,e)},Object.defineProperty(l.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var i=this.fieldsArray[0];return i.options!=null&&i.options.proto3_optional===!0}}),l.d=function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;)e[r]=arguments[r++];return function(n,d){v.decorateType(n.constructor).add(new l(d,e)),Object.defineProperty(n,d,{get:v.oneOfGetter(e),set:v.oneOfSetter(e)})}},oneof}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=e,e.className="ReflectionObject";const f=requireOneof();var c=requireUtil(),v,l={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},o={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},i={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function e(r,t){if(!c.isString(r))throw TypeError("name must be a string");if(t&&!c.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(e.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],t=this.parent;t;)r.unshift(t.name),t=t.parent;return r.join(".")}}}),e.prototype.toJSON=function(){throw Error()},e.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;var n=t.root;n instanceof v&&n._handleAdd(this)},e.prototype.onRemove=function(t){var n=t.root;n instanceof v&&n._handleRemove(this),this.parent=null,this.resolved=!1},e.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v&&(this.resolved=!0),this)},e.prototype._resolveFeaturesRecursive=function(t){return this._resolveFeatures(this._edition||t)},e.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var n={};if(!t)throw new Error("Unknown edition for "+this.fullName);var d=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if(t==="proto2")n=Object.assign({},o);else if(t==="proto3")n=Object.assign({},i);else if(t==="2023")n=Object.assign({},l);else throw new Error("Unknown edition: "+t);this._features=Object.assign(n,d||{}),this._featuresResolved=!0;return}if(this.partOf instanceof f){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,d||{})}else if(!this.declaringField)if(this.parent){var u=Object.assign({},this.parent._features);this._features=Object.assign(u,d||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},e.prototype._inferLegacyProtoFeatures=function(){return{}},e.prototype.getOption=function(t){if(this.options)return this.options[t]},e.prototype.setOption=function(t,n,d){return this.options||(this.options={}),/^features\./.test(t)?c.setProperty(this.options,t,n,d):(!d||this.options[t]===void 0)&&(this.getOption(t)!==n&&(this.resolved=!1),this.options[t]=n),this},e.prototype.setParsedOption=function(t,n,d){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(d){var u=s.find(function(m){return Object.prototype.hasOwnProperty.call(m,t)});if(u){var a=u[t];c.setProperty(a,d,n)}else u={},u[t]=c.setProperty({},d,n),s.push(u)}else{var h={};h[t]=n,s.push(h)}return this},e.prototype.setOptions=function(t,n){if(t)for(var d=Object.keys(t),s=0;s<d.length;++s)this.setOption(d[s],t[d[s]],n);return this},e.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t},e.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition},e._configure=function(r){v=r},object}var _enum,hasRequired_enum;function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=l;var f=requireObject();((l.prototype=Object.create(f.prototype)).constructor=l).className="Enum";var c=requireNamespace(),v=requireUtil();function l(o,i,e,r,t,n){if(f.call(this,o,e),i&&typeof i!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=t||{},this.valuesOptions=n,this._valuesFeatures={},this.reserved=void 0,i)for(var d=Object.keys(i),s=0;s<d.length;++s)typeof i[d[s]]=="number"&&(this.valuesById[this.values[d[s]]=i[d[s]]]=d[s])}return l.prototype._resolveFeatures=function(i){return i=this._edition||i,f.prototype._resolveFeatures.call(this,i),Object.keys(this.values).forEach(e=>{var r=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(r,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},l.fromJSON=function(i,e){var r=new l(i,e.values,e.options,e.comment,e.comments);return r.reserved=e.reserved,e.edition&&(r._edition=e.edition),r._defaultEdition="proto3",r},l.prototype.toJSON=function(i){var e=i?!!i.keepComments:!1;return v.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",e?this.comment:void 0,"comments",e?this.comments:void 0])},l.prototype.add=function(i,e,r,t){if(!v.isString(i))throw TypeError("name must be a string");if(!v.isInteger(e))throw TypeError("id must be an integer");if(this.values[i]!==void 0)throw Error("duplicate name '"+i+"' in "+this);if(this.isReservedId(e))throw Error("id "+e+" is reserved in "+this);if(this.isReservedName(i))throw Error("name '"+i+"' is reserved in "+this);if(this.valuesById[e]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+e+" in "+this);this.values[i]=e}else this.valuesById[this.values[i]=e]=i;return t&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[i]=t||null),this.comments[i]=r||null,this},l.prototype.remove=function(i){if(!v.isString(i))throw TypeError("name must be a string");var e=this.values[i];if(e==null)throw Error("name '"+i+"' does not exist in "+this);return delete this.valuesById[e],delete this.values[i],delete this.comments[i],this.valuesOptions&&delete this.valuesOptions[i],this},l.prototype.isReservedId=function(i){return c.isReservedId(this.reserved,i)},l.prototype.isReservedName=function(i){return c.isReservedName(this.reserved,i)},_enum}var encoder_1,hasRequiredEncoder;function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=o;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i,e,r,t){return e.delimited?i("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,t,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):i("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,t,(e.id<<3|2)>>>0)}function o(i){for(var e=v.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),r,t,n=i.fieldsArray.slice().sort(v.compareFieldsById),r=0;r<n.length;++r){var d=n[r].resolve(),s=i._fieldsArray.indexOf(d),u=d.resolvedType instanceof f?"int32":d.type,a=c.basic[u];t="m"+v.safeProp(d.name),d.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,d.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(d.id<<3|2)>>>0,8|c.mapKey[d.keyType],d.keyType),a===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,t):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|a,u,t),e("}")("}")):d.repeated?(e("if(%s!=null&&%s.length){",t,t),d.packed&&c.packed[u]!==void 0?e("w.uint32(%i).fork()",(d.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",u,t)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",t),a===void 0?l(e,d,s,t+"[i]"):e("w.uint32(%i).%s(%s[i])",(d.id<<3|a)>>>0,u,t)),e("}")):(d.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,d.name),a===void 0?l(e,d,s,t):e("w.uint32(%i).%s(%s)",(d.id<<3|a)>>>0,u,t))}return e("return w")}return encoder_1}var hasRequiredIndexLight;function requireIndexLight(){if(hasRequiredIndexLight)return indexLight.exports;hasRequiredIndexLight=1;var f=indexLight.exports=requireIndexMinimal();f.build="light";function c(l,o,i){return typeof o=="function"?(i=o,o=new f.Root):o||(o=new f.Root),o.load(l,i)}f.load=c;function v(l,o){return o||(o=new f.Root),o.loadSync(l)}return f.loadSync=v,f.encoder=requireEncoder(),f.decoder=requireDecoder(),f.verifier=requireVerifier(),f.converter=requireConverter(),f.ReflectionObject=requireObject(),f.Namespace=requireNamespace(),f.Root=requireRoot(),f.Enum=require_enum(),f.Type=requireType(),f.Field=requireField(),f.OneOf=requireOneof(),f.MapField=requireMapfield(),f.Service=requireService(),f.Method=requireMethod(),f.Message=requireMessage(),f.wrappers=requireWrappers(),f.types=requireTypes(),f.util=requireUtil(),f.ReflectionObject._configure(f.Root),f.Namespace._configure(f.Type,f.Service,f.Enum),f.Root._configure(f.Type),f.Field._configure(f.Type),indexLight.exports}var tokenize_1,hasRequiredTokenize;function requireTokenize(){if(hasRequiredTokenize)return tokenize_1;hasRequiredTokenize=1,tokenize_1=d;var f=/[\s{}=;:[\],'"()<>]/g,c=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,v=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,l=/^ *[*/]+ */,o=/^\s*\*?\/*/,i=/\n/g,e=/\s/,r=/\\(.?)/g,t={0:"\0",r:"\r",n:`
|
|
5
|
-
`,t:" "};function n(s){return s.replace(r,function(u,a){switch(a){case"\\":case"":return a;default:return t[a]||""}})}d.unescape=n;function d(s,u){s=s.toString();var a=0,h=s.length,m=1,R=0,g={},y=[],O=null;function b(_){return Error("illegal "+_+" (line "+m+")")}function k(){var _=O==="'"?v:c;_.lastIndex=a-1;var M=_.exec(s);if(!M)throw b("string");return a=_.lastIndex,w(O),O=null,n(M[1])}function F(_){return s.charAt(_)}function I(_,M,L){var D={type:s.charAt(_++),lineEmpty:!1,leading:L},B;u?B=2:B=3;var J=_-B,z;do if(--J<0||(z=s.charAt(J))===`
|
|
6
|
-
`){D.lineEmpty=!0;break}while(z===" "||z===" ");for(var W=s.substring(_,M).split(i),K=0;K<W.length;++K)W[K]=W[K].replace(u?o:l,"").trim();D.text=W.join(`
|
|
7
|
-
`).trim(),g[m]=D,R=m}function j(_){var M=V(_),L=s.substring(_,M),D=/^\s*\/\//.test(L);return D}function V(_){for(var M=_;M<h&&F(M)!==`
|
|
8
|
-
`;)M++;return M}function N(){if(y.length>0)return y.shift();if(O)return k();var _,M,L,D,B,J=a===0;do{if(a===h)return null;for(_=!1;e.test(L=F(a));)if(L===`
|
|
9
|
-
`&&(J=!0,++m),++a===h)return null;if(F(a)==="/"){if(++a===h)throw b("comment");if(F(a)==="/")if(u){if(D=a,B=!1,j(a-1)){B=!0;do if(a=V(a),a===h||(a++,!J))break;while(j(a))}else a=Math.min(h,V(a)+1);B&&(I(D,a,J),J=!0),m++,_=!0}else{for(B=F(D=a+1)==="/";F(++a)!==`
|
|
10
|
-
`;)if(a===h)return null;++a,B&&(I(D,a-1,J),J=!0),++m,_=!0}else if((L=F(a))==="*"){D=a+1,B=u||F(D)==="*";do{if(L===`
|
|
11
|
-
`&&++m,++a===h)throw b("comment");M=L,L=F(a)}while(M!=="*"||L!=="/");++a,B&&(I(D,a-2,J),J=!0),_=!0}else return"/"}}while(_);var z=a;f.lastIndex=0;var W=f.test(F(z++));if(!W)for(;z<h&&!f.test(F(z));)++z;var K=s.substring(a,a=z);return(K==='"'||K==="'")&&(O=K),K}function w(_){y.push(_)}function E(){if(!y.length){var _=N();if(_===null)return null;w(_)}return y[0]}function C(_,M){var L=E(),D=L===_;if(D)return N(),!0;if(!M)throw b("token '"+L+"', '"+_+"' expected");return!1}function A(_){var M=null,L;return _===void 0?(L=g[m-1],delete g[m-1],L&&(u||L.type==="*"||L.lineEmpty)&&(M=L.leading?L.text:null)):(R<_&&E(),L=g[_],delete g[_],L&&!L.lineEmpty&&(u||L.type==="/")&&(M=L.leading?null:L.text)),M}return Object.defineProperty({next:N,peek:E,push:w,skip:C,cmnt:A},"line",{get:function(){return m}})}return tokenize_1}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=k,k.filename=null,k.defaults={keepCase:!1};var f=requireTokenize(),c=requireRoot(),v=requireType(),l=requireField(),o=requireMapfield(),i=requireOneof(),e=require_enum(),r=requireService(),t=requireMethod(),n=requireObject(),d=requireTypes(),s=requireUtil(),u=/^[1-9][0-9]*$/,a=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,R=/^0[0-7]+$/,g=/^-?0[0-7]+$/,y=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,O=/^[a-zA-Z_][a-zA-Z_0-9]*$/,b=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function k(F,I,j){I instanceof c||(j=I,I=new c),j||(j=k.defaults);var V=j.preferTrailingComment||!1,N=f(F,j.alternateCommentMode||!1),w=N.next,E=N.push,C=N.peek,A=N.skip,_=N.cmnt,M=!0,L,D,B,J="proto2",z=I,W=[],K={},X=j.keepCase?function(P){return P}:s.camelCase;function ce(){W.forEach(P=>{P._edition=J,Object.keys(K).forEach(x=>{P.getOption(x)===void 0&&P.setOption(x,K[x],!0)})})}function U(P,x,p){var S=k.filename;return p||(k.filename=null),Error("illegal "+(x||"token")+" '"+P+"' ("+(S?S+", ":"")+"line "+N.line+")")}function ne(){var P=[],x;do{if((x=w())!=='"'&&x!=="'")throw U(x);P.push(w()),A(x),x=C()}while(x==='"'||x==="'");return P.join("")}function fe(P){var x=w();switch(x){case"'":case'"':return E(x),ne();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return ue(x,!0)}catch{if(b.test(x))return x;throw U(x,"value")}}function se(P,x){var p,S;do if(x&&((p=C())==='"'||p==="'")){var q=ne();if(P.push(q),J>=2023)throw U(q,"id")}else try{P.push([S=me(w()),A("to",!0)?me(w()):S])}catch($){if(x&&b.test(p)&&J>=2023)P.push(p);else throw $}while(A(",",!0));var T={options:void 0};T.setOption=function($,Y){this.options===void 0&&(this.options={}),this.options[$]=Y},pe(T,function(Y){if(Y==="option")de(T,Y),A(";");else throw U(Y)},function(){_e(T)})}function ue(P,x){var p=1;switch(P.charAt(0)==="-"&&(p=-1,P=P.substring(1)),P){case"inf":case"INF":case"Inf":return p*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(u.test(P))return p*parseInt(P,10);if(h.test(P))return p*parseInt(P,16);if(R.test(P))return p*parseInt(P,8);if(y.test(P))return p*parseFloat(P);throw U(P,"number",x)}function me(P,x){switch(P){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!x&&P.charAt(0)==="-")throw U(P,"id");if(a.test(P))return parseInt(P,10);if(m.test(P))return parseInt(P,16);if(g.test(P))return parseInt(P,8);throw U(P,"id")}function oe(){if(L!==void 0)throw U("package");if(L=w(),!b.test(L))throw U(L,"name");z=z.define(L),A(";")}function he(){var P=C(),x;switch(P){case"weak":x=B||(B=[]),w();break;case"public":w();default:x=D||(D=[]);break}P=ne(),A(";"),x.push(P)}function be(){if(A("="),J=ne(),J<2023)throw U(J,"syntax");A(";")}function Se(){if(A("="),J=ne(),!["2023"].includes(J))throw U(J,"edition");A(";")}function Re(P,x){switch(x){case"option":return de(P,x),A(";"),!0;case"message":return Oe(P,x),!0;case"enum":return ge(P,x),!0;case"service":return Ee(P,x),!0;case"extend":return xe(P,x),!0}return!1}function pe(P,x,p){var S=N.line;if(P&&(typeof P.comment!="string"&&(P.comment=_()),P.filename=k.filename),A("{",!0)){for(var q;(q=w())!=="}";)x(q);A(";",!0)}else p&&p(),A(";"),P&&(typeof P.comment!="string"||V)&&(P.comment=_(S)||P.comment)}function Oe(P,x){if(!O.test(x=w()))throw U(x,"type name");var p=new v(x);pe(p,function(q){if(!Re(p,q))switch(q){case"map":Te(p);break;case"required":if(J!=="proto2")throw U(q);case"repeated":ae(p,q);break;case"optional":if(J==="proto3")ae(p,"proto3_optional");else{if(J!=="proto2")throw U(q);ae(p,"optional")}break;case"oneof":we(p,q);break;case"extensions":se(p.extensions||(p.extensions=[]));break;case"reserved":se(p.reserved||(p.reserved=[]),!0);break;default:if(J==="proto2"||!b.test(q))throw U(q);E(q),ae(p,"optional");break}}),P.add(p),P===z&&W.push(p)}function ae(P,x,p){var S=w();if(S==="group"){qe(P,x);return}for(;S.endsWith(".")||C().startsWith(".");)S+=w();if(!b.test(S))throw U(S,"type");var q=w();if(!O.test(q))throw U(q,"name");q=X(q),A("=");var T=new l(q,me(w()),S,x,p);if(pe(T,function(Z){if(Z==="option")de(T,Z),A(";");else throw U(Z)},function(){_e(T)}),x==="proto3_optional"){var $=new i("_"+q);T.setOption("proto3_optional",!0),$.add(T),P.add($)}else P.add(T);P===z&&W.push(T)}function qe(P,x){if(J>=2023)throw U("group");var p=w();if(!O.test(p))throw U(p,"name");var S=s.lcFirst(p);p===S&&(p=s.ucFirst(p)),A("=");var q=me(w()),T=new v(p);T.group=!0;var $=new l(S,q,p,x);$.filename=k.filename,pe(T,function(Z){switch(Z){case"option":de(T,Z),A(";");break;case"required":case"repeated":ae(T,Z);break;case"optional":J==="proto3"?ae(T,"proto3_optional"):ae(T,"optional");break;case"message":Oe(T,Z);break;case"enum":ge(T,Z);break;case"reserved":se(T.reserved||(T.reserved=[]),!0);break;default:throw U(Z)}}),P.add(T).add($)}function Te(P){A("<");var x=w();if(d.mapKey[x]===void 0)throw U(x,"type");A(",");var p=w();if(!b.test(p))throw U(p,"type");A(">");var S=w();if(!O.test(S))throw U(S,"name");A("=");var q=new o(X(S),me(w()),x,p);pe(q,function($){if($==="option")de(q,$),A(";");else throw U($)},function(){_e(q)}),P.add(q)}function we(P,x){if(!O.test(x=w()))throw U(x,"name");var p=new i(X(x));pe(p,function(q){q==="option"?(de(p,q),A(";")):(E(q),ae(p,"optional"))}),P.add(p)}function ge(P,x){if(!O.test(x=w()))throw U(x,"name");var p=new e(x);pe(p,function(q){switch(q){case"option":de(p,q),A(";");break;case"reserved":se(p.reserved||(p.reserved=[]),!0),p.reserved===void 0&&(p.reserved=[]);break;default:ye(p,q)}}),P.add(p),P===z&&W.push(p)}function ye(P,x){if(!O.test(x))throw U(x,"name");A("=");var p=me(w(),!0),S={options:void 0};S.getOption=function(q){return this.options[q]},S.setOption=function(q,T){n.prototype.setOption.call(S,q,T)},S.setParsedOption=function(){},pe(S,function(T){if(T==="option")de(S,T),A(";");else throw U(T)},function(){_e(S)}),P.add(x,p,S.comment,S.parsedOptions||S.options)}function de(P,x){var p,S,q=!0;for(x==="option"&&(x=w());x!=="=";){if(x==="("){var T=w();A(")"),x="("+T+")"}if(q){if(q=!1,x.includes(".")&&!x.includes("(")){var $=x.split(".");p=$[0]+".",x=$[1];continue}p=x}else S=S?S+=x:x;x=w()}var Y=S?p.concat(S):p,Z=Ae(P,Y);S=S&&S[0]==="."?S.slice(1):S,p=p&&p[p.length-1]==="."?p.slice(0,-1):p,ke(P,p,Z,S)}function Ae(P,x){if(A("{",!0)){for(var p={};!A("}",!0);){if(!O.test(ie=w()))throw U(ie,"name");if(ie===null)throw U(ie,"end of input");var S,q=ie;if(A(":",!0),C()==="{")S=Ae(P,x+"."+ie);else if(C()==="["){S=[];var T;if(A("[",!0)){do T=fe(),S.push(T);while(A(",",!0));A("]"),typeof T<"u"&&le(P,x+"."+ie,T)}}else S=fe(),le(P,x+"."+ie,S);var $=p[q];$&&(S=[].concat($).concat(S)),p[q]=S,A(",",!0),A(";",!0)}return p}var Y=fe();return le(P,x,Y),Y}function le(P,x,p){if(z===P&&/^features\./.test(x)){K[x]=p;return}P.setOption&&P.setOption(x,p)}function ke(P,x,p,S){P.setParsedOption&&P.setParsedOption(x,p,S)}function _e(P){if(A("[",!0)){do de(P,"option");while(A(",",!0));A("]")}return P}function Ee(P,x){if(!O.test(x=w()))throw U(x,"service name");var p=new r(x);pe(p,function(q){if(!Re(p,q))if(q==="rpc")Ce(p,q);else throw U(q)}),P.add(p),P===z&&W.push(p)}function Ce(P,x){var p=_(),S=x;if(!O.test(x=w()))throw U(x,"name");var q=x,T,$,Y,Z;if(A("("),A("stream",!0)&&($=!0),!b.test(x=w())||(T=x,A(")"),A("returns"),A("("),A("stream",!0)&&(Z=!0),!b.test(x=w())))throw U(x);Y=x,A(")");var G=new t(q,S,T,Y,$,Z);G.comment=p,pe(G,function(Q){if(Q==="option")de(G,Q),A(";");else throw U(Q)}),P.add(G)}function xe(P,x){if(!b.test(x=w()))throw U(x,"reference");var p=x;pe(null,function(q){switch(q){case"required":case"repeated":ae(P,q,p);break;case"optional":J==="proto3"?ae(P,"proto3_optional",p):ae(P,"optional",p);break;default:if(J==="proto2"||!b.test(q))throw U(q);E(q),ae(P,"optional",p);break}})}for(var ie;(ie=w())!==null;)switch(ie){case"package":if(!M)throw U(ie);oe();break;case"import":if(!M)throw U(ie);he();break;case"syntax":if(!M)throw U(ie);be();break;case"edition":if(!M)throw U(ie);Se();break;case"option":de(z,ie),A(";",!0);break;default:if(Re(z,ie)){M=!1;continue}throw U(ie)}return ce(),k.filename=null,{package:L,imports:D,weakImports:B,root:I}}return parse_1}var common_1,hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common_1;hasRequiredCommon=1,common_1=c;var f=/\/|\./;function c(l,o){f.test(l)||(l="google/protobuf/"+l+".proto",o={nested:{google:{nested:{protobuf:{nested:o}}}}}),c[l]=o}c("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var v;return c("duration",{Duration:v={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),c("timestamp",{Timestamp:v}),c("empty",{Empty:{fields:{}}}),c("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),c("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),c("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),c.get=function(o){return c[o]||null},common_1}var hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src.exports;hasRequiredSrc=1;var f=src.exports=requireIndexLight();return f.build="full",f.tokenize=requireTokenize(),f.parse=requireParse(),f.common=requireCommon(),f.Root._configure(f.Type,f.parse,f.common),src.exports}var protobufjs,hasRequiredProtobufjs;function requireProtobufjs(){return hasRequiredProtobufjs||(hasRequiredProtobufjs=1,protobufjs=requireSrc()),protobufjs}var protobufjsExports=requireProtobufjs();const protobuf=getDefaultExportFromCjs(protobufjsExports),useWebSocket=()=>{const f=vue.ref(null),c=vue.ref("disconnected"),v=vue.ref(!0),l={nested:{Event:{fields:{source:{type:"string",id:1},pageStart:{type:"uint64",id:2},pageEnd:{type:"uint64",id:3},samplePeriod:{type:"double",id:4},pointsPerEvent:{type:"uint64",id:5},isResampled:{type:"bool",id:6},data:{rule:"repeated",type:"double",id:7},times:{rule:"repeated",type:"uint64",id:8},spikeGroup:{rule:"repeated",type:"uint32",id:9}}},Instruction:{fields:{command:{type:"string",id:1},argument:{type:"string",id:2}}},Segment:{fields:{startTs:{type:"uint64",id:1},source:{type:"string",id:2},lastUsed:{type:"uint64",id:3},unit:{type:"string",id:4},samplePeriod:{type:"double",id:5},requestedSamplePeriod:{type:"double",id:6},pageStart:{type:"uint64",id:7},isMinMax:{type:"bool",id:8},unitM:{type:"uint64",id:9},segmentType:{type:"string",id:10},nrPoints:{type:"uint64",id:11},data:{rule:"repeated",type:"double",id:12},pageEnd:{type:"uint64",id:13},channelName:{type:"string",id:14}}},IngestSegment:{fields:{channelId:{type:"string",id:1},startTime:{type:"uint64",id:2},samplePeriod:{type:"double",id:3},data:{rule:"repeated",type:"double",id:4}}},TimeSeriesMessage:{fields:{segment:{type:"Segment",id:3},event:{rule:"repeated",type:"Event",id:4},instruction:{type:"Instruction",id:5},ingestSegment:{type:"IngestSegment",id:6},totalResponses:{type:"uint64",id:7},responseSequenceId:{type:"uint64",id:8}}}}},i=protobuf.Root.fromJSON(l).TimeSeriesMessage;let e=null,r=null,t=null,n=null,d=null,s=null,u=!1,a=null;const h=(_,M=2e3)=>new Promise(L=>{if(!_||_.readyState===WebSocket.CLOSED){L();return}const D=Date.now(),B=()=>{_.readyState===WebSocket.CLOSED||Date.now()-D>M?L():setTimeout(B,50)};B()}),m=async()=>{if(f.value){const _=f.value;console.log("🔌 Disconnecting WebSocket (state:",_.readyState,")"),f.value=null,c.value="disconnected",(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING)&&(_.close(),await h(_))}a=null},R=async(_,M,L)=>{if(a&&(console.log("🔄 Waiting for previous connection to finish..."),await a),f.value){const D=f.value.readyState;(D===WebSocket.CONNECTING||D===WebSocket.OPEN||D===WebSocket.CLOSING)&&(console.log(`🔄 Disconnecting existing WebSocket (state: ${D})`),await m(),await new Promise(B=>setTimeout(B,100)))}console.log("setting packageId to: "+M),s=M,v.value=!0,a=new Promise(async(D,B)=>{try{const J=L||await index.useToken(),z=_+"?session="+J+"&package="+s,W=new WebSocket(z);f.value=W,W.onopen=()=>{console.log("🔗 WebSocket opened for package:",s),g(),D(W)},W.onclose=()=>{console.log("🔌 WebSocket closed for package:",s),y(),D(null)},W.onmessage=O,W.onerror=K=>{console.error("WebSocket error:",K),c.value="disconnected",B(K)},setTimeout(()=>{W.readyState===WebSocket.CONNECTING&&(W.close(),B(new Error("WebSocket connection timeout")))},1e4)}catch(J){console.error("Failed to create WebSocket:",J),B(J)}});try{await a}catch(D){console.error("WebSocket connection failed:",D),a=null}},g=()=>{if(c.value="connected",v.value){if(console.log("📡 Sending initialization messages for package:",s),d&&(console.log("🧹 Clearing channel filters"),d()),s){const _={montage:"NOT_MONTAGED",packageId:s};console.log("🎛️ Sending montage reset:",_),f.value.send(JSON.stringify(_))}v.value=!1}},y=()=>{console.log("📡 WebSocket connection closed"),c.value="disconnected"},O=_=>{if(typeof _.data=="string"){let L={};try{L=JSON.parse(_.data)}catch{n==null||n({error:"JSON Parse Error"});return}L.channelDetails?t==null||t(L.channelDetails):L.error&&(n==null||n(L));return}const M=new FileReader;M.addEventListener("loadend",function(L){const D=L.target.result,B=new Uint8Array(D),J=i.decode(B),z=J.segment;if(J.event&&J.event.length>0&&J.event[0].pageStart){const W=J.event[0],K=[[],[]],X=W.times.length/2;let ce=0;for(let se=0;se<X;se++)K[0].push(W.times[ce]),K[1].push(W.times[ce+1]),ce+=2;let U=new Array(3),ne=0;for(;ne<3;)U[ne]=new Float32Array(K[0].length),ne++;const fe={chId:W.source,lastUsed:0,unit:"uV",samplePeriod:W.samplePeriod,pageStart:W.pageStart,pageEnd:W.pageEnd,startTs:W.pageStart,isMinMax:W.isResampled,unitM:1,type:"Neural",nrPoints:X,parsedData:K,cData:U};r==null||r({pageStart:W.pageStart,data:fe,type:"Neural",nrResponses:J.totalResponses})}if(z!==null){let W=null;z.isMinMax?W=z.data.length/2:W=z.data.length;const K=new Array(3),X=z.startTs;let ce=0,U=0,ne=0;for(;ne<3;)K[ne]=new Float64Array(W),ne++;if(z.isMinMax){let oe=0;for(let he=0;he<W;he++){let be=-z.data[oe],Se=-z.data[oe+1];K[0][he]=X+he*z.samplePeriod,K[1][he]=be,K[2][he]=Se,isNaN(be)||(U++,ce+=be+(Se-be)/2),oe+=2}}else for(let oe=0;oe<W;oe++){let he=-z.data[oe];K[0][oe]=X+oe*z.samplePeriod,K[1][oe]=he,isNaN(he)||(U++,ce+=he)}let fe=0;if(u){const oe=Array.prototype.slice.call(K[1]).sort();fe=oe[Math.round(oe.length/2)]}let se=new Array(3),ue=0;for(;ue<3;)se[ue]=new Float32Array(K[0].length),ue++;const me={chId:z.source,lastUsed:z.lastUsed,unit:z.unit,samplePeriod:z.samplePeriod,pageStart:z.pageStart,pageEnd:z.pageEnd,startTs:X,isMinMax:z.isMinMax,unitM:z.unitM,type:z.segmentType,nrPoints:W,cData:se,parsedData:K,median:fe,sumElem:ce,nrValidPoints:U,name:z.channelName,label:z.channelName};me.nrPoints>0?e==null||e({pageStart:z.pageStart,data:me,type:z.segmentType,nrResponses:J.totalResponses}):e==null||e({pageStart:z.pageStart,data:me,nrResponses:J.totalResponses,type:"gap"})}}),M.readAsArrayBuffer(_.data)},b=_=>f.value&&f.value.readyState===1?(f.value.send(JSON.stringify(_)),!0):!1,k=_=>{let M;switch(_){case"NOT_MONTAGED":M={montage:"NOT_MONTAGED",packageId:s};break;default:M={montage:"CUSTOM_MONTAGE",packageId:s,montageMap:_}}b(M)},F=_=>{f.value&&f.value.readyState===1?f.value.send(JSON.stringify(_)):setTimeout(()=>F(_),200)},I=()=>{if(f.value&&f.value.readyState===1){const _={requestType:"DumpBufferRequest"};return f.value.send(JSON.stringify(_)),!0}return console.warn("⚠️ Cannot send dump buffer request - WebSocket not connected"),!1},j=_=>{e=_},V=_=>{r=_},N=_=>{t=_},w=_=>{n=_};vue.onUnmounted(async()=>{await m()});const E=_=>{d=_},C=_=>{s=_},A=_=>{u=_};return{websocket:vue.readonly(f),connectionStatus:vue.readonly(c),openWebsocket:R,send:b,sendMontageMessage:k,sendFilterMessage:F,sendDumpBufferRequest:I,disconnect:m,setClearChannelsCallback:E,setPackageId:C,setUseMedian:A,onSegment:j,onEvent:V,onChannelDetails:N,onError:w}},useCanvasRenderer=()=>{const f=vue.ref(null),c=vue.ref(null),v=(r,t,n)=>t*(r+n),l=(r=1)=>r,o=(r,t,n,d,s,u,a=!1)=>{const h=c.value;if(!h){console.warn("blurArea ref is missing, skipping renderData");return}const m=h.getContext("2d");if(!m){console.warn("Unable to get 2D context for blurArea, skipping renderData");return}m.setTransform(u,0,0,u,0,0),m.fillStyle="rgb(220,220,220)";const R=f.value;if(!R){console.warn("plotArea ref is missing, skipping drawing.");return}const g=R.getContext("2d");if(!g){console.warn("Unable to get 2D context for plotArea, skipping drawing.");return}g.setTransform(u,0,0,u,0,0),g.clearRect(0,0,d.cWidth,d.cHeight),m.clearRect(0,0,d.cWidth,d.cHeight);const y=t.reduce((O,b)=>b.visible?O+1:O,0);i(t,d.pHeight,y),g.save();for(let O in r.channels)if(r.channels.hasOwnProperty(O)){const b=r.channels[O];let k=null;if(k=t.find(_=>_.id===b.id),!k||!k.visible)continue;const F=d.start,I=d.rsPeriod,j=n.XOFFSET,V=Math.min(Math.round(d.cHeight/r.channels.length-2),10);for(let _=0;_<k.dataSegments.length;_+=2){if(k.dataSegments[_+1]<F){console.log("skipping something");continue}if(k.dataSegments[_]>F+d.duration){console.log("breaking something");break}let M=Math.floor(j+(k.dataSegments[_]-F)/I),L=Math.floor(j+(k.dataSegments[_+1]-F)/I),D=Math.floor(k.rowBaseline-V/2);m.fillRect(M,D,L-M,V)}e(k,b,d,n,s,a);const N=b.blocks.length;let w="Continuous";N&&(w=b.blocks[0].type),k.hover?k.selected?(g.strokeStyle="rgba(39,96,255,0.70)",g.fillStyle="rgba(39,96,255,0.70)"):(g.strokeStyle="rgba(39,96,255,0.60)",g.fillStyle="rgba(39,96,255,0.60)"):k.selected?(g.strokeStyle="rgb(249,162,58)",g.fillStyle="rgb(3249,162,58)"):w==="Neural"?g.strokeStyle="rgb(249,162,58)":(g.strokeStyle="black",g.fillStyle="black");let E=null,C=!0,A=1e6*(1/k.sf);for(let _=0;_<N;_++){const M=b.blocks[_];if(M.nrPoints===0){console.log("zero points");continue}const L=M.cData,D=M.nrPoints,B=L[0],J=L[1],z=L[2];let W=M.renderStartIndex,K=M.renderEndIndex;switch(m.clearRect(Math.floor(B[W]),Math.floor(k.rowBaseline-V/2),Math.ceil(B[K]-B[W]+2),V+1),M.type){case"Continuous":case"realtime":if(M.isMinMax){if(M.samplePeriod/A<3&&(C=!1),C){g.beginPath(),_>0&&B[W]<E.x+3?g.moveTo(E.x,E.y):g.moveTo(B[W],J[W]);for(let X=W;X<K+1;X++)g.lineTo(B[X],J[X]);for(let X=K-1;X>=W;X--)g.lineTo(B[X],z[X]);_>0&&B[W]<E.x+3&&g.lineTo(E.x,E.y2),g.closePath(),g.fill()}else{g.beginPath();for(let X=W;X<K+1;X++)g.lineTo(B[X],J[X]),g.lineTo(B[X],z[X]),g.moveTo(B[X],J[X]);g.stroke()}g.beginPath(),g.moveTo(B[W],J[W]);for(let X=W;X<K+1;X++)g.lineTo(B[X],J[X]);g.stroke()}else{_===0?(g.beginPath(),g.moveTo(B[W],J[W])):B[W]>E.x+2&&g.moveTo(B[W],J[W]);for(let X=W;X<K+1;X++)g.lineTo(B[X],J[X]);_===N-1&&g.stroke()}break;case"Neural":g.beginPath();for(let X=0;X<D;X++)g.moveTo(B[X],J[X]),g.lineTo(B[X],z[X]);g.stroke();break}E={x:B[D-1],y:J[D-1],y2:z[D-1]}}}g.restore()},i=(r,t,n)=>{const d=r.map(function(h,m){return{index:m,value:h.rank}});d.sort(function(h,m){return+(h.value>m.value)||+(h.value===m.value)-1});const s=d.map(function(h){return h.index}),u=(t+20)/n;let a=0;for(let h=0;h<s.length;h++){const m=r[s[h]];m.visible?(m.rowBaseline=.5*u+a*u,a++):m.rowBaseline=null}},e=(r,t,n,d,s,u)=>{let a=t.blocks.length;switch(r.type){case"UNIT":if(!u)for(let m=0;m<a;m++){const R=t.blocks[m],g=R.cData,y=R.parsedData,O=d.XOFFSET,b=R.parsedData[0].length,k=g[0],F=g[1],I=g[2],j=y[0],V=r.rowBaseline|0,N=n.start,w=n.rsPeriod,E=n.cHeight/(2*(n.nrVisibleChannels+1))|0;for(let C=0;C<b;C++)k[C]=O+(j[C]-N)/w,F[C]=V-E,I[C]=V+E}break;case"CONTINUOUS":let h=0;if(!u){t.mean=0,t.median=0;for(let m=0;m<a;m++){const R=t.blocks[m];R.nrValidPoints>0&&(t.mean=(R.sumElem+h*t.mean)/(h+R.nrValidPoints),t.median=(R.median+h*t.median)/(h+R.nrValidPoints),h+=R.nrValidPoints)}}for(let m=0;m<a;m++){const R=t.blocks[m];let g=Math.floor((n.start-R.startTs)/R.samplePeriod);R.renderStartIndex=g>0?g:0;let y=Math.floor((n.start+n.duration-(R.startTs+R.nrPoints*R.samplePeriod))/R.samplePeriod);R.renderEndIndex=y>=0?R.nrPoints-1:R.nrPoints+y;const O=R.cData,b=R.parsedData,k=s*r.rowScale,F=d.XOFFSET,I=R.parsedData[0].length,j=O[0],V=O[1],N=O[2],w=b[0],E=b[1],C=b[2],A=r.rowBaseline;let _=0;d.USEMEDIAN?_=t.median:_=t.mean;const M=n.rsPeriod,L=n.start;for(let D=0;D<I;D++)j[D]=F+(w[D]-L)/M,V[D]=A-(E[D]-_)*k,R.isMinMax&&(E[D]===C[D]?N[D]=V[D]+1:N[D]=A-(C[D]-_)*k)}break}};return{plotCanvasRef:f,blurCanvasRef:c,initializeCanvases:l,renderData:o,computeChannelViews:i,getPointCoords:e,cpCanvasScaler:v}},useTimeSeriesData=()=>{const f=vue.ref([]),c=vue.ref(new Map),v=vue.reactive({start:0,duration:0,channels:[]}),l=vue.ref(!1),o=vue.ref(0),i=vue.ref(null),e=vue.ref(1),r=15e6,t=3,n=(b,k,F,I)=>{I||(I=0);let j=d(b,k,I,b.length-1,F);return j===-1?j=0:j<0&&(j=-j-2),j},d=(b,k,F,I,j)=>{if(I<F){let N;if(I>=0?N=I:N=-I-2,N===-1)return N;const w=b[N].pageStart;for(;N>=0&&b[N].pageStart===w;)N--;return N++,-N-2}const V=parseInt((F+I)/2);if(b[V].pageStart>k)return d(b,k,F,V-1,j);if(b[V].pageStart<k)return d(b,k,V+1,I,j);{let N=V;if(j){for(;N>=0&&b[N].pageStart===k;)N--;N++}else{for(;N<b.length&&b[N].pageStart===k;)N++;N--}return N}},s=(b,k,F)=>{if(!b)return Promise.resolve();const I=[];if(b.length>0){const j=[];for(let V=0;V<b.length;V++){const N=b[V].content,E={id:F?F(N):N.id,serverId:N.serverId,label:N.name,displayName:N.displayName,type:N.channelType,segments:[],start:N.start,end:N.end,sampleFreq:N.rate,unit:N.unit,gaps:[],dataSegments:[]},C=E.label.split("<->",3),A=C[0];let _=C.length>1?parseFloat(C[1]):0;_=isNaN(_)?C[1]:_,j.push({id:E.id,serverId:E.serverId,type:E.type,label:E.label,displayName:E.displayName,label_split:C,label_prefix:A,label_value:_,dataSegments:[],rank:V,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:N.unit,sf:N.rate,filter:{},hideFilter:!0,isEditing:!1}),I.push(E)}k&&k.setChannels(j)}return u(I),f.value=I,o.value=b.length,l.value=!0,Promise.resolve()},u=b=>{var k,F;if(b.length===0){i.value=null;return}i.value=((F=(k=b[0])==null?void 0:k.gaps)==null?void 0:F[0])||null},a=b=>{let k=null;const F=b.data.chId||b.data.source,I=b.data.label||b.data.name;if(k=f.value.find(j=>j.serverId===F&&j.label===I),!k){console.error("❌ NO EXACT MATCH - rejecting to prevent data corruption:",{serverResponseId:F,serverResponseName:I,availableChannels:f.value.map(j=>({id:j.id,serverId:j.serverId,label:j.label,matches:{serverId:j.serverId===F,label:j.label===I}}))});return}switch(b.type){case"gap":case"Neural":case"Continuous":let j=!1,V=k&&k.segments;if(V&&b.type!=="gap"&&(j=!0,V.length>0)){let w=n(V,b.data.startTs,!0,0);for(;V[w]&&V[w].pageStart===b.data.pageStart;){if(V[w].startTs===b.data.startTs){j=!1;break}w++}}let N=c.value.get(b.data.pageStart);if(N){let w=N.counter.get(k.id);if(isNaN(w)&&(w=b.nrResponses||1,N.counter.set(k.id,w)),w>0&&(w=w-1,N.counter.set(k.id,w)),w===0){let E=!0;for(let[C,A]of N.counter.entries())if(A>0||isNaN(A)){E=!1;break}E&&c.value.delete(b.data.pageStart)}}j&&(V.push(b.data),V.sort((w,E)=>w.startTs<E.startTs?-1:w.startTs>E.startTs?1:0));break}},h=()=>{i.value=[],c.value.clear();for(let b=0;b<f.value.length;b++)f.value[b].segments=[];for(let b=0;b<v.channels.length;b++)v.channels[b].blocks=[]},m=b=>{let k=0,F=0,I=v.channels;for(let V=0;V<I.length;V++){let N=I[V].blocks;for(let w=0;w<N.length;w++)N[w].type==="Continuous"&&(k+=R(N[w].parsedData[1]),F++)}const j=k/F;return!isNaN(j)&&b?b/I.length/(2*j):1},R=b=>{const k=g(b),F=b.map(function(V){const N=V-k;return N*N}),I=g(F);return Math.sqrt(I)},g=b=>b.reduce(function(I,j){return I+j},0)/b.length;return{chData:f,requestedPages:c,viewData:v,channelsReady:l,autoScale:o,globalGaps:i,pageSize:r,prefetchPages:t,currentRequestedSamplePeriod:e,initChannels:s,computeSummary:u,dataCallback:a,invalidate:h,autoScaleViewData:m,segmIndexOf:n,updateCurrentRequestedSamplePeriod:b=>{e.value=Math.ceil(b)},isDataCurrentForViewport:b=>b&&b.startTs&&b.startTs>0,standardDeviation:R,average:g}},useDataRequests=()=>{const f=vue.ref([]),c=vue.ref([]),v=vue.ref(null),l=vue.ref(!1),o=vue.ref(null),i=vue.ref(0),e=vue.ref(0);let r=null;const t=(y,O)=>{r=function(){var k,F;if(c.value.length>0){const j=((k=O.value)==null?void 0:k.size)||0;j<5?y([c.value[0]])?c.value.splice(0,1):(console.warn("❌ Prefetch request failed"),clearInterval(v.value),l.value=!1):console.log("🚫 Prefetch blocked - too many pending pages:",{current:j,max:5,pendingPageStarts:Array.from(((F=O.value)==null?void 0:F.keys())||[])})}else console.log("✅ No more prefetch requests, stopping prefetch timer"),clearInterval(v.value),l.value=!1}},n=(y,O,b,k,F,I,j,V,N,w)=>{k.start=O,k.duration=b;const E=[];for(let C=0;C<k.channels.length;C++){const A=w?w(k.channels[C]):k.channels[C].id;E.push(A)}for(let C=0;C<y.length;C++){const A=y[C],_=w?w(A):A.id;E.indexOf(_)<0&&k.channels.push({id:_,mean:null,firstRenderedIndex:0,lastRenderedIndex:0,blocks:[]})}return d(y,O,b,k,F,I,j,V,N,w)},d=(y,O,b,k,F,I,j,V,N,w)=>{f.value=[];let C=!1;(i.value!==O||e.value!==b)&&(c.value=[],C=!0),i.value=O,e.value=b;const A=[];for(let _=0;_<k.channels.length;_++)A.push(k.channels[_]);for(let _=0;_<y.length;_++){let M=!1;const L=y[_],D=L.segments,B=w?w(L):L.id,J=A.findIndex(ne=>(w?w(ne):ne.id)===B);if(J===-1)continue;const z=k.channels[J];if(!z)continue;z.blocks=[];let W=Math.floor(O/15e6)*15e6;W<0&&(W=0);let K=0,X=0;D.length>0&&(K=N(D,W,!0,0));let ce=O+b+I.PREFETCHPAGES*15e6;ce>V&&(ce=V);let U;for(D.length>0&&(U=D[K]);W<ce||M;){M=!1;let ne=!1;if(U&&(ne=W>=U.pageStart&&W<=U.pageEnd),ne){let fe=U.startTs<O+b;X+=1,W+=15e6,fe&&z.blocks.push(U);const se=U.pageStart;U=D[K+X],U&&se===U.pageStart&&(M=!0)}else{if(F.get(W)){if(W+=15e6,U&&W>=U.pageEnd)for(;U&&U.pageEnd<W&&(X+=1,U=D[K+X],!!U););continue}let fe=W<O+b,se=!1;if(fe){for(let ue in c.value)if(c.value[ue].start===W){c.value.splice(ue,1);break}for(let ue in f.value)f.value[ue].start===W&&(f.value[ue].channels.push(L),se=!0);se||f.value.push({channels:[L],start:W,duration:15e6,isInViewport:!0,pixelWidth:Math.ceil(j)})}else if(C){for(let ue in c.value)c.value[ue].start===W&&(c.value[ue].channels.push(L),se=!0);se||c.value.push({channels:[L],start:W,duration:15e6,isInViewport:!1,pixelWidth:Math.ceil(j)})}if(W+=15e6,U&&W>=U.pageEnd)for(;U&&U.pageEnd<W&&(X+=1,U=D[K+X],!!U););}}z.blocks.sort(s)}return{asyncRequests:f.value,asyncPreRequests:c.value}},s=(y,O)=>y.startTs<O.startTs?-1:y.startTs>O.startTs?1:0,u=(y,O=0,b,k,F,I,j,V)=>{if(y.length===0)return console.log("⚠️ No requests to send"),!1;const N=V;for(let w=0;w<y.length;w++){let E;w===0?E=y[O]:w===O?E=y[0]:E=y[w];let C=E.start+E.duration;C>N&&(C=N);const A=b;if(A&&A.readyState===1){const _=E.channels.map(z=>{const W=z.serverId||z.id,K=z.label||z.name;return{id:W,name:K}}),M={session:k,minMax:!0,startTime:E.start,endTime:C,packageId:F.content.id,pixelWidth:E.pixelWidth,virtualChannels:_},L=JSON.stringify(M);A.send(L);const D=E.channels.length,B=new Map;for(let z=0;z<D;z++){const W=E.channels[z].id;B.set(W,NaN)}const J={count:D,counter:B,subPageCount:NaN,ts:Date.now(),inViewport:E.isInViewport,channels:E.channels.map(z=>({id:z.id,serverId:z.serverId,label:z.label}))};j.set(E.start,J)}else return console.error("❌ WebSocket not ready for sending requests:",{readyState:A==null?void 0:A.readyState,wsExists:!!A}),!1}return f.value=[],!0},a=()=>{c.value.length>0&&(l.value||(v.value=setInterval(r,150),l.value=!0))},h=()=>{v.value&&(clearInterval(v.value),v.value=null),l.value=!1},m=()=>{const y=f.value.length,O=c.value.length;f.value=[],c.value=[],i.value=0,e.value=0,h(),console.log("🧹 Cleared requests:",{asyncRequests:y,preRequests:O})},R=()=>{const y=f.value.slice();return f.value=[],y},g=(y,O,b)=>{const k=[];return y.forEach(function(F,I){if(!isNaN(F.subPageCount)){const j=[];F.counter.forEach(function(V,N){!isNaN(V)&&V>0&&j.push(N)}),j.length>0&&k.push({channels:j,start:I,duration:O,isInViewport:!0,pixelWidth:Math.ceil(b)})}}),y.clear(),k};return vue.onUnmounted(()=>{h()}),{aSyncRequests:vue.readonly(f),aSyncPreRequests:vue.readonly(c),isPrefetching:vue.readonly(l),lastViewPageRequest:vue.readonly(o),initializePrefetch:t,generatePoints:n,requestData:d,requestDataFromServer:u,startPrefetching:a,stopPrefetching:h,clearRequests:m,getViewportRequests:R,reRequestPages:g}},useChannelProcessing=(f,c,v,l)=>{const o=vue.reactive({totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0}),i=vue.ref(new Map),e=vue.ref(new Map),r=vue.computed(()=>c.value!=="NOT_MONTAGED"),t=vue.computed(()=>!r.value||!v.value?null:v.value.find(w=>w.name===c.value)),n=vue.computed(()=>{var w;return((w=t.value)==null?void 0:w.channelPairs)||{}});vue.watch(c,()=>{i.value.clear(),e.value.clear()});const d=w=>w?index.propOr("","id",w):"",s=w=>w?index.propOr("","serverId",w)||index.propOr("","id",w):"",u=w=>index.propOr("","id",w),a=w=>{if(!w)return"";let E=index.propOr("","id",w);if(r.value&&typeof E=="string"){const C=E.split("_");E=C.length>1?head(C):E}return E},h=(w,E,C=null)=>{var L,D;const A=C||c.value,_=`${w}_${E}_${A}`;if(e.value.has(_))return e.value.get(_);let M=`${w}-${E}`;if(A!=="NOT_MONTAGED"){const B=(L=v.value)==null?void 0:L.find(J=>J.name===A);if(B!=null&&B.channelPairs)for(const J of Object.keys(B.channelPairs)){const z=B.channelPairs[J];if(((D=z.channels)==null?void 0:D.length)===2&&z.channels[0]===w&&z.channels[1]===E){M=z.name||M;break}}}return e.value.set(_,M),M},m=w=>{if(!Array.isArray(w))return console.warn("Invalid channel details provided:",w),[];const E=performance.now();o.totalChannels=w.length,o.processedChannels=0,o.errors=0;const C=w.map(({id:A,name:_})=>{var M;try{const L=R(A);if(!L)return console.warn(`❌ Base channel not found for ID: ${A}, available base channels:`,((M=f.value)==null?void 0:M.map(B=>({id:B==null?void 0:B.id,name:B==null?void 0:B.name})))||[]),o.errors++,null;const D=g(A,_,L);return o.processedChannels++,r.value&&o.montageChannels++,D}catch(L){return console.error(`❌ Error processing channel ${A}:`,L),o.errors++,null}}).filter(Boolean);return o.lastProcessingTime=performance.now()-E,C},R=w=>{var C;if(i.value.has(w))return i.value.get(w);const E=(C=f.value)==null?void 0:C.find(A=>(A==null?void 0:A.id)===w);return E&&i.value.set(w,E),E},g=(w,E,C)=>{let A=E;const _=w;let M=w;if(r.value){M=`${w}_${E}`;const D=E.split("<->",2);D.length===2&&(A=h(D[0],D[1]),console.log("🎭 Montage display name created:",{originalName:E,channelParts:D,displayName:A}))}return{content:{id:M,serverId:_,name:E,channelType:C.channelType,label:E,displayName:A,unit:C.unit,rate:C.rate,start:C.start,end:C.end,montageScheme:r.value?c.value:"NOT_MONTAGED",isMontaged:r.value,baseChannelId:w},properties:C.properties||[]}},y=w=>{var A,_;if(w==="NOT_MONTAGED")return{montage:"NOT_MONTAGED",packageId:(A=l.value)==null?void 0:A.id,montageMap:[]};const E=v.value.find(M=>M.name===w);if(!E)return console.warn("Montage not found:",w),null;const C=E.channelPairs.map(M=>M.channels);return{montage:"CUSTOM_MONTAGE",packageId:(_=l.value)==null?void 0:_.content.id,montageMap:C}},O=w=>{const E=[];if(!w)return E.push("Channel configuration is null or undefined"),{isValid:!1,errors:E};const C=["id","label","type","unit","rate"];for(const _ of C)w[_]||E.push(`Missing required field: ${_}`);w.rate&&(typeof w.rate!="number"||w.rate<=0)&&E.push("Sample rate must be a positive number"),w.start&&w.end&&w.start>=w.end&&E.push("Channel start time must be less than end time");const A=["CONTINUOUS","UNIT","Neural"];return w.type&&!A.includes(w.type)&&E.push(`Invalid channel type: ${w.type}. Must be one of: ${A.join(", ")}`),{isValid:E.length===0,errors:E}},b=w=>w.sort((E,C)=>{const A=E.label||"",_=C.label||"",M=A.split("<->",3),L=_.split("<->",3);if(M.length>2||L.length>2)return A.localeCompare(_);const D=M[0]||"",B=L[0]||"";if(D===B&&M.length>1&&L.length>1){const J=parseFloat(M[1]),z=parseFloat(L[1]);return!isNaN(J)&&!isNaN(z)?J-z:M[1].localeCompare(L[1])}return D.localeCompare(B)}),k=(w,E=0)=>{const C=w.content,A=C.label.split("<->",3),_=A[0]||"",M=A.length>1?isNaN(parseFloat(A[1]))?A[1]:parseFloat(A[1]):0;return{id:C.id,serverId:C.serverId,type:C.channelType,label:C.label,displayName:C.displayName,labelParts:A,labelPrefix:_,labelValue:M,dataSegments:[],rank:E,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:C.unit,sf:C.rate,filter:{},hideFilter:!0,isEditing:!1,montageScheme:C.montageScheme||"NOT_MONTAGED",isMontaged:C.isMontaged||!1,baseChannelId:C.baseChannelId}},F=(w,E={})=>{const{channelType:C=null,visible:A=null,montageScheme:_=null,labelPattern:M=null,sampleRate:L=null}=E;return w.filter(D=>!(C&&D.type!==C||A!==null&&D.visible!==A||_&&D.montageScheme!==_||M&&!new RegExp(M,"i").test(D.label)||L&&D.sf!==L))},I=(w,E="type")=>{const C={};return w.forEach(A=>{let _;switch(E){case"type":_=A.type;break;case"montage":_=A.montageScheme||"NOT_MONTAGED";break;case"prefix":_=A.labelPrefix;break;case"sampleRate":_=A.sf;break;case"unit":_=A.unit;break;default:_="all"}C[_]||(C[_]=[]),C[_].push(A)}),C},j=()=>{var w;return{...o,cacheSize:i.value.size,montageCacheSize:e.value.size,isViewingMontage:r.value,currentMontageScheme:c.value,availableMontages:((w=v.value)==null?void 0:w.map(E=>E.name))||[]}},V=()=>{i.value.clear(),e.value.clear(),Object.assign(o,{totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0})},N=async w=>{const E=[];for(const C of w)try{const A=await C();E.push({success:!0,result:A})}catch(A){E.push({success:!1,error:A.message}),o.errors++}return E};return{processingStats:vue.readonly(o),isViewingMontage:r,currentMontage:t,montageChannelPairs:n,getChannelId:d,getBaseChannelId:a,getServerChannelId:s,getRawChannelId:u,getDisplayName:h,processChannelData:m,createMontagePayload:y,createChannelConfig:k,validateChannelConfig:O,sortChannelConfigurations:b,filterChannels:F,groupChannels:I,findBaseChannel:R,createVirtualChannel:g,getProcessingStats:j,clearCaches:V,batchProcessChannels:N}};function createThrottle(f,c,v={}){let l,o,i,e=null,r=0;const{leading:t=!0,trailing:n=!0}=v,d=function(){r=t===!1?0:Date.now(),e=null,i=f.apply(l,o),e||(l=o=null)},s=function(){const u=Date.now();!r&&t===!1&&(r=u);const a=c-(u-r);return l=this,o=arguments,a<=0||a>c?(e&&(clearTimeout(e),e=null),r=u,i=f.apply(l,o),e||(l=o=null)):!e&&n!==!1&&(e=setTimeout(d,a)),i};return s.cancel=function(){clearTimeout(e),r=0,e=l=o=null},s}const _hoisted_1$1={class:"timeseries-plot-canvas"},_hoisted_2$1=["width","height"],_hoisted_3$1=["width","height"],_sfc_main$1={__name:"TSPlotCanvas",props:{cHeight:{type:Number,required:!0},cWidth:{type:Number,required:!0},start:{type:Number,required:!0},duration:{type:Number,required:!0},constants:{type:Object,required:!0},rsPeriod:{type:Number,required:!0},ts_start:{type:Number,required:!0},ts_end:{type:Number,required:!0},globalZoomMult:{type:Number,required:!0},activeViewer:{type:Object,required:!0}},emits:["channelsInitialized","setGlobalZoom"],setup(f,{expose:c,emit:v}){const l=f,o=v,i=vue.computed(()=>l.activeViewer||{}),e=vue.computed(()=>{var T;return((T=i.value)==null?void 0:T.channels)||[]}),r=index.useViewerStore(),{viewerChannels:t,viewerMontageScheme:n,workspaceMontages:d}=pinia.storeToRefs(r),{websocket:s,connectionStatus:u,openWebsocket:a,send:h,sendFilterMessage:m,sendDumpBufferRequest:R,disconnect:g,setClearChannelsCallback:y,onSegment:O,onEvent:b,onChannelDetails:k,onError:F}=useWebSocket(),{plotCanvasRef:I,blurCanvasRef:j,initializeCanvases:V,renderData:N,cpCanvasScaler:w}=useCanvasRenderer(),E=vue.ref(1),C=vue.ref(!1),{chData:A,requestedPages:_,viewData:M,channelsReady:L,autoScale:D,initChannels:B,dataCallback:J,invalidate:z,autoScaleViewData:W,segmIndexOf:K,updateCurrentRequestedSamplePeriod:X,currentRequestedSamplePeriod:ce,isDataCurrentForViewport:U}=useTimeSeriesData(),{aSyncRequests:ne,aSyncPreRequests:fe,isPrefetching:se,initializePrefetch:ue,generatePoints:me,requestDataFromServer:oe,startPrefetching:he,clearRequests:be}=useDataRequests(),{getChannelId:Se,processChannelData:Re,createMontagePayload:pe}=useChannelProcessing(e,n,d,i),Oe=vue.ref({totalRequests:0,successfulRequests:0,failedRequests:0,montageRequests:0,singleChannelRequests:0,lastPrefetchTime:null,averageResponseTime:0}),ae=vue.ref(null),qe=vue.ref(null),Te=vue.ref(null),we=vue.ref(0),ge=vue.computed(()=>E.value*l.cWidth),ye=vue.computed(()=>w(l.cHeight,E.value,0)),de=vue.computed(()=>l.cHeight-20),Ae=vue.computed(()=>({width:l.cWidth+"px",height:de.value+"px"})),le=vue.reactive({start:l.start,duration:l.duration,cWidth:l.cWidth,cHeight:l.cHeight,pHeight:de.value,rsPeriod:l.rsPeriod,nrVisibleChannels:0}),ke=vue.computed(()=>l.rsPeriod>0?l.rsPeriod:le.duration>0&&le.cWidth>0?le.duration/le.cWidth:(console.warn("⚠️ Using fallback rsPeriod = 1"),1));vue.watch(ke,T=>{T>0&&X(T)},{immediate:!0});const _e=()=>{var T;try{if(!L.value){console.log("⏳ Render skipped - channels not ready");return}le.nrVisibleChannels=((T=t.value)==null?void 0:T.reduce((Z,G)=>G.visible?Z+1:Z,0))||0;let $=0,Y=0;if(M.channels.forEach((Z,G)=>{const H=Z.blocks||[],Q=H.reduce((te,ee)=>te+(ee.nrPoints||0),0);H.length>0&&(Y++,$+=H.length)}),Y===0)return;N(M,t.value||[],l.constants,le,l.globalZoomMult,E.value)}catch($){console.error("💥 ERROR in renderDataInternal:",$),console.error("💥 Stack trace:",$.stack)}},Ee=vue.ref(),Ce=()=>{Ee.value=setInterval(()=>{var Y,Z;if(!L.value)return;const T={timestamp:new Date().toISOString(),requestedPagesSize:_.value.size,isPrefetching:se.value,pendingAsyncRequests:ne.value.length,pendingPreRequests:fe.value.length,currentMontage:n.value,channelCount:((Y=t.value)==null?void 0:Y.length)||0,visibleChannelCount:((Z=t.value)==null?void 0:Z.filter(G=>G.visible).length)||0,connectionStatus:u.value,requestedPages:Array.from(_.value.entries()).map(([G,H])=>{var Q;return{pageStart:G,channelCount:H.count,inViewport:H.inViewport,age:Date.now()-H.ts,channels:((Q=H.channels)==null?void 0:Q.map(te=>te.id))||Array.from(H.counter.keys())}})},$=T.requestedPages.filter(G=>G.age>1e4);$.length>0&&console.warn("⚠️ Detected stuck requests:",$),T.pendingPreRequests>0&&!T.isPrefetching&&console.warn("⚠️ Prefetch is blocked with pending requests:",{pendingPreRequests:T.pendingPreRequests,requestedPagesSize:T.requestedPagesSize})},5e3)},xe=async()=>{if(!t.value)return;const T=A.value.filter(ee=>{const ve=t.value.find(re=>re.id===ee.id);return ve&&ve.visible}),$=ke.value,Y=me(T,l.start,l.duration,M,_.value,l.constants,$,l.ts_end,K,Se),Z=Math.ceil($);let G=!1,H="";if(ae.value!==null&&Z!==ae.value&&(G=!0,H=`rsPeriod changed: ${ae.value} → ${Z} (resolution change)`),qe.value!==null){const ee=Math.abs(l.start-qe.value),ve=Math.max(l.duration,Te.value||l.duration);ee>ve*2&&(G=!0,H=`Large time jump: ${ee} > ${ve*2} (${(ee/ve).toFixed(1)}x window)`)}const Q=15;if(_.value.size>Q&&(G=!0,H=`Too many pending requests: ${_.value.size} > ${Q}`),we.value>=5&&(G=!0,H=`High stale data rate: ${we.value} consecutive stale segments`),G&&!C.value){C.value=!0,console.log("🚨 Dumping server buffer before new requests:",H);try{R()&&(_.value.clear(),be(),we.value=0,await new Promise(ee=>setTimeout(ee,50)))}finally{C.value=!1}}else if(G&&C.value){console.log("⏭️ Skipping duplicate dump request (already in progress)");return}ae.value=Z,qe.value=l.start,Te.value=l.duration;const te=await index.useToken();Y.asyncRequests.length>0&&oe(Y.asyncRequests,0,s.value,te,i.value,$,_.value,l.ts_end),Y.asyncPreRequests.length>0&&he()},ie=()=>{xe(),_e()},P=()=>{xe(),D.value===0?(D.value--,x()):_e()},x=()=>{const T=W(l.cHeight);T&&!isNaN(T)&&o("setGlobalZoom",T),_e()},p=createThrottle(P,250,{leading:!1}),S=createThrottle(()=>ie(),50);vue.watch(()=>l.rsPeriod,(T,$)=>{T>0&&X(T),z(),_.value.clear()}),vue.watch(()=>l.duration,(T,$)=>{z()}),vue.watch(()=>n.value,T=>{if(s.value&&s.value.readyState===1){console.log("🔄 Montage changing to:",T),_.value.clear(),be(),z(),we.value=0,ae.value=null,qe.value=null,Te.value=null,L.value=!1;const $=pe(T);console.log("📡 Sending montage payload:",$),$&&h($)}}),vue.watch(()=>[l.start,l.duration,l.cWidth,l.cHeight,l.rsPeriod],()=>{le.start=l.start,le.duration=l.duration,le.cWidth=l.cWidth,le.cHeight=l.cHeight,le.pHeight=de.value,le.rsPeriod=l.rsPeriod}),O(T=>{T.pageStart>=l.start+l.duration&&(Oe.value.totalRequests++,n.value!=="NOT_MONTAGED"?Oe.value.montageRequests++:Oe.value.singleChannelRequests++),J(T),T.pageStart<l.start+l.duration&&p()}),b(T=>{if(!U(T.data)){we.value++;return}we.value=0,J(T),T.pageStart<l.start+l.duration&&p()}),k(T=>{const $=Re(T);B($,r,Se).then(()=>{z(),ie(),o("channelsInitialized")})}),F(T=>{r.setViewerErrors(T)});const q=async()=>{var Y,Z,G;const T=ke.value;X(T),y(()=>{var H;if((H=t.value)!=null&&H.length){const te={channelFiltersToClear:t.value.map(ee=>ee.id)};m(te)}});const $=await index.useToken();if(ue(H=>{const Q=ke.value;return oe(H,0,s.value,$,i.value,Q,_.value,l.ts_end)},_),(Y=i.value)!=null&&Y.content.id)try{console.log("🔄 Opening WebSocket connection for package:",i.value.content.id),await a(r.config.timeseriesDiscoverApi,i.value.content.id,$),console.log("✅ WebSocket connection established"),Ce()}catch(H){console.error("❌ Failed to establish WebSocket connection:",H);return}console.log("🚀 TSPlotCanvas mounted with config:",{activeViewerId:(Z=i.value)==null?void 0:Z.content.id,initialMontage:n.value,baseChannelCount:((G=e.value)==null?void 0:G.length)||0,viewport:{start:l.start,duration:l.duration,width:l.cWidth,height:l.cHeight,rsPeriod:l.rsPeriod}})};return vue.onMounted(async()=>{E.value=1,V(E.value),q()}),vue.onUnmounted(()=>{clearInterval(Ee.value),_.value.size>0&&R(),r.resetViewer(),be(),g(),p.cancel&&p.cancel(),S.cancel&&S.cancel()}),c({renderAll:ie,invalidate:z,throttledDataRender:S,sendFilterMessage:m,viewData:M,requestedPages:_,chData:A,viewerChannels:t,currentRequestedSamplePeriod:ce,initPlotCanvas:q}),(T,$)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("canvas",{ref_key:"blurCanvasRef",ref:j,class:"canvas",width:ge.value,height:ye.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_2$1),vue.renderSlot(T.$slots,"axisCanvas",{},void 0,!0),vue.renderSlot(T.$slots,"annCanvas",{},void 0,!0),vue.createElementVNode("canvas",{ref_key:"plotCanvasRef",ref:I,class:"canvas",width:ge.value,height:ye.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_3$1)]))}},TSPlotCanvas=index._export_sfc(_sfc_main$1,[["__scopeId","data-v-4be24234"]]),_hoisted_1={class:"timeseries-viewer-canvas"},_hoisted_2={id:"canvasWrapper"},_hoisted_3=["width","height"],_hoisted_4=["width","height"],_hoisted_5=["width","height"],_hoisted_6=["width","height"],_sfc_main={__name:"TSViewerCanvas",props:{windowHeight:Number,windowWidth:Number,duration:Number,start:Number,cHeight:Number,cWidth:Number,globalZoomMult:Number,constants:Object,tsStart:Number,tsEnd:Number,cursorLoc:Number,activeViewer:{type:Object,required:!0}},emits:["setDuration","setGlobalZoom","setStart","addAnnotation","updateAnnotation","closeAnnotationLayerWindow","channelsInitialized","annLayersInitialized"],setup(f,{expose:c,emit:v}){const l=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./TSAnnotationCanvas-C3-VI46n.cjs"))),o=f,i=v,e=index.useViewerStore(),{viewerChannels:r,viewerAnnotations:t,viewerActiveTool:n,viewerSelectedChannels:d}=pinia.storeToRefs(e),s=vue.ref(null),u=vue.ref(null),a=vue.ref(null),h=vue.ref(null),m=vue.ref(null),R=vue.ref(null);vue.reactive({});const g=vue.ref(0),y=vue.ref(0),O=vue.ref(0),b=vue.ref(1),k=vue.ref(!1),F=vue.ref(!1),I=vue.ref("pointer");vue.ref(!1);const j=vue.reactive({x:0,y:0}),V=vue.ref(0),N=vue.ref(["Event","Artifact","Seizure","Mark","Stim On","Stim Off","Start","Stop"]),w=vue.ref(0),E=vue.ref(null),C=vue.ref(0),A=vue.ref(!0),_=()=>{if(t.value.length>0){if(!t.value.some(S=>S.selected)){console.log("No layer selected, selecting first layer:",t.value[0]);const S=t.value[0];S&&S.id?e.setActiveAnnotationLayer(S.id):console.error("First layer has no ID:",S)}}else console.warn("No annotation layers available - waiting for layers to load"),setTimeout(()=>{t.value.length>0&&_()},500)},M=p=>{if(console.log("TSViewerCanvas: setActiveTool called with:",p),p){const S="set"+p.charAt(0).toUpperCase()+p.slice(1),q=L[S];typeof q=="function"&&q()}},L={setPan:()=>{console.log("Pan tool activated")},setPointer:()=>{console.log("Pointer tool activated")},setAnnotate:()=>{console.log("Annotate tool activated"),_()}},D=vue.computed(()=>r.value.filter(p=>p.visible).length),B=vue.computed(()=>o.cHeight-20),J=vue.computed(()=>o.cWidth+o.constants.CURSOROFFSET);vue.computed(()=>u.value);const z=vue.computed(()=>({width:o.cWidth+"px",height:o.cHeight+"px"})),W=vue.computed(()=>({width:o.cWidth+"px",height:B.value+"px"})),K=vue.computed(()=>({width:J.value+"px",height:o.cHeight+"px"}));vue.watch(()=>o.cHeight,()=>{Te()}),vue.watch(()=>o.cWidth,()=>{Te()}),vue.watch(()=>o.start,()=>{ye()}),vue.watch(()=>o.duration,()=>{var p;(p=s.value)==null||p.invalidate(),we(o.cWidth,o.duration),ye()}),vue.watch(()=>o.globalZoomMult,()=>{vue.nextTick(()=>{var p;(p=s.value)==null||p.throttledDataRender()})}),vue.watch(n,p=>{p&&(M(p),!k.value&&!["annResize-left","annResize-right","annSelect"].includes(I.value)&&(I.value=p))},{immediate:!0}),vue.watch(t,p=>{p.length>0&&n.value==="annotate"&&_()},{immediate:!0}),vue.watch(I,()=>{console.log(I);const p=R.value;if(p){switch(p.removeAttribute("col_resize"),p.removeAttribute("active"),p.removeAttribute("point"),I.value){case"cursor_hover":p.removeAttribute("point"),p.setAttribute("cursor_hover",!0);break;case"annResize-left":case"annResize-right":p.setAttribute("col_resize",!0);break;case"annSelect":p.setAttribute("active",!0);break;case"pan":case"pan":break;case"pointer":case"annotate":p.setAttribute("point",!0);break;default:p.removeAttribute("point"),p.removeAttribute("cursor_hover");break}vue.nextTick(()=>{Ae()})}});const X=()=>{var p;(p=m.value)==null||p.resetFocusedAnnotation()},ce=p=>{var S;(S=m.value)==null||S.createAnnotationLayer(p)},U=()=>{var q;let p=(o.cursorLoc*o.cWidth-o.constants.CURSOROFFSET)*g.value;return((q=m.value)==null?void 0:q.findNextAnnotation(o.start+p)).start-p},ne=()=>{var q;let p=(o.cursorLoc*o.cWidth-o.constants.CURSOROFFSET)*g.value;return((q=m.value)==null?void 0:q.findPreviousAnnotation(o.start+p)).start-p},fe=p=>{i("updateAnnotation",p)},se=()=>{i("closeAnnotationLayerWindow")},ue=()=>{ye(100)},me=()=>{console.log("Annotation layers initialized, ensuring active layer for annotate tool"),n.value==="annotate"&&_(),i("annLayersInitialized")},oe=p=>{i("setGlobalZoom",p)},he=()=>{i("channelsInitialized")},be=p=>{p.stopPropagation(),p.preventDefault(),p.shiftKey?Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setDuration",o.duration*1.1):i("setDuration",o.duration/1.1)):Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setGlobalZoom",o.globalZoomMult*1.2):i("setGlobalZoom",o.globalZoomMult/1.2))},Se=p=>{var S,q;switch(console.log("TSViewerCanvas: _onMouseUp called with pointerMode:",I.value,"viewerActiveTool:",n.value),F.value=!1,k.value=!1,I.value){case"pointer":Re();const T=p.metaKey,$=p.clientY-R.value.getBoundingClientRect().top,Y=j.y-R.value.getBoundingClientRect().top,Z=r.value.map(re=>(T===!1&&(re.selected=!1),(re.rowBaseline>Y&&re.rowBaseline<$||re.rowBaseline<Y&&re.rowBaseline>$)&&(re.selected=!0),re));e.setChannels(Z),ye();break;case"annSelect":Re(),(S=m.value)==null||S.selectFocusedAnn();break;case"annotate":_();let G=null,H=null;for(let re=0;re<t.value.length;re++)if(t.value[re].selected){G=re,H=t.value[re];break}if(console.log("Creating annotation - curLIndex:",G,"available layers:",t.value.length),console.log("Selected layer details:",H),G===null||!H||!H.id)if(console.error("No valid selected annotation layer found for annotation creation",{curLIndex:G,selectedLayer:H,allLayers:t.value}),t.value.length>0&&t.value[0].id)e.setActiveAnnotationLayer(t.value[0].id),H=t.value[0],G=0,console.log("Fallback: Selected first layer:",H);else{console.error("No layers available with valid IDs");return}const Q=d,te=Q.length===r.value.length||Q.length===0,ee=(p.clientX-j.x)*g.value,ve=V.value+(j.x-R.value.getBoundingClientRect().left)*g.value;if(console.log("Creating annotation with:",{startTime:ve,duration:ee,allChannels:te,selectedChannels:Q.length,layer:H.name,layerId:H.id,pointerMode:I.value}),Math.abs(ee)>1e3){const re={name:"",id:null,label:N.value[w.value],description:"",start:ve,duration:ee,end:ve+ee,cStart:null,cEnd:null,selected:!0,channelIds:Q,allChannels:te,layer_id:H.id,userId:null};console.log("📍 STEP 1 - TSViewerCanvas created:",re),e.setActiveAnnotation(re),console.log("📍 STEP 1 - Store now has:",e.activeAnnotation),i("addAnnotation",ve,ee,te,re.label,re.description,H);break}else console.log("Annotation duration too small, not creating annotation");break;case"annResize-left":case"annResize-right":(q=m.value)==null||q.onMouseUp();break}},Re=()=>{R.value.getContext("2d").clearRect(0,0,o.cWidth,o.cHeight)},pe=p=>{var q;console.log("TSViewerCanvas: _onMouseDown called with pointerMode:",I.value,"viewerActiveTool:",n.value),k.value=!0,V.value=o.start;const S=R.value.getBoundingClientRect();switch(j.x=p.clientX,j.y=p.clientY,n.value==="annotate"&&!["annResize-left","annResize-right","annSelect"].includes(I.value)&&(console.log("Setting pointerMode to annotate for annotation creation"),I.value="annotate"),I.value){case"annResize-left":case"annResize-right":F.value=!0,(q=m.value)==null||q.onMouseDown(p.clientX-S.left,p.clientY-S.top);break}},Oe=()=>{k.value=!1},ae=p=>{p.buttons===1?k.value=!0:k.value=!1},qe=p=>{var $,Y,Z,G;p.preventDefault(),p.stopPropagation();const S=R.value.getBoundingClientRect(),q=p.clientY-S.top,T=p.clientX-S.left;switch(n.value){case"pan":if(k.value){const H=V.value-(p.clientX-j.x)*g.value;i("setStart",H)}else{const H=($=m.value)==null?void 0:$.onMouseMove(T,q,I.value,k.value);I.value=H||"pan"}break;case"pointer":if(k.value)_e(p.clientX,p.clientY);else{const H=(Y=m.value)==null?void 0:Y.onMouseMove(T,q,I.value,k.value);I.value=H||"pointer"}break;case"annotate":if(k.value&&I.value==="annotate")Ce(p.clientX);else if(k.value&&["annResize-left","annResize-right"].includes(I.value)){const H=(Z=m.value)==null?void 0:Z.onMouseMove(T,q,I.value,k.value);I.value=H||I.value,ye()}else{const H=(G=m.value)==null?void 0:G.onMouseMove(T,q,I.value,k.value);H?(console.log("TSViewerCanvas: annCanvas.onMouseMove returned:",H),I.value=H):I.value="annotate"}break}},Te=()=>{we(o.cWidth,o.duration),ye(25)},we=(p,S)=>{const q=g.value,T=S/p;T!==q&&(O.value=Date.now(),g.value=T,y.value=Math.floor(S/o.constants.PAGESIZEDIVIDER))},ge=(p,S,q)=>S*(p+q),ye=(p=0,S=!0)=>{(!E.value||p!==C.value||A.value!==S)&&(E.value=de(le,p,{leading:S}),C.value=p,A.value=S),E.value()},de=(p,S,q={})=>{let T,$,Y,Z=null,G=0;const H=function(){G=q.leading===!1?0:Date.now(),Z=null,Y=p.apply(T,$),Z||(T=$=null)};return function(){const Q=Date.now();!G&&q.leading===!1&&(G=Q);const te=S-(Q-G);return T=this,$=arguments,te<=0||te>S?(Z&&(clearTimeout(Z),Z=null),G=Q,Y=p.apply(T,$),Z||(T=$=null)):!Z&&q.trailing!==!1&&(Z=setTimeout(H,te)),Y}},Ae=()=>{var p;Re(),(p=m.value)==null||p.render()},le=()=>{vue.nextTick(()=>{var p,S;ke(),Ee(),(p=s.value)==null||p.renderAll(),(S=m.value)==null||S.render()})},ke=()=>{const S=u.value.getContext("2d");S.setTransform(b.value,0,0,b.value,0,0),S.clearRect(0,0,o.cWidth,o.cHeight),S.stroke(),S.beginPath(),S.lineWidth=1,S.moveTo(o.constants.XOFFSET+.5,.5),S.lineTo(o.constants.XOFFSET+.5,B.value+.5),S.lineTo(o.cWidth+.5,B.value+.5),S.stroke();let q=B.value/(2*D.value)+.5<<1>>1;S.lineWidth=.5;for(let G=0;G<D.value;G++)S.beginPath(),S.moveTo(o.constants.XOFFSET-2,q),S.lineTo(o.constants.XOFFSET+2,q),S.stroke(),q+=B.value/D.value;const T=o.constants.XGRIDSPACING*Math.ceil(o.duration/1e8),$=Math.ceil(o.duration/T)+1,Y=Math.ceil(o.constants.NRPXPERLABEL/(T/g.value)),Z=(T-o.start%T)%T;for(let G=0;G<$;G++){let H=o.start+Z+G*T;if(H>o.tsEnd)break;const Q=H-o.start,te=o.constants.XOFFSET+Q/g.value,ee=Math.round(te);if(ee>1&&(S.save(),S.beginPath(),S.lineWidth=.5,S.strokeStyle="rgb(235,235,235)",S.moveTo(ee+.5,.5),S.lineTo(ee+.5,B.value-.5),S.stroke(),S.restore(),((H/T+T/10)%Y|0)===1||Y===1)){S.beginPath(),S.lineWidth=1,S.moveTo(ee+.5,B.value-3),S.lineTo(ee+.5,B.value+3),S.stroke();const re=new Date(H/1e3);S.font="12px sans-serif",S.fillStyle="rgb(150,150,150)",S.fillText(P(re),ee-20.5,o.cHeight-.2)}}},_e=(p,S)=>{const q=R.value,T=q.getContext("2d");T.setTransform(b.value,0,0,b.value,0,0),T.clearRect(0,0,o.cWidth,o.cHeight),T.beginPath(),T.lineWidth=2,T.strokeStyle="#295eff",T.setLineDash([5,5,15,5]);const $=p-q.getBoundingClientRect().left,Y=S-q.getBoundingClientRect().top;T.rect($,Y,-p+j.x,-S+j.y),T.stroke()},Ee=()=>{const S=h.value.getContext("2d");S.setTransform(b.value,0,0,b.value,0,0),S.clearRect(0,0,o.cWidth+o.constants.CURSOROFFSET,o.cHeight),S.save(),S.beginPath(),S.fillStyle="red";const q=o.cursorLoc*o.cWidth;q>o.constants.CURSOROFFSET?(S.strokeStyle="red",S.moveTo(q,0),S.lineTo(q,B.value),S.stroke()):S.moveTo(q,B.value),S.beginPath(),S.lineTo(q-5,B.value+8),S.lineTo(q+5,B.value+8),S.lineTo(q,B.value),S.fill(),S.restore()},Ce=p=>{const S=R.value,q=S.getContext("2d");q.setTransform(b.value,0,0,b.value,0,0);const T=o.constants.ANNOTATIONLABELHEIGHT,$=T/2|0;let Y=null;for(let Q=0;Q<t.value.length;Q++)if(t.value[Q].selected){Y=Q;break}if(Y===null)return;q.save(),q.clearRect(0,0,o.cWidth,o.cHeight),q.lineWidth=1;const Z=selectedChannels.length===r.value.length||selectedChannels.length===0,G=p-S.getBoundingClientRect().left,H=-p+j.x;if(Z){q.fillStyle="rgba(0,0,0,0.1)",q.fillRect(G,0,H,B.value),q.fillStyle=t.value[Y].color,q.strokeStyle=q.fillStyle;let Q=G-1,te=H+2;H<0&&(Q=G+1,te=H-2),q.fillRect(Q,0,te,T),q.setLineDash([5,5,5,5]),q.beginPath(),q.moveTo(G,T),q.lineTo(G,B.value),q.stroke(),q.beginPath(),q.moveTo(G+H,T),q.lineTo(G+H,B.value),q.stroke()}else{let Q=o.cHeight|0,te=0;const ee=r.value;q.fillStyle=t.value[Y].color,q.strokeStyle=q.fillStyle;let ve=G-1,re=H+2;H<0&&(ve=G+1,re=H-2);for(let Ne=0;Ne<ee.length;Ne++){const Fe=ee[Ne];if(Fe.selected&&Fe.visible){const Pe=Fe.rowBaseline|0;Pe<Q&&(Q=Pe),Pe>te&&(te=Pe),q.fillRect(ve,Pe-$,re,T)}}q.fillStyle="rgba(0,0,0,0.1)",q.setLineDash([5,5,5,5]),q.fillRect(G-1,Q+$,H+2,te-Q-T),q.beginPath(),q.moveTo(G,Q+$),q.lineTo(G,te-$),q.moveTo(G+H,Q+$),q.lineTo(G+H,te-$),q.stroke()}q.restore()},xe=()=>{var p;(p=s.value)==null||p.initPlotCanvas()},ie=()=>{let p=R.value.getContext("2d"),S=window.devicePixelRatio||1,q=p.webkitBackingStorePixelRatio||p.mozBackingStorePixelRatio||p.msBackingStorePixelRatio||p.oBackingStorePixelRatio||p.backingStorePixelRatio||1;return S/q},P=p=>("0"+p.getUTCHours()).slice(-2)+":"+("0"+p.getUTCMinutes()).slice(-2)+":"+("0"+p.getUTCSeconds()).slice(-2),x=p=>{var $,Y;let S=parseFloat(p.input0),q=parseFloat(p.input1),T={};switch(p.filterType){case"clear":T={channelFiltersToClear:p.selChannels};break;case"bandpass":let Z=(S+q)/2,G=Math.abs((q-S)/2);T={filter:p.filterType,filterParameters:[4,Z,G],channels:p.selChannels};break;case"highpass":T={filter:p.filterType,filterParameters:[4,S],channels:p.selChannels};break;case"lowpass":T={filter:p.filterType,filterParameters:[4,S],channels:p.selChannels};break;case"bandstop":let H=10;const Q=p.notchFreq;T={filter:p.filterType,filterParameters:[4,Q,H],channels:p.selChannels};break;default:return}($=s.value)==null||$.sendFilterMessage(T);for(let Z=0;Z<p.selChannels.length;Z++){let G=p.selChannels[Z],H=find(index.propEq("id",G),r.value);p.filterType==="clear"?H.filter={}:H.filter={type:p.filterType,input0:S,input1:q,notchFreq:p.notchFreq}}(Y=s.value)==null||Y.invalidate(),ye()};return vue.onMounted(()=>{b.value=ie()}),c({rsPeriod:g,resetFocusedAnnotation:X,createAnnotationLayer:ce,getNextAnnotation:U,getPreviousAnnotation:ne,setFilters:x,setActiveTool:M,renderAll:ye,renderAnnotationCanvas:Ae,initViewerCanvas:xe}),(p,S)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",_hoisted_2,[vue.createVNode(TSPlotCanvas,{ref_key:"plotCanvas",ref:s,"c-width":f.cWidth,"c-height":f.cHeight,start:f.start,ts_start:f.tsStart,ts_end:f.tsEnd,duration:f.duration,constants:f.constants,"rs-period":g.value,"global-zoom-mult":f.globalZoomMult,"active-viewer":f.activeViewer,onChannelsInitialized:he,onSetGlobalZoom:oe},{axisCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"axisArea",ref_key:"axisArea",ref:u,class:"canvas",width:ge(f.cWidth,b.value,0),height:ge(f.cHeight,b.value,0),style:vue.normalizeStyle(z.value)},null,12,_hoisted_3)]),annCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"annArea",ref_key:"annArea",ref:a,class:"canvas",width:ge(f.cWidth,b.value,0),height:ge(B.value,b.value,0),style:vue.normalizeStyle(W.value)},null,12,_hoisted_4)]),_:1},8,["c-width","c-height","start","ts_start","ts_end","duration","constants","rs-period","global-zoom-mult","active-viewer"]),vue.createElementVNode("canvas",{id:"cursorArea",ref_key:"cursorArea",ref:h,class:"canvas",width:ge(f.cWidth+5,b.value,0),height:ge(f.cHeight,b.value,0),style:vue.normalizeStyle(K.value)},null,12,_hoisted_5),vue.createVNode(vue.unref(l),{ref_key:"annCanvas",ref:m,"c-width":f.cWidth,"c-height":f.cHeight,constants:f.constants,"annotations-canvas":a.value,"pixel-ratio":b.value,"rs-period":g.value,start:f.start,duration:f.duration,"ts-end":f.tsEnd,"pointer-mode":I.value,"viewer-active-tool":vue.unref(n),"active-viewer":f.activeViewer,onAnnLayersInitialized:me,onAnnotationsReceived:ue,onCloseAnnotationLayerWindow:se,onUpdateAnnotation:fe},null,8,["c-width","c-height","constants","annotations-canvas","pixel-ratio","rs-period","start","duration","ts-end","pointer-mode","viewer-active-tool","active-viewer"]),vue.createElementVNode("canvas",{id:"iArea",ref_key:"iArea",ref:R,class:"canvas",width:ge(f.cWidth,b.value,0),height:ge(f.cHeight,b.value,0),style:vue.normalizeStyle(z.value),tabindex:"-1",onWheel:be,onMousemove:qe,onMousedown:pe,onMouseup:Se,onMouseout:Oe,onMouseenter:ae},null,44,_hoisted_6)])]))}},TSViewerCanvas=index._export_sfc(_sfc_main,[["__scopeId","data-v-c902180d"]]),TSViewerCanvas$1=Object.freeze(Object.defineProperty({__proto__:null,default:TSViewerCanvas},Symbol.toStringTag,{value:"Module"}));exports.TSViewerCanvas=TSViewerCanvas$1;exports.find=find;exports.getDefaultExportFromCjs=getDefaultExportFromCjs;exports.head=head;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CGSfhm_E.cjs"),B=require("./BFLibraryButton-BiLkvU6m.cjs"),m={name:"CircleIcon",props:{icon:{type:String},height:{type:String,default:"16"},width:{type:String,default:"16"},currentColor:{type:String,default:"#71747C"}}},v={class:"circle-icon"};function p(t,o,a,c,d,n){return e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(t.$slots,"icon",{},void 0,!0)])}const b=i._export_sfc(m,[["render",p],["__scopeId","data-v-46dcef49"]]),g={name:"AnnotationLayerWindow",components:{CircleIcon:b,BfLibraryButton:B.default},props:{visible:{type:Boolean,default:!1}},data:function(){return{name:"",selectedColor:"",colorOptions:[{label:"Green",value:"#18BA62",iconBgColor:"#18BA62"},{label:"Gold",value:"#FFBC27",iconBgColor:"#FFBC27"},{label:"Red",value:"#E94B4B",iconBgColor:"#E94B4B"},{label:"Light Blue",value:"#2760FF",iconBgColor:"#2760FF"},{label:"Magenta",value:"#FF4FFF",iconBgColor:"#FF4FFF"},{label:"Cyan",value:"#50FFFF",iconBgColor:"#50FFFF"},{label:"Yellow",value:"#FFFF4E",iconBgColor:"#FFFF4E"},{label:"Purple",value:"#512BAF",iconBgColor:"#512BAF"},{label:"Lavendar",value:"#8A6ECF",iconBgColor:"#8A6ECF"},{label:"Teal",value:"#389BAD",iconBgColor:"#389BAD"},{label:"Dark Green",value:"#187D46",iconBgColor:"#187D46"},{label:"Brick Red",value:"#B12800",iconBgColor:"#B12800"},{label:"Dark Blue",value:"#0C2475",iconBgColor:"#0C2475"},{label:"Bright Orange",value:"#FF5321",iconBgColor:"#FF5321"},{label:"Pink",value:"#FF99CC",iconBgColor:"#FF99CC"},{label:"Tan",value:"#DCC180",iconBgColor:"#DCC180"},{label:"Medium Blue",value:"#0D4EFF",iconBgColor:"#0D4EFF"},{label:"Orange",value:"#FF6C21",iconBgColor:"#FF6C21"},{label:"Black",value:"#000000",iconBgColor:"#000000"},{label:"Gray",value:"#9B9B9B",iconBgColor:"#9B9B9B"},{label:"Lime",value:"#00FF00",iconBgColor:"#00FF00"},{label:"Salmon",value:"#FA8072",iconBgColor:"#FA8072"},{label:"Olive",value:"#808000",iconBgColor:"#808000"},{label:"Sienna",value:"#A0522D",iconBgColor:"#A0522D"}]}},methods:{close:function(){this.$emit("close-window")},handleFormSubmit:function(){this.$emit("createLayer",{name:this.name,color:this.selectedColor})},handleFormCancel:function(){this.close()}}},_={slot:"body"},f={class:"input-section"},y={class:"input-section"},V={class:"color-option"},h={style:{float:"right",color:"#8492a6","font-size":"13px"}},k={slot:"footer"},E={class:"button-wrapper"},N={class:"buttons"};function S(t,o,a,c,d,n){const s=e.resolveComponent("el-input"),u=e.resolveComponent("el-option"),C=e.resolveComponent("el-select"),r=e.resolveComponent("bf-library-button"),F=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(F,{"onUpdate:modelValue":o[2]||(o[2]=l=>a.visible=l),"model-value":a.visible,onClose:n.close,class:"timeseries-annotation-layer-modal",ref:"timeseries-filter-modal",title:"Annotation Layers"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createElementVNode("div",f,[o[3]||(o[3]=e.createTextVNode(" Layer Name: ",-1)),e.createVNode(s,{placeholder:"Add a Layer Name",modelValue:t.name,"onUpdate:modelValue":o[0]||(o[0]=l=>t.name=l),ref:"input"},null,8,["modelValue"])]),e.createElementVNode("div",y,[o[4]||(o[4]=e.createTextVNode(" Select Color: ",-1)),e.createVNode(C,{modelValue:t.selectedColor,"onUpdate:modelValue":o[1]||(o[1]=l=>t.selectedColor=l),placeholder:"Select"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.colorOptions,l=>(e.openBlock(),e.createBlock(u,{key:l.value,label:l.label,value:l.value},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:l.value,height:"30px",width:"30px",borderRadius:"50%"})},null,4),e.createElementVNode("div",h,e.toDisplayString(l.label),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",k,[e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createVNode(r,{onClick:n.handleFormCancel},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("Cancel ",-1)])]),_:1},8,["onClick"]),e.createVNode(r,{onClick:n.handleFormSubmit},{default:e.withCtx(()=>[...o[6]||(o[6]=[e.createTextVNode("Save ",-1)])]),_:1},8,["onClick"])])])])]),_:1},8,["model-value","onClose"])}const w=i._export_sfc(g,[["render",S],["__scopeId","data-v-117509d0"]]);exports.default=w;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CGSfhm_E.cjs"),T={name:"IconPreviousPage",props:{width:{type:Number,default:12},height:{type:Number,default:12},color:{type:String,default:"currentColor"}}},A=["width","height","fill"];function F(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 12 12"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M10.959,0.571 L3.756,5.52 C3.756,5.52 3.477,5.721 3.477,6.001 C3.477,6.281 3.756,6.48 3.756,6.48 L10.959,11.431 C11.531,11.811 12,11.53 12,10.805 L12,1.196 C12,0.469 11.531,0.188 10.959,0.571 Z M2,0 L1,0 C0.447,0 0,0.048 0,0.6 L0,11.4 C0,11.952 0.447,12 1,12 L2,12 C2.553,12 3,11.952 3,11.4 L3,0.6 C3,0.048 2.553,0 2,0 Z"},null,-1)])],8,A)}const q=s._export_sfc(T,[["render",F]]),D={name:"IconNextAnnotationLeftFacing",props:{width:{type:Number,default:24},height:{type:Number,default:14},color:{type:String,default:"currentColor"}}},O=["width","height","fill"];function R(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 24 14"},[...o[0]||(o[0]=[e.createElementVNode("defs",null,[e.createElementVNode("path",{pid:"0",d:"M4 5L.859 1.58a.695.695 0 0 1 0-.978.68.68 0 0 1 .969 0l3.83 3.908a.697.697 0 0 1 0 .979l-3.83 3.908a.68.68 0 0 1-.969 0 .695.695 0 0 1 0-.978L4 5z",id:"svgicon-next-annotation-left-facing-a"})],-1),e.createElementVNode("g",{_fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{transform:"matrix(-1 0 0 1 6 0)"},[e.createElementVNode("mask",{id:"svgicon-next-annotation-left-facing-b",_fill:"#fff"},[e.createElementVNode("use",{"xlink:href":"#svgicon-next-annotation-left-facing-a"})]),e.createElementVNode("use",{_fill:"#000","fill-rule":"nonzero","xlink:href":"#svgicon-next-annotation-left-facing-a"}),e.createElementVNode("g",{mask:"url(#svgicon-next-annotation-left-facing-b)",_fill:"#000"},[e.createElementVNode("path",{pid:"1",d:"M-2 0H8v10H-2z"})])]),e.createElementVNode("g",{_fill:"#000"},[e.createElementVNode("path",{pid:"2",d:"M23.986 10.906l-5.6-2.506 2.303 5.6.63-2.611zM10 8.4h1.4v1.4H10zM12.8 8.4h1.4v1.4h-1.4zM15.6 8.4H17v1.4h-1.4zM10 5.6h1.4V7H10zM10 2.8h1.4v1.4H10zM18.4 5.6h1.4V7h-1.4zM18.4 2.8h1.4v1.4h-1.4zM10 0h1.4v1.4H10zM12.8 0h1.4v1.4h-1.4zM15.6 0H17v1.4h-1.4zM18.4 0h1.4v1.4h-1.4z"})])],-1)])],8,O)}const U=s._export_sfc(D,[["render",R]]),j={name:"IconNextAnnotationRightFacing",props:{width:{type:Number,default:24},height:{type:Number,default:14},color:{type:String,default:"currentColor"}}},X=["width","height","fill"];function G(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 24 14"},[...o[0]||(o[0]=[e.createElementVNode("defs",null,[e.createElementVNode("path",{pid:"0",d:"M4 5L.859 1.58a.695.695 0 0 1 0-.978.68.68 0 0 1 .969 0l3.83 3.908a.697.697 0 0 1 0 .979l-3.83 3.908a.68.68 0 0 1-.969 0 .695.695 0 0 1 0-.978L4 5z",id:"svgicon-next-annotation-right-facing-a"})],-1),e.createElementVNode("g",{_fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{transform:"translate(18)"},[e.createElementVNode("mask",{id:"svgicon-next-annotation-right-facing-b",_fill:"#fff"},[e.createElementVNode("use",{"xlink:href":"#svgicon-next-annotation-right-facing-a"})]),e.createElementVNode("use",{_fill:"#000","fill-rule":"nonzero","xlink:href":"#svgicon-next-annotation-right-facing-a"}),e.createElementVNode("g",{mask:"url(#svgicon-next-annotation-right-facing-b)",_fill:"#000"},[e.createElementVNode("path",{pid:"1",d:"M-2 0H8v10H-2z"})])]),e.createElementVNode("g",{_fill:"#000"},[e.createElementVNode("path",{pid:"2",d:"M13.986 10.906L8.386 8.4l2.303 5.6.63-2.611zM0 8.4h1.4v1.4H0zM2.8 8.4h1.4v1.4H2.8zM5.6 8.4H7v1.4H5.6zM0 5.6h1.4V7H0zM0 2.8h1.4v1.4H0zM8.4 5.6h1.4V7H8.4zM8.4 2.8h1.4v1.4H8.4zM0 0h1.4v1.4H0zM2.8 0h1.4v1.4H2.8zM5.6 0H7v1.4H5.6zM8.4 0h1.4v1.4H8.4z"})])],-1)])],8,X)}const J=s._export_sfc(j,[["render",G]]),K={name:"IconNextPage",props:{width:{type:Number,default:16},height:{type:Number,default:16},color:{type:String,default:"currentColor"}}},Q=["width","height","fill"];function W(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 12 12"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M8.244,5.52 L1.041,0.571 C0.469,0.188 0,0.469 0,1.196 L0,10.805 C0,11.53 0.469,11.811 1.041,11.43 L8.244,6.479 C8.244,6.479 8.523,6.28 8.523,6.001 C8.523,5.721 8.244,5.52 8.244,5.52 Z M10,0 L11,0 C11.553,0 12,0.048 12,0.6 L12,11.4 C12,11.952 11.553,12 11,12 L10,12 C9.447,12 9,11.952 9,11.4 L9,0.6 C9,0.048 9.447,0 10,0 Z"},null,-1)])],8,Q)}const Y=s._export_sfc(K,[["render",W]]),ee={name:"IconStopwatch",props:{width:{type:Number,default:15},height:{type:Number,default:16},color:{type:String,default:"currentColor"}}},te=["width","height","fill"];function oe(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 15 16"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M5.1008,5.396 C4.7432,5.616 6.0584,8.7896 6.3792,9.3064 C6.6592,9.7616 7.2536,9.9 7.7056,9.6216 C8.16,9.34 8.3016,8.7464 8.0216,8.2936 C7.704,7.7752 5.4576,5.1752 5.1008,5.396 Z M4.8328,1.9216 C5.5752,1.6632 6.3704,1.52 7.2,1.52 C8.0296,1.52 8.8248,1.6632 9.5672,1.9216 C9.8304,2.0128 10.1792,1.8296 10.0248,1.4328 C9.912,1.1448 9.8032,0.8632 9.7592,0.7488 C9.6544,0.4776 9.2792,0.2536 9.116,0.2168 C8.4984,0.0776 7.8584,0 7.2,0 C6.5416,0 5.9016,0.0776 5.2832,0.2168 C5.12,0.2536 4.7456,0.4776 4.6408,0.7488 C4.5968,0.8632 4.4872,1.1448 4.3752,1.4328 C4.2208,1.8296 4.5696,2.0136 4.8328,1.9216 Z M14.4784,2.5488 C14.3248,2.3648 14.1616,2.1848 13.988,2.0112 C13.8152,1.8376 13.6352,1.6752 13.452,1.5208 C13.3296,1.4176 12.9696,1.3336 12.7416,1.5616 C12.5144,1.7896 11.4232,2.8792 11.4232,2.8792 C11.7448,3.1096 12.0576,3.3632 12.3472,3.652 C12.6368,3.9408 12.8888,4.2536 13.12,4.576 C13.12,4.576 14.2104,3.4864 14.4376,3.2584 C14.6664,3.0296 14.5824,2.6704 14.4784,2.5488 Z M7.2,2.32 C3.62,2.32 0.7192,5.2208 0.7192,8.8 C0.7192,12.38 3.62,15.2808 7.2,15.2808 C10.7784,15.2808 13.68,12.38 13.68,8.8 C13.68,5.2216 10.7784,2.32 7.2,2.32 Z M7.2,13.6808 C4.5056,13.6808 2.32,11.496 2.32,8.8008 C2.32,6.1056 4.5048,3.9208 7.2,3.9208 C9.8952,3.9208 12.0808,6.1056 12.0808,8.8008 C12.0808,11.4952 9.8952,13.6808 7.2,13.6808 Z"},null,-1)])],8,te)}const ne=s._export_sfc(ee,[["render",oe]]),le={name:"IconControllerPlay",props:{width:{type:Number,default:10},height:{type:Number,default:12},color:{type:String,default:"currentColor"}}},ae=["width","height","fill"];function re(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 20 12"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M10,6.001 C10,6.3 9.695,6.515 9.695,6.515 L1.134,11.818 C0.51,12.227 0,11.924 0,11.149 L0,0.852 C0,0.075 0.51,-0.226 1.135,0.182 L9.696,5.487 C9.695,5.487 10,5.702 10,6.001 Z"},null,-1)])],8,ae)}const ie=s._export_sfc(le,[["render",re]]),ce={name:"IconControllerPause",props:{width:{type:Number,default:10},height:{type:Number,default:12},color:{type:String,default:"currentColor"}}},de=["width","height","fill"];function se(c,o,t,l,r,i){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,fill:t.color,viewBox:"0 0 20 12"},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M2,0 C2.553,0 3,0.048 3,0.6 L3,11.4 C3,11.952 2.553,12 2,12 L1,12 C0.447,12 0,11.952 0,11.4 L0,0.6 C0,0.048 0.447,0 1,0 L2,0 Z M9,0 C9.553,0 10,0.048 10,0.6 L10,11.4 C10,11.952 9.553,12 9,12 L8,12 C7.447,12 7,11.952 7,11.4 L7,0.6 C7,0.048 7.447,0 8,0 L9,0 Z"},null,-1)])],8,de)}const ue=s._export_sfc(ce,[["render",se]]),me={class:"timeseries-viewer-toolbar"},he={id:"left-controls"},pe={id:"center-controls"},ge={id:"right-controls"},fe={__name:"TSViewerToolbar",props:{constants:{type:Object,required:!0},duration:{type:Number,required:!0},start:{type:Number,required:!0}},emits:["pageBack","pageForward","incrementZoom","decrementZoom","updateDuration","nextAnnotation","previousAnnotation","setStart"],setup(c,{emit:o}){const t=c,l=o,r=e.ref(!0),i=e.ref(!0),p=e.ref(!0);e.ref(0);const m=e.ref(!1),h=e.ref(null),g=e.ref(null),f=e.ref(150),_=e.ref(1e6),w=[{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],N=e.computed(()=>m.value===!0?ue:ie),v=e.computed({get(){return t.duration/1e6},set(u){l("updateDuration",u)}}),x=()=>{i.value=!i.value},V=()=>{r.value=!r.value},b=()=>{p.value=!p.value},k=()=>{m.value===!1?L():P()},E=()=>{l("pageBack")},y=()=>{l("pageForward")},M=()=>{l("incrementZoom")},B=()=>{l("decrementZoom")},$=()=>{l("nextAnnotation")},z=()=>{l("previousAnnotation")},L=()=>{m.value=!0;const u=()=>{l("setStart",t.start+_.value*h.value),g.value=setTimeout(u,f.value)};g.value=setTimeout(u,f.value)},P=()=>{m.value=!1,f.value=150,clearInterval(g.value)};return e.onMounted(()=>{h.value=1}),(u,n)=>{const d=e.resolveComponent("el-tooltip"),Z=e.resolveComponent("el-input-number"),C=e.resolveComponent("el-button"),H=e.resolveComponent("el-button-group"),S=e.resolveComponent("el-option"),I=e.resolveComponent("el-select");return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",he,[e.createVNode(d,{placement:"top-end",content:"Toggle Time Zoom Controls"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[0]||(n[0]=a=>x())})]),_:1}),i.value?(e.openBlock(),e.createBlock(Z,{key:0,modelValue:v.value,"onUpdate:modelValue":n[1]||(n[1]=a=>v.value=a),precision:1,step:5,max:c.constants.MAXDURATION,"controls-position":"right"},null,8,["modelValue","max"])):e.createCommentVNode("",!0),e.createVNode(d,{placement:"top-end",content:"Toggle Vertical Zoom Controls"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[2]||(n[2]=a=>V())})]),_:1}),r.value?(e.openBlock(),e.createBlock(H,{key:1},{default:e.withCtx(()=>[e.createVNode(C,{icon:"el-icon-plus",size:"small",onClick:M}),e.createVNode(C,{icon:"el-icon-minus",size:"small",onClick:B})]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",pe,[e.createVNode(d,{placement:"top-end",content:"Page Back"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[3]||(n[3]=a=>E())},[e.createVNode(q,{height:12,width:12})])]),_:1}),e.createVNode(d,{placement:"top-end",content:"Previous Annotation"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[4]||(n[4]=a=>z())},[e.createVNode(U,{height:12,width:18})])]),_:1}),e.createVNode(d,{placement:"top-end",content:"Automatic Forward"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[5]||(n[5]=a=>k())},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N.value),{height:12,width:18}))])]),_:1}),e.createVNode(d,{placement:"top-end",content:"Next Annotation"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[6]||(n[6]=a=>$())},[e.createVNode(J,{name:"next-annotation-right-facing",height:12,width:18})])]),_:1}),e.createVNode(d,{placement:"top-end",content:"Next Page"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[7]||(n[7]=a=>y())},[e.createVNode(Y,{name:"icon-next-page",height:12,width:18})])]),_:1})]),e.createElementVNode("div",ge,[e.createVNode(d,{placement:"top-end",content:"Toggle Play Back Speed Controls"},{default:e.withCtx(()=>[e.createElementVNode("button",{class:"btn-icon",onClick:n[8]||(n[8]=a=>b())},[e.createVNode(ne,{height:20,width:22})])]),_:1}),p.value?(e.openBlock(),e.createBlock(I,{key:0,modelValue:h.value,"onUpdate:modelValue":n[9]||(n[9]=a=>h.value=a),placeholder:"Select",size:"small",class:"playSelect"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(w,a=>e.createVNode(S,{key:a.value,label:a.label,value:a.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)])])}}},ve=s._export_sfc(fe,[["__scopeId","data-v-5b412e2a"]]);exports.default=ve;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-CGSfhm_E.cjs"),g=require("./BFLibraryButton-BiLkvU6m.cjs"),d=require("./pathOr-D0158Gk1.cjs"),h={name:"BfDialogHeader",props:{title:{type:String,default:""}},methods:{onClose:function(){this.$parent.handleClose()}}},_={class:"bf-dialog-header"},C={class:"bf-dialog-header-title"};function b(t,n,s,i,a,o){return e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("span",C,e.toDisplayString(s.title),1),this.$slots.tabs?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"icon-close",onClick:n[0]||(n[0]=(...r)=>o.onClose&&o.onClose(...r))})),e.renderSlot(t.$slots,"tabs",{},void 0,!0)])}const y=l._export_sfc(h,[["render",b],["__scopeId","data-v-1491a20c"]]),D={name:"DialogBody",setup(t,{slots:n}){return{hasSlot:i=>!!n[i]}},props:{fixedHeight:{type:Boolean,default:!1}},computed:{classNames:function(){const t=this.$slots.icon?"icon":"",n=this.fixedHeight?"fixed-height":"";return`dialog-body ${t} ${n}`}}},k={key:0,class:"dialog-body-icon"},v={key:1,class:"dialog-body-heading"},B={class:"dialog-body-content"};function V(t,n,s,i,a,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.classNames)},[i.hasSlot("icon")?(e.openBlock(),e.createElementBlock("div",k,[e.renderSlot(t.$slots,"icon",{},void 0,!0)])):e.createCommentVNode("",!0),i.hasSlot("heading")?(e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(t.$slots,"heading",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",B,[e.renderSlot(t.$slots,"default",{},void 0,!0)])],2)}const w=l._export_sfc(D,[["render",V],["__scopeId","data-v-690e953f"]]),N={name:"IconWarningCircle",props:{width:{type:Number,default:16},height:{type:Number,default:16},color:{type:String,default:"currentColor"}}},S=["width","height","fill"];function $(t,n,s,i,a,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:s.width,height:s.height,fill:s.color,viewBox:"0 0 24 24"},[...n[0]||(n[0]=[e.createElementVNode("path",{pid:"0",d:"M22 11.4c-.1-2.7-1.3-5.1-3.3-6.9-.4-.4-1-.3-1.4.1-.4.4-.3 1 .1 1.4 1.6 1.4 2.5 3.4 2.7 5.5.1 2.1-.6 4.2-2 5.8s-3.4 2.5-5.5 2.7c-2.1.1-4.2-.6-5.8-2-1.6-1.4-2.5-3.4-2.7-5.5-.1-2.1.6-4.2 2-5.8 1.3-1.4 3.1-2.4 5-2.6V11c0 .6.4 1 1 1s1-.4 1-1V2h-1C9.2 2 6.4 3.2 4.5 5.3c-1.8 2-2.7 4.6-2.5 7.2.1 2.7 1.3 5.1 3.3 6.9C7.2 21.2 9.6 22 12 22c2.7 0 5.5-1.1 7.5-3.3 1.7-2 2.6-4.6 2.5-7.3z"},null,-1),e.createElementVNode("circle",{pid:"1",cx:"12",cy:"15.5",r:"1.5"},null,-1)])],8,S)}const x=l._export_sfc(N,[["render",$]]),E={name:"TsAnnotationDeleteDialog",components:{BfDialogHeader:y,DialogBody:w,BfLibraryButton:g.default,IconWarningCircle:x},props:{visible:{type:Boolean,default:!1},deleteAnnotation:{type:Object,default:()=>({annotation:{},withDiscussions:!1})}},data:function(){return{isProcessing:!1}},computed:{annotationDescription:function(){return d.pathOr("",["annotation","label"],this.deleteAnnotation)},annotationDateTime:function(){const t=d.pathOr("",["annotation","start"],this.deleteAnnotation);return this.getUTCDateString(t)+" "+this.getUTCTimeString(t)},deleteDiscussions:function(){return l.propOr(!1,"withDiscussions",this.deleteAnnotation)},btnDeleteCopy:function(){return this.deleteDiscussions?"Yes, I'm sure":"Delete"}},methods:{removeAnnotation:function(){this.$emit("delete",this.deleteAnnotation.annotation)},close:function(){this.$emit("update:visible",!1)},onClosed:function(){this.isProcessing=!1,this.$emit("update:delete-annotation",{annotation:{},withDiscussions:!1})},getUTCDateString:function(t){return t>0?(t=new Date(t/1e3),t.toDateString()):"unknown"},getUTCTimeString:function(t){if(t>0)return t=t/1e3,t=new Date(t),("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)}}},T={class:"dialog-simple-buttons"};function A(t,n,s,i,a,o){const r=e.resolveComponent("bf-dialog-header"),u=e.resolveComponent("icon-warning-circle"),c=e.resolveComponent("bf-library-button"),f=e.resolveComponent("dialog-body"),m=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(m,{class:"simple",modelValue:s.visible,"onUpdate:modelValue":n[0]||(n[0]=p=>s.visible=p),"show-close":!1,onClose:o.close,onClosed:o.onClosed},{default:e.withCtx(()=>[e.createVNode(r,{slot:"title"}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(u,{class:"mb-16",height:32,width:32,color:"#C14D49"}),n[5]||(n[5]=e.createElementVNode("h2",null,"Delete annotation?",-1)),o.deleteDiscussions?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("p",null,e.toDisplayString(o.annotationDescription)+" - "+e.toDisplayString(o.annotationDateTime),1),n[1]||(n[1]=e.createElementVNode("hr",null,null,-1)),n[2]||(n[2]=e.createElementVNode("p",null," Deleting this annotation will also remove any associated discussions and cannot be undone. ",-1)),n[3]||(n[3]=e.createElementVNode("p",null," Are you sure you would like to remove this annotation? ",-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("div",T,[e.createVNode(c,{class:"secondary",onClick:o.close},{default:e.withCtx(()=>[...n[4]||(n[4]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["onClick"]),e.createVNode(c,{class:"red",processing:t.isProcessing,onClick:o.removeAnnotation},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.btnDeleteCopy),1)]),_:1},8,["processing","onClick"])])]),_:1})]),_:1},8,["modelValue","onClose","onClosed"])}const U=l._export_sfc(E,[["render",A],["__scopeId","data-v-3cc4b959"]]);exports.default=U;
|