@dxos/shell 0.6.3-main.3c9610d โ 0.6.3-main.4203f37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/shell.mjs +23 -23
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +3 -3
- package/dist/bundle/shell.umd.js.map +1 -1
- package/package.json +23 -23
package/dist/bundle/shell.umd.js
CHANGED
|
@@ -111,9 +111,9 @@ Check the top-level render call using <`+at+">.")}return Xe}}function vn(Fe,Xe){
|
|
|
111
111
|
*/var import_buffer$1=__toESM$1(require_buffer());typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,"global")&&Object.defineProperty(globalThis,"global",{value:globalThis,configurable:!0,writable:!1,enumerable:!0}),typeof globalThis<"u"&&!globalThis.Buffer&&(globalThis.Buffer=import_buffer$1.Buffer),typeof globalThis<"u"&&!globalThis.process&&(globalThis.process=process$1);var import_util=__toESM$1(require_util()),import_util2=__toESM$1(require_util());import_util.default,import_util2.callbackify;var export_inspect=import_util2.inspect;import_util2.promisify;var lodash_defaultsdeep={exports:{}};lodash_defaultsdeep.exports,function(_,$){var I=200,j="__lodash_hash_undefined__",U=800,q=16,G=9007199254740991,K="[object Arguments]",Y="[object Array]",J="[object AsyncFunction]",X="[object Boolean]",Z="[object Date]",Q="[object Error]",ee="[object Function]",ne="[object GeneratorFunction]",ie="[object Map]",oe="[object Number]",se="[object Null]",ae="[object Object]",fe="[object Proxy]",le="[object RegExp]",pe="[object Set]",ue="[object String]",ve="[object Undefined]",ge="[object WeakMap]",be="[object ArrayBuffer]",Re="[object DataView]",we="[object Float32Array]",$e="[object Float64Array]",Me="[object Int8Array]",Ie="[object Int16Array]",Be="[object Int32Array]",We="[object Uint8Array]",Ke="[object Uint8ClampedArray]",Je="[object Uint16Array]",qe="[object Uint32Array]",Ze=/[\\^$.*+?()[\]{}|]/g,Ge=/^\[object .+?Constructor\]$/,Ne=/^(?:0|[1-9]\d*)$/,De={};De[we]=De[$e]=De[Me]=De[Ie]=De[Be]=De[We]=De[Ke]=De[Je]=De[qe]=!0,De[K]=De[Y]=De[be]=De[X]=De[Re]=De[Z]=De[Q]=De[ee]=De[ie]=De[oe]=De[ae]=De[le]=De[pe]=De[ue]=De[ge]=!1;var He=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,tt=typeof self=="object"&&self&&self.Object===Object&&self,Pe=He||tt||Function("return this")(),Le=$&&!$.nodeType&&$,Se=Le&&!0&&_&&!_.nodeType&&_,xe=Se&&Se.exports===Le,Ee=xe&&He.process,he=function(){try{var ye=Se&&Se.require&&Se.require("util").types;return ye||Ee&&Ee.binding&&Ee.binding("util")}catch{}}(),me=he&&he.isTypedArray;function Ae(ye,Te,ze){switch(ze.length){case 0:return ye.call(Te);case 1:return ye.call(Te,ze[0]);case 2:return ye.call(Te,ze[0],ze[1]);case 3:return ye.call(Te,ze[0],ze[1],ze[2])}return ye.apply(Te,ze)}function Ue(ye,Te){for(var ze=-1,et=Array(ye);++ze<ye;)et[ze]=Te(ze);return et}function Ye(ye){return function(Te){return ye(Te)}}function Qe(ye,Te){return ye==null?void 0:ye[Te]}function nt(ye,Te){return function(ze){return ye(Te(ze))}}var it=Array.prototype,Ve=Function.prototype,ht=Object.prototype,Et=Pe["__core-js_shared__"],lt=Ve.toString,yt=ht.hasOwnProperty,St=function(){var ye=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||"");return ye?"Symbol(src)_1."+ye:""}(),ot=ht.toString,bt=lt.call(Object),ce=RegExp("^"+lt.call(yt).replace(Ze,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=xe?Pe.Buffer:void 0,re=Pe.Symbol,de=Pe.Uint8Array,_e=te?te.allocUnsafe:void 0,ke=nt(Object.getPrototypeOf,Object),Oe=Object.create,rt=ht.propertyIsEnumerable,pt=it.splice,st=re?re.toStringTag:void 0,ut=function(){try{var ye=In(Object,"defineProperty");return ye({},"",{}),ye}catch{}}(),ft=te?te.isBuffer:void 0,Xt=Math.max,pn=Date.now,Vt=In(Pe,"Map"),Ut=In(Object,"create"),an=function(){function ye(){}return function(Te){if(!Ht(Te))return{};if(Oe)return Oe(Te);ye.prototype=Te;var ze=new ye;return ye.prototype=void 0,ze}}();function Ft(ye){var Te=-1,ze=ye==null?0:ye.length;for(this.clear();++Te<ze;){var et=ye[Te];this.set(et[0],et[1])}}function En(){this.__data__=Ut?Ut(null):{},this.size=0}function hn(ye){var Te=this.has(ye)&&delete this.__data__[ye];return this.size-=Te?1:0,Te}function Rn(ye){var Te=this.__data__;if(Ut){var ze=Te[ye];return ze===j?void 0:ze}return yt.call(Te,ye)?Te[ye]:void 0}function vn(ye){var Te=this.__data__;return Ut?Te[ye]!==void 0:yt.call(Te,ye)}function mn(ye,Te){var ze=this.__data__;return this.size+=this.has(ye)?0:1,ze[ye]=Ut&&Te===void 0?j:Te,this}Ft.prototype.clear=En,Ft.prototype.delete=hn,Ft.prototype.get=Rn,Ft.prototype.has=vn,Ft.prototype.set=mn;function It(ye){var Te=-1,ze=ye==null?0:ye.length;for(this.clear();++Te<ze;){var et=ye[Te];this.set(et[0],et[1])}}function Sn(){this.__data__=[],this.size=0}function gn(ye){var Te=this.__data__,ze=Nt(Te,ye);if(ze<0)return!1;var et=Te.length-1;return ze==et?Te.pop():pt.call(Te,ze,1),--this.size,!0}function Cn(ye){var Te=this.__data__,ze=Nt(Te,ye);return ze<0?void 0:Te[ze][1]}function Tn(ye){return Nt(this.__data__,ye)>-1}function An(ye,Te){var ze=this.__data__,et=Nt(ze,ye);return et<0?(++this.size,ze.push([ye,Te])):ze[et][1]=Te,this}It.prototype.clear=Sn,It.prototype.delete=gn,It.prototype.get=Cn,It.prototype.has=Tn,It.prototype.set=An;function zt(ye){var Te=-1,ze=ye==null?0:ye.length;for(this.clear();++Te<ze;){var et=ye[Te];this.set(et[0],et[1])}}function Fe(){this.size=0,this.__data__={hash:new Ft,map:new(Vt||It),string:new Ft}}function Xe(ye){var Te=en(this,ye).delete(ye);return this.size-=Te?1:0,Te}function at(ye){return en(this,ye).get(ye)}function vt(ye){return en(this,ye).has(ye)}function Rt(ye,Te){var ze=en(this,ye),et=ze.size;return ze.set(ye,Te),this.size+=ze.size==et?0:1,this}zt.prototype.clear=Fe,zt.prototype.delete=Xe,zt.prototype.get=at,zt.prototype.has=vt,zt.prototype.set=Rt;function _t(ye){var Te=this.__data__=new It(ye);this.size=Te.size}function kt(){this.__data__=new It,this.size=0}function $t(ye){var Te=this.__data__,ze=Te.delete(ye);return this.size=Te.size,ze}function Pt(ye){return this.__data__.get(ye)}function Tt(ye){return this.__data__.has(ye)}function At(ye,Te){var ze=this.__data__;if(ze instanceof It){var et=ze.__data__;if(!Vt||et.length<I-1)return et.push([ye,Te]),this.size=++ze.size,this;ze=this.__data__=new zt(et)}return ze.set(ye,Te),this.size=ze.size,this}_t.prototype.clear=kt,_t.prototype.delete=$t,_t.prototype.get=Pt,_t.prototype.has=Tt,_t.prototype.set=At;function jt(ye,Te){var ze=ln(ye),et=!ze&&fn(ye),dt=!ze&&!et&&$n(ye),ct=!ze&&!et&&!dt&&Wn(ye),mt=ze||et||dt||ct,gt=mt?Ue(ye.length,String):[],xt=gt.length;for(var Lt in ye)(Te||yt.call(ye,Lt))&&!(mt&&(Lt=="length"||dt&&(Lt=="offset"||Lt=="parent")||ct&&(Lt=="buffer"||Lt=="byteLength"||Lt=="byteOffset")||Bn(Lt,xt)))&>.push(Lt);return gt}function Wt(ye,Te,ze){(ze!==void 0&&!tn(ye[Te],ze)||ze===void 0&&!(Te in ye))&&sn(ye,Te,ze)}function bn(ye,Te,ze){var et=ye[Te];(!(yt.call(ye,Te)&&tn(et,ze))||ze===void 0&&!(Te in ye))&&sn(ye,Te,ze)}function Nt(ye,Te){for(var ze=ye.length;ze--;)if(tn(ye[ze][0],Te))return ze;return-1}function sn(ye,Te,ze){Te=="__proto__"&&ut?ut(ye,Te,{configurable:!0,enumerable:!0,value:ze,writable:!0}):ye[Te]=ze}var Yn=sr();function Zt(ye){return ye==null?ye===void 0?ve:se:st&&st in Object(ye)?cr(ye):ur(ye)}function On(ye){return dn(ye)&&Zt(ye)==K}function Jn(ye){if(!Ht(ye)||jn(ye))return!1;var Te=wn(ye)?ce:Ge;return Te.test(_n(ye))}function Xn(ye){return dn(ye)&&Kt(ye.length)&&!!De[Zt(ye)]}function Zn(ye){if(!Ht(ye))return dr(ye);var Te=Un(ye),ze=[];for(var et in ye)et=="constructor"&&(Te||!yt.call(ye,et))||ze.push(et);return ze}function yn(ye,Te,ze,et,dt){ye!==Te&&Yn(Te,function(ct,mt){if(dt||(dt=new _t),Ht(ct))Qn(ye,Te,mt,ze,yn,et,dt);else{var gt=et?et(Nn(ye,mt),ct,mt+"",ye,Te,dt):void 0;gt===void 0&&(gt=ct),Wt(ye,mt,gt)}},qn)}function Qn(ye,Te,ze,et,dt,ct,mt){var gt=Nn(ye,ze),xt=Nn(Te,ze),Lt=mt.get(xt);if(Lt){Wt(ye,ze,Lt);return}var Bt=ct?ct(gt,xt,ze+"",ye,Te,mt):void 0,Qt=Bt===void 0;if(Qt){var kn=ln(xt),gr=!kn&&$n(xt),yr=!kn&&!gr&&Wn(xt);Bt=xt,kn||gr||yr?ln(gt)?Bt=gt:zn(gt)?Bt=ir(gt):gr?(Qt=!1,Bt=tr(xt,!0)):yr?(Qt=!1,Bt=rr(xt,!0)):Bt=[]:Hn(xt)||fn(xt)?(Bt=gt,fn(gt)?Bt=Vn(gt):(!Ht(gt)||wn(gt))&&(Bt=Dn(xt))):Qt=!1}Qt&&(mt.set(xt,Bt),dt(Bt,xt,et,ct,mt),mt.delete(xt)),Wt(ye,ze,Bt)}function Ln(ye,Te){return pr(Pn(ye,Te,Ce),ye+"")}var er=ut?function(ye,Te){return ut(ye,"toString",{configurable:!0,enumerable:!1,value:mr(Te),writable:!0})}:Ce;function tr(ye,Te){if(Te)return ye.slice();var ze=ye.length,et=_e?_e(ze):new ye.constructor(ze);return ye.copy(et),et}function nr(ye){var Te=new ye.constructor(ye.byteLength);return new de(Te).set(new de(ye)),Te}function rr(ye,Te){var ze=Te?nr(ye.buffer):ye.buffer;return new ye.constructor(ze,ye.byteOffset,ye.length)}function ir(ye,Te){var ze=-1,et=ye.length;for(Te||(Te=Array(et));++ze<et;)Te[ze]=ye[ze];return Te}function ar(ye,Te,ze,et){var dt=!ze;ze||(ze={});for(var ct=-1,mt=Te.length;++ct<mt;){var gt=Te[ct],xt=et?et(ze[gt],ye[gt],gt,ze,ye):void 0;xt===void 0&&(xt=ye[gt]),dt?sn(ze,gt,xt):bn(ze,gt,xt)}return ze}function or(ye){return Ln(function(Te,ze){var et=-1,dt=ze.length,ct=dt>1?ze[dt-1]:void 0,mt=dt>2?ze[2]:void 0;for(ct=ye.length>3&&typeof ct=="function"?(dt--,ct):void 0,mt&&fr(ze[0],ze[1],mt)&&(ct=dt<3?void 0:ct,dt=1),Te=Object(Te);++et<dt;){var gt=ze[et];gt&&ye(Te,gt,et,ct)}return Te})}function sr(ye){return function(Te,ze,et){for(var dt=-1,ct=Object(Te),mt=et(Te),gt=mt.length;gt--;){var xt=mt[ye?gt:++dt];if(ze(ct[xt],xt,ct)===!1)break}return Te}}function cn(ye,Te,ze,et,dt,ct){return Ht(ye)&&Ht(Te)&&(ct.set(Te,ye),yn(ye,Te,void 0,cn,ct),ct.delete(Te)),ye}function en(ye,Te){var ze=ye.__data__;return lr(Te)?ze[typeof Te=="string"?"string":"hash"]:ze.map}function In(ye,Te){var ze=Qe(ye,Te);return Jn(ze)?ze:void 0}function cr(ye){var Te=yt.call(ye,st),ze=ye[st];try{ye[st]=void 0;var et=!0}catch{}var dt=ot.call(ye);return et&&(Te?ye[st]=ze:delete ye[st]),dt}function Dn(ye){return typeof ye.constructor=="function"&&!Un(ye)?an(ke(ye)):{}}function Bn(ye,Te){var ze=typeof ye;return Te=Te??G,!!Te&&(ze=="number"||ze!="symbol"&&Ne.test(ye))&&ye>-1&&ye%1==0&&ye<Te}function fr(ye,Te,ze){if(!Ht(ze))return!1;var et=typeof Te;return(et=="number"?Mn(ze)&&Bn(Te,ze.length):et=="string"&&Te in ze)?tn(ze[Te],ye):!1}function lr(ye){var Te=typeof ye;return Te=="string"||Te=="number"||Te=="symbol"||Te=="boolean"?ye!=="__proto__":ye===null}function jn(ye){return!!St&&St in ye}function Un(ye){var Te=ye&&ye.constructor,ze=typeof Te=="function"&&Te.prototype||ht;return ye===ze}function dr(ye){var Te=[];if(ye!=null)for(var ze in Object(ye))Te.push(ze);return Te}function ur(ye){return ot.call(ye)}function Pn(ye,Te,ze){return Te=Xt(Te===void 0?ye.length-1:Te,0),function(){for(var et=arguments,dt=-1,ct=Xt(et.length-Te,0),mt=Array(ct);++dt<ct;)mt[dt]=et[Te+dt];dt=-1;for(var gt=Array(Te+1);++dt<Te;)gt[dt]=et[dt];return gt[Te]=ze(mt),Ae(ye,this,gt)}}function Nn(ye,Te){if(!(Te==="constructor"&&typeof ye[Te]=="function")&&Te!="__proto__")return ye[Te]}var pr=hr(er);function hr(ye){var Te=0,ze=0;return function(){var et=pn(),dt=q-(et-ze);if(ze=et,dt>0){if(++Te>=U)return arguments[0]}else Te=0;return ye.apply(void 0,arguments)}}function _n(ye){if(ye!=null){try{return lt.call(ye)}catch{}try{return ye+""}catch{}}return""}function tn(ye,Te){return ye===Te||ye!==ye&&Te!==Te}var fn=On(function(){return arguments}())?On:function(ye){return dn(ye)&&yt.call(ye,"callee")&&!rt.call(ye,"callee")},ln=Array.isArray;function Mn(ye){return ye!=null&&Kt(ye.length)&&!wn(ye)}function zn(ye){return dn(ye)&&Mn(ye)}var $n=ft||je;function wn(ye){if(!Ht(ye))return!1;var Te=Zt(ye);return Te==ee||Te==ne||Te==J||Te==fe}function Kt(ye){return typeof ye=="number"&&ye>-1&&ye%1==0&&ye<=G}function Ht(ye){var Te=typeof ye;return ye!=null&&(Te=="object"||Te=="function")}function dn(ye){return ye!=null&&typeof ye=="object"}function Hn(ye){if(!dn(ye)||Zt(ye)!=ae)return!1;var Te=ke(ye);if(Te===null)return!0;var ze=yt.call(Te,"constructor")&&Te.constructor;return typeof ze=="function"&&ze instanceof ze&<.call(ze)==bt}var Wn=me?Ye(me):Xn;function Vn(ye){return ar(ye,qn(ye))}var vr=Ln(function(ye){return ye.push(void 0,cn),Ae(Gn,void 0,ye)});function qn(ye){return Mn(ye)?jt(ye,!0):Zn(ye)}var Gn=or(function(ye,Te,ze,et){yn(ye,Te,ze,et)});function mr(ye){return function(){return ye}}function Ce(ye){return ye}function je(){return!1}_.exports=vr}(lodash_defaultsdeep,lodash_defaultsdeep.exports);var lodash_defaultsdeepExports=lodash_defaultsdeep.exports;const defaultsDeep=getDefaultExportFromCjs(lodash_defaultsdeepExports);var import_buffer=__toESM$1(require_buffer()),export_Buffer=import_buffer.Buffer,invariant=(_,$,I)=>{if(_)return;if($!=null&&$.startsWith("BUG"))debugger;let j="invariant violation";throw $&&(j+=`: ${$}`),I!=null&&I.A&&(j+=` [${I.A[0]}]`),I!=null&&I.F&&(j+=` at ${getRelativeFilename$1(I.F)}:${I.L}`),new InvariantViolation(j)},InvariantViolation=class extends Error{constructor(_){super(_),Object.setPrototypeOf(this,new.target.prototype)}},getRelativeFilename$1=_=>{const $=_.match(/.+\/(packages\/.+\/.+)/);if($){const[,I]=$;return I}return _},require_events=__commonJS$1({"node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(_,$){var I=typeof Reflect=="object"?Reflect:null,j=I&&typeof I.apply=="function"?I.apply:function(ve,ge,be){return Function.prototype.apply.call(ve,ge,be)},U;I&&typeof I.ownKeys=="function"?U=I.ownKeys:Object.getOwnPropertySymbols?U=function(ve){return Object.getOwnPropertyNames(ve).concat(Object.getOwnPropertySymbols(ve))}:U=function(ve){return Object.getOwnPropertyNames(ve)};function q(ue){console&&console.warn&&console.warn(ue)}var G=Number.isNaN||function(ve){return ve!==ve};function K(){K.init.call(this)}$.exports=K,$.exports.once=fe,K.EventEmitter=K,K.prototype._events=void 0,K.prototype._eventsCount=0,K.prototype._maxListeners=void 0;var Y=10;function J(ue){if(typeof ue!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ue)}Object.defineProperty(K,"defaultMaxListeners",{enumerable:!0,get:function(){return Y},set:function(ue){if(typeof ue!="number"||ue<0||G(ue))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ue+".");Y=ue}}),K.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},K.prototype.setMaxListeners=function(ve){if(typeof ve!="number"||ve<0||G(ve))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ve+".");return this._maxListeners=ve,this};function X(ue){return ue._maxListeners===void 0?K.defaultMaxListeners:ue._maxListeners}K.prototype.getMaxListeners=function(){return X(this)},K.prototype.emit=function(ve){for(var ge=[],be=1;be<arguments.length;be++)ge.push(arguments[be]);var Re=ve==="error",we=this._events;if(we!==void 0)Re=Re&&we.error===void 0;else if(!Re)return!1;if(Re){var $e;if(ge.length>0&&($e=ge[0]),$e instanceof Error)throw $e;var Me=new Error("Unhandled error."+($e?" ("+$e.message+")":""));throw Me.context=$e,Me}var Ie=we[ve];if(Ie===void 0)return!1;if(typeof Ie=="function")j(Ie,this,ge);else for(var Be=Ie.length,We=oe(Ie,Be),be=0;be<Be;++be)j(We[be],this,ge);return!0};function Z(ue,ve,ge,be){var Re,we,$e;if(J(ge),we=ue._events,we===void 0?(we=ue._events=Object.create(null),ue._eventsCount=0):(we.newListener!==void 0&&(ue.emit("newListener",ve,ge.listener?ge.listener:ge),we=ue._events),$e=we[ve]),$e===void 0)$e=we[ve]=ge,++ue._eventsCount;else if(typeof $e=="function"?$e=we[ve]=be?[ge,$e]:[$e,ge]:be?$e.unshift(ge):$e.push(ge),Re=X(ue),Re>0&&$e.length>Re&&!$e.warned){$e.warned=!0;var Me=new Error("Possible EventEmitter memory leak detected. "+$e.length+" "+String(ve)+" listeners added. Use emitter.setMaxListeners() to increase limit");Me.name="MaxListenersExceededWarning",Me.emitter=ue,Me.type=ve,Me.count=$e.length,q(Me)}return ue}K.prototype.addListener=function(ve,ge){return Z(this,ve,ge,!1)},K.prototype.on=K.prototype.addListener,K.prototype.prependListener=function(ve,ge){return Z(this,ve,ge,!0)};function Q(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ee(ue,ve,ge){var be={fired:!1,wrapFn:void 0,target:ue,type:ve,listener:ge},Re=Q.bind(be);return Re.listener=ge,be.wrapFn=Re,Re}K.prototype.once=function(ve,ge){return J(ge),this.on(ve,ee(this,ve,ge)),this},K.prototype.prependOnceListener=function(ve,ge){return J(ge),this.prependListener(ve,ee(this,ve,ge)),this},K.prototype.removeListener=function(ve,ge){var be,Re,we,$e,Me;if(J(ge),Re=this._events,Re===void 0)return this;if(be=Re[ve],be===void 0)return this;if(be===ge||be.listener===ge)--this._eventsCount===0?this._events=Object.create(null):(delete Re[ve],Re.removeListener&&this.emit("removeListener",ve,be.listener||ge));else if(typeof be!="function"){for(we=-1,$e=be.length-1;$e>=0;$e--)if(be[$e]===ge||be[$e].listener===ge){Me=be[$e].listener,we=$e;break}if(we<0)return this;we===0?be.shift():se(be,we),be.length===1&&(Re[ve]=be[0]),Re.removeListener!==void 0&&this.emit("removeListener",ve,Me||ge)}return this},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(ve){var ge,be,Re;if(be=this._events,be===void 0)return this;if(be.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):be[ve]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete be[ve]),this;if(arguments.length===0){var we=Object.keys(be),$e;for(Re=0;Re<we.length;++Re)$e=we[Re],$e!=="removeListener"&&this.removeAllListeners($e);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(ge=be[ve],typeof ge=="function")this.removeListener(ve,ge);else if(ge!==void 0)for(Re=ge.length-1;Re>=0;Re--)this.removeListener(ve,ge[Re]);return this};function ne(ue,ve,ge){var be=ue._events;if(be===void 0)return[];var Re=be[ve];return Re===void 0?[]:typeof Re=="function"?ge?[Re.listener||Re]:[Re]:ge?ae(Re):oe(Re,Re.length)}K.prototype.listeners=function(ve){return ne(this,ve,!0)},K.prototype.rawListeners=function(ve){return ne(this,ve,!1)},K.listenerCount=function(ue,ve){return typeof ue.listenerCount=="function"?ue.listenerCount(ve):ie.call(ue,ve)},K.prototype.listenerCount=ie;function ie(ue){var ve=this._events;if(ve!==void 0){var ge=ve[ue];if(typeof ge=="function")return 1;if(ge!==void 0)return ge.length}return 0}K.prototype.eventNames=function(){return this._eventsCount>0?U(this._events):[]};function oe(ue,ve){for(var ge=new Array(ve),be=0;be<ve;++be)ge[be]=ue[be];return ge}function se(ue,ve){for(;ve+1<ue.length;ve++)ue[ve]=ue[ve+1];ue.pop()}function ae(ue){for(var ve=new Array(ue.length),ge=0;ge<ve.length;++ge)ve[ge]=ue[ge].listener||ue[ge];return ve}function fe(ue,ve){return new Promise(function(ge,be){function Re($e){ue.removeListener(ve,we),be($e)}function we(){typeof ue.removeListener=="function"&&ue.removeListener("error",Re),ge([].slice.call(arguments))}pe(ue,ve,we,{once:!0}),ve!=="error"&&le(ue,Re,{once:!0})})}function le(ue,ve,ge){typeof ue.on=="function"&&pe(ue,"error",ve,ge)}function pe(ue,ve,ge,be){if(typeof ue.on=="function")be.once?ue.once(ve,ge):ue.on(ve,ge);else if(typeof ue.addEventListener=="function")ue.addEventListener(ve,function Re(we){be.once&&ue.removeEventListener(ve,Re),ge(we)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ue)}}}),import_events=__toESM$1(require_events());import_events.EventEmitter,import_events.EventEmitter;var inspectObject=_=>{const $=Object.getPrototypeOf(_).constructor.name;return _.toJSON?`${$}(${export_inspect(_.toJSON())})`:String(_)},raise$2=_=>{throw _},SnoopLevel;(function(_){_[_.DEFAULT=0]="DEFAULT",_[_.VERBOSE=1]="VERBOSE",_[_.BOLD=2]="BOLD"})(SnoopLevel||(SnoopLevel={}));var StackTrace=class{constructor(){this._stack=new Error}getStack(_=0){return this._stack.stack.split(`
|
|
112
112
|
`).slice(_+2).join(`
|
|
113
113
|
`)}},truncateKey=(_,$=8)=>{const I=String(_);return I.length<=$?I:I.slice(0,$)},warnAfterTimeout=async(_,$,I)=>{const j=new StackTrace,U=setTimeout(()=>{console.warn(`Action \`${$}\` is taking more then ${_.toLocaleString()}ms to complete. This might be a bug.
|
|
114
|
-
${j.getStack()}`)},_);try{return await I()}finally{clearTimeout(U)}},devtoolsFormatter=Symbol.for("devtoolsFormatter"),register=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(_,$)=>{const I=_[devtoolsFormatter];if(I===void 0)return null;if(typeof I!="object"||I===null||typeof I.header!="function")throw new Error(`Invalid devtools formatter for ${_.constructor.name}`);return I.header($)},hasBody:(_,$)=>{const I=_[devtoolsFormatter];return!I||!I.hasBody?!1:I.hasBody($)},body:(_,$)=>{const I=_[devtoolsFormatter];return!I||!I.body?null:I.body($)}})};register();var equalsSymbol=Symbol.for("dxos.common.equals"),__create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__require=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:($,I)=>(typeof require<"u"?require:$)[I]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+_+'" is not supported')}),__commonJS=(_,$)=>function(){return $||(0,_[__getOwnPropNames(_)[0]])(($={exports:{}}).exports,$),$.exports},__copyProps=(_,$,I,j)=>{if($&&typeof $=="object"||typeof $=="function")for(let U of __getOwnPropNames($))!__hasOwnProp$1.call(_,U)&&U!==I&&__defProp$1(_,U,{get:()=>$[U],enumerable:!(j=__getOwnPropDesc($,U))||j.enumerable});return _},__toESM=(_,$,I)=>(I=_!=null?__create(__getProtoOf(_)):{},__copyProps($||!_||!_.__esModule?__defProp$1(I,"default",{value:_,enumerable:!0}):I,_)),require_base32_decode=__commonJS({"node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js"(_,$){var I="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",j="0123456789ABCDEFGHIJKLMNOPQRSTUV",U="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function q(G,K){var Y=G.indexOf(K);if(Y===-1)throw new Error("Invalid character found: "+K);return Y}$.exports=function(K,Y){var J;switch(Y){case"RFC3548":case"RFC4648":J=I,K=K.replace(/=+$/,"");break;case"RFC4648-HEX":J=j,K=K.replace(/=+$/,"");break;case"Crockford":J=U,K=K.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+Y)}for(var X=K.length,Z=0,Q=0,ee=0,ne=new Uint8Array(X*5/8|0),ie=0;ie<X;ie++)Q=Q<<5|q(J,K[ie]),Z+=5,Z>=8&&(ne[ee++]=Q>>>Z-8&255,Z-=8);return ne.buffer}}}),import_base32_decode=__toESM(require_base32_decode());function toDataView(_){if(_ instanceof Int8Array||_ instanceof Uint8Array||_ instanceof Uint8ClampedArray)return new DataView(_.buffer,_.byteOffset,_.byteLength);if(_ instanceof ArrayBuffer)return new DataView(_);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var RFC4648="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",RFC4648_HEX="0123456789ABCDEFGHIJKLMNOPQRSTUV",CROCKFORD="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function base32Encode(_,$,I){I=I||{};let j,U;switch($){case"RFC3548":case"RFC4648":j=RFC4648,U=!0;break;case"RFC4648-HEX":j=RFC4648_HEX,U=!0;break;case"Crockford":j=CROCKFORD,U=!1;break;default:throw new Error("Unknown base32 variant: "+$)}const q=I.padding!==void 0?I.padding:U,G=toDataView(_);let K=0,Y=0,J="";for(let X=0;X<G.byteLength;X++)for(Y=Y<<8|G.getUint8(X),K+=8;K>=5;)J+=j[Y>>>K-5&31],K-=5;if(K>0&&(J+=j[Y<<5-K&31]),q)for(;J.length%8!==0;)J+="=";return J}var randomBytes=_=>{const $=globalThis.crypto??__require("@dxos/node-std/crypto").webcrypto,I=new Uint8Array(_);return $.getRandomValues(I),I},__dxlog_file$6="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",PUBLIC_KEY_LENGTH=32,PublicKey=class Dt{static from($){if(invariant($,void 0,{F:__dxlog_file$6,L:34,S:this,A:["source",""]}),$ instanceof Dt)return $;if($ instanceof Buffer)return new Dt(new Uint8Array($.buffer,$.byteOffset,$.byteLength));if($ instanceof Uint8Array)return new Dt($);if($ instanceof ArrayBuffer)return new Dt(new Uint8Array($));if(typeof $=="string")return Dt.fromHex($);if($.asUint8Array)return new Dt($.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${$}`)}static safeFrom($){if($)try{return Dt.from($)}catch{return}}static fromHex($){$.startsWith("0x")&&($=$.slice(2));const I=Buffer.from($,"hex");return new Dt(new Uint8Array(I.buffer,I.byteOffset,I.byteLength))}static random(){return Dt.from(randomBytes(PUBLIC_KEY_LENGTH))}static randomOfLength($){return Dt.from(randomBytes($))}static*randomSequence(){for(let $=0;$<1e4;$++)yield Dt.random();throw new Error("Too many keys requested")}static isPublicKey($){return $ instanceof Dt}static assertValidPublicKey($){if(!this.isPublicKey($))throw new TypeError("Invalid PublicKey")}static equals($,I){return Dt.from($).equals(I)}static bufferize($){return invariant(typeof $=="string","Invalid type",{F:__dxlog_file$6,L:137,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from($,"hex")}static stringify($){return $ instanceof Dt?$=$.asBuffer():$ instanceof Uint8Array&&($=Buffer.from($.buffer,$.byteOffset,$.byteLength)),invariant($ instanceof Buffer,"Invalid type",{F:__dxlog_file$6,L:156,S:this,A:["key instanceof Buffer","'Invalid type'"]}),$.toString("hex")}static hash($){return $.toHex()}static fromMultibase32($){return invariant($.startsWith("B"),"Invalid multibase32 encoding",{F:__dxlog_file$6,L:169,S:this,A:["encoded.startsWith('B')","'Invalid multibase32 encoding'"]}),new Dt(new Uint8Array((0,import_base32_decode.default)($.slice(1),"RFC4648")))}constructor($){if(this._value=$,!($ instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${$}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}toJSONL(){return this.truncate()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}toMultibase32(){return"B"+base32Encode(this._value,"RFC4648")}truncate($=void 0){return truncateKey(this,$)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash($){return Math.abs(this._value.reduce((I,j)=>I^j|0,0))%$}[export_inspect.custom]($,I){if(!I.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const j=G=>`\x1B[${G}m`,U=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],q=U[this.getInsecureHash(U.length)];return`PublicKey(${j(export_inspect.colors[q][0])}${this.truncate()}${j(export_inspect.colors.reset[0])})`}get[devtoolsFormatter](){return{header:()=>{const $=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],I=$[this.getInsecureHash($.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${I};`},this.truncate()],["span",{},")"]]}}}equals($){const I=Dt.from($);if(this._value.length!==I._value.length)return!1;let j=!0;for(let U=0;U<this._value.length;U++)j&&(j=this._value[U]===I._value[U]);return j}[equalsSymbol]($){return Dt.isPublicKey($)?this.equals($):!1}};__toESM(require_base32_decode());var es5={};Object.defineProperty(es5,"__esModule",{value:!0});var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol?"symbol":typeof _};function isLower(_){return _>=97&&_<=122}function isUpper(_){return _>=65&&_<=90}function isDigit(_){return _>=48&&_<=57}function toUpper(_){return _-32}function toUpperSafe(_){return isLower(_)?_-32:_}function toLower(_){return _+32}function camelize$1(_,$){var I=_.charCodeAt(0);if(isDigit(I)||isUpper(I)||I==$)return _;var j=[],U=!1;isUpper(I)?(U=!0,j.push(toLower(I))):j.push(I);for(var q=_.length,G=1;G<q;++G){var K=_.charCodeAt(G);if(K===$){if(U=!0,K=_.charCodeAt(++G),isNaN(K))return _;j.push(toUpperSafe(K))}else j.push(K)}return U?String.fromCharCode.apply(void 0,j):_}function decamelize$1(_,$){var I=_.charCodeAt(0);if(!isLower(I))return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);isUpper(K)?(q.push($),q.push(toLower(K)),U=!0):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function pascalize$1(_,$){var I=_.charCodeAt(0);if(isDigit(I)||I==$)return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);if(K===$){if(U=!0,K=_.charCodeAt(++G),isNaN(K))return _;q.push(toUpperSafe(K))}else G===0&&isLower(K)?(U=!0,q.push(toUpper(K))):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function depascalize$1(_,$){var I=_.charCodeAt(0);if(!isUpper(I))return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);isUpper(K)?(G>0&&q.push($),q.push(toLower(K)),U=!0):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function shouldProcessValue(_){return _&&(typeof _>"u"?"undefined":_typeof(_))=="object"&&!(_ instanceof Date)&&!(_ instanceof Function)}function processKeys(_,$,I){var j=void 0;if(_ instanceof Array)j=[];else{if(typeof _.prototype<"u")return _;j={}}for(var U in _){var q=_[U];typeof U=="string"&&(U=$(U,I&&I.separator)),shouldProcessValue(q)?j[U]=processKeys(q,$,I):j[U]=q}return j}function processKeysInPlace(_,$,I){for(var j=Object.keys(_),U=0;U<j.length;++U){var q=j[U],G=_[q],K=$(q,I&&I.separator);K!==q&&delete _[q],shouldProcessValue(G)?_[K]=processKeys(G,$,I):_[K]=G}return _}function camelize$$1(_,$){return camelize$1(_,$&&$.charCodeAt(0)||95)}function decamelize$$1(_,$){return decamelize$1(_,$&&$.charCodeAt(0)||95)}function pascalize$$1(_,$){return pascalize$1(_,$&&$.charCodeAt(0)||95)}function depascalize$$1(_,$){return depascalize$1(_,$&&$.charCodeAt(0)||95)}function camelizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,camelize$$1,$):processKeys(_,camelize$$1,$):_}function decamelizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,decamelize$$1,$):processKeys(_,decamelize$$1,$):_}function pascalizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,pascalize$$1,$):processKeys(_,pascalize$$1,$):_}function depascalizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,depascalize$$1,$):processKeys(_,depascalize$$1,$):_}es5.camelize=camelize$$1,es5.decamelize=decamelize$$1,es5.pascalize=pascalize$$1,es5.depascalize=depascalize$$1,es5.camelizeKeys=camelizeKeys,es5.decamelizeKeys=decamelizeKeys,es5.pascalizeKeys=pascalizeKeys,es5.depascalizeKeys=depascalizeKeys;var MAX_SERIALIZATION_LENGTH=10;(class{constructor(_,$){if(this._projection=_,this._values=new Map,$)for(const I of $)this.add(I)}toString(){return inspectObject(this)}toJSON(){return this._values.size>MAX_SERIALIZATION_LENGTH?{size:this._values.size}:Array.from(this._values.values())}[export_inspect.custom](){return inspectObject(this)}add(_){return this._values.set(this._projection(_),_),this}clear(){this._values.clear()}delete(_){return this._values.delete(this._projection(_))}forEach(_,$){$&&(_=_.bind($)),this._values.forEach(I=>_(I,I,this))}has(_){return this._values.has(this._projection(_))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const _ of this._values.values())yield[_,_]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class $r{constructor($,I){if(this._keyProjection=$,this._keys=new Map,this._values=new Map,I)for(const[j,U]of I)this.set(j,U)}toString(){return inspectObject(this)}toJSON(){return this._values.size>MAX_SERIALIZATION_LENGTH?{size:this._values.size}:Array.from(this._values.values())}[export_inspect.custom](){return inspectObject(this)}clear(){this._keys.clear(),this._values.clear()}delete($){const I=this._keys.delete(this._keyProjection($)),j=this._values.delete(this._keyProjection($));return I||j}forEach($,I){I&&($=$.bind(I)),this._keys.forEach((j,U)=>$(this._values.get(U)??raise$2(new Error("Map corrupted.")),j,this))}get($){return this._values.get(this._keyProjection($))}has($){return this._keys.has(this._keyProjection($))}set($,I){const j=this._keyProjection($);return this._keys.set(j,$),this._values.set(j,I),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[$,I]of this._keys){const j=this._values.get($)??raise$2(new Error("Map corrupted."));yield[I,j]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}mapValues($){return new $r(this._keyProjection,[...this.entries()].map(([I,j])=>[I,$(j,I)]))}get[Symbol.toStringTag](){return"ComplexMap"}},Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var DEFAULT_WORDLIST=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],HumanHasher=class{constructor(_=DEFAULT_WORDLIST){if(this.wordlist=_,_.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=_}humanize(_,$=4,I="-"){const j=_.match(/(..?)/g);if(!j)throw new Error("");const U=j.map(G=>parseInt(G,16));return this._compress(U,$).map(G=>this.wordlist[G]).join(I)}_compress(_,$){const I=_.length;if($>I)throw new Error("Fewer input bytes than requested output");const j=I/$>>0,U=[];for(let G=0;G<j*$;G+=j)U.push(_.slice(G,G+j));return U[U.length-1]=U[U.length-1].concat(_.slice($*j)),U.map(G=>G.reduce((K,Y)=>K^Y))}},hasher=new HumanHasher,humanize=_=>(_ instanceof export_Buffer||_ instanceof Uint8Array||_ instanceof ArrayBuffer?_=PublicKey.stringify(_):_ instanceof PublicKey&&(_=_.toHex()),hasher.humanize(_)),exponentialBackoffInterval=(_,$)=>{let I=$;const j=()=>{_(),I*=2,U=setTimeout(j,I)};let U=setTimeout(j,I);return()=>clearTimeout(U)},defaultMap=(_,$,I)=>{let j=_.get($);return j===void 0&&(j=typeof I=="function"?I():I,_.set($,j)),j},symbol=Symbol.for("dxos.instance-contexts"),instanceContexts=globalThis[symbol]??(globalThis[symbol]=new WeakMap),getPrototypeSpecificInstanceId=_=>{const $=Object.getPrototypeOf(_),I=defaultMap(instanceContexts,$,()=>({nextId:0,instanceIds:new WeakMap}));let j=I.instanceIds.get(_);return j===void 0&&(j=I.nextId++,I.instanceIds.set(_,j)),j},getDebugName=_=>_==null?"null":`${Object.getPrototypeOf(_).constructor.name}#${getPrototypeSpecificInstanceId(_)}`,arrayToBuffer=_=>export_Buffer.from(_.buffer,_.byteOffset,_.byteLength),LOG_MAX_DEPTH=7,jsonlogify=(_,$=0,I=new WeakSet)=>{if($>LOG_MAX_DEPTH)return null;if(typeof _=="function")return null;if(typeof _=="object"&&_!==null){if(I.has(_))return null;I.add(_);try{if(_ instanceof Uint8Array)return arrayToBuffer(_).toString("hex");if(Array.isArray(_))return _.map(j=>jsonlogify(j,$+1,I));if(typeof _.toJSONL=="function")return _.toJSONL();if(typeof _.toJSON=="function")return _.toJSON();{const j={};for(const U of Object.keys(_))j[U]=jsonlogify(_[U],$+1,I);return j}}finally{I.delete(_)}}else return _},safariCheck=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),instanceTag=Symbol("instanceTag"),safeInstanceof=_=>$=>{$.prototype[instanceTag]=_,Object.defineProperty($.prototype,Symbol.hasInstance,{value:I=>(I==null?void 0:I[instanceTag])===_}),Object.defineProperty($,Symbol.hasInstance,{value:I=>(I==null?void 0:I[instanceTag])===_})},throwUnhandledError=_=>{queueMicrotask(()=>{throw _})},idEmoji=["๐น","๐ป","๐ฝ","๐ค","๐","๐ฆพ","๐ฆฟ","๐ฆท","๐ฃ","๐๏ธ","๐งถ","๐","๐","๐ฆ","๐ฆ","๐ด","๐ฆ","๐","๐ฆ","๐","๐ชฒ","๐ข","๐ฆ","๐ฆ","๐ฆ","๐ฆ","๐ ","๐ฌ","๐","๐ฆญ","๐
","๐","๐ฆ","๐ฆ","๐ฆง","๐","๐ซ","๐ฆ","๐ฆ","๐ฆฌ","๐","๐","๐ฆ","๐","๐","๐","๐ฆ","๐ฆ","๐ฆข","๐ฆฉ","๐ฆฆ","๐","๐ฟ๏ธ","๐ต","๐ฒ","๐ณ","๐ชต","๐ฑ","๐","๐ชบ","๐","๐","๐ชธ","๐ชจ","๐พ","๐ท","๐ป","โ๏ธ","๐","๐ช","โญ๏ธ","โก๏ธ","โ๏ธ","๐ฅ","๐","โ๏ธ","๐ง","โฑ๏ธ","๐","๐","๐","๐","๐","๐ซ","๐","๐","๐","๐ฅญ","๐","๐ฅฅ","๐ฅ","๐ฅ","๐ถ๏ธ","๐ฝ","๐ฅ","๐ฌ","๐ฅ","๐ซ","โ๏ธ","๐ต","๐ง","๐ง","๐๏ธ","โ๏ธ","๐","๐๏ธ","๐ถ","๐","๐ฐ๏ธ","โฒ๏ธ","๐ฐ","๐ฒ","โบ๏ธ","๐๏ธ","๐งฒ","โ๏ธ","๐ฉ","๐ฎ","๐ญ","๐ฌ","๐งฌ","๐ก๏ธ","๐งบ","๐๏ธ","๐","๐ช","๐งธ","๐","๐","๐","โป๏ธ","๐ต"],idHue=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],keyToEmoji=_=>hexToEmoji(_.toHex()),hexToEmoji=_=>toEmoji(parseInt(_,16)),toEmoji=_=>idEmoji[_%idEmoji.length],hexToHue=_=>toHue(parseInt(_,16)),toHue=_=>idHue[_%idHue.length],keyToFallback=_=>hexToFallback(_.toHex()),hexToFallback=_=>toFallback(parseInt(_,16)),toFallback=_=>({emoji:toEmoji(_),hue:toHue(_)}),notAvailable=()=>{throw new Error("Not available on this platform")},appendFileSync=()=>notAvailable(),mkdirSync=()=>notAvailable(),openSync=()=>notAvailable(),require_path_browserify=__commonJS$1({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(_,$){function I(G){if(typeof G!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(G))}function j(G,K){for(var Y="",J=0,X=-1,Z=0,Q,ee=0;ee<=G.length;++ee){if(ee<G.length)Q=G.charCodeAt(ee);else{if(Q===47)break;Q=47}if(Q===47){if(!(X===ee-1||Z===1))if(X!==ee-1&&Z===2){if(Y.length<2||J!==2||Y.charCodeAt(Y.length-1)!==46||Y.charCodeAt(Y.length-2)!==46){if(Y.length>2){var ne=Y.lastIndexOf("/");if(ne!==Y.length-1){ne===-1?(Y="",J=0):(Y=Y.slice(0,ne),J=Y.length-1-Y.lastIndexOf("/")),X=ee,Z=0;continue}}else if(Y.length===2||Y.length===1){Y="",J=0,X=ee,Z=0;continue}}K&&(Y.length>0?Y+="/..":Y="..",J=2)}else Y.length>0?Y+="/"+G.slice(X+1,ee):Y=G.slice(X+1,ee),J=ee-X-1;X=ee,Z=0}else Q===46&&Z!==-1?++Z:Z=-1}return Y}function U(G,K){var Y=K.dir||K.root,J=K.base||(K.name||"")+(K.ext||"");return Y?Y===K.root?Y+J:Y+G+J:J}var q={resolve:function(){for(var K="",Y=!1,J,X=arguments.length-1;X>=-1&&!Y;X--){var Z;X>=0?Z=arguments[X]:(J===void 0&&(J=process.cwd()),Z=J),I(Z),Z.length!==0&&(K=Z+"/"+K,Y=Z.charCodeAt(0)===47)}return K=j(K,!Y),Y?K.length>0?"/"+K:"/":K.length>0?K:"."},normalize:function(K){if(I(K),K.length===0)return".";var Y=K.charCodeAt(0)===47,J=K.charCodeAt(K.length-1)===47;return K=j(K,!Y),K.length===0&&!Y&&(K="."),K.length>0&&J&&(K+="/"),Y?"/"+K:K},isAbsolute:function(K){return I(K),K.length>0&&K.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var K,Y=0;Y<arguments.length;++Y){var J=arguments[Y];I(J),J.length>0&&(K===void 0?K=J:K+="/"+J)}return K===void 0?".":q.normalize(K)},relative:function(K,Y){if(I(K),I(Y),K===Y||(K=q.resolve(K),Y=q.resolve(Y),K===Y))return"";for(var J=1;J<K.length&&K.charCodeAt(J)===47;++J);for(var X=K.length,Z=X-J,Q=1;Q<Y.length&&Y.charCodeAt(Q)===47;++Q);for(var ee=Y.length,ne=ee-Q,ie=Z<ne?Z:ne,oe=-1,se=0;se<=ie;++se){if(se===ie){if(ne>ie){if(Y.charCodeAt(Q+se)===47)return Y.slice(Q+se+1);if(se===0)return Y.slice(Q+se)}else Z>ie&&(K.charCodeAt(J+se)===47?oe=se:se===0&&(oe=0));break}var ae=K.charCodeAt(J+se),fe=Y.charCodeAt(Q+se);if(ae!==fe)break;ae===47&&(oe=se)}var le="";for(se=J+oe+1;se<=X;++se)(se===X||K.charCodeAt(se)===47)&&(le.length===0?le+="..":le+="/..");return le.length>0?le+Y.slice(Q+oe):(Q+=oe,Y.charCodeAt(Q)===47&&++Q,Y.slice(Q))},_makeLong:function(K){return K},dirname:function(K){if(I(K),K.length===0)return".";for(var Y=K.charCodeAt(0),J=Y===47,X=-1,Z=!0,Q=K.length-1;Q>=1;--Q)if(Y=K.charCodeAt(Q),Y===47){if(!Z){X=Q;break}}else Z=!1;return X===-1?J?"/":".":J&&X===1?"//":K.slice(0,X)},basename:function(K,Y){if(Y!==void 0&&typeof Y!="string")throw new TypeError('"ext" argument must be a string');I(K);var J=0,X=-1,Z=!0,Q;if(Y!==void 0&&Y.length>0&&Y.length<=K.length){if(Y.length===K.length&&Y===K)return"";var ee=Y.length-1,ne=-1;for(Q=K.length-1;Q>=0;--Q){var ie=K.charCodeAt(Q);if(ie===47){if(!Z){J=Q+1;break}}else ne===-1&&(Z=!1,ne=Q+1),ee>=0&&(ie===Y.charCodeAt(ee)?--ee===-1&&(X=Q):(ee=-1,X=ne))}return J===X?X=ne:X===-1&&(X=K.length),K.slice(J,X)}else{for(Q=K.length-1;Q>=0;--Q)if(K.charCodeAt(Q)===47){if(!Z){J=Q+1;break}}else X===-1&&(Z=!1,X=Q+1);return X===-1?"":K.slice(J,X)}},extname:function(K){I(K);for(var Y=-1,J=0,X=-1,Z=!0,Q=0,ee=K.length-1;ee>=0;--ee){var ne=K.charCodeAt(ee);if(ne===47){if(!Z){J=ee+1;break}continue}X===-1&&(Z=!1,X=ee+1),ne===46?Y===-1?Y=ee:Q!==1&&(Q=1):Y!==-1&&(Q=-1)}return Y===-1||X===-1||Q===0||Q===1&&Y===X-1&&Y===J+1?"":K.slice(Y,X)},format:function(K){if(K===null||typeof K!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof K);return U("/",K)},parse:function(K){I(K);var Y={root:"",dir:"",base:"",ext:"",name:""};if(K.length===0)return Y;var J=K.charCodeAt(0),X=J===47,Z;X?(Y.root="/",Z=1):Z=0;for(var Q=-1,ee=0,ne=-1,ie=!0,oe=K.length-1,se=0;oe>=Z;--oe){if(J=K.charCodeAt(oe),J===47){if(!ie){ee=oe+1;break}continue}ne===-1&&(ie=!1,ne=oe+1),J===46?Q===-1?Q=oe:se!==1&&(se=1):Q!==-1&&(se=-1)}return Q===-1||ne===-1||se===0||se===1&&Q===ne-1&&Q===ee+1?ne!==-1&&(ee===0&&X?Y.base=Y.name=K.slice(1,ne):Y.base=Y.name=K.slice(ee,ne)):(ee===0&&X?(Y.name=K.slice(1,Q),Y.base=K.slice(1,ne)):(Y.name=K.slice(ee,Q),Y.base=K.slice(ee,ne)),Y.ext=K.slice(Q,ne)),ee>0?Y.dir=K.slice(0,ee-1):X&&(Y.dir="/"),Y},sep:"/",delimiter:":",win32:null,posix:null};q.posix=q,$.exports=q}});__toESM$1(require_path_browserify());var import_path_browserify=__toESM$1(require_path_browserify());import_path_browserify.basename;var export_dirname=import_path_browserify.dirname;import_path_browserify.extname,import_path_browserify.format,import_path_browserify.isAbsolute,import_path_browserify.join,import_path_browserify.normalize,import_path_browserify.parse,import_path_browserify.relative,import_path_browserify.resolve;var LogLevel$1;(function(_){_[_.TRACE=5]="TRACE",_[_.DEBUG=10]="DEBUG",_[_.INFO=11]="INFO",_[_.WARN=12]="WARN",_[_.ERROR=13]="ERROR"})(LogLevel$1||(LogLevel$1={}));var levels={trace:5,debug:10,info:11,warn:12,error:13},LogProcessorType;(function(_){_.CONSOLE="console",_.BROWSER="browser",_.DEBUG="debug"})(LogProcessorType||(LogProcessorType={}));var logInfoProperties=Symbol("logInfoProperties"),gatherLogInfoFromScope=_=>{if(!_)return{};const $={},j=Object.getPrototypeOf(_)[logInfoProperties]??[];for(const U of j)try{$[U]=typeof _[U]=="function"?_[U]():_[U]}catch(q){$[U]=q.message}return $},matchFilter=(_,$,I)=>$>=_.level&&(!_.pattern||I.includes(_.pattern)),shouldLog=(_,$)=>$===void 0?!0:$.some(I=>{var j;return matchFilter(I,_.level,((j=_.meta)==null?void 0:j.F)??"")}),getContextFromEntry=_=>{let $;if(_.meta){const j=gatherLogInfoFromScope(_.meta.S);Object.keys(j).length>0&&($=Object.assign($??{},j))}const I=typeof _.context=="function"?_.context():_.context;if(I)if(I instanceof Error){const j=I.context;$=Object.assign($??{},{error:I.stack,...j})}else typeof I=="object"&&($=Object.assign($??{},I));if(_.error){const j=_.error.context;$=Object.assign($??{},{error:_.error,...j})}return $&&Object.keys($).length>0?$:void 0},nextPromiseId=0,createMethodLogDecorator=_=>($,I,j)=>(U,q,G)=>{const K=G.value,Y=q;G.value=function(...J){const X={F:"",L:0,...j??{},S:this},Z=J.map(Q=>export_inspect(Q,!1,1,!0)).join(", ");try{const Q=performance.now(),ee=K.apply(this,J);if(isThenable(ee)){const ne=nextPromiseId++;logAsyncBegin(_,Y,Z,ne,X),ee.then(ie=>{logAsyncResolved(_,Y,ie,ne,Q,X)},ie=>{logAsyncRejected(_,Y,ie,ne,Q,X)})}else logSyncCall(_,Y,Z,ee,X);return ee}catch(Q){throw logSyncError(_,Y,Z,Q,X),Q}},Object.defineProperty(G.value,"name",{value:Y+"$log"})},isThenable=_=>_&&typeof _.then=="function",logSyncCall=(_,$,I,j,U)=>{_.info(`.${formatFunction($)} (${I}) ${chalk$1.gray("=>")} ${export_inspect(j,!1,1,!0)}`,{},U)},logSyncError=(_,$,I,j,U)=>{_.error(`.${formatFunction($)} (${I}) ๐ฅ ${j}`,{},U)},logAsyncBegin=(_,$,I,j,U)=>{_.info(`.${formatFunction($)} โด (${I}) ${chalk$1.gray("=>")} ${formatPromise(j)}`,{},U)},logAsyncResolved=(_,$,I,j,U,q)=>{I!==void 0?_.info(`.${formatFunction($)} โฒ ${greenCheck} ${chalk$1.gray("resolve")} ${formatPromise(j)} ${formatTimeElapsed(U)} ${chalk$1.gray("=>")} ${export_inspect(I,!1,1,!0)}`,{},q):_.info(`.${formatFunction($)} โฒ ${greenCheck} ${chalk$1.gray("resolve")} ${formatPromise(j)} ${formatTimeElapsed(U)}`,{},q)},logAsyncRejected=(_,$,I,j,U,q)=>{_.info(`.${formatFunction($)} โฒ ๐ฅ ${chalk$1.gray("reject")} ${formatPromise(j)} ${formatTimeElapsed(U)} ${chalk$1.gray("=>")} ${I}`,{},q)},greenCheck=chalk$1.green("โ"),formatTimeElapsed=_=>chalk$1.gray(`${(performance.now()-_).toFixed(0)}ms`),COLOR_FUNCTION=[220,220,170],formatFunction=_=>chalk$1.bold(chalk$1.rgb(...COLOR_FUNCTION)(_)),formatPromise=_=>chalk$1.blue(`Promise#${_}`),loadOptions=_=>{try{let $;return typeof localStorage>"u"?globalThis.localStorage_dxlog&&($=globalThis.localStorage_dxlog):$=localStorage.getItem("dxlog")??void 0,$?JSON.parse($):void 0}catch($){console.info("can't parse dxlog config",$);return}},CONSOLE_PROCESSOR=()=>{},DEBUG_PROCESSOR=(_,$)=>{console.log(export_inspect($,!1,null,!0))},getRelativeFilename=_=>{const $=_.match(/.+\/(packages\/.+\/.+)/);if($){const[,I]=$;return I}return _},CONFIG=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},APP_BROWSER_PROCESSOR=(_,$)=>{var J,X,Z,Q;if(!shouldLog($,_.filters))return;const I=_.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",j=[];let U="";if($.meta){const ee=getRelativeFilename($.meta.F);U=`${`${I.replace(/\/$/,"")}/${ee}`}#L${$.meta.L}`}let q=[];if((J=$.meta)!=null&&J.S){const ee=(X=$.meta)==null?void 0:X.S,ne=ee.name||getDebugName(ee),ie=(Z=$.meta.S)!=null&&Z.hostSessionId?"[worker] ":"";q.push(`%c${ie}${ne}`,"color:#C026D3;font-weight:bold")}q.push($.message);const G=getContextFromEntry($);G&&q.push(G);const K={[LogLevel$1.ERROR]:console.error,[LogLevel$1.WARN]:console.warn,[LogLevel$1.DEBUG]:console.log};(CONFIG.printFileLinks||safariCheck())&&(j!=null&&j.length?q=[`%c${U}
|
|
114
|
+
${j.getStack()}`)},_);try{return await I()}finally{clearTimeout(U)}},devtoolsFormatter=Symbol.for("devtoolsFormatter"),register=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(_,$)=>{const I=_[devtoolsFormatter];if(I===void 0)return null;if(typeof I!="object"||I===null||typeof I.header!="function")throw new Error(`Invalid devtools formatter for ${_.constructor.name}`);return I.header($)},hasBody:(_,$)=>{const I=_[devtoolsFormatter];return!I||!I.hasBody?!1:I.hasBody($)},body:(_,$)=>{const I=_[devtoolsFormatter];return!I||!I.body?null:I.body($)}})};register();var equalsSymbol=Symbol.for("dxos.common.equals"),__create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__require=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:($,I)=>(typeof require<"u"?require:$)[I]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+_+'" is not supported')}),__commonJS=(_,$)=>function(){return $||(0,_[__getOwnPropNames(_)[0]])(($={exports:{}}).exports,$),$.exports},__copyProps=(_,$,I,j)=>{if($&&typeof $=="object"||typeof $=="function")for(let U of __getOwnPropNames($))!__hasOwnProp$1.call(_,U)&&U!==I&&__defProp$1(_,U,{get:()=>$[U],enumerable:!(j=__getOwnPropDesc($,U))||j.enumerable});return _},__toESM=(_,$,I)=>(I=_!=null?__create(__getProtoOf(_)):{},__copyProps($||!_||!_.__esModule?__defProp$1(I,"default",{value:_,enumerable:!0}):I,_)),require_base32_decode=__commonJS({"node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js"(_,$){var I="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",j="0123456789ABCDEFGHIJKLMNOPQRSTUV",U="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function q(G,K){var Y=G.indexOf(K);if(Y===-1)throw new Error("Invalid character found: "+K);return Y}$.exports=function(K,Y){var J;switch(Y){case"RFC3548":case"RFC4648":J=I,K=K.replace(/=+$/,"");break;case"RFC4648-HEX":J=j,K=K.replace(/=+$/,"");break;case"Crockford":J=U,K=K.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+Y)}for(var X=K.length,Z=0,Q=0,ee=0,ne=new Uint8Array(X*5/8|0),ie=0;ie<X;ie++)Q=Q<<5|q(J,K[ie]),Z+=5,Z>=8&&(ne[ee++]=Q>>>Z-8&255,Z-=8);return ne.buffer}}}),import_base32_decode=__toESM(require_base32_decode());function toDataView(_){if(_ instanceof Int8Array||_ instanceof Uint8Array||_ instanceof Uint8ClampedArray)return new DataView(_.buffer,_.byteOffset,_.byteLength);if(_ instanceof ArrayBuffer)return new DataView(_);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var RFC4648="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",RFC4648_HEX="0123456789ABCDEFGHIJKLMNOPQRSTUV",CROCKFORD="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function base32Encode(_,$,I){I=I||{};let j,U;switch($){case"RFC3548":case"RFC4648":j=RFC4648,U=!0;break;case"RFC4648-HEX":j=RFC4648_HEX,U=!0;break;case"Crockford":j=CROCKFORD,U=!1;break;default:throw new Error("Unknown base32 variant: "+$)}const q=I.padding!==void 0?I.padding:U,G=toDataView(_);let K=0,Y=0,J="";for(let X=0;X<G.byteLength;X++)for(Y=Y<<8|G.getUint8(X),K+=8;K>=5;)J+=j[Y>>>K-5&31],K-=5;if(K>0&&(J+=j[Y<<5-K&31]),q)for(;J.length%8!==0;)J+="=";return J}var randomBytes=_=>{const $=globalThis.crypto??__require("@dxos/node-std/crypto").webcrypto,I=new Uint8Array(_);return $.getRandomValues(I),I},__dxlog_file$6="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",PUBLIC_KEY_LENGTH=32,PublicKey=class Dt{static from($){if(invariant($,void 0,{F:__dxlog_file$6,L:34,S:this,A:["source",""]}),$ instanceof Dt)return $;if($ instanceof Buffer)return new Dt(new Uint8Array($.buffer,$.byteOffset,$.byteLength));if($ instanceof Uint8Array)return new Dt($);if($ instanceof ArrayBuffer)return new Dt(new Uint8Array($));if(typeof $=="string")return Dt.fromHex($);if($.asUint8Array)return new Dt($.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${$}`)}static safeFrom($){if($)try{return Dt.from($)}catch{return}}static fromHex($){$.startsWith("0x")&&($=$.slice(2));const I=Buffer.from($,"hex");return new Dt(new Uint8Array(I.buffer,I.byteOffset,I.byteLength))}static random(){return Dt.from(randomBytes(PUBLIC_KEY_LENGTH))}static randomOfLength($){return Dt.from(randomBytes($))}static*randomSequence(){for(let $=0;$<1e4;$++)yield Dt.random();throw new Error("Too many keys requested")}static isPublicKey($){return $ instanceof Dt}static assertValidPublicKey($){if(!this.isPublicKey($))throw new TypeError("Invalid PublicKey")}static equals($,I){return Dt.from($).equals(I)}static bufferize($){return invariant(typeof $=="string","Invalid type",{F:__dxlog_file$6,L:137,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from($,"hex")}static stringify($){return $ instanceof Dt?$=$.asBuffer():$ instanceof Uint8Array&&($=Buffer.from($.buffer,$.byteOffset,$.byteLength)),invariant($ instanceof Buffer,"Invalid type",{F:__dxlog_file$6,L:156,S:this,A:["key instanceof Buffer","'Invalid type'"]}),$.toString("hex")}static hash($){return $.toHex()}static fromMultibase32($){return invariant($.startsWith("B"),"Invalid multibase32 encoding",{F:__dxlog_file$6,L:169,S:this,A:["encoded.startsWith('B')","'Invalid multibase32 encoding'"]}),new Dt(new Uint8Array((0,import_base32_decode.default)($.slice(1),"RFC4648")))}constructor($){if(this._value=$,!($ instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${$}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}toJSONL(){return this.truncate()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}toMultibase32(){return"B"+base32Encode(this._value,"RFC4648")}truncate($=void 0){return truncateKey(this,$)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash($){return Math.abs(this._value.reduce((I,j)=>I^j|0,0))%$}[export_inspect.custom]($,I){if(!I.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const j=G=>`\x1B[${G}m`,U=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],q=U[this.getInsecureHash(U.length)];return`PublicKey(${j(export_inspect.colors[q][0])}${this.truncate()}${j(export_inspect.colors.reset[0])})`}get[devtoolsFormatter](){return{header:()=>{const $=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],I=$[this.getInsecureHash($.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${I};`},this.truncate()],["span",{},")"]]}}}equals($){const I=Dt.from($);if(this._value.length!==I._value.length)return!1;let j=!0;for(let U=0;U<this._value.length;U++)j&&(j=this._value[U]===I._value[U]);return j}[equalsSymbol]($){return Dt.isPublicKey($)?this.equals($):!1}};__toESM(require_base32_decode());var es5={};Object.defineProperty(es5,"__esModule",{value:!0});var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol?"symbol":typeof _};function isLower(_){return _>=97&&_<=122}function isUpper(_){return _>=65&&_<=90}function isDigit(_){return _>=48&&_<=57}function toUpper(_){return _-32}function toUpperSafe(_){return isLower(_)?_-32:_}function toLower(_){return _+32}function camelize$1(_,$){var I=_.charCodeAt(0);if(isDigit(I)||isUpper(I)||I==$)return _;var j=[],U=!1;isUpper(I)?(U=!0,j.push(toLower(I))):j.push(I);for(var q=_.length,G=1;G<q;++G){var K=_.charCodeAt(G);if(K===$){if(U=!0,K=_.charCodeAt(++G),isNaN(K))return _;j.push(toUpperSafe(K))}else j.push(K)}return U?String.fromCharCode.apply(void 0,j):_}function decamelize$1(_,$){var I=_.charCodeAt(0);if(!isLower(I))return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);isUpper(K)?(q.push($),q.push(toLower(K)),U=!0):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function pascalize$1(_,$){var I=_.charCodeAt(0);if(isDigit(I)||I==$)return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);if(K===$){if(U=!0,K=_.charCodeAt(++G),isNaN(K))return _;q.push(toUpperSafe(K))}else G===0&&isLower(K)?(U=!0,q.push(toUpper(K))):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function depascalize$1(_,$){var I=_.charCodeAt(0);if(!isUpper(I))return _;for(var j=_.length,U=!1,q=[],G=0;G<j;++G){var K=_.charCodeAt(G);isUpper(K)?(G>0&&q.push($),q.push(toLower(K)),U=!0):q.push(K)}return U?String.fromCharCode.apply(void 0,q):_}function shouldProcessValue(_){return _&&(typeof _>"u"?"undefined":_typeof(_))=="object"&&!(_ instanceof Date)&&!(_ instanceof Function)}function processKeys(_,$,I){var j=void 0;if(_ instanceof Array)j=[];else{if(typeof _.prototype<"u")return _;j={}}for(var U in _){var q=_[U];typeof U=="string"&&(U=$(U,I&&I.separator)),shouldProcessValue(q)?j[U]=processKeys(q,$,I):j[U]=q}return j}function processKeysInPlace(_,$,I){for(var j=Object.keys(_),U=0;U<j.length;++U){var q=j[U],G=_[q],K=$(q,I&&I.separator);K!==q&&delete _[q],shouldProcessValue(G)?_[K]=processKeys(G,$,I):_[K]=G}return _}function camelize$$1(_,$){return camelize$1(_,$&&$.charCodeAt(0)||95)}function decamelize$$1(_,$){return decamelize$1(_,$&&$.charCodeAt(0)||95)}function pascalize$$1(_,$){return pascalize$1(_,$&&$.charCodeAt(0)||95)}function depascalize$$1(_,$){return depascalize$1(_,$&&$.charCodeAt(0)||95)}function camelizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,camelize$$1,$):processKeys(_,camelize$$1,$):_}function decamelizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,decamelize$$1,$):processKeys(_,decamelize$$1,$):_}function pascalizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,pascalize$$1,$):processKeys(_,pascalize$$1,$):_}function depascalizeKeys(_,$){return $=$||{},shouldProcessValue(_)?$.inPlace?processKeysInPlace(_,depascalize$$1,$):processKeys(_,depascalize$$1,$):_}es5.camelize=camelize$$1,es5.decamelize=decamelize$$1,es5.pascalize=pascalize$$1,es5.depascalize=depascalize$$1,es5.camelizeKeys=camelizeKeys,es5.decamelizeKeys=decamelizeKeys,es5.pascalizeKeys=pascalizeKeys,es5.depascalizeKeys=depascalizeKeys;var MAX_SERIALIZATION_LENGTH=10;(class{constructor(_,$){if(this._projection=_,this._values=new Map,$)for(const I of $)this.add(I)}toString(){return inspectObject(this)}toJSON(){return this._values.size>MAX_SERIALIZATION_LENGTH?{size:this._values.size}:Array.from(this._values.values())}[export_inspect.custom](){return inspectObject(this)}add(_){return this._values.set(this._projection(_),_),this}clear(){this._values.clear()}delete(_){return this._values.delete(this._projection(_))}forEach(_,$){$&&(_=_.bind($)),this._values.forEach(I=>_(I,I,this))}has(_){return this._values.has(this._projection(_))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const _ of this._values.values())yield[_,_]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class $r{constructor($,I){if(this._keyProjection=$,this._keys=new Map,this._values=new Map,I)for(const[j,U]of I)this.set(j,U)}toString(){return inspectObject(this)}toJSON(){return this._values.size>MAX_SERIALIZATION_LENGTH?{size:this._values.size}:Array.from(this._values.values())}[export_inspect.custom](){return inspectObject(this)}clear(){this._keys.clear(),this._values.clear()}delete($){const I=this._keys.delete(this._keyProjection($)),j=this._values.delete(this._keyProjection($));return I||j}forEach($,I){I&&($=$.bind(I)),this._keys.forEach((j,U)=>$(this._values.get(U)??raise$2(new Error("Map corrupted.")),j,this))}get($){return this._values.get(this._keyProjection($))}has($){return this._keys.has(this._keyProjection($))}set($,I){const j=this._keyProjection($);return this._keys.set(j,$),this._values.set(j,I),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[$,I]of this._keys){const j=this._values.get($)??raise$2(new Error("Map corrupted."));yield[I,j]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}mapValues($){return new $r(this._keyProjection,[...this.entries()].map(([I,j])=>[I,$(j,I)]))}get[Symbol.toStringTag](){return"ComplexMap"}},Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var DEFAULT_WORDLIST=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],HumanHasher=class{constructor(_=DEFAULT_WORDLIST){if(this.wordlist=_,_.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=_}humanize(_,$=4,I="-"){const j=_.match(/(..?)/g);if(!j)throw new Error("");const U=j.map(G=>parseInt(G,16));return this._compress(U,$).map(G=>this.wordlist[G]).join(I)}_compress(_,$){const I=_.length;if($>I)throw new Error("Fewer input bytes than requested output");const j=I/$>>0,U=[];for(let G=0;G<j*$;G+=j)U.push(_.slice(G,G+j));return U[U.length-1]=U[U.length-1].concat(_.slice($*j)),U.map(G=>G.reduce((K,Y)=>K^Y))}},hasher=new HumanHasher,humanize=_=>(_ instanceof export_Buffer||_ instanceof Uint8Array||_ instanceof ArrayBuffer?_=PublicKey.stringify(_):_ instanceof PublicKey&&(_=_.toHex()),hasher.humanize(_)),exponentialBackoffInterval=(_,$)=>{let I=$;const j=()=>{_(),I*=2,U=setTimeout(j,I)};let U=setTimeout(j,I);return()=>clearTimeout(U)},defaultMap=(_,$,I)=>{let j=_.get($);return j===void 0&&(j=typeof I=="function"?I():I,_.set($,j)),j},symbol=Symbol.for("dxos.instance-contexts"),instanceContexts=globalThis[symbol]??(globalThis[symbol]=new WeakMap),getPrototypeSpecificInstanceId=_=>{const $=Object.getPrototypeOf(_),I=defaultMap(instanceContexts,$,()=>({nextId:0,instanceIds:new WeakMap}));let j=I.instanceIds.get(_);return j===void 0&&(j=I.nextId++,I.instanceIds.set(_,j)),j},getDebugName=_=>_==null?"null":`${Object.getPrototypeOf(_).constructor.name}#${getPrototypeSpecificInstanceId(_)}`,arrayToBuffer=_=>export_Buffer.from(_.buffer,_.byteOffset,_.byteLength),LOG_MAX_DEPTH=7,jsonlogify=(_,$=0,I=new WeakSet)=>{if($>LOG_MAX_DEPTH)return null;if(typeof _=="function")return null;if(typeof _=="object"&&_!==null){if(I.has(_))return null;I.add(_);try{if(_ instanceof Uint8Array)return arrayToBuffer(_).toString("hex");if(Array.isArray(_))return _.map(j=>jsonlogify(j,$+1,I));if(typeof _.toJSONL=="function")return _.toJSONL();if(typeof _.toJSON=="function")return _.toJSON();{const j={};for(const U of Object.keys(_))j[U]=jsonlogify(_[U],$+1,I);return j}}finally{I.delete(_)}}else return _},safariCheck=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),instanceTag=Symbol("instanceTag"),safeInstanceof=_=>$=>{$.prototype[instanceTag]=_,Object.defineProperty($.prototype,Symbol.hasInstance,{value:I=>(I==null?void 0:I[instanceTag])===_}),Object.defineProperty($,Symbol.hasInstance,{value:I=>(I==null?void 0:I[instanceTag])===_})},throwUnhandledError=_=>{queueMicrotask(()=>{throw _})},idEmoji=["๐น","๐ป","๐ฝ","๐ค","๐","๐ฆพ","๐ฆฟ","๐ฆท","๐ฃ","๐๏ธ","๐งถ","๐","๐","๐ฆ","๐ฆ","๐ด","๐ฆ","๐","๐ฆ","๐","๐ชฒ","๐ข","๐ฆ","๐ฆ","๐ฆ","๐ฆ","๐ ","๐ฌ","๐","๐ฆญ","๐
","๐","๐ฆ","๐ฆ","๐ฆง","๐","๐ซ","๐ฆ","๐ฆ","๐ฆฌ","๐","๐","๐ฆ","๐","๐","๐","๐ฆ","๐ฆ","๐ฆข","๐ฆฉ","๐ฆฆ","๐","๐ฟ๏ธ","๐ต","๐ฒ","๐ณ","๐ชต","๐ฑ","๐","๐ชบ","๐","๐","๐ชธ","๐ชจ","๐พ","๐ท","๐ป","โ๏ธ","๐","๐ช","โญ๏ธ","โก๏ธ","โ๏ธ","๐ฅ","๐","โ๏ธ","๐ง","โฑ๏ธ","๐","๐","๐","๐","๐","๐ซ","๐","๐","๐","๐ฅญ","๐","๐ฅฅ","๐ฅ","๐ฅ","๐ถ๏ธ","๐ฝ","๐ฅ","๐ฌ","๐ฅ","๐ซ","โ๏ธ","๐ต","๐ง","๐ง","๐๏ธ","โ๏ธ","๐","๐๏ธ","๐ถ","๐","๐ฐ๏ธ","โฒ๏ธ","๐ฐ","๐ฒ","โบ๏ธ","๐๏ธ","๐งฒ","โ๏ธ","๐ฉ","๐ฎ","๐ญ","๐ฌ","๐งฌ","๐ก๏ธ","๐งบ","๐๏ธ","๐","๐ช","๐งธ","๐","๐","๐","โป๏ธ","๐ต"],idHue=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],keyToEmoji=_=>hexToEmoji(_.toHex()),hexToEmoji=_=>toEmoji(parseInt(_,16)),toEmoji=_=>idEmoji[_%idEmoji.length],hexToHue=_=>toHue(parseInt(_,16)),toHue=_=>idHue[_%idHue.length],keyToFallback=_=>hexToFallback(_.toHex()),hexToFallback=_=>toFallback(parseInt(_,16)),toFallback=_=>({emoji:toEmoji(_),hue:toHue(_)}),notAvailable=()=>{throw new Error("Not available on this platform")},appendFileSync=()=>notAvailable(),mkdirSync=()=>notAvailable(),openSync=()=>notAvailable(),require_path_browserify=__commonJS$1({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(_,$){function I(G){if(typeof G!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(G))}function j(G,K){for(var Y="",J=0,X=-1,Z=0,Q,ee=0;ee<=G.length;++ee){if(ee<G.length)Q=G.charCodeAt(ee);else{if(Q===47)break;Q=47}if(Q===47){if(!(X===ee-1||Z===1))if(X!==ee-1&&Z===2){if(Y.length<2||J!==2||Y.charCodeAt(Y.length-1)!==46||Y.charCodeAt(Y.length-2)!==46){if(Y.length>2){var ne=Y.lastIndexOf("/");if(ne!==Y.length-1){ne===-1?(Y="",J=0):(Y=Y.slice(0,ne),J=Y.length-1-Y.lastIndexOf("/")),X=ee,Z=0;continue}}else if(Y.length===2||Y.length===1){Y="",J=0,X=ee,Z=0;continue}}K&&(Y.length>0?Y+="/..":Y="..",J=2)}else Y.length>0?Y+="/"+G.slice(X+1,ee):Y=G.slice(X+1,ee),J=ee-X-1;X=ee,Z=0}else Q===46&&Z!==-1?++Z:Z=-1}return Y}function U(G,K){var Y=K.dir||K.root,J=K.base||(K.name||"")+(K.ext||"");return Y?Y===K.root?Y+J:Y+G+J:J}var q={resolve:function(){for(var K="",Y=!1,J,X=arguments.length-1;X>=-1&&!Y;X--){var Z;X>=0?Z=arguments[X]:(J===void 0&&(J=process.cwd()),Z=J),I(Z),Z.length!==0&&(K=Z+"/"+K,Y=Z.charCodeAt(0)===47)}return K=j(K,!Y),Y?K.length>0?"/"+K:"/":K.length>0?K:"."},normalize:function(K){if(I(K),K.length===0)return".";var Y=K.charCodeAt(0)===47,J=K.charCodeAt(K.length-1)===47;return K=j(K,!Y),K.length===0&&!Y&&(K="."),K.length>0&&J&&(K+="/"),Y?"/"+K:K},isAbsolute:function(K){return I(K),K.length>0&&K.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var K,Y=0;Y<arguments.length;++Y){var J=arguments[Y];I(J),J.length>0&&(K===void 0?K=J:K+="/"+J)}return K===void 0?".":q.normalize(K)},relative:function(K,Y){if(I(K),I(Y),K===Y||(K=q.resolve(K),Y=q.resolve(Y),K===Y))return"";for(var J=1;J<K.length&&K.charCodeAt(J)===47;++J);for(var X=K.length,Z=X-J,Q=1;Q<Y.length&&Y.charCodeAt(Q)===47;++Q);for(var ee=Y.length,ne=ee-Q,ie=Z<ne?Z:ne,oe=-1,se=0;se<=ie;++se){if(se===ie){if(ne>ie){if(Y.charCodeAt(Q+se)===47)return Y.slice(Q+se+1);if(se===0)return Y.slice(Q+se)}else Z>ie&&(K.charCodeAt(J+se)===47?oe=se:se===0&&(oe=0));break}var ae=K.charCodeAt(J+se),fe=Y.charCodeAt(Q+se);if(ae!==fe)break;ae===47&&(oe=se)}var le="";for(se=J+oe+1;se<=X;++se)(se===X||K.charCodeAt(se)===47)&&(le.length===0?le+="..":le+="/..");return le.length>0?le+Y.slice(Q+oe):(Q+=oe,Y.charCodeAt(Q)===47&&++Q,Y.slice(Q))},_makeLong:function(K){return K},dirname:function(K){if(I(K),K.length===0)return".";for(var Y=K.charCodeAt(0),J=Y===47,X=-1,Z=!0,Q=K.length-1;Q>=1;--Q)if(Y=K.charCodeAt(Q),Y===47){if(!Z){X=Q;break}}else Z=!1;return X===-1?J?"/":".":J&&X===1?"//":K.slice(0,X)},basename:function(K,Y){if(Y!==void 0&&typeof Y!="string")throw new TypeError('"ext" argument must be a string');I(K);var J=0,X=-1,Z=!0,Q;if(Y!==void 0&&Y.length>0&&Y.length<=K.length){if(Y.length===K.length&&Y===K)return"";var ee=Y.length-1,ne=-1;for(Q=K.length-1;Q>=0;--Q){var ie=K.charCodeAt(Q);if(ie===47){if(!Z){J=Q+1;break}}else ne===-1&&(Z=!1,ne=Q+1),ee>=0&&(ie===Y.charCodeAt(ee)?--ee===-1&&(X=Q):(ee=-1,X=ne))}return J===X?X=ne:X===-1&&(X=K.length),K.slice(J,X)}else{for(Q=K.length-1;Q>=0;--Q)if(K.charCodeAt(Q)===47){if(!Z){J=Q+1;break}}else X===-1&&(Z=!1,X=Q+1);return X===-1?"":K.slice(J,X)}},extname:function(K){I(K);for(var Y=-1,J=0,X=-1,Z=!0,Q=0,ee=K.length-1;ee>=0;--ee){var ne=K.charCodeAt(ee);if(ne===47){if(!Z){J=ee+1;break}continue}X===-1&&(Z=!1,X=ee+1),ne===46?Y===-1?Y=ee:Q!==1&&(Q=1):Y!==-1&&(Q=-1)}return Y===-1||X===-1||Q===0||Q===1&&Y===X-1&&Y===J+1?"":K.slice(Y,X)},format:function(K){if(K===null||typeof K!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof K);return U("/",K)},parse:function(K){I(K);var Y={root:"",dir:"",base:"",ext:"",name:""};if(K.length===0)return Y;var J=K.charCodeAt(0),X=J===47,Z;X?(Y.root="/",Z=1):Z=0;for(var Q=-1,ee=0,ne=-1,ie=!0,oe=K.length-1,se=0;oe>=Z;--oe){if(J=K.charCodeAt(oe),J===47){if(!ie){ee=oe+1;break}continue}ne===-1&&(ie=!1,ne=oe+1),J===46?Q===-1?Q=oe:se!==1&&(se=1):Q!==-1&&(se=-1)}return Q===-1||ne===-1||se===0||se===1&&Q===ne-1&&Q===ee+1?ne!==-1&&(ee===0&&X?Y.base=Y.name=K.slice(1,ne):Y.base=Y.name=K.slice(ee,ne)):(ee===0&&X?(Y.name=K.slice(1,Q),Y.base=K.slice(1,ne)):(Y.name=K.slice(ee,Q),Y.base=K.slice(ee,ne)),Y.ext=K.slice(Q,ne)),ee>0?Y.dir=K.slice(0,ee-1):X&&(Y.dir="/"),Y},sep:"/",delimiter:":",win32:null,posix:null};q.posix=q,$.exports=q}});__toESM$1(require_path_browserify());var import_path_browserify=__toESM$1(require_path_browserify());import_path_browserify.basename;var export_dirname=import_path_browserify.dirname;import_path_browserify.extname,import_path_browserify.format,import_path_browserify.isAbsolute,import_path_browserify.join,import_path_browserify.normalize,import_path_browserify.parse,import_path_browserify.relative,import_path_browserify.resolve;var LogLevel$1;(function(_){_[_.TRACE=5]="TRACE",_[_.DEBUG=10]="DEBUG",_[_.INFO=11]="INFO",_[_.WARN=12]="WARN",_[_.ERROR=13]="ERROR"})(LogLevel$1||(LogLevel$1={}));var levels={trace:5,debug:10,info:11,warn:12,error:13},LogProcessorType;(function(_){_.CONSOLE="console",_.BROWSER="browser",_.DEBUG="debug"})(LogProcessorType||(LogProcessorType={}));var logInfoProperties=Symbol("logInfoProperties"),gatherLogInfoFromScope=_=>{if(!_)return{};const $={},j=Object.getPrototypeOf(_)[logInfoProperties]??[];for(const U of j)try{$[U]=typeof _[U]=="function"?_[U]():_[U]}catch(q){$[U]=q.message}return $},matchFilter=(_,$,I)=>$>=_.level&&(!_.pattern||I.includes(_.pattern)),shouldLog=(_,$)=>$===void 0?!0:$.some(I=>{var j;return matchFilter(I,_.level,((j=_.meta)==null?void 0:j.F)??"")}),getContextFromEntry=_=>{let $;if(_.meta){const j=gatherLogInfoFromScope(_.meta.S);Object.keys(j).length>0&&($=Object.assign($??{},j))}const I=typeof _.context=="function"?_.context():_.context;if(I)if(I instanceof Error){const j=I.context;$=Object.assign($??{},{error:I.stack,...j})}else typeof I=="object"&&($=Object.assign($??{},I));if(_.error){const j=_.error.context;$=Object.assign($??{},{error:_.error,...j})}return $&&Object.keys($).length>0?$:void 0},nextPromiseId=0,createMethodLogDecorator=_=>($,I,j)=>(U,q,G)=>{const K=G.value,Y=q;G.value=function(...J){const X={F:"",L:0,...j??{},S:this},Z=J.map(Q=>export_inspect(Q,!1,1,!0)).join(", ");try{const Q=performance.now(),ee=K.apply(this,J);if(isThenable(ee)){const ne=nextPromiseId++;logAsyncBegin(_,Y,Z,ne,X),ee.then(ie=>{logAsyncResolved(_,Y,ie,ne,Q,X)},ie=>{logAsyncRejected(_,Y,ie,ne,Q,X)})}else logSyncCall(_,Y,Z,ee,X);return ee}catch(Q){throw logSyncError(_,Y,Z,Q,X),Q}},Object.defineProperty(G.value,"name",{value:Y+"$log"})},isThenable=_=>_&&typeof _.then=="function",logSyncCall=(_,$,I,j,U)=>{_.info(`.${formatFunction($)} (${I}) ${chalk$1.gray("=>")} ${export_inspect(j,!1,1,!0)}`,{},U)},logSyncError=(_,$,I,j,U)=>{_.error(`.${formatFunction($)} (${I}) ๐ฅ ${j}`,{},U)},logAsyncBegin=(_,$,I,j,U)=>{_.info(`.${formatFunction($)} โด (${I}) ${chalk$1.gray("=>")} ${formatPromise(j)}`,{},U)},logAsyncResolved=(_,$,I,j,U,q)=>{I!==void 0?_.info(`.${formatFunction($)} โฒ ${greenCheck} ${chalk$1.gray("resolve")} ${formatPromise(j)} ${formatTimeElapsed(U)} ${chalk$1.gray("=>")} ${export_inspect(I,!1,1,!0)}`,{},q):_.info(`.${formatFunction($)} โฒ ${greenCheck} ${chalk$1.gray("resolve")} ${formatPromise(j)} ${formatTimeElapsed(U)}`,{},q)},logAsyncRejected=(_,$,I,j,U,q)=>{_.info(`.${formatFunction($)} โฒ ๐ฅ ${chalk$1.gray("reject")} ${formatPromise(j)} ${formatTimeElapsed(U)} ${chalk$1.gray("=>")} ${I}`,{},q)},greenCheck=typeof chalk$1.green=="function"?chalk$1.green("โ"):"โ",formatTimeElapsed=_=>chalk$1.gray(`${(performance.now()-_).toFixed(0)}ms`),COLOR_FUNCTION=[220,220,170],formatFunction=_=>chalk$1.bold(chalk$1.rgb(...COLOR_FUNCTION)(_)),formatPromise=_=>chalk$1.blue(`Promise#${_}`),loadOptions=_=>{try{let $;return typeof localStorage>"u"?globalThis.localStorage_dxlog&&($=globalThis.localStorage_dxlog):$=localStorage.getItem("dxlog")??void 0,$?JSON.parse($):void 0}catch($){console.info("can't parse dxlog config",$);return}},CONSOLE_PROCESSOR=()=>{},DEBUG_PROCESSOR=(_,$)=>{console.log(export_inspect($,!1,null,!0))},getRelativeFilename=_=>{const $=_.match(/.+\/(packages\/.+\/.+)/);if($){const[,I]=$;return I}return _},CONFIG=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},APP_BROWSER_PROCESSOR=(_,$)=>{var J,X,Z,Q;if(!shouldLog($,_.filters))return;const I=_.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",j=[];let U="";if($.meta){const ee=getRelativeFilename($.meta.F);U=`${`${I.replace(/\/$/,"")}/${ee}`}#L${$.meta.L}`}let q=[];if((J=$.meta)!=null&&J.S){const ee=(X=$.meta)==null?void 0:X.S,ne=ee.name||getDebugName(ee),ie=(Z=$.meta.S)!=null&&Z.hostSessionId?"[worker] ":"";q.push(`%c${ie}${ne}`,"color:#C026D3;font-weight:bold")}q.push($.message);const G=getContextFromEntry($);G&&q.push(G);const K={[LogLevel$1.ERROR]:console.error.bind(console),[LogLevel$1.WARN]:console.warn.bind(console),[LogLevel$1.DEBUG]:console.log.bind(console)};(CONFIG.printFileLinks||safariCheck())&&(j!=null&&j.length?q=[`%c${U}
|
|
115
115
|
%c${q.join(" ")}`,...j]:q=[U+`
|
|
116
|
-
`,...q]);const Y=K[$.level]??console.log;typeof((Q=$.meta)==null?void 0:Q.C)=="function"?$.meta.C(Y,q):Y(...q)},TEST_BROWSER_PROCESSOR=(_,$)=>{var Y,J,X;if(!shouldLog($,_.filters))return;let I="";$.meta&&(I=`${getRelativeFilename($.meta.F)}:${$.meta.L}`);let j=[];const U=(J=(Y=$.meta)==null?void 0:Y.S)!=null&&J.hostSessionId?"[worker] ":"";j.push(`${U}${$.message}`);const q=getContextFromEntry($);q&&j.push(q);const G={[LogLevel$1.ERROR]:console.error,[LogLevel$1.WARN]:console.warn,[LogLevel$1.DEBUG]:console.log};CONFIG.printFileLinks&&(j=[I,...j]);const K=G[$.level]??console.log;typeof((X=$.meta)==null?void 0:X.C)=="function"?$.meta.C(K,j):K(...j)},BROWSER_PROCESSOR=CONFIG.useTestProcessor?TEST_BROWSER_PROCESSOR:APP_BROWSER_PROCESSOR,getRelativeFilename2=_=>{const $=_.match(/.+\/(packages\/.+\/.+)/);if($){const[,I]=$;return I}return _},EAGAIN_MAX_DURATION=1e3,createFileProcessor=({pathOrFd:_,levels:$,filters:I})=>{let j;return(U,q)=>{if($.length>0&&!$.includes(q.level)||!shouldLog(q,I))return;if(typeof _=="number")j=_;else{try{mkdirSync(export_dirname(_))}catch{}j=openSync()}const G={...q,timestamp:Date.now(),...q.meta?{meta:{file:getRelativeFilename2(q.meta.F),line:q.meta.L}}:{},context:jsonlogify(getContextFromEntry(q))};let K=0;for(;;)try{return appendFileSync(j,JSON.stringify(G)+`
|
|
116
|
+
`,...q]);const Y=K[$.level]??console.log.bind(console);typeof((Q=$.meta)==null?void 0:Q.C)=="function"?$.meta.C(Y,q):Y(...q)},TEST_BROWSER_PROCESSOR=(_,$)=>{var Y,J,X;if(!shouldLog($,_.filters))return;let I="";$.meta&&(I=`${getRelativeFilename($.meta.F)}:${$.meta.L}`);let j=[];const U=(J=(Y=$.meta)==null?void 0:Y.S)!=null&&J.hostSessionId?"[worker] ":"";j.push(`${U}${$.message}`);const q=getContextFromEntry($);q&&j.push(q);const G={[LogLevel$1.ERROR]:console.error,[LogLevel$1.WARN]:console.warn,[LogLevel$1.DEBUG]:console.log};CONFIG.printFileLinks&&(j=[I,...j]);const K=G[$.level]??console.log;typeof((X=$.meta)==null?void 0:X.C)=="function"?$.meta.C(K,j):K(...j)},BROWSER_PROCESSOR=CONFIG.useTestProcessor?TEST_BROWSER_PROCESSOR:APP_BROWSER_PROCESSOR,getRelativeFilename2=_=>{const $=_.match(/.+\/(packages\/.+\/.+)/);if($){const[,I]=$;return I}return _},EAGAIN_MAX_DURATION=1e3,createFileProcessor=({pathOrFd:_,levels:$,filters:I})=>{let j;return(U,q)=>{if($.length>0&&!$.includes(q.level)||!shouldLog(q,I))return;if(typeof _=="number")j=_;else{try{mkdirSync(export_dirname(_))}catch{}j=openSync()}const G={...q,timestamp:Date.now(),...q.meta?{meta:{file:getRelativeFilename2(q.meta.F),line:q.meta.L}}:{},context:jsonlogify(getContextFromEntry(q))};let K=0;for(;;)try{return appendFileSync(j,JSON.stringify(G)+`
|
|
117
117
|
`)}catch(Y){if(Y.code!=="EAGAIN")throw Y;if(K===0)K=performance.now();else if(performance.now()-K>EAGAIN_MAX_DURATION)throw console.log(`could not write after ${EAGAIN_MAX_DURATION}ms of EAGAIN failures, giving up`),Y}}},logFilePath,getLogFilePath=()=>(logFilePath??(logFilePath=process.env.LOG_FILE??(process.env.HOME?`${process.env.HOME}/.dxlog/${new Date().toISOString()}.log`:void 0)),logFilePath);createFileProcessor({pathOrFd:getLogFilePath(),levels:[LogLevel$1.ERROR,LogLevel$1.WARN,LogLevel$1.INFO,LogLevel$1.TRACE]});var processors={[LogProcessorType.CONSOLE]:CONSOLE_PROCESSOR,[LogProcessorType.BROWSER]:BROWSER_PROCESSOR,[LogProcessorType.DEBUG]:DEBUG_PROCESSOR},IS_BROWSER=typeof window<"u"||typeof navigator<"u",DEFAULT_PROCESSORS=[IS_BROWSER?BROWSER_PROCESSOR:CONSOLE_PROCESSOR],parseFilter=_=>{if(typeof _=="number")return[{level:_}];const $=(j,U=LogLevel$1.WARN)=>levels[j.toLowerCase()]??U;return(typeof _=="string"?_.split(/,\s*/):_).map(j=>{const[U,q]=j.split(":");return q?{level:$(q),pattern:U}:{level:$(U)}})},getConfig=_=>{const $="process"in globalThis?{file:process.env.LOG_CONFIG,filter:process.env.LOG_FILTER,processor:process.env.LOG_PROCESSOR}:void 0,I=defaultsDeep({},loadOptions($==null?void 0:$.file),$,_);return{options:I,filters:parseFilter(I.filter??LogLevel$1.INFO),captureFilters:parseFilter(I.captureFilter??LogLevel$1.WARN),processors:I.processor?[processors[I.processor]]:DEFAULT_PROCESSORS,prefix:I.prefix}},createLog=()=>{const _=(...I)=>$(LogLevel$1.DEBUG,...I);_._config=getConfig(),Object.defineProperty(_,"runtimeConfig",{get:()=>_._config}),_.addProcessor=I=>{DEFAULT_PROCESSORS.filter(j=>j===I).length===0&&DEFAULT_PROCESSORS.push(I),_._config.processors.filter(j=>j===I).length===0&&_._config.processors.push(I)},_.config=I=>{_._config=getConfig(I)},_.trace=(...I)=>$(LogLevel$1.TRACE,...I),_.debug=(...I)=>$(LogLevel$1.DEBUG,...I),_.info=(...I)=>$(LogLevel$1.INFO,...I),_.warn=(...I)=>$(LogLevel$1.WARN,...I),_.error=(...I)=>$(LogLevel$1.ERROR,...I),_.catch=(I,j,U)=>$(LogLevel$1.ERROR,I.message,j,U,I),_.break=()=>_.info("โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"),_.stack=(I,j,U)=>$(LogLevel$1.INFO,`${I??"Stack Dump"}
|
|
118
118
|
${getFormattedStackTrace()}`,j,U),_.method=createMethodLogDecorator(_);const $=(I,j,U={},q,G)=>{_._config.processors.forEach(K=>K(_._config,{level:I,message:j,context:U,meta:q,error:G}))};return _},log$2=globalThis.dx_log??(globalThis.dx_log=createLog()),getFormattedStackTrace=()=>new Error().stack.split(`
|
|
119
119
|
`).slice(3).join(`
|
|
@@ -843,7 +843,7 @@ button {
|
|
|
843
843
|
background-color: #61493f;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
`;function $e5534fc185f7111e$export$2e2bcd8739ae039(_){const $=React.useRef(null),I=React.useRef(null);return I.current&&I.current.update(_),React.useEffect(()=>(I.current=new $efa000751917694d$export$2e2bcd8739ae039({..._,ref:$}),()=>{I.current=null}),[]),React.createElement("div",{ref:$})}const EmojiPickerToolbarButton=({disabled:_,defaultEmoji:$,emoji:I,onChangeEmoji:j,classNames:U})=>{const{t:q}=useTranslation("os"),{themeMode:G}=useThemeContext(),[K,Y]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:j,defaultProp:$}),[J,X]=React.useState(!1),Z=React.useRef(!1),[Q,ee]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Q,onOpenChange:ne=>{Z.current?(ee(!1),Z.current=!1):ee(ne)}},React.createElement(Popover.Root,{open:J,onOpenChange:ne=>{X(ne),Z.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Popover.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:["gap-2 text-2xl plb-1",U],disabled:_},React.createElement("span",{className:"sr-only"},q("select emoji label")),React.createElement(react.UserCircle,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},q("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),X(!1),Z.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(Y(ne),X(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0,theme:G}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:_})=>{const{tx:$}=useThemeContext(),I=20;return React.createElement("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`},React.createElement("rect",{x:0,y:0,width:I,height:I,className:$("hue.fill","select--hue__preview",{hue:_})}))},hueTokens=Object.keys(hueTokenThemes).slice(0,16),HuePickerToolbarButton=({disabled:_,hue:$,onChangeHue:I,classNames:j,defaultHue:U})=>{const{t:q}=useTranslation("os"),[G,K]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:$,onChange:I,defaultProp:U}),[Y,J]=React.useState(!1),X=React.useRef(!1),[Z,Q]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Z,onOpenChange:ee=>{X.current?(Q(!1),X.current=!1):Q(ee)}},React.createElement(DropdownMenu2.Root,{modal:!1,open:Y,onOpenChange:ee=>{J(ee),X.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",j),disabled:_},React.createElement("span",{className:"sr-only"},q("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},q("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu2.Content,{side:"bottom",classNames:"!w-40"},React.createElement(DropdownMenu2.Viewport,{classNames:"grid grid-cols-4"},hueTokens.map(ee=>React.createElement(DropdownMenu2.CheckboxItem,{key:ee,checked:ee===G,onCheckedChange:()=>K(ee),classNames:"px-0 py-2 items-center justify-center"},React.createElement(HuePreview,{hue:ee})))))))};var data={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},capitalize=_=>_.charAt(0).toUpperCase()+_.slice(1),generateName=_=>{const $=_.length*2/3,I=_.substring(0,$),j=_.substring($),U=capitalize(data.adjectives[parseInt(I,16)%data.adjectives.length]),q=capitalize(data.animals[parseInt(j,16)%data.animals.length]);return`${U} ${q}`};const IdentityListItem=React.forwardRef(({identity:_,presence:$,onClick:I,classNames:j,...U},q)=>{var J,X,Z,Q,ee;const G=keyToFallback(_.identityKey),K=useId("identityListItem__label"),Y=((J=_.profile)==null?void 0:J.displayName)??generateName(_.identityKey.toHex());return React.createElement(ListItem.Root,{...U,classNames:mx("flex gap-2 pis-3 pie-1 items-center",I&&"cursor-pointer",j),onClick:()=>I==null?void 0:I(),"data-testid":"identity-list-item",labelId:K,ref:q},React.createElement(Avatar.Root,{status:$===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:K,hue:((Z=(X=_.profile)==null?void 0:X.data)==null?void 0:Z.hue)||G.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ee=(Q=_.profile)==null?void 0:Q.data)==null?void 0:ee.emoji)||G.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},Y)))}),SpaceMemberList=({spaceKey:_,includeSelf:$,onSelect:I})=>{const j=reactClient.useClient(),U=echo.useMembers(_),q=React.useMemo(()=>$?U.sort(G=>G.identity.identityKey.equals(j.halo.identity.get().identityKey)?-1:1):U.filter(G=>!G.identity.identityKey.equals(j.halo.identity.get().identityKey)),[U]);return React.createElement(SpaceMemberListImpl,{members:q,onSelect:I})},SpaceMemberListImpl=({members:_,onSelect:$})=>{const{t:I}=useTranslation("os"),j=_.filter(U=>U.identity);return j.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},j.map(U=>React.createElement(IdentityListItem,{key:U.identity.identityKey.toHex(),identity:U.identity,presence:U.presence,onClick:$&&(()=>$(U))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},I("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:_,onClickAdd:$,onClickEdit:I,onClickReset:j,onClickJoinExisting:U,classNames:q,connectionState:G,onAgentDestroy:K,...Y},J)=>{var ie,oe;const{t:X}=useTranslation("os"),Z=keyToFallback(_.deviceKey),Q=useId("identityListItem__label"),ee=_.profile?X("device name placeholder",{os:_.profile.os,platform:_.profile.platform}):generateName(_.deviceKey.toHex()),ne=_.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...Y,classNames:["flex gap-2 items-center mlb-2",q],"data-testid":`device-list-item${ne?"-current":""}`,labelId:Q,ref:J},React.createElement(Avatar.Root,{status:ne&&G===mesh.ConnectionState.OFFLINE?"error":_.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:Q,hue:Z.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ie=_.profile)!=null&&ie.type?_.profile.type===halo.DeviceType.AGENT_MANAGED?React.createElement(react.Database,{...iconProps}):_.profile.type===halo.DeviceType.BROWSER?React.createElement(react.Compass,{...iconProps}):_.profile.type===halo.DeviceType.NATIVE?React.createElement(react.Desktop,{...iconProps}):[halo.DeviceType.AGENT,halo.DeviceType.AGENT_MANAGED].includes(_.profile.type)?React.createElement(react.Robot,{...iconProps}):_.profile.type===halo.DeviceType.MOBILE?React.createElement(react.DeviceMobile,{...iconProps}):React.createElement(react.Devices,{...iconProps}):React.createElement(Avatar.Fallback,{text:Z.emoji})),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ee),ne&&React.createElement(Tag,{color:"primary"},X("current device tag label")),((oe=_.profile)==null?void 0:oe.type)===halo.DeviceType.AGENT_MANAGED?React.createElement(Tooltip.Root,null,React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":"agent.destroy",onClick:K},React.createElement("span",{className:"sr-only"},X("destroy agent label")),React.createElement(react.Power,{className:getSize(5)}))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},X("destroy agent label")))):_.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu2.Root,null,React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${ne?"-current":""}.options`},React.createElement("span",{className:"sr-only"},X("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu2.Content,null,React.createElement(DropdownMenu2.Viewport,null,React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.join-existing",onClick:U},React.createElement(react.ShareFat,{className:getSize(5)}),X("choose join new identity label")),React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.reset",onClick:j},React.createElement(react.Power,{className:getSize(5)}),X("reset device label")))))))}),DeviceList=({devices:_,connectionState:$,onClickAdd:I,onClickEdit:j,onClickReset:U,onClickJoinExisting:q,onAgentDestroy:G})=>{const{t:K}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},K("devices heading")),_.length>0&&React.createElement(List,null,_.map(Y=>React.createElement(DeviceListItem,{key:Y.deviceKey.toHex(),device:Y,onClickEdit:()=>j==null?void 0:j(Y),onClickReset:U,onClickJoinExisting:q,connectionState:$,onAgentDestroy:G}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3 is-full","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm surface-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},K("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds(_){const $=toDate(_),I=new Date(Date.UTC($.getFullYear(),$.getMonth(),$.getDate(),$.getHours(),$.getMinutes(),$.getSeconds(),$.getMilliseconds()));return I.setUTCFullYear($.getFullYear()),+_-+I}function compareAsc(_,$){const I=toDate(_),j=toDate($),U=I.getTime()-j.getTime();return U<0?-1:U>0?1:U}function differenceInCalendarMonths(_,$){const I=toDate(_),j=toDate($),U=I.getFullYear()-j.getFullYear(),q=I.getMonth()-j.getMonth();return U*12+q}function getRoundingMethod(_){return $=>{const j=(_?Math[_]:Math.trunc)($);return j===0?0:j}}function differenceInMilliseconds(_,$){return+toDate(_)-+toDate($)}function endOfDay(_){const $=toDate(_);return $.setHours(23,59,59,999),$}function endOfMonth(_){const $=toDate(_),I=$.getMonth();return $.setFullYear($.getFullYear(),I+1,0),$.setHours(23,59,59,999),$}function isLastDayOfMonth(_){const $=toDate(_);return+endOfDay($)==+endOfMonth($)}function differenceInMonths(_,$){const I=toDate(_),j=toDate($),U=compareAsc(I,j),q=Math.abs(differenceInCalendarMonths(I,j));let G;if(q<1)G=0;else{I.getMonth()===1&&I.getDate()>27&&I.setDate(30),I.setMonth(I.getMonth()-U*q);let K=compareAsc(I,j)===-U;isLastDayOfMonth(toDate(_))&&q===1&&compareAsc(_,j)===1&&(K=!1),G=U*(q-Number(K))}return G===0?0:G}function differenceInSeconds(_,$,I){const j=differenceInMilliseconds(_,$)/1e3;return getRoundingMethod(I==null?void 0:I.roundingMethod)(j)}function formatDistance(_,$,I){const j=getDefaultOptions(),U=(I==null?void 0:I.locale)??j.locale??enUS$1,q=2520,G=compareAsc(_,$);if(isNaN(G))throw new RangeError("Invalid time value");const K=Object.assign({},I,{addSuffix:I==null?void 0:I.addSuffix,comparison:G});let Y,J;G>0?(Y=toDate($),J=toDate(_)):(Y=toDate(_),J=toDate($));const X=differenceInSeconds(J,Y),Z=(getTimezoneOffsetInMilliseconds(J)-getTimezoneOffsetInMilliseconds(Y))/1e3,Q=Math.round((X-Z)/60);let ee;if(Q<2)return I!=null&&I.includeSeconds?X<5?U.formatDistance("lessThanXSeconds",5,K):X<10?U.formatDistance("lessThanXSeconds",10,K):X<20?U.formatDistance("lessThanXSeconds",20,K):X<40?U.formatDistance("halfAMinute",0,K):X<60?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",1,K):Q===0?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",Q,K);if(Q<45)return U.formatDistance("xMinutes",Q,K);if(Q<90)return U.formatDistance("aboutXHours",1,K);if(Q<minutesInDay){const ne=Math.round(Q/60);return U.formatDistance("aboutXHours",ne,K)}else{if(Q<q)return U.formatDistance("xDays",1,K);if(Q<minutesInMonth){const ne=Math.round(Q/minutesInDay);return U.formatDistance("xDays",ne,K)}else if(Q<minutesInMonth*2)return ee=Math.round(Q/minutesInMonth),U.formatDistance("aboutXMonths",ee,K)}if(ee=differenceInMonths(J,Y),ee<12){const ne=Math.round(Q/minutesInMonth);return U.formatDistance("xMonths",ne,K)}else{const ne=ee%12,ie=Math.trunc(ee/12);return ne<3?U.formatDistance("aboutXYears",ie,K):ne<9?U.formatDistance("overXYears",ie,K):U.formatDistance("almostXYears",ie+1,K)}}function formatDistanceToNow(_,$){return formatDistance(_,Date.now(),$)}var LogLevel;(function(_){_[_.TRACE=5]="TRACE",_[_.DEBUG=10]="DEBUG",_[_.INFO=11]="INFO",_[_.WARN=12]="WARN",_[_.ERROR=13]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function(_){(function($){$[$.INCLUSIVE=1]="INCLUSIVE",$[$.EXPLICIT=2]="EXPLICIT"})(_.MatchingOptions||(_.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var SystemStatus;(function(_){_[_.ACTIVE=0]="ACTIVE",_[_.INACTIVE=1]="INACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function(_){(function($){$[$.NONE=0]="NONE",$[$.TRUNCATE=1]="TRUNCATE",$[$.HUMANIZE=2]="HUMANIZE"})(_.KEY_OPTION||(_.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function(_){(function($){$[$.BROWSER=0]="BROWSER",$[$.SHARED_WORKER=1]="SHARED_WORKER",$[$.NODE=2]="NODE"})(_.PLATFORM_TYPE||(_.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function(_){_[_.CURRENT=0]="CURRENT",_[_.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function(_){(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE",$[$.REMOVED=2]="REMOVED"})(_.PresenceState||(_.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function(_){(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(_.PresenceState||(_.PresenceState={}))})(SpaceMember||(SpaceMember={}));var SpaceState;(function(_){_[_.INACTIVE=2]="INACTIVE",_[_.ACTIVE=6]="ACTIVE",_[_.CLOSED=1]="CLOSED",_[_.CONTROL_ONLY=7]="CONTROL_ONLY",_[_.INITIALIZING=4]="INITIALIZING",_[_.READY=3]="READY",_[_.ERROR=5]="ERROR",_[_.REQUIRES_MIGRATION=8]="REQUIRES_MIGRATION"})(SpaceState||(SpaceState={}));var CreateEpochRequest;(function(_){(function($){$[$.NONE=0]="NONE",$[$.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",$[$.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",$[$.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT",$[$.REPLACE_AUTOMERGE_ROOT=4]="REPLACE_AUTOMERGE_ROOT",$[$.MIGRATE_REFERENCES_TO_DXN=5]="MIGRATE_REFERENCES_TO_DXN"})(_.Migration||(_.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var Invitation;(function(_){(function($){$[$.INTERACTIVE=0]="INTERACTIVE",$[$.DELEGATED=1]="DELEGATED",$[$.MULTIUSE=2]="MULTIUSE"})(_.Type||(_.Type={})),function($){$[$.DEVICE=0]="DEVICE",$[$.SPACE=1]="SPACE"}(_.Kind||(_.Kind={})),function($){$[$.NONE=0]="NONE",$[$.SHARED_SECRET=1]="SHARED_SECRET",$[$.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}(_.AuthMethod||(_.AuthMethod={})),function($){$[$.INIT=0]="INIT",$[$.CONNECTING=1]="CONNECTING",$[$.CONNECTED=2]="CONNECTED",$[$.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",$[$.AUTHENTICATING=4]="AUTHENTICATING",$[$.SUCCESS=5]="SUCCESS",$[$.CANCELLED=6]="CANCELLED",$[$.TIMEOUT=7]="TIMEOUT",$[$.ERROR=8]="ERROR",$[$.EXPIRED=9]="EXPIRED"}(_.State||(_.State={}))})(Invitation||(Invitation={}));var QueryInvitationsResponse;(function(_){(function($){$[$.ADDED=0]="ADDED",$[$.REMOVED=1]="REMOVED",$[$.SAVED=2]="SAVED",$[$.LOAD_COMPLETE=3]="LOAD_COMPLETE"})(_.Action||(_.Action={})),function($){$[$.CREATED=0]="CREATED",$[$.ACCEPTED=1]="ACCEPTED"}(_.Type||(_.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState;(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE"})(ConnectionState||(ConnectionState={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$1(_,$,I,j){var U=arguments.length,q=U<3?$:j===null?j=Object.getOwnPropertyDescriptor($,I):j,G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(_,$,I,j);else for(var K=_.length-1;K>=0;K--)(G=_[K])&&(q=(U<3?G(q):U>3?G($,I,q):G($,I))||q);return U>3&&q&&Object.defineProperty($,I,q),q}var __dxlog_file$4="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,DEFAULT_ERROR_HANDLER=(_,$)=>{if(!(_ instanceof ContextDisposedError))throw $.dispose(),_},_a$1,_b,Context=(un=class{constructor($={},I){nn(this,wt,void 0);nn(this,Ct,void 0);nn(this,Mt,void 0);nn(this,Yt,void 0);nn(this,xn,void 0);nn(this,Jt,void 0);nn(this,rn,void 0);qt(this,wt,[]),qt(this,Ct,void 0),qt(this,Mt,void 0),qt(this,Jt,!1),qt(this,rn,void 0),this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_a$1]="Context",this[_b]=()=>this.toString(),qt(this,Ct,getContextName($,I)),qt(this,Mt,$.parent),qt(this,Yt,$.attributes??{}),qt(this,xn,$.onError??DEFAULT_ERROR_HANDLER)}static default(){return new un}get disposed(){return Ot(this,Jt)}get disposeCallbacksLength(){return Ot(this,wt).length}onDispose($){return Ot(this,Jt)&&(async()=>{try{await $()}catch(I){log$2.catch(I,{context:Ot(this,Ct)},{F:__dxlog_file$4,L:90,S:this,C:(j,U)=>j(...U)})}})(),Ot(this,wt).push($),Ot(this,wt).length>this.maxSafeDisposeCallbacks&&log$2.warn("Context has a large number of dispose callbacks (this might be a memory leak).",{context:Ot(this,Ct),count:Ot(this,wt).length},{F:__dxlog_file$4,L:97,S:this,C:(I,j)=>I(...j)}),()=>{const I=Ot(this,wt).indexOf($);I!==-1&&Ot(this,wt).splice(I,1)}}async dispose($=!1){if(Ot(this,rn))return Ot(this,rn);qt(this,Jt,!0);let I;const j=new Promise(Y=>{I=Y});qt(this,rn,j);const U=Array.from(Ot(this,wt)).reverse();Ot(this,wt).length=0;let q=0,G=!0;const K=[];for(const Y of U)try{await Y(),q++}catch(J){G=!1,$?K.push(J):log$2.catch(J,{context:Ot(this,Ct),callback:q,count:U.length},{F:__dxlog_file$4,L:156,S:this,C:(X,Z)=>X(...Z)})}if(K.length>0)throw new AggregateError(K);return I(G),G}raise($){if(!Ot(this,Jt))try{Ot(this,xn).call(this,$,this)}catch(I){Promise.reject(I)}}derive({onError:$,attributes:I}={}){const j=new un({onError:async q=>{if(!$)this.raise(q);else try{await $(q,this)}catch{this.raise(q)}},attributes:I}),U=this.onDispose(()=>j.dispose());return j.onDispose(U),j}getAttribute($){if($ in Ot(this,Yt))return Ot(this,Yt)[$];if(Ot(this,Mt))return Ot(this,Mt).getAttribute($)}toString(){return`Context(${Ot(this,Jt)?"disposed":"active"})`}async[(_a$1=Symbol.toStringTag,_b=export_inspect.custom,Symbol.asyncDispose)](){await this.dispose()}},wt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap,Yt=new WeakMap,xn=new WeakMap,Jt=new WeakMap,rn=new WeakMap,un);Context=_ts_decorate$1([safeInstanceof("Context")],Context);var getContextName=(_,$)=>{var I;if(_.name)return _.name;if((I=$==null?void 0:$.F)!=null&&I.length){const j=$==null?void 0:$.F.split("/");return`${j[j.length-1]}#${($==null?void 0:$.L)??0}`}},LifecycleState;(function(_){_.CLOSED="CLOSED",_.OPEN="OPEN",_.ERROR="ERROR"})(LifecycleState||(LifecycleState={}));var Observable$2={};Object.defineProperty(Observable$2,"__esModule",{value:!0}),Observable$2.Observable=void 0;const hasSymbol=_=>!!Symbol[_],getSymbol=_=>hasSymbol(_)?Symbol[_]:"@@"+_,SymbolIterator=getSymbol("iterator"),SymbolObservable=getSymbol("observable"),SymbolSpecies=getSymbol("species");function getMethod(_,$){let I=_[$];if(I!=null){if(typeof I!="function")throw new TypeError(I+" is not a function");return I}}function getSpecies(_){let $=_.constructor;return $!==void 0&&($=$[SymbolSpecies],$===null&&($=void 0)),$!==void 0?$:Observable$1}function isObservable$1(_){return _ instanceof Observable$1}function hostReportError(_){hostReportError.log?hostReportError.log(_):setTimeout(()=>{throw _})}function enqueue(_){Promise.resolve().then(()=>{try{_()}catch($){hostReportError($)}})}function cleanupSubscription(_){let $=_._cleanup;if($!==void 0&&(_._cleanup=void 0,!!$))try{if(typeof $=="function")$();else{let I=getMethod($,"unsubscribe");I&&I.call($)}}catch(I){hostReportError(I)}}function closeSubscription(_){_._observer=void 0,_._queue=void 0,_._state="closed"}function flushSubscription(_){let $=_._queue;if($){_._queue=void 0,_._state="ready";for(let I=0;I<$.length&&(notifySubscription(_,$[I].type,$[I].value),_._state!=="closed");++I);}}function notifySubscription(_,$,I){_._state="running";let j=_._observer;try{let U=getMethod(j,$);switch($){case"next":U&&U.call(j,I);break;case"error":if(closeSubscription(_),U)U.call(j,I);else throw I;break;case"complete":closeSubscription(_),U&&U.call(j);break}}catch(U){hostReportError(U)}_._state==="closed"?cleanupSubscription(_):_._state==="running"&&(_._state="ready")}function onNotify(_,$,I){if(_._state!=="closed"){if(_._state==="buffering"){_._queue.push({type:$,value:I});return}if(_._state!=="ready"){_._state="buffering",_._queue=[{type:$,value:I}],enqueue(()=>flushSubscription(_));return}notifySubscription(_,$,I)}}class Subscription{constructor($,I){this._cleanup=void 0,this._observer=$,this._queue=void 0,this._state="initializing";let j=this,U={get closed(){return j._state==="closed"},next(q){onNotify(j,"next",q)},error(q){onNotify(j,"error",q)},complete(){onNotify(j,"complete")}};try{this._cleanup=I.call(void 0,U)}catch(q){U.error(q)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class Kn{constructor($){if(!(this instanceof Kn))throw new TypeError("Observable cannot be called as a function");if(typeof $!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=$}subscribe($){return(typeof $!="object"||$===null)&&($={next:$,error:arguments[1],complete:arguments[2]}),new Subscription($,this._subscriber)}forEach($){return new Promise((I,j)=>{if(typeof $!="function"){j(new TypeError($+" is not a function"));return}function U(){q.unsubscribe(),I()}let q=this.subscribe({next(G){try{$(G,U)}catch(K){j(K),q.unsubscribe()}},error:j,complete:I})})}map($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{U=$(U)}catch(q){return j.error(q)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}filter($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{if(!$(U))return}catch(q){return j.error(q)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}reduce($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this),j=arguments.length>1,U=!1,G=arguments[1];return new I(K=>this.subscribe({next(Y){let J=!U;if(U=!0,!J||j)try{G=$(G,Y)}catch(X){return K.error(X)}else G=Y},error(Y){K.error(Y)},complete(){if(!U&&!j)return K.error(new TypeError("Cannot reduce an empty sequence"));K.next(G),K.complete()}}))}async all(){let $=[];return await this.forEach(I=>$.push(I)),$}concat(...$){let I=getSpecies(this);return new I(j=>{let U,q=0;function G(K){U=K.subscribe({next(Y){j.next(Y)},error(Y){j.error(Y)},complete(){q===$.length?(U=void 0,j.complete()):G(I.from($[q++]))}})}return G(this),()=>{U&&(U.unsubscribe(),U=void 0)}})}flatMap($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>{let U=[],q=this.subscribe({next(K){if($)try{K=$(K)}catch(J){return j.error(J)}let Y=I.from(K).subscribe({next(J){j.next(J)},error(J){j.error(J)},complete(){let J=U.indexOf(Y);J>=0&&U.splice(J,1),G()}});U.push(Y)},error(K){j.error(K)},complete(){G()}});function G(){q.closed&&U.length===0&&j.complete()}return()=>{U.forEach(K=>K.unsubscribe()),q.unsubscribe()}})}[SymbolObservable](){return this}static from($){let I=typeof this=="function"?this:Kn;if($==null)throw new TypeError($+" is not an object");let j=getMethod($,SymbolObservable);if(j){let U=j.call($);if(Object(U)!==U)throw new TypeError(U+" is not an object");return isObservable$1(U)&&U.constructor===I?U:new I(q=>U.subscribe(q))}if(hasSymbol("iterator")&&(j=getMethod($,SymbolIterator),j))return new I(U=>{enqueue(()=>{if(!U.closed){for(let q of j.call($))if(U.next(q),U.closed)return;U.complete()}})});if(Array.isArray($))return new I(U=>{enqueue(()=>{if(!U.closed){for(let q=0;q<$.length;++q)if(U.next($[q]),U.closed)return;U.complete()}})});throw new TypeError($+" is not observable")}static of(...$){let I=typeof this=="function"?this:Kn;return new I(j=>{enqueue(()=>{if(!j.closed){for(let U=0;U<$.length;++U)if(j.next($[U]),j.closed)return;j.complete()}})})}static get[SymbolSpecies](){return this}};Observable$2.Observable=Observable$1,Object.defineProperty(Observable$1,Symbol("extensions"),{value:{symbol:SymbolObservable,hostReportError},configurable:!0});var zenObservable=Observable$2.Observable;const Observable=getDefaultExportFromCjs(zenObservable);var readableBrowser={exports:{}},events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function($,I,j){return Function.prototype.apply.call($,I,j)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:ReflectOwnKeys=function($){return Object.getOwnPropertyNames($)};function ProcessEmitWarning(_){console&&console.warn&&console.warn(_)}var NumberIsNaN=Number.isNaN||function($){return $!==$};function EventEmitter$1(){EventEmitter$1.init.call(this)}events.exports=EventEmitter$1,events.exports.once=once$2,EventEmitter$1.EventEmitter=EventEmitter$1,EventEmitter$1.prototype._events=void 0,EventEmitter$1.prototype._eventsCount=0,EventEmitter$1.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(EventEmitter$1,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(_){if(typeof _!="number"||_<0||NumberIsNaN(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");defaultMaxListeners=_}}),EventEmitter$1.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter$1.prototype.setMaxListeners=function($){if(typeof $!="number"||$<0||NumberIsNaN($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this};function _getMaxListeners(_){return _._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:_._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function($){for(var I=[],j=1;j<arguments.length;j++)I.push(arguments[j]);var U=$==="error",q=this._events;if(q!==void 0)U=U&&q.error===void 0;else if(!U)return!1;if(U){var G;if(I.length>0&&(G=I[0]),G instanceof Error)throw G;var K=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw K.context=G,K}var Y=q[$];if(Y===void 0)return!1;if(typeof Y=="function")ReflectApply(Y,this,I);else for(var J=Y.length,X=arrayClone(Y,J),j=0;j<J;++j)ReflectApply(X[j],this,I);return!0};function _addListener(_,$,I,j){var U,q,G;if(checkListener(I),q=_._events,q===void 0?(q=_._events=Object.create(null),_._eventsCount=0):(q.newListener!==void 0&&(_.emit("newListener",$,I.listener?I.listener:I),q=_._events),G=q[$]),G===void 0)G=q[$]=I,++_._eventsCount;else if(typeof G=="function"?G=q[$]=j?[I,G]:[G,I]:j?G.unshift(I):G.push(I),U=_getMaxListeners(_),U>0&&G.length>U&&!G.warned){G.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=_,K.type=$,K.count=G.length,ProcessEmitWarning(K)}return _}EventEmitter$1.prototype.addListener=function($,I){return _addListener(this,$,I,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function($,I){return _addListener(this,$,I,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(_,$,I){var j={fired:!1,wrapFn:void 0,target:_,type:$,listener:I},U=onceWrapper.bind(j);return U.listener=I,j.wrapFn=U,U}EventEmitter$1.prototype.once=function($,I){return checkListener(I),this.on($,_onceWrap(this,$,I)),this},EventEmitter$1.prototype.prependOnceListener=function($,I){return checkListener(I),this.prependListener($,_onceWrap(this,$,I)),this},EventEmitter$1.prototype.removeListener=function($,I){var j,U,q,G,K;if(checkListener(I),U=this._events,U===void 0)return this;if(j=U[$],j===void 0)return this;if(j===I||j.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete U[$],U.removeListener&&this.emit("removeListener",$,j.listener||I));else if(typeof j!="function"){for(q=-1,G=j.length-1;G>=0;G--)if(j[G]===I||j[G].listener===I){K=j[G].listener,q=G;break}if(q<0)return this;q===0?j.shift():spliceOne(j,q),j.length===1&&(U[$]=j[0]),U.removeListener!==void 0&&this.emit("removeListener",$,K||I)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function($){var I,j,U;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[$]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[$]),this;if(arguments.length===0){var q=Object.keys(j),G;for(U=0;U<q.length;++U)G=q[U],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=j[$],typeof I=="function")this.removeListener($,I);else if(I!==void 0)for(U=I.length-1;U>=0;U--)this.removeListener($,I[U]);return this};function _listeners(_,$,I){var j=_._events;if(j===void 0)return[];var U=j[$];return U===void 0?[]:typeof U=="function"?I?[U.listener||U]:[U]:I?unwrapListeners(U):arrayClone(U,U.length)}EventEmitter$1.prototype.listeners=function($){return _listeners(this,$,!0)},EventEmitter$1.prototype.rawListeners=function($){return _listeners(this,$,!1)},EventEmitter$1.listenerCount=function(_,$){return typeof _.listenerCount=="function"?_.listenerCount($):listenerCount.call(_,$)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(_){var $=this._events;if($!==void 0){var I=$[_];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(_,$){for(var I=new Array($),j=0;j<$;++j)I[j]=_[j];return I}function spliceOne(_,$){for(;$+1<_.length;$++)_[$]=_[$+1];_.pop()}function unwrapListeners(_){for(var $=new Array(_.length),I=0;I<$.length;++I)$[I]=_[I].listener||_[I];return $}function once$2(_,$){return new Promise(function(I,j){function U(G){_.removeListener($,q),j(G)}function q(){typeof _.removeListener=="function"&&_.removeListener("error",U),I([].slice.call(arguments))}eventTargetAgnosticAddListener(_,$,q,{once:!0}),$!=="error"&&addErrorHandlerIfEventEmitter(_,U,{once:!0})})}function addErrorHandlerIfEventEmitter(_,$,I){typeof _.on=="function"&&eventTargetAgnosticAddListener(_,"error",$,I)}function eventTargetAgnosticAddListener(_,$,I,j){if(typeof _.on=="function")j.once?_.once($,I):_.on($,I);else if(typeof _.addEventListener=="function")_.addEventListener($,function U(q){j.once&&_.removeEventListener($,U),I(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}var eventsExports=events.exports,streamBrowser=eventsExports.EventEmitter,buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;revLookup[45]=62,revLookup[95]=63;function getLens(_){var $=_.length;if($%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=_.indexOf("=");I===-1&&(I=$);var j=I===$?0:4-I%4;return[I,j]}function byteLength(_){var $=getLens(_),I=$[0],j=$[1];return(I+j)*3/4-j}function _byteLength(_,$,I){return($+I)*3/4-I}function toByteArray(_){var $,I=getLens(_),j=I[0],U=I[1],q=new Arr(_byteLength(_,j,U)),G=0,K=U>0?j-4:j,Y;for(Y=0;Y<K;Y+=4)$=revLookup[_.charCodeAt(Y)]<<18|revLookup[_.charCodeAt(Y+1)]<<12|revLookup[_.charCodeAt(Y+2)]<<6|revLookup[_.charCodeAt(Y+3)],q[G++]=$>>16&255,q[G++]=$>>8&255,q[G++]=$&255;return U===2&&($=revLookup[_.charCodeAt(Y)]<<2|revLookup[_.charCodeAt(Y+1)]>>4,q[G++]=$&255),U===1&&($=revLookup[_.charCodeAt(Y)]<<10|revLookup[_.charCodeAt(Y+1)]<<4|revLookup[_.charCodeAt(Y+2)]>>2,q[G++]=$>>8&255,q[G++]=$&255),q}function tripletToBase64(_){return lookup[_>>18&63]+lookup[_>>12&63]+lookup[_>>6&63]+lookup[_&63]}function encodeChunk(_,$,I){for(var j,U=[],q=$;q<I;q+=3)j=(_[q]<<16&16711680)+(_[q+1]<<8&65280)+(_[q+2]&255),U.push(tripletToBase64(j));return U.join("")}function fromByteArray(_){for(var $,I=_.length,j=I%3,U=[],q=16383,G=0,K=I-j;G<K;G+=q)U.push(encodeChunk(_,G,G+q>K?K:G+q));return j===1?($=_[I-1],U.push(lookup[$>>2]+lookup[$<<4&63]+"==")):j===2&&($=(_[I-2]<<8)+_[I-1],U.push(lookup[$>>10]+lookup[$>>4&63]+lookup[$<<2&63]+"=")),U.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(_,$,I,j,U){var q,G,K=U*8-j-1,Y=(1<<K)-1,J=Y>>1,X=-7,Z=I?U-1:0,Q=I?-1:1,ee=_[$+Z];for(Z+=Q,q=ee&(1<<-X)-1,ee>>=-X,X+=K;X>0;q=q*256+_[$+Z],Z+=Q,X-=8);for(G=q&(1<<-X)-1,q>>=-X,X+=j;X>0;G=G*256+_[$+Z],Z+=Q,X-=8);if(q===0)q=1-J;else{if(q===Y)return G?NaN:(ee?-1:1)*(1/0);G=G+Math.pow(2,j),q=q-J}return(ee?-1:1)*G*Math.pow(2,q-j)},ieee754.write=function(_,$,I,j,U,q){var G,K,Y,J=q*8-U-1,X=(1<<J)-1,Z=X>>1,Q=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=j?0:q-1,ne=j?1:-1,ie=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(K=isNaN($)?1:0,G=X):(G=Math.floor(Math.log($)/Math.LN2),$*(Y=Math.pow(2,-G))<1&&(G--,Y*=2),G+Z>=1?$+=Q/Y:$+=Q*Math.pow(2,1-Z),$*Y>=2&&(G++,Y/=2),G+Z>=X?(K=0,G=X):G+Z>=1?(K=($*Y-1)*Math.pow(2,U),G=G+Z):(K=$*Math.pow(2,Z-1)*Math.pow(2,U),G=0));U>=8;_[I+ee]=K&255,ee+=ne,K/=256,U-=8);for(G=G<<U|K,J+=U;J>0;_[I+ee]=G&255,ee+=ne,G/=256,J-=8);_[I+ee-ne]|=ie*128};/*!
|
|
846
|
+
`;function $e5534fc185f7111e$export$2e2bcd8739ae039(_){const $=React.useRef(null),I=React.useRef(null);return I.current&&I.current.update(_),React.useEffect(()=>(I.current=new $efa000751917694d$export$2e2bcd8739ae039({..._,ref:$}),()=>{I.current=null}),[]),React.createElement("div",{ref:$})}const EmojiPickerToolbarButton=({disabled:_,defaultEmoji:$,emoji:I,onChangeEmoji:j,classNames:U})=>{const{t:q}=useTranslation("os"),{themeMode:G}=useThemeContext(),[K,Y]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:j,defaultProp:$}),[J,X]=React.useState(!1),Z=React.useRef(!1),[Q,ee]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Q,onOpenChange:ne=>{Z.current?(ee(!1),Z.current=!1):ee(ne)}},React.createElement(Popover.Root,{open:J,onOpenChange:ne=>{X(ne),Z.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Popover.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:["gap-2 text-2xl plb-1",U],disabled:_},React.createElement("span",{className:"sr-only"},q("select emoji label")),React.createElement(react.UserCircle,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},q("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),X(!1),Z.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(Y(ne),X(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0,theme:G}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:_})=>{const{tx:$}=useThemeContext(),I=20;return React.createElement("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`},React.createElement("rect",{x:0,y:0,width:I,height:I,className:$("hue.fill","select--hue__preview",{hue:_})}))},hueTokens=Object.keys(hueTokenThemes).slice(0,16),HuePickerToolbarButton=({disabled:_,hue:$,onChangeHue:I,classNames:j,defaultHue:U})=>{const{t:q}=useTranslation("os"),[G,K]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:$,onChange:I,defaultProp:U}),[Y,J]=React.useState(!1),X=React.useRef(!1),[Z,Q]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Z,onOpenChange:ee=>{X.current?(Q(!1),X.current=!1):Q(ee)}},React.createElement(DropdownMenu2.Root,{modal:!1,open:Y,onOpenChange:ee=>{J(ee),X.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",j),disabled:_},React.createElement("span",{className:"sr-only"},q("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},q("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu2.Content,{side:"bottom",classNames:"!w-40"},React.createElement(DropdownMenu2.Viewport,{classNames:"grid grid-cols-4"},hueTokens.map(ee=>React.createElement(DropdownMenu2.CheckboxItem,{key:ee,checked:ee===G,onCheckedChange:()=>K(ee),classNames:"px-0 py-2 items-center justify-center"},React.createElement(HuePreview,{hue:ee})))))))};var data={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},capitalize=_=>_.charAt(0).toUpperCase()+_.slice(1),generateName=_=>{const $=_.length*2/3,I=_.substring(0,$),j=_.substring($),U=capitalize(data.adjectives[parseInt(I,16)%data.adjectives.length]),q=capitalize(data.animals[parseInt(j,16)%data.animals.length]);return`${U} ${q}`};const IdentityListItem=React.forwardRef(({identity:_,presence:$,onClick:I,classNames:j,...U},q)=>{var J,X,Z,Q,ee;const G=keyToFallback(_.identityKey),K=useId("identityListItem__label"),Y=((J=_.profile)==null?void 0:J.displayName)??generateName(_.identityKey.toHex());return React.createElement(ListItem.Root,{...U,classNames:mx("flex gap-2 pis-3 pie-1 items-center",I&&"cursor-pointer",j),onClick:()=>I==null?void 0:I(),"data-testid":"identity-list-item",labelId:K,ref:q},React.createElement(Avatar.Root,{status:$===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:K,hue:((Z=(X=_.profile)==null?void 0:X.data)==null?void 0:Z.hue)||G.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ee=(Q=_.profile)==null?void 0:Q.data)==null?void 0:ee.emoji)||G.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},Y)))}),SpaceMemberList=({spaceKey:_,includeSelf:$,onSelect:I})=>{const j=reactClient.useClient(),U=echo.useMembers(_),q=React.useMemo(()=>$?U.sort(G=>G.identity.identityKey.equals(j.halo.identity.get().identityKey)?-1:1):U.filter(G=>!G.identity.identityKey.equals(j.halo.identity.get().identityKey)),[U]);return React.createElement(SpaceMemberListImpl,{members:q,onSelect:I})},SpaceMemberListImpl=({members:_,onSelect:$})=>{const{t:I}=useTranslation("os"),j=_.filter(U=>U.identity);return j.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},j.map(U=>React.createElement(IdentityListItem,{key:U.identity.identityKey.toHex(),identity:U.identity,presence:U.presence,onClick:$&&(()=>$(U))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},I("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:_,onClickAdd:$,onClickEdit:I,onClickReset:j,onClickJoinExisting:U,classNames:q,connectionState:G,onAgentDestroy:K,...Y},J)=>{var ie,oe;const{t:X}=useTranslation("os"),Z=keyToFallback(_.deviceKey),Q=useId("identityListItem__label"),ee=_.profile?X("device name placeholder",{os:_.profile.os,platform:_.profile.platform}):generateName(_.deviceKey.toHex()),ne=_.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...Y,classNames:["flex gap-2 items-center mlb-2",q],"data-testid":`device-list-item${ne?"-current":""}`,labelId:Q,ref:J},React.createElement(Avatar.Root,{status:ne&&G===mesh.ConnectionState.OFFLINE?"error":_.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:Q,hue:Z.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ie=_.profile)!=null&&ie.type?_.profile.type===halo.DeviceType.AGENT_MANAGED?React.createElement(react.Database,{...iconProps}):_.profile.type===halo.DeviceType.BROWSER?React.createElement(react.Compass,{...iconProps}):_.profile.type===halo.DeviceType.NATIVE?React.createElement(react.Desktop,{...iconProps}):[halo.DeviceType.AGENT,halo.DeviceType.AGENT_MANAGED].includes(_.profile.type)?React.createElement(react.Robot,{...iconProps}):_.profile.type===halo.DeviceType.MOBILE?React.createElement(react.DeviceMobile,{...iconProps}):React.createElement(react.Devices,{...iconProps}):React.createElement(Avatar.Fallback,{text:Z.emoji})),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ee),ne&&React.createElement(Tag,{color:"primary"},X("current device tag label")),((oe=_.profile)==null?void 0:oe.type)===halo.DeviceType.AGENT_MANAGED?React.createElement(Tooltip.Root,null,React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":"agent.destroy",onClick:K},React.createElement("span",{className:"sr-only"},X("destroy agent label")),React.createElement(react.Power,{className:getSize(5)}))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},X("destroy agent label")))):_.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu2.Root,null,React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${ne?"-current":""}.options`},React.createElement("span",{className:"sr-only"},X("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu2.Content,null,React.createElement(DropdownMenu2.Viewport,null,React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.join-existing",onClick:U},React.createElement(react.ShareFat,{className:getSize(5)}),X("choose join new identity label")),React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.reset",onClick:j},React.createElement(react.Power,{className:getSize(5)}),X("reset device label")))))))}),DeviceList=({devices:_,connectionState:$,onClickAdd:I,onClickEdit:j,onClickReset:U,onClickJoinExisting:q,onAgentDestroy:G})=>{const{t:K}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},K("devices heading")),_.length>0&&React.createElement(List,null,_.map(Y=>React.createElement(DeviceListItem,{key:Y.deviceKey.toHex(),device:Y,onClickEdit:()=>j==null?void 0:j(Y),onClickReset:U,onClickJoinExisting:q,connectionState:$,onAgentDestroy:G}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3 is-full","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm surface-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},K("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds(_){const $=toDate(_),I=new Date(Date.UTC($.getFullYear(),$.getMonth(),$.getDate(),$.getHours(),$.getMinutes(),$.getSeconds(),$.getMilliseconds()));return I.setUTCFullYear($.getFullYear()),+_-+I}function compareAsc(_,$){const I=toDate(_),j=toDate($),U=I.getTime()-j.getTime();return U<0?-1:U>0?1:U}function differenceInCalendarMonths(_,$){const I=toDate(_),j=toDate($),U=I.getFullYear()-j.getFullYear(),q=I.getMonth()-j.getMonth();return U*12+q}function getRoundingMethod(_){return $=>{const j=(_?Math[_]:Math.trunc)($);return j===0?0:j}}function differenceInMilliseconds(_,$){return+toDate(_)-+toDate($)}function endOfDay(_){const $=toDate(_);return $.setHours(23,59,59,999),$}function endOfMonth(_){const $=toDate(_),I=$.getMonth();return $.setFullYear($.getFullYear(),I+1,0),$.setHours(23,59,59,999),$}function isLastDayOfMonth(_){const $=toDate(_);return+endOfDay($)==+endOfMonth($)}function differenceInMonths(_,$){const I=toDate(_),j=toDate($),U=compareAsc(I,j),q=Math.abs(differenceInCalendarMonths(I,j));let G;if(q<1)G=0;else{I.getMonth()===1&&I.getDate()>27&&I.setDate(30),I.setMonth(I.getMonth()-U*q);let K=compareAsc(I,j)===-U;isLastDayOfMonth(toDate(_))&&q===1&&compareAsc(_,j)===1&&(K=!1),G=U*(q-Number(K))}return G===0?0:G}function differenceInSeconds(_,$,I){const j=differenceInMilliseconds(_,$)/1e3;return getRoundingMethod(I==null?void 0:I.roundingMethod)(j)}function formatDistance(_,$,I){const j=getDefaultOptions(),U=(I==null?void 0:I.locale)??j.locale??enUS$1,q=2520,G=compareAsc(_,$);if(isNaN(G))throw new RangeError("Invalid time value");const K=Object.assign({},I,{addSuffix:I==null?void 0:I.addSuffix,comparison:G});let Y,J;G>0?(Y=toDate($),J=toDate(_)):(Y=toDate(_),J=toDate($));const X=differenceInSeconds(J,Y),Z=(getTimezoneOffsetInMilliseconds(J)-getTimezoneOffsetInMilliseconds(Y))/1e3,Q=Math.round((X-Z)/60);let ee;if(Q<2)return I!=null&&I.includeSeconds?X<5?U.formatDistance("lessThanXSeconds",5,K):X<10?U.formatDistance("lessThanXSeconds",10,K):X<20?U.formatDistance("lessThanXSeconds",20,K):X<40?U.formatDistance("halfAMinute",0,K):X<60?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",1,K):Q===0?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",Q,K);if(Q<45)return U.formatDistance("xMinutes",Q,K);if(Q<90)return U.formatDistance("aboutXHours",1,K);if(Q<minutesInDay){const ne=Math.round(Q/60);return U.formatDistance("aboutXHours",ne,K)}else{if(Q<q)return U.formatDistance("xDays",1,K);if(Q<minutesInMonth){const ne=Math.round(Q/minutesInDay);return U.formatDistance("xDays",ne,K)}else if(Q<minutesInMonth*2)return ee=Math.round(Q/minutesInMonth),U.formatDistance("aboutXMonths",ee,K)}if(ee=differenceInMonths(J,Y),ee<12){const ne=Math.round(Q/minutesInMonth);return U.formatDistance("xMonths",ne,K)}else{const ne=ee%12,ie=Math.trunc(ee/12);return ne<3?U.formatDistance("aboutXYears",ie,K):ne<9?U.formatDistance("overXYears",ie,K):U.formatDistance("almostXYears",ie+1,K)}}function formatDistanceToNow(_,$){return formatDistance(_,Date.now(),$)}var LogLevel;(function(_){_[_.NONE=0]="NONE",_[_.TRACE=5]="TRACE",_[_.DEBUG=10]="DEBUG",_[_.INFO=11]="INFO",_[_.WARN=12]="WARN",_[_.ERROR=13]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function(_){(function($){$[$.NONE=0]="NONE",$[$.INCLUSIVE=1]="INCLUSIVE",$[$.EXPLICIT=2]="EXPLICIT"})(_.MatchingOptions||(_.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var SystemStatus;(function(_){_[_.ACTIVE=0]="ACTIVE",_[_.INACTIVE=1]="INACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function(_){(function($){$[$.NONE=0]="NONE",$[$.TRUNCATE=1]="TRUNCATE",$[$.HUMANIZE=2]="HUMANIZE"})(_.KEY_OPTION||(_.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function(_){(function($){$[$.BROWSER=0]="BROWSER",$[$.SHARED_WORKER=1]="SHARED_WORKER",$[$.NODE=2]="NODE"})(_.PLATFORM_TYPE||(_.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function(_){_[_.CURRENT=0]="CURRENT",_[_.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function(_){(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE",$[$.REMOVED=2]="REMOVED"})(_.PresenceState||(_.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function(_){(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(_.PresenceState||(_.PresenceState={}))})(SpaceMember||(SpaceMember={}));var CreateEpochRequest;(function(_){(function($){$[$.NONE=0]="NONE",$[$.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",$[$.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",$[$.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT",$[$.REPLACE_AUTOMERGE_ROOT=4]="REPLACE_AUTOMERGE_ROOT",$[$.MIGRATE_REFERENCES_TO_DXN=5]="MIGRATE_REFERENCES_TO_DXN"})(_.Migration||(_.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var QueryInvitationsResponse;(function(_){(function($){$[$.ADDED=0]="ADDED",$[$.REMOVED=1]="REMOVED",$[$.SAVED=2]="SAVED",$[$.LOAD_COMPLETE=3]="LOAD_COMPLETE"})(_.Action||(_.Action={})),function($){$[$.CREATED=0]="CREATED",$[$.ACCEPTED=1]="ACCEPTED"}(_.Type||(_.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState;(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE"})(ConnectionState||(ConnectionState={}));var SpaceState;(function(_){_[_.INVALID=0]="INVALID",_[_.SPACE_INACTIVE=2]="SPACE_INACTIVE",_[_.SPACE_ACTIVE=6]="SPACE_ACTIVE",_[_.SPACE_CLOSED=1]="SPACE_CLOSED",_[_.SPACE_CONTROL_ONLY=7]="SPACE_CONTROL_ONLY",_[_.SPACE_INITIALIZING=4]="SPACE_INITIALIZING",_[_.SPACE_READY=3]="SPACE_READY",_[_.SPACE_ERROR=5]="SPACE_ERROR",_[_.SPACE_REQUIRES_MIGRATION=8]="SPACE_REQUIRES_MIGRATION"})(SpaceState||(SpaceState={}));var Invitation;(function(_){(function($){$[$.INTERACTIVE=0]="INTERACTIVE",$[$.DELEGATED=1]="DELEGATED",$[$.MULTIUSE=2]="MULTIUSE"})(_.Type||(_.Type={})),function($){$[$.DEVICE=0]="DEVICE",$[$.SPACE=1]="SPACE"}(_.Kind||(_.Kind={})),function($){$[$.NONE=0]="NONE",$[$.SHARED_SECRET=1]="SHARED_SECRET",$[$.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}(_.AuthMethod||(_.AuthMethod={})),function($){$[$.INIT=0]="INIT",$[$.CONNECTING=1]="CONNECTING",$[$.CONNECTED=2]="CONNECTED",$[$.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",$[$.AUTHENTICATING=4]="AUTHENTICATING",$[$.SUCCESS=5]="SUCCESS",$[$.CANCELLED=6]="CANCELLED",$[$.TIMEOUT=7]="TIMEOUT",$[$.ERROR=8]="ERROR",$[$.EXPIRED=9]="EXPIRED"}(_.State||(_.State={}))})(Invitation||(Invitation={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$1(_,$,I,j){var U=arguments.length,q=U<3?$:j===null?j=Object.getOwnPropertyDescriptor($,I):j,G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(_,$,I,j);else for(var K=_.length-1;K>=0;K--)(G=_[K])&&(q=(U<3?G(q):U>3?G($,I,q):G($,I))||q);return U>3&&q&&Object.defineProperty($,I,q),q}var __dxlog_file$4="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,DEFAULT_ERROR_HANDLER=(_,$)=>{if(!(_ instanceof ContextDisposedError))throw $.dispose(),_},_a$1,_b,Context=(un=class{constructor($={},I){nn(this,wt,void 0);nn(this,Ct,void 0);nn(this,Mt,void 0);nn(this,Yt,void 0);nn(this,xn,void 0);nn(this,Jt,void 0);nn(this,rn,void 0);qt(this,wt,[]),qt(this,Ct,void 0),qt(this,Mt,void 0),qt(this,Jt,!1),qt(this,rn,void 0),this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_a$1]="Context",this[_b]=()=>this.toString(),qt(this,Ct,getContextName($,I)),qt(this,Mt,$.parent),qt(this,Yt,$.attributes??{}),qt(this,xn,$.onError??DEFAULT_ERROR_HANDLER)}static default(){return new un}get disposed(){return Ot(this,Jt)}get disposeCallbacksLength(){return Ot(this,wt).length}onDispose($){return Ot(this,Jt)&&(async()=>{try{await $()}catch(I){log$2.catch(I,{context:Ot(this,Ct)},{F:__dxlog_file$4,L:90,S:this,C:(j,U)=>j(...U)})}})(),Ot(this,wt).push($),Ot(this,wt).length>this.maxSafeDisposeCallbacks&&log$2.warn("Context has a large number of dispose callbacks (this might be a memory leak).",{context:Ot(this,Ct),count:Ot(this,wt).length},{F:__dxlog_file$4,L:97,S:this,C:(I,j)=>I(...j)}),()=>{const I=Ot(this,wt).indexOf($);I!==-1&&Ot(this,wt).splice(I,1)}}async dispose($=!1){if(Ot(this,rn))return Ot(this,rn);qt(this,Jt,!0);let I;const j=new Promise(Y=>{I=Y});qt(this,rn,j);const U=Array.from(Ot(this,wt)).reverse();Ot(this,wt).length=0;let q=0,G=!0;const K=[];for(const Y of U)try{await Y(),q++}catch(J){G=!1,$?K.push(J):log$2.catch(J,{context:Ot(this,Ct),callback:q,count:U.length},{F:__dxlog_file$4,L:156,S:this,C:(X,Z)=>X(...Z)})}if(K.length>0)throw new AggregateError(K);return I(G),G}raise($){if(!Ot(this,Jt))try{Ot(this,xn).call(this,$,this)}catch(I){Promise.reject(I)}}derive({onError:$,attributes:I}={}){const j=new un({onError:async q=>{if(!$)this.raise(q);else try{await $(q,this)}catch{this.raise(q)}},attributes:I}),U=this.onDispose(()=>j.dispose());return j.onDispose(U),j}getAttribute($){if($ in Ot(this,Yt))return Ot(this,Yt)[$];if(Ot(this,Mt))return Ot(this,Mt).getAttribute($)}toString(){return`Context(${Ot(this,Jt)?"disposed":"active"})`}async[(_a$1=Symbol.toStringTag,_b=export_inspect.custom,Symbol.asyncDispose)](){await this.dispose()}},wt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap,Yt=new WeakMap,xn=new WeakMap,Jt=new WeakMap,rn=new WeakMap,un);Context=_ts_decorate$1([safeInstanceof("Context")],Context);var getContextName=(_,$)=>{var I;if(_.name)return _.name;if((I=$==null?void 0:$.F)!=null&&I.length){const j=$==null?void 0:$.F.split("/");return`${j[j.length-1]}#${($==null?void 0:$.L)??0}`}},LifecycleState;(function(_){_.CLOSED="CLOSED",_.OPEN="OPEN",_.ERROR="ERROR"})(LifecycleState||(LifecycleState={}));var Observable$2={};Object.defineProperty(Observable$2,"__esModule",{value:!0}),Observable$2.Observable=void 0;const hasSymbol=_=>!!Symbol[_],getSymbol=_=>hasSymbol(_)?Symbol[_]:"@@"+_,SymbolIterator=getSymbol("iterator"),SymbolObservable=getSymbol("observable"),SymbolSpecies=getSymbol("species");function getMethod(_,$){let I=_[$];if(I!=null){if(typeof I!="function")throw new TypeError(I+" is not a function");return I}}function getSpecies(_){let $=_.constructor;return $!==void 0&&($=$[SymbolSpecies],$===null&&($=void 0)),$!==void 0?$:Observable$1}function isObservable$1(_){return _ instanceof Observable$1}function hostReportError(_){hostReportError.log?hostReportError.log(_):setTimeout(()=>{throw _})}function enqueue(_){Promise.resolve().then(()=>{try{_()}catch($){hostReportError($)}})}function cleanupSubscription(_){let $=_._cleanup;if($!==void 0&&(_._cleanup=void 0,!!$))try{if(typeof $=="function")$();else{let I=getMethod($,"unsubscribe");I&&I.call($)}}catch(I){hostReportError(I)}}function closeSubscription(_){_._observer=void 0,_._queue=void 0,_._state="closed"}function flushSubscription(_){let $=_._queue;if($){_._queue=void 0,_._state="ready";for(let I=0;I<$.length&&(notifySubscription(_,$[I].type,$[I].value),_._state!=="closed");++I);}}function notifySubscription(_,$,I){_._state="running";let j=_._observer;try{let U=getMethod(j,$);switch($){case"next":U&&U.call(j,I);break;case"error":if(closeSubscription(_),U)U.call(j,I);else throw I;break;case"complete":closeSubscription(_),U&&U.call(j);break}}catch(U){hostReportError(U)}_._state==="closed"?cleanupSubscription(_):_._state==="running"&&(_._state="ready")}function onNotify(_,$,I){if(_._state!=="closed"){if(_._state==="buffering"){_._queue.push({type:$,value:I});return}if(_._state!=="ready"){_._state="buffering",_._queue=[{type:$,value:I}],enqueue(()=>flushSubscription(_));return}notifySubscription(_,$,I)}}class Subscription{constructor($,I){this._cleanup=void 0,this._observer=$,this._queue=void 0,this._state="initializing";let j=this,U={get closed(){return j._state==="closed"},next(q){onNotify(j,"next",q)},error(q){onNotify(j,"error",q)},complete(){onNotify(j,"complete")}};try{this._cleanup=I.call(void 0,U)}catch(q){U.error(q)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class Kn{constructor($){if(!(this instanceof Kn))throw new TypeError("Observable cannot be called as a function");if(typeof $!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=$}subscribe($){return(typeof $!="object"||$===null)&&($={next:$,error:arguments[1],complete:arguments[2]}),new Subscription($,this._subscriber)}forEach($){return new Promise((I,j)=>{if(typeof $!="function"){j(new TypeError($+" is not a function"));return}function U(){q.unsubscribe(),I()}let q=this.subscribe({next(G){try{$(G,U)}catch(K){j(K),q.unsubscribe()}},error:j,complete:I})})}map($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{U=$(U)}catch(q){return j.error(q)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}filter($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{if(!$(U))return}catch(q){return j.error(q)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}reduce($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this),j=arguments.length>1,U=!1,G=arguments[1];return new I(K=>this.subscribe({next(Y){let J=!U;if(U=!0,!J||j)try{G=$(G,Y)}catch(X){return K.error(X)}else G=Y},error(Y){K.error(Y)},complete(){if(!U&&!j)return K.error(new TypeError("Cannot reduce an empty sequence"));K.next(G),K.complete()}}))}async all(){let $=[];return await this.forEach(I=>$.push(I)),$}concat(...$){let I=getSpecies(this);return new I(j=>{let U,q=0;function G(K){U=K.subscribe({next(Y){j.next(Y)},error(Y){j.error(Y)},complete(){q===$.length?(U=void 0,j.complete()):G(I.from($[q++]))}})}return G(this),()=>{U&&(U.unsubscribe(),U=void 0)}})}flatMap($){if(typeof $!="function")throw new TypeError($+" is not a function");let I=getSpecies(this);return new I(j=>{let U=[],q=this.subscribe({next(K){if($)try{K=$(K)}catch(J){return j.error(J)}let Y=I.from(K).subscribe({next(J){j.next(J)},error(J){j.error(J)},complete(){let J=U.indexOf(Y);J>=0&&U.splice(J,1),G()}});U.push(Y)},error(K){j.error(K)},complete(){G()}});function G(){q.closed&&U.length===0&&j.complete()}return()=>{U.forEach(K=>K.unsubscribe()),q.unsubscribe()}})}[SymbolObservable](){return this}static from($){let I=typeof this=="function"?this:Kn;if($==null)throw new TypeError($+" is not an object");let j=getMethod($,SymbolObservable);if(j){let U=j.call($);if(Object(U)!==U)throw new TypeError(U+" is not an object");return isObservable$1(U)&&U.constructor===I?U:new I(q=>U.subscribe(q))}if(hasSymbol("iterator")&&(j=getMethod($,SymbolIterator),j))return new I(U=>{enqueue(()=>{if(!U.closed){for(let q of j.call($))if(U.next(q),U.closed)return;U.complete()}})});if(Array.isArray($))return new I(U=>{enqueue(()=>{if(!U.closed){for(let q=0;q<$.length;++q)if(U.next($[q]),U.closed)return;U.complete()}})});throw new TypeError($+" is not observable")}static of(...$){let I=typeof this=="function"?this:Kn;return new I(j=>{enqueue(()=>{if(!j.closed){for(let U=0;U<$.length;++U)if(j.next($[U]),j.closed)return;j.complete()}})})}static get[SymbolSpecies](){return this}};Observable$2.Observable=Observable$1,Object.defineProperty(Observable$1,Symbol("extensions"),{value:{symbol:SymbolObservable,hostReportError},configurable:!0});var zenObservable=Observable$2.Observable;const Observable=getDefaultExportFromCjs(zenObservable);var readableBrowser={exports:{}},events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function($,I,j){return Function.prototype.apply.call($,I,j)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:ReflectOwnKeys=function($){return Object.getOwnPropertyNames($)};function ProcessEmitWarning(_){console&&console.warn&&console.warn(_)}var NumberIsNaN=Number.isNaN||function($){return $!==$};function EventEmitter$1(){EventEmitter$1.init.call(this)}events.exports=EventEmitter$1,events.exports.once=once$2,EventEmitter$1.EventEmitter=EventEmitter$1,EventEmitter$1.prototype._events=void 0,EventEmitter$1.prototype._eventsCount=0,EventEmitter$1.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(EventEmitter$1,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(_){if(typeof _!="number"||_<0||NumberIsNaN(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");defaultMaxListeners=_}}),EventEmitter$1.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter$1.prototype.setMaxListeners=function($){if(typeof $!="number"||$<0||NumberIsNaN($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this};function _getMaxListeners(_){return _._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:_._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function($){for(var I=[],j=1;j<arguments.length;j++)I.push(arguments[j]);var U=$==="error",q=this._events;if(q!==void 0)U=U&&q.error===void 0;else if(!U)return!1;if(U){var G;if(I.length>0&&(G=I[0]),G instanceof Error)throw G;var K=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw K.context=G,K}var Y=q[$];if(Y===void 0)return!1;if(typeof Y=="function")ReflectApply(Y,this,I);else for(var J=Y.length,X=arrayClone(Y,J),j=0;j<J;++j)ReflectApply(X[j],this,I);return!0};function _addListener(_,$,I,j){var U,q,G;if(checkListener(I),q=_._events,q===void 0?(q=_._events=Object.create(null),_._eventsCount=0):(q.newListener!==void 0&&(_.emit("newListener",$,I.listener?I.listener:I),q=_._events),G=q[$]),G===void 0)G=q[$]=I,++_._eventsCount;else if(typeof G=="function"?G=q[$]=j?[I,G]:[G,I]:j?G.unshift(I):G.push(I),U=_getMaxListeners(_),U>0&&G.length>U&&!G.warned){G.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=_,K.type=$,K.count=G.length,ProcessEmitWarning(K)}return _}EventEmitter$1.prototype.addListener=function($,I){return _addListener(this,$,I,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function($,I){return _addListener(this,$,I,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(_,$,I){var j={fired:!1,wrapFn:void 0,target:_,type:$,listener:I},U=onceWrapper.bind(j);return U.listener=I,j.wrapFn=U,U}EventEmitter$1.prototype.once=function($,I){return checkListener(I),this.on($,_onceWrap(this,$,I)),this},EventEmitter$1.prototype.prependOnceListener=function($,I){return checkListener(I),this.prependListener($,_onceWrap(this,$,I)),this},EventEmitter$1.prototype.removeListener=function($,I){var j,U,q,G,K;if(checkListener(I),U=this._events,U===void 0)return this;if(j=U[$],j===void 0)return this;if(j===I||j.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete U[$],U.removeListener&&this.emit("removeListener",$,j.listener||I));else if(typeof j!="function"){for(q=-1,G=j.length-1;G>=0;G--)if(j[G]===I||j[G].listener===I){K=j[G].listener,q=G;break}if(q<0)return this;q===0?j.shift():spliceOne(j,q),j.length===1&&(U[$]=j[0]),U.removeListener!==void 0&&this.emit("removeListener",$,K||I)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function($){var I,j,U;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[$]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[$]),this;if(arguments.length===0){var q=Object.keys(j),G;for(U=0;U<q.length;++U)G=q[U],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=j[$],typeof I=="function")this.removeListener($,I);else if(I!==void 0)for(U=I.length-1;U>=0;U--)this.removeListener($,I[U]);return this};function _listeners(_,$,I){var j=_._events;if(j===void 0)return[];var U=j[$];return U===void 0?[]:typeof U=="function"?I?[U.listener||U]:[U]:I?unwrapListeners(U):arrayClone(U,U.length)}EventEmitter$1.prototype.listeners=function($){return _listeners(this,$,!0)},EventEmitter$1.prototype.rawListeners=function($){return _listeners(this,$,!1)},EventEmitter$1.listenerCount=function(_,$){return typeof _.listenerCount=="function"?_.listenerCount($):listenerCount.call(_,$)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(_){var $=this._events;if($!==void 0){var I=$[_];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(_,$){for(var I=new Array($),j=0;j<$;++j)I[j]=_[j];return I}function spliceOne(_,$){for(;$+1<_.length;$++)_[$]=_[$+1];_.pop()}function unwrapListeners(_){for(var $=new Array(_.length),I=0;I<$.length;++I)$[I]=_[I].listener||_[I];return $}function once$2(_,$){return new Promise(function(I,j){function U(G){_.removeListener($,q),j(G)}function q(){typeof _.removeListener=="function"&&_.removeListener("error",U),I([].slice.call(arguments))}eventTargetAgnosticAddListener(_,$,q,{once:!0}),$!=="error"&&addErrorHandlerIfEventEmitter(_,U,{once:!0})})}function addErrorHandlerIfEventEmitter(_,$,I){typeof _.on=="function"&&eventTargetAgnosticAddListener(_,"error",$,I)}function eventTargetAgnosticAddListener(_,$,I,j){if(typeof _.on=="function")j.once?_.once($,I):_.on($,I);else if(typeof _.addEventListener=="function")_.addEventListener($,function U(q){j.once&&_.removeEventListener($,U),I(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}var eventsExports=events.exports,streamBrowser=eventsExports.EventEmitter,buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;revLookup[45]=62,revLookup[95]=63;function getLens(_){var $=_.length;if($%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=_.indexOf("=");I===-1&&(I=$);var j=I===$?0:4-I%4;return[I,j]}function byteLength(_){var $=getLens(_),I=$[0],j=$[1];return(I+j)*3/4-j}function _byteLength(_,$,I){return($+I)*3/4-I}function toByteArray(_){var $,I=getLens(_),j=I[0],U=I[1],q=new Arr(_byteLength(_,j,U)),G=0,K=U>0?j-4:j,Y;for(Y=0;Y<K;Y+=4)$=revLookup[_.charCodeAt(Y)]<<18|revLookup[_.charCodeAt(Y+1)]<<12|revLookup[_.charCodeAt(Y+2)]<<6|revLookup[_.charCodeAt(Y+3)],q[G++]=$>>16&255,q[G++]=$>>8&255,q[G++]=$&255;return U===2&&($=revLookup[_.charCodeAt(Y)]<<2|revLookup[_.charCodeAt(Y+1)]>>4,q[G++]=$&255),U===1&&($=revLookup[_.charCodeAt(Y)]<<10|revLookup[_.charCodeAt(Y+1)]<<4|revLookup[_.charCodeAt(Y+2)]>>2,q[G++]=$>>8&255,q[G++]=$&255),q}function tripletToBase64(_){return lookup[_>>18&63]+lookup[_>>12&63]+lookup[_>>6&63]+lookup[_&63]}function encodeChunk(_,$,I){for(var j,U=[],q=$;q<I;q+=3)j=(_[q]<<16&16711680)+(_[q+1]<<8&65280)+(_[q+2]&255),U.push(tripletToBase64(j));return U.join("")}function fromByteArray(_){for(var $,I=_.length,j=I%3,U=[],q=16383,G=0,K=I-j;G<K;G+=q)U.push(encodeChunk(_,G,G+q>K?K:G+q));return j===1?($=_[I-1],U.push(lookup[$>>2]+lookup[$<<4&63]+"==")):j===2&&($=(_[I-2]<<8)+_[I-1],U.push(lookup[$>>10]+lookup[$>>4&63]+lookup[$<<2&63]+"=")),U.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(_,$,I,j,U){var q,G,K=U*8-j-1,Y=(1<<K)-1,J=Y>>1,X=-7,Z=I?U-1:0,Q=I?-1:1,ee=_[$+Z];for(Z+=Q,q=ee&(1<<-X)-1,ee>>=-X,X+=K;X>0;q=q*256+_[$+Z],Z+=Q,X-=8);for(G=q&(1<<-X)-1,q>>=-X,X+=j;X>0;G=G*256+_[$+Z],Z+=Q,X-=8);if(q===0)q=1-J;else{if(q===Y)return G?NaN:(ee?-1:1)*(1/0);G=G+Math.pow(2,j),q=q-J}return(ee?-1:1)*G*Math.pow(2,q-j)},ieee754.write=function(_,$,I,j,U,q){var G,K,Y,J=q*8-U-1,X=(1<<J)-1,Z=X>>1,Q=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=j?0:q-1,ne=j?1:-1,ie=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(K=isNaN($)?1:0,G=X):(G=Math.floor(Math.log($)/Math.LN2),$*(Y=Math.pow(2,-G))<1&&(G--,Y*=2),G+Z>=1?$+=Q/Y:$+=Q*Math.pow(2,1-Z),$*Y>=2&&(G++,Y/=2),G+Z>=X?(K=0,G=X):G+Z>=1?(K=($*Y-1)*Math.pow(2,U),G=G+Z):(K=$*Math.pow(2,Z-1)*Math.pow(2,U),G=0));U>=8;_[I+ee]=K&255,ee+=ne,K/=256,U-=8);for(G=G<<U|K,J+=U;J>0;_[I+ee]=G&255,ee+=ne,G/=256,J-=8);_[I+ee-ne]|=ie*128};/*!
|
|
847
847
|
* The buffer module from node.js, for the browser.
|
|
848
848
|
*
|
|
849
849
|
* @author Feross Aboukhadijeh <https://feross.org>
|