import{s as safe_not_equal,e as empty,i as insert_hydration,d as detach,A as compute_rest_props,B as setContext,C as assign,D as exclude_internal_props,r as create_slot,f as element,g as claim_element,h as children,E as set_dynamic_element_data,F as action_destroyer,G as listen,u as update_slot_base,v as get_all_dirty_from_scope,w as get_slot_changes,H as is_function,I as add_render_callback,J as run_all,K as bubble,p as binding_callbacks,L as identity,M as getContext,a as space,c as claim_space,N as set_attributes,x as append_hydration,l as text,m as claim_text,j as attr,n as set_data,O as svg_element,P as claim_svg_element,Q as compute_slots,R as createEventDispatcher,S as add_flush_callback,y as noop$1,z as component_subscribe,k as set_style,T as destroy_each,o as onMount}from"../chunks/scheduler.c252431e.js";import{S as SvelteComponent,i as init,a as transition_in,g as group_outros,t as transition_out,c as check_outros,f as create_bidirectional_transition,b as create_component,d as claim_component,m as mount_component,e as destroy_component,h as bind,n as now,l as loop}from"../chunks/index.055e1bc1.js";import{w as writable}from"../chunks/index.0dba420f.js";function ensure_array_like(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function get_spread_update(t,e){const r={},o={},n={$$scope:1};let i=t.length;for(;i--;){const a=t[i],s=e[i];if(s){for(const l in a)l in s||(o[l]=1);for(const l in s)n[l]||(r[l]=s[l],n[l]=1);t[i]=s}else for(const l in a)n[l]=1}for(const a in o)a in r||(r[a]=void 0);return r}function get_spread_object(t){return typeof t=="object"&&t!==null?t:{}}const prerender=!1,ssr=!1,_page=Object.freeze(Object.defineProperty({__proto__:null,prerender,ssr},Symbol.toStringTag,{value:"Module"})),bluetoothState=writable("DISCONNECTED"),raceFullState=writable(),settings=writable();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},indexLight={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=t;function t(e,r){for(var o=new Array(arguments.length-1),n=0,i=2,a=!0;i1&&s.charAt(l)==="=";)++u;return Math.ceil(s.length*3)/4-u};for(var r=new Array(64),o=new Array(123),n=0;n<64;)o[r[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;e.encode=function(s,l,u){for(var h=null,c=[],d=0,f=0,m;l>2],m=(p&3)<<4,f=1;break;case 1:c[d++]=r[m|p>>4],m=(p&15)<<2,f=2;break;case 2:c[d++]=r[m|p>>6],c[d++]=r[p&63],f=0;break}d>8191&&((h||(h=[])).push(String.fromCharCode.apply(String,c)),d=0)}return f&&(c[d++]=r[m],c[d++]=61,f===1&&(c[d++]=61)),h?(d&&h.push(String.fromCharCode.apply(String,c.slice(0,d))),h.join("")):String.fromCharCode.apply(String,c.slice(0,d))};var i="invalid encoding";e.decode=function(s,l,u){for(var h=u,c=0,d,f=0;f1)break;if((m=o[m])===void 0)throw Error(i);switch(c){case 0:d=m,c=1;break;case 1:l[u++]=d<<2|(m&48)>>4,d=m,c=2;break;case 2:l[u++]=(d&15)<<4|(m&60)>>2,d=m,c=3;break;case 3:l[u++]=(d&3)<<6|m,c=0;break}}if(c===1)throw Error(i);return u-h},e.test=function(s){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s)}}(base64$1)),base64$1}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=t;function t(){this._listeners={}}return t.prototype.on=function(r,o,n){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:o,ctx:n||this}),this},t.prototype.off=function(r,o){if(r===void 0)this._listeners={};else if(o===void 0)this._listeners[r]=[];else for(var n=this._listeners[r],i=0;i0?0:2147483648,h,c);else if(isNaN(u))l(2143289344,h,c);else if(u>34028234663852886e22)l((d<<31|2139095040)>>>0,h,c);else if(u<11754943508222875e-54)l((d<<31|Math.round(u/1401298464324817e-60))>>>0,h,c);else{var f=Math.floor(Math.log(u)/Math.LN2),m=Math.round(u*Math.pow(2,-f)*8388608)&8388607;l((d<<31|f+127<<23|m)>>>0,h,c)}}i.writeFloatLE=a.bind(null,e),i.writeFloatBE=a.bind(null,r);function s(l,u,h){var c=l(u,h),d=(c>>31)*2+1,f=c>>>23&255,m=c&8388607;return f===255?m?NaN:d*(1/0):f===0?d*1401298464324817e-60*m:d*Math.pow(2,f-150)*(m+8388608)}i.readFloatLE=s.bind(null,o),i.readFloatBE=s.bind(null,n)}(),typeof Float64Array<"u"?function(){var a=new Float64Array([-0]),s=new Uint8Array(a.buffer),l=s[7]===128;function u(f,m,p){a[0]=f,m[p]=s[0],m[p+1]=s[1],m[p+2]=s[2],m[p+3]=s[3],m[p+4]=s[4],m[p+5]=s[5],m[p+6]=s[6],m[p+7]=s[7]}function h(f,m,p){a[0]=f,m[p]=s[7],m[p+1]=s[6],m[p+2]=s[5],m[p+3]=s[4],m[p+4]=s[3],m[p+5]=s[2],m[p+6]=s[1],m[p+7]=s[0]}i.writeDoubleLE=l?u:h,i.writeDoubleBE=l?h:u;function c(f,m){return s[0]=f[m],s[1]=f[m+1],s[2]=f[m+2],s[3]=f[m+3],s[4]=f[m+4],s[5]=f[m+5],s[6]=f[m+6],s[7]=f[m+7],a[0]}function d(f,m){return s[7]=f[m],s[6]=f[m+1],s[5]=f[m+2],s[4]=f[m+3],s[3]=f[m+4],s[2]=f[m+5],s[1]=f[m+6],s[0]=f[m+7],a[0]}i.readDoubleLE=l?c:d,i.readDoubleBE=l?d:c}():function(){function a(l,u,h,c,d,f){var m=c<0?1:0;if(m&&(c=-c),c===0)l(0,d,f+u),l(1/c>0?0:2147483648,d,f+h);else if(isNaN(c))l(0,d,f+u),l(2146959360,d,f+h);else if(c>17976931348623157e292)l(0,d,f+u),l((m<<31|2146435072)>>>0,d,f+h);else{var p;if(c<22250738585072014e-324)p=c/5e-324,l(p>>>0,d,f+u),l((m<<31|p/4294967296)>>>0,d,f+h);else{var y=Math.floor(Math.log(c)/Math.LN2);y===1024&&(y=1023),p=c*Math.pow(2,-y),l(p*4503599627370496>>>0,d,f+u),l((m<<31|y+1023<<20|p*1048576&1048575)>>>0,d,f+h)}}}i.writeDoubleLE=a.bind(null,e,0,4),i.writeDoubleBE=a.bind(null,r,4,0);function s(l,u,h,c,d){var f=l(c,d+u),m=l(c,d+h),p=(m>>31)*2+1,y=m>>>20&2047,v=4294967296*(m&1048575)+f;return y===2047?v?NaN:p*(1/0):y===0?p*5e-324*v:p*Math.pow(2,y-1075)*(v+4503599627370496)}i.readDoubleLE=s.bind(null,o,0,4),i.readDoubleBE=s.bind(null,n,4,0)}(),i}function e(i,a,s){a[s]=i&255,a[s+1]=i>>>8&255,a[s+2]=i>>>16&255,a[s+3]=i>>>24}function r(i,a,s){a[s]=i>>>24,a[s+1]=i>>>16&255,a[s+2]=i>>>8&255,a[s+3]=i&255}function o(i,a){return(i[a]|i[a+1]<<8|i[a+2]<<16|i[a+3]<<24)>>>0}function n(i,a){return(i[a]<<24|i[a+1]<<16|i[a+2]<<8|i[a+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(t){}return null}return inquire_1}var utf8$2={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(t){var e=t;e.length=function(o){for(var n=0,i=0,a=0;a191&&h<224?l[u++]=(h&31)<<6|o[n++]&63:h>239&&h<365?(h=((h&7)<<18|(o[n++]&63)<<12|(o[n++]&63)<<6|o[n++]&63)-65536,l[u++]=55296+(h>>10),l[u++]=56320+(h&1023)):l[u++]=(h&15)<<12|(o[n++]&63)<<6|o[n++]&63,u>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,l)),u=0);return s?(u&&s.push(String.fromCharCode.apply(String,l.slice(0,u))),s.join("")):String.fromCharCode.apply(String,l.slice(0,u))},e.write=function(o,n,i){for(var a=i,s,l,u=0;u>6|192,n[i++]=s&63|128):(s&64512)===55296&&((l=o.charCodeAt(u+1))&64512)===56320?(s=65536+((s&1023)<<10)+(l&1023),++u,n[i++]=s>>18|240,n[i++]=s>>12&63|128,n[i++]=s>>6&63|128,n[i++]=s&63|128):(n[i++]=s>>12|224,n[i++]=s>>6&63|128,n[i++]=s&63|128);return i-a}}(utf8$2)),utf8$2}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=t;function t(e,r,o){var n=o||8192,i=n>>>1,a=null,s=n;return function(u){if(u<1||u>i)return e(u);s+u>n&&(a=e(n),s=0);var h=r.call(a,s,s+=u);return s&7&&(s=(s|7)+1),h}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=e;var t=requireMinimal();function e(i,a){this.lo=i>>>0,this.hi=a>>>0}var r=e.zero=new e(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var o=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(a){if(a===0)return r;var s=a<0;s&&(a=-a);var l=a>>>0,u=(a-l)/4294967296>>>0;return s&&(u=~u>>>0,l=~l>>>0,++l>4294967295&&(l=0,++u>4294967295&&(u=0))),new e(l,u)},e.from=function(a){if(typeof a=="number")return e.fromNumber(a);if(t.isString(a))if(t.Long)a=t.Long.fromString(a);else return e.fromNumber(parseInt(a,10));return a.low||a.high?new e(a.low>>>0,a.high>>>0):r},e.prototype.toNumber=function(a){if(!a&&this.hi>>>31){var s=~this.lo+1>>>0,l=~this.hi>>>0;return s||(l=l+1>>>0),-(s+l*4294967296)}return this.lo+this.hi*4294967296},e.prototype.toLong=function(a){return t.Long?new t.Long(this.lo|0,this.hi|0,!!a):{low:this.lo|0,high:this.hi|0,unsigned:!!a}};var n=String.prototype.charCodeAt;return e.fromHash=function(a){return a===o?r:new e((n.call(a,0)|n.call(a,1)<<8|n.call(a,2)<<16|n.call(a,3)<<24)>>>0,(n.call(a,4)|n.call(a,5)<<8|n.call(a,6)<<16|n.call(a,7)<<24)>>>0)},e.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)},e.prototype.zzEncode=function(){var a=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^a)>>>0,this.lo=(this.lo<<1^a)>>>0,this},e.prototype.zzDecode=function(){var a=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^a)>>>0,this.hi=(this.hi>>>1^a)>>>0,this},e.prototype.length=function(){var a=this.lo,s=(this.lo>>>28|this.hi<<4)>>>0,l=this.hi>>>24;return l===0?s===0?a<16384?a<128?1:2:a<2097152?3:4:s<16384?s<128?5:6:s<2097152?7:8:l<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(t){var e=t;e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i},e.isString=function(i){return typeof i=="string"||i instanceof String},e.isObject=function(i){return i&&typeof i=="object"},e.isset=e.isSet=function(i,a){var s=i[a];return s!=null&&i.hasOwnProperty(a)?typeof s!="object"||(Array.isArray(s)?s.length:Object.keys(s).length)>0:!1},e.Buffer=function(){try{var n=e.inquire("buffer").Buffer;return n.prototype.utf8Write?n:null}catch{return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(i){return typeof i=="number"?e.Buffer?e._Buffer_allocUnsafe(i):new e.Array(i):e.Buffer?e._Buffer_from(i):typeof Uint8Array>"u"?i:new Uint8Array(i)},e.Array=typeof Uint8Array<"u"?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(i){return i?e.LongBits.from(i).toHash():e.LongBits.zeroHash},e.longFromHash=function(i,a){var s=e.LongBits.fromHash(i);return e.Long?e.Long.fromBits(s.lo,s.hi,a):s.toNumber(!!a)};function r(n,i,a){for(var s=Object.keys(i),l=0;l-1;--u)if(a[l[u]]===1&&this[l[u]]!==void 0&&this[l[u]]!==null)return l[u]}},e.oneOfSetter=function(i){return function(a){for(var s=0;s127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function VarintOp(t,e){this.len=t,this.next=void 0,this.val=e}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function t(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};Writer$1.prototype.int32=function t(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)};Writer$1.prototype.sint32=function t(e){return this.uint32((e<<1^e>>31)>>>0)};function writeVarint64(t,e,r){for(;t.hi;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}Writer$1.prototype.uint64=function t(e){var r=LongBits$1.from(e);return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function t(e){var r=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.bool=function t(e){return this._push(writeByte,1,e?1:0)};function writeFixed32(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}Writer$1.prototype.fixed32=function t(e){return this._push(writeFixed32,4,e>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function t(e){var r=LongBits$1.from(e);return this._push(writeFixed32,4,r.lo)._push(writeFixed32,4,r.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function t(e){return this._push(util$7.float.writeFloatLE,4,e)};Writer$1.prototype.double=function t(e){return this._push(util$7.float.writeDoubleLE,8,e)};var writeBytes=util$7.Array.prototype.set?function t(e,r,o){r.set(e,o)}:function t(e,r,o){for(var n=0;n>>0;if(!r)return this._push(writeByte,1,0);if(util$7.isString(e)){var o=Writer$1.alloc(r=base64.length(e));base64.decode(e,o,0),e=o}return this.uint32(r)._push(writeBytes,r,e)};Writer$1.prototype.string=function t(e){var r=utf8$1.length(e);return r?this.uint32(r)._push(utf8$1.write,r,e):this._push(writeByte,1,0)};Writer$1.prototype.fork=function t(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function t(){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 Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function t(){var e=this.head,r=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=r,this.len+=o),this};Writer$1.prototype.finish=function t(){for(var e=this.head.next,r=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,r,o),o+=e.len,e=e.next;return r};Writer$1._configure=function(t){BufferWriter$1=t,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(e,r,o){r.set(e,o)}:function(e,r,o){if(e.copy)e.copy(r,o,0,e.length);else for(var n=0;n>>0;return this.uint32(r),r&&this._push(BufferWriter.writeBytesBuffer,r,e),this};function writeStringBuffer(t,e,r){t.length<40?util$6.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}BufferWriter.prototype.string=function t(e){var r=util$6.Buffer.byteLength(e);return this.uint32(r),r&&this._push(writeStringBuffer,r,e),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Reader$1(t){this.buf=t,this.pos=0,this.len=t.length}var create_array=typeof Uint8Array<"u"?function t(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader$1(e);throw Error("illegal buffer")}:function t(e){if(Array.isArray(e))return new Reader$1(e);throw Error("illegal buffer")},create=function t(){return util$5.Buffer?function(r){return(Reader$1.create=function(n){return util$5.Buffer.isBuffer(n)?new BufferReader$1(n):create_array(n)})(r)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function t(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return e}}();Reader$1.prototype.int32=function t(){return this.uint32()|0};Reader$1.prototype.sint32=function t(){var e=this.uint32();return e>>>1^-(e&1)|0};function readLongVarint(){var t=new LongBits(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function t(){return this.uint32()!==0};function readFixed32_end(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Reader$1.prototype.fixed32=function t(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function t(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function t(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Reader$1.prototype.double=function t(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Reader$1.prototype.bytes=function t(){var e=this.uint32(),r=this.pos,o=this.pos+e;if(o>this.len)throw indexOutOfRange(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,o);if(r===o){var n=util$5.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,o)};Reader$1.prototype.string=function t(){var e=this.bytes();return utf8.read(e,0,e.length)};Reader$1.prototype.skip=function t(e){if(typeof e=="number"){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Reader$1._configure=function(t){BufferReader$1=t,Reader$1.create=create(),BufferReader$1._configure();var e=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[e](!1)},uint64:function(){return readLongVarint.call(this)[e](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[e](!1)},fixed64:function(){return readFixed64.call(this)[e](!0)},sfixed64:function(){return readFixed64.call(this)[e](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(t){Reader.call(this,t)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function t(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}Service$1.prototype.rpcCall=function t(e,r,o,n,i){if(!n)throw TypeError("request must be specified");var a=this;if(!i)return util$3.asPromise(t,a,e,r,o,n);if(!a.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return a.rpcImpl(e,r[a.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(l,u){if(l)return a.emit("error",l,e),i(l);if(u===null){a.end(!0);return}if(!(u instanceof o))try{u=o[a.responseDelimited?"decodeDelimited":"decode"](u)}catch(h){return a.emit("error",h,e),i(h)}return a.emit("data",u,e),i(null,u)})}catch(s){a.emit("error",s,e),setTimeout(function(){i(s)},0);return}};Service$1.prototype.end=function t(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(t){var e=t;e.Service=service$1})(rpc);var roots={};(function(t){var e=t;e.build="minimal",e.Writer=writer,e.BufferWriter=writer_buffer,e.Reader=reader,e.BufferReader=reader_buffer,e.util=requireMinimal(),e.rpc=rpc,e.roots=roots,e.configure=r;function r(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}r()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function o(i){if(typeof i!="string"){var a=n();if(codegen.verbose&&console.log("codegen: "+a),a="return "+a,i){for(var s=Object.keys(i),l=new Array(s.length+1),u=new Array(s.length),h=0;h0&&a[u-1]!==".."?a.splice(--u,2):s?a.splice(u,1):++u:a[u]==="."?a.splice(u,1):++u;return l+a.join("/")};e.resolve=function(i,a,s){return s||(a=o(a)),r(a)?a:(s||(i=o(i)),(i=i.replace(/(?:\/|^)[^/]+$/,"")).length?o(i+"/"+a):a)}})(path);var types$1={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(t){var e=t,r=requireUtil(),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(i,a){var s=0,l={};for(a|=0;s-1&&this.oneof.splice(s,1),a.partOf=null,this},o.prototype.onAdd=function(a){t.prototype.onAdd.call(this,a);for(var s=this,l=0;ld)return!0}return!1},l.isReservedName=function(c,d){if(c){for(var f=0;f0;){var m=c.shift();if(f.nested&&f.nested[m]){if(f=f.nested[m],!(f instanceof l))throw Error("path conflicts with non-namespace objects")}else f.add(f=new l(m))}return d&&f.addJSON(d),f},l.prototype.resolveAll=function(){for(var c=this.nestedArray,d=0;d-1)return m}else if(m instanceof l&&(m=m.lookup(c.slice(1),d,!0)))return m}else for(var p=0;p>>3){");for(var s=0;s>>3){")("case 1: k=r.%s(); break",l.keyType)("case 2:"),e.basic[u]===void 0?a("value=types[%i].decode(r,r.uint32())",s):a("value=r.%s()",u),a("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),e.long[l.keyType]!==void 0?a('%s[typeof k==="object"?util.longToHash(k):k]=value',h):a("%s[k]=value",h)):l.repeated?(a("if(!(%s&&%s.length))",h,h)("%s=[]",h),e.packed[u]!==void 0&&a("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",u,u);break;case"int32":case"sint32":case"sfixed32":a("m%s=d%s|0",u,u);break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":a("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",u,u,m)('else if(typeof d%s==="string")',u)("m%s=parseInt(d%s,10)",u,u)('else if(typeof d%s==="number")',u)("m%s=d%s",u,u)('else if(typeof d%s==="object")',u)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",u,u,u,m?"true":"");break;case"bytes":a('if(typeof d%s==="string")',u)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",u,u,u)("else if(d%s.length >= 0)",u)("m%s=d%s",u,u);break;case"string":a("m%s=String(d%s)",u,u);break;case"bool":a("m%s=Boolean(d%s)",u,u);break}}return a}e.fromObject=function(s){var l=s.fieldsArray,u=o.codegen(["d"],s.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!l.length)return u("return new this.ctor");u("var m=new this.ctor");for(var h=0;h>>0,m%s.high>>>0).toNumber(%s):m%s",u,u,u,u,h?"true":"",u);break;case"bytes":a("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",u,u,u,u,u);break;default:a("d%s=m%s",u,u);break}}return a}e.toObject=function(s){var l=s.fieldsArray.slice().sort(o.compareFieldsById);if(!l.length)return o.codegen()("return {}");for(var u=o.codegen(["m","o"],s.name+"$toObject")("if(!o)")("o={}")("var d={}"),h=[],c=[],d=[],f=0;f-1){var M=I.substring(L);if(M in s)return M}return null}function b(I,L){try{if(n.isString(L)&&L.charAt(0)==="{"&&(L=JSON.parse(L)),!n.isString(L))y.setOptions(L.options).addJSON(L.nested);else{a.filename=I;var M=a(L,y,m),N,U=0;if(M.imports)for(;U-1)){if(y.files.push(I),I in s){v?b(I,s[I]):(++k,setTimeout(function(){--k,b(I,s[I])}));return}if(v){var M;try{M=n.fs.readFileSync(I).toString("utf8")}catch(N){L||g(N);return}b(I,M)}else++k,y.fetch(I,function(N,U){if(--k,!!p){if(N){L?k||g(null,y):g(N);return}b(I,U)}})}}var k=0;n.isString(f)&&(f=[f]);for(var x=0,D;x-1&&this.deferred.splice(m,1)}}else if(f instanceof r)h.test(f.name)&&delete f.parent[f.name];else if(f instanceof t){for(var p=0;p0)f[y]=d(f[y]||{},m,p);else{var v=f[y];v&&(p=[].concat(v).concat(p)),f[y]=p}return f}if(typeof u!="object")throw TypeError("dst must be an object");if(!h)throw TypeError("path must be specified");return h=h.split("."),d(u,h,c)},Object.defineProperty(t,"decorateRoot",{get:function(){return e.decorated||(e.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=r,r.className="ReflectionObject";var t=requireUtil(),e;function r(o,n){if(!t.isString(o))throw TypeError("name must be a string");if(n&&!t.isObject(n))throw TypeError("options must be an object");this.options=n,this.parsedOptions=null,this.name=o,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(r.prototype,{root:{get:function(){for(var o=this;o.parent!==null;)o=o.parent;return o}},fullName:{get:function(){for(var o=[this.name],n=this.parent;n;)o.unshift(n.name),n=n.parent;return o.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(n){this.parent&&this.parent!==n&&this.parent.remove(this),this.parent=n,this.resolved=!1;var i=n.root;i instanceof e&&i._handleAdd(this)},r.prototype.onRemove=function(n){var i=n.root;i instanceof e&&i._handleRemove(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved?this:(this.root instanceof e&&(this.resolved=!0),this)},r.prototype.getOption=function(n){if(this.options)return this.options[n]},r.prototype.setOption=function(n,i,a){return(!a||!this.options||this.options[n]===void 0)&&((this.options||(this.options={}))[n]=i),this},r.prototype.setParsedOption=function(n,i,a){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(a){var l=s.find(function(c){return Object.prototype.hasOwnProperty.call(c,n)});if(l){var u=l[n];t.setProperty(u,a,i)}else l={},l[n]=t.setProperty({},a,i),s.push(l)}else{var h={};h[n]=i,s.push(h)}return this},r.prototype.setOptions=function(n,i){if(n)for(var a=Object.keys(n),s=0;s>>0,(a.id<<3|4)>>>0):i("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",s,l,(a.id<<3|2)>>>0)}function n(i){for(var a=r.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),s,l,u=i.fieldsArray.slice().sort(r.compareFieldsById),s=0;s>>0,8|e.mapKey[h.keyType],h.keyType),f===void 0?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,l):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,d,l),a("}")("}")):h.repeated?(a("if(%s!=null&&%s.length){",l,l),h.packed&&e.packed[d]!==void 0?a("w.uint32(%i).fork()",(h.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",l)("w.%s(%s[i])",d,l)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",l),f===void 0?o(a,h,c,l+"[i]"):a("w.uint32(%i).%s(%s[i])",(h.id<<3|f)>>>0,d,l)),a("}")):(h.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",l,h.name),f===void 0?o(a,h,c,l):a("w.uint32(%i).%s(%s)",(h.id<<3|f)>>>0,d,l))}return a("return w")}return encoder_1}var protobuf$1=indexLight.exports=indexMinimal;protobuf$1.build="light";function load(t,e,r){return typeof e=="function"?(r=e,e=new protobuf$1.Root):e||(e=new protobuf$1.Root),e.load(t,r)}protobuf$1.load=load;function loadSync(t,e){return e||(e=new protobuf$1.Root),e.loadSync(t)}protobuf$1.loadSync=loadSync;protobuf$1.encoder=requireEncoder();protobuf$1.decoder=requireDecoder();protobuf$1.verifier=requireVerifier();protobuf$1.converter=requireConverter();protobuf$1.ReflectionObject=requireObject();protobuf$1.Namespace=requireNamespace();protobuf$1.Root=requireRoot();protobuf$1.Enum=require_enum();protobuf$1.Type=requireType();protobuf$1.Field=requireField();protobuf$1.OneOf=requireOneof();protobuf$1.MapField=requireMapfield();protobuf$1.Service=requireService();protobuf$1.Method=requireMethod();protobuf$1.Message=message;protobuf$1.wrappers=wrappers;protobuf$1.types=requireTypes();protobuf$1.util=requireUtil();protobuf$1.ReflectionObject._configure(protobuf$1.Root);protobuf$1.Namespace._configure(protobuf$1.Type,protobuf$1.Service,protobuf$1.Enum);protobuf$1.Root._configure(protobuf$1.Type);protobuf$1.Field._configure(protobuf$1.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:` `,t:" "};function unescape(t){return t.replace(unescapeRe,function(e,r){switch(r){case"\\":case"":return r;default:return unescapeMap[r]||""}})}tokenize$1.unescape=unescape;function tokenize$1(t,e){t=t.toString();var r=0,o=t.length,n=1,i=0,a={},s=[],l=null;function u(b){return Error("illegal "+b+" (line "+n+")")}function h(){var b=l==="'"?stringSingleRe:stringDoubleRe;b.lastIndex=r-1;var w=b.exec(t);if(!w)throw u("string");return r=b.lastIndex,y(l),l=null,unescape(w[1])}function c(b){return t.charAt(b)}function d(b,w,k){var x={type:t.charAt(b++),lineEmpty:!1,leading:k},D;e?D=2:D=3;var I=b-D,L;do if(--I<0||(L=t.charAt(I))===` `){x.lineEmpty=!0;break}while(L===" "||L===" ");for(var M=t.substring(b,w).split(setCommentSplitRe),N=0;N0)return s.shift();if(l)return h();var b,w,k,x,D,I=r===0;do{if(r===o)return null;for(b=!1;whitespaceRe.test(k=c(r));)if(k===` `&&(I=!0,++n),++r===o)return null;if(c(r)==="/"){if(++r===o)throw u("comment");if(c(r)==="/")if(e){if(x=r,D=!1,f(r-1)){D=!0;do if(r=m(r),r===o||(r++,!I))break;while(f(r))}else r=Math.min(o,m(r)+1);D&&(d(x,r,I),I=!0),n++,b=!0}else{for(D=c(x=r+1)==="/";c(++r)!==` `;)if(r===o)return null;++r,D&&(d(x,r-1,I),I=!0),++n,b=!0}else if((k=c(r))==="*"){x=r+1,D=e||c(x)==="*";do{if(k===` `&&++n,++r===o)throw u("comment");w=k,k=c(r)}while(w!=="*"||k!=="/");++r,D&&(d(x,r-2,I),I=!0),b=!0}else return"/"}}while(b);var L=r;delimRe.lastIndex=0;var M=delimRe.test(c(L++));if(!M)for(;L");var T=i();if(!nameRe.test(T))throw g(T,"name");l("=");var C=new MapField(v(T),x(i()),O,E);N(C,function(j){if(j==="option")Y(C,j),l(";");else throw g(j)},function(){le(C)}),R.add(C)}function ne(R,O){if(!nameRe.test(O=i()))throw g(O,"name");var E=new OneOf(v(O));N(E,function(C){C==="option"?(Y(E,C),l(";")):(a(C),S(E,"optional"))}),R.add(E)}function oe(R,O){if(!nameRe.test(O=i()))throw g(O,"name");var E=new Enum(O);N(E,function(C){switch(C){case"option":Y(E,C),l(";");break;case"reserved":w(E.reserved||(E.reserved=[]),!0);break;default:$(E,C)}}),R.add(E)}function $(R,O){if(!nameRe.test(O))throw g(O,"name");l("=");var E=x(i(),!0),T={options:void 0};T.setOption=function(C,q){this.options===void 0&&(this.options={}),this.options[C]=q},N(T,function(q){if(q==="option")Y(T,q),l(";");else throw g(q)},function(){le(T)}),R.add(O,E,T.comment,T.options)}function Y(R,O){var E=l("(",!0);if(!typeRefRe.test(O=i()))throw g(O,"name");var T=O,C=T,q;E&&(l(")"),T="("+T+")",C=T,O=s(),fqTypeRefRe.test(O)&&(q=O.slice(1),T+=O,i())),l("=");var j=ee(R,T);G(R,C,j,q)}function ee(R,O){if(l("{",!0)){for(var E={};!l("}",!0);){if(!nameRe.test(H=i()))throw g(H,"name");if(H===null)throw g(H,"end of input");var T,C=H;if(l(":",!0),s()==="{")T=ee(R,O+"."+H);else if(s()==="["){T=[];var q;if(l("[",!0)){do q=b(!0),T.push(q);while(l(",",!0));l("]"),typeof q<"u"&&K(R,O+"."+H,q)}}else T=b(!0),K(R,O+"."+H,T);var j=E[C];j&&(T=[].concat(j).concat(T)),E[C]=T,l(",",!0),l(";",!0)}return E}var Q=b(!0);return K(R,O,Q),Q}function K(R,O,E){R.setOption&&R.setOption(O,E)}function G(R,O,E,T){R.setParsedOption&&R.setParsedOption(O,E,T)}function le(R){if(l("[",!0)){do Y(R,"option");while(l(",",!0));l("]")}return R}function ue(R,O){if(!nameRe.test(O=i()))throw g(O,"service name");var E=new Service(O);N(E,function(C){if(!M(E,C))if(C==="rpc")fe(E,C);else throw g(C)}),R.add(E)}function fe(R,O){var E=u(),T=O;if(!nameRe.test(O=i()))throw g(O,"name");var C=O,q,j,Q,Z;if(l("("),l("stream",!0)&&(j=!0),!typeRefRe.test(O=i())||(q=O,l(")"),l("returns"),l("("),l("stream",!0)&&(Z=!0),!typeRefRe.test(O=i())))throw g(O);Q=O,l(")");var ae=new Method(C,T,q,Q,j,Z);ae.comment=E,N(ae,function(ce){if(ce==="option")Y(ae,ce),l(";");else throw g(ce)}),R.add(ae)}function he(R,O){if(!typeRefRe.test(O=i()))throw g(O,"reference");var E=O;N(null,function(C){switch(C){case"required":case"repeated":S(R,C,E);break;case"optional":p?S(R,"proto3_optional",E):S(R,"optional",E);break;default:if(!p||!typeRefRe.test(C))throw g(C);a(C),S(R,"optional",E);break}})}for(var H;(H=i())!==null;)switch(H){case"package":if(!h)throw g(H);D();break;case"import":if(!h)throw g(H);I();break;case"syntax":if(!h)throw g(H);L();break;case"option":Y(y,H),l(";");break;default:if(M(y,H)){h=!1;continue}throw g(H)}return parse.filename=null,{package:c,imports:d,weakImports:f,syntax:m,root:e}}var common_1=common$1,commonRe=/\/|\./;function common$1(t,e){commonRe.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),common$1[t]=e}common$1("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common$1("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common$1("timestamp",{Timestamp:timeType});common$1("empty",{Empty:{fields:{}}});common$1("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}}}});common$1("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}}}});common$1("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common$1.get=function t(e){return common$1[e]||null};var protobuf=indexLightExports;protobuf.build="full";protobuf.tokenize=tokenize_1;protobuf.parse=parse_1;protobuf.common=common_1;protobuf.Root._configure(protobuf.Type,protobuf.parse,protobuf.common);var minimal=indexMinimal,LaneFullState_State=(t=>(t[t.IDLE=0]="IDLE",t[t.IDLE_FOOT_DOWN=1]="IDLE_FOOT_DOWN",t[t.READY_FOOT_DOWN=2]="READY_FOOT_DOWN",t[t.RUNNING_FOOT_DOWN=3]="RUNNING_FOOT_DOWN",t[t.RUNNING=4]="RUNNING",t[t.FALSE_START=5]="FALSE_START",t[t.FALSE_START_TIE=6]="FALSE_START_TIE",t[t.WILDCARD=7]="WILDCARD",t[t.FINISHED=8]="FINISHED",t[t.FINISHED_WINNER=9]="FINISHED_WINNER",t[t.FINISHED_TIE=10]="FINISHED_TIE",t[t.FALL=11]="FALL",t[t.DISABLED=12]="DISABLED",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED",t))(LaneFullState_State||{});function laneFullState_StateFromJSON(t){switch(t){case 0:case"IDLE":return 0;case 1:case"IDLE_FOOT_DOWN":return 1;case 2:case"READY_FOOT_DOWN":return 2;case 3:case"RUNNING_FOOT_DOWN":return 3;case 4:case"RUNNING":return 4;case 5:case"FALSE_START":return 5;case 6:case"FALSE_START_TIE":return 6;case 7:case"WILDCARD":return 7;case 8:case"FINISHED":return 8;case 9:case"FINISHED_WINNER":return 9;case 10:case"FINISHED_TIE":return 10;case 11:case"FALL":return 11;case 12:case"DISABLED":return 12;case-1:case"UNRECOGNIZED":default:return-1}}function laneFullState_StateToJSON(t){switch(t){case 0:return"IDLE";case 1:return"IDLE_FOOT_DOWN";case 2:return"READY_FOOT_DOWN";case 3:return"RUNNING_FOOT_DOWN";case 4:return"RUNNING";case 5:return"FALSE_START";case 6:return"FALSE_START_TIE";case 7:return"WILDCARD";case 8:return"FINISHED";case 9:return"FINISHED_WINNER";case 10:return"FINISHED_TIE";case 11:return"FALL";case 12:return"DISABLED";case-1:default:return"UNRECOGNIZED"}}var RaceFullState_State=(t=>(t[t.IDLE=0]="IDLE",t[t.IDLE_CLEAR_TO_START=1]="IDLE_CLEAR_TO_START",t[t.STARTING=2]="STARTING",t[t.RUNNING=3]="RUNNING",t[t.FINISHED=4]="FINISHED",t[t.FINISHED_MUTED=5]="FINISHED_MUTED",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED",t))(RaceFullState_State||{});function raceFullState_StateFromJSON(t){switch(t){case 0:case"IDLE":return 0;case 1:case"IDLE_CLEAR_TO_START":return 1;case 2:case"STARTING":return 2;case 3:case"RUNNING":return 3;case 4:case"FINISHED":return 4;case 5:case"FINISHED_MUTED":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function raceFullState_StateToJSON(t){switch(t){case 0:return"IDLE";case 1:return"IDLE_CLEAR_TO_START";case 2:return"STARTING";case 3:return"RUNNING";case 4:return"FINISHED";case 5:return"FINISHED_MUTED";case-1:default:return"UNRECOGNIZED"}}function createBaseLaneFullState(){return{state:0,reactionTime:0,climbingTime:0}}const LaneFullState={encode(t,e=minimal.Writer.create()){return t.state!==0&&e.uint32(8).int32(t.state),t.reactionTime!==0&&e.uint32(16).uint32(t.reactionTime),t.climbingTime!==0&&e.uint32(24).uint32(t.climbingTime),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseLaneFullState();for(;r.pos>>3){case 1:if(i!==8)break;n.state=r.int32();continue;case 2:if(i!==16)break;n.reactionTime=r.uint32();continue;case 3:if(i!==24)break;n.climbingTime=r.uint32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{state:isSet$2(t.state)?laneFullState_StateFromJSON(t.state):0,reactionTime:isSet$2(t.reactionTime)?globalThis.Number(t.reactionTime):0,climbingTime:isSet$2(t.climbingTime)?globalThis.Number(t.climbingTime):0}},toJSON(t){const e={};return t.state!==0&&(e.state=laneFullState_StateToJSON(t.state)),t.reactionTime!==0&&(e.reactionTime=Math.round(t.reactionTime)),t.climbingTime!==0&&(e.climbingTime=Math.round(t.climbingTime)),e},create(t){return LaneFullState.fromPartial(t??{})},fromPartial(t){const e=createBaseLaneFullState();return e.state=t.state??0,e.reactionTime=t.reactionTime??0,e.climbingTime=t.climbingTime??0,e}};function createBaseRaceFullState(){return{state:0,laneStates:[]}}const RaceFullState={encode(t,e=minimal.Writer.create()){t.state!==0&&e.uint32(8).int32(t.state);for(const r of t.laneStates)LaneFullState.encode(r,e.uint32(18).fork()).ldelim();return e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseRaceFullState();for(;r.pos>>3){case 1:if(i!==8)break;n.state=r.int32();continue;case 2:if(i!==18)break;n.laneStates.push(LaneFullState.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{state:isSet$2(t.state)?raceFullState_StateFromJSON(t.state):0,laneStates:globalThis.Array.isArray(t==null?void 0:t.laneStates)?t.laneStates.map(e=>LaneFullState.fromJSON(e)):[]}},toJSON(t){var r;const e={};return t.state!==0&&(e.state=raceFullState_StateToJSON(t.state)),(r=t.laneStates)!=null&&r.length&&(e.laneStates=t.laneStates.map(o=>LaneFullState.toJSON(o))),e},create(t){return RaceFullState.fromPartial(t??{})},fromPartial(t){var r;const e=createBaseRaceFullState();return e.state=t.state??0,e.laneStates=((r=t.laneStates)==null?void 0:r.map(o=>LaneFullState.fromPartial(o)))||[],e}};function isSet$2(t){return t!=null}function createBaseRaceStartCommand(){return{}}const RaceStartCommand={encode(t,e=minimal.Writer.create()){return e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseRaceStartCommand();for(;r.pos>>3){case 1:if(i!==8)break;n.laneNumber=r.uint32();continue;case 2:if(i!==16)break;n.disabled=r.bool();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{laneNumber:isSet$1(t.laneNumber)?globalThis.Number(t.laneNumber):0,disabled:isSet$1(t.disabled)?globalThis.Boolean(t.disabled):!1}},toJSON(t){const e={};return t.laneNumber!==0&&(e.laneNumber=Math.round(t.laneNumber)),t.disabled===!0&&(e.disabled=t.disabled),e},create(t){return LaneSetDisabledCommand.fromPartial(t??{})},fromPartial(t){const e=createBaseLaneSetDisabledCommand();return e.laneNumber=t.laneNumber??0,e.disabled=t.disabled??!1,e}};function createBaseLaneSetFallCommand(){return{laneNumber:0}}const LaneSetFallCommand={encode(t,e=minimal.Writer.create()){return t.laneNumber!==0&&e.uint32(8).uint32(t.laneNumber),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseLaneSetFallCommand();for(;r.pos>>3){case 1:if(i!==8)break;n.laneNumber=r.uint32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{laneNumber:isSet$1(t.laneNumber)?globalThis.Number(t.laneNumber):0}},toJSON(t){const e={};return t.laneNumber!==0&&(e.laneNumber=Math.round(t.laneNumber)),e},create(t){return LaneSetFallCommand.fromPartial(t??{})},fromPartial(t){const e=createBaseLaneSetFallCommand();return e.laneNumber=t.laneNumber??0,e}};function createBaseRaceResetCommand(){return{}}const RaceResetCommand={encode(t,e=minimal.Writer.create()){return e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseRaceResetCommand();for(;r.pos>>3){case 1:if(i!==10)break;n.start=RaceStartCommand.decode(r,r.uint32());continue;case 2:if(i!==18)break;n.disable=LaneSetDisabledCommand.decode(r,r.uint32());continue;case 3:if(i!==26)break;n.fall=LaneSetFallCommand.decode(r,r.uint32());continue;case 4:if(i!==34)break;n.reset=RaceResetCommand.decode(r,r.uint32());continue;case 5:if(i!==42)break;n.reboot=RebootCommand.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{start:isSet$1(t.start)?RaceStartCommand.fromJSON(t.start):void 0,disable:isSet$1(t.disable)?LaneSetDisabledCommand.fromJSON(t.disable):void 0,fall:isSet$1(t.fall)?LaneSetFallCommand.fromJSON(t.fall):void 0,reset:isSet$1(t.reset)?RaceResetCommand.fromJSON(t.reset):void 0,reboot:isSet$1(t.reboot)?RebootCommand.fromJSON(t.reboot):void 0}},toJSON(t){const e={};return t.start!==void 0&&(e.start=RaceStartCommand.toJSON(t.start)),t.disable!==void 0&&(e.disable=LaneSetDisabledCommand.toJSON(t.disable)),t.fall!==void 0&&(e.fall=LaneSetFallCommand.toJSON(t.fall)),t.reset!==void 0&&(e.reset=RaceResetCommand.toJSON(t.reset)),t.reboot!==void 0&&(e.reboot=RebootCommand.toJSON(t.reboot)),e},create(t){return Command.fromPartial(t??{})},fromPartial(t){const e=createBaseCommand();return e.start=t.start!==void 0&&t.start!==null?RaceStartCommand.fromPartial(t.start):void 0,e.disable=t.disable!==void 0&&t.disable!==null?LaneSetDisabledCommand.fromPartial(t.disable):void 0,e.fall=t.fall!==void 0&&t.fall!==null?LaneSetFallCommand.fromPartial(t.fall):void 0,e.reset=t.reset!==void 0&&t.reset!==null?RaceResetCommand.fromPartial(t.reset):void 0,e.reboot=t.reboot!==void 0&&t.reboot!==null?RebootCommand.fromPartial(t.reboot):void 0,e}};function isSet$1(t){return t!=null}function createBaseManualStartProcedureSettings(){return{}}const ManualStartProcedureSettings={encode(t,e=minimal.Writer.create()){return e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseManualStartProcedureSettings();for(;r.pos>>3){case 1:if(i!==8)break;n.sayReady=r.bool();continue;case 2:if(i!==16)break;n.standstillDurationBeforeReady=r.int32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{sayReady:isSet(t.sayReady)?globalThis.Boolean(t.sayReady):!1,standstillDurationBeforeReady:isSet(t.standstillDurationBeforeReady)?globalThis.Number(t.standstillDurationBeforeReady):0}},toJSON(t){const e={};return t.sayReady===!0&&(e.sayReady=t.sayReady),t.standstillDurationBeforeReady!==0&&(e.standstillDurationBeforeReady=Math.round(t.standstillDurationBeforeReady)),e},create(t){return AutomatedStartProcedureSettings.fromPartial(t??{})},fromPartial(t){const e=createBaseAutomatedStartProcedureSettings();return e.sayReady=t.sayReady??!1,e.standstillDurationBeforeReady=t.standstillDurationBeforeReady??0,e}};function createBaseStartProcedureSettings(){return{manualStartProcedureSettings:void 0,automatedStartProcedureSettings:void 0}}const StartProcedureSettings={encode(t,e=minimal.Writer.create()){return t.manualStartProcedureSettings!==void 0&&ManualStartProcedureSettings.encode(t.manualStartProcedureSettings,e.uint32(10).fork()).ldelim(),t.automatedStartProcedureSettings!==void 0&&AutomatedStartProcedureSettings.encode(t.automatedStartProcedureSettings,e.uint32(18).fork()).ldelim(),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseStartProcedureSettings();for(;r.pos>>3){case 1:if(i!==10)break;n.manualStartProcedureSettings=ManualStartProcedureSettings.decode(r,r.uint32());continue;case 2:if(i!==18)break;n.automatedStartProcedureSettings=AutomatedStartProcedureSettings.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{manualStartProcedureSettings:isSet(t.manualStartProcedureSettings)?ManualStartProcedureSettings.fromJSON(t.manualStartProcedureSettings):void 0,automatedStartProcedureSettings:isSet(t.automatedStartProcedureSettings)?AutomatedStartProcedureSettings.fromJSON(t.automatedStartProcedureSettings):void 0}},toJSON(t){const e={};return t.manualStartProcedureSettings!==void 0&&(e.manualStartProcedureSettings=ManualStartProcedureSettings.toJSON(t.manualStartProcedureSettings)),t.automatedStartProcedureSettings!==void 0&&(e.automatedStartProcedureSettings=AutomatedStartProcedureSettings.toJSON(t.automatedStartProcedureSettings)),e},create(t){return StartProcedureSettings.fromPartial(t??{})},fromPartial(t){const e=createBaseStartProcedureSettings();return e.manualStartProcedureSettings=t.manualStartProcedureSettings!==void 0&&t.manualStartProcedureSettings!==null?ManualStartProcedureSettings.fromPartial(t.manualStartProcedureSettings):void 0,e.automatedStartProcedureSettings=t.automatedStartProcedureSettings!==void 0&&t.automatedStartProcedureSettings!==null?AutomatedStartProcedureSettings.fromPartial(t.automatedStartProcedureSettings):void 0,e}};function createBaseLaneSettings(){return{letter:"",disable:!1}}const LaneSettings={encode(t,e=minimal.Writer.create()){return t.letter!==""&&e.uint32(10).string(t.letter),t.disable===!0&&e.uint32(16).bool(t.disable),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseLaneSettings();for(;r.pos>>3){case 1:if(i!==10)break;n.letter=r.string();continue;case 2:if(i!==16)break;n.disable=r.bool();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{letter:isSet(t.letter)?globalThis.String(t.letter):"",disable:isSet(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){const e={};return t.letter!==""&&(e.letter=t.letter),t.disable===!0&&(e.disable=t.disable),e},create(t){return LaneSettings.fromPartial(t??{})},fromPartial(t){const e=createBaseLaneSettings();return e.letter=t.letter??"",e.disable=t.disable??!1,e}};function createBaseSoundSettings(){return{volume:0}}const SoundSettings={encode(t,e=minimal.Writer.create()){return t.volume!==0&&e.uint32(8).uint32(t.volume),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseSoundSettings();for(;r.pos>>3){case 1:if(i!==8)break;n.volume=r.uint32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{volume:isSet(t.volume)?globalThis.Number(t.volume):0}},toJSON(t){const e={};return t.volume!==0&&(e.volume=Math.round(t.volume)),e},create(t){return SoundSettings.fromPartial(t??{})},fromPartial(t){const e=createBaseSoundSettings();return e.volume=t.volume??0,e}};function createBaseRaceSettings(){return{startProcedure:void 0,lanes:[]}}const RaceSettings={encode(t,e=minimal.Writer.create()){t.startProcedure!==void 0&&StartProcedureSettings.encode(t.startProcedure,e.uint32(10).fork()).ldelim();for(const r of t.lanes)LaneSettings.encode(r,e.uint32(18).fork()).ldelim();return e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseRaceSettings();for(;r.pos>>3){case 1:if(i!==10)break;n.startProcedure=StartProcedureSettings.decode(r,r.uint32());continue;case 2:if(i!==18)break;n.lanes.push(LaneSettings.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{startProcedure:isSet(t.startProcedure)?StartProcedureSettings.fromJSON(t.startProcedure):void 0,lanes:globalThis.Array.isArray(t==null?void 0:t.lanes)?t.lanes.map(e=>LaneSettings.fromJSON(e)):[]}},toJSON(t){var r;const e={};return t.startProcedure!==void 0&&(e.startProcedure=StartProcedureSettings.toJSON(t.startProcedure)),(r=t.lanes)!=null&&r.length&&(e.lanes=t.lanes.map(o=>LaneSettings.toJSON(o))),e},create(t){return RaceSettings.fromPartial(t??{})},fromPartial(t){var r;const e=createBaseRaceSettings();return e.startProcedure=t.startProcedure!==void 0&&t.startProcedure!==null?StartProcedureSettings.fromPartial(t.startProcedure):void 0,e.lanes=((r=t.lanes)==null?void 0:r.map(o=>LaneSettings.fromPartial(o)))||[],e}};function createBaseSettings(){return{default:!1,race:void 0,sound:void 0}}const Settings={encode(t,e=minimal.Writer.create()){return t.default===!0&&e.uint32(8).bool(t.default),t.race!==void 0&&RaceSettings.encode(t.race,e.uint32(18).fork()).ldelim(),t.sound!==void 0&&SoundSettings.encode(t.sound,e.uint32(26).fork()).ldelim(),e},decode(t,e){const r=t instanceof minimal.Reader?t:minimal.Reader.create(t);let o=e===void 0?r.len:r.pos+e;const n=createBaseSettings();for(;r.pos>>3){case 1:if(i!==8)break;n.default=r.bool();continue;case 2:if(i!==18)break;n.race=RaceSettings.decode(r,r.uint32());continue;case 3:if(i!==26)break;n.sound=SoundSettings.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return n},fromJSON(t){return{default:isSet(t.default)?globalThis.Boolean(t.default):!1,race:isSet(t.race)?RaceSettings.fromJSON(t.race):void 0,sound:isSet(t.sound)?SoundSettings.fromJSON(t.sound):void 0}},toJSON(t){const e={};return t.default===!0&&(e.default=t.default),t.race!==void 0&&(e.race=RaceSettings.toJSON(t.race)),t.sound!==void 0&&(e.sound=SoundSettings.toJSON(t.sound)),e},create(t){return Settings.fromPartial(t??{})},fromPartial(t){const e=createBaseSettings();return e.default=t.default??!1,e.race=t.race!==void 0&&t.race!==null?RaceSettings.fromPartial(t.race):void 0,e.sound=t.sound!==void 0&&t.sound!==null?SoundSettings.fromPartial(t.sound):void 0,e}};function isSet(t){return t!=null}const BLUETOOTH_BASE_UUID="97ed638a-690f-4ce4-bb12-d9c4e0",BLUETOOTH_TIMER_SERVICE_BASE_UUID=BLUETOOTH_BASE_UUID+"01",BLUETOOTH_TIMER_SERVICE_UUID=BLUETOOTH_TIMER_SERVICE_BASE_UUID+"0000";let bluetoothDevice,bluetoothService,bluetoothCharacteristics={raceFullState:void 0,control:void 0,settings:void 0};function checkAvailability(){return navigator.bluetooth?(bluetoothState.set("DISCONNECTED"),!0):(bluetoothState.set("UNAVAILABLE"),!1)}async function startBluetooth(){bluetoothState.set("CONNECTING");try{bluetoothDevice=await navigator.bluetooth.requestDevice({filters:[{services:[BLUETOOTH_TIMER_SERVICE_UUID]}],optionalServices:[BLUETOOTH_TIMER_SERVICE_UUID]})}catch(e){console.error(e),bluetoothState.set("DISCONNECTED");return}console.log("> Requested "+bluetoothDevice.name+" ("+bluetoothDevice.id+")");let t;try{t=await bluetoothDevice.gatt.connect()}catch{console.log("> Error connecting to "+bluetoothDevice.name+" ("+bluetoothDevice.id+")"),bluetoothState.set("DISCONNECTED");return}bluetoothDevice.addEventListener("gattserverdisconnected",onDisconnected),bluetoothService=await t.getPrimaryService(BLUETOOTH_TIMER_SERVICE_UUID),bluetoothCharacteristics.raceFullState=await bluetoothService.getCharacteristic(BLUETOOTH_TIMER_SERVICE_BASE_UUID+"0001"),handleNewState((await bluetoothCharacteristics.raceFullState.readValue()).buffer),await bluetoothCharacteristics.raceFullState.startNotifications(),bluetoothCharacteristics.raceFullState.addEventListener("characteristicvaluechanged",handleNotifications),bluetoothCharacteristics.control=await bluetoothService.getCharacteristic(BLUETOOTH_TIMER_SERVICE_BASE_UUID+"0002"),bluetoothCharacteristics.settings=await bluetoothService.getCharacteristic(BLUETOOTH_TIMER_SERVICE_BASE_UUID+"0003"),handleNewSettings((await bluetoothCharacteristics.settings.readValue()).buffer),await bluetoothCharacteristics.settings.startNotifications(),bluetoothCharacteristics.settings.addEventListener("characteristicvaluechanged",handleNotifications),bluetoothState.set("CONNECTED")}function onDisconnected(){console.log("> Bluetooth Device disconnected"),bluetoothDevice=void 0,bluetoothService=void 0,bluetoothState.set("DISCONNECTED")}function handleNotifications(t){var r,o;if(!t.target)return;const e=t.target;console.log(`${e.uuid} - VALUE CHANGED`),e.uuid==((r=bluetoothCharacteristics.raceFullState)==null?void 0:r.uuid)?handleNewState(e.value.buffer):e.uuid==((o=bluetoothCharacteristics.settings)==null?void 0:o.uuid)&&handleNewSettings(e.value.buffer)}function handleNewState(t){let e=RaceFullState.decode(new Uint8Array(t));console.log(e),raceFullState.set(e)}function handleNewSettings(t){let e=Settings.decode(new Uint8Array(t));console.log(e),settings.set(e)}async function sendCommand(t){if(bluetoothCharacteristics.control===void 0)return!1;let e=Command.encode(t).finish(),r=__createArrayBufferWithCorrectSize(e);return console.log(r.byteLength),await bluetoothCharacteristics.control.writeValueWithResponse(r),!0}async function writeSettings(t){if(bluetoothCharacteristics.settings===void 0)return!1;let e=Settings.encode(t).finish(),r=__createArrayBufferWithCorrectSize(e);return await bluetoothCharacteristics.settings.writeValueWithResponse(r),!0}function __createArrayBufferWithCorrectSize(t){const e=new Uint8Array(t.byteLength);return t.forEach((r,o)=>{e[o]=r}),e}function twJoin(){for(var t=0,e,r,o="";tt&&(e=0,o=r,r=new Map)}return{get:function(a){var s=r.get(a);if(s!==void 0)return s;if((s=o.get(a))!==void 0)return n(a,s),s},set:function(a,s){r.has(a)?r.set(a,s):n(a,s)}}}var IMPORTANT_MODIFIER="!";function createSplitModifiers(t){var e=t.separator||":",r=e.length===1,o=e[0],n=e.length;return function(a){for(var s=[],l=0,u=0,h,c=0;cu?h-u:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:y}}}function sortModifiers(t){if(t.length<=1)return t;var e=[],r=[];return t.forEach(function(o){var n=o[0]==="[";n?(e.push.apply(e,r.sort().concat([o])),r=[]):r.push(o)}),e.push.apply(e,r.sort()),e}function createConfigUtils(t){return{cache:createLruCache(t.cacheSize),splitModifiers:createSplitModifiers(t),...createClassUtils(t)}}var SPLIT_CLASSES_REGEX=/\s+/;function mergeClassList(t,e){var r=e.splitModifiers,o=e.getClassGroupId,n=e.getConflictingClassGroupIds,i=new Set;return t.trim().split(SPLIT_CLASSES_REGEX).map(function(a){var s=r(a),l=s.modifiers,u=s.hasImportantModifier,h=s.baseClassName,c=s.maybePostfixModifierPosition,d=o(c?h.substring(0,c):h),f=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:a};if(d=o(h),!d)return{isTailwindClass:!1,originalClassName:a};f=!1}var m=sortModifiers(l).join(":"),p=u?m+IMPORTANT_MODIFIER:m;return{isTailwindClass:!0,modifierId:p,classGroupId:d,originalClassName:a,hasPostfixModifier:f}}).reverse().filter(function(a){if(!a.isTailwindClass)return!0;var s=a.modifierId,l=a.classGroupId,u=a.hasPostfixModifier,h=s+l;return i.has(h)?!1:(i.add(h),n(l,u).forEach(function(c){return i.add(s+c)}),!0)}).reverse().map(function(a){return a.originalClassName}).join(" ")}function createTailwindMerge(){for(var t=arguments.length,e=new Array(t),r=0;r{n&&(o||(o=create_bidirectional_transition(e,t[2],t[3],!0)),o.run(1))}),n=!0)},o(c){transition_out(l,c),c&&(o||(o=create_bidirectional_transition(e,t[2],t[3],!1)),o.run(0)),n=!1},d(c){c&&detach(e),l&&l.d(c),t[20](null),c&&o&&o.end(),i=!1,run_all(a)}}}function create_fragment$b(t){let e=t[1],r,o=!1,n,i=t[1]&&create_dynamic_element$1(t);return{c(){i&&i.c(),r=empty()},l(a){i&&i.l(a),r=empty()},m(a,s){i&&i.m(a,s),insert_hydration(a,r,s),n=!0},p(a,[s]){a[1]?e?safe_not_equal(e,a[1])?(i.d(1),i=create_dynamic_element$1(a),e=a[1],i.c(),o&&(o=!1,transition_in(i)),i.m(r.parentNode,r)):(o&&(o=!1,transition_in(i)),i.p(a,s)):(i=create_dynamic_element$1(a),e=a[1],i.c(),transition_in(i),i.m(r.parentNode,r)):e&&(o=!0,group_outros(),transition_out(i,1,1,()=>{i=null,e=a[1],o=!1}),check_outros())},i(a){n||(transition_in(i,a),n=!0)},o(a){transition_out(i,a),n=!1},d(a){a&&detach(r),i&&i.d(a)}}}function instance$b(t,e,r){const o=["tag","color","rounded","border","shadow","transition","params","node","use","options","role"];let n=compute_rest_props(e,o),{$$slots:i={},$$scope:a}=e;const s=()=>({duration:0}),l=()=>{};setContext("background",!0);let{tag:u=n.href?"a":"div"}=e,{color:h="default"}=e,{rounded:c=!1}=e,{border:d=!1}=e,{shadow:f=!1}=e,{transition:m=s}=e,{params:p={}}=e,{node:y=void 0}=e,{use:v=l}=e,{options:g={}}=e,{role:_=void 0}=e;const b={gray:"bg-gray-50 dark:bg-gray-800",red:"bg-red-50 dark:bg-gray-800",yellow:"bg-yellow-50 dark:bg-gray-800 ",green:"bg-green-50 dark:bg-gray-800 ",indigo:"bg-indigo-50 dark:bg-gray-800 ",purple:"bg-purple-50 dark:bg-gray-800 ",pink:"bg-pink-50 dark:bg-gray-800 ",blue:"bg-blue-50 dark:bg-gray-800 ",light:"bg-gray-50 dark:bg-gray-700",dark:"bg-gray-50 dark:bg-gray-800",default:"bg-white dark:bg-gray-800",dropdown:"bg-white dark:bg-gray-700",navbar:"bg-white dark:bg-gray-900",navbarUl:"bg-gray-50 dark:bg-gray-800",form:"bg-gray-50 dark:bg-gray-700",primary:"bg-primary-50 dark:bg-gray-800 ",orange:"bg-orange-50 dark:bg-orange-800",none:""},w={gray:"text-gray-800 dark:text-gray-300",red:"text-red-800 dark:text-red-400",yellow:"text-yellow-800 dark:text-yellow-300",green:"text-green-800 dark:text-green-400",indigo:"text-indigo-800 dark:text-indigo-400",purple:"text-purple-800 dark:text-purple-400",pink:"text-pink-800 dark:text-pink-400",blue:"text-blue-800 dark:text-blue-400",light:"text-gray-700 dark:text-gray-300",dark:"text-gray-700 dark:text-gray-300",default:"text-gray-500 dark:text-gray-400",dropdown:"text-gray-700 dark:text-gray-200",navbar:"text-gray-700 dark:text-gray-200",navbarUl:"text-gray-700 dark:text-gray-400",form:"text-gray-900 dark:text-white",primary:"text-primary-800 dark:text-primary-400",orange:"text-orange-800 dark:text-orange-400",none:""},k={gray:"border-gray-300 dark:border-gray-800 divide-gray-300 dark:divide-gray-800",red:"border-red-300 dark:border-red-800 divide-red-300 dark:divide-red-800",yellow:"border-yellow-300 dark:border-yellow-800 divide-yellow-300 dark:divide-yellow-800",green:"border-green-300 dark:border-green-800 divide-green-300 dark:divide-green-800",indigo:"border-indigo-300 dark:border-indigo-800 divide-indigo-300 dark:divide-indigo-800",purple:"border-purple-300 dark:border-purple-800 divide-purple-300 dark:divide-purple-800",pink:"border-pink-300 dark:border-pink-800 divide-pink-300 dark:divide-pink-800",blue:"border-blue-300 dark:border-blue-800 divide-blue-300 dark:divide-blue-800",light:"border-gray-500 divide-gray-500",dark:"border-gray-500 divide-gray-500",default:"border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700",dropdown:"border-gray-100 dark:border-gray-600 divide-gray-100 dark:divide-gray-600",navbar:"border-gray-100 dark:border-gray-700 divide-gray-100 dark:divide-gray-700",navbarUl:"border-gray-100 dark:border-gray-700 divide-gray-100 dark:divide-gray-700",form:"border-gray-300 dark:border-gray-700 divide-gray-300 dark:divide-gray-700",primary:"border-primary-500 dark:border-primary-200 divide-primary-500 dark:divide-primary-200 ",orange:"border-orange-300 dark:border-orange-800 divide-orange-300 dark:divide-orange-800",none:""};let x;function D(S){bubble.call(this,t,S)}function I(S){bubble.call(this,t,S)}function L(S){bubble.call(this,t,S)}function M(S){bubble.call(this,t,S)}function N(S){bubble.call(this,t,S)}function U(S){binding_callbacks[S?"unshift":"push"](()=>{y=S,r(0,y)})}return t.$$set=S=>{r(26,e=assign(assign({},e),exclude_internal_props(S))),r(8,n=compute_rest_props(e,o)),"tag"in S&&r(1,u=S.tag),"color"in S&&r(9,h=S.color),"rounded"in S&&r(10,c=S.rounded),"border"in S&&r(11,d=S.border),"shadow"in S&&r(12,f=S.shadow),"transition"in S&&r(2,m=S.transition),"params"in S&&r(3,p=S.params),"node"in S&&r(0,y=S.node),"use"in S&&r(4,v=S.use),"options"in S&&r(5,g=S.options),"role"in S&&r(6,_=S.role),"$$scope"in S&&r(13,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&r(9,h=h??"default"),t.$$.dirty&512&&setContext("color",h),r(7,x=twMerge(b[h],w[h],c&&"rounded-lg",d&&"border",k[h],f&&"shadow-md",e.class))},e=exclude_internal_props(e),[y,u,m,p,v,g,_,x,n,h,c,d,f,a,i,D,I,L,M,N,U]}class Frame extends SvelteComponent{constructor(e){super(),init(this,e,instance$b,create_fragment$b,safe_not_equal,{tag:1,color:9,rounded:10,border:11,shadow:12,transition:2,params:3,node:0,use:4,options:5,role:6})}}function cubicOut(t){const e=t-1;return e*e*e+1}function fade(t,{delay:e=0,duration:r=400,easing:o=identity}={}){const n=+getComputedStyle(t).opacity;return{delay:e,duration:r,easing:o,css:i=>`opacity: ${i*n}`}}const get_default_slot_changes_1=t=>({svgSize:t&4}),get_default_slot_context_1=t=>({svgSize:t[5][t[2]]}),get_default_slot_changes=t=>({svgSize:t&4}),get_default_slot_context=t=>({svgSize:t[5][t[2]]});function create_else_block$5(t){let e,r,o,n,i,a,s=t[0]&&create_if_block_2$3(t);const l=t[9].default,u=create_slot(l,t,t[8],get_default_slot_context_1);let h=[{type:"button"},t[6],{class:t[4]},{"aria-label":o=t[1]??t[0]}],c={};for(let d=0;d{a[h]=null}),check_outros(),r=a[e],r?r.p(l,u):(r=a[e]=i[e](l),r.c()),transition_in(r,1),r.m(o.parentNode,o))},i(l){n||(transition_in(r),n=!0)},o(l){transition_out(r),n=!1},d(l){l&&detach(o),a[e].d(l)}}}function instance$a(t,e,r){const o=["color","name","ariaLabel","size","href"];let n=compute_rest_props(e,o),{$$slots:i={},$$scope:a}=e;const s=getContext("background");let{color:l="default"}=e,{name:u=void 0}=e,{ariaLabel:h=void 0}=e,{size:c="md"}=e,{href:d=void 0}=e;const f={dark:"text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-600",gray:"text-gray-500 focus:ring-gray-400 hover:bg-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-300",red:"text-red-500 focus:ring-red-400 hover:bg-red-200 dark:hover:bg-red-800 dark:hover:text-red-300",yellow:"text-yellow-500 focus:ring-yellow-400 hover:bg-yellow-200 dark:hover:bg-yellow-800 dark:hover:text-yellow-300",green:"text-green-500 focus:ring-green-400 hover:bg-green-200 dark:hover:bg-green-800 dark:hover:text-green-300",indigo:"text-indigo-500 focus:ring-indigo-400 hover:bg-indigo-200 dark:hover:bg-indigo-800 dark:hover:text-indigo-300",purple:"text-purple-500 focus:ring-purple-400 hover:bg-purple-200 dark:hover:bg-purple-800 dark:hover:text-purple-300",pink:"text-pink-500 focus:ring-pink-400 hover:bg-pink-200 dark:hover:bg-pink-800 dark:hover:text-pink-300",blue:"text-blue-500 focus:ring-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800 dark:hover:text-blue-300",primary:"text-primary-500 focus:ring-primary-400 hover:bg-primary-200 dark:hover:bg-primary-800 dark:hover:text-primary-300",default:"focus:ring-gray-400"},m={xs:"m-0.5 rounded-sm focus:ring-1 p-0.5",sm:"m-0.5 rounded focus:ring-1 p-0.5",md:"m-0.5 rounded-lg focus:ring-2 p-1.5",lg:"m-0.5 rounded-lg focus:ring-2 p-2.5"};let p;const y={xs:"w-3 h-3",sm:"w-3.5 h-3.5",md:"w-5 h-5",lg:"w-5 h-5"};function v(g){bubble.call(this,t,g)}return t.$$set=g=>{r(14,e=assign(assign({},e),exclude_internal_props(g))),r(6,n=compute_rest_props(e,o)),"color"in g&&r(7,l=g.color),"name"in g&&r(0,u=g.name),"ariaLabel"in g&&r(1,h=g.ariaLabel),"size"in g&&r(2,c=g.size),"href"in g&&r(3,d=g.href),"$$scope"in g&&r(8,a=g.$$scope)},t.$$.update=()=>{r(4,p=twMerge("focus:outline-none whitespace-normal",m[c],f[l],l==="default"&&(s?"hover:bg-gray-100 dark:hover:bg-gray-600":"hover:bg-gray-100 dark:hover:bg-gray-700"),e.class))},e=exclude_internal_props(e),[u,h,c,d,p,y,n,l,a,i,v]}class ToolbarButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$a,create_fragment$a,safe_not_equal,{color:7,name:0,ariaLabel:1,size:2,href:3})}}function create_default_slot$5(t){let e,r,o;return{c(){e=svg_element("svg"),r=svg_element("path"),this.h()},l(n){e=claim_svg_element(n,"svg",{class:!0,fill:!0,viewBox:!0,xmlns:!0});var i=children(e);r=claim_svg_element(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),children(r).forEach(detach),i.forEach(detach),this.h()},h(){attr(r,"fill-rule","evenodd"),attr(r,"d","M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"),attr(r,"clip-rule","evenodd"),attr(e,"class",o=t[4]),attr(e,"fill","currentColor"),attr(e,"viewBox","0 0 20 20"),attr(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){insert_hydration(n,e,i),append_hydration(e,r)},p(n,i){i&16&&o!==(o=n[4])&&attr(e,"class",o)},d(n){n&&detach(e)}}}function create_fragment$9(t){let e,r;const o=[{name:t[0]},t[1],{class:twMerge("ml-auto",t[2].class)}];let n={$$slots:{default:[create_default_slot$5,({svgSize:i})=>({4:i}),({svgSize:i})=>i?16:0]},$$scope:{ctx:t}};for(let i=0;i{r(2,e=assign(assign({},e),exclude_internal_props(s))),r(1,n=compute_rest_props(e,o)),"name"in s&&r(0,i=s.name)},e=exclude_internal_props(e),[i,n,e,a]}class CloseButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$9,create_fragment$9,safe_not_equal,{name:0})}}const get_close_button_slot_changes=t=>({}),get_close_button_slot_context=t=>({close:t[3]}),get_icon_slot_changes=t=>({}),get_icon_slot_context=t=>({});function create_if_block$4(t){let e,r;const o=[t[4],{class:t[2]},{role:"alert"}];let n={$$slots:{default:[create_default_slot$4]},$$scope:{ctx:t}};for(let i=0;i{s=null}),check_outros());let m=r;r=h(d),r===m?u[r].p(d,f):(group_outros(),transition_out(u[m],1,1,()=>{u[m]=null}),check_outros(),o=u[r],o?o.p(d,f):(o=u[r]=l[r](d),o.c()),transition_in(o,1),o.m(n.parentNode,n)),d[0]?c?(c.p(d,f),f&1&&transition_in(c,1)):(c=create_if_block_1$3(d),c.c(),transition_in(c,1),c.m(i.parentNode,i)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros())},i(d){a||(transition_in(s),transition_in(o),transition_in(c),a=!0)},o(d){transition_out(s),transition_out(o),transition_out(c),a=!1},d(d){d&&(detach(e),detach(n),detach(i)),s&&s.d(d),u[r].d(d),c&&c.d(d)}}}function create_fragment$8(t){let e,r,o=t[1]&&create_if_block$4(t);return{c(){o&&o.c(),e=empty()},l(n){o&&o.l(n),e=empty()},m(n,i){o&&o.m(n,i),insert_hydration(n,e,i),r=!0},p(n,[i]){n[1]?o?(o.p(n,i),i&2&&transition_in(o,1)):(o=create_if_block$4(n),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(n){r||(transition_in(o),r=!0)},o(n){transition_out(o),r=!1},d(n){n&&detach(e),o&&o.d(n)}}}function instance$8(t,e,r){const o=["dismissable","defaultClass"];let n=compute_rest_props(e,o),{$$slots:i={},$$scope:a}=e;const s=compute_slots(i);let{dismissable:l=!1}=e,{defaultClass:u="p-4 gap-3 text-sm"}=e,h=!0;const c=createEventDispatcher();function d(k){k.stopPropagation(),r(1,h=!1)}let f;function m(k){bubble.call(this,t,k)}function p(k){bubble.call(this,t,k)}function y(k){bubble.call(this,t,k)}function v(k){bubble.call(this,t,k)}function g(k){bubble.call(this,t,k)}function _(k){bubble.call(this,t,k)}function b(k){bubble.call(this,t,k)}function w(k){bubble.call(this,t,k)}return t.$$set=k=>{r(18,e=assign(assign({},e),exclude_internal_props(k))),r(4,n=compute_rest_props(e,o)),"dismissable"in k&&r(0,l=k.dismissable),"defaultClass"in k&&r(6,u=k.defaultClass),"$$scope"in k&&r(16,a=k.$$scope)},t.$$.update=()=>{t.$$.dirty&2&&c(h?"open":"close"),r(2,f=twMerge(u,(s.icon||l)&&"flex items-center",e.class)),r(4,n.color=n.color??"primary",n),r(4,n.rounded=n.rounded??!0,n),l&&r(4,n.transition=n.transition??fade,n)},e=exclude_internal_props(e),[l,h,f,d,n,s,u,i,m,p,y,v,g,_,b,w,a]}class Alert extends SvelteComponent{constructor(e){super(),init(this,e,instance$8,create_fragment$8,safe_not_equal,{dismissable:0,defaultClass:6})}}function create_dynamic_element(t){let e,r,o,n,i,a;const s=t[10].default,l=create_slot(s,t,t[9],null);let u=[{type:r=t[0]?void 0:t[1]},{href:t[0]},{role:o=t[0]?"link":"button"},t[3],{class:t[2]}],h={};for(let c=0;cu||f==="alternative"||f==="light";let w;function k(F){bubble.call(this,t,F)}function x(F){bubble.call(this,t,F)}function D(F){bubble.call(this,t,F)}function I(F){bubble.call(this,t,F)}function L(F){bubble.call(this,t,F)}function M(F){bubble.call(this,t,F)}function N(F){bubble.call(this,t,F)}function U(F){bubble.call(this,t,F)}function S(F){bubble.call(this,t,F)}return t.$$set=F=>{r(27,e=assign(assign({},e),exclude_internal_props(F))),r(3,n=compute_rest_props(e,o)),"pill"in F&&r(4,l=F.pill),"outline"in F&&r(5,u=F.outline),"size"in F&&r(6,h=F.size),"href"in F&&r(0,c=F.href),"type"in F&&r(1,d=F.type),"color"in F&&r(7,f=F.color),"shadow"in F&&r(8,m=F.shadow),"$$scope"in F&&r(9,a=F.$$scope)},t.$$.update=()=>{r(2,w=twMerge("text-center font-medium",s?"focus:ring-2":"focus:ring-4",s&&"focus:z-10",s||"focus:outline-none","inline-flex items-center justify-center "+_[h],u?g[f]:p[f],f==="alternative"&&(s?"dark:bg-gray-700 dark:text-white dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-600":"dark:bg-transparent dark:border-gray-600 dark:hover:border-gray-700"),u&&f==="dark"&&(s?"dark:text-white dark:border-white":"dark:text-gray-400 dark:border-gray-700"),y[f],b()&&s&&"border-l-0 first:border-l",s?l&&"first:rounded-l-full last:rounded-r-full"||"first:rounded-l-lg last:rounded-r-lg":l&&"rounded-full"||"rounded-lg",m&&"shadow-lg",m&&v[f],e.disabled&&"cursor-not-allowed opacity-50",e.class))},e=exclude_internal_props(e),[c,d,w,n,l,u,h,f,m,a,i,k,x,D,I,L,M,N,U,S]}class Button extends SvelteComponent{constructor(e){super(),init(this,e,instance$7,create_fragment$7,safe_not_equal,{pill:4,outline:5,size:6,href:0,type:1,color:7,shadow:8})}}function create_else_block$3(t){let e;const r=t[7].default,o=create_slot(r,t,t[6],null);return{c(){o&&o.c()},l(n){o&&o.l(n)},m(n,i){o&&o.m(n,i),e=!0},p(n,i){o&&o.p&&(!e||i&64)&&update_slot_base(o,r,n,n[6],e?get_slot_changes(r,n[6],i,null):get_all_dirty_from_scope(n[6]),null)},i(n){e||(transition_in(o,n),e=!0)},o(n){transition_out(o,n),e=!1},d(n){o&&o.d(n)}}}function create_if_block$3(t){let e,r;const o=t[7].default,n=create_slot(o,t,t[6],null);let i=[t[3],{class:t[2]}],a={};for(let s=0;s{a[h]=null}),check_outros(),r=a[e],r?r.p(l,u):(r=a[e]=i[e](l),r.c()),transition_in(r,1),r.m(o.parentNode,o))},i(l){n||(transition_in(r),n=!0)},o(l){transition_out(r),n=!1},d(l){l&&detach(o),a[e].d(l)}}}function instance$6(t,e,r){let o;const n=["color","defaultClass","show"];let i=compute_rest_props(e,n),{$$slots:a={},$$scope:s}=e,{color:l="gray"}=e,{defaultClass:u="text-sm font-medium block"}=e,{show:h=!0}=e,c;const d={gray:"text-gray-900 dark:text-gray-300",green:"text-green-700 dark:text-green-500",red:"text-red-700 dark:text-red-500",disabled:"text-gray-400 dark:text-gray-500"};function f(m){binding_callbacks[m?"unshift":"push"](()=>{c=m,r(1,c)})}return t.$$set=m=>{r(10,e=assign(assign({},e),exclude_internal_props(m))),r(3,i=compute_rest_props(e,n)),"color"in m&&r(4,l=m.color),"defaultClass"in m&&r(5,u=m.defaultClass),"show"in m&&r(0,h=m.show),"$$scope"in m&&r(6,s=m.$$scope)},t.$$.update=()=>{if(t.$$.dirty&18){const m=c==null?void 0:c.control;r(4,l=m!=null&&m.disabled?"disabled":l)}r(2,o=twMerge(u,d[l],e.class))},e=exclude_internal_props(e),[h,c,o,i,l,u,s,a,f]}class Label extends SvelteComponent{constructor(e){super(),init(this,e,instance$6,create_fragment$6,safe_not_equal,{color:4,defaultClass:5,show:0})}}const colorClasses={primary:"text-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600",secondary:"text-secondary-600 focus:ring-secondary-500 dark:focus:ring-secondary-600",red:"text-red-600 focus:ring-red-500 dark:focus:ring-red-600",green:"text-green-600 focus:ring-green-500 dark:focus:ring-green-600",purple:"text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600",teal:"text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600",yellow:"text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600",orange:"text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600",blue:"text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600"},labelClass=(t,e)=>twMerge(t?"inline-flex":"flex","items-center",e);let spacing="mr-2";const inputClass=(t,e,r,o,n)=>twMerge("w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2",spacing,o?"dark:bg-gray-600 dark:border-gray-500":"dark:bg-gray-700 dark:border-gray-600",t&&"sr-only peer",r&&"rounded",colorClasses[e],n);function create_default_slot$3(t){let e,r,o,n,i,a,s,l=[{type:"checkbox"},{__value:t[5]},t[12],{class:r=twMerge(t[6],inputClass(t[3],t[2],!0,t[7],t[11].default||t[10].class))}],u={};for(let d=0;d=0),f?S<0&&(c.push(d),r(0,c)):S>=0&&(c.splice(S,1),r(0,c))}function g(S){bubble.call(this,t,S)}function _(S){bubble.call(this,t,S)}function b(S){bubble.call(this,t,S)}function w(S){bubble.call(this,t,S)}function k(S){bubble.call(this,t,S)}function x(S){bubble.call(this,t,S)}function D(S){bubble.call(this,t,S)}function I(S){bubble.call(this,t,S)}function L(S){bubble.call(this,t,S)}function M(S){bubble.call(this,t,S)}function N(S){bubble.call(this,t,S)}function U(){f=this.checked,r(1,f)}return t.$$set=S=>{r(10,e=assign(assign({},e),exclude_internal_props(S))),r(12,n=compute_rest_props(e,o)),"color"in S&&r(2,l=S.color),"custom"in S&&r(3,u=S.custom),"inline"in S&&r(4,h=S.inline),"group"in S&&r(0,c=S.group),"value"in S&&r(5,d=S.value),"checked"in S&&r(1,f=S.checked),"spacing"in S&&r(6,m=S.spacing),"$$scope"in S&&r(26,a=S.$$scope)},e=exclude_internal_props(e),[c,f,l,u,h,d,m,p,y,v,e,s,n,i,g,_,b,w,k,x,D,I,L,M,N,U,a]}class Checkbox extends SvelteComponent{constructor(e){super(),init(this,e,instance$5,create_fragment$5,safe_not_equal,{color:2,custom:3,inline:4,group:0,value:5,checked:1,spacing:6})}}function create_default_slot$2(t){let e,r,o;const n=t[8].default,i=create_slot(n,t,t[13],null);return{c(){e=element("span"),r=space(),i&&i.c(),this.h()},l(a){e=claim_element(a,"SPAN",{class:!0}),children(e).forEach(detach),r=claim_space(a),i&&i.l(a),this.h()},h(){attr(e,"class",t[3])},m(a,s){insert_hydration(a,e,s),insert_hydration(a,r,s),i&&i.m(a,s),o=!0},p(a,s){(!o||s&8)&&attr(e,"class",a[3]),i&&i.p&&(!o||s&8192)&&update_slot_base(i,n,a,a[13],o?get_slot_changes(n,a[13],s,null):get_all_dirty_from_scope(a[13]),null)},i(a){o||(transition_in(i,a),o=!0)},o(a){transition_out(i,a),o=!1},d(a){a&&(detach(e),detach(r)),i&&i.d(a)}}}function create_fragment$4(t){let e,r,o,n;const i=[{custom:!0},t[5],{class:t[4].class},{value:t[2]}];function a(u){t[9](u)}function s(u){t[10](u)}let l={$$slots:{default:[create_default_slot$2]},$$scope:{ctx:t}};for(let u=0;ubind(e,"checked",a)),binding_callbacks.push(()=>bind(e,"group",s)),e.$on("click",t[11]),e.$on("change",t[12]),{c(){create_component(e.$$.fragment)},l(u){claim_component(e.$$.fragment,u)},m(u,h){mount_component(e,u,h),n=!0},p(u,[h]){const c=h&52?get_spread_update(i,[i[0],h&32&&get_spread_object(u[5]),h&16&&{class:u[4].class},h&4&&{value:u[2]}]):{};h&8200&&(c.$$scope={dirty:h,ctx:u}),!r&&h&2&&(r=!0,c.checked=u[1],add_flush_callback(()=>r=!1)),!o&&h&1&&(o=!0,c.group=u[0],add_flush_callback(()=>o=!1)),e.$set(c)},i(u){n||(transition_in(e.$$.fragment,u),n=!0)},o(u){transition_out(e.$$.fragment,u),n=!1},d(u){destroy_component(e,u)}}}const common="mr-3 shrink-0 bg-gray-200 rounded-full peer-focus:ring-4 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all";function instance$4(t,e,r){const o=["size","group","value","checked","customSize"];let n=compute_rest_props(e,o),{$$slots:i={},$$scope:a}=e,{size:s="default"}=e,{group:l=[]}=e,{value:u=""}=e,{checked:h=void 0}=e,{customSize:c=""}=e,d=getContext("background");const f={primary:"peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 peer-checked:bg-primary-600",secondary:"peer-focus:ring-secondary-300 dark:peer-focus:ring-secondary-800 peer-checked:bg-secondary-600",red:"peer-focus:ring-red-300 dark:peer-focus:ring-red-800 peer-checked:bg-red-600",green:"peer-focus:ring-green-300 dark:peer-focus:ring-green-800 peer-checked:bg-green-600",purple:"peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 peer-checked:bg-purple-600",yellow:"peer-focus:ring-yellow-300 dark:peer-focus:ring-yellow-800 peer-checked:bg-yellow-400",teal:"peer-focus:ring-teal-300 dark:peer-focus:ring-teal-800 peer-checked:bg-teal-600",orange:"peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:bg-orange-500",blue:"peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 peer-checked:bg-blue-600"},m={small:"w-9 h-5 after:top-[2px] after:left-[2px] after:h-4 after:w-4",default:"w-11 h-6 after:top-0.5 after:left-[2px] after:h-5 after:w-5",large:"w-14 h-7 after:top-0.5 after:left-[4px] after:h-6 after:w-6",custom:c};let p;function y(b){h=b,r(1,h)}function v(b){l=b,r(0,l)}function g(b){bubble.call(this,t,b)}function _(b){bubble.call(this,t,b)}return t.$$set=b=>{r(4,e=assign(assign({},e),exclude_internal_props(b))),r(5,n=compute_rest_props(e,o)),"size"in b&&r(6,s=b.size),"group"in b&&r(0,l=b.group),"value"in b&&r(2,u=b.value),"checked"in b&&r(1,h=b.checked),"customSize"in b&&r(7,c=b.customSize),"$$scope"in b&&r(13,a=b.$$scope)},t.$$.update=()=>{r(3,p=twMerge(common,d?"dark:bg-gray-600 dark:border-gray-500":"dark:bg-gray-700 dark:border-gray-600",f[n.color??"primary"],m[s],"relative",e.classDiv))},e=exclude_internal_props(e),[l,h,u,p,e,n,s,c,i,y,v,g,_,a]}class Toggle extends SvelteComponent{constructor(e){super(),init(this,e,instance$4,create_fragment$4,safe_not_equal,{size:6,group:0,value:2,checked:1,customSize:7})}}function is_date(t){return Object.prototype.toString.call(t)==="[object Date]"}function get_interpolator(t,e){if(t===e||t!==t)return()=>t;const r=typeof t;if(r!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const o=e.map((n,i)=>get_interpolator(t[i],n));return n=>o.map(i=>i(n))}if(r==="object"){if(!t||!e)throw new Error("Object cannot be null");if(is_date(t)&&is_date(e)){t=t.getTime(),e=e.getTime();const i=e-t;return a=>new Date(t+a*i)}const o=Object.keys(e),n={};return o.forEach(i=>{n[i]=get_interpolator(t[i],e[i])}),i=>{const a={};return o.forEach(s=>{a[s]=n[s](i)}),a}}if(r==="number"){const o=e-t;return n=>t+n*o}throw new Error(`Cannot interpolate ${r} values`)}function tweened(t,e={}){const r=writable(t);let o,n=t;function i(a,s){if(t==null)return r.set(t=a),Promise.resolve();n=a;let l=o,u=!1,{delay:h=0,duration:c=400,easing:d=identity,interpolate:f=get_interpolator}=assign(assign({},e),s);if(c===0)return l&&(l.abort(),l=null),r.set(t=n),Promise.resolve();const m=now()+h;let p;return o=loop(y=>{if(yc?(r.set(t=a),!1):(r.set(t=p(d(v/c))),!0)}),o.promise}return{set:i,update:(a,s)=>i(a(n,t),s),subscribe:r.subscribe}}function create_if_block_1$2(t){let e,r,o,n,i,a,s,l,u=[t[11],{class:l=twMerge("flex justify-between mb-1",t[12].classLabelOutside)}],h={};for(let c=0;cr(8,i=_));const g={primary:"bg-primary-600",blue:"bg-blue-600",gray:"bg-gray-600 dark:bg-gray-300",red:"bg-red-600 dark:bg-red-500",green:"bg-green-600 dark:bg-green-500",yellow:"bg-yellow-400",purple:"bg-purple-600 dark:bg-purple-500",indigo:"bg-indigo-600 dark:bg-indigo-500"};return t.$$set=_=>{r(12,e=assign(assign({},e),exclude_internal_props(_))),r(11,n=compute_rest_props(e,o)),"progress"in _&&r(0,a=_.progress),"precision"in _&&r(1,s=_.precision),"tweenDuration"in _&&r(13,l=_.tweenDuration),"animate"in _&&r(14,u=_.animate),"size"in _&&r(2,h=_.size),"labelInside"in _&&r(3,c=_.labelInside),"labelOutside"in _&&r(4,d=_.labelOutside),"easing"in _&&r(15,f=_.easing),"color"in _&&r(5,m=_.color),"labelInsideClass"in _&&r(6,p=_.labelInsideClass),"divClass"in _&&r(7,y=_.divClass)},t.$$.update=()=>{t.$$.dirty&1&&v.set(Number(a))},e=exclude_internal_props(e),[a,s,h,c,d,m,p,y,i,v,g,n,e,l,u,f]}class Progressbar extends SvelteComponent{constructor(e){super(),init(this,e,instance$3,create_fragment$3,safe_not_equal,{progress:0,precision:1,tweenDuration:13,animate:14,size:2,labelInside:3,labelOutside:4,easing:15,color:5,labelInsideClass:6,divClass:7})}}function create_fragment$2(t){let e,r,o,n,i;const a=t[6].default,s=create_slot(a,t,t[5],null);let l=[t[3],{href:t[0]},{class:r=twMerge(t[2],t[1],t[4].class)}],u={};for(let h=0;h{r(4,e=assign(assign({},e),exclude_internal_props(c))),r(3,n=compute_rest_props(e,o)),"href"in c&&r(0,s=c.href),"color"in c&&r(1,l=c.color),"aClass"in c&&r(2,u=c.aClass),"$$scope"in c&&r(5,a=c.$$scope)},e=exclude_internal_props(e),[s,l,u,n,e,a,i,h]}class A extends SvelteComponent{constructor(e){super(),init(this,e,instance$2,create_fragment$2,safe_not_equal,{href:0,color:1,aClass:2})}}function get_each_context(t,e,r){const o=t.slice();return o[15]=e[r],o[17]=r,o}function create_else_block_1$1(t){let e=(t[15].climbingTime/1e3).toFixed(3)+"",r;return{c(){r=text(e)},l(o){r=claim_text(o,e)},m(o,n){insert_hydration(o,r,n)},p(o,n){n&1&&e!==(e=(o[15].climbingTime/1e3).toFixed(3)+"")&&set_data(r,e)},d(o){o&&detach(r)}}}function create_if_block_11(t){let e=(t[1]/1e3).toFixed(3)+"",r;return{c(){r=text(e)},l(o){r=claim_text(o,e)},m(o,n){insert_hydration(o,r,n)},p(o,n){n&2&&e!==(e=(o[1]/1e3).toFixed(3)+"")&&set_data(r,e)},d(o){o&&detach(r)}}}function create_if_block_10(t){let e;return{c(){e=text("FALL")},l(r){e=claim_text(r,"FALL")},m(r,o){insert_hydration(r,e,o)},p:noop$1,d(r){r&&detach(e)}}}function create_if_block_9(t){let e;return{c(){e=text("FALSE")},l(r){e=claim_text(r,"FALSE")},m(r,o){insert_hydration(r,e,o)},p:noop$1,d(r){r&&detach(e)}}}function create_if_block_8(t){let e,r,o,n=(t[15].reactionTime/1e3-3).toFixed(3)+"",i;return{c(){e=element("span"),r=text("reaction time: "),o=element("b"),i=text(n)},l(a){e=claim_element(a,"SPAN",{});var s=children(e);r=claim_text(s,"reaction time: "),o=claim_element(s,"B",{});var l=children(o);i=claim_text(l,n),l.forEach(detach),s.forEach(detach)},m(a,s){insert_hydration(a,e,s),append_hydration(e,r),append_hydration(e,o),append_hydration(o,i)},p(a,s){s&1&&n!==(n=(a[15].reactionTime/1e3-3).toFixed(3)+"")&&set_data(i,n)},d(a){a&&detach(e)}}}function create_if_block_7(t){let e,r;function o(){return t[12](t[17])}return e=new Button({props:{disabled:!1,class:"mt-3",color:"light",$$slots:{default:[create_default_slot_4$1]},$$scope:{ctx:t}}}),e.$on("click",o),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,i){mount_component(e,n,i),r=!0},p(n,i){t=n;const a={};i&262144&&(a.$$scope={dirty:i,ctx:t}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_if_block_6(t){let e;return{c(){e=text("READY")},l(r){e=claim_text(r,"READY")},m(r,o){insert_hydration(r,e,o)},p:noop$1,i:noop$1,o:noop$1,d(r){r&&detach(e)}}}function create_if_block_5(t){let e;return{c(){e=text("FOOT OK")},l(r){e=claim_text(r,"FOOT OK")},m(r,o){insert_hydration(r,e,o)},p:noop$1,i:noop$1,o:noop$1,d(r){r&&detach(e)}}}function create_if_block_4(t){let e,r;function o(){return t[11](t[17])}return e=new Button({props:{class:"mt-3",color:"light",$$slots:{default:[create_default_slot_3$1]},$$scope:{ctx:t}}}),e.$on("click",o),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,i){mount_component(e,n,i),r=!0},p(n,i){t=n;const a={};i&262144&&(a.$$scope={dirty:i,ctx:t}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_if_block_2$1(t){let e,r,o,n,i,a=(t[0].state===RaceFullState_State.IDLE||t[0].state===RaceFullState_State.IDLE_CLEAR_TO_START)&&create_if_block_3$1(t);return{c(){e=text("OFFLINE"),r=element("br"),o=space(),a&&a.c(),n=empty()},l(s){e=claim_text(s,"OFFLINE"),r=claim_element(s,"BR",{}),o=claim_space(s),a&&a.l(s),n=empty()},m(s,l){insert_hydration(s,e,l),insert_hydration(s,r,l),insert_hydration(s,o,l),a&&a.m(s,l),insert_hydration(s,n,l),i=!0},p(s,l){s[0].state===RaceFullState_State.IDLE||s[0].state===RaceFullState_State.IDLE_CLEAR_TO_START?a?(a.p(s,l),l&1&&transition_in(a,1)):(a=create_if_block_3$1(s),a.c(),transition_in(a,1),a.m(n.parentNode,n)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros())},i(s){i||(transition_in(a),i=!0)},o(s){transition_out(a),i=!1},d(s){s&&(detach(e),detach(r),detach(o),detach(n)),a&&a.d(s)}}}function create_default_slot_4$1(t){let e;return{c(){e=text("disable")},l(r){e=claim_text(r,"disable")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_default_slot_3$1(t){let e;return{c(){e=text("fall")},l(r){e=claim_text(r,"fall")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_if_block_3$1(t){let e,r;function o(){return t[10](t[17])}return e=new Button({props:{class:"mt-3",color:"light",$$slots:{default:[create_default_slot_2$1]},$$scope:{ctx:t}}}),e.$on("click",o),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,i){mount_component(e,n,i),r=!0},p(n,i){t=n;const a={};i&262144&&(a.$$scope={dirty:i,ctx:t}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_default_slot_2$1(t){let e;return{c(){e=text("enable")},l(r){e=claim_text(r,"enable")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_each_block(t){let e,r,o,n,i,a,s,l,u,h;function c(g,_){return _&3&&(o=null),g[15].state===LaneFullState_State.FALSE_START?create_if_block_9:g[15].state===LaneFullState_State.FALL?create_if_block_10:(o==null&&(o=!!([LaneFullState_State.RUNNING_FOOT_DOWN,LaneFullState_State.RUNNING].includes(g[15].state)&&g[1]!==void 0)),o?create_if_block_11:create_else_block_1$1)}let d=c(t,-1),f=d(t),m=t[15].reactionTime>0&&create_if_block_8(t);const p=[create_if_block_2$1,create_if_block_4,create_if_block_5,create_if_block_6,create_if_block_7],y=[];function v(g,_){return g[15].state===LaneFullState_State.DISABLED?0:g[15].state===LaneFullState_State.RUNNING?1:g[15].state===LaneFullState_State.IDLE_FOOT_DOWN?2:g[15].state===LaneFullState_State.READY_FOOT_DOWN?3:g[15].state===LaneFullState_State.IDLE?4:-1}return~(s=v(t))&&(l=y[s]=p[s](t)),{c(){e=element("div"),r=element("span"),f.c(),n=space(),i=element("span"),m&&m.c(),a=space(),l&&l.c(),u=space(),this.h()},l(g){e=claim_element(g,"DIV",{class:!0});var _=children(e);r=claim_element(_,"SPAN",{class:!0,style:!0});var b=children(r);f.l(b),b.forEach(detach),n=claim_space(_),i=claim_element(_,"SPAN",{class:!0});var w=children(i);m&&m.l(w),a=claim_space(w),l&&l.l(w),w.forEach(detach),u=claim_space(_),_.forEach(detach),this.h()},h(){attr(r,"class","text-9xl font-bold"),set_style(r,"color",t[5](t[15])),attr(i,"class","text-3xl flex flex-col"),attr(e,"class","flex flex-grow flex-col items-center")},m(g,_){insert_hydration(g,e,_),append_hydration(e,r),f.m(r,null),append_hydration(e,n),append_hydration(e,i),m&&m.m(i,null),append_hydration(i,a),~s&&y[s].m(i,null),append_hydration(e,u),h=!0},p(g,_){d===(d=c(g,_))&&f?f.p(g,_):(f.d(1),f=d(g),f&&(f.c(),f.m(r,null))),(!h||_&1)&&set_style(r,"color",g[5](g[15])),g[15].reactionTime>0?m?m.p(g,_):(m=create_if_block_8(g),m.c(),m.m(i,a)):m&&(m.d(1),m=null);let b=s;s=v(g),s===b?~s&&y[s].p(g,_):(l&&(group_outros(),transition_out(y[b],1,1,()=>{y[b]=null}),check_outros()),~s?(l=y[s],l?l.p(g,_):(l=y[s]=p[s](g),l.c()),transition_in(l,1),l.m(i,null)):l=null)},i(g){h||(transition_in(l),h=!0)},o(g){transition_out(l),h=!1},d(g){g&&detach(e),f.d(),m&&m.d(),~s&&y[s].d()}}}function create_if_block_1$1(t){let e,r;return e=new Progressbar({props:{progress:t[4],animate:!0}}),{c(){create_component(e.$$.fragment)},l(o){claim_component(e.$$.fragment,o)},m(o,n){mount_component(e,o,n),r=!0},p(o,n){const i={};n&16&&(i.progress=o[4]),e.$set(i)},i(o){r||(transition_in(e.$$.fragment,o),r=!0)},o(o){transition_out(e.$$.fragment,o),r=!1},d(o){destroy_component(e,o)}}}function create_else_block$1(t){let e;return{c(){e=text("RESET")},l(r){e=claim_text(r,"RESET")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_if_block$1(t){let e;return{c(){e=text("READY")},l(r){e=claim_text(r,"READY")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_default_slot_1$1(t){let e,r;function o(a,s){return s&1&&(e=null),e==null&&(e=!![RaceFullState_State.IDLE,RaceFullState_State.IDLE_CLEAR_TO_START].includes(a[0].state)),e?create_if_block$1:create_else_block$1}let n=o(t,-1),i=n(t);return{c(){i.c(),r=empty()},l(a){i.l(a),r=empty()},m(a,s){i.m(a,s),insert_hydration(a,r,s)},p(a,s){n!==(n=o(a,s))&&(i.d(1),i=n(a),i&&(i.c(),i.m(r.parentNode,r)))},d(a){a&&detach(r),i.d(a)}}}function create_default_slot$1(t){let e;return{c(){e=text("Autostart")},l(r){e=claim_text(r,"Autostart")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_fragment$1(t){let e,r,o=t[0].state+"",n,i,a,s,l,u,h,c,d,f,m=ensure_array_like(t[0].laneStates),p=[];for(let b=0;btransition_out(p[b],1,1,()=>{p[b]=null});let v=t[4]&&create_if_block_1$1(t);u=new Button({props:{size:"xl",class:"w-full py-10 mt-6",disabled:![RaceFullState_State.IDLE_CLEAR_TO_START,RaceFullState_State.RUNNING,RaceFullState_State.FINISHED,RaceFullState_State.FINISHED_MUTED].includes(t[0].state),$$slots:{default:[create_default_slot_1$1]},$$scope:{ctx:t}}}),u.$on("click",t[6]);function g(b){t[13](b)}let _={$$slots:{default:[create_default_slot$1]},$$scope:{ctx:t}};return t[3]!==void 0&&(_.checked=t[3]),c=new Toggle({props:_}),binding_callbacks.push(()=>bind(c,"checked",g)),c.$on("click",t[14]),{c(){e=element("div"),r=text("Race state: "),n=text(o),i=space(),a=element("div");for(let b=0;b{v=null}),check_outros());const k={};w&1&&(k.disabled=![RaceFullState_State.IDLE_CLEAR_TO_START,RaceFullState_State.RUNNING,RaceFullState_State.FINISHED,RaceFullState_State.FINISHED_MUTED].includes(b[0].state)),w&262145&&(k.$$scope={dirty:w,ctx:b}),u.$set(k);const x={};w&262144&&(x.$$scope={dirty:w,ctx:b}),!d&&w&8&&(d=!0,x.checked=b[3],add_flush_callback(()=>d=!1)),c.$set(x)},i(b){if(!f){for(let w=0;wr(2,o=g));let{raceFullState:n}=e,i,a;const s=g=>{switch(g.state){case LaneFullState_State.IDLE:return"red";case LaneFullState_State.IDLE_FOOT_DOWN:return"yellow";case LaneFullState_State.READY_FOOT_DOWN:return"yellow";case LaneFullState_State.RUNNING_FOOT_DOWN:case LaneFullState_State.RUNNING:return"red";case LaneFullState_State.FALSE_START:return"red";case LaneFullState_State.FALSE_START_TIE:return"yellow";case LaneFullState_State.WILDCARD:return"green";case LaneFullState_State.FINISHED_TIE:return"yellow";case LaneFullState_State.FALL:return"red";case LaneFullState_State.UNRECOGNIZED:return"gray";case LaneFullState_State.FINISHED:return"red";case LaneFullState_State.FINISHED_WINNER:return"green";case LaneFullState_State.DISABLED:return"gray"}};onMount(()=>{setInterval(()=>{if(i===void 0){r(1,a=void 0);return}let g=performance.now()-i;const _=n.state===RaceFullState_State.IDLE_CLEAR_TO_START?10:100;r(1,a=g-g%_)},100)});const l=()=>{n.state===RaceFullState_State.IDLE_CLEAR_TO_START?sendCommand(Command.create({start:{}})):sendCommand(Command.create({reset:{}}))},u=(g,_)=>{sendCommand(Command.create({disable:{laneNumber:g,disabled:_}}))},h=g=>{sendCommand(Command.create({fall:{laneNumber:g}}))};let c=!1,d=0;const f=g=>{u(g,!1)},m=g=>{h(g)},p=g=>{u(g,!0)};function y(g){c=g,r(3,c),r(2,o)}const v=()=>{let g=o;g.race!==void 0&&(c?g.race.startProcedure={manualStartProcedureSettings:{},automatedStartProcedureSettings:void 0}:g.race.startProcedure={manualStartProcedureSettings:void 0,automatedStartProcedureSettings:{sayReady:!0,standstillDurationBeforeReady:3e3}},console.log("Setting settings to:",g),writeSettings(g))};return t.$$set=g=>{"raceFullState"in g&&r(0,n=g.raceFullState)},t.$$.update=()=>{var g,_,b,w,k;if(t.$$.dirty&513&&(n.state===RaceFullState_State.RUNNING&&i===void 0||n.state===RaceFullState_State.IDLE_CLEAR_TO_START&&i===void 0?r(9,i=performance.now()):n.state!==RaceFullState_State.RUNNING&&n.state!==RaceFullState_State.IDLE_CLEAR_TO_START&&r(9,i=void 0)),t.$$.dirty&7)if(((_=(g=o.race)==null?void 0:g.startProcedure)==null?void 0:_.automatedStartProcedureSettings)===void 0||n.state!==RaceFullState_State.IDLE_CLEAR_TO_START)r(4,d=void 0);else{let x=(a??0)/o.race.startProcedure.automatedStartProcedureSettings.standstillDurationBeforeReady*100;r(4,d=Math.min(100,Math.max(0,x)))}t.$$.dirty&4&&r(3,c=(k=(w=(b=o.race)==null?void 0:b.startProcedure)==null?void 0:w.automatedStartProcedureSettings)==null?void 0:k.sayReady)},[n,a,o,c,d,s,l,u,h,i,f,m,p,y,v]}class Timer extends SvelteComponent{constructor(e){super(),init(this,e,instance$1,create_fragment$1,safe_not_equal,{raceFullState:0})}}var uaParser={exports:{}};(function(t,e){(function(r,o){var n="1.0.36",i="",a="?",s="function",l="undefined",u="object",h="string",c="major",d="model",f="name",m="type",p="vendor",y="version",v="architecture",g="console",_="mobile",b="tablet",w="smarttv",k="wearable",x="embedded",D=350,I="Amazon",L="Apple",M="ASUS",N="BlackBerry",U="Browser",S="Chrome",F="Edge",X="Firefox",ne="Google",oe="Huawei",$="LG",Y="Microsoft",ee="Motorola",K="Opera",G="Samsung",le="Sharp",ue="Sony",fe="Xiaomi",he="Zebra",H="Facebook",R="Chromium OS",O="Mac OS",E=function(z,W){var P={};for(var J in z)W[J]&&W[J].length%2===0?P[J]=W[J].concat(z[J]):P[J]=z[J];return P},T=function(z){for(var W={},P=0;P0?V.length===2?typeof V[1]==s?this[V[0]]=V[1].call(this,ie):this[V[0]]=V[1]:V.length===3?typeof V[1]===s&&!(V[1].exec&&V[1].test)?this[V[0]]=ie?V[1].call(this,ie,V[2]):o:this[V[0]]=ie?ie.replace(V[1],V[2]):o:V.length===4&&(this[V[0]]=ie?V[3].call(this,ie.replace(V[1],V[2])):o):this[V]=ie||o;P+=2}},ae=function(z,W){for(var P in W)if(typeof W[P]===u&&W[P].length>0){for(var J=0;J2&&(B[d]="iPad",B[m]=b),B},this.getEngine=function(){var B={};return B[f]=o,B[y]=o,Z.call(B,J,re.engine),B},this.getOS=function(){var B={};return B[f]=o,B[y]=o,Z.call(B,J,re.os),V&&!B[f]&&se&&se.platform!="Unknown"&&(B[f]=se.platform.replace(/chrome os/i,R).replace(/macos/i,O)),B},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return J},this.setUA=function(B){return J=typeof B===h&&B.length>D?Q(B,D):B,this},this.setUA(J),this};te.VERSION=n,te.BROWSER=T([f,y,c]),te.CPU=T([v]),te.DEVICE=T([d,p,m,g,_,w,b,k,x]),te.ENGINE=te.OS=T([f,y]),t.exports&&(e=t.exports=te),e.UAParser=te;var de=typeof r!==l&&(r.jQuery||r.Zepto);if(de&&!de.ua){var me=new te;de.ua=me.getResult(),de.ua.get=function(){return me.getUA()},de.ua.set=function(z){me.setUA(z);var W=me.getResult();for(var P in W)de.ua[P]=W[P]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const _page_svelte_svelte_type_style_lang="";function create_else_block_1(t){let e,r;return e=new Alert({props:{color:"yellow",$$slots:{default:[create_default_slot_4]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(o){claim_component(e.$$.fragment,o)},m(o,n){mount_component(e,o,n),r=!0},p(o,n){const i={};n&16&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){r||(transition_in(e.$$.fragment,o),r=!0)},o(o){transition_out(e.$$.fragment,o),r=!1},d(o){destroy_component(e,o)}}}function create_if_block_3(t){let e,r;return e=new Timer({props:{raceFullState:t[1]}}),{c(){create_component(e.$$.fragment)},l(o){claim_component(e.$$.fragment,o)},m(o,n){mount_component(e,o,n),r=!0},p(o,n){const i={};n&2&&(i.raceFullState=o[1]),e.$set(i)},i(o){r||(transition_in(e.$$.fragment,o),r=!0)},o(o){transition_out(e.$$.fragment,o),r=!1},d(o){destroy_component(e,o)}}}function create_if_block_1(t){let e,r,o,n,i,a,s,l,u,h,c;o=new A({props:{class:"font-bold",href:"https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#browser_compatibility",$$slots:{default:[create_default_slot_3]},$$scope:{ctx:t}}});const d=[create_if_block_2,create_else_block],f=[];function m(p,y){return p[2].getOS().name==="iOS"?0:1}return l=m(t),u=f[l]=d[l](t),{c(){e=element("span"),r=text("Your Browser is not compatible with this website, as it does not support "),create_component(o.$$.fragment),n=text("."),i=space(),a=element("span"),s=text(`Please use a browser which supports web bluetooth, for example `),u.c(),h=text("."),this.h()},l(p){e=claim_element(p,"SPAN",{class:!0});var y=children(e);r=claim_text(y,"Your Browser is not compatible with this website, as it does not support "),claim_component(o.$$.fragment,y),n=claim_text(y,"."),y.forEach(detach),i=claim_space(p),a=claim_element(p,"SPAN",{class:!0});var v=children(a);s=claim_text(v,`Please use a browser which supports web bluetooth, for example `),u.l(v),h=claim_text(v,"."),v.forEach(detach),this.h()},h(){attr(e,"class","text-xl text-white rounded-md font-bold border-primary-600 border-4 border-r-4 p-3"),attr(a,"class","text-xl mt-3")},m(p,y){insert_hydration(p,e,y),append_hydration(e,r),mount_component(o,e,null),append_hydration(e,n),insert_hydration(p,i,y),insert_hydration(p,a,y),append_hydration(a,s),f[l].m(a,null),append_hydration(a,h),c=!0},p(p,y){const v={};y&16&&(v.$$scope={dirty:y,ctx:p}),o.$set(v)},i(p){c||(transition_in(o.$$.fragment,p),transition_in(u),c=!0)},o(p){transition_out(o.$$.fragment,p),transition_out(u),c=!1},d(p){p&&(detach(e),detach(i),detach(a)),destroy_component(o),f[l].d()}}}function create_if_block(t){let e,r;return e=new Button({props:{$$slots:{default:[create_default_slot]},$$scope:{ctx:t}}}),e.$on("click",t[3]),{c(){create_component(e.$$.fragment)},l(o){claim_component(e.$$.fragment,o)},m(o,n){mount_component(e,o,n),r=!0},p(o,n){const i={};n&16&&(i.$$scope={dirty:n,ctx:o}),e.$set(i)},i(o){r||(transition_in(e.$$.fragment,o),r=!0)},o(o){transition_out(e.$$.fragment,o),r=!1},d(o){destroy_component(e,o)}}}function create_default_slot_4(t){let e;return{c(){e=text("Connecting...")},l(r){e=claim_text(r,"Connecting...")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_default_slot_3(t){let e;return{c(){e=text(`web bluetooth `)},l(r){e=claim_text(r,`web bluetooth `)},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_else_block(t){let e,r,o;return e=new A({props:{href:"https://www.google.com/chrome/",$$slots:{default:[create_default_slot_2]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment),r=space()},l(n){claim_component(e.$$.fragment,n),r=claim_space(n)},m(n,i){mount_component(e,n,i),insert_hydration(n,r,i),o=!0},i(n){o||(transition_in(e.$$.fragment,n),o=!0)},o(n){transition_out(e.$$.fragment,n),o=!1},d(n){n&&detach(r),destroy_component(e,n)}}}function create_if_block_2(t){let e,r,o;return e=new A({props:{href:"https://apps.apple.com/us/app/bluefy-web-ble-browser/id1492822055",$$slots:{default:[create_default_slot_1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment),r=space()},l(n){claim_component(e.$$.fragment,n),r=claim_space(n)},m(n,i){mount_component(e,n,i),insert_hydration(n,r,i),o=!0},i(n){o||(transition_in(e.$$.fragment,n),o=!0)},o(n){transition_out(e.$$.fragment,n),o=!1},d(n){n&&detach(r),destroy_component(e,n)}}}function create_default_slot_2(t){let e;return{c(){e=text("Google Chrome")},l(r){e=claim_text(r,"Google Chrome")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_default_slot_1(t){let e;return{c(){e=text("Bluefy")},l(r){e=claim_text(r,"Bluefy")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_default_slot(t){let e;return{c(){e=text("Connect")},l(r){e=claim_text(r,"Connect")},m(r,o){insert_hydration(r,e,o)},d(r){r&&detach(e)}}}function create_fragment(t){let e,r,o,n;const i=[create_if_block,create_if_block_1,create_if_block_3,create_else_block_1],a=[];function s(l,u){return l[0]=="DISCONNECTED"?0:l[0]=="UNAVAILABLE"?1:l[0]=="CONNECTED"&&l[1]?2:3}return r=s(t),o=a[r]=i[r](t),{c(){e=element("div"),o.c(),this.h()},l(l){e=claim_element(l,"DIV",{class:!0});var u=children(e);o.l(u),u.forEach(detach),this.h()},h(){attr(e,"class","p-8 flex flex-col")},m(l,u){insert_hydration(l,e,u),a[r].m(e,null),n=!0},p(l,[u]){let h=r;r=s(l),r===h?a[r].p(l,u):(group_outros(),transition_out(a[h],1,1,()=>{a[h]=null}),check_outros(),o=a[r],o?o.p(l,u):(o=a[r]=i[r](l),o.c()),transition_in(o,1),o.m(e,null))},i(l){n||(transition_in(o),n=!0)},o(l){transition_out(o),n=!1},d(l){l&&detach(e),a[r].d()}}}function instance(t,e,r){let o,n;component_subscribe(t,bluetoothState,s=>r(0,o=s)),component_subscribe(t,raceFullState,s=>r(1,n=s));const i=new uaParserExports.UAParser,a=()=>{startBluetooth()};return checkAvailability(),[o,n,i,a]}class Page extends SvelteComponent{constructor(e){super(),init(this,e,instance,create_fragment,safe_not_equal,{})}}export{Page as component,_page as universal};