@pennsieve-viz/tsviewer 1.1.13 → 1.1.15
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-B_TaDdTw.cjs → BFLibraryButton-CejyiXuM.cjs} +1 -1
- package/dist/{BFLibraryButton-DTcYY6VD.js → BFLibraryButton-DZ2vSCxe.js} +1 -1
- package/dist/{IconSelection-BocyglLO.js → IconSelection-BzYwshr4.js} +1 -1
- package/dist/{IconSelection-BPTLv8Go.cjs → IconSelection-cSMnGinu.cjs} +1 -1
- package/dist/{TSAnnotationCanvas-DaDdtIB4.cjs → TSAnnotationCanvas-4SmGl8c3.cjs} +1 -1
- package/dist/{TSAnnotationCanvas-DErBDH0Y.js → TSAnnotationCanvas-CbokCIrw.js} +2 -2
- package/dist/{TSAnnotationModal-DevUUWys.cjs → TSAnnotationModal-D0b8AU9O.cjs} +1 -1
- package/dist/{TSAnnotationModal-B3OSl05U.js → TSAnnotationModal-TeSqIo0K.js} +3 -3
- package/dist/{TSFilterModal-DHBpbDNp.js → TSFilterModal-2CfPJASx.js} +3 -3
- package/dist/{TSFilterModal-DoqvKSUT.cjs → TSFilterModal-fnGuCvzM.cjs} +1 -1
- package/dist/{TSScrubber-hN5JY-DA.js → TSScrubber-AOeCfSLx.js} +1 -1
- package/dist/{TSScrubber-E03DDcMn.cjs → TSScrubber-Du6rn9S7.cjs} +1 -1
- package/dist/{TSViewerCanvas-Dc5cwQzK.cjs → TSViewerCanvas-BQj5a8IV.cjs} +9 -9
- package/dist/{TSViewerCanvas-2Jz9ZgqW.js → TSViewerCanvas-ljR2hT4f.js} +995 -990
- package/dist/{TSViewerLayerWindow-PAfR31ZO.cjs → TSViewerLayerWindow-IT8yWMkx.cjs} +1 -1
- package/dist/{TSViewerLayerWindow-CalBmhT6.js → TSViewerLayerWindow-gUCLKeIc.js} +2 -2
- package/dist/{TSViewerToolbar-DL9XKYbV.js → TSViewerToolbar-CCrVE8tX.js} +1 -1
- package/dist/{TSViewerToolbar-C1wTQDPC.cjs → TSViewerToolbar-FIV2vK54.cjs} +1 -1
- package/dist/{TsAnnotationDeleteDialog-Cv3z3dFh.cjs → TsAnnotationDeleteDialog-B-NbfFR2.cjs} +1 -1
- package/dist/{TsAnnotationDeleteDialog-DXgN07Wj.js → TsAnnotationDeleteDialog-gCd7BJPS.js} +2 -2
- package/dist/index-Bu7yyQ4J.cjs +1 -0
- package/dist/{index-BsH36ax4.js → index-DdLtKk-t.js} +132 -130
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-yiwCKzNX.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const vue=require("vue"),pinia=require("pinia"),index=require("./index-yiwCKzNX.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,a=v.length;l<a;){if(c(v[l]))return v[l];l+=1}})),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),a=0,i=2,e=!0;i<arguments.length;)l[a++]=arguments[i++];return new Promise(function(r,n){l[a]=function(s){if(e)if(e=!1,s)n(s);else{for(var u=new Array(arguments.length-1),o=0;o<u.length;)u[o++]=arguments[o];r.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(t){var r=t.length;if(!r)return 0;for(var n=0;--r%4>1&&t.charAt(r)==="=";)++n;return Math.ceil(t.length*3)/4-n};for(var v=new Array(64),l=new Array(123),a=0;a<64;)l[v[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;c.encode=function(t,r,n){for(var d=null,s=[],u=0,o=0,h;r<n;){var m=t[r++];switch(o){case 0:s[u++]=v[m>>2],h=(m&3)<<4,o=1;break;case 1:s[u++]=v[h|m>>4],h=(m&15)<<2,o=2;break;case 2:s[u++]=v[h|m>>6],s[u++]=v[m&63],o=0;break}u>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,s)),u=0)}return o&&(s[u++]=v[h],s[u++]=61,o===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(t,r,n){for(var d=n,s=0,u,o=0;o<t.length;){var h=t.charCodeAt(o++);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:r[n++]=u<<2|(h&48)>>4,u=h,s=2;break;case 2:r[n++]=(u&15)<<4|(h&60)>>2,u=h,s=3;break;case 3:r[n++]=(u&3)<<6|h,s=0;break}}if(s===1)throw Error(i);return n-d},c.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}})(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,a){return(this._listeners[v]||(this._listeners[v]=[])).push({fn:l,ctx:a||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 a=this._listeners[v],i=0;i<a.length;)a[i].fn===l?a.splice(i,1):++i;return this},f.prototype.emit=function(v){var l=this._listeners[v];if(l){for(var a=[],i=1;i<arguments.length;)a.push(arguments[i++]);for(i=0;i<l.length;)l[i].fn.apply(l[i++].ctx,a)}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]),t=new Uint8Array(e.buffer),r=t[3]===128;function n(o,h,m){e[0]=o,h[m]=t[0],h[m+1]=t[1],h[m+2]=t[2],h[m+3]=t[3]}function d(o,h,m){e[0]=o,h[m]=t[3],h[m+1]=t[2],h[m+2]=t[1],h[m+3]=t[0]}i.writeFloatLE=r?n:d,i.writeFloatBE=r?d:n;function s(o,h){return t[0]=o[h],t[1]=o[h+1],t[2]=o[h+2],t[3]=o[h+3],e[0]}function u(o,h){return t[3]=o[h],t[2]=o[h+1],t[1]=o[h+2],t[0]=o[h+3],e[0]}i.readFloatLE=r?s:u,i.readFloatBE=r?u:s})():(function(){function e(r,n,d,s){var u=n<0?1:0;if(u&&(n=-n),n===0)r(1/n>0?0:2147483648,d,s);else if(isNaN(n))r(2143289344,d,s);else if(n>34028234663852886e22)r((u<<31|2139095040)>>>0,d,s);else if(n<11754943508222875e-54)r((u<<31|Math.round(n/1401298464324817e-60))>>>0,d,s);else{var o=Math.floor(Math.log(n)/Math.LN2),h=Math.round(n*Math.pow(2,-o)*8388608)&8388607;r((u<<31|o+127<<23|h)>>>0,d,s)}}i.writeFloatLE=e.bind(null,c),i.writeFloatBE=e.bind(null,v);function t(r,n,d){var s=r(n,d),u=(s>>31)*2+1,o=s>>>23&255,h=s&8388607;return o===255?h?NaN:u*(1/0):o===0?u*1401298464324817e-60*h:u*Math.pow(2,o-150)*(h+8388608)}i.readFloatLE=t.bind(null,l),i.readFloatBE=t.bind(null,a)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),r=t[7]===128;function n(o,h,m){e[0]=o,h[m]=t[0],h[m+1]=t[1],h[m+2]=t[2],h[m+3]=t[3],h[m+4]=t[4],h[m+5]=t[5],h[m+6]=t[6],h[m+7]=t[7]}function d(o,h,m){e[0]=o,h[m]=t[7],h[m+1]=t[6],h[m+2]=t[5],h[m+3]=t[4],h[m+4]=t[3],h[m+5]=t[2],h[m+6]=t[1],h[m+7]=t[0]}i.writeDoubleLE=r?n:d,i.writeDoubleBE=r?d:n;function s(o,h){return t[0]=o[h],t[1]=o[h+1],t[2]=o[h+2],t[3]=o[h+3],t[4]=o[h+4],t[5]=o[h+5],t[6]=o[h+6],t[7]=o[h+7],e[0]}function u(o,h){return t[7]=o[h],t[6]=o[h+1],t[5]=o[h+2],t[4]=o[h+3],t[3]=o[h+4],t[2]=o[h+5],t[1]=o[h+6],t[0]=o[h+7],e[0]}i.readDoubleLE=r?s:u,i.readDoubleBE=r?u:s})():(function(){function e(r,n,d,s,u,o){var h=s<0?1:0;if(h&&(s=-s),s===0)r(0,u,o+n),r(1/s>0?0:2147483648,u,o+d);else if(isNaN(s))r(0,u,o+n),r(2146959360,u,o+d);else if(s>17976931348623157e292)r(0,u,o+n),r((h<<31|2146435072)>>>0,u,o+d);else{var m;if(s<22250738585072014e-324)m=s/5e-324,r(m>>>0,u,o+n),r((h<<31|m/4294967296)>>>0,u,o+d);else{var R=Math.floor(Math.log(s)/Math.LN2);R===1024&&(R=1023),m=s*Math.pow(2,-R),r(m*4503599627370496>>>0,u,o+n),r((h<<31|R+1023<<20|m*1048576&1048575)>>>0,u,o+d)}}}i.writeDoubleLE=e.bind(null,c,0,4),i.writeDoubleBE=e.bind(null,v,4,0);function t(r,n,d,s,u){var o=r(s,u+n),h=r(s,u+d),m=(h>>31)*2+1,R=h>>>20&2047,y=4294967296*(h&1048575)+o;return R===2047?y?NaN:m*(1/0):R===0?m*5e-324*y:m*Math.pow(2,R-1075)*(y+4503599627370496)}i.readDoubleLE=t.bind(null,l,0,4),i.readDoubleBE=t.bind(null,a,4,0)})(),i}function c(i,e,t){e[t]=i&255,e[t+1]=i>>>8&255,e[t+2]=i>>>16&255,e[t+3]=i>>>24}function v(i,e,t){e[t]=i>>>24,e[t+1]=i>>>16&255,e[t+2]=i>>>8&255,e[t+3]=i&255}function l(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0}function a(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 a=0,i=0,e=0;e<l.length;++e)i=l.charCodeAt(e),i<128?a+=1:i<2048?a+=2:(i&64512)===55296&&(l.charCodeAt(e+1)&64512)===56320?(++e,a+=4):a+=3;return a},c.read=function(l,a,i){var e=i-a;if(e<1)return"";for(var t=null,r=[],n=0,d;a<i;)d=l[a++],d<128?r[n++]=d:d>191&&d<224?r[n++]=(d&31)<<6|l[a++]&63:d>239&&d<365?(d=((d&7)<<18|(l[a++]&63)<<12|(l[a++]&63)<<6|l[a++]&63)-65536,r[n++]=55296+(d>>10),r[n++]=56320+(d&1023)):r[n++]=(d&15)<<12|(l[a++]&63)<<6|l[a++]&63,n>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,r)),n=0);return t?(n&&t.push(String.fromCharCode.apply(String,r.slice(0,n))),t.join("")):String.fromCharCode.apply(String,r.slice(0,n))},c.write=function(l,a,i){for(var e=i,t,r,n=0;n<l.length;++n)t=l.charCodeAt(n),t<128?a[i++]=t:t<2048?(a[i++]=t>>6|192,a[i++]=t&63|128):(t&64512)===55296&&((r=l.charCodeAt(n+1))&64512)===56320?(t=65536+((t&1023)<<10)+(r&1023),++n,a[i++]=t>>18|240,a[i++]=t>>12&63|128,a[i++]=t>>6&63|128,a[i++]=t&63|128):(a[i++]=t>>12|224,a[i++]=t>>6&63|128,a[i++]=t&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 a=l||8192,i=a>>>1,e=null,t=a;return function(n){if(n<1||n>i)return c(n);t+n>a&&(e=c(a),t=0);var d=v.call(e,t,t+=n);return t&7&&(t=(t|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 t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new c(r,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 t=~this.lo+1>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+r*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 a=String.prototype.charCodeAt;return c.fromHash=function(e){return e===l?v:new c((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.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,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<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 index.commonjsGlobal<"u"&&index.commonjsGlobal&&index.commonjsGlobal.process&&index.commonjsGlobal.process.versions&&index.commonjsGlobal.process.versions.node),c.global=c.isNode&&index.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 t=i[e];return t!=null&&i.hasOwnProperty(e)?typeof t!="object"||(Array.isArray(t)?t.length:Object.keys(t).length)>0:!1},c.Buffer=(function(){try{var a=c.inquire("buffer").Buffer;return a.prototype.utf8Write?a: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 t=c.LongBits.fromHash(i);return c.Long?c.Long.fromBits(t.lo,t.hi,e):t.toNumber(!!e)};function v(a,i,e){for(var t=Object.keys(i),r=0;r<t.length;++r)(a[t[r]]===void 0||!e)&&(a[t[r]]=i[t[r]]);return a}c.merge=v,c.lcFirst=function(i){return i.charAt(0).toLowerCase()+i.substring(1)};function l(a){function i(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,i):Object.defineProperty(this,"stack",{value:new Error().stack||""}),t&&v(this,t)}return i.prototype=Object.create(Error.prototype,{constructor:{value:i,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},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={},t=0;t<i.length;++t)e[i[t]]=1;return function(){for(var r=Object.keys(this),n=r.length-1;n>-1;--n)if(e[r[n]]===1&&this[r[n]]!==void 0&&this[r[n]]!==null)return r[n]}},c.oneOfSetter=function(i){return function(e){for(var t=0;t<i.length;++t)i[t]!==e&&delete this[i[t]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var a=c.Buffer;if(!a){c._Buffer_from=c._Buffer_allocUnsafe=null;return}c._Buffer_from=a.from!==Uint8Array.from&&a.from||function(e,t){return new a(e,t)},c._Buffer_allocUnsafe=a.allocUnsafe||function(e){return new a(e)}}})(minimal)),minimal}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=r;var f=requireMinimal(),c,v=f.LongBits,l=f.base64,a=f.utf8;function i(R,y,g){this.fn=R,this.len=y,this.next=void 0,this.val=g}function e(){}function t(R){this.head=R.head,this.tail=R.tail,this.len=R.len,this.next=R.states}function r(){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(r.create=function(){return new c})()}:function(){return new r}};r.create=n(),r.alloc=function(y){return new f.Array(y)},f.Array!==Array&&(r.alloc=f.pool(r.alloc,f.Array.prototype.subarray)),r.prototype._push=function(y,g,S){return this.tail=this.tail.next=new i(y,g,S),this.len+=g,this};function d(R,y,g){y[g]=R&255}function s(R,y,g){for(;R>127;)y[g++]=R&127|128,R>>>=7;y[g]=R}function u(R,y){this.len=R,this.next=void 0,this.val=y}u.prototype=Object.create(i.prototype),u.prototype.fn=s,r.prototype.uint32=function(y){return this.len+=(this.tail=this.tail.next=new u((y=y>>>0)<128?1:y<16384?2:y<2097152?3:y<268435456?4:5,y)).len,this},r.prototype.int32=function(y){return y<0?this._push(o,10,v.fromNumber(y)):this.uint32(y)},r.prototype.sint32=function(y){return this.uint32((y<<1^y>>31)>>>0)};function o(R,y,g){for(;R.hi;)y[g++]=R.lo&127|128,R.lo=(R.lo>>>7|R.hi<<25)>>>0,R.hi>>>=7;for(;R.lo>127;)y[g++]=R.lo&127|128,R.lo=R.lo>>>7;y[g++]=R.lo}r.prototype.uint64=function(y){var g=v.from(y);return this._push(o,g.length(),g)},r.prototype.int64=r.prototype.uint64,r.prototype.sint64=function(y){var g=v.from(y).zzEncode();return this._push(o,g.length(),g)},r.prototype.bool=function(y){return this._push(d,1,y?1:0)};function h(R,y,g){y[g]=R&255,y[g+1]=R>>>8&255,y[g+2]=R>>>16&255,y[g+3]=R>>>24}r.prototype.fixed32=function(y){return this._push(h,4,y>>>0)},r.prototype.sfixed32=r.prototype.fixed32,r.prototype.fixed64=function(y){var g=v.from(y);return this._push(h,4,g.lo)._push(h,4,g.hi)},r.prototype.sfixed64=r.prototype.fixed64,r.prototype.float=function(y){return this._push(f.float.writeFloatLE,4,y)},r.prototype.double=function(y){return this._push(f.float.writeDoubleLE,8,y)};var m=f.Array.prototype.set?function(y,g,S){g.set(y,S)}:function(y,g,S){for(var k=0;k<y.length;++k)g[S+k]=y[k]};return r.prototype.bytes=function(y){var g=y.length>>>0;if(!g)return this._push(d,1,0);if(f.isString(y)){var S=r.alloc(g=l.length(y));l.decode(y,S,0),y=S}return this.uint32(g)._push(m,g,y)},r.prototype.string=function(y){var g=a.length(y);return g?this.uint32(g)._push(a.write,g,y):this._push(d,1,0)},r.prototype.fork=function(){return this.states=new t(this),this.head=this.tail=new i(e,0,0),this.len=0,this},r.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},r.prototype.ldelim=function(){var y=this.head,g=this.tail,S=this.len;return this.reset().uint32(S),S&&(this.tail.next=y.next,this.tail=g,this.len+=S),this},r.prototype.finish=function(){for(var y=this.head.next,g=this.constructor.alloc(this.len),S=0;y;)y.fn(y.val,g,S),S+=y.len,y=y.next;return g},r._configure=function(R){c=R,r.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,t){e.set(i,t)}:function(i,e,t){if(i.copy)i.copy(e,t,0,i.length);else for(var r=0;r<i.length;)e[t++]=i[r++]}},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(a,i,e){a.length<40?c.utf8.write(a,i,e):i.utf8Write?i.utf8Write(a,e):i.write(a,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 a(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")},t=function(){return f.Buffer?function(o){return(i.create=function(m){return f.Buffer.isBuffer(m)?new c(m):e(m)})(o)}:e};i.create=t(),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,a(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 r(){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 a(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 a(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 a(this,4);return n(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return n(this.buf,this.pos+=4)|0};function d(){if(this.pos+8>this.len)throw a(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 a(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 a(this,4);var u=f.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,u},i.prototype.bytes=function(){var u=this.uint32(),o=this.pos,h=this.pos+u;if(h>this.len)throw a(this,u);if(this.pos+=u,Array.isArray(this.buf))return this.buf.slice(o,h);if(o===h){var m=f.Buffer;return m?m.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,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 a(this,u);this.pos+=u}else do if(this.pos>=this.len)throw a(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=t(),c._configure();var u=f.Long?"toLong":"toNumber";f.merge(i.prototype,{int64:function(){return r.call(this)[u](!1)},uint64:function(){return r.call(this)[u](!0)},sint64:function(){return r.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 a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,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,a){if(typeof v!="function")throw TypeError("rpcImpl must be a function");f.EventEmitter.call(this),this.rpcImpl=v,this.requestDelimited=!!l,this.responseDelimited=!!a}return c.prototype.rpcCall=function v(l,a,i,e,t){if(!e)throw TypeError("request must be specified");var r=this;if(!t)return f.asPromise(v,r,l,a,i,e);if(!r.rpcImpl){setTimeout(function(){t(Error("already ended"))},0);return}try{return r.rpcImpl(l,a[r.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(d,s){if(d)return r.emit("error",d,l),t(d);if(s===null){r.end(!0);return}if(!(s instanceof i))try{s=i[r.responseDelimited?"decodeDelimited":"decode"](s)}catch(u){return r.emit("error",u,l),t(u)}return r.emit("data",s,l),t(null,s)})}catch(n){r.emit("error",n,l),setTimeout(function(){t(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 a(e){if(typeof e!="string"){var t=i();if(f.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var r=Object.keys(e),n=new Array(r.length+1),d=new Array(r.length),s=0;s<r.length;)n[s]=r[s],d[s]=e[r[s++]];return n[s]=t,Function.apply(null,n).apply(null,d)}return Function(t)()}for(var u=new Array(arguments.length-1),o=0;o<u.length;)u[o]=arguments[++o];if(o=0,e=e.replace(/%([%dfijs])/g,function(m,R){var y=u[o++];switch(R){case"d":case"f":return String(Number(y));case"i":return String(Math.floor(y));case"j":return JSON.stringify(y);case"s":return String(y)}return"%"}),o!==u.length)throw Error("parameter count mismatch");return l.push(e),a}function i(e){return"function "+(e||v||"")+"("+(c&&c.join(",")||"")+`){
|
|
1
|
+
"use strict";const vue=require("vue"),pinia=require("pinia"),index=require("./index-Bu7yyQ4J.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,a=v.length;l<a;){if(c(v[l]))return v[l];l+=1}})),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),a=0,i=2,e=!0;i<arguments.length;)l[a++]=arguments[i++];return new Promise(function(r,n){l[a]=function(s){if(e)if(e=!1,s)n(s);else{for(var u=new Array(arguments.length-1),o=0;o<u.length;)u[o++]=arguments[o];r.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(t){var r=t.length;if(!r)return 0;for(var n=0;--r%4>1&&t.charAt(r)==="=";)++n;return Math.ceil(t.length*3)/4-n};for(var v=new Array(64),l=new Array(123),a=0;a<64;)l[v[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;c.encode=function(t,r,n){for(var d=null,s=[],u=0,o=0,h;r<n;){var m=t[r++];switch(o){case 0:s[u++]=v[m>>2],h=(m&3)<<4,o=1;break;case 1:s[u++]=v[h|m>>4],h=(m&15)<<2,o=2;break;case 2:s[u++]=v[h|m>>6],s[u++]=v[m&63],o=0;break}u>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,s)),u=0)}return o&&(s[u++]=v[h],s[u++]=61,o===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(t,r,n){for(var d=n,s=0,u,o=0;o<t.length;){var h=t.charCodeAt(o++);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:r[n++]=u<<2|(h&48)>>4,u=h,s=2;break;case 2:r[n++]=(u&15)<<4|(h&60)>>2,u=h,s=3;break;case 3:r[n++]=(u&3)<<6|h,s=0;break}}if(s===1)throw Error(i);return n-d},c.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}})(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,a){return(this._listeners[v]||(this._listeners[v]=[])).push({fn:l,ctx:a||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 a=this._listeners[v],i=0;i<a.length;)a[i].fn===l?a.splice(i,1):++i;return this},f.prototype.emit=function(v){var l=this._listeners[v];if(l){for(var a=[],i=1;i<arguments.length;)a.push(arguments[i++]);for(i=0;i<l.length;)l[i].fn.apply(l[i++].ctx,a)}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]),t=new Uint8Array(e.buffer),r=t[3]===128;function n(o,h,m){e[0]=o,h[m]=t[0],h[m+1]=t[1],h[m+2]=t[2],h[m+3]=t[3]}function d(o,h,m){e[0]=o,h[m]=t[3],h[m+1]=t[2],h[m+2]=t[1],h[m+3]=t[0]}i.writeFloatLE=r?n:d,i.writeFloatBE=r?d:n;function s(o,h){return t[0]=o[h],t[1]=o[h+1],t[2]=o[h+2],t[3]=o[h+3],e[0]}function u(o,h){return t[3]=o[h],t[2]=o[h+1],t[1]=o[h+2],t[0]=o[h+3],e[0]}i.readFloatLE=r?s:u,i.readFloatBE=r?u:s})():(function(){function e(r,n,d,s){var u=n<0?1:0;if(u&&(n=-n),n===0)r(1/n>0?0:2147483648,d,s);else if(isNaN(n))r(2143289344,d,s);else if(n>34028234663852886e22)r((u<<31|2139095040)>>>0,d,s);else if(n<11754943508222875e-54)r((u<<31|Math.round(n/1401298464324817e-60))>>>0,d,s);else{var o=Math.floor(Math.log(n)/Math.LN2),h=Math.round(n*Math.pow(2,-o)*8388608)&8388607;r((u<<31|o+127<<23|h)>>>0,d,s)}}i.writeFloatLE=e.bind(null,c),i.writeFloatBE=e.bind(null,v);function t(r,n,d){var s=r(n,d),u=(s>>31)*2+1,o=s>>>23&255,h=s&8388607;return o===255?h?NaN:u*(1/0):o===0?u*1401298464324817e-60*h:u*Math.pow(2,o-150)*(h+8388608)}i.readFloatLE=t.bind(null,l),i.readFloatBE=t.bind(null,a)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),r=t[7]===128;function n(o,h,m){e[0]=o,h[m]=t[0],h[m+1]=t[1],h[m+2]=t[2],h[m+3]=t[3],h[m+4]=t[4],h[m+5]=t[5],h[m+6]=t[6],h[m+7]=t[7]}function d(o,h,m){e[0]=o,h[m]=t[7],h[m+1]=t[6],h[m+2]=t[5],h[m+3]=t[4],h[m+4]=t[3],h[m+5]=t[2],h[m+6]=t[1],h[m+7]=t[0]}i.writeDoubleLE=r?n:d,i.writeDoubleBE=r?d:n;function s(o,h){return t[0]=o[h],t[1]=o[h+1],t[2]=o[h+2],t[3]=o[h+3],t[4]=o[h+4],t[5]=o[h+5],t[6]=o[h+6],t[7]=o[h+7],e[0]}function u(o,h){return t[7]=o[h],t[6]=o[h+1],t[5]=o[h+2],t[4]=o[h+3],t[3]=o[h+4],t[2]=o[h+5],t[1]=o[h+6],t[0]=o[h+7],e[0]}i.readDoubleLE=r?s:u,i.readDoubleBE=r?u:s})():(function(){function e(r,n,d,s,u,o){var h=s<0?1:0;if(h&&(s=-s),s===0)r(0,u,o+n),r(1/s>0?0:2147483648,u,o+d);else if(isNaN(s))r(0,u,o+n),r(2146959360,u,o+d);else if(s>17976931348623157e292)r(0,u,o+n),r((h<<31|2146435072)>>>0,u,o+d);else{var m;if(s<22250738585072014e-324)m=s/5e-324,r(m>>>0,u,o+n),r((h<<31|m/4294967296)>>>0,u,o+d);else{var R=Math.floor(Math.log(s)/Math.LN2);R===1024&&(R=1023),m=s*Math.pow(2,-R),r(m*4503599627370496>>>0,u,o+n),r((h<<31|R+1023<<20|m*1048576&1048575)>>>0,u,o+d)}}}i.writeDoubleLE=e.bind(null,c,0,4),i.writeDoubleBE=e.bind(null,v,4,0);function t(r,n,d,s,u){var o=r(s,u+n),h=r(s,u+d),m=(h>>31)*2+1,R=h>>>20&2047,y=4294967296*(h&1048575)+o;return R===2047?y?NaN:m*(1/0):R===0?m*5e-324*y:m*Math.pow(2,R-1075)*(y+4503599627370496)}i.readDoubleLE=t.bind(null,l,0,4),i.readDoubleBE=t.bind(null,a,4,0)})(),i}function c(i,e,t){e[t]=i&255,e[t+1]=i>>>8&255,e[t+2]=i>>>16&255,e[t+3]=i>>>24}function v(i,e,t){e[t]=i>>>24,e[t+1]=i>>>16&255,e[t+2]=i>>>8&255,e[t+3]=i&255}function l(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0}function a(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 a=0,i=0,e=0;e<l.length;++e)i=l.charCodeAt(e),i<128?a+=1:i<2048?a+=2:(i&64512)===55296&&(l.charCodeAt(e+1)&64512)===56320?(++e,a+=4):a+=3;return a},c.read=function(l,a,i){var e=i-a;if(e<1)return"";for(var t=null,r=[],n=0,d;a<i;)d=l[a++],d<128?r[n++]=d:d>191&&d<224?r[n++]=(d&31)<<6|l[a++]&63:d>239&&d<365?(d=((d&7)<<18|(l[a++]&63)<<12|(l[a++]&63)<<6|l[a++]&63)-65536,r[n++]=55296+(d>>10),r[n++]=56320+(d&1023)):r[n++]=(d&15)<<12|(l[a++]&63)<<6|l[a++]&63,n>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,r)),n=0);return t?(n&&t.push(String.fromCharCode.apply(String,r.slice(0,n))),t.join("")):String.fromCharCode.apply(String,r.slice(0,n))},c.write=function(l,a,i){for(var e=i,t,r,n=0;n<l.length;++n)t=l.charCodeAt(n),t<128?a[i++]=t:t<2048?(a[i++]=t>>6|192,a[i++]=t&63|128):(t&64512)===55296&&((r=l.charCodeAt(n+1))&64512)===56320?(t=65536+((t&1023)<<10)+(r&1023),++n,a[i++]=t>>18|240,a[i++]=t>>12&63|128,a[i++]=t>>6&63|128,a[i++]=t&63|128):(a[i++]=t>>12|224,a[i++]=t>>6&63|128,a[i++]=t&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 a=l||8192,i=a>>>1,e=null,t=a;return function(n){if(n<1||n>i)return c(n);t+n>a&&(e=c(a),t=0);var d=v.call(e,t,t+=n);return t&7&&(t=(t|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 t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new c(r,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 t=~this.lo+1>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+r*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 a=String.prototype.charCodeAt;return c.fromHash=function(e){return e===l?v:new c((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.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,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<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 index.commonjsGlobal<"u"&&index.commonjsGlobal&&index.commonjsGlobal.process&&index.commonjsGlobal.process.versions&&index.commonjsGlobal.process.versions.node),c.global=c.isNode&&index.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 t=i[e];return t!=null&&i.hasOwnProperty(e)?typeof t!="object"||(Array.isArray(t)?t.length:Object.keys(t).length)>0:!1},c.Buffer=(function(){try{var a=c.inquire("buffer").Buffer;return a.prototype.utf8Write?a: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 t=c.LongBits.fromHash(i);return c.Long?c.Long.fromBits(t.lo,t.hi,e):t.toNumber(!!e)};function v(a,i,e){for(var t=Object.keys(i),r=0;r<t.length;++r)(a[t[r]]===void 0||!e)&&(a[t[r]]=i[t[r]]);return a}c.merge=v,c.lcFirst=function(i){return i.charAt(0).toLowerCase()+i.substring(1)};function l(a){function i(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,i):Object.defineProperty(this,"stack",{value:new Error().stack||""}),t&&v(this,t)}return i.prototype=Object.create(Error.prototype,{constructor:{value:i,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},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={},t=0;t<i.length;++t)e[i[t]]=1;return function(){for(var r=Object.keys(this),n=r.length-1;n>-1;--n)if(e[r[n]]===1&&this[r[n]]!==void 0&&this[r[n]]!==null)return r[n]}},c.oneOfSetter=function(i){return function(e){for(var t=0;t<i.length;++t)i[t]!==e&&delete this[i[t]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var a=c.Buffer;if(!a){c._Buffer_from=c._Buffer_allocUnsafe=null;return}c._Buffer_from=a.from!==Uint8Array.from&&a.from||function(e,t){return new a(e,t)},c._Buffer_allocUnsafe=a.allocUnsafe||function(e){return new a(e)}}})(minimal)),minimal}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=r;var f=requireMinimal(),c,v=f.LongBits,l=f.base64,a=f.utf8;function i(R,y,g){this.fn=R,this.len=y,this.next=void 0,this.val=g}function e(){}function t(R){this.head=R.head,this.tail=R.tail,this.len=R.len,this.next=R.states}function r(){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(r.create=function(){return new c})()}:function(){return new r}};r.create=n(),r.alloc=function(y){return new f.Array(y)},f.Array!==Array&&(r.alloc=f.pool(r.alloc,f.Array.prototype.subarray)),r.prototype._push=function(y,g,S){return this.tail=this.tail.next=new i(y,g,S),this.len+=g,this};function d(R,y,g){y[g]=R&255}function s(R,y,g){for(;R>127;)y[g++]=R&127|128,R>>>=7;y[g]=R}function u(R,y){this.len=R,this.next=void 0,this.val=y}u.prototype=Object.create(i.prototype),u.prototype.fn=s,r.prototype.uint32=function(y){return this.len+=(this.tail=this.tail.next=new u((y=y>>>0)<128?1:y<16384?2:y<2097152?3:y<268435456?4:5,y)).len,this},r.prototype.int32=function(y){return y<0?this._push(o,10,v.fromNumber(y)):this.uint32(y)},r.prototype.sint32=function(y){return this.uint32((y<<1^y>>31)>>>0)};function o(R,y,g){for(;R.hi;)y[g++]=R.lo&127|128,R.lo=(R.lo>>>7|R.hi<<25)>>>0,R.hi>>>=7;for(;R.lo>127;)y[g++]=R.lo&127|128,R.lo=R.lo>>>7;y[g++]=R.lo}r.prototype.uint64=function(y){var g=v.from(y);return this._push(o,g.length(),g)},r.prototype.int64=r.prototype.uint64,r.prototype.sint64=function(y){var g=v.from(y).zzEncode();return this._push(o,g.length(),g)},r.prototype.bool=function(y){return this._push(d,1,y?1:0)};function h(R,y,g){y[g]=R&255,y[g+1]=R>>>8&255,y[g+2]=R>>>16&255,y[g+3]=R>>>24}r.prototype.fixed32=function(y){return this._push(h,4,y>>>0)},r.prototype.sfixed32=r.prototype.fixed32,r.prototype.fixed64=function(y){var g=v.from(y);return this._push(h,4,g.lo)._push(h,4,g.hi)},r.prototype.sfixed64=r.prototype.fixed64,r.prototype.float=function(y){return this._push(f.float.writeFloatLE,4,y)},r.prototype.double=function(y){return this._push(f.float.writeDoubleLE,8,y)};var m=f.Array.prototype.set?function(y,g,S){g.set(y,S)}:function(y,g,S){for(var k=0;k<y.length;++k)g[S+k]=y[k]};return r.prototype.bytes=function(y){var g=y.length>>>0;if(!g)return this._push(d,1,0);if(f.isString(y)){var S=r.alloc(g=l.length(y));l.decode(y,S,0),y=S}return this.uint32(g)._push(m,g,y)},r.prototype.string=function(y){var g=a.length(y);return g?this.uint32(g)._push(a.write,g,y):this._push(d,1,0)},r.prototype.fork=function(){return this.states=new t(this),this.head=this.tail=new i(e,0,0),this.len=0,this},r.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},r.prototype.ldelim=function(){var y=this.head,g=this.tail,S=this.len;return this.reset().uint32(S),S&&(this.tail.next=y.next,this.tail=g,this.len+=S),this},r.prototype.finish=function(){for(var y=this.head.next,g=this.constructor.alloc(this.len),S=0;y;)y.fn(y.val,g,S),S+=y.len,y=y.next;return g},r._configure=function(R){c=R,r.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,t){e.set(i,t)}:function(i,e,t){if(i.copy)i.copy(e,t,0,i.length);else for(var r=0;r<i.length;)e[t++]=i[r++]}},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(a,i,e){a.length<40?c.utf8.write(a,i,e):i.utf8Write?i.utf8Write(a,e):i.write(a,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 a(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")},t=function(){return f.Buffer?function(o){return(i.create=function(m){return f.Buffer.isBuffer(m)?new c(m):e(m)})(o)}:e};i.create=t(),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,a(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 r(){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 a(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 a(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 a(this,4);return n(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return n(this.buf,this.pos+=4)|0};function d(){if(this.pos+8>this.len)throw a(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 a(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 a(this,4);var u=f.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,u},i.prototype.bytes=function(){var u=this.uint32(),o=this.pos,h=this.pos+u;if(h>this.len)throw a(this,u);if(this.pos+=u,Array.isArray(this.buf))return this.buf.slice(o,h);if(o===h){var m=f.Buffer;return m?m.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,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 a(this,u);this.pos+=u}else do if(this.pos>=this.len)throw a(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=t(),c._configure();var u=f.Long?"toLong":"toNumber";f.merge(i.prototype,{int64:function(){return r.call(this)[u](!1)},uint64:function(){return r.call(this)[u](!0)},sint64:function(){return r.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 a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,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,a){if(typeof v!="function")throw TypeError("rpcImpl must be a function");f.EventEmitter.call(this),this.rpcImpl=v,this.requestDelimited=!!l,this.responseDelimited=!!a}return c.prototype.rpcCall=function v(l,a,i,e,t){if(!e)throw TypeError("request must be specified");var r=this;if(!t)return f.asPromise(v,r,l,a,i,e);if(!r.rpcImpl){setTimeout(function(){t(Error("already ended"))},0);return}try{return r.rpcImpl(l,a[r.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(d,s){if(d)return r.emit("error",d,l),t(d);if(s===null){r.end(!0);return}if(!(s instanceof i))try{s=i[r.responseDelimited?"decodeDelimited":"decode"](s)}catch(u){return r.emit("error",u,l),t(u)}return r.emit("data",s,l),t(null,s)})}catch(n){r.emit("error",n,l),setTimeout(function(){t(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 a(e){if(typeof e!="string"){var t=i();if(f.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var r=Object.keys(e),n=new Array(r.length+1),d=new Array(r.length),s=0;s<r.length;)n[s]=r[s],d[s]=e[r[s++]];return n[s]=t,Function.apply(null,n).apply(null,d)}return Function(t)()}for(var u=new Array(arguments.length-1),o=0;o<u.length;)u[o]=arguments[++o];if(o=0,e=e.replace(/%([%dfijs])/g,function(m,R){var y=u[o++];switch(R){case"d":case"f":return String(Number(y));case"i":return String(Math.floor(y));case"j":return JSON.stringify(y);case"s":return String(y)}return"%"}),o!==u.length)throw Error("parameter count mismatch");return l.push(e),a}function i(e){return"function "+(e||v||"")+"("+(c&&c.join(",")||"")+`){
|
|
2
2
|
`+l.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
}`}return a.toString=i,a}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(a,i,e){return typeof i=="function"?(e=i,i={}):i||(i={}),e?!i.xhr&&v&&v.readFile?v.readFile(a,function(r,n){return r&&typeof XMLHttpRequest<"u"?l.xhr(a,i,e):r?e(r):e(null,i.binary?n:n.toString("utf8"))}):l.xhr(a,i,e):f(l,this,a,i)}return l.xhr=function(i,e,t){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return t(Error("status "+r.status));if(e.binary){var d=r.response;if(!d){d=[];for(var s=0;s<r.responseText.length;++s)d.push(r.responseText.charCodeAt(s)&255)}return t(null,typeof Uint8Array<"u"?new Uint8Array(d):d)}return t(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",i),r.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("/"),t=v(i),r="";t&&(r=e.shift()+"/");for(var n=0;n<e.length;)e[n]===".."?n>0&&e[n-1]!==".."?e.splice(--n,2):t?e.splice(n,1):++n:e[n]==="."?e.splice(n,1):++n;return r+e.join("/")};c.resolve=function(i,e,t){return t||(e=l(e)),v(e)?e:(t||(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=r;var f=requireObject();((r.prototype=Object.create(f.prototype)).constructor=r).className="Namespace";var c=requireField(),v=requireUtil(),l=requireOneof(),a,i,e;r.fromJSON=function(s,u){return new r(s,u.options).addJSON(u.nested)};function t(d,s){if(d&&d.length){for(var u={},o=0;o<d.length;++o)u[d[o].name]=d[o].toJSON(s);return u}}r.arrayToJSON=t,r.isReservedId=function(s,u){if(s){for(var o=0;o<s.length;++o)if(typeof s[o]!="string"&&s[o][0]<=u&&s[o][1]>u)return!0}return!1},r.isReservedName=function(s,u){if(s){for(var o=0;o<s.length;++o)if(s[o]===u)return!0}return!1};function r(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(r.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=v.toArray(this.nested))}}),r.prototype.toJSON=function(s){return v.toObject(["options",this.options,"nested",t(this.nestedArray,s)])},r.prototype.addJSON=function(s){var u=this;if(s)for(var o=Object.keys(s),h=0,m;h<o.length;++h)m=s[o[h]],u.add((m.fields!==void 0?a.fromJSON:m.values!==void 0?e.fromJSON:m.methods!==void 0?i.fromJSON:m.id!==void 0?c.fromJSON:r.fromJSON)(o[h],m));return this},r.prototype.get=function(s){return this.nested&&this.nested[s]||null},r.prototype.getEnum=function(s){if(this.nested&&this.nested[s]instanceof e)return this.nested[s].values;throw Error("no such enum: "+s)},r.prototype.add=function(s){if(!(s instanceof c&&s.extend!==void 0||s instanceof a||s instanceof l||s instanceof e||s instanceof i||s instanceof r))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 r&&s instanceof r&&!(u instanceof a||u instanceof i)){for(var o=u.nestedArray,h=0;h<o.length;++h)s.add(o[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 a||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)},r.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)},r.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 o=this;s.length>0;){var h=s.shift();if(o.nested&&o.nested[h]){if(o=o.nested[h],!(o instanceof r))throw Error("path conflicts with non-namespace objects")}else o.add(o=new r(h))}return u&&o.addJSON(u),o},r.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 r?s[u++].resolveAll():s[u++].resolve();return this._needsRecursiveResolve=!1,this},r.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},r.prototype.lookup=function(s,u,o){if(typeof u=="boolean"?(o=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(o)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},r.prototype._lookupImpl=function(s,u){if(Object.prototype.hasOwnProperty.call(this._lookupCache,u))return this._lookupCache[u];var o=this.get(s[0]),h=null;if(o)s.length===1?h=o:o instanceof r&&(s=s.slice(1),h=o._lookupImpl(s,s.join(".")));else for(var m=0;m<this.nestedArray.length;++m)this._nestedArray[m]instanceof r&&(o=this._nestedArray[m]._lookupImpl(s,u))&&(h=o);return this._lookupCache[u]=h,h},r.prototype.lookupType=function(s){var u=this.lookup(s,[a]);if(!u)throw Error("no such type: "+s);return u},r.prototype.lookupEnum=function(s){var u=this.lookup(s,[e]);if(!u)throw Error("no such Enum '"+s+"' in "+this);return u},r.prototype.lookupTypeOrEnum=function(s){var u=this.lookup(s,[a,e]);if(!u)throw Error("no such Type or Enum '"+s+"' in "+this);return u},r.prototype.lookupService=function(s){var u=this.lookup(s,[i]);if(!u)throw Error("no such Service '"+s+"' in "+this);return u},r._configure=function(d,s,u){a=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(a,i,e,t,r,n){if(f.call(this,a,i,t,void 0,void 0,r,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,t){return typeof t=="function"?t=v.decorateType(t).name:t&&typeof t=="object"&&(t=v.decorateEnum(t).name),function(n,d){v.decorateType(n.constructor).add(new l(d,i,e,t))}},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,a,i,e,t,r,n,d,s){if(c.isObject(t)?(n=t,t=r=void 0):c.isObject(r)&&(n=r,r=void 0),!(a===void 0||c.isString(a)))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=a||"rpc",this.requestType=i,this.requestStream=t?!0:void 0,this.responseType=e,this.responseStream=r?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=d,this.parsedOptions=s}return v.fromJSON=function(a,i){return new v(a,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)},v.prototype.toJSON=function(a){var i=a?!!a.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=a;var f=requireNamespace();((a.prototype=Object.create(f.prototype)).constructor=a).className="Service";var c=requireMethod(),v=requireUtil(),l=requireRpc();function a(e,t){f.call(this,e,t),this.methods={},this._methodsArray=null}a.fromJSON=function(t,r){var n=new a(t,r.options);if(r.methods)for(var d=Object.keys(r.methods),s=0;s<d.length;++s)n.add(c.fromJSON(d[s],r.methods[d[s]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},a.prototype.toJSON=function(t){var r=f.prototype.toJSON.call(this,t),n=t?!!t.keepComments:!1;return v.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",f.arrayToJSON(this.methodsArray,t)||{},"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=v.toArray(this.methods))}});function i(e){return e._methodsArray=null,e}return a.prototype.get=function(t){return this.methods[t]||f.prototype.get.call(this,t)},a.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},a.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,f.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(t)}),this):this},a.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof c?(this.methods[t.name]=t,t.parent=this,i(this)):f.prototype.add.call(this,t)},a.prototype.remove=function(t){if(t instanceof c){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,i(this)}return f.prototype.remove.call(this,t)},a.prototype.create=function(t,r,n){for(var d=new l.Service(t,r,n),s=0,u;s<this.methodsArray.length;++s){var o=v.lcFirst((u=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");d[o]=v.codegen(["r","c"],v.isReserved(o)?o+"_":o)("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),a=0;a<l.length;++a)this[l[a]]=v[l[a]]}return c.create=function(l){return this.$type.create(l)},c.encode=function(l,a){return this.$type.encode(l,a)},c.encodeDelimited=function(l,a){return this.$type.encodeDelimited(l,a)},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,a){return this.$type.toObject(l,a)},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=a;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i){return"missing required '"+i.name+"'"}function a(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){"),t=0;t<i.fieldsArray.length;++t){var r=i._fieldsArray[t].resolve(),n=r.resolvedType instanceof f?"int32":r.type,d="m"+v.safeProp(r.name);e("case %i: {",r.id),r.map?(e("if(%s===util.emptyObject)",d)("%s={}",d)("var c2 = r.uint32()+r.pos"),c.defaults[r.keyType]!==void 0?e("k=%j",c.defaults[r.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",r.keyType)("case 2:"),c.basic[n]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",n),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),c.long[r.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',d):e("%s[k]=value",d)):r.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(r.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",d,t):e("%s.push(r.%s())",d,n)):c.basic[n]===void 0?e(r.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",d,t):e("%s=r.%s()",d,n),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<i._fieldsArray.length;++t){var s=i._fieldsArray[t];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,t){return e.name+": "+t+(e.repeated&&t!=="array"?"[]":e.map&&t!=="object"?"{k:"+e.keyType+"}":"")+" expected"}function l(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof f){e("switch(%s){",n)("default:")("return%j",v(t,"enum value"));for(var d=Object.keys(t.resolvedType.values),s=0;s<d.length;++s)e("case %i:",t.resolvedType.values[d[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",v(t,"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(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",v(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",v(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",v(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",v(t,"buffer"));break}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",v(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",v(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",v(t,"boolean key"));break}return e}function i(e){var t=c.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("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&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,s.name),s.map)t("if(!util.isObject(%s))",u)("return%j",v(s,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,s,"k[i]"),l(t,s,d,u+"[k[i]]")("}");else if(s.repeated)t("if(!Array.isArray(%s))",u)("return%j",v(s,"array"))("for(var i=0;i<%s.length;++i){",u),l(t,s,d,u+"[i]")("}");else{if(s.partOf){var o=c.safeProp(s.partOf.name);n[s.partOf.name]===1&&t("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),n[s.partOf.name]=1,t("p%s=1",o)}l(t,s,d,u)}s.optional&&t("}")}return t("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 a(e,t,r,n){var d=!1;if(t.resolvedType)if(t.resolvedType instanceof v){e("switch(d%s){",n);for(var s=t.resolvedType.values,u=Object.keys(s),o=0;o<u.length;++o)s[u[o]]===t.typeDefault&&!d&&(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||e("break"),d=!0),e("case%j:",u[o])("case %i:",s[u[o]])("m%s=%j",n,s[u[o]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var h=!1;switch(t.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(t){var r=t.fieldsArray,n=l.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!r.length)return n("return new this.ctor");n("var m=new this.ctor");for(var d=0;d<r.length;++d){var s=r[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),a(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),a(n,s,d,u+"[i]")("}")("}")):(s.resolvedType instanceof v||n("if(d%s!=null){",u),a(n,s,d,u),s.resolvedType instanceof v||n("}"))}return n("return m")};function i(e,t,r,n){if(t.resolvedType)t.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,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var d=!1;switch(t.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(t){var r=t.fieldsArray.slice().sort(l.compareFieldsById);if(!r.length)return l.codegen()("return {}");for(var n=l.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),d=[],s=[],u=[],o=0;o<r.length;++o)r[o].partOf||(r[o].resolve().repeated?d:r[o].map?s:u).push(r[o]);if(d.length){for(n("if(o.arrays||o.defaults){"),o=0;o<d.length;++o)n("d%s=[]",l.safeProp(d[o].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),o=0;o<s.length;++o)n("d%s={}",l.safeProp(s[o].name));n("}")}if(u.length){for(n("if(o.defaults){"),o=0;o<u.length;++o){var h=u[o],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 y=!1;for(o=0;o<r.length;++o){var h=r[o],g=t._fieldsArray.indexOf(h),m=l.safeProp(h.name);h.map?(y||(y=!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,g,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,g,m+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",m,h.name),i(n,h,g,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 a=l["@type"].substring(l["@type"].lastIndexOf("/")+1),i=this.lookup(a);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,a){var i="type.googleapis.com/",e="",t="";if(a&&a.json&&l.type_url&&l.value){t=l.type_url.substring(l.type_url.lastIndexOf("/")+1),e=l.type_url.substring(0,l.type_url.lastIndexOf("/")+1);var r=this.lookup(t);r&&(l=r.decode(l.value))}if(!(l instanceof this.ctor)&&l instanceof v){var n=l.$type.toObject(l,a),d=l.$type.fullName[0]==="."?l.$type.fullName.slice(1):l.$type.fullName;return e===""&&(e=i),t=e+d,n["@type"]=t,n}return this.toObject(l,a)}}})(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(),a=requireMapfield(),i=requireService(),e=requireMessage(),t=requireReader(),r=requireWriter(),n=requireUtil(),d=requireEncoder(),s=requireDecoder(),u=requireVerifier(),o=requireConverter(),h=requireWrappers();function m(y,g){f.call(this,y,g),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 y=Object.keys(this.fields),g=0;g<y.length;++g){var S=this.fields[y[g]],k=S.id;if(this._fieldsById[k])throw Error("duplicate id "+k+" in "+this);this._fieldsById[k]=S}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(y){var g=y.prototype;g instanceof e||((y.prototype=new e).constructor=y,n.merge(y.prototype,g)),y.$type=y.prototype.$type=this,n.merge(y,e,!0),this._ctor=y;for(var S=0;S<this.fieldsArray.length;++S)this._fieldsArray[S].resolve();var k={};for(S=0;S<this.oneofsArray.length;++S)k[this._oneofsArray[S].resolve().name]={get:n.oneOfGetter(this._oneofsArray[S].oneof),set:n.oneOfSetter(this._oneofsArray[S].oneof)};S&&Object.defineProperties(y.prototype,k)}}}),m.generateConstructor=function(g){for(var S=n.codegen(["p"],g.name),k=0,_;k<g.fieldsArray.length;++k)(_=g._fieldsArray[k]).map?S("this%s={}",n.safeProp(_.name)):_.repeated&&S("this%s=[]",n.safeProp(_.name));return S("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(y){return y._fieldsById=y._fieldsArray=y._oneofsArray=null,delete y.encode,delete y.decode,delete y.verify,y}return m.fromJSON=function(g,S){var k=new m(g,S.options);k.extensions=S.extensions,k.reserved=S.reserved;for(var _=Object.keys(S.fields),N=0;N<_.length;++N)k.add((typeof S.fields[_[N]].keyType<"u"?a.fromJSON:l.fromJSON)(_[N],S.fields[_[N]]));if(S.oneofs)for(_=Object.keys(S.oneofs),N=0;N<_.length;++N)k.add(v.fromJSON(_[N],S.oneofs[_[N]]));if(S.nested)for(_=Object.keys(S.nested),N=0;N<_.length;++N){var z=S.nested[_[N]];k.add((z.id!==void 0?l.fromJSON:z.fields!==void 0?m.fromJSON:z.values!==void 0?c.fromJSON:z.methods!==void 0?i.fromJSON:f.fromJSON)(_[N],z))}return S.extensions&&S.extensions.length&&(k.extensions=S.extensions),S.reserved&&S.reserved.length&&(k.reserved=S.reserved),S.group&&(k.group=!0),S.comment&&(k.comment=S.comment),S.edition&&(k._edition=S.edition),k._defaultEdition="proto3",k},m.prototype.toJSON=function(g){var S=f.prototype.toJSON.call(this,g),k=g?!!g.keepComments:!1;return n.toObject(["edition",this._editionToJSON(),"options",S&&S.options||void 0,"oneofs",f.arrayToJSON(this.oneofsArray,g),"fields",f.arrayToJSON(this.fieldsArray.filter(function(_){return!_.declaringField}),g)||{},"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",S&&S.nested||void 0,"comment",k?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolveAll.call(this);var g=this.oneofsArray;for(k=0;k<g.length;)g[k++].resolve();for(var S=this.fieldsArray,k=0;k<S.length;)S[k++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(g){return this._needsRecursiveFeatureResolution?(g=this._edition||g,f.prototype._resolveFeaturesRecursive.call(this,g),this.oneofsArray.forEach(S=>{S._resolveFeatures(g)}),this.fieldsArray.forEach(S=>{S._resolveFeatures(g)}),this):this},m.prototype.get=function(g){return this.fields[g]||this.oneofs&&this.oneofs[g]||this.nested&&this.nested[g]||null},m.prototype.add=function(g){if(this.get(g.name))throw Error("duplicate name '"+g.name+"' in "+this);if(g instanceof l&&g.extend===void 0){if(this._fieldsById?this._fieldsById[g.id]:this.fieldsById[g.id])throw Error("duplicate id "+g.id+" in "+this);if(this.isReservedId(g.id))throw Error("id "+g.id+" is reserved in "+this);if(this.isReservedName(g.name))throw Error("name '"+g.name+"' is reserved in "+this);return g.parent&&g.parent.remove(g),this.fields[g.name]=g,g.message=this,g.onAdd(this),R(this)}return g instanceof v?(this.oneofs||(this.oneofs={}),this.oneofs[g.name]=g,g.onAdd(this),R(this)):f.prototype.add.call(this,g)},m.prototype.remove=function(g){if(g instanceof l&&g.extend===void 0){if(!this.fields||this.fields[g.name]!==g)throw Error(g+" is not a member of "+this);return delete this.fields[g.name],g.parent=null,g.onRemove(this),R(this)}if(g instanceof v){if(!this.oneofs||this.oneofs[g.name]!==g)throw Error(g+" is not a member of "+this);return delete this.oneofs[g.name],g.parent=null,g.onRemove(this),R(this)}return f.prototype.remove.call(this,g)},m.prototype.isReservedId=function(g){return f.isReservedId(this.reserved,g)},m.prototype.isReservedName=function(g){return f.isReservedName(this.reserved,g)},m.prototype.create=function(g){return new this.ctor(g)},m.prototype.setup=function(){for(var g=this.fullName,S=[],k=0;k<this.fieldsArray.length;++k)S.push(this._fieldsArray[k].resolve().resolvedType);this.encode=d(this)({Writer:r,types:S,util:n}),this.decode=s(this)({Reader:t,types:S,util:n}),this.verify=u(this)({types:S,util:n}),this.fromObject=o.fromObject(this)({types:S,util:n}),this.toObject=o.toObject(this)({types:S,util:n});var _=h[g];if(_){var N=Object.create(this);N.fromObject=this.fromObject,this.fromObject=_.fromObject.bind(N),N.toObject=this.toObject,this.toObject=_.toObject.bind(N)}return this},m.prototype.encode=function(g,S){return this.setup().encode(g,S)},m.prototype.encodeDelimited=function(g,S){return this.encode(g,S&&S.len?S.fork():S).ldelim()},m.prototype.decode=function(g,S){return this.setup().decode(g,S)},m.prototype.decodeDelimited=function(g){return g instanceof t||(g=t.create(g)),this.decode(g,g.uint32())},m.prototype.verify=function(g){return this.setup().verify(g)},m.prototype.fromObject=function(g){return this.setup().fromObject(g)},m.prototype.toObject=function(g,S){return this.setup().toObject(g,S)},m.d=function(g){return function(k){n.decorateType(k,g)}},type}var root,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=r;var f=requireNamespace();((r.prototype=Object.create(f.prototype)).constructor=r).className="Root";var c=requireField(),v=require_enum(),l=requireOneof(),a=requireUtil(),i,e,t;function r(u){f.call(this,"",u),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}r.fromJSON=function(o,h){return h||(h=new r),o.options&&h.setOptions(o.options),h.addJSON(o.nested).resolveAll()},r.prototype.resolvePath=a.path.resolve,r.prototype.fetch=a.fetch;function n(){}r.prototype.load=function u(o,h,m){typeof h=="function"&&(m=h,h=void 0);var R=this;if(!m)return a.asPromise(u,R,o,h);var y=m===n;function g(B,V){if(m){if(y)throw B;V&&V.resolveAll();var b=m;m=null,b(B,V)}}function S(B){var V=B.lastIndexOf("google/protobuf/");if(V>-1){var b=B.substring(V);if(b in t)return b}return null}function k(B,V){try{if(a.isString(V)&&V.charAt(0)==="{"&&(V=JSON.parse(V)),!a.isString(V))R.setOptions(V.options).addJSON(V.nested);else{e.filename=B;var b=e(V,R,h),q,x=0;if(b.imports)for(;x<b.imports.length;++x)(q=S(b.imports[x])||R.resolvePath(B,b.imports[x]))&&_(q);if(b.weakImports)for(x=0;x<b.weakImports.length;++x)(q=S(b.weakImports[x])||R.resolvePath(B,b.weakImports[x]))&&_(q,!0)}}catch(T){g(T)}!y&&!N&&g(null,R)}function _(B,V){if(B=S(B)||B,!(R.files.indexOf(B)>-1)){if(R.files.push(B),B in t){y?k(B,t[B]):(++N,setTimeout(function(){--N,k(B,t[B])}));return}if(y){var b;try{b=a.fs.readFileSync(B).toString("utf8")}catch(q){V||g(q);return}k(B,b)}else++N,R.fetch(B,function(q,x){if(--N,!!m){if(q){V?N||g(null,R):g(q);return}k(B,x)}})}}var N=0;a.isString(o)&&(o=[o]);for(var z=0,H;z<o.length;++z)(H=R.resolvePath("",o[z]))&&_(H);return y?(R.resolveAll(),R):(N||g(null,R),R)},r.prototype.loadSync=function(o,h){if(!a.isNode)throw Error("not supported");return this.load(o,h,n)},r.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(o){return"'extend "+o.extend+"' in "+o.parent.fullName}).join(", "));return f.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function s(u,o){var h=o.parent.lookup(o.extend);if(h){var m=new c(o.fullName,o.id,o.type,o.rule,void 0,o.options);return h.get(m.name)||(m.declaringField=o,o.extensionField=m,h.add(m)),!0}return!1}return r.prototype._handleAdd=function(o){if(o instanceof c)o.extend!==void 0&&!o.extensionField&&(s(this,o)||this.deferred.push(o));else if(o instanceof v)d.test(o.name)&&(o.parent[o.name]=o.values);else if(!(o instanceof l)){if(o 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<o.nestedArray.length;++m)this._handleAdd(o._nestedArray[m]);d.test(o.name)&&(o.parent[o.name]=o)}(o instanceof i||o instanceof v||o instanceof c)&&(this._fullyQualifiedObjects[o.fullName]=o)},r.prototype._handleRemove=function(o){if(o instanceof c){if(o.extend!==void 0)if(o.extensionField)o.extensionField.parent.remove(o.extensionField),o.extensionField=null;else{var h=this.deferred.indexOf(o);h>-1&&this.deferred.splice(h,1)}}else if(o instanceof v)d.test(o.name)&&delete o.parent[o.name];else if(o instanceof f){for(var m=0;m<o.nestedArray.length;++m)this._handleRemove(o._nestedArray[m]);d.test(o.name)&&delete o.parent[o.name]}delete this._fullyQualifiedObjects[o.fullName]},r._configure=function(u,o,h){i=u,e=o,t=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++],o=n[s++];o!==void 0&&(d[u]=o)}return d};var a=/\\/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(a,"\\\\").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 t=0;return f.decorateEnum=function(n){if(n.$type)return n.$type;l||(l=require_enum());var d=new l("Enum"+t++,n);return f.decorateRoot.add(d),Object.defineProperty(n,"$type",{value:d,enumerable:!1}),d},f.setProperty=function(n,d,s,u){function o(h,m,R){var y=m.shift();if(y==="__proto__"||y==="prototype")return h;if(m.length>0)h[y]=o(h[y]||{},m,R);else{var g=h[y];if(g&&u)return h;g&&(R=[].concat(g).concat(R)),h[y]=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("."),o(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 a(i,e){var t=0,r={};for(e|=0;t<i.length;)r[l[t+e]]=i[t++];return r}c.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),c.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",v.emptyArray,null]),c.long=a([0,0,0,1,1],7),c.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),c.packed=a([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(),a,i=/^required|optional|repeated$/;e.fromJSON=function(r,n){var d=new e(r,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(t,r,n,d,s,u,o){if(l.isObject(d)?(o=s,u=d,d=s=void 0):l.isObject(s)&&(o=u,u=s,s=void 0),f.call(this,t,u),!l.isInteger(r)||r<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=r,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=o}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 a&&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(r,n,d){return f.prototype.setOption.call(this,r,n,d)},e.prototype.toJSON=function(r){var n=r?!!r.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 a?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 r;l.base64.test(this.typeDefault)?l.base64.decode(this.typeDefault,r=l.newBuffer(l.base64.length(this.typeDefault)),0):l.utf8.write(this.typeDefault,r=l.newBuffer(l.utf8.length(this.typeDefault)),0),this.typeDefault=r}return this.map?this.defaultValue=l.emptyObject:this.repeated?this.defaultValue=l.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof a&&(this.parent.ctor.prototype[this.name]=this.defaultValue),f.prototype.resolve.call(this)},e.prototype._inferLegacyProtoFeatures=function(r){if(r!=="proto2"&&r!=="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 a&&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(r){return f.prototype._resolveFeatures.call(this,this._edition||r)},e.d=function(r,n,d,s){return typeof n=="function"?n=l.decorateType(n).name:n&&typeof n=="object"&&(n=l.decorateEnum(n).name),function(o,h){l.decorateType(o.constructor).add(new e(h,r,n,d,{default:s}))}},e._configure=function(r){a=r},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,t,r){if(Array.isArray(e)||(t=e,e=void 0),f.call(this,i,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=r}l.fromJSON=function(e,t){return new l(e,t.oneof,t.options,t.comment)},l.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return v.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function a(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,a(this),this},l.prototype.remove=function(e){if(!(e instanceof c))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},l.prototype.onAdd=function(e){f.prototype.onAdd.call(this,e);for(var t=this,r=0;r<this.oneof.length;++r){var n=e.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=t,t.fieldsArray.push(n))}a(this)},l.prototype.onRemove=function(e){for(var t=0,r;t<this.fieldsArray.length;++t)(r=this.fieldsArray[t]).parent&&r.parent.remove(r);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),t=0;t<arguments.length;)e[t]=arguments[t++];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"},a={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(t,r){if(!c.isString(t))throw TypeError("name must be a string");if(r&&!c.isObject(r))throw TypeError("options must be an object");this.options=r,this.parsedOptions=null,this.name=t,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 t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],r=this.parent;r;)t.unshift(r.name),r=r.parent;return t.join(".")}}}),e.prototype.toJSON=function(){throw Error()},e.prototype.onAdd=function(r){this.parent&&this.parent!==r&&this.parent.remove(this),this.parent=r,this.resolved=!1;var n=r.root;n instanceof v&&n._handleAdd(this)},e.prototype.onRemove=function(r){var n=r.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(r){return this._resolveFeatures(this._edition||r)},e.prototype._resolveFeatures=function(r){if(!this._featuresResolved){var n={};if(!r)throw new Error("Unknown edition for "+this.fullName);var d=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(r));if(this._edition){if(r==="proto2")n=Object.assign({},a);else if(r==="proto3")n=Object.assign({},i);else if(r==="2023")n=Object.assign({},l);else throw new Error("Unknown edition: "+r);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(r){if(this.options)return this.options[r]},e.prototype.setOption=function(r,n,d){return this.options||(this.options={}),/^features\./.test(r)?c.setProperty(this.options,r,n,d):(!d||this.options[r]===void 0)&&(this.getOption(r)!==n&&(this.resolved=!1),this.options[r]=n),this},e.prototype.setParsedOption=function(r,n,d){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(d){var u=s.find(function(m){return Object.prototype.hasOwnProperty.call(m,r)});if(u){var o=u[r];c.setProperty(o,d,n)}else u={},u[r]=c.setProperty({},d,n),s.push(u)}else{var h={};h[r]=n,s.push(h)}return this},e.prototype.setOptions=function(r,n){if(r)for(var d=Object.keys(r),s=0;s<d.length;++s)this.setOption(d[s],r[d[s]],n);return this},e.prototype.toString=function(){var r=this.constructor.className,n=this.fullName;return n.length?r+" "+n:r},e.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition},e._configure=function(t){v=t},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(a,i,e,t,r,n){if(f.call(this,a,e),i&&typeof i!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=t,this.comments=r||{},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 t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},l.fromJSON=function(i,e){var t=new l(i,e.values,e.options,e.comment,e.comments);return t.reserved=e.reserved,e.edition&&(t._edition=e.edition),t._defaultEdition="proto3",t},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,t,r){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 r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[i]=r||null),this.comments[i]=t||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=a;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i,e,t,r){return e.delimited?i("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,r,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):i("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,r,(e.id<<3|2)>>>0)}function a(i){for(var e=v.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),t,r,n=i.fieldsArray.slice().sort(v.compareFieldsById),t=0;t<n.length;++t){var d=n[t].resolve(),s=i._fieldsArray.indexOf(d),u=d.resolvedType instanceof f?"int32":d.type,o=c.basic[u];r="m"+v.safeProp(d.name),d.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",r,d.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",r)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(d.id<<3|2)>>>0,8|c.mapKey[d.keyType],d.keyType),o===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,r):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|o,u,r),e("}")("}")):d.repeated?(e("if(%s!=null&&%s.length){",r,r),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)",r)("w.%s(%s[i])",u,r)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",r),o===void 0?l(e,d,s,r+"[i]"):e("w.uint32(%i).%s(%s[i])",(d.id<<3|o)>>>0,u,r)),e("}")):(d.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",r,d.name),o===void 0?l(e,d,s,r):e("w.uint32(%i).%s(%s)",(d.id<<3|o)>>>0,u,r))}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,a,i){return typeof a=="function"?(i=a,a=new f.Root):a||(a=new f.Root),a.load(l,i)}f.load=c;function v(l,a){return a||(a=new f.Root),a.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=/^ *[*/]+ */,a=/^\s*\*?\/*/,i=/\n/g,e=/\s/,t=/\\(.?)/g,r={0:"\0",r:"\r",n:`
|
|
5
|
-
`,t:" "};function n(s){return s.replace(t,function(u,o){switch(o){case"\\":case"":return o;default:return r[o]||""}})}d.unescape=n;function d(s,u){s=s.toString();var o=0,h=s.length,m=1,R=0,y={},g=[],S=null;function k(A){return Error("illegal "+A+" (line "+m+")")}function _(){var A=S==="'"?v:c;A.lastIndex=o-1;var
|
|
6
|
-
`){
|
|
7
|
-
`).trim(),y[m]=
|
|
8
|
-
`;)
|
|
9
|
-
`&&(
|
|
10
|
-
`;)if(o===h)return null;++o,
|
|
11
|
-
`&&++m,++o===h)throw k("comment");E=D,D=N(o)}while(E!=="*"||D!=="/");++o,W&&(z(L,o-2,J),J=!0),A=!0}else return"/"}}while(A);var $=o;f.lastIndex=0;var I=f.test(N($++));if(!I)for(;$<h&&!f.test(N($));)++$;var Y=s.substring(o,o=$);return(Y==='"'||Y==="'")&&(S=Y),Y}function b(A){g.push(A)}function q(){if(!g.length){var A=V();if(A===null)return null;b(A)}return g[0]}function x(A,E){var D=q(),L=D===A;if(L)return V(),!0;if(!E)throw k("token '"+D+"', '"+A+"' expected");return!1}function T(A){var E=null,D;return A===void 0?(D=y[m-1],delete y[m-1],D&&(u||D.type==="*"||D.lineEmpty)&&(E=D.leading?D.text:null)):(R<A&&q(),D=y[A],delete y[A],D&&!D.lineEmpty&&(u||D.type==="/")&&(E=D.leading?null:D.text)),E}return Object.defineProperty({next:V,peek:q,push:b,skip:x,cmnt:T},"line",{get:function(){return m}})}return tokenize_1}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=_,_.filename=null,_.defaults={keepCase:!1};var f=requireTokenize(),c=requireRoot(),v=requireType(),l=requireField(),a=requireMapfield(),i=requireOneof(),e=require_enum(),t=requireService(),r=requireMethod(),n=requireObject(),d=requireTypes(),s=requireUtil(),u=/^[1-9][0-9]*$/,o=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,R=/^0[0-7]+$/,y=/^-?0[0-7]+$/,g=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,S=/^[a-zA-Z_][a-zA-Z_0-9]*$/,k=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function _(N,z,H){z instanceof c||(H=z,z=new c),H||(H=_.defaults);var B=H.preferTrailingComment||!1,V=f(N,H.alternateCommentMode||!1),b=V.next,q=V.push,x=V.peek,T=V.skip,A=V.cmnt,E=!0,D,L,W,J="proto2",$=z,I=[],Y={},U=H.keepCase?function(P){return P}:s.camelCase;function ce(){I.forEach(P=>{P._edition=J,Object.keys(Y).forEach(C=>{P.getOption(C)===void 0&&P.setOption(C,Y[C],!0)})})}function j(P,C,p){var w=_.filename;return p||(_.filename=null),Error("illegal "+(C||"token")+" '"+P+"' ("+(w?w+", ":"")+"line "+V.line+")")}function re(){var P=[],C;do{if((C=b())!=='"'&&C!=="'")throw j(C);P.push(b()),T(C),C=x()}while(C==='"'||C==="'");return P.join("")}function se(P){var C=b();switch(C){case"'":case'"':return q(C),re();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return oe(C,!0)}catch{if(k.test(C))return C;throw j(C,"value")}}function fe(P,C){var p,w;do if(C&&((p=x())==='"'||p==="'")){var O=re();if(P.push(O),J>=2023)throw j(O,"id")}else try{P.push([w=ye(b()),T("to",!0)?ye(b()):w])}catch(F){if(C&&k.test(p)&&J>=2023)P.push(p);else throw F}while(T(",",!0));var M={options:void 0};M.setOption=function(F,G){this.options===void 0&&(this.options={}),this.options[F]=G},me(M,function(G){if(G==="option")pe(M,G),T(";");else throw j(G)},function(){_e(M)})}function oe(P,C){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(g.test(P))return p*parseFloat(P);throw j(P,"number",C)}function ye(P,C){switch(P){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!C&&P.charAt(0)==="-")throw j(P,"id");if(o.test(P))return parseInt(P,10);if(m.test(P))return parseInt(P,16);if(y.test(P))return parseInt(P,8);throw j(P,"id")}function Re(){if(D!==void 0)throw j("package");if(D=b(),!k.test(D))throw j(D,"name");$=$.define(D),T(";")}function ue(){var P=x(),C;switch(P){case"weak":C=W||(W=[]),b();break;case"public":b();default:C=L||(L=[]);break}P=re(),T(";"),C.push(P)}function he(){if(T("="),J=re(),J<2023)throw j(J,"syntax");T(";")}function we(){if(T("="),J=re(),!["2023"].includes(J))throw j(J,"edition");T(";")}function ge(P,C){switch(C){case"option":return pe(P,C),T(";"),!0;case"message":return xe(P,C),!0;case"enum":return ae(P,C),!0;case"service":return Ee(P,C),!0;case"extend":return Ce(P,C),!0}return!1}function me(P,C,p){var w=V.line;if(P&&(typeof P.comment!="string"&&(P.comment=A()),P.filename=_.filename),T("{",!0)){for(var O;(O=b())!=="}";)C(O);T(";",!0)}else p&&p(),T(";"),P&&(typeof P.comment!="string"||B)&&(P.comment=A(w)||P.comment)}function xe(P,C){if(!S.test(C=b()))throw j(C,"type name");var p=new v(C);me(p,function(O){if(!ge(p,O))switch(O){case"map":Oe(p);break;case"required":if(J!=="proto2")throw j(O);case"repeated":de(p,O);break;case"optional":if(J==="proto3")de(p,"proto3_optional");else{if(J!=="proto2")throw j(O);de(p,"optional")}break;case"oneof":Te(p,O);break;case"extensions":fe(p.extensions||(p.extensions=[]));break;case"reserved":fe(p.reserved||(p.reserved=[]),!0);break;default:if(J==="proto2"||!k.test(O))throw j(O);q(O),de(p,"optional");break}}),P.add(p),P===$&&I.push(p)}function de(P,C,p){var w=b();if(w==="group"){Se(P,C);return}for(;w.endsWith(".")||x().startsWith(".");)w+=b();if(!k.test(w))throw j(w,"type");var O=b();if(!S.test(O))throw j(O,"name");O=U(O),T("=");var M=new l(O,ye(b()),w,C,p);if(me(M,function(Z){if(Z==="option")pe(M,Z),T(";");else throw j(Z)},function(){_e(M)}),C==="proto3_optional"){var F=new i("_"+O);M.setOption("proto3_optional",!0),F.add(M),P.add(F)}else P.add(M);P===$&&I.push(M)}function Se(P,C){if(J>=2023)throw j("group");var p=b();if(!S.test(p))throw j(p,"name");var w=s.lcFirst(p);p===w&&(p=s.ucFirst(p)),T("=");var O=ye(b()),M=new v(p);M.group=!0;var F=new l(w,O,p,C);F.filename=_.filename,me(M,function(Z){switch(Z){case"option":pe(M,Z),T(";");break;case"required":case"repeated":de(M,Z);break;case"optional":J==="proto3"?de(M,"proto3_optional"):de(M,"optional");break;case"message":xe(M,Z);break;case"enum":ae(M,Z);break;case"reserved":fe(M.reserved||(M.reserved=[]),!0);break;default:throw j(Z)}}),P.add(M).add(F)}function Oe(P){T("<");var C=b();if(d.mapKey[C]===void 0)throw j(C,"type");T(",");var p=b();if(!k.test(p))throw j(p,"type");T(">");var w=b();if(!S.test(w))throw j(w,"name");T("=");var O=new a(U(w),ye(b()),C,p);me(O,function(F){if(F==="option")pe(O,F),T(";");else throw j(F)},function(){_e(O)}),P.add(O)}function Te(P,C){if(!S.test(C=b()))throw j(C,"name");var p=new i(U(C));me(p,function(O){O==="option"?(pe(p,O),T(";")):(q(O),de(p,"optional"))}),P.add(p)}function ae(P,C){if(!S.test(C=b()))throw j(C,"name");var p=new e(C);me(p,function(O){switch(O){case"option":pe(p,O),T(";");break;case"reserved":fe(p.reserved||(p.reserved=[]),!0),p.reserved===void 0&&(p.reserved=[]);break;default:be(p,O)}}),P.add(p),P===$&&I.push(p)}function be(P,C){if(!S.test(C))throw j(C,"name");T("=");var p=ye(b(),!0),w={options:void 0};w.getOption=function(O){return this.options[O]},w.setOption=function(O,M){n.prototype.setOption.call(w,O,M)},w.setParsedOption=function(){},me(w,function(M){if(M==="option")pe(w,M),T(";");else throw j(M)},function(){_e(w)}),P.add(C,p,w.comment,w.parsedOptions||w.options)}function pe(P,C){var p,w,O=!0;for(C==="option"&&(C=b());C!=="=";){if(C==="("){var M=b();T(")"),C="("+M+")"}if(O){if(O=!1,C.includes(".")&&!C.includes("(")){var F=C.split(".");p=F[0]+".",C=F[1];continue}p=C}else w=w?w+=C:C;C=b()}var G=w?p.concat(w):p,Z=qe(P,G);w=w&&w[0]==="."?w.slice(1):w,p=p&&p[p.length-1]==="."?p.slice(0,-1):p,ve(P,p,Z,w)}function qe(P,C){if(T("{",!0)){for(var p={};!T("}",!0);){if(!S.test(ie=b()))throw j(ie,"name");if(ie===null)throw j(ie,"end of input");var w,O=ie;if(T(":",!0),x()==="{")w=qe(P,C+"."+ie);else if(x()==="["){w=[];var M;if(T("[",!0)){do M=se(),w.push(M);while(T(",",!0));T("]"),typeof M<"u"&&Ae(P,C+"."+ie,M)}}else w=se(),Ae(P,C+"."+ie,w);var F=p[O];F&&(w=[].concat(F).concat(w)),p[O]=w,T(",",!0),T(";",!0)}return p}var G=se();return Ae(P,C,G),G}function Ae(P,C,p){if($===P&&/^features\./.test(C)){Y[C]=p;return}P.setOption&&P.setOption(C,p)}function ve(P,C,p,w){P.setParsedOption&&P.setParsedOption(C,p,w)}function _e(P){if(T("[",!0)){do pe(P,"option");while(T(",",!0));T("]")}return P}function Ee(P,C){if(!S.test(C=b()))throw j(C,"service name");var p=new t(C);me(p,function(O){if(!ge(p,O))if(O==="rpc")ke(p,O);else throw j(O)}),P.add(p),P===$&&I.push(p)}function ke(P,C){var p=A(),w=C;if(!S.test(C=b()))throw j(C,"name");var O=C,M,F,G,Z;if(T("("),T("stream",!0)&&(F=!0),!k.test(C=b())||(M=C,T(")"),T("returns"),T("("),T("stream",!0)&&(Z=!0),!k.test(C=b())))throw j(C);G=C,T(")");var Q=new r(O,w,M,G,F,Z);Q.comment=p,me(Q,function(K){if(K==="option")pe(Q,K),T(";");else throw j(K)}),P.add(Q)}function Ce(P,C){if(!k.test(C=b()))throw j(C,"reference");var p=C;me(null,function(O){switch(O){case"required":case"repeated":de(P,O,p);break;case"optional":J==="proto3"?de(P,"proto3_optional",p):de(P,"optional",p);break;default:if(J==="proto2"||!k.test(O))throw j(O);q(O),de(P,"optional",p);break}})}for(var ie;(ie=b())!==null;)switch(ie){case"package":if(!E)throw j(ie);Re();break;case"import":if(!E)throw j(ie);ue();break;case"syntax":if(!E)throw j(ie);he();break;case"edition":if(!E)throw j(ie);we();break;case"option":pe($,ie),T(";",!0);break;default:if(ge($,ie)){E=!1;continue}throw j(ie)}return ce(),_.filename=null,{package:D,imports:L,weakImports:W,root:z}}return parse_1}var common_1,hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common_1;hasRequiredCommon=1,common_1=c;var f=/\/|\./;function c(l,a){f.test(l)||(l="google/protobuf/"+l+".proto",a={nested:{google:{nested:{protobuf:{nested:a}}}}}),c[l]=a}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(a){return c[a]||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=index.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,t=null,r=null,n=null,d=null,s=null,u="viewerAsset",o=!1,h=null;const m=(E,D=2e3)=>new Promise(L=>{if(!E||E.readyState===WebSocket.CLOSED){L();return}const W=Date.now(),J=()=>{E.readyState===WebSocket.CLOSED||Date.now()-W>D?L():setTimeout(J,50)};J()}),R=async()=>{if(f.value){const E=f.value;f.value=null,c.value="disconnected",(E.readyState===WebSocket.OPEN||E.readyState===WebSocket.CONNECTING)&&(E.close(),await m(E))}h=null},y=async(E,D,L,W="viewerAsset")=>{if(h&&await h,f.value){const J=f.value.readyState;(J===WebSocket.CONNECTING||J===WebSocket.OPEN||J===WebSocket.CLOSING)&&(await R(),await new Promise($=>setTimeout($,100)))}s=D,u=W,v.value=!0,h=new Promise(async(J,$)=>{try{const I=L||await index.useToken(),Y=E+"?session="+I+"&"+u+"="+s,U=new WebSocket(Y);f.value=U,U.onopen=()=>{g(),J(U)},U.onclose=()=>{S(),J(null)},U.onmessage=k,U.onerror=ce=>{console.error("WebSocket error:",ce),c.value="disconnected",$(ce)},setTimeout(()=>{U.readyState===WebSocket.CONNECTING&&(U.close(),$(new Error("WebSocket connection timeout")))},1e4)}catch(I){console.error("Failed to create WebSocket:",I),$(I)}});try{await h}catch(J){console.error("WebSocket connection failed:",J),h=null}},g=()=>{if(c.value="connected",v.value){if(d&&d(),s){const E={montage:"NOT_MONTAGED",packageId:s};f.value.send(JSON.stringify(E))}v.value=!1}},S=()=>{c.value="disconnected"},k=E=>{if(typeof E.data=="string"){let L={};try{L=JSON.parse(E.data)}catch{n==null||n({error:"JSON Parse Error"});return}L.channelDetails?r==null||r(L.channelDetails):L.error&&(n==null||n(L));return}const D=new FileReader;D.addEventListener("loadend",function(L){const W=L.target.result,J=new Uint8Array(W),$=i.decode(J),I=$.segment;if($.event&&$.event.length>0&&$.event[0].pageStart){const Y=$.event[0],U=[[],[]],ce=Y.times.length/2;let j=0;for(let oe=0;oe<ce;oe++)U[0].push(Y.times[j]),U[1].push(Y.times[j+1]),j+=2;let re=new Array(3),se=0;for(;se<3;)re[se]=new Float32Array(U[0].length),se++;const fe={chId:Y.source,lastUsed:0,unit:"uV",samplePeriod:Y.samplePeriod,pageStart:Y.pageStart,pageEnd:Y.pageEnd,startTs:Y.pageStart,isMinMax:Y.isResampled,unitM:1,type:"Neural",nrPoints:ce,parsedData:U,cData:re};t==null||t({pageStart:Y.pageStart,data:fe,type:"Neural",nrResponses:$.totalResponses})}if(I!==null){let Y=null;I.isMinMax?Y=I.data.length/2:Y=I.data.length;const U=new Array(3),ce=I.startTs;let j=0,re=0,se=0;for(;se<3;)U[se]=new Float64Array(Y),se++;if(I.isMinMax){let ue=0;for(let he=0;he<Y;he++){let we=-I.data[ue],ge=-I.data[ue+1];U[0][he]=ce+he*I.samplePeriod,U[1][he]=we,U[2][he]=ge,isNaN(we)||(re++,j+=we+(ge-we)/2),ue+=2}}else for(let ue=0;ue<Y;ue++){let he=-I.data[ue];U[0][ue]=ce+ue*I.samplePeriod,U[1][ue]=he,isNaN(he)||(re++,j+=he)}let fe=0;if(o){const ue=Array.prototype.slice.call(U[1]).sort();fe=ue[Math.round(ue.length/2)]}let oe=new Array(3),ye=0;for(;ye<3;)oe[ye]=new Float32Array(U[0].length),ye++;const Re={chId:I.source,lastUsed:I.lastUsed,unit:I.unit,samplePeriod:I.samplePeriod,pageStart:I.pageStart,pageEnd:I.pageEnd,startTs:ce,isMinMax:I.isMinMax,unitM:I.unitM,type:I.segmentType,nrPoints:Y,cData:oe,parsedData:U,median:fe,sumElem:j,nrValidPoints:re,name:I.channelName,label:I.channelName};Re.nrPoints>0?e==null||e({pageStart:I.pageStart,data:Re,type:I.segmentType,nrResponses:$.totalResponses}):e==null||e({pageStart:I.pageStart,data:Re,nrResponses:$.totalResponses,type:"gap"})}}),D.readAsArrayBuffer(E.data)},_=E=>f.value&&f.value.readyState===1?(f.value.send(JSON.stringify(E)),!0):!1,N=E=>{let D;switch(E){case"NOT_MONTAGED":D={montage:"NOT_MONTAGED",packageId:s};break;default:D={montage:"CUSTOM_MONTAGE",packageId:s,montageMap:E}}_(D)},z=E=>{f.value&&f.value.readyState===1?f.value.send(JSON.stringify(E)):setTimeout(()=>z(E),200)},H=()=>{if(f.value&&f.value.readyState===1){const E={requestType:"DumpBufferRequest"};return f.value.send(JSON.stringify(E)),!0}return console.warn("⚠️ Cannot send dump buffer request - WebSocket not connected"),!1},B=E=>{e=E},V=E=>{t=E},b=E=>{r=E},q=E=>{n=E};vue.onUnmounted(async()=>{await R()});const x=E=>{d=E},T=E=>{s=E},A=E=>{o=E};return{websocket:vue.readonly(f),connectionStatus:vue.readonly(c),openWebsocket:y,send:_,sendMontageMessage:N,sendFilterMessage:z,sendDumpBufferRequest:H,disconnect:R,setClearChannelsCallback:x,setActiveId:T,setUseMedian:A,onSegment:B,onEvent:V,onChannelDetails:b,onError:q}},useCanvasRenderer=()=>{const f=vue.ref(null),c=vue.ref(null),v=(t,r,n)=>r*(t+n),l=(t=1)=>t,a=(t,r,n,d,s,u,o=!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 y=R.getContext("2d");if(!y){console.warn("Unable to get 2D context for plotArea, skipping drawing.");return}y.setTransform(u,0,0,u,0,0),y.clearRect(0,0,d.cWidth,d.cHeight),m.clearRect(0,0,d.cWidth,d.cHeight);const g=r.reduce((S,k)=>k.visible?S+1:S,0);i(r,d.pHeight,g),y.save();for(let S in t.channels)if(t.channels.hasOwnProperty(S)){const k=t.channels[S];let _=null;if(_=r.find(A=>A.id===k.id),!_||!_.visible)continue;const N=d.start,z=d.rsPeriod,H=n.XOFFSET,B=Math.min(Math.round(d.cHeight/t.channels.length-2),10);for(let A=0;A<_.dataSegments.length;A+=2){if(_.dataSegments[A+1]<N)continue;if(_.dataSegments[A]>N+d.duration)break;let E=Math.floor(H+(_.dataSegments[A]-N)/z),D=Math.floor(H+(_.dataSegments[A+1]-N)/z),L=Math.floor(_.rowBaseline-B/2);m.fillRect(E,L,D-E,B)}e(_,k,d,n,s,o);const V=k.blocks.length;let b="Continuous";V&&(b=k.blocks[0].type),_.hover?_.selected?(y.strokeStyle="rgba(39,96,255,0.70)",y.fillStyle="rgba(39,96,255,0.70)"):(y.strokeStyle="rgba(39,96,255,0.60)",y.fillStyle="rgba(39,96,255,0.60)"):_.selected?(y.strokeStyle="rgb(249,162,58)",y.fillStyle="rgb(3249,162,58)"):b==="Neural"?y.strokeStyle="rgb(249,162,58)":(y.strokeStyle="black",y.fillStyle="black");let q=null,x=!0,T=1e6*(1/_.sf);for(let A=0;A<V;A++){const E=k.blocks[A];if(E.nrPoints===0)continue;const D=E.cData,L=E.nrPoints,W=D[0],J=D[1],$=D[2];let I=E.renderStartIndex,Y=E.renderEndIndex;switch(m.clearRect(Math.floor(W[I]),Math.floor(_.rowBaseline-B/2),Math.ceil(W[Y]-W[I]+2),B+1),E.type){case"Continuous":case"realtime":if(E.isMinMax){if(E.samplePeriod/T<3&&(x=!1),x){y.beginPath(),A>0&&W[I]<q.x+3?y.moveTo(q.x,q.y):y.moveTo(W[I],J[I]);for(let U=I;U<Y+1;U++)y.lineTo(W[U],J[U]);for(let U=Y-1;U>=I;U--)y.lineTo(W[U],$[U]);A>0&&W[I]<q.x+3&&y.lineTo(q.x,q.y2),y.closePath(),y.fill()}else{y.beginPath();for(let U=I;U<Y+1;U++)y.lineTo(W[U],J[U]),y.lineTo(W[U],$[U]),y.moveTo(W[U],J[U]);y.stroke()}y.beginPath(),y.moveTo(W[I],J[I]);for(let U=I;U<Y+1;U++)y.lineTo(W[U],J[U]);y.stroke()}else{A===0?(y.beginPath(),y.moveTo(W[I],J[I])):W[I]>q.x+2&&y.moveTo(W[I],J[I]);for(let U=I;U<Y+1;U++)y.lineTo(W[U],J[U]);A===V-1&&y.stroke()}break;case"Neural":y.beginPath();for(let U=0;U<L;U++)y.moveTo(W[U],J[U]),y.lineTo(W[U],$[U]);y.stroke();break}q={x:W[L-1],y:J[L-1],y2:$[L-1]}}}y.restore()},i=(t,r,n)=>{const d=t.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=(r+20)/n;let o=0;for(let h=0;h<s.length;h++){const m=t[s[h]];m.visible?(m.rowBaseline=.5*u+o*u,o++):m.rowBaseline=null}},e=(t,r,n,d,s,u)=>{let o=r.blocks.length;switch(t.type){case"UNIT":if(!u)for(let m=0;m<o;m++){const R=r.blocks[m],y=R.cData,g=R.parsedData,S=d.XOFFSET,k=R.parsedData[0].length,_=y[0],N=y[1],z=y[2],H=g[0],B=t.rowBaseline|0,V=n.start,b=n.rsPeriod,q=n.cHeight/(2*(n.nrVisibleChannels+1))|0;for(let x=0;x<k;x++)_[x]=S+(H[x]-V)/b,N[x]=B-q,z[x]=B+q}break;case"CONTINUOUS":let h=0;if(!u){r.mean=0,r.median=0;for(let m=0;m<o;m++){const R=r.blocks[m];R.nrValidPoints>0&&(r.mean=(R.sumElem+h*r.mean)/(h+R.nrValidPoints),r.median=(R.median+h*r.median)/(h+R.nrValidPoints),h+=R.nrValidPoints)}}for(let m=0;m<o;m++){const R=r.blocks[m];let y=Math.floor((n.start-R.startTs)/R.samplePeriod);R.renderStartIndex=y>0?y:0;let g=Math.floor((n.start+n.duration-(R.startTs+R.nrPoints*R.samplePeriod))/R.samplePeriod);R.renderEndIndex=g>=0?R.nrPoints-1:R.nrPoints+g;const S=R.cData,k=R.parsedData,_=s*t.rowScale,N=d.XOFFSET,z=R.parsedData[0].length,H=S[0],B=S[1],V=S[2],b=k[0],q=k[1],x=k[2],T=t.rowBaseline;let A=0;d.USEMEDIAN?A=r.median:A=r.mean;const E=n.rsPeriod,D=n.start;for(let L=0;L<z;L++)H[L]=N+(b[L]-D)/E,B[L]=T-(q[L]-A)*_,R.isMinMax&&(q[L]===x[L]?V[L]=B[L]+1:V[L]=T-(x[L]-A)*_)}break}};return{plotCanvasRef:f,blurCanvasRef:c,initializeCanvases:l,renderData:a,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),a=vue.ref(0),i=vue.ref(null),e=vue.ref(1),t=vue.ref(!1),r=15e6,n=3,d=(_,N,z,H)=>{H||(H=0);let B=s(_,N,H,_.length-1,z);return B===-1?B=0:B<0&&(B=-B-2),B},s=(_,N,z,H,B)=>{if(H<z){let b;if(H>=0?b=H:b=-H-2,b===-1)return b;const q=_[b].pageStart;for(;b>=0&&_[b].pageStart===q;)b--;return b++,-b-2}const V=parseInt((z+H)/2);if(_[V].pageStart>N)return s(_,N,z,V-1,B);if(_[V].pageStart<N)return s(_,N,V+1,H,B);{let b=V;if(B){for(;b>=0&&_[b].pageStart===N;)b--;b++}else{for(;b<_.length&&_[b].pageStart===N;)b++;b--}return b}},u=(_,N,z)=>{if(!_)return Promise.resolve();const H=[];if(_.length>0){const B=[];for(let V=0;V<_.length;V++){const b=_[V].content,x={id:z?z(b):b.id,serverId:b.serverId,label:b.name,displayName:b.displayName,type:b.channelType,segments:[],start:b.start,end:b.end,sampleFreq:b.rate,unit:b.unit,gaps:[],dataSegments:[]},T=x.label.split("<->",3),A=T[0];let E=T.length>1?parseFloat(T[1]):0;E=isNaN(E)?T[1]:E,B.push({id:x.id,serverId:x.serverId,type:x.type,label:x.label,displayName:x.displayName,label_split:T,label_prefix:A,label_value:E,dataSegments:[],rank:V,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:b.unit,sf:b.rate,filter:{},hideFilter:!0,isEditing:!1}),H.push(x)}N&&N.setChannels(B)}return o(H),f.value=H,a.value=_.length,l.value=!0,Promise.resolve()},o=_=>{var N,z;if(_.length===0){i.value=null;return}i.value=((z=(N=_[0])==null?void 0:N.gaps)==null?void 0:z[0])||null},h=_=>{if(t.value)return;let N=null;const z=_.data.chId||_.data.source,H=_.data.label||_.data.name;if(N=f.value.find(B=>B.serverId===z&&B.label===H),!!N)switch(_.type){case"gap":case"Neural":case"Continuous":let B=!1,V=N&&N.segments;if(V&&_.type!=="gap"&&(B=!0,V.length>0)){let q=d(V,_.data.startTs,!0,0);for(;V[q]&&V[q].pageStart===_.data.pageStart;){if(V[q].startTs===_.data.startTs){B=!1;break}q++}}let b=c.value.get(_.data.pageStart);if(b){let q=b.counter.get(N.id);if(isNaN(q)&&(q=_.nrResponses!==void 0?_.nrResponses:1,b.counter.set(N.id,q)),q>0&&(q=q-1,b.counter.set(N.id,q)),q===0){let x=!0;for(let[T,A]of b.counter.entries())if(A>0||isNaN(A)){x=!1;break}x&&c.value.delete(_.data.pageStart)}}B&&(V.push(_.data),V.sort((q,x)=>q.startTs<x.startTs?-1:q.startTs>x.startTs?1:0));break}},m=()=>{i.value=[],c.value.clear();for(let _=0;_<f.value.length;_++)f.value[_].segments=[];for(let _=0;_<v.channels.length;_++)v.channels[_].blocks=[]},R=_=>{let N=0,z=0,H=v.channels;for(let V=0;V<H.length;V++){let b=H[V].blocks;for(let q=0;q<b.length;q++)b[q].type==="Continuous"&&(N+=y(b[q].parsedData[1]),z++)}const B=N/z;return!isNaN(B)&&_?_/H.length/(2*B):1},y=_=>{const N=g(_),z=_.map(function(V){const b=V-N;return b*b}),H=g(z);return Math.sqrt(H)},g=_=>_.reduce(function(H,B){return H+B},0)/_.length;return{chData:f,requestedPages:c,viewData:v,channelsReady:l,autoScale:a,globalGaps:i,pageSize:r,prefetchPages:n,currentRequestedSamplePeriod:e,isSwitchingMontage:t,initChannels:u,computeSummary:o,dataCallback:h,invalidate:m,autoScaleViewData:R,segmIndexOf:d,updateCurrentRequestedSamplePeriod:_=>{e.value=Math.ceil(_)},isDataCurrentForViewport:_=>_&&_.startTs&&_.startTs>0,standardDeviation:y,average:g}},useDataRequests=()=>{const f=vue.ref([]),c=vue.ref([]),v=vue.ref(null),l=vue.ref(!1),a=vue.ref(null),i=vue.ref(0),e=vue.ref(0);let t=null;const r=(g,S)=>{t=function(){var _;c.value.length>0?(((_=S.value)==null?void 0:_.size)||0)<5&&(g([c.value[0]])?c.value.splice(0,1):(console.warn("❌ Prefetch request failed"),clearInterval(v.value),l.value=!1)):(clearInterval(v.value),l.value=!1)}},n=(g,S,k,_,N,z,H,B,V,b)=>{_.start=S,_.duration=k;const q=[];for(let x=0;x<_.channels.length;x++){const T=b?b(_.channels[x]):_.channels[x].id;q.push(T)}for(let x=0;x<g.length;x++){const T=g[x],A=b?b(T):T.id;q.indexOf(A)<0&&_.channels.push({id:A,mean:null,firstRenderedIndex:0,lastRenderedIndex:0,blocks:[]})}return d(g,S,k,_,N,z,H,B,V,b)},d=(g,S,k,_,N,z,H,B,V,b)=>{f.value=[];let x=!1;(i.value!==S||e.value!==k)&&(c.value=[],x=!0),i.value=S,e.value=k;const T=[];for(let A=0;A<_.channels.length;A++)T.push(_.channels[A]);for(let A=0;A<g.length;A++){let E=!1;const D=g[A],L=D.segments,W=b?b(D):D.id,J=T.findIndex(re=>(b?b(re):re.id)===W);if(J===-1)continue;const $=_.channels[J];if(!$)continue;$.blocks=[];let I=Math.floor(S/15e6)*15e6;I<0&&(I=0);let Y=0,U=0;L.length>0&&(Y=V(L,I,!0,0));let ce=S+k+z.PREFETCHPAGES*15e6;ce>B&&(ce=B);let j;for(L.length>0&&(j=L[Y]);I<ce||E;){E=!1;let re=!1;if(j&&(re=I>=j.pageStart&&I<=j.pageEnd),re){const se=j.pageStart;for(;j&&j.pageStart===se;)j.startTs<S+k&&$.blocks.push(j),U+=1,j=L[Y+U];I+=15e6,j&&j.pageStart===se&&(E=!0)}else{if(N.get(I)){if(I+=15e6,j&&I>=j.pageEnd)for(;j&&j.pageEnd<I&&(U+=1,j=L[Y+U],!!j););continue}if(I>=B){I+=15e6;continue}let se=I<S+k,fe=!1;if(se){for(let oe in c.value)if(c.value[oe].start===I){c.value.splice(oe,1);break}for(let oe in f.value)f.value[oe].start===I&&(f.value[oe].channels.push(D),fe=!0);fe||f.value.push({channels:[D],start:I,duration:15e6,isInViewport:!0,pixelWidth:Math.ceil(H)})}else if(x){for(let oe in c.value)c.value[oe].start===I&&(c.value[oe].channels.push(D),fe=!0);fe||c.value.push({channels:[D],start:I,duration:15e6,isInViewport:!1,pixelWidth:Math.ceil(H)})}if(I+=15e6,j&&I>=j.pageEnd)for(;j&&j.pageEnd<I&&(U+=1,j=L[Y+U],!!j););}}$.blocks.sort(s)}return{asyncRequests:f.value,asyncPreRequests:c.value}},s=(g,S)=>g.startTs<S.startTs?-1:g.startTs>S.startTs?1:0,u=(g,S=0,k,_,N,z,H,B)=>{if(g.length===0)return!1;const V=B;for(let b=0;b<g.length;b++){let q;b===0?q=g[S]:b===S?q=g[0]:q=g[b];let x=q.start+q.duration;if(q.start>=V&&console.error("❌ Request start time is beyond dataset end!",{requestStart:q.start,requestDuration:q.duration,calculatedEndTime:x,datasetEndTime:V,isStartAfterEnd:q.start>=V}),x>V&&(console.warn("📊 Clamping request end time to dataset boundary:",{original:x,clamped:V,requestStart:q.start,duration:q.duration}),x=V),x<=q.start){console.error("🚨 CRITICAL: Invalid request detected - endTime <= startTime! Skipping request.",{startTime:q.start,endTime:x,duration:q.duration,datasetEndTime:V,originalEndTime:q.start+q.duration});continue}const T=k;if(T&&T.readyState===1){const A=q.channels.map($=>{const I=$.serverId||$.id,Y=$.label||$.name;return{id:I,name:Y}}),E={session:_,minMax:!0,startTime:q.start,endTime:x,packageId:N.content.id,pixelWidth:q.pixelWidth,virtualChannels:A},D=JSON.stringify(E);T.send(D);const L=q.channels.length,W=new Map;for(let $=0;$<L;$++){const I=q.channels[$].id;W.set(I,NaN)}const J={count:L,counter:W,subPageCount:NaN,ts:Date.now(),inViewport:q.isInViewport,channels:q.channels.map($=>({id:$.id,serverId:$.serverId,label:$.label}))};H.set(q.start,J)}else return console.error("❌ WebSocket not ready for sending requests:",{readyState:T==null?void 0:T.readyState,wsExists:!!T}),!1}return f.value=[],!0},o=()=>{c.value.length>0&&(l.value||(v.value=setInterval(t,150),l.value=!0))},h=()=>{v.value&&(clearInterval(v.value),v.value=null),l.value=!1},m=()=>{f.value=[],c.value=[],i.value=0,e.value=0,h()},R=()=>{const g=f.value.slice();return f.value=[],g},y=(g,S,k)=>{const _=[];return g.forEach(function(N,z){if(!isNaN(N.subPageCount)){const H=[];N.counter.forEach(function(B,V){!isNaN(B)&&B>0&&H.push(V)}),H.length>0&&_.push({channels:H,start:z,duration:S,isInViewport:!0,pixelWidth:Math.ceil(k)})}}),g.clear(),_};return vue.onUnmounted(()=>{h()}),{aSyncRequests:vue.readonly(f),aSyncPreRequests:vue.readonly(c),isPrefetching:vue.readonly(l),lastViewPageRequest:vue.readonly(a),initializePrefetch:r,generatePoints:n,requestData:d,requestDataFromServer:u,startPrefetching:o,stopPrefetching:h,clearRequests:m,getViewportRequests:R,reRequestPages:y}},useChannelProcessing=(f,c,v,l)=>{const a=vue.reactive({totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0}),i=vue.ref(new Map),e=vue.ref(new Map),t=vue.computed(()=>c.value!=="NOT_MONTAGED"),r=vue.computed(()=>!t.value||!v.value?null:v.value.find(b=>b.name===c.value)),n=vue.computed(()=>{var b;return((b=r.value)==null?void 0:b.channelPairs)||{}});vue.watch(c,()=>{i.value.clear(),e.value.clear()});const d=b=>b?index.propOr("","id",b):"",s=b=>b?index.propOr("","serverId",b)||index.propOr("","id",b):"",u=b=>index.propOr("","id",b),o=b=>{if(!b)return"";let q=index.propOr("","id",b);if(t.value&&typeof q=="string"){const x=q.split("_");q=x.length>1?head(x):q}return q},h=(b,q,x=null)=>{var D,L;const T=x||c.value,A=`${b}_${q}_${T}`;if(e.value.has(A))return e.value.get(A);let E=`${b}-${q}`;if(T!=="NOT_MONTAGED"){const W=(D=v.value)==null?void 0:D.find(J=>J.name===T);if(W!=null&&W.channelPairs)for(const J of Object.keys(W.channelPairs)){const $=W.channelPairs[J];if(((L=$.channels)==null?void 0:L.length)===2&&$.channels[0]===b&&$.channels[1]===q){E=$.name||E;break}}}return e.value.set(A,E),E},m=b=>{if(!Array.isArray(b))return console.warn("Invalid channel details provided:",b),[];const q=performance.now();a.totalChannels=b.length,a.processedChannels=0,a.errors=0;const x=b.map(({id:T,name:A})=>{var E;try{const D=R(T);if(!D)return console.warn(`❌ Base channel not found for ID: ${T}, available base channels:`,((E=f.value)==null?void 0:E.map(W=>({id:W==null?void 0:W.id,name:W==null?void 0:W.name})))||[]),a.errors++,null;const L=y(T,A,D);return a.processedChannels++,t.value&&a.montageChannels++,L}catch(D){return console.error(`❌ Error processing channel ${T}:`,D),a.errors++,null}}).filter(Boolean);return a.lastProcessingTime=performance.now()-q,x},R=b=>{var x;if(i.value.has(b))return i.value.get(b);const q=(x=f.value)==null?void 0:x.find(T=>(T==null?void 0:T.id)===b);return q&&i.value.set(b,q),q},y=(b,q,x)=>{let T=q;const A=b;let E=b;if(t.value){E=`${b}_${q}`;const L=q.split("<->",2);L.length===2&&(T=h(L[0],L[1]))}return{content:{id:E,serverId:A,name:q,channelType:x.channelType,label:q,displayName:T,unit:x.unit,rate:x.rate,start:x.start,end:x.end,montageScheme:t.value?c.value:"NOT_MONTAGED",isMontaged:t.value,baseChannelId:b},properties:x.properties||[]}},g=b=>{var T,A,E;if(b==="NOT_MONTAGED")return{montage:"NOT_MONTAGED",packageId:(A=(T=l.value)==null?void 0:T.content)==null?void 0:A.id,montageMap:[]};const q=v.value.find(D=>D.name===b);if(!q)return console.warn("Montage not found:",b),null;const x=q.channelPairs.map(D=>D.channels);return{montage:"CUSTOM_MONTAGE",packageId:(E=l.value)==null?void 0:E.content.id,montageMap:x}},S=b=>{const q=[];if(!b)return q.push("Channel configuration is null or undefined"),{isValid:!1,errors:q};const x=["id","label","type","unit","rate"];for(const A of x)b[A]||q.push(`Missing required field: ${A}`);b.rate&&(typeof b.rate!="number"||b.rate<=0)&&q.push("Sample rate must be a positive number"),b.start&&b.end&&b.start>=b.end&&q.push("Channel start time must be less than end time");const T=["CONTINUOUS","UNIT","Neural"];return b.type&&!T.includes(b.type)&&q.push(`Invalid channel type: ${b.type}. Must be one of: ${T.join(", ")}`),{isValid:q.length===0,errors:q}},k=b=>b.sort((q,x)=>{const T=q.label||"",A=x.label||"",E=T.split("<->",3),D=A.split("<->",3);if(E.length>2||D.length>2)return T.localeCompare(A);const L=E[0]||"",W=D[0]||"";if(L===W&&E.length>1&&D.length>1){const J=parseFloat(E[1]),$=parseFloat(D[1]);return!isNaN(J)&&!isNaN($)?J-$:E[1].localeCompare(D[1])}return L.localeCompare(W)}),_=(b,q=0)=>{const x=b.content,T=x.label.split("<->",3),A=T[0]||"",E=T.length>1?isNaN(parseFloat(T[1]))?T[1]:parseFloat(T[1]):0;return{id:x.id,serverId:x.serverId,type:x.channelType,label:x.label,displayName:x.displayName,labelParts:T,labelPrefix:A,labelValue:E,dataSegments:[],rank:q,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:x.unit,sf:x.rate,filter:{},hideFilter:!0,isEditing:!1,montageScheme:x.montageScheme||"NOT_MONTAGED",isMontaged:x.isMontaged||!1,baseChannelId:x.baseChannelId}},N=(b,q={})=>{const{channelType:x=null,visible:T=null,montageScheme:A=null,labelPattern:E=null,sampleRate:D=null}=q;return b.filter(L=>!(x&&L.type!==x||T!==null&&L.visible!==T||A&&L.montageScheme!==A||E&&!new RegExp(E,"i").test(L.label)||D&&L.sf!==D))},z=(b,q="type")=>{const x={};return b.forEach(T=>{let A;switch(q){case"type":A=T.type;break;case"montage":A=T.montageScheme||"NOT_MONTAGED";break;case"prefix":A=T.labelPrefix;break;case"sampleRate":A=T.sf;break;case"unit":A=T.unit;break;default:A="all"}x[A]||(x[A]=[]),x[A].push(T)}),x},H=()=>{var b;return{...a,cacheSize:i.value.size,montageCacheSize:e.value.size,isViewingMontage:t.value,currentMontageScheme:c.value,availableMontages:((b=v.value)==null?void 0:b.map(q=>q.name))||[]}},B=()=>{i.value.clear(),e.value.clear(),Object.assign(a,{totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0})},V=async b=>{const q=[];for(const x of b)try{const T=await x();q.push({success:!0,result:T})}catch(T){q.push({success:!1,error:T.message}),a.errors++}return q};return{processingStats:vue.readonly(a),isViewingMontage:t,currentMontage:r,montageChannelPairs:n,getChannelId:d,getBaseChannelId:o,getServerChannelId:s,getRawChannelId:u,getDisplayName:h,processChannelData:m,createMontagePayload:g,createChannelConfig:_,validateChannelConfig:S,sortChannelConfigurations:k,filterChannels:N,groupChannels:z,findBaseChannel:R,createVirtualChannel:y,getProcessingStats:H,clearCaches:B,batchProcessChannels:V}};function createThrottle(f,c,v={}){let l,a,i,e=null,t=0;const{leading:r=!0,trailing:n=!0}=v,d=function(){t=r===!1?0:Date.now(),e=null,i=f.apply(l,a),e||(l=a=null)},s=function(){const u=Date.now();!t&&r===!1&&(t=u);const o=c-(u-t);return l=this,a=arguments,o<=0||o>c?(e&&(clearTimeout(e),e=null),t=u,i=f.apply(l,a),e||(l=a=null)):!e&&n!==!1&&(e=setTimeout(d,o)),i};return s.cancel=function(){clearTimeout(e),t=0,e=l=a=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,a=v,i=vue.computed(()=>l.activeViewer||{}),e=vue.computed(()=>{var F;return((F=i.value)==null?void 0:F.channels)||[]}),t=vue.inject("viewerStore",()=>index.createViewerStore("default"),!0),{viewerChannels:r,viewerMontageScheme:n,workspaceMontages:d}=pinia.storeToRefs(t),{websocket:s,connectionStatus:u,openWebsocket:o,send:h,sendFilterMessage:m,sendDumpBufferRequest:R,disconnect:y,setClearChannelsCallback:g,onSegment:S,onEvent:k,onChannelDetails:_,onError:N}=useWebSocket(),{plotCanvasRef:z,blurCanvasRef:H,initializeCanvases:B,renderData:V,cpCanvasScaler:b}=useCanvasRenderer(),q=vue.ref(1),x=vue.ref(!1),{chData:T,requestedPages:A,viewData:E,channelsReady:D,autoScale:L,initChannels:W,dataCallback:J,invalidate:$,autoScaleViewData:I,segmIndexOf:Y,updateCurrentRequestedSamplePeriod:U,currentRequestedSamplePeriod:ce,isDataCurrentForViewport:j,isSwitchingMontage:re}=useTimeSeriesData(),{aSyncRequests:se,aSyncPreRequests:fe,isPrefetching:oe,initializePrefetch:ye,generatePoints:Re,requestDataFromServer:ue,startPrefetching:he,clearRequests:we}=useDataRequests(),{getChannelId:ge,processChannelData:me,createMontagePayload:xe}=useChannelProcessing(e,n,d,i),de=vue.ref({totalRequests:0,successfulRequests:0,failedRequests:0,montageRequests:0,singleChannelRequests:0,lastPrefetchTime:null,averageResponseTime:0}),Se=vue.ref(null),Oe=vue.ref(null),Te=vue.ref(null),ae=vue.ref(0),be=vue.computed(()=>q.value*l.cWidth),pe=vue.computed(()=>b(l.cHeight,q.value,0)),qe=vue.computed(()=>l.cHeight-20),Ae=vue.computed(()=>({width:l.cWidth+"px",height:qe.value+"px"})),ve=vue.reactive({start:l.start,duration:l.duration,cWidth:l.cWidth,cHeight:l.cHeight,pHeight:qe.value,rsPeriod:l.rsPeriod,nrVisibleChannels:0}),_e=vue.computed(()=>l.rsPeriod>0?l.rsPeriod:ve.duration>0&&ve.cWidth>0?ve.duration/ve.cWidth:(console.warn("⚠️ Using fallback rsPeriod = 1"),1));vue.watch(_e,F=>{F>0&&U(F)},{immediate:!0});const Ee=()=>{var F;try{if(!D.value)return;ve.nrVisibleChannels=((F=r.value)==null?void 0:F.reduce((Q,X)=>X.visible?Q+1:Q,0))||0;let G=0,Z=0;if(E.channels.forEach((Q,X)=>{const K=Q.blocks||[],te=K.reduce((ee,le)=>ee+(le.nrPoints||0),0);K.length>0&&(Z++,G+=K.length)}),Z===0)return;V(E,r.value||[],l.constants,ve,l.globalZoomMult,q.value)}catch(G){console.error("💥 ERROR in renderDataInternal:",G),console.error("💥 Stack trace:",G.stack)}},ke=vue.ref(),Ce=()=>{ke.value=setInterval(()=>{var Q,X;if(!D.value)return;const F={timestamp:new Date().toISOString(),requestedPagesSize:A.value.size,isPrefetching:oe.value,pendingAsyncRequests:se.value.length,pendingPreRequests:fe.value.length,currentMontage:n.value,channelCount:((Q=r.value)==null?void 0:Q.length)||0,visibleChannelCount:((X=r.value)==null?void 0:X.filter(K=>K.visible).length)||0,connectionStatus:u.value,requestedPages:Array.from(A.value.entries()).map(([K,te])=>{var ee;return{pageStart:K,channelCount:te.count,inViewport:te.inViewport,age:Date.now()-te.ts,channels:((ee=te.channels)==null?void 0:ee.map(le=>le.id))||Array.from(te.counter.keys())}})},G=1e4,Z=F.requestedPages.filter(K=>K.age>G);Z.length>0&&(console.warn("⚠️ Detected stuck requests, cleaning up:",Z.map(K=>({pageStart:K.pageStart,age:Math.round(K.age/1e3)+"s",channels:K.channels}))),Z.forEach(K=>{A.value.delete(K.pageStart)}),ae.value>0&&(ae.value=Math.max(0,ae.value-1))),F.pendingPreRequests>0&&!F.isPrefetching&&console.warn("⚠️ Prefetch is blocked with pending requests:",{pendingPreRequests:F.pendingPreRequests,requestedPagesSize:F.requestedPagesSize})},5e3)},ie=async()=>{if(!r.value)return;const F=T.value.filter(ee=>{const le=r.value.find(ne=>ne.id===ee.id);return le&&le.visible}),G=_e.value,Z=Re(F,l.start,l.duration,E,A.value,l.constants,G,l.ts_end,Y,ge),Q=Math.ceil(G);let X=!1;if(Se.value!==null&&Q!==Se.value&&(X=!0,`${Se.value}${Q}`),Oe.value!==null){const ee=Math.abs(l.start-Oe.value),le=Math.max(l.duration,Te.value||l.duration);ee>le*2&&(X=!0,`${ee}`,le*2,`${(ee/le).toFixed(1)}`)}const K=15;if(A.value.size>K&&(X=!0,`${A.value.size}${K}`),ae.value>=5&&(X=!0,`${ae.value}`),X&&!x.value){x.value=!0;try{R()&&(A.value.clear(),we(),ae.value=0,await new Promise(ee=>setTimeout(ee,50)))}finally{x.value=!1}}else if(X&&x.value)return;Se.value=Q,Oe.value=l.start,Te.value=l.duration;const te=await index.useToken();Z.asyncRequests.length>0&&ue(Z.asyncRequests,0,s.value,te,i.value,G,A.value,l.ts_end),Z.asyncPreRequests.length>0&&he()},P=()=>{ie(),Ee()},C=()=>{ie(),L.value===0?(L.value--,p()):Ee()},p=()=>{const F=I(l.cHeight);F&&!isNaN(F)&&a("setGlobalZoom",F),Ee()},w=createThrottle(C,250,{leading:!1}),O=createThrottle(()=>P(),50);vue.watch(()=>l.rsPeriod,(F,G)=>{F>0&&U(F),$(),A.value.clear()}),vue.watch(()=>l.duration,(F,G)=>{$()}),vue.watch(()=>n.value,F=>{if(!s.value||s.value.readyState!==1){console.warn("Cannot switch montage — WebSocket not connected");return}re.value=!0,A.value.clear(),we(),$(),ae.value=0,Se.value=null,Oe.value=null,Te.value=null,D.value=!1;const G=xe(F);G?h(G):(console.warn("Montage definition not found for:",F),re.value=!1)}),vue.watch(()=>[l.start,l.duration,l.cWidth,l.cHeight,l.rsPeriod],()=>{ve.start=l.start,ve.duration=l.duration,ve.cWidth=l.cWidth,ve.cHeight=l.cHeight,ve.pHeight=qe.value,ve.rsPeriod=l.rsPeriod}),S(F=>{F.pageStart>=l.start+l.duration&&(de.value.totalRequests++,n.value!=="NOT_MONTAGED"?de.value.montageRequests++:de.value.singleChannelRequests++),J(F),F.pageStart<l.start+l.duration&&w()}),k(F=>{if(!j(F.data)){ae.value++;return}ae.value=0,J(F),F.pageStart<l.start+l.duration&&w()}),_(F=>{re.value=!1;try{const G=me(F);if(!G||G.length===0){console.warn("No valid channels after processing channel details");return}W(G,t,ge).then(()=>{$(),P(),a("channelsInitialized")}).catch(Z=>{console.error("Failed to initialize channels:",Z),t.setViewerErrors({error:"Failed to initialize channels after montage switch"})})}catch(G){console.error("Error processing channel details:",G),t.setViewerErrors({error:"Error processing channel details"})}}),N(F=>{t.setViewerErrors(F)});const M=async()=>{var Z,Q;const F=_e.value;U(F),g(()=>{var X;if((X=r.value)!=null&&X.length){const te={channelFiltersToClear:r.value.map(ee=>ee.id)};m(te)}});const G=await index.useToken();if(ye(X=>{const K=_e.value;return ue(X,0,s.value,G,i.value,K,A.value,l.ts_end)},A),(Q=(Z=i.value)==null?void 0:Z.content)!=null&&Q.id)try{await o(t.config.timeseriesDiscoverApi,i.value.content.id,G,i.value.content.idType||"viewerAsset"),Ce()}catch(X){console.error("Failed to establish WebSocket connection:",X);return}};return vue.onMounted(async()=>{q.value=1,B(q.value),M()}),vue.onUnmounted(()=>{clearInterval(ke.value),A.value.size>0&&R(),t.resetViewer(),we(),y(),w.cancel&&w.cancel(),O.cancel&&O.cancel()}),c({renderAll:P,invalidate:$,throttledDataRender:O,sendFilterMessage:m,viewData:E,requestedPages:A,chData:T,viewerChannels:r,currentRequestedSamplePeriod:ce,initPlotCanvas:M}),(F,G)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("canvas",{ref_key:"blurCanvasRef",ref:H,class:"canvas",width:be.value,height:pe.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_2$1),vue.renderSlot(F.$slots,"axisCanvas",{},void 0,!0),vue.renderSlot(F.$slots,"annCanvas",{},void 0,!0),vue.createElementVNode("canvas",{ref_key:"plotCanvasRef",ref:z,class:"canvas",width:be.value,height:pe.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_3$1)]))}},TSPlotCanvas=index._export_sfc(_sfc_main$1,[["__scopeId","data-v-66a33b77"]]),_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-DaDdtIB4.cjs"))),a=f,i=v,e=vue.inject("viewerStore",()=>index.createViewerStore("default"),!0),{viewerChannels:t,viewerAnnotations:r,viewerActiveTool:n,viewerSelectedChannels:d}=pinia.storeToRefs(e),s=vue.ref(null),u=vue.ref(null),o=vue.ref(null),h=vue.ref(null),m=vue.ref(null),R=vue.ref(null);vue.reactive({});const y=vue.ref(0),g=vue.ref(0),S=vue.ref(0),k=vue.ref(1),_=vue.ref(!1),N=vue.ref(!1),z=vue.ref("pointer");vue.ref(!1);const H=vue.reactive({x:0,y:0}),B=vue.ref(0),V=vue.ref(["Event","Artifact","Seizure","Mark","Stim On","Stim Off","Start","Stop"]),b=vue.ref(0),q=vue.ref(null),x=vue.ref(0),T=vue.ref(!0),A=()=>{if(r.value.length>0){if(!r.value.some(w=>w.selected)){const w=r.value[0];w&&w.id&&e.setActiveAnnotationLayer(w.id)}}else setTimeout(()=>{r.value.length>0&&A()},500)},E=p=>{if(p){const w="set"+p.charAt(0).toUpperCase()+p.slice(1),O=D[w];typeof O=="function"&&O()}},D={setPan:()=>{},setPointer:()=>{},setAnnotate:()=>{A()}},L=vue.computed(()=>t.value.filter(p=>p.visible).length),W=vue.computed(()=>a.cHeight-20),J=vue.computed(()=>a.cWidth+a.constants.CURSOROFFSET);vue.computed(()=>u.value);const $=vue.computed(()=>({width:a.cWidth+"px",height:a.cHeight+"px"})),I=vue.computed(()=>({width:a.cWidth+"px",height:W.value+"px"})),Y=vue.computed(()=>({width:J.value+"px",height:a.cHeight+"px"}));vue.watch(()=>a.cHeight,()=>{Oe()}),vue.watch(()=>a.cWidth,()=>{Oe()}),vue.watch(()=>a.start,()=>{be()}),vue.watch(()=>a.duration,()=>{var p;(p=s.value)==null||p.invalidate(),Te(a.cWidth,a.duration),be()}),vue.watch(()=>a.globalZoomMult,()=>{vue.nextTick(()=>{var p;(p=s.value)==null||p.throttledDataRender()})}),vue.watch(n,p=>{p&&(E(p),!_.value&&!["annResize-left","annResize-right","annSelect"].includes(z.value)&&(z.value=p))},{immediate:!0}),vue.watch(r,p=>{p.length>0&&n.value==="annotate"&&A()},{immediate:!0}),vue.watch(z,()=>{const p=R.value;if(p){switch(p.removeAttribute("col_resize"),p.removeAttribute("active"),p.removeAttribute("point"),z.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(()=>{qe()})}});const U=()=>{var p;(p=m.value)==null||p.resetFocusedAnnotation()},ce=p=>{var w;(w=m.value)==null||w.createAnnotationLayer(p)},j=()=>{var O;let p=(a.cursorLoc*a.cWidth-a.constants.CURSOROFFSET)*y.value;return((O=m.value)==null?void 0:O.findNextAnnotation(a.start+p)).start-p},re=()=>{var O;let p=(a.cursorLoc*a.cWidth-a.constants.CURSOROFFSET)*y.value;return((O=m.value)==null?void 0:O.findPreviousAnnotation(a.start+p)).start-p},se=p=>{i("updateAnnotation",p)},fe=()=>{i("closeAnnotationLayerWindow")},oe=()=>{be(100)},ye=()=>{n.value==="annotate"&&A(),i("annLayersInitialized")},Re=p=>{i("setGlobalZoom",p)},ue=()=>{i("channelsInitialized")},he=p=>{p.stopPropagation(),p.preventDefault(),p.shiftKey?Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setDuration",a.duration*1.1):i("setDuration",a.duration/1.1)):Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setGlobalZoom",a.globalZoomMult*1.2):i("setGlobalZoom",a.globalZoomMult/1.2))},we=p=>{var w,O;switch(N.value=!1,_.value=!1,z.value){case"pointer":ge();const M=p.metaKey,F=p.clientY-R.value.getBoundingClientRect().top,G=H.y-R.value.getBoundingClientRect().top,Z=t.value.map(ne=>(M===!1&&(ne.selected=!1),(ne.rowBaseline>G&&ne.rowBaseline<F||ne.rowBaseline<G&&ne.rowBaseline>F)&&(ne.selected=!0),ne));e.setChannels(Z),be();break;case"annSelect":ge(),(w=m.value)==null||w.selectFocusedAnn();break;case"annotate":A();let Q=null,X=null;for(let ne=0;ne<r.value.length;ne++)if(r.value[ne].selected){Q=ne,X=r.value[ne];break}if(Q===null||!X||!X.id)if(r.value.length>0&&r.value[0].id)e.setActiveAnnotationLayer(r.value[0].id),X=r.value[0],Q=0;else return;const K=d.value,te=K.length===t.value.length||K.length===0;let ee=(p.clientX-H.x)*y.value,le=B.value+(H.x-R.value.getBoundingClientRect().left)*y.value;if(ee<0&&(le=le+ee,ee=-ee),ee>1e3){const ne={name:"",id:null,label:V.value[b.value],description:"",start:le,duration:ee,end:le+ee,cStart:null,cEnd:null,selected:!0,channelIds:K.map(Ne=>Ne.id),allChannels:te,layer_id:X.id,userId:null};e.setActiveAnnotation(ne),i("addAnnotation",le,ee,te,ne.label,ne.description,X);break}break;case"annResize-left":case"annResize-right":(O=m.value)==null||O.onMouseUp();break}},ge=()=>{R.value.getContext("2d").clearRect(0,0,a.cWidth,a.cHeight)},me=p=>{var O;_.value=!0,B.value=a.start;const w=R.value.getBoundingClientRect();switch(H.x=p.clientX,H.y=p.clientY,n.value==="annotate"&&!["annResize-left","annResize-right","annSelect"].includes(z.value)&&(z.value="annotate"),z.value){case"annResize-left":case"annResize-right":N.value=!0,(O=m.value)==null||O.onMouseDown(p.clientX-w.left,p.clientY-w.top);break}},xe=()=>{_.value=!1},de=p=>{p.buttons===1?_.value=!0:_.value=!1},Se=p=>{var F,G,Z,Q;p.preventDefault(),p.stopPropagation();const w=R.value.getBoundingClientRect(),O=p.clientY-w.top,M=p.clientX-w.left;switch(n.value){case"pan":if(_.value){const X=B.value-(p.clientX-H.x)*y.value;i("setStart",X)}else{const X=(F=m.value)==null?void 0:F.onMouseMove(M,O,z.value,_.value);z.value=X||"pan"}break;case"pointer":if(_.value)_e(p.clientX,p.clientY);else{const X=(G=m.value)==null?void 0:G.onMouseMove(M,O,z.value,_.value);z.value=X||"pointer"}break;case"annotate":if(_.value&&z.value==="annotate")ke(p.clientX);else if(_.value&&["annResize-left","annResize-right"].includes(z.value)){const X=(Z=m.value)==null?void 0:Z.onMouseMove(M,O,z.value,_.value);z.value=X||z.value,be()}else{const X=(Q=m.value)==null?void 0:Q.onMouseMove(M,O,z.value,_.value);X?z.value=X:z.value="annotate"}break}},Oe=()=>{Te(a.cWidth,a.duration),be(25)},Te=(p,w)=>{const O=y.value,M=w/p;M!==O&&(S.value=Date.now(),y.value=M,g.value=Math.floor(w/a.constants.PAGESIZEDIVIDER))},ae=(p,w,O)=>w*(p+O),be=(p=0,w=!0)=>{(!q.value||p!==x.value||T.value!==w)&&(q.value=pe(Ae,p,{leading:w}),x.value=p,T.value=w),q.value()},pe=(p,w,O={})=>{let M,F,G,Z=null,Q=0;const X=function(){Q=O.leading===!1?0:Date.now(),Z=null,G=p.apply(M,F),Z||(M=F=null)};return function(){const K=Date.now();!Q&&O.leading===!1&&(Q=K);const te=w-(K-Q);return M=this,F=arguments,te<=0||te>w?(Z&&(clearTimeout(Z),Z=null),Q=K,G=p.apply(M,F),Z||(M=F=null)):!Z&&O.trailing!==!1&&(Z=setTimeout(X,te)),G}},qe=()=>{var p;ge(),(p=m.value)==null||p.render()},Ae=()=>{vue.nextTick(()=>{var p,w;ve(),Ee(),(p=s.value)==null||p.renderAll(),(w=m.value)==null||w.render()})},ve=()=>{const w=u.value.getContext("2d");w.setTransform(k.value,0,0,k.value,0,0),w.clearRect(0,0,a.cWidth,a.cHeight),w.stroke(),w.beginPath(),w.lineWidth=1,w.moveTo(a.constants.XOFFSET+.5,.5),w.lineTo(a.constants.XOFFSET+.5,W.value+.5),w.lineTo(a.cWidth+.5,W.value+.5),w.stroke();let O=W.value/(2*L.value)+.5<<1>>1;w.lineWidth=.5;for(let Q=0;Q<L.value;Q++)w.beginPath(),w.moveTo(a.constants.XOFFSET-2,O),w.lineTo(a.constants.XOFFSET+2,O),w.stroke(),O+=W.value/L.value;const M=a.constants.XGRIDSPACING*Math.ceil(a.duration/1e8),F=Math.ceil(a.duration/M)+1,G=Math.ceil(a.constants.NRPXPERLABEL/(M/y.value)),Z=(M-a.start%M)%M;for(let Q=0;Q<F;Q++){let X=a.start+Z+Q*M;if(X>a.tsEnd)break;const K=X-a.start,te=a.constants.XOFFSET+K/y.value,ee=Math.round(te);if(ee>1&&(w.save(),w.beginPath(),w.lineWidth=.5,w.strokeStyle="rgb(235,235,235)",w.moveTo(ee+.5,.5),w.lineTo(ee+.5,W.value-.5),w.stroke(),w.restore(),((X/M+M/10)%G|0)===1||G===1)){w.beginPath(),w.lineWidth=1,w.moveTo(ee+.5,W.value-3),w.lineTo(ee+.5,W.value+3),w.stroke();const ne=new Date(X/1e3);w.font="12px sans-serif",w.fillStyle="rgb(150,150,150)",w.fillText(P(ne),ee-20.5,a.cHeight-.2)}}},_e=(p,w)=>{const O=R.value,M=O.getContext("2d");M.setTransform(k.value,0,0,k.value,0,0),M.clearRect(0,0,a.cWidth,a.cHeight),M.beginPath(),M.lineWidth=2,M.strokeStyle="#295eff",M.setLineDash([5,5,15,5]);const F=p-O.getBoundingClientRect().left,G=w-O.getBoundingClientRect().top;M.rect(F,G,-p+H.x,-w+H.y),M.stroke()},Ee=()=>{const w=h.value.getContext("2d");w.setTransform(k.value,0,0,k.value,0,0),w.clearRect(0,0,a.cWidth+a.constants.CURSOROFFSET,a.cHeight),w.save(),w.beginPath(),w.fillStyle="red";const O=a.cursorLoc*a.cWidth;O>a.constants.CURSOROFFSET?(w.strokeStyle="red",w.moveTo(O,0),w.lineTo(O,W.value),w.stroke()):w.moveTo(O,W.value),w.beginPath(),w.lineTo(O-5,W.value+8),w.lineTo(O+5,W.value+8),w.lineTo(O,W.value),w.fill(),w.restore()},ke=p=>{const w=R.value,O=w.getContext("2d");O.setTransform(k.value,0,0,k.value,0,0);const M=a.constants.ANNOTATIONLABELHEIGHT,F=M/2|0;let G=null;for(let te=0;te<r.value.length;te++)if(r.value[te].selected){G=te;break}if(G===null)return;O.save(),O.clearRect(0,0,a.cWidth,a.cHeight),O.lineWidth=1;const Z=d.value,Q=Z.length===t.value.length||Z.length===0,X=p-w.getBoundingClientRect().left,K=-p+H.x;if(Q){O.fillStyle="rgba(0,0,0,0.1)",O.fillRect(X,0,K,W.value),O.fillStyle=r.value[G].color,O.strokeStyle=O.fillStyle;let te=X-1,ee=K+2;K<0&&(te=X+1,ee=K-2),O.fillRect(te,0,ee,M),O.setLineDash([5,5,5,5]),O.beginPath(),O.moveTo(X,M),O.lineTo(X,W.value),O.stroke(),O.beginPath(),O.moveTo(X+K,M),O.lineTo(X+K,W.value),O.stroke()}else{let te=a.cHeight|0,ee=0;const le=t.value;O.fillStyle=r.value[G].color,O.strokeStyle=O.fillStyle;let ne=X-1,Ne=K+2;K<0&&(ne=X+1,Ne=K-2);for(let Fe=0;Fe<le.length;Fe++){const Ie=le[Fe];if(Ie.selected&&Ie.visible){const Pe=Ie.rowBaseline|0;Pe<te&&(te=Pe),Pe>ee&&(ee=Pe),O.fillRect(ne,Pe-F,Ne,M)}}O.fillStyle="rgba(0,0,0,0.1)",O.setLineDash([5,5,5,5]),O.fillRect(X-1,te+F,K+2,ee-te-M),O.beginPath(),O.moveTo(X,te+F),O.lineTo(X,ee-F),O.moveTo(X+K,te+F),O.lineTo(X+K,ee-F),O.stroke()}O.restore()},Ce=()=>{var p;(p=s.value)==null||p.initPlotCanvas()},ie=()=>{let p=R.value.getContext("2d"),w=window.devicePixelRatio||1,O=p.webkitBackingStorePixelRatio||p.mozBackingStorePixelRatio||p.msBackingStorePixelRatio||p.oBackingStorePixelRatio||p.backingStorePixelRatio||1;return w/O},P=p=>("0"+p.getUTCHours()).slice(-2)+":"+("0"+p.getUTCMinutes()).slice(-2)+":"+("0"+p.getUTCSeconds()).slice(-2),C=p=>{var F,G;let w=parseFloat(p.input0),O=parseFloat(p.input1),M={};switch(p.filterType){case"clear":M={channelFiltersToClear:p.selChannels};break;case"bandpass":let Z=(w+O)/2,Q=Math.abs((O-w)/2);M={filter:p.filterType,filterParameters:[4,Z,Q],channels:p.selChannels};break;case"highpass":M={filter:p.filterType,filterParameters:[4,w],channels:p.selChannels};break;case"lowpass":M={filter:p.filterType,filterParameters:[4,w],channels:p.selChannels};break;case"bandstop":let X=10;const K=p.notchFreq;M={filter:p.filterType,filterParameters:[4,K,X],channels:p.selChannels};break;default:return}(F=s.value)==null||F.sendFilterMessage(M);for(let Z=0;Z<p.selChannels.length;Z++){let Q=p.selChannels[Z],X=find(index.propEq("id",Q),t.value);p.filterType==="clear"?X.filter={}:X.filter={type:p.filterType,input0:w,input1:O,notchFreq:p.notchFreq}}(G=s.value)==null||G.invalidate(),be()};return vue.onMounted(()=>{k.value=ie()}),c({rsPeriod:y,resetFocusedAnnotation:U,createAnnotationLayer:ce,getNextAnnotation:j,getPreviousAnnotation:re,setFilters:C,setActiveTool:E,renderAll:be,renderAnnotationCanvas:qe,initViewerCanvas:Ce}),(p,w)=>(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":y.value,"global-zoom-mult":f.globalZoomMult,"active-viewer":f.activeViewer,onChannelsInitialized:ue,onSetGlobalZoom:Re},{axisCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"axisArea",ref_key:"axisArea",ref:u,class:"canvas",width:ae(f.cWidth,k.value,0),height:ae(f.cHeight,k.value,0),style:vue.normalizeStyle($.value)},null,12,_hoisted_3)]),annCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"annArea",ref_key:"annArea",ref:o,class:"canvas",width:ae(f.cWidth,k.value,0),height:ae(W.value,k.value,0),style:vue.normalizeStyle(I.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:ae(f.cWidth+5,k.value,0),height:ae(f.cHeight,k.value,0),style:vue.normalizeStyle(Y.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":o.value,"pixel-ratio":k.value,"rs-period":y.value,start:f.start,duration:f.duration,"ts-end":f.tsEnd,"pointer-mode":z.value,"viewer-active-tool":vue.unref(n),"active-viewer":f.activeViewer,onAnnLayersInitialized:ye,onAnnotationsReceived:oe,onCloseAnnotationLayerWindow:fe,onUpdateAnnotation:se},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:ae(f.cWidth,k.value,0),height:ae(f.cHeight,k.value,0),style:vue.normalizeStyle($.value),tabindex:"-1",onWheel:he,onMousemove:Se,onMousedown:me,onMouseup:we,onMouseout:xe,onMouseenter:de},null,44,_hoisted_6)])]))}},TSViewerCanvas=index._export_sfc(_sfc_main,[["__scopeId","data-v-12d19814"]]),TSViewerCanvas$1=Object.freeze(Object.defineProperty({__proto__:null,default:TSViewerCanvas},Symbol.toStringTag,{value:"Module"}));exports.TSViewerCanvas=TSViewerCanvas$1;exports.find=find;exports.head=head;
|
|
4
|
+
}`}return a.toString=i,a}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(a,i,e){return typeof i=="function"?(e=i,i={}):i||(i={}),e?!i.xhr&&v&&v.readFile?v.readFile(a,function(r,n){return r&&typeof XMLHttpRequest<"u"?l.xhr(a,i,e):r?e(r):e(null,i.binary?n:n.toString("utf8"))}):l.xhr(a,i,e):f(l,this,a,i)}return l.xhr=function(i,e,t){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return t(Error("status "+r.status));if(e.binary){var d=r.response;if(!d){d=[];for(var s=0;s<r.responseText.length;++s)d.push(r.responseText.charCodeAt(s)&255)}return t(null,typeof Uint8Array<"u"?new Uint8Array(d):d)}return t(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",i),r.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("/"),t=v(i),r="";t&&(r=e.shift()+"/");for(var n=0;n<e.length;)e[n]===".."?n>0&&e[n-1]!==".."?e.splice(--n,2):t?e.splice(n,1):++n:e[n]==="."?e.splice(n,1):++n;return r+e.join("/")};c.resolve=function(i,e,t){return t||(e=l(e)),v(e)?e:(t||(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=r;var f=requireObject();((r.prototype=Object.create(f.prototype)).constructor=r).className="Namespace";var c=requireField(),v=requireUtil(),l=requireOneof(),a,i,e;r.fromJSON=function(s,u){return new r(s,u.options).addJSON(u.nested)};function t(d,s){if(d&&d.length){for(var u={},o=0;o<d.length;++o)u[d[o].name]=d[o].toJSON(s);return u}}r.arrayToJSON=t,r.isReservedId=function(s,u){if(s){for(var o=0;o<s.length;++o)if(typeof s[o]!="string"&&s[o][0]<=u&&s[o][1]>u)return!0}return!1},r.isReservedName=function(s,u){if(s){for(var o=0;o<s.length;++o)if(s[o]===u)return!0}return!1};function r(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(r.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=v.toArray(this.nested))}}),r.prototype.toJSON=function(s){return v.toObject(["options",this.options,"nested",t(this.nestedArray,s)])},r.prototype.addJSON=function(s){var u=this;if(s)for(var o=Object.keys(s),h=0,m;h<o.length;++h)m=s[o[h]],u.add((m.fields!==void 0?a.fromJSON:m.values!==void 0?e.fromJSON:m.methods!==void 0?i.fromJSON:m.id!==void 0?c.fromJSON:r.fromJSON)(o[h],m));return this},r.prototype.get=function(s){return this.nested&&this.nested[s]||null},r.prototype.getEnum=function(s){if(this.nested&&this.nested[s]instanceof e)return this.nested[s].values;throw Error("no such enum: "+s)},r.prototype.add=function(s){if(!(s instanceof c&&s.extend!==void 0||s instanceof a||s instanceof l||s instanceof e||s instanceof i||s instanceof r))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 r&&s instanceof r&&!(u instanceof a||u instanceof i)){for(var o=u.nestedArray,h=0;h<o.length;++h)s.add(o[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 a||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)},r.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)},r.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 o=this;s.length>0;){var h=s.shift();if(o.nested&&o.nested[h]){if(o=o.nested[h],!(o instanceof r))throw Error("path conflicts with non-namespace objects")}else o.add(o=new r(h))}return u&&o.addJSON(u),o},r.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 r?s[u++].resolveAll():s[u++].resolve();return this._needsRecursiveResolve=!1,this},r.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},r.prototype.lookup=function(s,u,o){if(typeof u=="boolean"?(o=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(o)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},r.prototype._lookupImpl=function(s,u){if(Object.prototype.hasOwnProperty.call(this._lookupCache,u))return this._lookupCache[u];var o=this.get(s[0]),h=null;if(o)s.length===1?h=o:o instanceof r&&(s=s.slice(1),h=o._lookupImpl(s,s.join(".")));else for(var m=0;m<this.nestedArray.length;++m)this._nestedArray[m]instanceof r&&(o=this._nestedArray[m]._lookupImpl(s,u))&&(h=o);return this._lookupCache[u]=h,h},r.prototype.lookupType=function(s){var u=this.lookup(s,[a]);if(!u)throw Error("no such type: "+s);return u},r.prototype.lookupEnum=function(s){var u=this.lookup(s,[e]);if(!u)throw Error("no such Enum '"+s+"' in "+this);return u},r.prototype.lookupTypeOrEnum=function(s){var u=this.lookup(s,[a,e]);if(!u)throw Error("no such Type or Enum '"+s+"' in "+this);return u},r.prototype.lookupService=function(s){var u=this.lookup(s,[i]);if(!u)throw Error("no such Service '"+s+"' in "+this);return u},r._configure=function(d,s,u){a=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(a,i,e,t,r,n){if(f.call(this,a,i,t,void 0,void 0,r,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,t){return typeof t=="function"?t=v.decorateType(t).name:t&&typeof t=="object"&&(t=v.decorateEnum(t).name),function(n,d){v.decorateType(n.constructor).add(new l(d,i,e,t))}},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,a,i,e,t,r,n,d,s){if(c.isObject(t)?(n=t,t=r=void 0):c.isObject(r)&&(n=r,r=void 0),!(a===void 0||c.isString(a)))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=a||"rpc",this.requestType=i,this.requestStream=t?!0:void 0,this.responseType=e,this.responseStream=r?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=d,this.parsedOptions=s}return v.fromJSON=function(a,i){return new v(a,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)},v.prototype.toJSON=function(a){var i=a?!!a.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=a;var f=requireNamespace();((a.prototype=Object.create(f.prototype)).constructor=a).className="Service";var c=requireMethod(),v=requireUtil(),l=requireRpc();function a(e,t){f.call(this,e,t),this.methods={},this._methodsArray=null}a.fromJSON=function(t,r){var n=new a(t,r.options);if(r.methods)for(var d=Object.keys(r.methods),s=0;s<d.length;++s)n.add(c.fromJSON(d[s],r.methods[d[s]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},a.prototype.toJSON=function(t){var r=f.prototype.toJSON.call(this,t),n=t?!!t.keepComments:!1;return v.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",f.arrayToJSON(this.methodsArray,t)||{},"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=v.toArray(this.methods))}});function i(e){return e._methodsArray=null,e}return a.prototype.get=function(t){return this.methods[t]||f.prototype.get.call(this,t)},a.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},a.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,f.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(t)}),this):this},a.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof c?(this.methods[t.name]=t,t.parent=this,i(this)):f.prototype.add.call(this,t)},a.prototype.remove=function(t){if(t instanceof c){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,i(this)}return f.prototype.remove.call(this,t)},a.prototype.create=function(t,r,n){for(var d=new l.Service(t,r,n),s=0,u;s<this.methodsArray.length;++s){var o=v.lcFirst((u=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");d[o]=v.codegen(["r","c"],v.isReserved(o)?o+"_":o)("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),a=0;a<l.length;++a)this[l[a]]=v[l[a]]}return c.create=function(l){return this.$type.create(l)},c.encode=function(l,a){return this.$type.encode(l,a)},c.encodeDelimited=function(l,a){return this.$type.encodeDelimited(l,a)},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,a){return this.$type.toObject(l,a)},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=a;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i){return"missing required '"+i.name+"'"}function a(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){"),t=0;t<i.fieldsArray.length;++t){var r=i._fieldsArray[t].resolve(),n=r.resolvedType instanceof f?"int32":r.type,d="m"+v.safeProp(r.name);e("case %i: {",r.id),r.map?(e("if(%s===util.emptyObject)",d)("%s={}",d)("var c2 = r.uint32()+r.pos"),c.defaults[r.keyType]!==void 0?e("k=%j",c.defaults[r.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",r.keyType)("case 2:"),c.basic[n]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",n),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),c.long[r.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',d):e("%s[k]=value",d)):r.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(r.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",d,t):e("%s.push(r.%s())",d,n)):c.basic[n]===void 0?e(r.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",d,t):e("%s=r.%s()",d,n),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<i._fieldsArray.length;++t){var s=i._fieldsArray[t];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,t){return e.name+": "+t+(e.repeated&&t!=="array"?"[]":e.map&&t!=="object"?"{k:"+e.keyType+"}":"")+" expected"}function l(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof f){e("switch(%s){",n)("default:")("return%j",v(t,"enum value"));for(var d=Object.keys(t.resolvedType.values),s=0;s<d.length;++s)e("case %i:",t.resolvedType.values[d[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",v(t,"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(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",v(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",v(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",v(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",v(t,"buffer"));break}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",v(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",v(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",v(t,"boolean key"));break}return e}function i(e){var t=c.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("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&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,s.name),s.map)t("if(!util.isObject(%s))",u)("return%j",v(s,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,s,"k[i]"),l(t,s,d,u+"[k[i]]")("}");else if(s.repeated)t("if(!Array.isArray(%s))",u)("return%j",v(s,"array"))("for(var i=0;i<%s.length;++i){",u),l(t,s,d,u+"[i]")("}");else{if(s.partOf){var o=c.safeProp(s.partOf.name);n[s.partOf.name]===1&&t("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),n[s.partOf.name]=1,t("p%s=1",o)}l(t,s,d,u)}s.optional&&t("}")}return t("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 a(e,t,r,n){var d=!1;if(t.resolvedType)if(t.resolvedType instanceof v){e("switch(d%s){",n);for(var s=t.resolvedType.values,u=Object.keys(s),o=0;o<u.length;++o)s[u[o]]===t.typeDefault&&!d&&(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||e("break"),d=!0),e("case%j:",u[o])("case %i:",s[u[o]])("m%s=%j",n,s[u[o]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var h=!1;switch(t.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(t){var r=t.fieldsArray,n=l.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!r.length)return n("return new this.ctor");n("var m=new this.ctor");for(var d=0;d<r.length;++d){var s=r[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),a(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),a(n,s,d,u+"[i]")("}")("}")):(s.resolvedType instanceof v||n("if(d%s!=null){",u),a(n,s,d,u),s.resolvedType instanceof v||n("}"))}return n("return m")};function i(e,t,r,n){if(t.resolvedType)t.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,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var d=!1;switch(t.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(t){var r=t.fieldsArray.slice().sort(l.compareFieldsById);if(!r.length)return l.codegen()("return {}");for(var n=l.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),d=[],s=[],u=[],o=0;o<r.length;++o)r[o].partOf||(r[o].resolve().repeated?d:r[o].map?s:u).push(r[o]);if(d.length){for(n("if(o.arrays||o.defaults){"),o=0;o<d.length;++o)n("d%s=[]",l.safeProp(d[o].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),o=0;o<s.length;++o)n("d%s={}",l.safeProp(s[o].name));n("}")}if(u.length){for(n("if(o.defaults){"),o=0;o<u.length;++o){var h=u[o],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 y=!1;for(o=0;o<r.length;++o){var h=r[o],g=t._fieldsArray.indexOf(h),m=l.safeProp(h.name);h.map?(y||(y=!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,g,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,g,m+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",m,h.name),i(n,h,g,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 a=l["@type"].substring(l["@type"].lastIndexOf("/")+1),i=this.lookup(a);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,a){var i="type.googleapis.com/",e="",t="";if(a&&a.json&&l.type_url&&l.value){t=l.type_url.substring(l.type_url.lastIndexOf("/")+1),e=l.type_url.substring(0,l.type_url.lastIndexOf("/")+1);var r=this.lookup(t);r&&(l=r.decode(l.value))}if(!(l instanceof this.ctor)&&l instanceof v){var n=l.$type.toObject(l,a),d=l.$type.fullName[0]==="."?l.$type.fullName.slice(1):l.$type.fullName;return e===""&&(e=i),t=e+d,n["@type"]=t,n}return this.toObject(l,a)}}})(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(),a=requireMapfield(),i=requireService(),e=requireMessage(),t=requireReader(),r=requireWriter(),n=requireUtil(),d=requireEncoder(),s=requireDecoder(),u=requireVerifier(),o=requireConverter(),h=requireWrappers();function m(y,g){f.call(this,y,g),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 y=Object.keys(this.fields),g=0;g<y.length;++g){var S=this.fields[y[g]],k=S.id;if(this._fieldsById[k])throw Error("duplicate id "+k+" in "+this);this._fieldsById[k]=S}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(y){var g=y.prototype;g instanceof e||((y.prototype=new e).constructor=y,n.merge(y.prototype,g)),y.$type=y.prototype.$type=this,n.merge(y,e,!0),this._ctor=y;for(var S=0;S<this.fieldsArray.length;++S)this._fieldsArray[S].resolve();var k={};for(S=0;S<this.oneofsArray.length;++S)k[this._oneofsArray[S].resolve().name]={get:n.oneOfGetter(this._oneofsArray[S].oneof),set:n.oneOfSetter(this._oneofsArray[S].oneof)};S&&Object.defineProperties(y.prototype,k)}}}),m.generateConstructor=function(g){for(var S=n.codegen(["p"],g.name),k=0,_;k<g.fieldsArray.length;++k)(_=g._fieldsArray[k]).map?S("this%s={}",n.safeProp(_.name)):_.repeated&&S("this%s=[]",n.safeProp(_.name));return S("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(y){return y._fieldsById=y._fieldsArray=y._oneofsArray=null,delete y.encode,delete y.decode,delete y.verify,y}return m.fromJSON=function(g,S){var k=new m(g,S.options);k.extensions=S.extensions,k.reserved=S.reserved;for(var _=Object.keys(S.fields),N=0;N<_.length;++N)k.add((typeof S.fields[_[N]].keyType<"u"?a.fromJSON:l.fromJSON)(_[N],S.fields[_[N]]));if(S.oneofs)for(_=Object.keys(S.oneofs),N=0;N<_.length;++N)k.add(v.fromJSON(_[N],S.oneofs[_[N]]));if(S.nested)for(_=Object.keys(S.nested),N=0;N<_.length;++N){var z=S.nested[_[N]];k.add((z.id!==void 0?l.fromJSON:z.fields!==void 0?m.fromJSON:z.values!==void 0?c.fromJSON:z.methods!==void 0?i.fromJSON:f.fromJSON)(_[N],z))}return S.extensions&&S.extensions.length&&(k.extensions=S.extensions),S.reserved&&S.reserved.length&&(k.reserved=S.reserved),S.group&&(k.group=!0),S.comment&&(k.comment=S.comment),S.edition&&(k._edition=S.edition),k._defaultEdition="proto3",k},m.prototype.toJSON=function(g){var S=f.prototype.toJSON.call(this,g),k=g?!!g.keepComments:!1;return n.toObject(["edition",this._editionToJSON(),"options",S&&S.options||void 0,"oneofs",f.arrayToJSON(this.oneofsArray,g),"fields",f.arrayToJSON(this.fieldsArray.filter(function(_){return!_.declaringField}),g)||{},"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",S&&S.nested||void 0,"comment",k?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;f.prototype.resolveAll.call(this);var g=this.oneofsArray;for(k=0;k<g.length;)g[k++].resolve();for(var S=this.fieldsArray,k=0;k<S.length;)S[k++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(g){return this._needsRecursiveFeatureResolution?(g=this._edition||g,f.prototype._resolveFeaturesRecursive.call(this,g),this.oneofsArray.forEach(S=>{S._resolveFeatures(g)}),this.fieldsArray.forEach(S=>{S._resolveFeatures(g)}),this):this},m.prototype.get=function(g){return this.fields[g]||this.oneofs&&this.oneofs[g]||this.nested&&this.nested[g]||null},m.prototype.add=function(g){if(this.get(g.name))throw Error("duplicate name '"+g.name+"' in "+this);if(g instanceof l&&g.extend===void 0){if(this._fieldsById?this._fieldsById[g.id]:this.fieldsById[g.id])throw Error("duplicate id "+g.id+" in "+this);if(this.isReservedId(g.id))throw Error("id "+g.id+" is reserved in "+this);if(this.isReservedName(g.name))throw Error("name '"+g.name+"' is reserved in "+this);return g.parent&&g.parent.remove(g),this.fields[g.name]=g,g.message=this,g.onAdd(this),R(this)}return g instanceof v?(this.oneofs||(this.oneofs={}),this.oneofs[g.name]=g,g.onAdd(this),R(this)):f.prototype.add.call(this,g)},m.prototype.remove=function(g){if(g instanceof l&&g.extend===void 0){if(!this.fields||this.fields[g.name]!==g)throw Error(g+" is not a member of "+this);return delete this.fields[g.name],g.parent=null,g.onRemove(this),R(this)}if(g instanceof v){if(!this.oneofs||this.oneofs[g.name]!==g)throw Error(g+" is not a member of "+this);return delete this.oneofs[g.name],g.parent=null,g.onRemove(this),R(this)}return f.prototype.remove.call(this,g)},m.prototype.isReservedId=function(g){return f.isReservedId(this.reserved,g)},m.prototype.isReservedName=function(g){return f.isReservedName(this.reserved,g)},m.prototype.create=function(g){return new this.ctor(g)},m.prototype.setup=function(){for(var g=this.fullName,S=[],k=0;k<this.fieldsArray.length;++k)S.push(this._fieldsArray[k].resolve().resolvedType);this.encode=d(this)({Writer:r,types:S,util:n}),this.decode=s(this)({Reader:t,types:S,util:n}),this.verify=u(this)({types:S,util:n}),this.fromObject=o.fromObject(this)({types:S,util:n}),this.toObject=o.toObject(this)({types:S,util:n});var _=h[g];if(_){var N=Object.create(this);N.fromObject=this.fromObject,this.fromObject=_.fromObject.bind(N),N.toObject=this.toObject,this.toObject=_.toObject.bind(N)}return this},m.prototype.encode=function(g,S){return this.setup().encode(g,S)},m.prototype.encodeDelimited=function(g,S){return this.encode(g,S&&S.len?S.fork():S).ldelim()},m.prototype.decode=function(g,S){return this.setup().decode(g,S)},m.prototype.decodeDelimited=function(g){return g instanceof t||(g=t.create(g)),this.decode(g,g.uint32())},m.prototype.verify=function(g){return this.setup().verify(g)},m.prototype.fromObject=function(g){return this.setup().fromObject(g)},m.prototype.toObject=function(g,S){return this.setup().toObject(g,S)},m.d=function(g){return function(k){n.decorateType(k,g)}},type}var root,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=r;var f=requireNamespace();((r.prototype=Object.create(f.prototype)).constructor=r).className="Root";var c=requireField(),v=require_enum(),l=requireOneof(),a=requireUtil(),i,e,t;function r(u){f.call(this,"",u),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}r.fromJSON=function(o,h){return h||(h=new r),o.options&&h.setOptions(o.options),h.addJSON(o.nested).resolveAll()},r.prototype.resolvePath=a.path.resolve,r.prototype.fetch=a.fetch;function n(){}r.prototype.load=function u(o,h,m){typeof h=="function"&&(m=h,h=void 0);var R=this;if(!m)return a.asPromise(u,R,o,h);var y=m===n;function g(D,L){if(m){if(y)throw D;L&&L.resolveAll();var b=m;m=null,b(D,L)}}function S(D){var L=D.lastIndexOf("google/protobuf/");if(L>-1){var b=D.substring(L);if(b in t)return b}return null}function k(D,L){try{if(a.isString(L)&&L.charAt(0)==="{"&&(L=JSON.parse(L)),!a.isString(L))R.setOptions(L.options).addJSON(L.nested);else{e.filename=D;var b=e(L,R,h),q,E=0;if(b.imports)for(;E<b.imports.length;++E)(q=S(b.imports[E])||R.resolvePath(D,b.imports[E]))&&_(q);if(b.weakImports)for(E=0;E<b.weakImports.length;++E)(q=S(b.weakImports[E])||R.resolvePath(D,b.weakImports[E]))&&_(q,!0)}}catch(T){g(T)}!y&&!N&&g(null,R)}function _(D,L){if(D=S(D)||D,!(R.files.indexOf(D)>-1)){if(R.files.push(D),D in t){y?k(D,t[D]):(++N,setTimeout(function(){--N,k(D,t[D])}));return}if(y){var b;try{b=a.fs.readFileSync(D).toString("utf8")}catch(q){L||g(q);return}k(D,b)}else++N,R.fetch(D,function(q,E){if(--N,!!m){if(q){L?N||g(null,R):g(q);return}k(D,E)}})}}var N=0;a.isString(o)&&(o=[o]);for(var z=0,$;z<o.length;++z)($=R.resolvePath("",o[z]))&&_($);return y?(R.resolveAll(),R):(N||g(null,R),R)},r.prototype.loadSync=function(o,h){if(!a.isNode)throw Error("not supported");return this.load(o,h,n)},r.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(o){return"'extend "+o.extend+"' in "+o.parent.fullName}).join(", "));return f.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function s(u,o){var h=o.parent.lookup(o.extend);if(h){var m=new c(o.fullName,o.id,o.type,o.rule,void 0,o.options);return h.get(m.name)||(m.declaringField=o,o.extensionField=m,h.add(m)),!0}return!1}return r.prototype._handleAdd=function(o){if(o instanceof c)o.extend!==void 0&&!o.extensionField&&(s(this,o)||this.deferred.push(o));else if(o instanceof v)d.test(o.name)&&(o.parent[o.name]=o.values);else if(!(o instanceof l)){if(o 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<o.nestedArray.length;++m)this._handleAdd(o._nestedArray[m]);d.test(o.name)&&(o.parent[o.name]=o)}(o instanceof i||o instanceof v||o instanceof c)&&(this._fullyQualifiedObjects[o.fullName]=o)},r.prototype._handleRemove=function(o){if(o instanceof c){if(o.extend!==void 0)if(o.extensionField)o.extensionField.parent.remove(o.extensionField),o.extensionField=null;else{var h=this.deferred.indexOf(o);h>-1&&this.deferred.splice(h,1)}}else if(o instanceof v)d.test(o.name)&&delete o.parent[o.name];else if(o instanceof f){for(var m=0;m<o.nestedArray.length;++m)this._handleRemove(o._nestedArray[m]);d.test(o.name)&&delete o.parent[o.name]}delete this._fullyQualifiedObjects[o.fullName]},r._configure=function(u,o,h){i=u,e=o,t=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++],o=n[s++];o!==void 0&&(d[u]=o)}return d};var a=/\\/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(a,"\\\\").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 t=0;return f.decorateEnum=function(n){if(n.$type)return n.$type;l||(l=require_enum());var d=new l("Enum"+t++,n);return f.decorateRoot.add(d),Object.defineProperty(n,"$type",{value:d,enumerable:!1}),d},f.setProperty=function(n,d,s,u){function o(h,m,R){var y=m.shift();if(y==="__proto__"||y==="prototype")return h;if(m.length>0)h[y]=o(h[y]||{},m,R);else{var g=h[y];if(g&&u)return h;g&&(R=[].concat(g).concat(R)),h[y]=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("."),o(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 a(i,e){var t=0,r={};for(e|=0;t<i.length;)r[l[t+e]]=i[t++];return r}c.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),c.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",v.emptyArray,null]),c.long=a([0,0,0,1,1],7),c.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),c.packed=a([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(),a,i=/^required|optional|repeated$/;e.fromJSON=function(r,n){var d=new e(r,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(t,r,n,d,s,u,o){if(l.isObject(d)?(o=s,u=d,d=s=void 0):l.isObject(s)&&(o=u,u=s,s=void 0),f.call(this,t,u),!l.isInteger(r)||r<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=r,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=o}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 a&&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(r,n,d){return f.prototype.setOption.call(this,r,n,d)},e.prototype.toJSON=function(r){var n=r?!!r.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 a?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 r;l.base64.test(this.typeDefault)?l.base64.decode(this.typeDefault,r=l.newBuffer(l.base64.length(this.typeDefault)),0):l.utf8.write(this.typeDefault,r=l.newBuffer(l.utf8.length(this.typeDefault)),0),this.typeDefault=r}return this.map?this.defaultValue=l.emptyObject:this.repeated?this.defaultValue=l.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof a&&(this.parent.ctor.prototype[this.name]=this.defaultValue),f.prototype.resolve.call(this)},e.prototype._inferLegacyProtoFeatures=function(r){if(r!=="proto2"&&r!=="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 a&&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(r){return f.prototype._resolveFeatures.call(this,this._edition||r)},e.d=function(r,n,d,s){return typeof n=="function"?n=l.decorateType(n).name:n&&typeof n=="object"&&(n=l.decorateEnum(n).name),function(o,h){l.decorateType(o.constructor).add(new e(h,r,n,d,{default:s}))}},e._configure=function(r){a=r},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,t,r){if(Array.isArray(e)||(t=e,e=void 0),f.call(this,i,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=r}l.fromJSON=function(e,t){return new l(e,t.oneof,t.options,t.comment)},l.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return v.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function a(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,a(this),this},l.prototype.remove=function(e){if(!(e instanceof c))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},l.prototype.onAdd=function(e){f.prototype.onAdd.call(this,e);for(var t=this,r=0;r<this.oneof.length;++r){var n=e.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=t,t.fieldsArray.push(n))}a(this)},l.prototype.onRemove=function(e){for(var t=0,r;t<this.fieldsArray.length;++t)(r=this.fieldsArray[t]).parent&&r.parent.remove(r);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),t=0;t<arguments.length;)e[t]=arguments[t++];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"},a={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(t,r){if(!c.isString(t))throw TypeError("name must be a string");if(r&&!c.isObject(r))throw TypeError("options must be an object");this.options=r,this.parsedOptions=null,this.name=t,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 t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],r=this.parent;r;)t.unshift(r.name),r=r.parent;return t.join(".")}}}),e.prototype.toJSON=function(){throw Error()},e.prototype.onAdd=function(r){this.parent&&this.parent!==r&&this.parent.remove(this),this.parent=r,this.resolved=!1;var n=r.root;n instanceof v&&n._handleAdd(this)},e.prototype.onRemove=function(r){var n=r.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(r){return this._resolveFeatures(this._edition||r)},e.prototype._resolveFeatures=function(r){if(!this._featuresResolved){var n={};if(!r)throw new Error("Unknown edition for "+this.fullName);var d=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(r));if(this._edition){if(r==="proto2")n=Object.assign({},a);else if(r==="proto3")n=Object.assign({},i);else if(r==="2023")n=Object.assign({},l);else throw new Error("Unknown edition: "+r);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(r){if(this.options)return this.options[r]},e.prototype.setOption=function(r,n,d){return this.options||(this.options={}),/^features\./.test(r)?c.setProperty(this.options,r,n,d):(!d||this.options[r]===void 0)&&(this.getOption(r)!==n&&(this.resolved=!1),this.options[r]=n),this},e.prototype.setParsedOption=function(r,n,d){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(d){var u=s.find(function(m){return Object.prototype.hasOwnProperty.call(m,r)});if(u){var o=u[r];c.setProperty(o,d,n)}else u={},u[r]=c.setProperty({},d,n),s.push(u)}else{var h={};h[r]=n,s.push(h)}return this},e.prototype.setOptions=function(r,n){if(r)for(var d=Object.keys(r),s=0;s<d.length;++s)this.setOption(d[s],r[d[s]],n);return this},e.prototype.toString=function(){var r=this.constructor.className,n=this.fullName;return n.length?r+" "+n:r},e.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition},e._configure=function(t){v=t},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(a,i,e,t,r,n){if(f.call(this,a,e),i&&typeof i!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=t,this.comments=r||{},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 t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},l.fromJSON=function(i,e){var t=new l(i,e.values,e.options,e.comment,e.comments);return t.reserved=e.reserved,e.edition&&(t._edition=e.edition),t._defaultEdition="proto3",t},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,t,r){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 r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[i]=r||null),this.comments[i]=t||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=a;var f=require_enum(),c=requireTypes(),v=requireUtil();function l(i,e,t,r){return e.delimited?i("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,r,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):i("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,r,(e.id<<3|2)>>>0)}function a(i){for(var e=v.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),t,r,n=i.fieldsArray.slice().sort(v.compareFieldsById),t=0;t<n.length;++t){var d=n[t].resolve(),s=i._fieldsArray.indexOf(d),u=d.resolvedType instanceof f?"int32":d.type,o=c.basic[u];r="m"+v.safeProp(d.name),d.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",r,d.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",r)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(d.id<<3|2)>>>0,8|c.mapKey[d.keyType],d.keyType),o===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,r):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|o,u,r),e("}")("}")):d.repeated?(e("if(%s!=null&&%s.length){",r,r),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)",r)("w.%s(%s[i])",u,r)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",r),o===void 0?l(e,d,s,r+"[i]"):e("w.uint32(%i).%s(%s[i])",(d.id<<3|o)>>>0,u,r)),e("}")):(d.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",r,d.name),o===void 0?l(e,d,s,r):e("w.uint32(%i).%s(%s)",(d.id<<3|o)>>>0,u,r))}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,a,i){return typeof a=="function"?(i=a,a=new f.Root):a||(a=new f.Root),a.load(l,i)}f.load=c;function v(l,a){return a||(a=new f.Root),a.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=/^ *[*/]+ */,a=/^\s*\*?\/*/,i=/\n/g,e=/\s/,t=/\\(.?)/g,r={0:"\0",r:"\r",n:`
|
|
5
|
+
`,t:" "};function n(s){return s.replace(t,function(u,o){switch(o){case"\\":case"":return o;default:return r[o]||""}})}d.unescape=n;function d(s,u){s=s.toString();var o=0,h=s.length,m=1,R=0,y={},g=[],S=null;function k(A){return Error("illegal "+A+" (line "+m+")")}function _(){var A=S==="'"?v:c;A.lastIndex=o-1;var V=A.exec(s);if(!V)throw k("string");return o=A.lastIndex,b(S),S=null,n(V[1])}function N(A){return s.charAt(A)}function z(A,V,x){var W={type:s.charAt(A++),lineEmpty:!1,leading:x},M;u?M=2:M=3;var H=A-M,G;do if(--H<0||(G=s.charAt(H))===`
|
|
6
|
+
`){W.lineEmpty=!0;break}while(G===" "||G===" ");for(var j=s.substring(A,V).split(i),Z=0;Z<j.length;++Z)j[Z]=j[Z].replace(u?a:l,"").trim();W.text=j.join(`
|
|
7
|
+
`).trim(),y[m]=W,R=m}function $(A){var V=D(A),x=s.substring(A,V),W=/^\s*\/\//.test(x);return W}function D(A){for(var V=A;V<h&&N(V)!==`
|
|
8
|
+
`;)V++;return V}function L(){if(g.length>0)return g.shift();if(S)return _();var A,V,x,W,M,H=o===0;do{if(o===h)return null;for(A=!1;e.test(x=N(o));)if(x===`
|
|
9
|
+
`&&(H=!0,++m),++o===h)return null;if(N(o)==="/"){if(++o===h)throw k("comment");if(N(o)==="/")if(u){if(W=o,M=!1,$(o-1)){M=!0;do if(o=D(o),o===h||(o++,!H))break;while($(o))}else o=Math.min(h,D(o)+1);M&&(z(W,o,H),H=!0),m++,A=!0}else{for(M=N(W=o+1)==="/";N(++o)!==`
|
|
10
|
+
`;)if(o===h)return null;++o,M&&(z(W,o-1,H),H=!0),++m,A=!0}else if((x=N(o))==="*"){W=o+1,M=u||N(W)==="*";do{if(x===`
|
|
11
|
+
`&&++m,++o===h)throw k("comment");V=x,x=N(o)}while(V!=="*"||x!=="/");++o,M&&(z(W,o-2,H),H=!0),A=!0}else return"/"}}while(A);var G=o;f.lastIndex=0;var j=f.test(N(G++));if(!j)for(;G<h&&!f.test(N(G));)++G;var Z=s.substring(o,o=G);return(Z==='"'||Z==="'")&&(S=Z),Z}function b(A){g.push(A)}function q(){if(!g.length){var A=L();if(A===null)return null;b(A)}return g[0]}function E(A,V){var x=q(),W=x===A;if(W)return L(),!0;if(!V)throw k("token '"+x+"', '"+A+"' expected");return!1}function T(A){var V=null,x;return A===void 0?(x=y[m-1],delete y[m-1],x&&(u||x.type==="*"||x.lineEmpty)&&(V=x.leading?x.text:null)):(R<A&&q(),x=y[A],delete y[A],x&&!x.lineEmpty&&(u||x.type==="/")&&(V=x.leading?null:x.text)),V}return Object.defineProperty({next:L,peek:q,push:b,skip:E,cmnt:T},"line",{get:function(){return m}})}return tokenize_1}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=_,_.filename=null,_.defaults={keepCase:!1};var f=requireTokenize(),c=requireRoot(),v=requireType(),l=requireField(),a=requireMapfield(),i=requireOneof(),e=require_enum(),t=requireService(),r=requireMethod(),n=requireObject(),d=requireTypes(),s=requireUtil(),u=/^[1-9][0-9]*$/,o=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,R=/^0[0-7]+$/,y=/^-?0[0-7]+$/,g=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,S=/^[a-zA-Z_][a-zA-Z_0-9]*$/,k=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function _(N,z,$){z instanceof c||($=z,z=new c),$||($=_.defaults);var D=$.preferTrailingComment||!1,L=f(N,$.alternateCommentMode||!1),b=L.next,q=L.push,E=L.peek,T=L.skip,A=L.cmnt,V=!0,x,W,M,H="proto2",G=z,j=[],Z={},U=$.keepCase?function(P){return P}:s.camelCase;function ne(){j.forEach(P=>{P._edition=H,Object.keys(Z).forEach(C=>{P.getOption(C)===void 0&&P.setOption(C,Z[C],!0)})})}function B(P,C,p){var w=_.filename;return p||(_.filename=null),Error("illegal "+(C||"token")+" '"+P+"' ("+(w?w+", ":"")+"line "+L.line+")")}function re(){var P=[],C;do{if((C=b())!=='"'&&C!=="'")throw B(C);P.push(b()),T(C),C=E()}while(C==='"'||C==="'");return P.join("")}function ue(P){var C=b();switch(C){case"'":case'"':return q(C),re();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return ce(C,!0)}catch{if(k.test(C))return C;throw B(C,"value")}}function se(P,C){var p,w;do if(C&&((p=E())==='"'||p==="'")){var O=re();if(P.push(O),H>=2023)throw B(O,"id")}else try{P.push([w=ve(b()),T("to",!0)?ve(b()):w])}catch(I){if(C&&k.test(p)&&H>=2023)P.push(p);else throw I}while(T(",",!0));var F={options:void 0};F.setOption=function(I,X){this.options===void 0&&(this.options={}),this.options[I]=X},he(F,function(X){if(X==="option")me(F,X),T(";");else throw B(X)},function(){we(F)})}function ce(P,C){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(g.test(P))return p*parseFloat(P);throw B(P,"number",C)}function ve(P,C){switch(P){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!C&&P.charAt(0)==="-")throw B(P,"id");if(o.test(P))return parseInt(P,10);if(m.test(P))return parseInt(P,16);if(y.test(P))return parseInt(P,8);throw B(P,"id")}function Re(){if(x!==void 0)throw B("package");if(x=b(),!k.test(x))throw B(x,"name");G=G.define(x),T(";")}function _e(){var P=E(),C;switch(P){case"weak":C=M||(M=[]),b();break;case"public":b();default:C=W||(W=[]);break}P=re(),T(";"),C.push(P)}function fe(){if(T("="),H=re(),H<2023)throw B(H,"syntax");T(";")}function de(){if(T("="),H=re(),!["2023"].includes(H))throw B(H,"edition");T(";")}function ge(P,C){switch(C){case"option":return me(P,C),T(";"),!0;case"message":return xe(P,C),!0;case"enum":return oe(P,C),!0;case"service":return Ee(P,C),!0;case"extend":return Ce(P,C),!0}return!1}function he(P,C,p){var w=L.line;if(P&&(typeof P.comment!="string"&&(P.comment=A()),P.filename=_.filename),T("{",!0)){for(var O;(O=b())!=="}";)C(O);T(";",!0)}else p&&p(),T(";"),P&&(typeof P.comment!="string"||D)&&(P.comment=A(w)||P.comment)}function xe(P,C){if(!S.test(C=b()))throw B(C,"type name");var p=new v(C);he(p,function(O){if(!ge(p,O))switch(O){case"map":Oe(p);break;case"required":if(H!=="proto2")throw B(O);case"repeated":pe(p,O);break;case"optional":if(H==="proto3")pe(p,"proto3_optional");else{if(H!=="proto2")throw B(O);pe(p,"optional")}break;case"oneof":Te(p,O);break;case"extensions":se(p.extensions||(p.extensions=[]));break;case"reserved":se(p.reserved||(p.reserved=[]),!0);break;default:if(H==="proto2"||!k.test(O))throw B(O);q(O),pe(p,"optional");break}}),P.add(p),P===G&&j.push(p)}function pe(P,C,p){var w=b();if(w==="group"){Se(P,C);return}for(;w.endsWith(".")||E().startsWith(".");)w+=b();if(!k.test(w))throw B(w,"type");var O=b();if(!S.test(O))throw B(O,"name");O=U(O),T("=");var F=new l(O,ve(b()),w,C,p);if(he(F,function(Y){if(Y==="option")me(F,Y),T(";");else throw B(Y)},function(){we(F)}),C==="proto3_optional"){var I=new i("_"+O);F.setOption("proto3_optional",!0),I.add(F),P.add(I)}else P.add(F);P===G&&j.push(F)}function Se(P,C){if(H>=2023)throw B("group");var p=b();if(!S.test(p))throw B(p,"name");var w=s.lcFirst(p);p===w&&(p=s.ucFirst(p)),T("=");var O=ve(b()),F=new v(p);F.group=!0;var I=new l(w,O,p,C);I.filename=_.filename,he(F,function(Y){switch(Y){case"option":me(F,Y),T(";");break;case"required":case"repeated":pe(F,Y);break;case"optional":H==="proto3"?pe(F,"proto3_optional"):pe(F,"optional");break;case"message":xe(F,Y);break;case"enum":oe(F,Y);break;case"reserved":se(F.reserved||(F.reserved=[]),!0);break;default:throw B(Y)}}),P.add(F).add(I)}function Oe(P){T("<");var C=b();if(d.mapKey[C]===void 0)throw B(C,"type");T(",");var p=b();if(!k.test(p))throw B(p,"type");T(">");var w=b();if(!S.test(w))throw B(w,"name");T("=");var O=new a(U(w),ve(b()),C,p);he(O,function(I){if(I==="option")me(O,I),T(";");else throw B(I)},function(){we(O)}),P.add(O)}function Te(P,C){if(!S.test(C=b()))throw B(C,"name");var p=new i(U(C));he(p,function(O){O==="option"?(me(p,O),T(";")):(q(O),pe(p,"optional"))}),P.add(p)}function oe(P,C){if(!S.test(C=b()))throw B(C,"name");var p=new e(C);he(p,function(O){switch(O){case"option":me(p,O),T(";");break;case"reserved":se(p.reserved||(p.reserved=[]),!0),p.reserved===void 0&&(p.reserved=[]);break;default:be(p,O)}}),P.add(p),P===G&&j.push(p)}function be(P,C){if(!S.test(C))throw B(C,"name");T("=");var p=ve(b(),!0),w={options:void 0};w.getOption=function(O){return this.options[O]},w.setOption=function(O,F){n.prototype.setOption.call(w,O,F)},w.setParsedOption=function(){},he(w,function(F){if(F==="option")me(w,F),T(";");else throw B(F)},function(){we(w)}),P.add(C,p,w.comment,w.parsedOptions||w.options)}function me(P,C){var p,w,O=!0;for(C==="option"&&(C=b());C!=="=";){if(C==="("){var F=b();T(")"),C="("+F+")"}if(O){if(O=!1,C.includes(".")&&!C.includes("(")){var I=C.split(".");p=I[0]+".",C=I[1];continue}p=C}else w=w?w+=C:C;C=b()}var X=w?p.concat(w):p,Y=qe(P,X);w=w&&w[0]==="."?w.slice(1):w,p=p&&p[p.length-1]==="."?p.slice(0,-1):p,ye(P,p,Y,w)}function qe(P,C){if(T("{",!0)){for(var p={};!T("}",!0);){if(!S.test(ae=b()))throw B(ae,"name");if(ae===null)throw B(ae,"end of input");var w,O=ae;if(T(":",!0),E()==="{")w=qe(P,C+"."+ae);else if(E()==="["){w=[];var F;if(T("[",!0)){do F=ue(),w.push(F);while(T(",",!0));T("]"),typeof F<"u"&&Ae(P,C+"."+ae,F)}}else w=ue(),Ae(P,C+"."+ae,w);var I=p[O];I&&(w=[].concat(I).concat(w)),p[O]=w,T(",",!0),T(";",!0)}return p}var X=ue();return Ae(P,C,X),X}function Ae(P,C,p){if(G===P&&/^features\./.test(C)){Z[C]=p;return}P.setOption&&P.setOption(C,p)}function ye(P,C,p,w){P.setParsedOption&&P.setParsedOption(C,p,w)}function we(P){if(T("[",!0)){do me(P,"option");while(T(",",!0));T("]")}return P}function Ee(P,C){if(!S.test(C=b()))throw B(C,"service name");var p=new t(C);he(p,function(O){if(!ge(p,O))if(O==="rpc")ke(p,O);else throw B(O)}),P.add(p),P===G&&j.push(p)}function ke(P,C){var p=A(),w=C;if(!S.test(C=b()))throw B(C,"name");var O=C,F,I,X,Y;if(T("("),T("stream",!0)&&(I=!0),!k.test(C=b())||(F=C,T(")"),T("returns"),T("("),T("stream",!0)&&(Y=!0),!k.test(C=b())))throw B(C);X=C,T(")");var Q=new r(O,w,F,X,I,Y);Q.comment=p,he(Q,function(K){if(K==="option")me(Q,K),T(";");else throw B(K)}),P.add(Q)}function Ce(P,C){if(!k.test(C=b()))throw B(C,"reference");var p=C;he(null,function(O){switch(O){case"required":case"repeated":pe(P,O,p);break;case"optional":H==="proto3"?pe(P,"proto3_optional",p):pe(P,"optional",p);break;default:if(H==="proto2"||!k.test(O))throw B(O);q(O),pe(P,"optional",p);break}})}for(var ae;(ae=b())!==null;)switch(ae){case"package":if(!V)throw B(ae);Re();break;case"import":if(!V)throw B(ae);_e();break;case"syntax":if(!V)throw B(ae);fe();break;case"edition":if(!V)throw B(ae);de();break;case"option":me(G,ae),T(";",!0);break;default:if(ge(G,ae)){V=!1;continue}throw B(ae)}return ne(),_.filename=null,{package:x,imports:W,weakImports:M,root:z}}return parse_1}var common_1,hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common_1;hasRequiredCommon=1,common_1=c;var f=/\/|\./;function c(l,a){f.test(l)||(l="google/protobuf/"+l+".proto",a={nested:{google:{nested:{protobuf:{nested:a}}}}}),c[l]=a}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(a){return c[a]||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=index.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,t=null,r=null,n=null,d=null,s=null,u=null,o="viewerAsset",h=!1,m=null;const R=(x,W=2e3)=>new Promise(M=>{if(!x||x.readyState===WebSocket.CLOSED){M();return}const H=Date.now(),G=()=>{x.readyState===WebSocket.CLOSED||Date.now()-H>W?M():setTimeout(G,50)};G()}),y=async()=>{if(f.value){const x=f.value;f.value=null,c.value="disconnected",(x.readyState===WebSocket.OPEN||x.readyState===WebSocket.CONNECTING)&&(x.close(),await R(x))}m=null},g=async(x,W,M,H="viewerAsset",G=null)=>{if(m&&await m,f.value){const j=f.value.readyState;(j===WebSocket.CONNECTING||j===WebSocket.OPEN||j===WebSocket.CLOSING)&&(await y(),await new Promise(Z=>setTimeout(Z,100)))}s=W,u=G,o=H,v.value=!0,m=new Promise(async(j,Z)=>{try{const U=M||await index.useToken();let ne=x+"?session="+U+"&"+o+"="+s;u&&o!=="package"&&(ne+="&package="+u);const B=new WebSocket(ne);f.value=B,B.onopen=()=>{S(),j(B)},B.onclose=()=>{k(),j(null)},B.onmessage=_,B.onerror=re=>{console.error("WebSocket error:",re),c.value="disconnected",Z(re)},setTimeout(()=>{B.readyState===WebSocket.CONNECTING&&(B.close(),Z(new Error("WebSocket connection timeout")))},1e4)}catch(U){console.error("Failed to create WebSocket:",U),Z(U)}});try{await m}catch(j){console.error("WebSocket connection failed:",j),m=null}},S=()=>{if(c.value="connected",v.value){if(d&&d(),s){const x={montage:"NOT_MONTAGED",packageId:u||s};f.value.send(JSON.stringify(x))}v.value=!1}},k=()=>{c.value="disconnected"},_=x=>{if(typeof x.data=="string"){let M={};try{M=JSON.parse(x.data)}catch{n==null||n({error:"JSON Parse Error"});return}M.channelDetails?r==null||r(M.channelDetails):M.error&&(n==null||n(M));return}const W=new FileReader;W.addEventListener("loadend",function(M){const H=M.target.result,G=new Uint8Array(H),j=i.decode(G),Z=j.segment;if(j.event&&j.event.length>0&&j.event[0].pageStart){const U=j.event[0],ne=[[],[]],B=U.times.length/2;let re=0;for(let ve=0;ve<B;ve++)ne[0].push(U.times[re]),ne[1].push(U.times[re+1]),re+=2;let ue=new Array(3),se=0;for(;se<3;)ue[se]=new Float32Array(ne[0].length),se++;const ce={chId:U.source,lastUsed:0,unit:"uV",samplePeriod:U.samplePeriod,pageStart:U.pageStart,pageEnd:U.pageEnd,startTs:U.pageStart,isMinMax:U.isResampled,unitM:1,type:"Neural",nrPoints:B,parsedData:ne,cData:ue};t==null||t({pageStart:U.pageStart,data:ce,type:"Neural",nrResponses:j.totalResponses})}if(Z!==null){let U=null;Z.isMinMax?U=Z.data.length/2:U=Z.data.length;const ne=new Array(3),B=Z.startTs;let re=0,ue=0,se=0;for(;se<3;)ne[se]=new Float64Array(U),se++;if(Z.isMinMax){let fe=0;for(let de=0;de<U;de++){let ge=-Z.data[fe],he=-Z.data[fe+1];ne[0][de]=B+de*Z.samplePeriod,ne[1][de]=ge,ne[2][de]=he,isNaN(ge)||(ue++,re+=ge+(he-ge)/2),fe+=2}}else for(let fe=0;fe<U;fe++){let de=-Z.data[fe];ne[0][fe]=B+fe*Z.samplePeriod,ne[1][fe]=de,isNaN(de)||(ue++,re+=de)}let ce=0;if(h){const fe=Array.prototype.slice.call(ne[1]).sort();ce=fe[Math.round(fe.length/2)]}let ve=new Array(3),Re=0;for(;Re<3;)ve[Re]=new Float32Array(ne[0].length),Re++;const _e={chId:Z.source,lastUsed:Z.lastUsed,unit:Z.unit,samplePeriod:Z.samplePeriod,pageStart:Z.pageStart,pageEnd:Z.pageEnd,startTs:B,isMinMax:Z.isMinMax,unitM:Z.unitM,type:Z.segmentType,nrPoints:U,cData:ve,parsedData:ne,median:ce,sumElem:re,nrValidPoints:ue,name:Z.channelName,label:Z.channelName};_e.nrPoints>0?e==null||e({pageStart:Z.pageStart,data:_e,type:Z.segmentType,nrResponses:j.totalResponses}):e==null||e({pageStart:Z.pageStart,data:_e,nrResponses:j.totalResponses,type:"gap"})}}),W.readAsArrayBuffer(x.data)},N=x=>f.value&&f.value.readyState===1?(f.value.send(JSON.stringify(x)),!0):!1,z=x=>{let W;switch(x){case"NOT_MONTAGED":W={montage:"NOT_MONTAGED",packageId:u||s};break;default:W={montage:"CUSTOM_MONTAGE",packageId:u||s,montageMap:x}}N(W)},$=x=>{f.value&&f.value.readyState===1?f.value.send(JSON.stringify(x)):setTimeout(()=>$(x),200)},D=()=>{if(f.value&&f.value.readyState===1){const x={requestType:"DumpBufferRequest"};return f.value.send(JSON.stringify(x)),!0}return console.warn("⚠️ Cannot send dump buffer request - WebSocket not connected"),!1},L=x=>{e=x},b=x=>{t=x},q=x=>{r=x},E=x=>{n=x};vue.onUnmounted(async()=>{await y()});const T=x=>{d=x},A=x=>{s=x},V=x=>{h=x};return{websocket:vue.readonly(f),connectionStatus:vue.readonly(c),openWebsocket:g,send:N,sendMontageMessage:z,sendFilterMessage:$,sendDumpBufferRequest:D,disconnect:y,setClearChannelsCallback:T,setActiveId:A,setUseMedian:V,onSegment:L,onEvent:b,onChannelDetails:q,onError:E}},useCanvasRenderer=()=>{const f=vue.ref(null),c=vue.ref(null),v=(t,r,n)=>r*(t+n),l=(t=1)=>t,a=(t,r,n,d,s,u,o=!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 y=R.getContext("2d");if(!y){console.warn("Unable to get 2D context for plotArea, skipping drawing.");return}y.setTransform(u,0,0,u,0,0),y.clearRect(0,0,d.cWidth,d.cHeight),m.clearRect(0,0,d.cWidth,d.cHeight);const g=r.reduce((S,k)=>k.visible?S+1:S,0);i(r,d.pHeight,g),y.save();for(let S in t.channels)if(t.channels.hasOwnProperty(S)){const k=t.channels[S];let _=null;if(_=r.find(A=>A.id===k.id),!_||!_.visible)continue;const N=d.start,z=d.rsPeriod,$=n.XOFFSET,D=Math.min(Math.round(d.cHeight/t.channels.length-2),10);for(let A=0;A<_.dataSegments.length;A+=2){if(_.dataSegments[A+1]<N)continue;if(_.dataSegments[A]>N+d.duration)break;let V=Math.floor($+(_.dataSegments[A]-N)/z),x=Math.floor($+(_.dataSegments[A+1]-N)/z),W=Math.floor(_.rowBaseline-D/2);m.fillRect(V,W,x-V,D)}e(_,k,d,n,s,o);const L=k.blocks.length;let b="Continuous";L&&(b=k.blocks[0].type),_.hover?_.selected?(y.strokeStyle="rgba(39,96,255,0.70)",y.fillStyle="rgba(39,96,255,0.70)"):(y.strokeStyle="rgba(39,96,255,0.60)",y.fillStyle="rgba(39,96,255,0.60)"):_.selected?(y.strokeStyle="rgb(249,162,58)",y.fillStyle="rgb(3249,162,58)"):b==="Neural"?y.strokeStyle="rgb(249,162,58)":(y.strokeStyle="black",y.fillStyle="black");let q=null,E=!0,T=1e6*(1/_.sf);for(let A=0;A<L;A++){const V=k.blocks[A];if(V.nrPoints===0)continue;const x=V.cData,W=V.nrPoints,M=x[0],H=x[1],G=x[2];let j=V.renderStartIndex,Z=V.renderEndIndex;switch(m.clearRect(Math.floor(M[j]),Math.floor(_.rowBaseline-D/2),Math.ceil(M[Z]-M[j]+2),D+1),V.type){case"Continuous":case"realtime":if(V.isMinMax){if(V.samplePeriod/T<3&&(E=!1),E){y.beginPath(),A>0&&M[j]<q.x+3?y.moveTo(q.x,q.y):y.moveTo(M[j],H[j]);for(let U=j;U<Z+1;U++)y.lineTo(M[U],H[U]);for(let U=Z-1;U>=j;U--)y.lineTo(M[U],G[U]);A>0&&M[j]<q.x+3&&y.lineTo(q.x,q.y2),y.closePath(),y.fill()}else{y.beginPath();for(let U=j;U<Z+1;U++)y.lineTo(M[U],H[U]),y.lineTo(M[U],G[U]),y.moveTo(M[U],H[U]);y.stroke()}y.beginPath(),y.moveTo(M[j],H[j]);for(let U=j;U<Z+1;U++)y.lineTo(M[U],H[U]);y.stroke()}else{A===0?(y.beginPath(),y.moveTo(M[j],H[j])):M[j]>q.x+2&&y.moveTo(M[j],H[j]);for(let U=j;U<Z+1;U++)y.lineTo(M[U],H[U]);A===L-1&&y.stroke()}break;case"Neural":y.beginPath();for(let U=0;U<W;U++)y.moveTo(M[U],H[U]),y.lineTo(M[U],G[U]);y.stroke();break}q={x:M[W-1],y:H[W-1],y2:G[W-1]}}}y.restore()},i=(t,r,n)=>{const d=t.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=(r+20)/n;let o=0;for(let h=0;h<s.length;h++){const m=t[s[h]];m.visible?(m.rowBaseline=.5*u+o*u,o++):m.rowBaseline=null}},e=(t,r,n,d,s,u)=>{let o=r.blocks.length;switch(t.type){case"UNIT":if(!u)for(let m=0;m<o;m++){const R=r.blocks[m],y=R.cData,g=R.parsedData,S=d.XOFFSET,k=R.parsedData[0].length,_=y[0],N=y[1],z=y[2],$=g[0],D=t.rowBaseline|0,L=n.start,b=n.rsPeriod,q=n.cHeight/(2*(n.nrVisibleChannels+1))|0;for(let E=0;E<k;E++)_[E]=S+($[E]-L)/b,N[E]=D-q,z[E]=D+q}break;case"CONTINUOUS":let h=0;if(!u){r.mean=0,r.median=0;for(let m=0;m<o;m++){const R=r.blocks[m];R.nrValidPoints>0&&(r.mean=(R.sumElem+h*r.mean)/(h+R.nrValidPoints),r.median=(R.median+h*r.median)/(h+R.nrValidPoints),h+=R.nrValidPoints)}}for(let m=0;m<o;m++){const R=r.blocks[m];let y=Math.floor((n.start-R.startTs)/R.samplePeriod);R.renderStartIndex=y>0?y:0;let g=Math.floor((n.start+n.duration-(R.startTs+R.nrPoints*R.samplePeriod))/R.samplePeriod);R.renderEndIndex=g>=0?R.nrPoints-1:R.nrPoints+g;const S=R.cData,k=R.parsedData,_=s*t.rowScale,N=d.XOFFSET,z=R.parsedData[0].length,$=S[0],D=S[1],L=S[2],b=k[0],q=k[1],E=k[2],T=t.rowBaseline;let A=0;d.USEMEDIAN?A=r.median:A=r.mean;const V=n.rsPeriod,x=n.start;for(let W=0;W<z;W++)$[W]=N+(b[W]-x)/V,D[W]=T-(q[W]-A)*_,R.isMinMax&&(q[W]===E[W]?L[W]=D[W]+1:L[W]=T-(E[W]-A)*_)}break}};return{plotCanvasRef:f,blurCanvasRef:c,initializeCanvases:l,renderData:a,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),a=vue.ref(0),i=vue.ref(null),e=vue.ref(1),t=vue.ref(!1),r=15e6,n=3,d=(_,N,z,$)=>{$||($=0);let D=s(_,N,$,_.length-1,z);return D===-1?D=0:D<0&&(D=-D-2),D},s=(_,N,z,$,D)=>{if($<z){let b;if($>=0?b=$:b=-$-2,b===-1)return b;const q=_[b].pageStart;for(;b>=0&&_[b].pageStart===q;)b--;return b++,-b-2}const L=parseInt((z+$)/2);if(_[L].pageStart>N)return s(_,N,z,L-1,D);if(_[L].pageStart<N)return s(_,N,L+1,$,D);{let b=L;if(D){for(;b>=0&&_[b].pageStart===N;)b--;b++}else{for(;b<_.length&&_[b].pageStart===N;)b++;b--}return b}},u=(_,N,z)=>{if(!_)return Promise.resolve();const $=[];if(_.length>0){const D=[];for(let L=0;L<_.length;L++){const b=_[L].content,E={id:z?z(b):b.id,serverId:b.serverId,label:b.name,displayName:b.displayName,type:b.channelType,segments:[],start:b.start,end:b.end,sampleFreq:b.rate,unit:b.unit,gaps:[],dataSegments:[]},T=E.label.split("<->",3),A=T[0];let V=T.length>1?parseFloat(T[1]):0;V=isNaN(V)?T[1]:V,D.push({id:E.id,serverId:E.serverId,type:E.type,label:E.label,displayName:E.displayName,label_split:T,label_prefix:A,label_value:V,dataSegments:[],rank:L,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:b.unit,sf:b.rate,filter:{},hideFilter:!0,isEditing:!1}),$.push(E)}N&&N.setChannels(D)}return o($),f.value=$,a.value=_.length,l.value=!0,Promise.resolve()},o=_=>{var N,z;if(_.length===0){i.value=null;return}i.value=((z=(N=_[0])==null?void 0:N.gaps)==null?void 0:z[0])||null},h=_=>{if(t.value)return;let N=null;const z=_.data.chId||_.data.source,$=_.data.label||_.data.name;if(N=f.value.find(D=>D.serverId===z&&D.label===$),!!N)switch(_.type){case"gap":case"Neural":case"Continuous":let D=!1,L=N&&N.segments;if(L&&_.type!=="gap"&&(D=!0,L.length>0)){let q=d(L,_.data.startTs,!0,0);for(;L[q]&&L[q].pageStart===_.data.pageStart;){if(L[q].startTs===_.data.startTs){D=!1;break}q++}}let b=c.value.get(_.data.pageStart);if(b){let q=b.counter.get(N.id);if(isNaN(q)&&(q=_.nrResponses!==void 0?_.nrResponses:1,b.counter.set(N.id,q)),q>0&&(q=q-1,b.counter.set(N.id,q)),q===0){let E=!0;for(let[T,A]of b.counter.entries())if(A>0||isNaN(A)){E=!1;break}E&&c.value.delete(_.data.pageStart)}}D&&(L.push(_.data),L.sort((q,E)=>q.startTs<E.startTs?-1:q.startTs>E.startTs?1:0));break}},m=()=>{i.value=[],c.value.clear();for(let _=0;_<f.value.length;_++)f.value[_].segments=[];for(let _=0;_<v.channels.length;_++)v.channels[_].blocks=[]},R=_=>{let N=0,z=0,$=v.channels;for(let L=0;L<$.length;L++){let b=$[L].blocks;for(let q=0;q<b.length;q++)b[q].type==="Continuous"&&(N+=y(b[q].parsedData[1]),z++)}const D=N/z;return!isNaN(D)&&_?_/$.length/(2*D):1},y=_=>{const N=g(_),z=_.map(function(L){const b=L-N;return b*b}),$=g(z);return Math.sqrt($)},g=_=>_.reduce(function($,D){return $+D},0)/_.length;return{chData:f,requestedPages:c,viewData:v,channelsReady:l,autoScale:a,globalGaps:i,pageSize:r,prefetchPages:n,currentRequestedSamplePeriod:e,isSwitchingMontage:t,initChannels:u,computeSummary:o,dataCallback:h,invalidate:m,autoScaleViewData:R,segmIndexOf:d,updateCurrentRequestedSamplePeriod:_=>{e.value=Math.ceil(_)},isDataCurrentForViewport:_=>_&&_.startTs&&_.startTs>0,standardDeviation:y,average:g}},useDataRequests=()=>{const f=vue.ref([]),c=vue.ref([]),v=vue.ref(null),l=vue.ref(!1),a=vue.ref(null),i=vue.ref(0),e=vue.ref(0);let t=null;const r=(g,S)=>{t=function(){var _;c.value.length>0?(((_=S.value)==null?void 0:_.size)||0)<5&&(g([c.value[0]])?c.value.splice(0,1):(console.warn("❌ Prefetch request failed"),clearInterval(v.value),l.value=!1)):(clearInterval(v.value),l.value=!1)}},n=(g,S,k,_,N,z,$,D,L,b)=>{_.start=S,_.duration=k;const q=[];for(let E=0;E<_.channels.length;E++){const T=b?b(_.channels[E]):_.channels[E].id;q.push(T)}for(let E=0;E<g.length;E++){const T=g[E],A=b?b(T):T.id;q.indexOf(A)<0&&_.channels.push({id:A,mean:null,firstRenderedIndex:0,lastRenderedIndex:0,blocks:[]})}return d(g,S,k,_,N,z,$,D,L,b)},d=(g,S,k,_,N,z,$,D,L,b)=>{f.value=[];let E=!1;(i.value!==S||e.value!==k)&&(c.value=[],E=!0),i.value=S,e.value=k;const T=[];for(let A=0;A<_.channels.length;A++)T.push(_.channels[A]);for(let A=0;A<g.length;A++){let V=!1;const x=g[A],W=x.segments,M=b?b(x):x.id,H=T.findIndex(re=>(b?b(re):re.id)===M);if(H===-1)continue;const G=_.channels[H];if(!G)continue;G.blocks=[];let j=Math.floor(S/15e6)*15e6;j<0&&(j=0);let Z=0,U=0;W.length>0&&(Z=L(W,j,!0,0));let ne=S+k+z.PREFETCHPAGES*15e6;ne>D&&(ne=D);let B;for(W.length>0&&(B=W[Z]);j<ne||V;){V=!1;let re=!1;if(B&&(re=j>=B.pageStart&&j<=B.pageEnd),re){const ue=B.pageStart;for(;B&&B.pageStart===ue;)B.startTs<S+k&&G.blocks.push(B),U+=1,B=W[Z+U];j+=15e6,B&&B.pageStart===ue&&(V=!0)}else{if(N.get(j)){if(j+=15e6,B&&j>=B.pageEnd)for(;B&&B.pageEnd<j&&(U+=1,B=W[Z+U],!!B););continue}if(j>=D){j+=15e6;continue}let ue=j<S+k,se=!1;if(ue){for(let ce in c.value)if(c.value[ce].start===j){c.value.splice(ce,1);break}for(let ce in f.value)f.value[ce].start===j&&(f.value[ce].channels.push(x),se=!0);se||f.value.push({channels:[x],start:j,duration:15e6,isInViewport:!0,pixelWidth:Math.ceil($)})}else if(E){for(let ce in c.value)c.value[ce].start===j&&(c.value[ce].channels.push(x),se=!0);se||c.value.push({channels:[x],start:j,duration:15e6,isInViewport:!1,pixelWidth:Math.ceil($)})}if(j+=15e6,B&&j>=B.pageEnd)for(;B&&B.pageEnd<j&&(U+=1,B=W[Z+U],!!B););}}G.blocks.sort(s)}return{asyncRequests:f.value,asyncPreRequests:c.value}},s=(g,S)=>g.startTs<S.startTs?-1:g.startTs>S.startTs?1:0,u=(g,S=0,k,_,N,z,$,D)=>{if(g.length===0)return!1;const L=D;for(let b=0;b<g.length;b++){let q;b===0?q=g[S]:b===S?q=g[0]:q=g[b];let E=q.start+q.duration;if(q.start>=L&&console.error("❌ Request start time is beyond dataset end!",{requestStart:q.start,requestDuration:q.duration,calculatedEndTime:E,datasetEndTime:L,isStartAfterEnd:q.start>=L}),E>L&&(console.warn("📊 Clamping request end time to dataset boundary:",{original:E,clamped:L,requestStart:q.start,duration:q.duration}),E=L),E<=q.start){console.error("🚨 CRITICAL: Invalid request detected - endTime <= startTime! Skipping request.",{startTime:q.start,endTime:E,duration:q.duration,datasetEndTime:L,originalEndTime:q.start+q.duration});continue}const T=k;if(T&&T.readyState===1){const A=q.channels.map(G=>{const j=G.serverId||G.id,Z=G.label||G.name;return{id:j,name:Z}}),V={session:_,minMax:!0,startTime:q.start,endTime:E,packageId:N.content.id,pixelWidth:q.pixelWidth,virtualChannels:A},x=JSON.stringify(V);T.send(x);const W=q.channels.length,M=new Map;for(let G=0;G<W;G++){const j=q.channels[G].id;M.set(j,NaN)}const H={count:W,counter:M,subPageCount:NaN,ts:Date.now(),inViewport:q.isInViewport,channels:q.channels.map(G=>({id:G.id,serverId:G.serverId,label:G.label}))};$.set(q.start,H)}else return console.error("❌ WebSocket not ready for sending requests:",{readyState:T==null?void 0:T.readyState,wsExists:!!T}),!1}return f.value=[],!0},o=()=>{c.value.length>0&&(l.value||(v.value=setInterval(t,150),l.value=!0))},h=()=>{v.value&&(clearInterval(v.value),v.value=null),l.value=!1},m=()=>{f.value=[],c.value=[],i.value=0,e.value=0,h()},R=()=>{const g=f.value.slice();return f.value=[],g},y=(g,S,k)=>{const _=[];return g.forEach(function(N,z){if(!isNaN(N.subPageCount)){const $=[];N.counter.forEach(function(D,L){!isNaN(D)&&D>0&&$.push(L)}),$.length>0&&_.push({channels:$,start:z,duration:S,isInViewport:!0,pixelWidth:Math.ceil(k)})}}),g.clear(),_};return vue.onUnmounted(()=>{h()}),{aSyncRequests:vue.readonly(f),aSyncPreRequests:vue.readonly(c),isPrefetching:vue.readonly(l),lastViewPageRequest:vue.readonly(a),initializePrefetch:r,generatePoints:n,requestData:d,requestDataFromServer:u,startPrefetching:o,stopPrefetching:h,clearRequests:m,getViewportRequests:R,reRequestPages:y}},useChannelProcessing=(f,c,v,l)=>{const a=vue.reactive({totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0}),i=vue.ref(new Map),e=vue.ref(new Map),t=vue.computed(()=>c.value!=="NOT_MONTAGED"),r=vue.computed(()=>!t.value||!v.value?null:v.value.find(b=>b.name===c.value)),n=vue.computed(()=>{var b;return((b=r.value)==null?void 0:b.channelPairs)||{}});vue.watch(c,()=>{i.value.clear(),e.value.clear()});const d=b=>b?index.propOr("","id",b):"",s=b=>b?index.propOr("","serverId",b)||index.propOr("","id",b):"",u=b=>index.propOr("","id",b),o=b=>{if(!b)return"";let q=index.propOr("","id",b);if(t.value&&typeof q=="string"){const E=q.split("_");q=E.length>1?head(E):q}return q},h=(b,q,E=null)=>{var x,W;const T=E||c.value,A=`${b}_${q}_${T}`;if(e.value.has(A))return e.value.get(A);let V=`${b}-${q}`;if(T!=="NOT_MONTAGED"){const M=(x=v.value)==null?void 0:x.find(H=>H.name===T);if(M!=null&&M.channelPairs)for(const H of Object.keys(M.channelPairs)){const G=M.channelPairs[H];if(((W=G.channels)==null?void 0:W.length)===2&&G.channels[0]===b&&G.channels[1]===q){V=G.name||V;break}}}return e.value.set(A,V),V},m=b=>{if(!Array.isArray(b))return console.warn("Invalid channel details provided:",b),[];const q=performance.now();a.totalChannels=b.length,a.processedChannels=0,a.errors=0;const E=b.map(({id:T,name:A})=>{var V;try{const x=R(T);if(!x)return console.warn(`❌ Base channel not found for ID: ${T}, available base channels:`,((V=f.value)==null?void 0:V.map(M=>({id:M==null?void 0:M.id,name:M==null?void 0:M.name})))||[]),a.errors++,null;const W=y(T,A,x);return a.processedChannels++,t.value&&a.montageChannels++,W}catch(x){return console.error(`❌ Error processing channel ${T}:`,x),a.errors++,null}}).filter(Boolean);return a.lastProcessingTime=performance.now()-q,E},R=b=>{var E;if(i.value.has(b))return i.value.get(b);const q=(E=f.value)==null?void 0:E.find(T=>(T==null?void 0:T.id)===b);return q&&i.value.set(b,q),q},y=(b,q,E)=>{let T=q;const A=b;let V=b;if(t.value){V=`${b}_${q}`;const W=q.split("<->",2);W.length===2&&(T=h(W[0],W[1]))}return{content:{id:V,serverId:A,name:q,channelType:E.channelType,label:q,displayName:T,unit:E.unit,rate:E.rate,start:E.start,end:E.end,montageScheme:t.value?c.value:"NOT_MONTAGED",isMontaged:t.value,baseChannelId:b},properties:E.properties||[]}},g=b=>{var T,A,V;if(b==="NOT_MONTAGED")return{montage:"NOT_MONTAGED",packageId:(A=(T=l.value)==null?void 0:T.content)==null?void 0:A.id,montageMap:[]};const q=v.value.find(x=>x.name===b);if(!q)return console.warn("Montage not found:",b),null;const E=q.channelPairs.map(x=>x.channels);return{montage:"CUSTOM_MONTAGE",packageId:(V=l.value)==null?void 0:V.content.id,montageMap:E}},S=b=>{const q=[];if(!b)return q.push("Channel configuration is null or undefined"),{isValid:!1,errors:q};const E=["id","label","type","unit","rate"];for(const A of E)b[A]||q.push(`Missing required field: ${A}`);b.rate&&(typeof b.rate!="number"||b.rate<=0)&&q.push("Sample rate must be a positive number"),b.start&&b.end&&b.start>=b.end&&q.push("Channel start time must be less than end time");const T=["CONTINUOUS","UNIT","Neural"];return b.type&&!T.includes(b.type)&&q.push(`Invalid channel type: ${b.type}. Must be one of: ${T.join(", ")}`),{isValid:q.length===0,errors:q}},k=b=>b.sort((q,E)=>{const T=q.label||"",A=E.label||"",V=T.split("<->",3),x=A.split("<->",3);if(V.length>2||x.length>2)return T.localeCompare(A);const W=V[0]||"",M=x[0]||"";if(W===M&&V.length>1&&x.length>1){const H=parseFloat(V[1]),G=parseFloat(x[1]);return!isNaN(H)&&!isNaN(G)?H-G:V[1].localeCompare(x[1])}return W.localeCompare(M)}),_=(b,q=0)=>{const E=b.content,T=E.label.split("<->",3),A=T[0]||"",V=T.length>1?isNaN(parseFloat(T[1]))?T[1]:parseFloat(T[1]):0;return{id:E.id,serverId:E.serverId,type:E.channelType,label:E.label,displayName:E.displayName,labelParts:T,labelPrefix:A,labelValue:V,dataSegments:[],rank:q,visible:!0,plotAgainst:null,rowBaseline:null,rowScale:1,rowAdjust:0,selected:!1,hover:!1,unit:E.unit,sf:E.rate,filter:{},hideFilter:!0,isEditing:!1,montageScheme:E.montageScheme||"NOT_MONTAGED",isMontaged:E.isMontaged||!1,baseChannelId:E.baseChannelId}},N=(b,q={})=>{const{channelType:E=null,visible:T=null,montageScheme:A=null,labelPattern:V=null,sampleRate:x=null}=q;return b.filter(W=>!(E&&W.type!==E||T!==null&&W.visible!==T||A&&W.montageScheme!==A||V&&!new RegExp(V,"i").test(W.label)||x&&W.sf!==x))},z=(b,q="type")=>{const E={};return b.forEach(T=>{let A;switch(q){case"type":A=T.type;break;case"montage":A=T.montageScheme||"NOT_MONTAGED";break;case"prefix":A=T.labelPrefix;break;case"sampleRate":A=T.sf;break;case"unit":A=T.unit;break;default:A="all"}E[A]||(E[A]=[]),E[A].push(T)}),E},$=()=>{var b;return{...a,cacheSize:i.value.size,montageCacheSize:e.value.size,isViewingMontage:t.value,currentMontageScheme:c.value,availableMontages:((b=v.value)==null?void 0:b.map(q=>q.name))||[]}},D=()=>{i.value.clear(),e.value.clear(),Object.assign(a,{totalChannels:0,processedChannels:0,montageChannels:0,errors:0,lastProcessingTime:0})},L=async b=>{const q=[];for(const E of b)try{const T=await E();q.push({success:!0,result:T})}catch(T){q.push({success:!1,error:T.message}),a.errors++}return q};return{processingStats:vue.readonly(a),isViewingMontage:t,currentMontage:r,montageChannelPairs:n,getChannelId:d,getBaseChannelId:o,getServerChannelId:s,getRawChannelId:u,getDisplayName:h,processChannelData:m,createMontagePayload:g,createChannelConfig:_,validateChannelConfig:S,sortChannelConfigurations:k,filterChannels:N,groupChannels:z,findBaseChannel:R,createVirtualChannel:y,getProcessingStats:$,clearCaches:D,batchProcessChannels:L}};function createThrottle(f,c,v={}){let l,a,i,e=null,t=0;const{leading:r=!0,trailing:n=!0}=v,d=function(){t=r===!1?0:Date.now(),e=null,i=f.apply(l,a),e||(l=a=null)},s=function(){const u=Date.now();!t&&r===!1&&(t=u);const o=c-(u-t);return l=this,a=arguments,o<=0||o>c?(e&&(clearTimeout(e),e=null),t=u,i=f.apply(l,a),e||(l=a=null)):!e&&n!==!1&&(e=setTimeout(d,o)),i};return s.cancel=function(){clearTimeout(e),t=0,e=l=a=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,a=v,i=vue.computed(()=>l.activeViewer||{}),e=vue.computed(()=>{var I;return((I=i.value)==null?void 0:I.channels)||[]}),t=vue.inject("viewerStore",()=>index.createViewerStore("default"),!0),{viewerChannels:r,viewerMontageScheme:n,workspaceMontages:d}=pinia.storeToRefs(t),{websocket:s,connectionStatus:u,openWebsocket:o,send:h,sendFilterMessage:m,sendDumpBufferRequest:R,disconnect:y,setClearChannelsCallback:g,onSegment:S,onEvent:k,onChannelDetails:_,onError:N}=useWebSocket(),{plotCanvasRef:z,blurCanvasRef:$,initializeCanvases:D,renderData:L,cpCanvasScaler:b}=useCanvasRenderer(),q=vue.ref(1),E=vue.ref(!1),{chData:T,requestedPages:A,viewData:V,channelsReady:x,autoScale:W,initChannels:M,dataCallback:H,invalidate:G,autoScaleViewData:j,segmIndexOf:Z,updateCurrentRequestedSamplePeriod:U,currentRequestedSamplePeriod:ne,isDataCurrentForViewport:B,isSwitchingMontage:re}=useTimeSeriesData(),{aSyncRequests:ue,aSyncPreRequests:se,isPrefetching:ce,initializePrefetch:ve,generatePoints:Re,requestDataFromServer:_e,startPrefetching:fe,clearRequests:de}=useDataRequests(),{getChannelId:ge,processChannelData:he,createMontagePayload:xe}=useChannelProcessing(e,n,d,i),pe=vue.ref({totalRequests:0,successfulRequests:0,failedRequests:0,montageRequests:0,singleChannelRequests:0,lastPrefetchTime:null,averageResponseTime:0}),Se=vue.ref(null),Oe=vue.ref(null),Te=vue.ref(null),oe=vue.ref(0),be=vue.computed(()=>q.value*l.cWidth),me=vue.computed(()=>b(l.cHeight,q.value,0)),qe=vue.computed(()=>l.cHeight-20),Ae=vue.computed(()=>({width:l.cWidth+"px",height:qe.value+"px"})),ye=vue.reactive({start:l.start,duration:l.duration,cWidth:l.cWidth,cHeight:l.cHeight,pHeight:qe.value,rsPeriod:l.rsPeriod,nrVisibleChannels:0}),we=vue.computed(()=>l.rsPeriod>0?l.rsPeriod:ye.duration>0&&ye.cWidth>0?ye.duration/ye.cWidth:(console.warn("⚠️ Using fallback rsPeriod = 1"),1));vue.watch(we,I=>{I>0&&U(I)},{immediate:!0});const Ee=()=>{var I;try{if(!x.value)return;ye.nrVisibleChannels=((I=r.value)==null?void 0:I.reduce((Q,J)=>J.visible?Q+1:Q,0))||0;let X=0,Y=0;if(V.channels.forEach((Q,J)=>{const K=Q.blocks||[],te=K.reduce((ee,le)=>ee+(le.nrPoints||0),0);K.length>0&&(Y++,X+=K.length)}),Y===0)return;L(V,r.value||[],l.constants,ye,l.globalZoomMult,q.value)}catch(X){console.error("💥 ERROR in renderDataInternal:",X),console.error("💥 Stack trace:",X.stack)}},ke=vue.ref(),Ce=()=>{ke.value=setInterval(()=>{var Q,J;if(!x.value)return;const I={timestamp:new Date().toISOString(),requestedPagesSize:A.value.size,isPrefetching:ce.value,pendingAsyncRequests:ue.value.length,pendingPreRequests:se.value.length,currentMontage:n.value,channelCount:((Q=r.value)==null?void 0:Q.length)||0,visibleChannelCount:((J=r.value)==null?void 0:J.filter(K=>K.visible).length)||0,connectionStatus:u.value,requestedPages:Array.from(A.value.entries()).map(([K,te])=>{var ee;return{pageStart:K,channelCount:te.count,inViewport:te.inViewport,age:Date.now()-te.ts,channels:((ee=te.channels)==null?void 0:ee.map(le=>le.id))||Array.from(te.counter.keys())}})},X=1e4,Y=I.requestedPages.filter(K=>K.age>X);Y.length>0&&(console.warn("⚠️ Detected stuck requests, cleaning up:",Y.map(K=>({pageStart:K.pageStart,age:Math.round(K.age/1e3)+"s",channels:K.channels}))),Y.forEach(K=>{A.value.delete(K.pageStart)}),oe.value>0&&(oe.value=Math.max(0,oe.value-1))),I.pendingPreRequests>0&&!I.isPrefetching&&console.warn("⚠️ Prefetch is blocked with pending requests:",{pendingPreRequests:I.pendingPreRequests,requestedPagesSize:I.requestedPagesSize})},5e3)},ae=async()=>{if(!r.value)return;const I=T.value.filter(ee=>{const le=r.value.find(ie=>ie.id===ee.id);return le&&le.visible}),X=we.value,Y=Re(I,l.start,l.duration,V,A.value,l.constants,X,l.ts_end,Z,ge),Q=Math.ceil(X);let J=!1;if(Se.value!==null&&Q!==Se.value&&(J=!0,`${Se.value}${Q}`),Oe.value!==null){const ee=Math.abs(l.start-Oe.value),le=Math.max(l.duration,Te.value||l.duration);ee>le*2&&(J=!0,`${ee}`,le*2,`${(ee/le).toFixed(1)}`)}const K=15;if(A.value.size>K&&(J=!0,`${A.value.size}${K}`),oe.value>=5&&(J=!0,`${oe.value}`),J&&!E.value){E.value=!0;try{R()&&(A.value.clear(),de(),oe.value=0,await new Promise(ee=>setTimeout(ee,50)))}finally{E.value=!1}}else if(J&&E.value)return;Se.value=Q,Oe.value=l.start,Te.value=l.duration;const te=await index.useToken();Y.asyncRequests.length>0&&_e(Y.asyncRequests,0,s.value,te,i.value,X,A.value,l.ts_end),Y.asyncPreRequests.length>0&&fe()},P=()=>{ae(),Ee()},C=()=>{ae(),W.value===0?(W.value--,p()):Ee()},p=()=>{const I=j(l.cHeight);I&&!isNaN(I)&&a("setGlobalZoom",I),Ee()},w=createThrottle(C,250,{leading:!1}),O=createThrottle(()=>P(),50);vue.watch(()=>l.rsPeriod,(I,X)=>{I>0&&U(I),G(),A.value.clear()}),vue.watch(()=>l.duration,(I,X)=>{G()}),vue.watch(()=>n.value,I=>{if(!s.value||s.value.readyState!==1){console.warn("Cannot switch montage — WebSocket not connected");return}re.value=!0,A.value.clear(),de(),G(),oe.value=0,Se.value=null,Oe.value=null,Te.value=null,x.value=!1;const X=xe(I);X?h(X):(console.warn("Montage definition not found for:",I),re.value=!1)}),vue.watch(()=>[l.start,l.duration,l.cWidth,l.cHeight,l.rsPeriod],()=>{ye.start=l.start,ye.duration=l.duration,ye.cWidth=l.cWidth,ye.cHeight=l.cHeight,ye.pHeight=qe.value,ye.rsPeriod=l.rsPeriod}),S(I=>{I.pageStart>=l.start+l.duration&&(pe.value.totalRequests++,n.value!=="NOT_MONTAGED"?pe.value.montageRequests++:pe.value.singleChannelRequests++),H(I),I.pageStart<l.start+l.duration&&w()}),k(I=>{if(!B(I.data)){oe.value++;return}oe.value=0,H(I),I.pageStart<l.start+l.duration&&w()}),_(I=>{re.value=!1;try{const X=he(I);if(!X||X.length===0){console.warn("No valid channels after processing channel details");return}M(X,t,ge).then(()=>{G(),P(),a("channelsInitialized")}).catch(Y=>{console.error("Failed to initialize channels:",Y),t.setViewerErrors({error:"Failed to initialize channels after montage switch"})})}catch(X){console.error("Error processing channel details:",X),t.setViewerErrors({error:"Error processing channel details"})}}),N(I=>{t.setViewerErrors(I)});const F=async()=>{var Y,Q;const I=we.value;U(I),g(()=>{var J;if((J=r.value)!=null&&J.length){const te={channelFiltersToClear:r.value.map(ee=>ee.id)};m(te)}});const X=await index.useToken();if(ve(J=>{const K=we.value;return _e(J,0,s.value,X,i.value,K,A.value,l.ts_end)},A),(Q=(Y=i.value)==null?void 0:Y.content)!=null&&Q.id)try{const J=i.value.content.viewerAssetId||i.value.content.id,K=i.value.content.viewerAssetId?"viewerAsset":i.value.content.idType||"viewerAsset",te=i.value.content.viewerAssetId?i.value.content.id:null;await o(t.config.timeseriesDiscoverApi,J,X,K,te),Ce()}catch(J){console.error("Failed to establish WebSocket connection:",J);return}};return vue.onMounted(async()=>{q.value=1,D(q.value),F()}),vue.onUnmounted(()=>{clearInterval(ke.value),A.value.size>0&&R(),t.resetViewer(),de(),y(),w.cancel&&w.cancel(),O.cancel&&O.cancel()}),c({renderAll:P,invalidate:G,throttledDataRender:O,sendFilterMessage:m,viewData:V,requestedPages:A,chData:T,viewerChannels:r,currentRequestedSamplePeriod:ne,initPlotCanvas:F}),(I,X)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("canvas",{ref_key:"blurCanvasRef",ref:$,class:"canvas",width:be.value,height:me.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_2$1),vue.renderSlot(I.$slots,"axisCanvas",{},void 0,!0),vue.renderSlot(I.$slots,"annCanvas",{},void 0,!0),vue.createElementVNode("canvas",{ref_key:"plotCanvasRef",ref:z,class:"canvas",width:be.value,height:me.value,style:vue.normalizeStyle(Ae.value)},null,12,_hoisted_3$1)]))}},TSPlotCanvas=index._export_sfc(_sfc_main$1,[["__scopeId","data-v-1549be92"]]),_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-4SmGl8c3.cjs"))),a=f,i=v,e=vue.inject("viewerStore",()=>index.createViewerStore("default"),!0),{viewerChannels:t,viewerAnnotations:r,viewerActiveTool:n,viewerSelectedChannels:d}=pinia.storeToRefs(e),s=vue.ref(null),u=vue.ref(null),o=vue.ref(null),h=vue.ref(null),m=vue.ref(null),R=vue.ref(null);vue.reactive({});const y=vue.ref(0),g=vue.ref(0),S=vue.ref(0),k=vue.ref(1),_=vue.ref(!1),N=vue.ref(!1),z=vue.ref("pointer");vue.ref(!1);const $=vue.reactive({x:0,y:0}),D=vue.ref(0),L=vue.ref(["Event","Artifact","Seizure","Mark","Stim On","Stim Off","Start","Stop"]),b=vue.ref(0),q=vue.ref(null),E=vue.ref(0),T=vue.ref(!0),A=()=>{if(r.value.length>0){if(!r.value.some(w=>w.selected)){const w=r.value[0];w&&w.id&&e.setActiveAnnotationLayer(w.id)}}else setTimeout(()=>{r.value.length>0&&A()},500)},V=p=>{if(p){const w="set"+p.charAt(0).toUpperCase()+p.slice(1),O=x[w];typeof O=="function"&&O()}},x={setPan:()=>{},setPointer:()=>{},setAnnotate:()=>{A()}},W=vue.computed(()=>t.value.filter(p=>p.visible).length),M=vue.computed(()=>a.cHeight-20),H=vue.computed(()=>a.cWidth+a.constants.CURSOROFFSET);vue.computed(()=>u.value);const G=vue.computed(()=>({width:a.cWidth+"px",height:a.cHeight+"px"})),j=vue.computed(()=>({width:a.cWidth+"px",height:M.value+"px"})),Z=vue.computed(()=>({width:H.value+"px",height:a.cHeight+"px"}));vue.watch(()=>a.cHeight,()=>{Oe()}),vue.watch(()=>a.cWidth,()=>{Oe()}),vue.watch(()=>a.start,()=>{be()}),vue.watch(()=>a.duration,()=>{var p;(p=s.value)==null||p.invalidate(),Te(a.cWidth,a.duration),be()}),vue.watch(()=>a.globalZoomMult,()=>{vue.nextTick(()=>{var p;(p=s.value)==null||p.throttledDataRender()})}),vue.watch(n,p=>{p&&(V(p),!_.value&&!["annResize-left","annResize-right","annSelect"].includes(z.value)&&(z.value=p))},{immediate:!0}),vue.watch(r,p=>{p.length>0&&n.value==="annotate"&&A()},{immediate:!0}),vue.watch(z,()=>{const p=R.value;if(p){switch(p.removeAttribute("col_resize"),p.removeAttribute("active"),p.removeAttribute("point"),z.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(()=>{qe()})}});const U=()=>{var p;(p=m.value)==null||p.resetFocusedAnnotation()},ne=p=>{var w;(w=m.value)==null||w.createAnnotationLayer(p)},B=()=>{var O;let p=(a.cursorLoc*a.cWidth-a.constants.CURSOROFFSET)*y.value;return((O=m.value)==null?void 0:O.findNextAnnotation(a.start+p)).start-p},re=()=>{var O;let p=(a.cursorLoc*a.cWidth-a.constants.CURSOROFFSET)*y.value;return((O=m.value)==null?void 0:O.findPreviousAnnotation(a.start+p)).start-p},ue=p=>{i("updateAnnotation",p)},se=()=>{i("closeAnnotationLayerWindow")},ce=()=>{be(100)},ve=()=>{n.value==="annotate"&&A(),i("annLayersInitialized")},Re=p=>{i("setGlobalZoom",p)},_e=()=>{i("channelsInitialized")},fe=p=>{p.stopPropagation(),p.preventDefault(),p.shiftKey?Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setDuration",a.duration*1.1):i("setDuration",a.duration/1.1)):Math.abs(p.deltaY)>Math.abs(p.deltaX)&&(p.deltaY>0?i("setGlobalZoom",a.globalZoomMult*1.2):i("setGlobalZoom",a.globalZoomMult/1.2))},de=p=>{var w,O;switch(N.value=!1,_.value=!1,z.value){case"pointer":ge();const F=p.metaKey,I=p.clientY-R.value.getBoundingClientRect().top,X=$.y-R.value.getBoundingClientRect().top,Y=t.value.map(ie=>(F===!1&&(ie.selected=!1),(ie.rowBaseline>X&&ie.rowBaseline<I||ie.rowBaseline<X&&ie.rowBaseline>I)&&(ie.selected=!0),ie));e.setChannels(Y),be();break;case"annSelect":ge(),(w=m.value)==null||w.selectFocusedAnn();break;case"annotate":A();let Q=null,J=null;for(let ie=0;ie<r.value.length;ie++)if(r.value[ie].selected){Q=ie,J=r.value[ie];break}if(Q===null||!J||!J.id)if(r.value.length>0&&r.value[0].id)e.setActiveAnnotationLayer(r.value[0].id),J=r.value[0],Q=0;else return;const K=d.value,te=K.length===t.value.length||K.length===0;let ee=(p.clientX-$.x)*y.value,le=D.value+($.x-R.value.getBoundingClientRect().left)*y.value;if(ee<0&&(le=le+ee,ee=-ee),ee>1e3){const ie={name:"",id:null,label:L.value[b.value],description:"",start:le,duration:ee,end:le+ee,cStart:null,cEnd:null,selected:!0,channelIds:K.map(Ne=>Ne.id),allChannels:te,layer_id:J.id,userId:null};e.setActiveAnnotation(ie),i("addAnnotation",le,ee,te,ie.label,ie.description,J);break}break;case"annResize-left":case"annResize-right":(O=m.value)==null||O.onMouseUp();break}},ge=()=>{R.value.getContext("2d").clearRect(0,0,a.cWidth,a.cHeight)},he=p=>{var O;_.value=!0,D.value=a.start;const w=R.value.getBoundingClientRect();switch($.x=p.clientX,$.y=p.clientY,n.value==="annotate"&&!["annResize-left","annResize-right","annSelect"].includes(z.value)&&(z.value="annotate"),z.value){case"annResize-left":case"annResize-right":N.value=!0,(O=m.value)==null||O.onMouseDown(p.clientX-w.left,p.clientY-w.top);break}},xe=()=>{_.value=!1},pe=p=>{p.buttons===1?_.value=!0:_.value=!1},Se=p=>{var I,X,Y,Q;p.preventDefault(),p.stopPropagation();const w=R.value.getBoundingClientRect(),O=p.clientY-w.top,F=p.clientX-w.left;switch(n.value){case"pan":if(_.value){const J=D.value-(p.clientX-$.x)*y.value;i("setStart",J)}else{const J=(I=m.value)==null?void 0:I.onMouseMove(F,O,z.value,_.value);z.value=J||"pan"}break;case"pointer":if(_.value)we(p.clientX,p.clientY);else{const J=(X=m.value)==null?void 0:X.onMouseMove(F,O,z.value,_.value);z.value=J||"pointer"}break;case"annotate":if(_.value&&z.value==="annotate")ke(p.clientX);else if(_.value&&["annResize-left","annResize-right"].includes(z.value)){const J=(Y=m.value)==null?void 0:Y.onMouseMove(F,O,z.value,_.value);z.value=J||z.value,be()}else{const J=(Q=m.value)==null?void 0:Q.onMouseMove(F,O,z.value,_.value);J?z.value=J:z.value="annotate"}break}},Oe=()=>{Te(a.cWidth,a.duration),be(25)},Te=(p,w)=>{const O=y.value,F=w/p;F!==O&&(S.value=Date.now(),y.value=F,g.value=Math.floor(w/a.constants.PAGESIZEDIVIDER))},oe=(p,w,O)=>w*(p+O),be=(p=0,w=!0)=>{(!q.value||p!==E.value||T.value!==w)&&(q.value=me(Ae,p,{leading:w}),E.value=p,T.value=w),q.value()},me=(p,w,O={})=>{let F,I,X,Y=null,Q=0;const J=function(){Q=O.leading===!1?0:Date.now(),Y=null,X=p.apply(F,I),Y||(F=I=null)};return function(){const K=Date.now();!Q&&O.leading===!1&&(Q=K);const te=w-(K-Q);return F=this,I=arguments,te<=0||te>w?(Y&&(clearTimeout(Y),Y=null),Q=K,X=p.apply(F,I),Y||(F=I=null)):!Y&&O.trailing!==!1&&(Y=setTimeout(J,te)),X}},qe=()=>{var p;ge(),(p=m.value)==null||p.render()},Ae=()=>{vue.nextTick(()=>{var p,w;ye(),Ee(),(p=s.value)==null||p.renderAll(),(w=m.value)==null||w.render()})},ye=()=>{const w=u.value.getContext("2d");w.setTransform(k.value,0,0,k.value,0,0),w.clearRect(0,0,a.cWidth,a.cHeight),w.stroke(),w.beginPath(),w.lineWidth=1,w.moveTo(a.constants.XOFFSET+.5,.5),w.lineTo(a.constants.XOFFSET+.5,M.value+.5),w.lineTo(a.cWidth+.5,M.value+.5),w.stroke();let O=M.value/(2*W.value)+.5<<1>>1;w.lineWidth=.5;for(let Q=0;Q<W.value;Q++)w.beginPath(),w.moveTo(a.constants.XOFFSET-2,O),w.lineTo(a.constants.XOFFSET+2,O),w.stroke(),O+=M.value/W.value;const F=a.constants.XGRIDSPACING*Math.ceil(a.duration/1e8),I=Math.ceil(a.duration/F)+1,X=Math.ceil(a.constants.NRPXPERLABEL/(F/y.value)),Y=(F-a.start%F)%F;for(let Q=0;Q<I;Q++){let J=a.start+Y+Q*F;if(J>a.tsEnd)break;const K=J-a.start,te=a.constants.XOFFSET+K/y.value,ee=Math.round(te);if(ee>1&&(w.save(),w.beginPath(),w.lineWidth=.5,w.strokeStyle="rgb(235,235,235)",w.moveTo(ee+.5,.5),w.lineTo(ee+.5,M.value-.5),w.stroke(),w.restore(),((J/F+F/10)%X|0)===1||X===1)){w.beginPath(),w.lineWidth=1,w.moveTo(ee+.5,M.value-3),w.lineTo(ee+.5,M.value+3),w.stroke();const ie=new Date(J/1e3);w.font="12px sans-serif",w.fillStyle="rgb(150,150,150)",w.fillText(P(ie),ee-20.5,a.cHeight-.2)}}},we=(p,w)=>{const O=R.value,F=O.getContext("2d");F.setTransform(k.value,0,0,k.value,0,0),F.clearRect(0,0,a.cWidth,a.cHeight),F.beginPath(),F.lineWidth=2,F.strokeStyle="#295eff",F.setLineDash([5,5,15,5]);const I=p-O.getBoundingClientRect().left,X=w-O.getBoundingClientRect().top;F.rect(I,X,-p+$.x,-w+$.y),F.stroke()},Ee=()=>{const w=h.value.getContext("2d");w.setTransform(k.value,0,0,k.value,0,0),w.clearRect(0,0,a.cWidth+a.constants.CURSOROFFSET,a.cHeight),w.save(),w.beginPath(),w.fillStyle="red";const O=a.cursorLoc*a.cWidth;O>a.constants.CURSOROFFSET?(w.strokeStyle="red",w.moveTo(O,0),w.lineTo(O,M.value),w.stroke()):w.moveTo(O,M.value),w.beginPath(),w.lineTo(O-5,M.value+8),w.lineTo(O+5,M.value+8),w.lineTo(O,M.value),w.fill(),w.restore()},ke=p=>{const w=R.value,O=w.getContext("2d");O.setTransform(k.value,0,0,k.value,0,0);const F=a.constants.ANNOTATIONLABELHEIGHT,I=F/2|0;let X=null;for(let te=0;te<r.value.length;te++)if(r.value[te].selected){X=te;break}if(X===null)return;O.save(),O.clearRect(0,0,a.cWidth,a.cHeight),O.lineWidth=1;const Y=d.value,Q=Y.length===t.value.length||Y.length===0,J=p-w.getBoundingClientRect().left,K=-p+$.x;if(Q){O.fillStyle="rgba(0,0,0,0.1)",O.fillRect(J,0,K,M.value),O.fillStyle=r.value[X].color,O.strokeStyle=O.fillStyle;let te=J-1,ee=K+2;K<0&&(te=J+1,ee=K-2),O.fillRect(te,0,ee,F),O.setLineDash([5,5,5,5]),O.beginPath(),O.moveTo(J,F),O.lineTo(J,M.value),O.stroke(),O.beginPath(),O.moveTo(J+K,F),O.lineTo(J+K,M.value),O.stroke()}else{let te=a.cHeight|0,ee=0;const le=t.value;O.fillStyle=r.value[X].color,O.strokeStyle=O.fillStyle;let ie=J-1,Ne=K+2;K<0&&(ie=J+1,Ne=K-2);for(let Ie=0;Ie<le.length;Ie++){const Fe=le[Ie];if(Fe.selected&&Fe.visible){const Pe=Fe.rowBaseline|0;Pe<te&&(te=Pe),Pe>ee&&(ee=Pe),O.fillRect(ie,Pe-I,Ne,F)}}O.fillStyle="rgba(0,0,0,0.1)",O.setLineDash([5,5,5,5]),O.fillRect(J-1,te+I,K+2,ee-te-F),O.beginPath(),O.moveTo(J,te+I),O.lineTo(J,ee-I),O.moveTo(J+K,te+I),O.lineTo(J+K,ee-I),O.stroke()}O.restore()},Ce=()=>{var p;(p=s.value)==null||p.initPlotCanvas()},ae=()=>{let p=R.value.getContext("2d"),w=window.devicePixelRatio||1,O=p.webkitBackingStorePixelRatio||p.mozBackingStorePixelRatio||p.msBackingStorePixelRatio||p.oBackingStorePixelRatio||p.backingStorePixelRatio||1;return w/O},P=p=>("0"+p.getUTCHours()).slice(-2)+":"+("0"+p.getUTCMinutes()).slice(-2)+":"+("0"+p.getUTCSeconds()).slice(-2),C=p=>{var I,X;let w=parseFloat(p.input0),O=parseFloat(p.input1),F={};switch(p.filterType){case"clear":F={channelFiltersToClear:p.selChannels};break;case"bandpass":let Y=(w+O)/2,Q=Math.abs((O-w)/2);F={filter:p.filterType,filterParameters:[4,Y,Q],channels:p.selChannels};break;case"highpass":F={filter:p.filterType,filterParameters:[4,w],channels:p.selChannels};break;case"lowpass":F={filter:p.filterType,filterParameters:[4,w],channels:p.selChannels};break;case"bandstop":let J=10;const K=p.notchFreq;F={filter:p.filterType,filterParameters:[4,K,J],channels:p.selChannels};break;default:return}(I=s.value)==null||I.sendFilterMessage(F);for(let Y=0;Y<p.selChannels.length;Y++){let Q=p.selChannels[Y],J=find(index.propEq("id",Q),t.value);p.filterType==="clear"?J.filter={}:J.filter={type:p.filterType,input0:w,input1:O,notchFreq:p.notchFreq}}(X=s.value)==null||X.invalidate(),be()};return vue.onMounted(()=>{k.value=ae()}),c({rsPeriod:y,resetFocusedAnnotation:U,createAnnotationLayer:ne,getNextAnnotation:B,getPreviousAnnotation:re,setFilters:C,setActiveTool:V,renderAll:be,renderAnnotationCanvas:qe,initViewerCanvas:Ce}),(p,w)=>(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":y.value,"global-zoom-mult":f.globalZoomMult,"active-viewer":f.activeViewer,onChannelsInitialized:_e,onSetGlobalZoom:Re},{axisCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"axisArea",ref_key:"axisArea",ref:u,class:"canvas",width:oe(f.cWidth,k.value,0),height:oe(f.cHeight,k.value,0),style:vue.normalizeStyle(G.value)},null,12,_hoisted_3)]),annCanvas:vue.withCtx(()=>[vue.createElementVNode("canvas",{id:"annArea",ref_key:"annArea",ref:o,class:"canvas",width:oe(f.cWidth,k.value,0),height:oe(M.value,k.value,0),style:vue.normalizeStyle(j.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:oe(f.cWidth+5,k.value,0),height:oe(f.cHeight,k.value,0),style:vue.normalizeStyle(Z.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":o.value,"pixel-ratio":k.value,"rs-period":y.value,start:f.start,duration:f.duration,"ts-end":f.tsEnd,"pointer-mode":z.value,"viewer-active-tool":vue.unref(n),"active-viewer":f.activeViewer,onAnnLayersInitialized:ve,onAnnotationsReceived:ce,onCloseAnnotationLayerWindow:se,onUpdateAnnotation:ue},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:oe(f.cWidth,k.value,0),height:oe(f.cHeight,k.value,0),style:vue.normalizeStyle(G.value),tabindex:"-1",onWheel:fe,onMousemove:Se,onMousedown:he,onMouseup:de,onMouseout:xe,onMouseenter:pe},null,44,_hoisted_6)])]))}},TSViewerCanvas=index._export_sfc(_sfc_main,[["__scopeId","data-v-12d19814"]]),TSViewerCanvas$1=Object.freeze(Object.defineProperty({__proto__:null,default:TSViewerCanvas},Symbol.toStringTag,{value:"Module"}));exports.TSViewerCanvas=TSViewerCanvas$1;exports.find=find;exports.head=head;
|