"use strict";(()=>{var Jt=Object.create;var Q=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Zt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var re=(e,r,t)=>r in e?Q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),pr=(e,r)=>{for(var t in r)Q(e,t,{get:r[t],enumerable:!0})},te=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Xt(r))!Qt.call(e,n)&&n!==t&&Q(e,n,{get:()=>r[n],enumerable:!(o=Vt(r,n))||o.enumerable});return e};var hr=(e,r,t)=>(t=e!=null?Jt(Zt(e)):{},te(r||!e||!e.__esModule?Q(t,"default",{value:e,enumerable:!0}):t,e));var C=(e,r,t)=>(re(e,typeof r!="symbol"?r+"":r,t),t);var Br=Y((Ko,nr)=>{(function(){"use strict";var e={}.hasOwnProperty;function r(){for(var t=[],o=0;o{"use strict";ir.byteLength=Ee;ir.toByteArray=Ae;ir.fromByteArray=Te;var T=[],A=[],Ce=typeof Uint8Array<"u"?Uint8Array:Array,Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(R=0,wt=Ir.length;R0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var o=t===r?0:4-t%4;return[t,o]}function Ee(e){var r=xt(e),t=r[0],o=r[1];return(t+o)*3/4-o}function be(e,r,t){return(r+t)*3/4-t}function Ae(e){var r,t=xt(e),o=t[0],n=t[1],i=new Ce(be(e,o,n)),a=0,u=n>0?o-4:o,c;for(c=0;c>16&255,i[a++]=r>>8&255,i[a++]=r&255;return n===2&&(r=A[e.charCodeAt(c)]<<2|A[e.charCodeAt(c+1)]>>4,i[a++]=r&255),n===1&&(r=A[e.charCodeAt(c)]<<10|A[e.charCodeAt(c+1)]<<4|A[e.charCodeAt(c+2)]>>2,i[a++]=r>>8&255,i[a++]=r&255),i}function Se(e){return T[e>>18&63]+T[e>>12&63]+T[e>>6&63]+T[e&63]}function Fe(e,r,t){for(var o,n=[],i=r;iu?u:a+i));return o===1?(r=e[t-1],n.push(T[r>>2]+T[r<<4&63]+"==")):o===2&&(r=(e[t-2]<<8)+e[t-1],n.push(T[r>>10]+T[r>>4&63]+T[r<<2&63]+"=")),n.join("")}});var Ct=Y(kr=>{kr.read=function(e,r,t,o,n){var i,a,u=n*8-o-1,c=(1<>1,d=-7,f=t?n-1:0,m=t?-1:1,y=e[r+f];for(f+=m,i=y&(1<<-d)-1,y>>=-d,d+=u;d>0;i=i*256+e[r+f],f+=m,d-=8);for(a=i&(1<<-d)-1,i>>=-d,d+=o;d>0;a=a*256+e[r+f],f+=m,d-=8);if(i===0)i=1-h;else{if(i===c)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,o),i=i-h}return(y?-1:1)*a*Math.pow(2,i-o)};kr.write=function(e,r,t,o,n,i){var a,u,c,h=i*8-n-1,d=(1<>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=o?0:i-1,_=o?1:-1,z=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=d):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?r+=m/c:r+=m*Math.pow(2,1-f),r*c>=2&&(a++,c/=2),a+f>=d?(u=0,a=d):a+f>=1?(u=(r*c-1)*Math.pow(2,n),a=a+f):(u=r*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;e[t+y]=u&255,y+=_,u/=256,n-=8);for(a=a<0;e[t+y]=a&255,y+=_,a/=256,h-=8);e[t+y-_]|=z*128}});var kt=Y(H=>{"use strict";var Nr=_t(),W=Ct(),Et=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;H.Buffer=s;H.SlowBuffer=Ie;H.INSPECT_MAX_BYTES=50;var ar=2147483647;H.kMaxLength=ar;s.TYPED_ARRAY_SUPPORT=De();!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function De(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function B(e){if(e>ar)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,s.prototype),r}function s(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Pr(e)}return St(e,r,t)}s.poolSize=8192;function St(e,r,t){if(typeof e=="string")return Be(e,r);if(ArrayBuffer.isView(e))return Ue(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return jr(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return s.from(o,r,t);var n=Oe(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return s.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s.from=function(e,r,t){return St(e,r,t)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Ft(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ve(e,r,t){return Ft(e),e<=0?B(e):r!==void 0?typeof t=="string"?B(e).fill(r,t):B(e).fill(r):B(e)}s.alloc=function(e,r,t){return ve(e,r,t)};function Pr(e){return Ft(e),B(e<0?0:Mr(e)|0)}s.allocUnsafe=function(e){return Pr(e)};s.allocUnsafeSlow=function(e){return Pr(e)};function Be(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=Tt(e,r)|0,o=B(t),n=o.write(e,r);return n!==t&&(o=o.slice(0,n)),o}function Rr(e){for(var r=e.length<0?0:Mr(e.length)|0,t=B(r),o=0;o=ar)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ar.toString(16)+" bytes");return e|0}function Ie(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,t){if(D(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),D(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(r)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var o=r.length,n=t.length,i=0,a=Math.min(o,n);in.length?s.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else if(s.isBuffer(a))a.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=a.length}return n};function Tt(e,r){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Lr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return It(e).length;default:if(n)return o?-1:Lr(e).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Tt;function ke(e,r,t){var o=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ge(this,r,t);case"utf8":case"utf-8":return vt(this,r,t);case"ascii":return We(this,r,t);case"latin1":case"binary":return He(this,r,t);case"base64":return Me(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,r,t);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}s.prototype._isBuffer=!0;function j(e,r,t){var o=e[r];e[r]=e[t],e[t]=o}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tt&&(r+=" ... "),""};Et&&(s.prototype[Et]=s.prototype.inspect);s.prototype.compare=function(r,t,o,n,i){if(D(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),o===void 0&&(o=r?r.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||o>r.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=o)return 0;if(n>=i)return-1;if(t>=o)return 1;if(t>>>=0,o>>>=0,n>>>=0,i>>>=0,this===r)return 0;for(var a=i-n,u=o-t,c=Math.min(a,u),h=this.slice(n,i),d=r.slice(t,o),f=0;f2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,qr(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=s.from(r,o)),s.isBuffer(r))return r.length===0?-1:bt(e,r,t,o,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):bt(e,[r],t,o,n);throw new TypeError("val must be string, number or Buffer")}function bt(e,r,t,o,n){var i=1,a=e.length,u=r.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||r.length<2)return-1;i=2,a/=2,u/=2,t/=2}function c(y,_){return i===1?y[_]:y.readUInt16BE(_*i)}var h;if(n){var d=-1;for(h=t;ha&&(t=a-u),h=t;h>=0;h--){for(var f=!0,m=0;mn&&(o=n)):o=n;var i=r.length;o>i/2&&(o=i/2);for(var a=0;a>>0,isFinite(o)?(o=o>>>0,n===void 0&&(n="utf8")):(n=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((o===void 0||o>i)&&(o=i),r.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Ne(this,r,t,o);case"utf8":case"utf-8":return Re(this,r,t,o);case"ascii":case"latin1":case"binary":return je(this,r,t,o);case"base64":return Le(this,r,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe(this,r,t,o);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Me(e,r,t){return r===0&&t===e.length?Nr.fromByteArray(e):Nr.fromByteArray(e.slice(r,t))}function vt(e,r,t){t=Math.min(e.length,t);for(var o=[],n=r;n239?4:i>223?3:i>191?2:1;if(n+u<=t){var c,h,d,f;switch(u){case 1:i<128&&(a=i);break;case 2:c=e[n+1],(c&192)===128&&(f=(i&31)<<6|c&63,f>127&&(a=f));break;case 3:c=e[n+1],h=e[n+2],(c&192)===128&&(h&192)===128&&(f=(i&15)<<12|(c&63)<<6|h&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:c=e[n+1],h=e[n+2],d=e[n+3],(c&192)===128&&(h&192)===128&&(d&192)===128&&(f=(i&15)<<18|(c&63)<<12|(h&63)<<6|d&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,o.push(a>>>10&1023|55296),a=56320|a&1023),o.push(a),n+=u}return qe(o)}var At=4096;function qe(e){var r=e.length;if(r<=At)return String.fromCharCode.apply(String,e);for(var t="",o=0;oo)&&(t=o);for(var n="",i=r;io&&(r=o),t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),tt)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,t,o){r=r>>>0,t=t>>>0,o||w(r,t,this.length);for(var n=this[r],i=1,a=0;++a>>0,t=t>>>0,o||w(r,t,this.length);for(var n=this[r+--t],i=1;t>0&&(i*=256);)n+=this[r+--t]*i;return n};s.prototype.readUint8=s.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,t,o){r=r>>>0,t=t>>>0,o||w(r,t,this.length);for(var n=this[r],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n};s.prototype.readIntBE=function(r,t,o){r=r>>>0,t=t>>>0,o||w(r,t,this.length);for(var n=t,i=1,a=this[r+--n];n>0&&(i*=256);)a+=this[r+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a};s.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var o=this[r]|this[r+1]<<8;return o&32768?o|4294901760:o};s.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var o=this[r+1]|this[r]<<8;return o&32768?o|4294901760:o};s.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),W.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),W.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),W.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),W.read(this,r,!1,52,8)};function E(e,r,t,o,n,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||re.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,t,o,n){if(r=+r,t=t>>>0,o=o>>>0,!n){var i=Math.pow(2,8*o)-1;E(this,r,t,o,i,0)}var a=1,u=0;for(this[t]=r&255;++u>>0,o=o>>>0,!n){var i=Math.pow(2,8*o)-1;E(this,r,t,o,i,0)}var a=o-1,u=1;for(this[t+a]=r&255;--a>=0&&(u*=256);)this[t+a]=r/u&255;return t+o};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,1,255,0),this[t]=r&255,t+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};s.prototype.writeIntLE=function(r,t,o,n){if(r=+r,t=t>>>0,!n){var i=Math.pow(2,8*o-1);E(this,r,t,o,i-1,-i)}var a=0,u=1,c=0;for(this[t]=r&255;++a>0)-c&255;return t+o};s.prototype.writeIntBE=function(r,t,o,n){if(r=+r,t=t>>>0,!n){var i=Math.pow(2,8*o-1);E(this,r,t,o,i-1,-i)}var a=o-1,u=1,c=0;for(this[t+a]=r&255;--a>=0&&(u*=256);)r<0&&c===0&&this[t+a+1]!==0&&(c=1),this[t+a]=(r/u>>0)-c&255;return t+o};s.prototype.writeInt8=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};s.prototype.writeInt16LE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeInt16BE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeInt32LE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};s.prototype.writeInt32BE=function(r,t,o){return r=+r,t=t>>>0,o||E(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Bt(e,r,t,o,n,i){if(t+o>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ut(e,r,t,o,n){return r=+r,t=t>>>0,n||Bt(e,r,t,4,34028234663852886e22,-34028234663852886e22),W.write(e,r,t,o,23,4),t+4}s.prototype.writeFloatLE=function(r,t,o){return Ut(this,r,t,!0,o)};s.prototype.writeFloatBE=function(r,t,o){return Ut(this,r,t,!1,o)};function Ot(e,r,t,o,n){return r=+r,t=t>>>0,n||Bt(e,r,t,8,17976931348623157e292,-17976931348623157e292),W.write(e,r,t,o,52,8),t+8}s.prototype.writeDoubleLE=function(r,t,o){return Ot(this,r,t,!0,o)};s.prototype.writeDoubleBE=function(r,t,o){return Ot(this,r,t,!1,o)};s.prototype.copy=function(r,t,o,n){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(o||(o=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t>>0,o=o===void 0?this.length:o>>>0,r||(r=0);var a;if(typeof r=="number")for(a=t;a55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===o){(r-=3)>-1&&i.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&i.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&i.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;i.push(t)}else if(t<2048){if((r-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function Ke(e){for(var r=[],t=0;t>8,n=t%256,i.push(n),i.push(o);return i}function It(e){return Nr.toByteArray(Ye(e))}function sr(e,r,t,o){for(var n=0;n=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function D(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function qr(e){return e!==e}var Ve=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var o=t*16,n=0;n<16;++n)r[o+n]=e[t]+e[n];return r}()});var Rt=Y((sn,Nt)=>{var{Buffer:ur}=kt();function U(...e){let r=new U.Request(...e),t=new XMLHttpRequest;t.withCredentials=r.credentials==="include",t.timeout=r[l].timeout,t.open(r.method,r.url,!1);try{t.responseType="arraybuffer"}catch{}for(let i of r.headers)t.setRequestHeader(...i);t.send(r.body||null);let o=t.getAllResponseHeaders();o=o&&o.split(`\r `).filter(Boolean).map(i=>i.split(": ",2));let n=new U.Response(t.response,{headers:o,status:t.status,statusText:t.statusText});return n[l].url=t.responseURL,n[l].redirected=t.responseURL!==r.url,n}var l=Symbol("SyncFetch Internals"),Xe=["mode","cache","redirect","referrer","integrity"],Ze={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},L=class{constructor(r,t={}){for(let o of Xe)if(o in t)throw new TypeError(`option ${o} not supported`);if(t.credentials==="same-origin")throw new TypeError("option credentials with value 'same-origin' not supported");if(this[l]={method:t.method||"GET",headers:new U.Headers(t.headers),body:t.body?ur.from(t.body):null,credentials:t.credentials||"omit",timeout:t.timeout||0},typeof r=="string")this[l].url=r;else if(r instanceof L)this[l].url=r.url,t.method||(this[l].method=r.method),t.headers||(this[l].headers=r.headers),t.body||(this[l].body=r[l].body),t.credentials||(this[l].credentials=r.credentials);else throw new TypeError("Request input should be a URL string or a Request object")}get cache(){return"default"}get credentials(){return this[l].credentials}get destination(){return""}get headers(){return this[l].headers}get integrity(){return""}get method(){return this[l].method}get mode(){return"cors"}get priority(){return"auto"}get redirect(){return"follow"}get referrer(){return"about:client"}get referrerPolicy(){return""}get url(){return this[l].url}clone(){return Hr(this),new L(this.url,this[l])}},G=class{constructor(r,t={}){this[l]={body:r?ur.from(r):null,bodyUsed:!1,headers:new U.Headers(t.headers),status:t.status,statusText:t.statusText}}get headers(){return this[l].headers}get ok(){let r=this[l].status;return r>=200&&r<300}get redirected(){return this[l].redirected}get status(){return this[l].status}get statusText(){return this[l].statusText}get url(){return this[l].url}clone(){return this.redirect(this[l].url,this[l].status)}redirect(r,t){Hr(this);let o=new G(this[l].body,{headers:this[l].headers,status:t||this[l].status,statusText:Ze[t]||this[l].statusText});return o[l].url=r||this[l].url,o[l].redirected=this[l].redirected,o}},P=class{constructor(r){this[l]={body:ur.from(r),bodyUsed:!1}}get bodyUsed(){return this[l].bodyUsed}static mixin(r){for(let t of Object.getOwnPropertyNames(P.prototype)){if(t==="constructor")continue;let o=Object.getOwnPropertyDescriptor(P.prototype,t);Object.defineProperty(r,t,{...o,enumerable:!0})}}arrayBuffer(){let r=X(this);return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}blob(){let r=this.headers&&this.headers.get("content-type");return new Blob([X(this)],r&&{type:r})}text(){return X(this).toString()}json(){try{return JSON.parse(X(this).toString())}catch(r){throw new TypeError(`invalid json response body at ${this.url} reason: ${r.message}`,"invalid-json")}}buffer(){return X(this).clone()}};function Hr(e){if(e.bodyUsed)throw new TypeError(`body used already for: ${e.url}`)}function X(e){return Hr(e),e[l].bodyUsed=!0,e[l].body||ur.alloc(0)}P.mixin(L.prototype);P.mixin(G.prototype);var Wr=class{constructor(r){if(r instanceof U.Headers)this[l]={...r[l]};else if(this[l]={},Array.isArray(r))for(let[t,o]of r)this.append(t,o);else if(typeof r=="object")for(let t in r)this.set(t,r[t])}append(r,t){r=r.toLowerCase(),this[l][r]||(this[l][r]=[]),this[l][r].push(t)}delete(r){delete this[l][r.toLowerCase()]}set(r,t){this[l][r.toLowerCase()]=[t]}entries(){let r=[];for(let t in this[l])for(let o of this[l][t])r.push([t,o]);return r}get(r){return r=r.toLowerCase(),r in this[l]?this[l][r].join(", "):null}keys(){return Object.keys(this[l])}has(r){return r.toLowerCase()in this[l]}values(){let r=[];for(let t in this[l])for(let o of this[l][t])r.push(o);return r}*[Symbol.iterator](){for(let r in this[l])for(let t of this[l][r])yield[r,t]}};U.Headers=Wr;U.Request=L;U.Response=G;Nt.exports=U});var gr={};pr(gr,{Flux:()=>N,FluxDispatcher:()=>x,React:()=>p,ReactDOM:()=>ne,Router:()=>ie});var yr={};pr(yr,{find:()=>dr,findAll:()=>mr,findByDisplayName:()=>I,findByDisplayNameAll:()=>oe,findByProps:()=>g,findByPropsAll:()=>ee,modules:()=>fr});var Zr=window.webpackJsonp([],[(e,r,t)=>{e.exports=t}]);var Qr=(e,r=!1)=>t=>{let o=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n].exports;if(!i)continue;if(i.default&&i.__esModule&&t(i.default)){if(r)return i.default;o.push(i.default)}if(t(i)){if(r)return i;o.push(i)}}if(!r)return o},fr=Zr.c,dr=Qr(fr,!0),mr=Qr(fr),rt=e=>r=>e.every(t=>r[t]!==void 0),tt=(e,r)=>r?t=>t.displayName===e:t=>t?.default?.displayName===e,g=(...e)=>dr(rt(e)),ee=(...e)=>mr(rt(e)),I=(e,r=!0)=>dr(tt(e,r)),oe=(e,r=!0)=>mr(tt(e,r));var p=g("createElement"),ne=g("render","findDOMNode"),N=g("Store","initialize"),x=g("_isDispatching","dispatch"),ie=g("transitionTo");var Cr={};pr(Cr,{after:()=>v,before:()=>_r,instead:()=>ae,unpatchAll:()=>rr});var wr=["a","b","i"],F=new Map;function et(e,r,t,o,n){let i=F.get(r)?.[e];if(!i)return n?Reflect.construct(r[e],t,o):r[e].apply(o,t);for(let c of i.b.values()){let h=c.call(o,t);Array.isArray(h)&&(t=h)}let a=(...c)=>n?Reflect.construct(i.o,c,o):i.o.apply(o,c);for(let c of i.i.values()){let h=a;a=(...d)=>c.call(o,d,h)}let u=a(...t);for(let c of i.a.values())u=c.call(o,t,u)??u;return u}function xr(e,r,t,o){let n=F.get(e),i=n?.[r];return i?.[o].has(t)?(i[o].delete(t),wr.every(a=>i[a].size===0)&&(Reflect.defineProperty(e,r,{value:i.o,writable:!0,configurable:!0})||(e[r]=i.o),delete n[r]),Object.keys(n).length==0&&F.delete(e),!0):!1}function rr(){for(let[e,r]of F.entries())for(let t in r)for(let o of wr)for(let n of r[t]?.[o].keys()??[])xr(e,t,n,o)}var tr=e=>(r,t,o,n=!1)=>{if(typeof t[r]!="function")throw new Error(`${r} is not a function in ${t.constructor.name}`);F.has(t)||F.set(t,{});let i=F.get(t);if(!i[r]){let c=t[r];i[r]={o:c,b:new Map,i:new Map,a:new Map};let h=(m,y,_)=>{let z=et(r,t,y,m,_);return n&&u(),z},d=new Proxy(c,{apply:(m,y,_)=>h(y,_,!1),construct:(m,y)=>h(c,y,!0),get:(m,y,_)=>y=="toString"?c.toString.bind(c):Reflect.get(m,y,_)});Reflect.defineProperty(t,r,{value:d,configurable:!0,writable:!0})||(t[r]=d)}let a=Symbol(),u=()=>xr(t,r,a,e);return i[r][e].set(a,o),u};var _r=tr("b"),ae=tr("i"),v=tr("a");var ot=new Array;function se(e){let r=document.createElement("style");r.id="CORDWOOD_INJECTED_STYLE",r.innerHTML=e,document.head.appendChild(r),ot.push(t);function t(){r.remove()}return t}function Er(){for(let e of ot)e()}var nt={...Cr,injectCSS:se,clearStyles:Er};function k(e,r,{walkable:t=[],ignore:o=[],maxDepth:n=100}={}){let i=0;function a(u,c,{walkable:h=[],ignore:d=[]}={}){if(i+=1,!(i>n)){if(typeof c=="string"){if(u.hasOwnProperty(c))return u[c]}else if(c(u))return u;if(!!u){if(Array.isArray(u))for(let f of u){let m=a(f,c,{walkable:h,ignore:d});if(m)return m}else if(typeof u=="object"){for(let f of Object.keys(u))if(!(h!=null&&h.includes(f))&&!d.includes(f))try{let m=a(u[f],c,{walkable:h,ignore:d});if(m)return m}catch{}}}}}return a(e,r,{walkable:t,ignore:o})}var ue=g("showChangeLog");function br(){v("showChangeLog",ue,()=>{x.dispatch({type:"CHANGE_LOG_OPEN"})})}function ce(e,r,t){if(e===r)return!0;let o=Object.keys(e),n=Object.keys(r);if(o.length!==n.length)return!1;for(let i=0;iclass extends p.Component{static displayName=`FluxContainer(${le(t)})`;constructor(o){super(o),this.state=r(o),this._handleStoreChange=this._handleStoreChange.bind(this)}_handleStoreChange(){this.setState(r(this.props))}componentWillMount(){e.forEach(o=>{o.addChangeListener(this._handleStoreChange)})}componentWillReceiveProps(o){ce(this.props,o)||this.setState(r(o))}componentWillUnmount(){e.forEach(o=>o.removeChangeListener(this._handleStoreChange))}render(){return p.createElement(t,{...this.props,...this.state},null)}}}function J(e){return new Promise((r,t)=>{e.oncomplete=e.onsuccess=()=>r(e.result),e.onabort=e.onerror=()=>t(e.error)})}function pe(e,r){let t=indexedDB.open(e);t.onupgradeneeded=()=>t.result.createObjectStore(r);let o=J(t);return(n,i)=>o.then(a=>i(a.transaction(r,n).objectStore(r)))}var Ar;function er(){return Ar||(Ar=pe("keyval-store","keyval")),Ar}function it(e,r=er()){return r("readonly",t=>J(t.get(e)))}function at(e,r,t=er()){return t("readwrite",o=>(o.put(r,e),J(o.transaction)))}function st(e,r=er()){return r("readwrite",t=>(t.delete(e),J(t.transaction)))}function ut(e=er()){return e("readwrite",r=>(r.clear(),J(r.transaction)))}var Sr=class{async get(r,t=null){let o=await it(r);return o||(o=t),o}async set(r,t){await at(r,t)}async remove(r){await st(r)}async clear(){await ut()}},S=new Sr;var ct="CordwoodSettingsStore",Fr={fluxLogger:!1};async function lt(e){let r=!1,t={};for(let[o,n]of Object.entries(e))n!=null&&(r=!0,Fr[o]=n),t[o]=Fr[o];return r&&await S.set(ct,t),r}var Tr=class extends N.Store{constructor(r,t){super(r,t)}async initialize(){let r=await S.get(ct);r!=null&&await lt(r)}get fluxLogger(){return Fr.fluxLogger}},V=new Tr(x,async e=>{switch(e.type){case"CORDWOOD_SETTINGS_UPDATE":return await lt(e.settings);default:return!1}});var pt={setFlux(e){x.dispatch({type:"CORDWOOD_SETTINGS_UPDATE",settings:{fluxLogger:e}})}};var he=I("Scroller"),fe=I("Checkbox"),or=class extends p.Component{constructor(r={}){super(r)}render(){return p.createElement(he,{className:"settings-wrapper settings-panel"},p.createElement("div",{className:"control-groups"},p.createElement("div",{className:"control-group"},p.createElement("label",null,"Debug Settings"),p.createElement("ul",{className:"checkbox-group"},p.createElement("li",null,p.createElement(fe,{onChange:r=>{pt.setFlux(r.target.checked)},defaultChecked:this.props.fluxLogger},"Log everything that passes through the Flux Dispatcher.")),p.createElement("li",null,p.createElement("div",{className:"help-text"},"Note that this will clog up your console."))))))}};C(or,"displayName","SettingsView");var Dr=K([V],()=>({fluxLogger:V.fluxLogger}))(or);var M=g("defaultRules","parserFor"),ft=g("getDefaultRules","parserFor"),de=ft.getDefaultRules(),me=M.defaultRules.lheading,ht=M.defaultRules.link,ye=M.defaultRules.image,ge=ft.parserFor({...de,image:{...ye},link:{...ht},list:M.defaultRules.list,lheading:{...me,parse(e,r,t){return{className:/\{(.+?)}/.exec(e[1])[1],level:e[2]==="="?1:2,content:M.parseInline(r,e[1].replace(/\{.+?}/,""),t)}},react(e,r,t){return p.createElement(`h${e.level}`,{key:t.key,className:e.className},r(e.content,t))}},shortlink:{shortlinks:{gh:"github.com",srht:"git.sr.ht"},regex:/^\[(.+?)\]\((.+?):([^\/].+?)\)/,order:ht.order-.5,match(e){return this.regex.exec(e)},parse(e,r,t){return{content:M.parseInline(r,e[1],t),target:`https://${this.shortlinks[e[2]]}/${e[3]}`}},react(e,r,t){return p.createElement("a",{href:e.target},r(e.content,t))}}}),dt=({changelog:e})=>p.createElement("div",null,ge(e.body,!1));var we="._cordwood-settings-header_1mzwv_1{paddingbottom:1rem}._cordwood-changelog-button_1mzwv_1{display:block;color:#faa61a;font-size:12px;padding:8px 6px 10px 20px;cursor:pointer;opacity:.7;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}._cordwood-changelog-button_1mzwv_1:hover{opacity:1;color:#faa61a}";document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(we));var vr={cordwoodSettingsHeader:"_cordwood-settings-header_1mzwv_1",cordwoodChangelogButton:"_cordwood-changelog-button_1mzwv_1"};var gt=hr(Br());var xe="._defaultColor_hmmrj_1{color:#4f545c}._h1_hmmrj_1{font-size:20px;line-height:24px}._h1_hmmrj_1,._h1_hmmrj_1 ._h2_hmmrj_1{font-weight:500}._h2_hmmrj_1{font-size:16px;line-height:20px;text-transform:uppercase}._h3_hmmrj_1{line-height:24px;font-weight:400}._h3_hmmrj_1,._h3_hmmrj_1 ._h4_hmmrj_1{font-size:16px}._h4_hmmrj_1{line-height:20px;letter-spacing:.3px}._h4_hmmrj_1,._h4_hmmrj_1 ._h5_hmmrj_1{font-weight:500;text-transform:uppercase}._h5_hmmrj_1{font-size:12px;line-height:16px}._faded_hmmrj_1{color:rgba(114,118,126,.6)}._card_hmmrj_1{position:relative;margin:0 0 15px;padding:10px;border-radius:5px;font-size:14px;line-height:22px}._cardPrimary_hmmrj_1{color:#dcddde;background:#36393e}._cardPrimaryOutline_hmmrj_1{color:#dcddde;background:#36393e;border:1px solid #1e2124}._cardSuccess_hmmrj_1{color:#4dc303;background:#daffd1}._cardSuccessOutline_hmmrj_1{color:#4dc303;background:#daffd1;border:1px solid #4dc303}._cardWarning_hmmrj_1{color:#c38803;background:#ffefd1}._cardWarningOutline_hmmrj_1{color:#c38803;background:#ffefd1;border:1px solid #c38803}._cardDanger_hmmrj_1{color:#f04747;background:#fdecec}._cardDangerOutline_hmmrj_1{color:#f04747;background:#fdecec;border:1px solid #f04747}._cardBrand_hmmrj_1{background:rgba(88,101,242,.1)}._cardBrandOutline_hmmrj_1{background:rgba(88,101,242,.1);border:2px solid rgba(88,101,242,.5)}";document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(xe));var Ur={defaultColor:"_defaultColor_hmmrj_1",h1:"_h1_hmmrj_1",h2:"_h2_hmmrj_1",h3:"_h3_hmmrj_1",h4:"_h4_hmmrj_1",h5:"_h5_hmmrj_1",faded:"_faded_hmmrj_1",card:"_card_hmmrj_1",cardPrimary:"_cardPrimary_hmmrj_1",cardPrimaryOutline:"_cardPrimaryOutline_hmmrj_1",cardSuccess:"_cardSuccess_hmmrj_1",cardSuccessOutline:"_cardSuccessOutline_hmmrj_1",cardWarning:"_cardWarning_hmmrj_1",cardWarningOutline:"_cardWarningOutline_hmmrj_1",cardDanger:"_cardDanger_hmmrj_1",cardDangerOutline:"_cardDangerOutline_hmmrj_1",cardBrand:"_cardBrand_hmmrj_1",cardBrandOutline:"_cardBrandOutline_hmmrj_1"};var Or=(e,r,t)=>{console[t]("%cCordwood%c",`background-color: ${r}; color: black; font-weight: 600; border-radius: 16px; padding: 0px 5px 0px 5px;`,"",e)},q={log:e=>Or(e,"#b6c76c","log"),warn:e=>Or(e,"#e19c3d","warn"),error:e=>Or(e,"#a63d40","error")};function _e(e){return e==null||typeof e!="string"?"":`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`}function mt(e,r,...t){let o=t.reduce((a,u)=>a+_e(u),""),n=`${r}${o}`,i=e[n];return i??(q.warn(`Class doesn't exist: ${r} ${n}`),"")}var yt={PRIMARY:"cardPrimary",DANGER:"cardDanger",WARNING:"cardWarning",SUCCESS:"cardSuccess",BRAND:"cardBrand",CUSTOM:"cardCustom"},b=class extends p.PureComponent{render(){let{children:r,type:t,className:o,outline:n,...i}=this.props,a="";return n&&(a="outline"),p.createElement("div",{className:(0,gt.default)(Ur.card,o,mt(Ur,t,a)),...i},r)}};C(b,"displayName","Card"),C(b,"Types",yt),C(b,"defaultProps",{type:yt.PRIMARY,outline:!0});var jt=hr(Rt());function Lt(){return(0,jt.default)("https://api.github.com/repos/Cordwood/Cordwood/commits",{headers:{Accept:"application/vnd.github+json"}}).json()}var Pt="CordwoodDataStore",cr={commitData:[],latestFetch:0};async function Mt(e){let r=!1,t={};for(let[o,n]of Object.entries(e))n!=null&&(r=!0,cr[o]=n),t[o]=cr[o];return r&&await S.set(Pt,t),r}var Gr=class extends N.Store{constructor(r,t){super(r,t)}async initialize(){let r=await S.get(Pt);r!=null&&await Mt(r)}get commitData(){return cr.commitData}get latestFetch(){return cr.latestFetch}},Z=new Gr(x,async e=>{switch(e.type){case"CORDWOOD_DATA_UPDATE":return await Mt(e.data);default:return!1}});var qt={updateData(){x.dispatch({type:"CORDWOOD_DATA_UPDATE",data:{commitData:Lt(),latestFetch:new Date().getTime()*1e3}})}};var lr=class extends p.Component{constructor(r={commitData:[],latestFetch:0}){super(r),Z.commitData.length==0&&qt.updateData()}get outdatedData(){let r=new Date().getTime(),t=new Date(this.props.commitData[0].commit.author.date).getTime(),o=Math.abs(t-r),n=Math.ceil(o/(1e3*60*60*24));return{outdated:n>=3,outdatedDays:n}}render(){if(this.props.commitData.length>0)return p.createElement(b,{type:b.Types.PRIMARY},p.createElement(b,{type:this.outdatedData.outdatedDays>7?b.Types.DANGER:b.Types.BRAND},this.outdatedData.outdated?`You're ${this.outdatedData.outdatedDays>7?"over a week":`${Math.round(this.outdatedData.outdatedDays)} days`} out of date! Please update!`:`Last updated ${Math.round(this.outdatedData.outdatedDays)} day${Math.round(this.outdatedData.outdatedDays)==1?"":"s"} ago`),p.createElement("div",{style:{display:"flex",flex:"1 1 auto",alignItems:"stretch",justifyContent:"flex-start",flexWrap:"nowrap",flexDirection:"row",boxSizing:"border-box"}},p.createElement("div",{style:{marginLeft:0,flex:"1 1 auto"}},p.createElement("div",null,"Last update:"),p.createElement("div",null,p.createElement("a",{target:"_blank",href:`https://github.com/Cordwood/Cordwood/commit/${this.props.commitData[0].sha}`},this.props.commitData[0].sha.substring(0,7))," ","by ",this.props.commitData[0].commit.author.name,": ",this.props.commitData[0].commit.message))))}};C(lr,"displayName","Updater");var Wt=K([Z],()=>({commitData:Z.commitData,latestFetch:Z.latestFetch}))(lr);var Gt=hr(Br());var Qe="._h1_lqq18_1{font-size:20px;line-height:24px}._h1_lqq18_1,._h1_lqq18_1 ._h2_lqq18_1{font-weight:500}._h2_lqq18_1{font-size:16px;line-height:20px;text-transform:uppercase}._h3_lqq18_1{line-height:24px;font-weight:400}._h3_lqq18_1,._h3_lqq18_1 ._h4_lqq18_1{font-size:16px}._h4_lqq18_1{line-height:20px;letter-spacing:.3px}._h4_lqq18_1,._h4_lqq18_1 ._h5_lqq18_1{font-weight:500;text-transform:uppercase}._h5_lqq18_1{font-size:12px;line-height:16px}._faded_lqq18_1{color:rgba(114,118,126,.6)}";document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(Qe));var $r={h1:"_h1_lqq18_1",h2:"_h2_lqq18_1",h3:"_h3_lqq18_1",h4:"_h4_lqq18_1",h5:"_h5_lqq18_1",faded:"_faded_lqq18_1"};var ro="._defaultColor_1fvov_1{color:#4f545c}";document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(ro));var Ht={defaultColor:"_defaultColor_1fvov_1"};var $t=(i=>(i.H1="h1",i.H2="h2",i.H3="h3",i.H4="h4",i.H5="h5",i))($t||{}),O=class extends p.PureComponent{render(){let{tag:r,className:t,children:o,faded:n,...i}=this.props,a=!i.color&&r!=="h5"?Ht.defaultColor:null;return p.createElement(r,{className:(0,Gt.default)($r[r],t,a,{[$r.faded]:n}),...i},o)}};C(O,"displayName","FormTitle"),C(O,"Tags",$t),C(O,"defaultProps",{tag:"h5"});var to=I("Scroller"),$=class extends p.Component{render(){return p.createElement(to,{className:"settings-wrapper settings-panel"},p.createElement("img",{style:{width:"100%"},src:"https://raw.githubusercontent.com/Cordwood/Cordwood/master/.assets/banner/cordwood-transparent-black.png"}),p.createElement(Wt,null),p.createElement(O,{tag:O.Tags.H5},"Made with \u2764\uFE0F by Beef and Alyxia"))}};C($,"displayName","AboutView");function zr(){br();let e=g("UserSettingsModalSections");Object.assign(e.UserSettingsModalSections,{CORDWOOD_ABOUT:"CORDWOOD_ABOUT",CORDWOOD_SETTINGS:"CORDWOOD_SETTINGS",CORDWOOD_PLUGINS:"CORDWOOD_PLUGINS"});let r=g("getUserSettingsModalSections");v("getUserSettingsModalSections",r,(o,n)=>{n.push({section:e.UserSettingsModalSections.CORDWOOD_SETTINGS,label:"Cordwood",element:Dr})});let t=g("TabBarItem","TabBarHeader","TabBarSeparator");v("render",r.default.prototype,(o,n)=>{let i=k(n,u=>u?.selectedItem),a=k(n,u=>u.props?.className.trim?.()==="settings-inner");i.children[1].push(p.createElement(t.TabBarHeader,{className:vr.cordwoodSettingsHeader},"Cordwood"),p.createElement(t.TabBarItem,{key:"CORDWOOD_ABOUT"},"About"),p.createElement(t.TabBarItem,{key:"CORDWOOD_SETTINGS"},"Settings"),p.createElement("div",{className:vr.cordwoodChangelogButton,onClick:()=>{eo(),x.dispatch({type:"CHANGE_LOG_OPEN"})}},"Cordwood Change Log")),i.selectedItem==="CORDWOOD_ABOUT"&&(a.props.children=p.createElement($,null)),i.selectedItem==="CORDWOOD_SETTINGS"&&(a.props.children=p.createElement(Dr,null))})}function eo(){let e=I("MarkdownModal");v("render",e.prototype,(r,t)=>{if(!t.props.className.includes("change-log"))return t;let n=window.cordwood.changelog.replace(/\r/g,"").split(`---changelog--- `).slice(1).map(c=>{let h=!1,d={},f=c.split(` `).filter(m=>{if(m==="---")return h=!0,!1;if(!h){let y=m.split(": "),_=y.shift(),z=y.join(": ");d[_]=JSON.parse(z)}return h}).join(` `);return{...d,body:f}})[0],i=t.props.children[0].props.children[0];i[0].props.children="Cordwood Changelog",i[1]=` (${n.date})`;let a=t.props.children[2].props.children;a[1].props.href="https://github.com/Cordwood/Cordwood/blob/master/CHANGELOG.md";let u=t.props.children[1];return u.props.children[0]=null,u.props.children[1]=[p.createElement(dt,{changelog:n})],t},!0)}var zt=g("Router");function Yr(){_r("render",zt.Router.prototype,function(){let e=this;e.props.children[1].props.children.push(p.createElement(zt,{path:"/cordwood",component:()=>p.createElement("div",null,"Cordwood route")})),e.componentWillUnmount(),e.componentWillMount()},!0)}function Kr(e,r){return k(e,r,{walkable:["props","children","child","sibling"]})}function Jr(e){let r=new Array;for(let[t,o]of Object.entries(e)){let n=Object.entries(o).map(([i,a])=>`${i.replace(/[A-Z]/g,u=>`-${u.toLowerCase()}`)}:${a}`).join(";");r.push(`${t}{${n}}`)}return r.join("")}async function Vr(e){let r={cache:"no-cache"},t=new URL(e.endsWith("/")?e:e+"/"),o=await fetch(t+"manifest.json",r);if(!o.ok)throw new Error(`Could not load manifest for plugin at ${e}`);let n;try{n=await o.json()}catch{throw new Error(`Could not parse manifest for plugin at ${e}`)}let i;try{i=await(await fetch(t+"index.js",r)).text()}catch{throw new Error(`Could not load main file for plugin at ${e}`)}return{manifest:n,url:t,main:i}}var oo=window.eval;async function Xr(e){window.cordwood.plugins.loaded.push(e);let r=oo(e.main)(window.cordwood);r.onLoad&&r.onLoad()}var Yt=()=>v("dispatch",x,e=>{V.fluxLogger&&console.log(e[0])});if(window.cordwood)throw new Error("Cordwood is already injected...");var Kt=!1;try{zr(),Yr(),N.initialize(),Yt(),window.cordwood={utils:{logger:q,findInTree:k,findInReactTree:Kr,storage:{get:S.get,set:S.set,remove:S.remove,clear:S.clear},createStyle:Jr},patcher:{...nt},webpack:{...yr,common:{...gr}},plugins:{importPlugin:Vr,loadPlugin:Xr,loaded:new Array},uninject:()=>{rr(),Er(),delete window.cordwood}},fetch("https://raw.githubusercontent.com/Cordwood/Cordwood/master/CHANGELOG.md",{cache:"no-store"}).then(e=>e.text().then(r=>Object.assign(window.cordwood,{changelog:r})))}catch(e){Kt=!0,q.error(`Cordwood failed to initialize... ${e.stack?e.stack:e.toString()}`)}Kt||q.log("Loaded successfully!");})(); //# sourceURL=Cordwood