1import{o as e,t}from"./rolldown-runtime.C0FnF6B9.js";import{t as n}from"./loglevel.xXLtmX_e.js";import{C as r,P as i,d as a,g as o,q as s,s as c,t as l}from"./protobuf.Bpsvwqxh.js";import{C as u,E as d,S as f,_ as p,b as ee,g as te,n as m,t as h,v as g,x as ne}from"./getColors.CymiOtHO.js";import{n as _,t as re}from"./types.cZoyy9Y-.js";import{o as v}from"./isArrayLike.Crw2F5li.js";import{c as y,f as b,n as x,r as S,t as ie}from"./merge.D4_AOTv8.js";import{p as C}from"./isArrayLikeObject.B3Zf3PTL.js";var ae=`Expected a function`;function oe(e,t){var n;if(typeof t!=`function`)throw TypeError(ae);return e=b(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var w=y(function(e,t,n,r){x(e,t,n,r)});function T(e){return oe(2,e)}var se=t(((e,t)=>{(function(e){n(36**5),n(16**7),n(10**9),n(2**30),n(36),n(16),n(10),n(2);function n(e,t){if(!(this instanceof n))return new n(e,t);if(this._low=0,this._high=0,this.remainder=null,t===void 0)return i.call(this,e);if(typeof e==`string`)return a.call(this,e,t);r.call(this,e,t)}function r(e,t){return this._low=e|0,this._high=t|0,this}n.prototype.fromBits=r;function i(e){return this._low=e&65535,this._high=e>>>16,this}n.prototype.fromNumber=i;function a(e,t){var n=parseInt(e,t||10);return this._low=n&65535,this._high=n>>>16,this}n.prototype.fromString=a,n.prototype.toNumber=function(){return this._high*65536+this._low},n.prototype.toString=function(e){return this.toNumber().toString(e||10)},n.prototype.add=function(e){var t=this._low+e._low,n=t>>>16;return n+=this._high+e._high,this._low=t&65535,this._high=n&65535,this},n.prototype.subtract=function(e){return this.add(e.clone().negate())},n.prototype.multiply=function(e){var t=this._high,n=this._low,r=e._high,i=e._low,a,o=n*i;return a=o>>>16,a+=t*i,a&=65535,a+=n*r,this._low=o&65535,this._high=a&65535,this},n.prototype.div=function(e){if(e._low==0&&e._high==0)throw Error(`division by zero`);if(e._high==0&&e._low==1)return this.remainder=new n(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new n(0),this._low=1,this._high=0,this;for(var t=e.clone(),r=-1;!this.lt(t);)t.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._low=0,this._high=0;r>=0;r--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),r>=16?this._high|=1<<r-16:this._low|=1<<r);return this},n.prototype.negate=function(){var e=(~this._low&65535)+1;return this._low=e&65535,this._high=~this._high+(e>>>16)&65535,this},n.prototype.equals=n.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},n.prototype.greaterThan=n.prototype.gt=function(e){return this._high>e._high?!0:this._high<e._high?!1:this._low>e._low},n.prototype.lessThan=n.prototype.lt=function(e){return this._high<e._high?!0:this._high>e._high?!1:this._low<e._low},n.prototype.or=function(e){return this._low|=e._low,this._high|=e._high,this},n.prototype.and=function(e){return this._low&=e._low,this._high&=e._high,this},n.prototype.not=function(){return this._low=~this._low&65535,this._high=~this._high&65535,this},n.prototype.xor=function(e){return this._low^=e._low,this._high^=e._high,this},n.prototype.shiftRight=n.prototype.shiftr=function(e){return e>16?(this._low=this._high>>e-16,this._high=0):e==16?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},n.prototype.shiftLeft=n.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<<e-16,this._low=0,t||(this._high&=65535)):e==16?(this._high=this._low,this._low=0):(this._high=this._high<<e|this._low>>16-e,this._low=this._low<<e&65535,t||(this._high&=65535)),this},n.prototype.rotateLeft=n.prototype.rotl=function(e){var t=this._high<<16|this._low;return t=t<<e|t>>>32-e,this._low=t&65535,this._high=t>>>16,this},n.prototype.rotateRight=n.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=t&65535,this._high=t>>>16,this},n.prototype.clone=function(){return new n(this._low,this._high)},typeof define<`u`&&define.amd?define([],function(){return n}):t!==void 0&&t.exports?t.exports=n:e.UINT32=n})(e)})),ce=t(((e,t)=>{(function(e){var n={16:i(16**5),10:i(10**5),2:i(32)},r={16:i(16),10:i(10),2:i(2)};function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);if(this.remainder=null,typeof e==`string`)return s.call(this,e,t);if(t===void 0)return o.call(this,e);a.apply(this,arguments)}function a(e,t,n,r){return n===void 0?(this._a00=e&65535,this._a16=e>>>16,this._a32=t&65535,this._a48=t>>>16,this):(this._a00=e|0,this._a16=t|0,this._a32=n|0,this._a48=r|0,this)}i.prototype.fromBits=a;function o(e){return this._a00=e&65535,this._a16=e>>>16,this._a32=0,this._a48=0,this}i.prototype.fromNumber=o;function s(e,t){t||=10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var r=n[t]||new i(t**5),a=0,o=e.length;a<o;a+=5){var s=Math.min(5,o-a),c=parseInt(e.slice(a,a+s),t);this.multiply(s<5?new i(t**+s):r).add(new i(c))}return this}i.prototype.fromString=s,i.prototype.toNumber=function(){return this._a16*65536+this._a00},i.prototype.toString=function(e){e||=10;var t=r[e]||new i(e);if(!this.gt(t))return this.toNumber().toString(e);for(var n=this.clone(),a=Array(64),o=63;o>=0&&(n.div(t),a[o]=n.remainder.toNumber().toString(e),n.gt(t));o--);return a[o-1]=n.toNumber().toString(e),a.join(``)},i.prototype.add=function(e){var t=this._a00+e._a00,n=t>>>16;n+=this._a16+e._a16;var r=n>>>16;r+=this._a32+e._a32;var i=r>>>16;return i+=this._a48+e._a48,this._a00=t&65535,this._a16=n&65535,this._a32=r&65535,this._a48=i&65535,this},i.prototype.subtract=function(e){return this.add(e.clone().negate())},i.prototype.multiply=function(e){var t=this._a00,n=this._a16,r=this._a32,i=this._a48,a=e._a00,o=e._a16,s=e._a32,c=e._a48,l=t*a,u=l>>>16;u+=t*o;var d=u>>>16;u&=65535,u+=n*a,d+=u>>>16,d+=t*s;var f=d>>>16;return d&=65535,d+=n*o,f+=d>>>16,d&=65535,d+=r*a,f+=d>>>16,f+=t*c,f&=65535,f+=n*s,f&=65535,f+=r*o,f&=65535,f+=i*a,this._a00=l&65535,this._a16=u&65535,this._a32=d&65535,this._a48=f&65535,this},i.prototype.div=function(e){if(e._a16==0&&e._a32==0&&e._a48==0){if(e._a00==0)throw Error(`division by zero`);if(e._a00==1)return this.remainder=new i(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new i(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),n=-1;!this.lt(t);)t.shiftLeft(1,!0),n++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;n>=0;n--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),n>=48?this._a48|=1<<n-48:n>=32?this._a32|=1<<n-32:n>=16?this._a16|=1<<n-16:this._a00|=1<<n);return this},i.prototype.negate=function(){var e=(~this._a00&65535)+1;return this._a00=e&65535,e=(~this._a16&65535)+(e>>>16),this._a16=e&65535,e=(~this._a32&65535)+(e>>>16),this._a32=e&65535,this._a48=~this._a48+(e>>>16)&65535,this},i.prototype.equals=i.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},i.prototype.greaterThan=i.prototype.gt=function(e){return this._a48>e._a48?!0:this._a48<e._a48?!1:this._a32>e._a32?!0:this._a32<e._a32?!1:this._a16>e._a16?!0:this._a16<e._a16?!1:this._a00>e._a00},i.prototype.lessThan=i.prototype.lt=function(e){return this._a48<e._a48?!0:this._a48>e._a48?!1:this._a32<e._a32?!0:this._a32>e._a32?!1:this._a16<e._a16?!0:this._a16>e._a16?!1:this._a00<e._a00},i.prototype.or=function(e){return this._a00|=e._a00,this._a16|=e._a16,this._a32|=e._a32,this._a48|=e._a48,this},i.prototype.and=function(e){return this._a00&=e._a00,this._a16&=e._a16,this._a32&=e._a32,this._a48&=e._a48,this},i.prototype.xor=function(e){return this._a00^=e._a00,this._a16^=e._a16,this._a32^=e._a32,this._a48^=e._a48,this},i.prototype.not=function(){return this._a00=~this._a00&65535,this._a16=~this._a16&65535,this._a32=~this._a32&65535,this._a48=~this._a48&65535,this},i.prototype.shiftRight=i.prototype.shiftr=function(e){return e%=64,e>=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=(this._a32>>e|this._a48<<16-e)&65535,this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=(this._a16>>e|this._a32<<16-e)&65535,this._a16=(this._a32>>e|this._a48<<16-e)&65535,this._a32=this._a48>>e&65535,this._a48=0):(this._a00=(this._a00>>e|this._a16<<16-e)&65535,this._a16=(this._a16>>e|this._a32<<16-e)&65535,this._a32=(this._a32>>e|this._a48<<16-e)&65535,this._a48=this._a48>>e&65535),this},i.prototype.shiftLeft=i.prototype.shiftl=function(e,t){return e%=64,e>=48?(this._a48=this._a00<<e-48,this._a32=0,this._a16=0,this._a00=0):e>=32?(e-=32,this._a48=this._a16<<e|this._a00>>16-e,this._a32=this._a00<<e&65535,this._a16=0,this._a00=0):e>=16?(e-=16,this._a48=this._a32<<e|this._a16>>16-e,this._a32=(this._a16<<e|this._a00>>16-e)&65535,this._a16=this._a00<<e&65535,this._a00=0):(this._a48=this._a48<<e|this._a32>>16-e,this._a32=(this._a32<<e|this._a16>>16-e)&65535,this._a16=(this._a16<<e|this._a00>>16-e)&65535,this._a00=this._a00<<e&65535),t||(this._a48&=65535),this},i.prototype.rotateLeft=i.prototype.rotl=function(e){if(e%=64,e==0)return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,e==32)return this;e-=32}var n=this._a48<<16|this._a32,r=this._a16<<16|this._a00,i=n<<e|r>>>32-e,a=r<<e|n>>>32-e;return this._a00=a&65535,this._a16=a>>>16,this._a32=i&65535,this._a48=i>>>16,this},i.prototype.rotateRight=i.prototype.rotr=function(e){if(e%=64,e==0)return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,e==32)return this;e-=32}var n=this._a48<<16|this._a32,r=this._a16<<16|this._a00,i=n>>>e|r<<32-e,a=r>>>e|n<<32-e;return this._a00=a&65535,this._a16=a>>>16,this._a32=i&65535,this._a48=i>>>16,this},i.prototype.clone=function(){return new i(this._a00,this._a16,this._a32,this._a48)},typeof define<`u`&&define.amd?define([],function(){return i}):t!==void 0&&t.exports?t.exports=i:e.UINT64=i})(e)})),E=t((e=>{e.UINT32=se(),e.UINT64=ce()})),le=t(((e,t)=>{var n=E().UINT32;n.prototype.xxh_update=function(e,t){var n=i._low,a=i._high,o,s=e*n;o=s>>>16,o+=t*n,o&=65535,o+=e*a;var c=this._low+(s&65535),l=c>>>16;l+=this._high+(o&65535);var u=l<<16|c&65535;u=u<<13|u>>>19,c=u&65535,l=u>>>16,n=r._low,a=r._high,s=c*n,o=s>>>16,o+=l*n,o&=65535,o+=c*a,this._low=s&65535,this._high=o&65535};
1var r=n(`2654435761`),i=n(`2246822519`),a=n(`3266489917`),o=n(`668265263`),s=n(`374761393`);function c(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);i<128?t.push(i):i<2048?t.push(192|i>>6,128|i&63):i<55296||i>=57344?t.push(224|i>>12,128|i>>6&63,128|i&63):(n++,i=65536+((i&1023)<<10|e.charCodeAt(n)&1023),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return new Uint8Array(t)}function l(){if(arguments.length==2)return new l(arguments[1]).update(arguments[0]).digest();if(!(this instanceof l))return new l(arguments[0]);u.call(this,arguments[0])}function u(e){return this.seed=e instanceof n?e.clone():n(e),this.v1=this.seed.clone().add(r).add(i),this.v2=this.seed.clone().add(i),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(r),this.total_len=0,this.memsize=0,this.memory=null,this}l.prototype.init=u,l.prototype.update=function(e){var t=typeof e==`string`,n;t&&(e=c(e),t=!1,n=!0),typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer&&(n=!0,e=new Uint8Array(e));var r=0,i=e.length,a=r+i;if(i==0)return this;if(this.total_len+=i,this.memsize==0&&(this.memory=t?``:n?new Uint8Array(16):new Buffer(16)),this.memsize+i<16)return t?this.memory+=e:n?this.memory.set(e.subarray(0,i),this.memsize):e.copy(this.memory,this.memsize,0,i),this.memsize+=i,this;if(this.memsize>0){t?this.memory+=e.slice(0,16-this.memsize):n?this.memory.set(e.subarray(0,16-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,16-this.memsize);var o=0;t?(this.v1.xxh_update(this.memory.charCodeAt(o+1)<<8|this.memory.charCodeAt(o),this.memory.charCodeAt(o+3)<<8|this.memory.charCodeAt(o+2)),o+=4,this.v2.xxh_update(this.memory.charCodeAt(o+1)<<8|this.memory.charCodeAt(o),this.memory.charCodeAt(o+3)<<8|this.memory.charCodeAt(o+2)),o+=4,this.v3.xxh_update(this.memory.charCodeAt(o+1)<<8|this.memory.charCodeAt(o),this.memory.charCodeAt(o+3)<<8|this.memory.charCodeAt(o+2)),o+=4,this.v4.xxh_update(this.memory.charCodeAt(o+1)<<8|this.memory.charCodeAt(o),this.memory.charCodeAt(o+3)<<8|this.memory.charCodeAt(o+2))):(this.v1.xxh_update(this.memory[o+1]<<8|this.memory[o],this.memory[o+3]<<8|this.memory[o+2]),o+=4,this.v2.xxh_update(this.memory[o+1]<<8|this.memory[o],this.memory[o+3]<<8|this.memory[o+2]),o+=4,this.v3.xxh_update(this.memory[o+1]<<8|this.memory[o],this.memory[o+3]<<8|this.memory[o+2]),o+=4,this.v4.xxh_update(this.memory[o+1]<<8|this.memory[o],this.memory[o+3]<<8|this.memory[o+2])),r+=16-this.memsize,this.memsize=0,t&&(this.memory=``)}if(r<=a-16){var s=a-16;do t?(this.v1.xxh_update(e.charCodeAt(r+1)<<8|e.charCodeAt(r),e.charCodeAt(r+3)<<8|e.charCodeAt(r+2)),r+=4,this.v2.xxh_update(e.charCodeAt(r+1)<<8|e.charCodeAt(r),e.charCodeAt(r+3)<<8|e.charCodeAt(r+2)),r+=4,this.v3.xxh_update(e.charCodeAt(r+1)<<8|e.charCodeAt(r),e.charCodeAt(r+3)<<8|e.charCodeAt(r+2)),r+=4,this.v4.xxh_update(e.charCodeAt(r+1)<<8|e.charCodeAt(r),e.charCodeAt(r+3)<<8|e.charCodeAt(r+2))):(this.v1.xxh_update(e[r+1]<<8|e[r],e[r+3]<<8|e[r+2]),r+=4,this.v2.xxh_update(e[r+1]<<8|e[r],e[r+3]<<8|e[r+2]),r+=4,this.v3.xxh_update(e[r+1]<<8|e[r],e[r+3]<<8|e[r+2]),r+=4,this.v4.xxh_update(e[r+1]<<8|e[r],e[r+3]<<8|e[r+2])),r+=4;while(r<=s)}return r<a&&(t?this.memory+=e.slice(r):n?this.memory.set(e.subarray(r,a),this.memsize):e.copy(this.memory,this.memsize,r,a),this.memsize=a-r),this},l.prototype.digest=function(){var e=this.memory,t=typeof e==`string`,c=0,l=this.memsize,u,d,f=new n;for(u=this.total_len>=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(s),u.add(f.fromNumber(this.total_len));c<=l-4;)t?f.fromBits(e.charCodeAt(c+1)<<8|e.charCodeAt(c),e.charCodeAt(c+3)<<8|e.charCodeAt(c+2)):f.fromBits(e[c+1]<<8|e[c],e[c+3]<<8|e[c+2]),u.add(f.multiply(a)).rotl(17).multiply(o),c+=4;for(;c<l;)f.fromBits(t?e.charCodeAt(c++):e[c++],0),u.add(f.multiply(s)).rotl(11).multiply(r);return d=u.clone().shiftRight(15),u.xor(d).multiply(i),d=u.clone().shiftRight(13),u.xor(d).multiply(a),d=u.clone().shiftRight(16),u.xor(d),this.init(this.seed),u},t.exports=l})),ue=t(((e,t)=>{var n=E().UINT64,r=n(`11400714785074694791`),i=n(`14029467366897019727`),a=n(`1609587929392839161`),o=n(`9650029242287828579`),s=n(`2870177450012600261`);function c(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);i<128?t.push(i):i<2048?t.push(192|i>>6,128|i&63):i<55296||i>=57344?t.push(224|i>>12,128|i>>6&63,128|i&63):(n++,i=65536+((i&1023)<<10|e.charCodeAt(n)&1023),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return new Uint8Array(t)}function l(){if(arguments.length==2)return new l(arguments[1]).update(arguments[0]).digest();if(!(this instanceof l))return new l(arguments[0]);u.call(this,arguments[0])}function u(e){return this.seed=e instanceof n?e.clone():n(e),this.v1=this.seed.clone().add(r).add(i),this.v2=this.seed.clone().add(i),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(r),this.total_len=0,this.memsize=0,this.memory=null,this}l.prototype.init=u,l.prototype.update=function(e){var t=typeof e==`string`,a;t&&(e=c(e),t=!1,a=!0),typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer&&(a=!0,e=new Uint8Array(e));var o=0,s=e.length,l=o+s;if(s==0)return this;if(this.total_len+=s,this.memsize==0&&(this.memory=t?``:a?new Uint8Array(32):new Buffer(32)),this.memsize+s<32)return t?this.memory+=e:a?this.memory.set(e.subarray(0,s),this.memsize):e.copy(this.memory,this.memsize,0,s),this.memsize+=s,this;if(this.memsize>0){t?this.memory+=e.slice(0,32-this.memsize):a?this.memory.set(e.subarray(0,32-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,32-this.memsize);var u=0;
1if(t){var d=n(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6));this.v1.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v2.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v3.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v4.add(d.multiply(i)).rotl(31).multiply(r)}else{var d=n(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]);this.v1.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v2.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v3.add(d.multiply(i)).rotl(31).multiply(r),u+=8,d=n(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v4.add(d.multiply(i)).rotl(31).multiply(r)}o+=32-this.memsize,this.memsize=0,t&&(this.memory=``)}if(o<=l-32){var f=l-32;do{if(t){var d=n(e.charCodeAt(o+1)<<8|e.charCodeAt(o),e.charCodeAt(o+3)<<8|e.charCodeAt(o+2),e.charCodeAt(o+5)<<8|e.charCodeAt(o+4),e.charCodeAt(o+7)<<8|e.charCodeAt(o+6));this.v1.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e.charCodeAt(o+1)<<8|e.charCodeAt(o),e.charCodeAt(o+3)<<8|e.charCodeAt(o+2),e.charCodeAt(o+5)<<8|e.charCodeAt(o+4),e.charCodeAt(o+7)<<8|e.charCodeAt(o+6)),this.v2.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e.charCodeAt(o+1)<<8|e.charCodeAt(o),e.charCodeAt(o+3)<<8|e.charCodeAt(o+2),e.charCodeAt(o+5)<<8|e.charCodeAt(o+4),e.charCodeAt(o+7)<<8|e.charCodeAt(o+6)),this.v3.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e.charCodeAt(o+1)<<8|e.charCodeAt(o),e.charCodeAt(o+3)<<8|e.charCodeAt(o+2),e.charCodeAt(o+5)<<8|e.charCodeAt(o+4),e.charCodeAt(o+7)<<8|e.charCodeAt(o+6)),this.v4.add(d.multiply(i)).rotl(31).multiply(r)}else{var d=n(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]);this.v1.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),this.v2.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),this.v3.add(d.multiply(i)).rotl(31).multiply(r),o+=8,d=n(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),this.v4.add(d.multiply(i)).rotl(31).multiply(r)}o+=8}while(o<=f)}return o<l&&(t?this.memory+=e.slice(o):a?this.memory.set(e.subarray(o,l),this.memsize):e.copy(this.memory,this.memsize,o,l),this.memsize=l-o),this},l.prototype.digest=function(){var e=this.memory,t=typeof e==`string`,c=0,l=this.memsize,u,d,f=new n;for(this.total_len>=32?(u=this.v1.clone().rotl(1),u.add(this.v2.clone().rotl(7)),u.add(this.v3.clone().rotl(12)),u.add(this.v4.clone().rotl(18)),u.xor(this.v1.multiply(i).rotl(31).multiply(r)),u.multiply(r).add(o),u.xor(this.v2.multiply(i).rotl(31).multiply(r)),u.multiply(r).add(o),u.xor(this.v3.multiply(i).rotl(31).multiply(r)),u.multiply(r).add(o),u.xor(this.v4.multiply(i).rotl(31).multiply(r)),u.multiply(r).add(o)):u=this.seed.clone().add(s),u.add(f.fromNumber(this.total_len));c<=l-8;)t?f.fromBits(e.charCodeAt(c+1)<<8|e.charCodeAt(c),e.charCodeAt(c+3)<<8|e.charCodeAt(c+2),e.charCodeAt(c+5)<<8|e.charCodeAt(c+4),e.charCodeAt(c+7)<<8|e.charCodeAt(c+6)):f.fromBits(e[c+1]<<8|e[c],e[c+3]<<8|e[c+2],e[c+5]<<8|e[c+4],e[c+7]<<8|e[c+6]),f.multiply(i).rotl(31).multiply(r),u.xor(f).rotl(27).multiply(r).add(o),c+=8;for(c+4<=l&&(t?f.fromBits(e.charCodeAt(c+1)<<8|e.charCodeAt(c),e.charCodeAt(c+3)<<8|e.charCodeAt(c+2),0,0):f.fromBits(e[c+1]<<8|e[c],e[c+3]<<8|e[c+2],0,0),u.xor(f.multiply(r)).rotl(23).multiply(i).add(a),c+=4);c<l;)f.fromBits(t?e.charCodeAt(c++):e[c++],0,0,0),u.xor(f.multiply(s)).rotl(11).multiply(r);return d=u.clone().shiftRight(33),u.xor(d).multiply(i),d=u.clone().shiftRight(29),u.xor(d).multiply(a),d=u.clone().shiftRight(32),u.xor(d),this.init(this.seed),u},t.exports=l})),D=t(((e,t)=>{t.exports={h32:le(),h64:ue()}})),de=e(n(),1),fe=e(D(),1);function pe(e,t){let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r),n=null},e)}}var me=`embed`,O=`embed_options`,he=`show_toolbar`,k=`show_padding`,ge=`disable_scrolling`,A=`light_theme`,j=`dark_theme`,M=`true`,_e=`hide_loading_screen`,ve=`show_loading_screen_v1`,ye=[he,k,ge,A,j,_e,ve,`show_loading_screen_v2`,M],be=function(e){return e[e.NONE=0]=`NONE`,e[e.V1=1]=`V1`,e[e.V2=2]=`V2`,e}({});function N(e){let t=new Set;
1return new URLSearchParams(window.location.search).forEach((n,r)=>{r=r.toString().toLowerCase(),n=n.toString().toLowerCase(),r===e&&ye.includes(n)&&t.add(n)}),t}function xe(){if(!P())return``;let e=new URLSearchParams(window.location.search).getAll(O),t=[];return t.push([me,M]),e.forEach(e=>{t.push([O,e])}),new URLSearchParams(t).toString()}function Se(e,t){return e===void 0?t:t?e?`${t}&${e}`:t:e}function P(){return N(me).has(M)}function Ce(){return P()&&N(O).has(he)}function we(){return P()&&N(O).has(ge)}function Te(){return P()&&N(O).has(k)}function Ee(){return N(O).has(A)}function De(){return N(O).has(j)}function Oe(){return window.parent!==window}function ke(){let e;try{e=Oe()&&window.top?window.top.location.href:document.location.href}catch{e=document.location.href}let t=new URL(e);return t.search=``,t.hash=``,t.toString()}function Ae(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}-${String(e.getHours()).padStart(2,`0`)}-${String(e.getMinutes()).padStart(2,`0`)}-${String(e.getSeconds()).padStart(2,`0`)}`}function je(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Me(){return new Date().getTimezoneOffset()}function Ne(){return navigator.language}function Pe(){let e=N(O);return e.has(_e)?0:e.has(ve)?1:2}function Fe(e){return new o({alert:{body:e,format:l.Format.INFO}})}function Ie(){return new o({skeleton:{style:i.SkeletonStyle.APP}})}function Le(e){return fe.default.h32(e,3735928559).toString(16)}function Re(e){if(re(e))throw Error(`value is null`);return e}function ze(e){return e!==void 0}function Be(){return/Mac/i.test(navigator.platform)}function Ve(){return/^Win/i.test(navigator.platform)}function He(e,t,n){let r=t?n:new Date,i=r?`expires=${r.toUTCString()};`:``;document.cookie=`${e}=${t};${i}path=/`}function Ue(e){return e?e.startsWith(`$$ID`)&&e.split(`-`).length>=3:!1}function We(e){let t=C(e,[Re(e.type),`id`]);if(t&&Ue(t))return t}function Ge(e){return _(e)&&e.length>0}function Ke(e){return Ge(e.formId)}function qe(e,t,n,r=!1){let i=!1;return e===``&&(t.length===0?n?e=r?`Add options`:`Add an option`:(e=`No options to select`,i=!0):e=n?r?`Choose or add options`:`Choose or add an option`:r?`Choose options`:`Choose an option`),{placeholder:e,shouldDisable:i}}var Je=function(e){return e[e.Visible=0]=`Visible`,e[e.Hidden=1]=`Hidden`,e[e.Collapsed=2]=`Collapsed`,e}({});function Ye(e){switch(e){case r.LabelVisibilityOptions.VISIBLE:return 0;case r.LabelVisibilityOptions.HIDDEN:return 1;case r.LabelVisibilityOptions.COLLAPSED:return 2;default:return 0}}var Xe=function(e){return e[e.None=0]=`None`,e[e.Single=1]=`Single`,e[e.Multiple=2]=`Multiple`,e[e.Directory=3]=`Directory`,e}({});function Ze(e){switch(e){case c.AcceptFile.NONE:return 0;case c.AcceptFile.SINGLE:return 1;case c.AcceptFile.MULTIPLE:return 2;case c.AcceptFile.DIRECTORY:return 3;default:return u(e),0}}function F(e,t){for(let n=0;n<e.length;n++){let r=e[n].contentDocument;if(r&&r.getElementsByClassName(t).length>0)return e[n]}return null}function I(e){try{if(e.contentWindow===null)return!1;let t=(e.contentDocument||e.contentWindow.document).body.innerHTML;return t!==null&&t!==``}catch{return!1}}function Qe(e){if(!Oe())return null;let t=et(e),n=`iframe[title="streamlitApp"]`,r=window.document.querySelectorAll(n),i=F(r,t);if(i&&!I(i))return null;if(i)return i;if(window.parent&&(r=window.parent.document.querySelectorAll(n)),i=F(r,t),i&&!I(i))return null;if(i)return i;let a=window.document.getElementsByTagName(`iframe`);return i=F(a,t),i&&!I(i)?null:i||(window.parent&&(a=window.parent.document.getElementsByTagName(`iframe`)),i=F(a,t),i&&!I(i)?null:i)}function $e(){return Math.floor(Date.now()/1e3).toString(36)+Math.random().toString(36).slice(-6)}function et(e){return`stAppEmbeddingId-${e}`}function tt(e,t){return decodeURIComponent(e.replace(t,``).replace(RegExp(`^/?`),``).replace(RegExp(`/$`),``))}function L(e){return Object.keys(e).reduce((t,n)=>{let r=nt(n).replace(`.`,`_`),i=e[n];return i&&typeof i==`object`&&!Array.isArray(i)&&(i=L(i)),Array.isArray(i)&&(i=i.map(e=>typeof e==`object`&&e?L(e):e)),t[r]=i,t},{})}function nt(e){return e.length<2?e:e.replaceAll(/([\p{Lowercase_Letter}\d])(\p{Uppercase_Letter})/gu,`$1_$2`).replaceAll(/((?<![\p{Uppercase_Letter}\d])[\p{Uppercase_Letter}\d](?![\p{Uppercase_Letter}\d]))/gu,e=>e.toLowerCase()).replaceAll(/(?<!\p{Uppercase_Letter})(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu,(e,t,n)=>`${t}_${n.toLowerCase()}`)}var rt=2,it=`stActiveTheme-${window.location.pathname}`,at={CACHED_THEME_VERSION:rt,CACHED_THEME_BASE_KEY:it,ACTIVE_THEME:`${it}-v${rt}`},ot={tooltip:`0px 1px 4px rgba(0, 0, 0, 0.16)`,popover:`0px 4px 16px rgba(0, 0, 0, 0.16)`,toolbar:`1px 2px 8px rgba(0, 0, 0, 0.08)`,sidebar:`-2rem 0 2rem 2rem rgba(0, 0, 0, 0.16)`,none:`none`},st={tooltip:`0px 1px 4px rgba(0, 0, 0, 0.4)`,popover:`0px 4px 16px rgba(0, 0, 0, 0.7)`,toolbar:`1px 2px 8px rgba(0, 0, 0, 0.2)`,sidebar:`-2rem 0 2rem 2rem rgba(0, 0, 0, 0.4)`,none:`none`},ct={px:`1px`,none:`0`,threeXS:`0.125rem`,twoXS:`0.25rem`,xs:`0.375rem`,sm:`0.5rem`,md:`0.75rem`,lg:`1rem`,xl:`1.25rem`,twoXL:`1.5rem`,threeXL:`2rem`,fourXL:`4rem`,fiveXL:`6rem`,sixXL:`8rem`},lt=`2.5rem`,ut=`1px`,dt={full:`100%`,headerHeight:`3.75rem`,fullScreenHeaderHeight:`2.875rem`,sidebarTopSpace:`6rem`,toastWidth:`21rem`,contentMaxWidth:`736px`,maxChartTooltipWidth:`30rem`,checkbox:`1rem`,borderWidth:ut,smallElementHeight:`1.5rem`,minElementHeight:lt,elementHighlightHeight:`calc(${lt} - 2 * ${ct.xs})`,tagMarginInsideBorder:`calc(${ct.xs} - ${ut})`,largestElementHeight:`4.25rem`,smallLogoHeight:`1.25rem`,defaultLogoHeight:`1.5rem`,largeLogoHeight:`2rem`,sliderThumb:`0.75rem`,wideSidePadding:`5rem`,headerDecorationHeight:`0.125rem`,appMainMenu:`12rem`,appRunningMen:`1.6rem`,appStatusMaxWidth:`20rem`,tableColumnMaxWidth:`25rem`,spinnerSize:`1.375rem`,spinnerThickness:`0.125rem`,tabHeight:`2.5rem`,minPopupWidth:`20rem`,maxTooltipHeight:`18.75rem`,chatAvatarSize:`2rem`,clearIconSize:`1.5em`,numberInputControlsWidth:`2rem`,emptyDropdownHeight:`5.625rem`,dropdownItemHeight:`2.5rem`,maxDropdownHeight:`18.75rem`,appDefaultBottomPadding:`3.5rem`,defaultMapHeight:`31.25rem`,defaultChartHeight:`21.875rem`,defaultChartWidth:`25rem`,minMenuWidth:`8rem`,minChatInputFileListHeight:`3rem`,uploadedFileIconSize:`2rem`,headerItemHeight:`1.75rem`,headerRightContentMaxWidth:`12.5rem`,chatInputTextareaMinHeight:`1.5rem`,chatInputPrimaryButtonSize:`2rem`,chatInputButtonVerticalOffset:`0.1875rem`,dialogLargeWidth:`80rem`,defaultStrokeWidth:2.25,metricStrokeWidth:2,focusRingWidth:`0.2rem`,focusOutlineWidth:`0.125rem`,fileChipNameMinWidth:`4.875rem`,dateInputMinWidth:`14rem`},ft=e=>{let t=p(e.bgColor)>.5,n=t?ot:st,r=dt.focusRingWidth,i=t?e.gray90:e.gray10;return{...n,focusRing:`0 0 0 ${r} ${f(e.primary,.5)}`,focusRingSubtle:`0 0 0 ${r} ${f(e.darkenedBgMix25,.5)}`,focusRingOutline:`0 0 0 1px ${e.primary}`,focusRingMuted:`0 0 0 ${r} ${f(i,.8)}`}}
1,R={sansSerif:`"Source Sans", sans-serif`,monospace:`"Source Code Pro", monospace`,serif:`"Source Serif", serif`,materialIcons:`Material Symbols Rounded`},pt={bodyFont:R.sansSerif,codeFont:R.monospace,headingFont:R.sansSerif,iconFont:R.materialIcons},mt={baseFontSize:16,twoSm:`0.75rem`,sm:`0.875rem`,md:`1rem`,mdLg:`1.125rem`,lg:`1.25rem`,xl:`1.5rem`,twoXL:`1.75rem`,threeXL:`2.25rem`,fourXL:`2.75rem`,codeFontSize:`0.875rem`,inlineCodeFontSize:`0.75em`,h1FontSize:`2.75rem`,h2FontSize:`2.25rem`,h3FontSize:`1.75rem`,h4FontSize:`1.5rem`,h5FontSize:`1.25rem`,h6FontSize:`1rem`,metricValueFontSize:`2.25rem`},ht={normal:400,semiBold:500,bold:600,extrabold:700,code:400,codeBold:600,codeExtraBold:700,h1FontWeight:700,h2FontWeight:600,h3FontWeight:600,h4FontWeight:600,h5FontWeight:600,h6FontWeight:600,metricValueFontWeight:400},gt={none:1,headings:1.2,tight:1.25,inputWidget:1.4,small:1.5,base:1.6,menuItem:2},_t={hideWidgetDetails:`11.25rem`,hideNumberInputControls:`7.5rem`,sm:`576px`,columns:`640px`,md:`768px`},vt={xs:`0.5rem`,sm:`0.75rem`,md:`0.9rem`,base:`1rem`,lg:`1.25rem`,xl:`1.5rem`,twoXL:`1.8rem`,threeXL:`2.3rem`},yt={secondary:.6,stale:.33},bt={sm:`0.25rem`,md2:`0.375rem`,default:`0.5rem`,xl:`0.75rem`,xxl:`1rem`,button:`0.5rem`,chatInput:`1.25rem`,full:`9999px`,maxCheckbox:`0.35rem`},xt={hide:-1,auto:`auto`,base:0,priority:1,sidebar:100,menuButton:110,balloons:1e6,header:999990,sidebarMobile:999995,modal:1000059,popup:1000060,fullscreenWrapper:1000050,tablePortal:1000110,tablePortalTooltip:1000120,bottom:99,cacheSpinner:101,toast:1000062,headerDecoration:999999},z={transparent:`transparent`,black:`#000000`,white:`#ffffff`,gray10:`#fafafa`,gray20:`#f0f2f6`,gray30:`#e6eaf1`,gray40:`#d5dae5`,gray50:`#bfc5d3`,gray60:`#a3a8b8`,gray70:`#808495`,gray80:`#555867`,gray85:`#31333F`,gray90:`#262730`,gray100:`#0e1117`,red10:`#fff0f0`,red20:`#ffdede`,red30:`#ffc7c7`,red40:`#ffabab`,red50:`#ff8c8c`,red60:`#ff6c6c`,red70:`#ff4b4b`,red80:`#ff2b2b`,red90:`#bd4043`,red100:`#7d353b`,orange10:`#fffae8`,orange20:`#fff6d0`,orange30:`#ffecb0`,orange40:`#ffe08e`,orange50:`#ffd16a`,orange60:`#ffbd45`,orange70:`#ffa421`,orange80:`#ff8700`,orange90:`#ed6f13`,orange95:`#e2660c`,orange100:`#d95a00`,yellow10:`#ffffe1`,yellow20:`#ffffc2`,yellow30:`#ffffa0`,yellow40:`#ffff7d`,yellow50:`#ffff59`,yellow60:`#fff835`,yellow65:`#ffff12`,yellow70:`#ffe312`,yellow80:`#faca2b`,yellow90:`#edbb16`,yellow100:`#dea816`,yellow110:`#916e10`,yellow115:`#926c05`,green10:`#dffde9`,green20:`#c0fcd3`,green30:`#9ef6bb`,green40:`#7defa1`,green50:`#5ce488`,green60:`#3dd56d`,green70:`#21c354`,green80:`#09ab3b`,green90:`#158237`,green100:`#177233`,blueGreen10:`#dcfffb`,blueGreen20:`#bafff7`,blueGreen30:`#93ffee`,blueGreen40:`#6bfde3`,blueGreen50:`#45f4d5`,blueGreen60:`#20e7c5`,blueGreen70:`#00d4b1`,blueGreen80:`#29b09d`,blueGreen90:`#2c867c`,blueGreen100:`#246e69`,lightBlue10:`#e0feff`,lightBlue20:`#bffdff`,lightBlue30:`#9af8ff`,lightBlue40:`#73efff`,lightBlue50:`#4be4ff`,lightBlue60:`#24d4ff`,lightBlue70:`#00c0f2`,lightBlue80:`#00a4d4`,lightBlue90:`#0d8cb5`,lightBlue100:`#15799e`,blue10:`#e4f5ff`,blue20:`#c7ebff`,blue30:`#a6dcff`,blue40:`#83c9ff`,blue50:`#60b4ff`,blue60:`#3d9df3`,blue65:`#1c83ff`,blue70:`#1c83e1`,blue80:`#0068c9`,blue90:`#0054a3`,blue100:`#004280`,purple10:`#f5ebff`,purple20:`#ebd6ff`,purple30:`#dbbbff`,purple40:`#c89dff`,purple50:`#b27eff`,purple60:`#9a5dff`,purple70:`#803df5`,purple80:`#6d3fc0`,purple90:`#583f84`,purple100:`#3f3163`},St={bgColor:z.white,secondaryBg:z.gray20,bodyText:z.gray85,primary:z.red70,secondary:z.blue70,redColor:z.red70,orangeColor:z.orange70,yellowColor:z.yellow80,blueColor:z.blue70,greenColor:z.green70,violetColor:z.purple70,grayColor:z.gray60,redBackgroundColor:f(z.red80,.9),orangeBackgroundColor:f(z.orange70,.9),yellowBackgroundColor:f(z.yellow65,.9),blueBackgroundColor:f(z.blue65,.9),greenBackgroundColor:f(z.green70,.9),violetBackgroundColor:f(z.purple60,.9),grayBackgroundColor:f(z.gray85,.9),redTextColor:z.red90,orangeTextColor:z.orange95,yellowTextColor:z.yellow115,blueTextColor:z.blue90,greenTextColor:z.green90,violetTextColor:z.purple90,grayTextColor:f(z.gray85,.4)},Ct={},wt={...z,...St,...Ct},Tt=m(wt),B={inSidebar:!1,showSidebarBorder:!1,linkUnderline:!0,breakpoints:_t,colors:Tt,fonts:R,fontSizes:mt,fontWeights:ht,genericFonts:pt,iconSizes:vt,lineHeights:gt,opacities:yt,radii:bt,shadows:ft(Tt),sizes:dt,spacing:ct,zIndices:xt},Et={...z,bgColor:z.gray100,bodyText:z.gray10,primary:z.red70,secondaryBg:z.gray90,redColor:z.red80,orangeColor:z.orange80,yellowColor:z.yellow70,blueColor:z.blue80,greenColor:z.green80,violetColor:z.purple70,grayColor:z.gray80,redBackgroun
1dColor:f(z.red60,.8),orangeBackgroundColor:f(z.orange80,.8),yellowBackgroundColor:f(z.yellow65,.8),blueBackgroundColor:f(z.blue60,.8),greenBackgroundColor:f(z.green60,.8),violetBackgroundColor:f(z.purple60,.8),grayBackgroundColor:f(z.gray70,.8),redTextColor:z.red60,orangeTextColor:z.orange60,yellowTextColor:z.yellow20,blueTextColor:z.blue60,greenTextColor:z.green50,violetTextColor:z.purple50,grayTextColor:f(z.gray10,.4)},Dt=m({...B.colors,...Et}),Ot=ft(Dt),kt={...B,inSidebar:!1,colors:Dt,shadows:Ot},At={...B,inSidebar:!1},jt={name:`base`,emotion:B},V={name:`Dark`,emotion:kt},H={name:`Light`,emotion:At},U=`Use system setting`,W=`Custom Theme`,Mt=`Custom Theme Light`,Nt=`Custom Theme Dark`,Pt=`Custom Theme Auto`,G=(0,de.getLogger)(`theme:utils`);function Ft(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>Ft(e));if(typeof e==`object`){let t={};return Object.keys(e).toSorted().forEach(n=>{t[n]=Ft(e[n])}),t}return e}function It(e,t){if(t&&v(t)){let n=new a(t);return Z(e.name,n,e)}return e}var K=T(()=>It(H,s.LIGHT_THEME)),q=T(()=>It(V,s.DARK_THEME)),Lt=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`)?.matches??!1?`dark`:`light`,Rt=()=>Lt()===`dark`?q():K(),J=()=>({...Rt(),name:U}),zt=()=>[J(),K(),q()],Bt=e=>zt().map(e=>e.name).includes(e.name),Vt=e=>e===void 0||p(e)>.5?`light`:`dark`,Ht=e=>{let t=new Option().style;return t.color=e,t.color!==``},Ut=e=>Math.round(e*8)/8,Y=(e,t=R.sansSerif)=>{let n=e.trim();if(!n)return t;let r={"sans-serif":R.sansSerif,serif:R.serif,monospace:R.monospace},i=n.toLowerCase().replaceAll(` `,`-`);return i in r?r[i]:`${n}, ${t}`},Wt=(e,t,n=!1)=>
1{if(Ht(e))return e;if(Ht(`#${e}`))return`#${e}`;if(t.toLowerCase().includes(`color`)){let r=n?`theme.sidebar`:`theme`;G.warn(`Invalid color passed for ${t} in ${r}: "${e}"`)}},Gt=(e,t,n,r)=>e||(t?f(t,r?.9:.8):n),Kt=(e,t,n,r)=>{if(e)return e;if(t){let e=.15;return r?te(t,e):g(t,e)}return n},qt=(e,t)=>{let n={...e},r={redBackgroundColor:{main:t.redColor,background:t.redBackgroundColor},orangeBackgroundColor:{main:t.orangeColor,background:t.orangeBackgroundColor},yellowBackgroundColor:{main:t.yellowColor,background:t.yellowBackgroundColor},blueBackgroundColor:{main:t.blueColor,background:t.blueBackgroundColor},greenBackgroundColor:{main:t.greenColor,background:t.greenBackgroundColor},violetBackgroundColor:{main:t.violetColor,background:t.violetBackgroundColor},grayBackgroundColor:{main:t.grayColor,background:t.grayBackgroundColor}},i=p(n.bgColor)>.5;return Object.entries(r).forEach(([t,{main:r,background:a}])=>{let o=t;n[o]=Gt(a,r,e[o],i)}),n},Jt=(e,t)=>{let n={...e},r={redTextColor:{main:t.redColor,text:t.redTextColor},orangeTextColor:{main:t.orangeColor,text:t.orangeTextColor},yellowTextColor:{main:t.yellowColor,text:t.yellowTextColor},blueTextColor:{main:t.blueColor,text:t.blueTextColor},greenTextColor:{main:t.greenColor,text:t.greenTextColor},violetTextColor:{main:t.violetColor,text:t.violetTextColor},grayTextColor:{main:t.grayColor,text:t.grayTextColor}},i=p(n.bgColor)>.5;return Object.entries(r).forEach(([t,{main:r,text:a}])=>{let o=t;n[o]=Kt(a,r,e[o],i)}),n},Yt=e=>{let t=`rem`,n,r=e.trim().toLowerCase();return r===`none`?n=0:r===`small`?n=.35:r===`medium`?n=.5:r===`large`?n=1:r===`full`?n=1.4:r.endsWith(`rem`)?n=parseFloat(r):r.endsWith(`px`)?(n=parseFloat(r),t=`px`):isNaN(parseFloat(r))||(n=parseFloat(r),t=`px`),[n,t]},Xt=(e,t,n)=>{let r=n?`theme.sidebar`:`theme`;if(typeof t==`string`){let e=t.trim().toLowerCase(),n=parseFloat(e);if(n&&(e.endsWith(`rem`)||e.endsWith(`px`)))return e;if(n.toString()===e)return`${e}px`}G.warn(`Invalid size passed for ${e} in ${r}: ${t}. Falling back to default ${e}.`)},X=(e,t,n,r,i)=>{let a=i?`theme.sidebar`:`theme`;if(_(t)){let i=Number.isInteger(t),o=t%50==0;return!i||!o||!(t>=n&&t<=r)?(G.warn(`Invalid ${e}: ${t} in ${a}. The ${e} must be an integer ${n}-${r}, and an increment of 50. Falling back to default font weight.`),!1):!0}return!1},Zt=(e,t,n,r)=>{let i=Xt(e,t,r);if(i?.endsWith(`rem`))return i;if(i?.endsWith(`px`))return`${parseFloat(i)/n}rem`},Qt=(e,t,n,r)=>{let i={...e};return r&&r.forEach((e,r)=>{let a=`h${r+1}FontSize`,o=Zt(`${a} in headingFontSizes`,e,n,t);o&&(i[a]=o)}),i},$t=(e,t,n,r,i)=>{let a={...e,h1FontWeight:t?600:e.h1FontWeight};return n&&X(`baseFontWeight`,n,100,600)&&(a.normal=n,a.semiBold=n+100,a.bold=n+200,a.extrabold=n+300,a.code=n,a.codeBold=n+200,a.codeExtraBold=n+300),r&&X(`codeFontWeight`,r,100,600)&&(a.code=r,a.codeBold=r+200,a.codeExtraBold=r+300),i&&i.forEach((e,n)=>{let r=`h${n+1}FontWeight`;X(`${r} in headingFontWeights`,e,100,900,t)&&(a[r]=e)}),a},en=(e,t)=>t.map(t=>Wt(t,e)).filter(e=>e!==void 0),tn=(e,t=jt)=>{let{colors:n,genericFonts:r,inSidebar:i}=t.emotion,{baseFontSize:a,baseFontWeight:o,baseRadius:s,buttonRadius:c,codeFontSize:l,codeFontWeight:u,showWidgetBorder:d,headingFont:p,headingFontSizes:ee,headingFontWeights:te,bodyFont:h,codeFont:g,showSidebarBorder:ne,linkUnderline:re,chartCategoricalColors:v,chartSequentialColors:y,chartDivergingColors:b,metricValueFontSize:x,metricValueFontWeight:S,...ie}=e,C=Object.entries(ie).reduce((e,[t,n])=>{let r=Wt(n,t,i);return r&&(e[t]=r),e},{}),{secondaryBackgroundColor:ae,backgroundColor:oe,primaryColor:w,textColor:T,dataframeBorderColor:se,dataframeHeaderBackgroundColor:ce,borderColor:E,linkColor:le,codeTextColor:ue,codeBackgroundColor:D,redColor:de,orangeColor:fe,yellowColor:pe,blueColor:me,greenColor:O,violetColor:he,grayColor:k}=C,ge={...n,primary:w??n.primary,bodyText:T??n.bodyText,secondaryBg:ae??n.secondaryBg,bgColor:oe??n.bgColor,redColor:de??n.redColor,orangeColor:fe??n.orangeColor,yellowColor:pe??n.yellowColor,blueColor:me??n.blueColor,greenColor:O??n.greenColor,violetColor:he??n.violetColor,grayColor:k??n.grayColor,secondary:w??n.primary},A={colors:{...m(ge)},showSidebarBorder:ne??t.emotion.showSidebarBorder,linkUnderline:re??t.emotion.linkUnderline,radii:{...t.emotion.radii},fontSizes:{...t.emotion.fontSizes},fontWeights:{...t.emotion.fontWeights}};
1if(A.colors.codeBackgroundColor=D??A.colors.codeBackgroundColor,A.colors.dataframeHeaderBackgroundColor=ce??A.colors.dataframeHeaderBackgroundColor,_(E)){A.colors.borderColor=E;let e=f(E,.55);A.colors.borderColorLight=e,A.colors.dataframeBorderColor=e}if(_(se)&&(A.colors.dataframeBorderColor=se),d&&(A.colors.widgetBorderColor=A.colors.borderColor),A.colors=qt(A.colors,C),A.colors=Jt(A.colors,C),A.colors.link=le??A.colors.blueTextColor,A.colors.codeTextColor=ue??A.colors.greenTextColor,_(v)&&v.length>0){let e=en(`chartCategoricalColors`,v);e.length>0&&(A.colors.chartCategoricalColors=e)}if(_(y)&&y.length>0){let e=en(`chartSequentialColors`,y);e.length===10?A.colors.chartSequentialColors=e:G.warn(`Invalid chartSequentialColors: ${y.toString()}. Falling back to default chartSequentialColors.`)}if(_(b)&&b.length>0){let e=en(`chartDivergingColors`,b);e.length===10?A.colors.chartDivergingColors=e:G.warn(`Invalid chartDivergingColors: ${b.toString()}. Falling back to default chartDivergingColors.`)}if(_(s)){let[e,t]=Yt(s);if(_(e)&&!isNaN(e)){let n=Q(e,t);A.radii.default=n,A.radii.button=n,A.radii.sm=Q($(e*.5),t),A.radii.md2=Q($(e*.75),t),A.radii.xl=Q($(e*1.5),t),A.radii.xxl=Q($(e*2),t)}else G.warn(`Invalid base radius: ${s}. Falling back to default base radius.`)}if(_(c)){let[e,t]=Yt(c);_(e)&&!isNaN(e)?A.radii.button=Q(e,t):G.warn(`Invalid button radius: ${c}. Falling back to default button radius.`)}if(a&&a>0&&(A.fontSizes.baseFontSize=a),l){let e=Xt(`codeFontSize`,l,i);e&&(A.fontSizes.codeFontSize=e)}if(A.fontSizes=Qt(A.fontSizes,i,A.fontSizes.baseFontSize,ee),x){let e=Xt(`metricValueFontSize`,x,i);e&&(parseFloat(e)<=0?G.warn(`Invalid metricValueFontSize: ${x} in theme. The metricValueFontSize must be greater than 0. Falling back to default metricValueFontSize.`):A.fontSizes.metricValueFontSize=e)}A.fontWeights=$t(t.emotion.fontWeights,i,o,u,te),S&&X(`metricValueFontWeight`,S,100,900)&&(A.fontWeights.metricValueFontWeight=S);let j={...r,bodyFont:h?Y(h,R.sansSerif):r.bodyFont,codeFont:g?Y(g,R.monospace):r.codeFont,headingFont:p?Y(p,R.sansSerif):r.headingFont};h&&!p&&(j.headingFont=Y(h,R.sansSerif));let M=ft(A.colors);return{...t.emotion,genericFonts:j,...A,shadows:M}},nn=e=>{let{colors:t}=e;return{primaryColor:t.primary,backgroundColor:t.bgColor,secondaryBackgroundColor:t.secondaryBg,textColor:t.bodyText,bodyFont:e.genericFonts.bodyFont}},rn=e=>{let{colors:t}=e,n=nn(e);return{primaryColor:n.primaryColor,backgroundColor:n.backgroundColor,secondaryBackgroundColor:n.secondaryBackgroundColor,textColor:n.textColor,bodyFont:n.bodyFont,base:Vt(n.backgroundColor),...h(t)}},an=(e,t)=>new a({...nn(t.emotion),...e}),Z=(e,t,n,r=!1)=>{let i;i=n?an(t,n):t.base===a.BaseTheme.DARK?an(t,V):an(t,H);let o=i.backgroundColor,s=ie(S(n||(p(o)>.5?H:V)),{emotion:{inSidebar:r}}),c=tn(i,s);return{...s,name:e,emotion:c,themeInput:t}},on=()=>{let{CACHED_THEME_VERSION:e,CACHED_THEME_BASE_KEY:t}=at,{localStorage:n}=window;n.removeItem(`stActiveTheme`),n.removeItem(t);for(let r=1;r<e;r++)n.removeItem(`${t}-v${r}`)},sn=e=>e.name===`Use system setting`||e.name===`Custom Theme Auto`?`System`:e.name===H.name||e.name===`Custom Theme Light`?`Light`:e.name===V.name||e.name===`Custom Theme Dark`?`Dark`:(e.name,`System`),cn=e=>e===`System`||e===`Light`||e===`Dark`,ln=()=>{if(!d())return null;on();let e=window.localStorage.getItem(at.ACTIVE_THEME);if(!e)return null;let t=JSON.parse(e);return cn(t)?t:null},un=e=>{if(!d()||(on(),Ee()||De()))return;let t=sn(e);window.localStorage.setItem(at.ACTIVE_THEME,JSON.stringify(t))},dn=()=>Ee()?K():De()?q():null,fn=()=>dn()??J(),pn=()=>{let e=dn();if(e)return e;let t=ln();return t===`Light`?K():t===`Dark`?q():J()},mn=/\s+/;function hn(e,t){return e===``?``:e.split(mn).map(e=>e===`0`?t.spacing.none:e in t.spacing?t.spacing[e]:(G.error(`Invalid spacing value: ${e}`),t.spacing.none)).join(` `)}function Q(e,t){return`${e}${t}`}function $(e){return parseFloat(e.toFixed(2))}function gn(e,t){if(t===void 0)return e;let[n,r,i,a]=ee(e);
1if(a===1)return e;let[o,s,c,l]=ee(t),u=a+l*(1-a),d=Math.round((a*n+l*o*(1-a))/u),f=Math.round((a*r+l*s*(1-a))/u),p=Math.round((a*i+l*c*(1-a))/u);return ne(`rgba(${d}, ${f}, ${p}, ${u})`)}var _n=e=>parseFloat(e.replace(/rem$/,``))*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16),vn=(e,t)=>{if(t===``||t===null||Array.isArray(t)&&t.length===0)return e;if(Array.isArray(t)&&t.length>0)return t},yn=(e,t)=>{let n=t===`light`,r=n?a.BaseTheme.LIGHT:a.BaseTheme.DARK,{light:i,dark:o,sidebar:s,...c}=e,{sidebar:l,...u}=(n?i:o)||{},d=w({},c,u,{base:r},vn);return(s||l)&&(d.sidebar=w({},s,l,vn)),d},bn=e=>{if(!e)return!1;let t=e=>e==null?!1:Array.isArray(e)?e.length>0:typeof e!=`object`||Object.values(e).some(t);return Object.values(e).some(t)},xn=e=>{let t=bn(e.light),n=bn(e.dark),r=[];if(t||n){let t={...Z(Mt,yn(e,`light`)),displayName:`Light`},n={...Z(Nt,yn(e,`dark`)),displayName:`Dark`},i={...Lt()===`dark`?n:t,displayName:U,name:Pt};r.push(t,n,i)}else{let t=Z(W,e);r.push(t)}return r},Sn=e=>ie([],[`1.5rem`,`1.25rem`,`1.125rem`,`1rem`,`0.875rem`,`0.75rem`],e||[]),Cn=e=>{let t=e.themeInput?.sidebar,{bgColor:n,secondaryBg:r}=e.emotion.colors,i=t?.backgroundColor||r,o=t?.secondaryBackgroundColor||n,s=Sn(t?.headingFontSizes),c=p(i)>.5?a.BaseTheme.LIGHT:a.BaseTheme.DARK;return e.name===`Custom Theme Light`?c=a.BaseTheme.LIGHT:e.name===`Custom Theme Dark`&&(c=a.BaseTheme.DARK),Z(`Sidebar`,w({},e.themeInput,t,{base:c,backgroundColor:i,secondaryBackgroundColor:o,headingFontSizes:s},vn),void 0,!0)},wn=(e,t)=>{if(!e)return null;let n={System:[Pt,U,W],Light:[Mt,H.name],Dark:[Nt,V.name]};for(let r of n[e]){let e=t.find(e=>e.name===r);if(e)return e}return null},Tn=e=>{let t=dn();return wn((t?sn(t):null)??ln(),e)};export{Ke as $,Xe as A,Pe as B,rn as C,yt as D,wt as E,tt as F,je as G,Se as H,$e as I,Le as J,Me as K,We as L,be as M,Ze as N,mt as O,pe as P,Oe as Q,et as R,Ft as S,H as T,Ae as U,Ne as V,qe as W,Be as X,P as Y,Ve as Z,Lt as _,W as a,L as at,Ut as b,_n as c,Fe as ct,zt as d,He as dt,Te as et,Cn as f,D as ft,Tn as g,fn as h,Mt as i,Ge as it,Je as j,pt as k,J as l,ze as lt,pn as m,w as mt,Pt as n,Ce as nt,gn as o,Ye as ot,Z as p,T as pt,ke as q,Nt as r,Ue as rt,hn as s,Ie as st,U as t,we as tt,xn as u,xe as ut,sn as v,V as w,un as x,Bt as y,Qe as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.