@telepath-computer/television 0.1.208 → 0.1.210
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var hb=Object.defineProperty;var Jp=n=>{throw TypeError(n)};var db=(n,e,t)=>e in n?hb(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>db(n,typeof e!="symbol"?e+"":e,t),eh=(n,e,t)=>e.has(n)||Jp("Cannot "+t);var a=(n,e,t)=>(eh(n,e,"read from private field"),t?t.call(n):e.get(n)),v=(n,e,t)=>e.has(n)?Jp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),d=(n,e,t,r)=>(eh(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),h=(n,e,t)=>(eh(n,e,"access private method"),t);var th=(n,e,t,r)=>({set _(i){d(n,e,i,t)},get _(){return a(n,e,r)}});import{i as fb,a as pb,b as mb,c as gb,d as vb,e as yb,f as wb,U as bb,A as _b,g as Sb}from"./artifact-bridge-BXDhGuL-.js";import{m as Ab,a as kb,b as Eb}from"./missing-artifact-page-DVzJ41AE.js";var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $b(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Xp=Object.prototype.toString,i1=function(e){var t=Xp.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Xp.call(e.callee)==="[object Function]"),r},nh,Qp;function Cb(){if(Qp)return nh;Qp=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=i1,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(g){var y=g.constructor;return y&&y.prototype===g},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var g in window)try{if(!u["$"+g]&&e.call(window,g)&&window[g]!==null&&typeof window[g]=="object")try{c(window[g])}catch{return!0}}catch{return!0}return!1}(),m=function(g){if(typeof window>"u"||!f)return c(g);try{return c(g)}catch{return!1}};n=function(y){var k=y!==null&&typeof y=="object",A=t.call(y)==="[object Function]",x=r(y),M=k&&t.call(y)==="[object String]",Z=[];if(!k&&!A&&!x)throw new TypeError("Object.keys called on a non-object");var G=o&&A;if(M&&y.length>0&&!e.call(y,0))for(var F=0;F<y.length;++F)Z.push(String(F));if(x&&y.length>0)for(var W=0;W<y.length;++W)Z.push(String(W));else for(var re in y)!(G&&re==="prototype")&&e.call(y,re)&&Z.push(String(re));if(s)for(var Q=m(y),oe=0;oe<l.length;++oe)!(Q&&l[oe]==="constructor")&&e.call(y,l[oe])&&Z.push(l[oe]);return Z}}return nh=n,nh}var Tb=Array.prototype.slice,Rb=i1,e0=Object.keys,tc=e0?function(e){return e0(e)}:Cb(),t0=Object.keys;tc.shim=function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=function(r){return Rb(r)?t0(Tb.call(r)):t0(r)})}else Object.keys=tc;return Object.keys||tc};var Ib=tc,nc=Object.defineProperty||!1;if(nc)try{nc({},"a",{value:1})}catch{nc=!1}var ul=nc,Gn=SyntaxError,J=TypeError,xb=Object.getOwnPropertyDescriptor,rc=xb;if(rc)try{rc([],"length")}catch{rc=null}var io=rc,n0=ul,Pb=Gn,Ji=J,r0=io,s1=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Ji("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ji("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ji("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ji("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ji("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ji("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!r0&&r0(e,t);if(n0)n0(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(l||!i&&!s&&!o)e[t]=r;else throw new Pb("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wh=ul,o1=function(){return!!Wh};o1.hasArrayLengthDefineBug=function(){if(!Wh)return null;try{return Wh([],"length",{value:1}).length!==1}catch{return!0}};var yu=o1,Db=Ib,Lb=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Ob=Object.prototype.toString,zb=Array.prototype.concat,i0=s1,Nb=function(n){return typeof n=="function"&&Ob.call(n)==="[object Function]"},a1=yu(),Mb=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!Nb(r)||!r())return}a1?i0(n,e,t,!0):i0(n,e,t)},l1=function(n,e){var t=arguments.length>2?arguments[2]:{},r=Db(e);Lb&&(r=zb.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)Mb(n,r[i],e[r[i]],t[r[i]])};l1.supportsDescriptors=!!a1;var Fi=l1,ic={exports:{}};typeof self<"u"?ic.exports=self:typeof window<"u"?ic.exports=window:ic.exports=Function("return this")();var c1=ic.exports,Ub=c1,u1=function(){return typeof Wr!="object"||!Wr||Wr.Math!==Math||Wr.Array!==Array?Ub:Wr},Zb=Fi,Fb=io,Hb=u1,Vb=function(){var e=Hb();if(Zb.supportsDescriptors){var t=Fb(e,"globalThis");(!t||t.configurable&&(t.enumerable||!t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!0})}else(typeof globalThis!="object"||globalThis!==e)&&(e.globalThis=e);return e},Bb=Fi,jb=c1,h1=u1,qb=Vb,Wb=h1(),d1=function(){return Wb};Bb(d1,{getPolyfill:h1,implementation:jb,shim:qb});var $f=d1,Yn=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},Cf=Object,f1=Error,Gb=EvalError,Yb=RangeError,Tf=ReferenceError,Kb=URIError,Jb=Math.abs,Xb=Math.floor,Qb=Math.max,e_=Math.min,t_=Math.pow,n_=Math.round,Rf=Number.isNaN||function(e){return e!==e},r_=Rf,i_=function(e){return r_(e)||e===0?e:e<0?-1:1},so=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==i||l.enumerable!==!0)return!1}return!0},s0=typeof Symbol<"u"&&Symbol,s_=so,If=function(){return typeof s0!="function"||typeof Symbol!="function"||typeof s0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:s_()},p1=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,o_=Cf,m1=o_.getPrototypeOf||null,a_="Function.prototype.bind called on incompatible ",l_=Object.prototype.toString,c_=Math.max,u_="[object Function]",o0=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var s=0;s<t.length;s+=1)r[s+e.length]=t[s];return r},h_=function(e,t){for(var r=[],i=t,s=0;i<e.length;i+=1,s+=1)r[s]=e[i];return r},d_=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},f_=function(e){var t=this;if(typeof t!="function"||l_.apply(t)!==u_)throw new TypeError(a_+t);for(var r=h_(arguments,1),i,s=function(){if(this instanceof i){var f=t.apply(this,o0(r,arguments));return Object(f)===f?f:this}return t.apply(e,o0(r,arguments))},o=c_(0,t.length-r.length),l=[],c=0;c<o;c++)l[c]="$"+c;if(i=Function("binder","return function ("+d_(l,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var u=function(){};u.prototype=t.prototype,i.prototype=new u,u.prototype=null}return i},p_=f_,hl=Function.prototype.bind||p_,xf=Function.prototype.call,Pf=Function.prototype.apply,m_=typeof Reflect<"u"&&Reflect&&Reflect.apply,g_=hl,v_=Pf,y_=xf,w_=m_,g1=w_||g_.call(y_,v_),b_=hl,__=J,S_=xf,A_=g1,wu=function(e){if(e.length<1||typeof e[0]!="function")throw new __("a function is required");return A_(b_,S_,e)},k_=wu,a0=io,v1;try{v1=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var rh=!!v1&&a0&&a0(Object.prototype,"__proto__"),y1=Object,l0=y1.getPrototypeOf,E_=rh&&typeof rh.get=="function"?k_([rh.get]):typeof l0=="function"?function(e){return l0(e==null?e:y1(e))}:!1,c0=p1,u0=m1,h0=E_,w1=c0?function(e){return c0(e)}:u0?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return u0(e)}:h0?function(e){return h0(e)}:null,$_=Function.prototype.call,C_=Object.prototype.hasOwnProperty,T_=hl,Kn=T_.call($_,C_),K,R_=Cf,I_=f1,x_=Gb,P_=Yb,D_=Tf,Xs=Gn,ms=J,L_=Kb,O_=Jb,z_=Xb,N_=Qb,M_=e_,U_=t_,Z_=n_,F_=i_,b1=Function,ih=function(n){try{return b1('"use strict"; return ('+n+").constructor;")()}catch{}},ia=io,H_=ul,sh=function(){throw new ms},V_=ia?function(){try{return arguments.callee,sh}catch{try{return ia(arguments,"callee").get}catch{return sh}}}():sh,Xi=If(),Re=w1,B_=m1,j_=p1,_1=Pf,dl=xf,rs={},q_=typeof Uint8Array>"u"||!Re?K:Re(Uint8Array),zi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":Xi&&Re?Re([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":rs,"%AsyncGenerator%":rs,"%AsyncGeneratorFunction%":rs,"%AsyncIteratorPrototype%":rs,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":I_,"%eval%":eval,"%EvalError%":x_,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":b1,"%GeneratorFunction%":rs,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xi&&Re?Re(Re([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xi||!Re?K:Re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":R_,"%Object.getOwnPropertyDescriptor%":ia,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":P_,"%ReferenceError%":D_,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xi||!Re?K:Re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xi&&Re?Re(""[Symbol.iterator]()):K,"%Symbol%":Xi?Symbol:K,"%SyntaxError%":Xs,"%ThrowTypeError%":V_,"%TypedArray%":q_,"%TypeError%":ms,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":L_,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":dl,"%Function.prototype.apply%":_1,"%Object.defineProperty%":H_,"%Object.getPrototypeOf%":B_,"%Math.abs%":O_,"%Math.floor%":z_,"%Math.max%":N_,"%Math.min%":M_,"%Math.pow%":U_,"%Math.round%":Z_,"%Math.sign%":F_,"%Reflect.getPrototypeOf%":j_};if(Re)try{null.error}catch(n){var W_=Re(Re(n));zi["%Error.prototype%"]=W_}var G_=function n(e){var t;if(e==="%AsyncFunction%")t=ih("async function () {}");else if(e==="%GeneratorFunction%")t=ih("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=ih("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Re&&(t=Re(i.prototype))}return zi[e]=t,t},d0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},fl=hl,Dc=Kn,Y_=fl.call(dl,Array.prototype.concat),K_=fl.call(_1,Array.prototype.splice),f0=fl.call(dl,String.prototype.replace),Lc=fl.call(dl,String.prototype.slice),J_=fl.call(dl,RegExp.prototype.exec),X_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q_=/\\(\\)?/g,eS=function(e){var t=Lc(e,0,1),r=Lc(e,-1);if(t==="%"&&r!=="%")throw new Xs("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new Xs("invalid intrinsic syntax, expected opening `%`");var i=[];return f0(e,X_,function(s,o,l,c){i[i.length]=l?f0(c,Q_,"$1"):o||s}),i},tS=function(e,t){var r=e,i;if(Dc(d0,r)&&(i=d0[r],r="%"+i[0]+"%"),Dc(zi,r)){var s=zi[r];if(s===rs&&(s=G_(r)),typeof s>"u"&&!t)throw new ms("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Xs("intrinsic "+e+" does not exist!")},_t=function(e,t){if(typeof e!="string"||e.length===0)throw new ms("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ms('"allowMissing" argument must be a boolean');if(J_(/^%?[^%]*%?$/,e)===null)throw new Xs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=eS(e),i=r.length>0?r[0]:"",s=tS("%"+i+"%",t),o=s.name,l=s.value,c=!1,u=s.alias;u&&(i=u[0],K_(r,Y_([0,1],u)));for(var f=1,m=!0;f<r.length;f+=1){var g=r[f],y=Lc(g,0,1),k=Lc(g,-1);if((y==='"'||y==="'"||y==="`"||k==='"'||k==="'"||k==="`")&&y!==k)throw new Xs("property names with quotes must have matching quotes");if((g==="constructor"||!m)&&(c=!0),i+="."+g,o="%"+i+"%",Dc(zi,o))l=zi[o];else if(l!=null){if(!(g in l)){if(!t)throw new ms("base intrinsic for "+e+" exists, but the property is not available.");return}if(ia&&f+1>=r.length){var A=ia(l,g);m=!!A,m&&"get"in A&&!("originalValue"in A.get)?l=A.get:l=l[g]}else m=Dc(l,g),l=l[g];m&&!c&&(zi[o]=l)}}return l},oh,p0;function Lr(){if(p0)return oh;p0=1;var n=_t,e=wu,t=e([n("%String.prototype.indexOf%")]);return oh=function(i,s){var o=n(i,!!s);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},oh}var ah,m0;function Df(){if(m0)return ah;m0=1;var n=_t,e=n("%Array%"),t=!e.isArray&&Lr()("Object.prototype.toString");return ah=e.isArray||function(i){return t(i)==="[object Array]"},ah}var nS=yu,g0=ul,S1=nS.hasArrayLengthDefineBug(),rS=S1&&Df(),iS=Lr(),sS=iS("Object.prototype.propertyIsEnumerable"),Lf=function(e,t,r,i,s,o){if(!g0){if(!e(o)||!o["[[Configurable]]"]||!o["[[Writable]]"]||s in i&&sS(i,s)!==!!o["[[Enumerable]]"])return!1;var l=o["[[Value]]"];return i[s]=l,t(i[s],l)}return S1&&s==="length"&&"[[Value]]"in o&&rS(i)&&i.length!==o["[[Value]]"]?(i.length=o["[[Value]]"],i.length===o["[[Value]]"]):(g0(i,s,r(o)),!0)},oS=J,_o=Kn,aS={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},oo=function(e){if(!e||typeof e!="object")return!1;for(var t in e)if(_o(e,t)&&!aS[t])return!1;var r=_o(e,"[[Value]]")||_o(e,"[[Writable]]"),i=_o(e,"[[Get]]")||_o(e,"[[Set]]");if(r&&i)throw new oS("Property Descriptors may not be both accessor and data descriptors");return!0},A1=function(e){if(typeof e>"u")return e;var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=!!e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=!!e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=!!e["[[Configurable]]"]),t},lS=J,cS=oo,uS=A1,k1=function(e){if(typeof e<"u"&&!cS(e))throw new lS("Assertion failed: `Desc` must be a Property Descriptor");return uS(e)},hS=J,v0=Kn,dS=oo,E1=function(e){if(typeof e>"u")return!1;if(!dS(e))throw new hS("Assertion failed: `Desc` must be a Property Descriptor");return!(!v0(e,"[[Value]]")&&!v0(e,"[[Writable]]"))},ao=function(e){return typeof e=="string"||typeof e=="symbol"},y0=Rf,$1=function(e,t){return e===t?e===0?1/e===1/t:!0:y0(e)&&y0(t)},w0=J,fS=Yn,pS=Lf,mS=k1,gS=E1,vS=ao,yS=$1,Of=function(e,t,r){if(!fS(e))throw new w0("Assertion failed: Type(O) is not Object");if(!vS(t))throw new w0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return pS(gS,yS,mS,e,t,i)},C1=Function.prototype.toString,hs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Gh,sc;if(typeof hs=="function"&&typeof Object.defineProperty=="function")try{Gh=Object.defineProperty({},"length",{get:function(){throw sc}}),sc={},hs(function(){throw 42},null,Gh)}catch(n){n!==sc&&(hs=null)}else hs=null;var wS=/^\s*class\b/,Yh=function(e){try{var t=C1.call(e);return wS.test(t)}catch{return!1}},lh=function(e){try{return Yh(e)?!1:(C1.call(e),!0)}catch{return!1}},oc=Object.prototype.toString,bS="[object Object]",_S="[object Function]",SS="[object GeneratorFunction]",AS="[object HTMLAllCollection]",kS="[object HTML document.all class]",ES="[object HTMLCollection]",$S=typeof Symbol=="function"&&!!Symbol.toStringTag,CS=!(0 in[,]),Kh=function(){return!1};if(typeof document=="object"){var TS=document.all;oc.call(TS)===oc.call(document.all)&&(Kh=function(e){if((CS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=oc.call(e);return(t===AS||t===kS||t===ES||t===bS)&&e("")==null}catch{}return!1})}var T1=hs?function(e){if(Kh(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{hs(e,null,Gh)}catch(t){if(t!==sc)return!1}return!Yh(e)&&lh(e)}:function(e){if(Kh(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if($S)return lh(e);if(Yh(e))return!1;var t=oc.call(e);return t!==_S&&t!==SS&&!/^\[object HTML/.test(t)?!1:lh(e)},RS=T1,IS=function(e){return!!e},Mt=Kn,Pl=J,xS=Yn,b0=RS,ch=IS,PS=function(e){if(!xS(e))throw new Pl("ToPropertyDescriptor requires an object");var t={};if(Mt(e,"enumerable")&&(t["[[Enumerable]]"]=ch(e.enumerable)),Mt(e,"configurable")&&(t["[[Configurable]]"]=ch(e.configurable)),Mt(e,"value")&&(t["[[Value]]"]=e.value),Mt(e,"writable")&&(t["[[Writable]]"]=ch(e.writable)),Mt(e,"get")){var r=e.get;if(typeof r<"u"&&!b0(r))throw new Pl("getter must be a function");t["[[Get]]"]=r}if(Mt(e,"set")){var i=e.set;if(typeof i<"u"&&!b0(i))throw new Pl("setter must be a function");t["[[Set]]"]=i}if((Mt(t,"[[Get]]")||Mt(t,"[[Set]]"))&&(Mt(t,"[[Value]]")||Mt(t,"[[Writable]]")))throw new Pl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},uh=J,DS=Yn,_0=oo,LS=Lf,OS=k1,zS=E1,NS=ao,MS=$1,US=PS,ZS=function(e,t,r){if(!DS(e))throw new uh("Assertion failed: Type(O) is not Object");if(!NS(t))throw new uh("Assertion failed: P is not a Property Key");var i=_0(r)?r:US(r);if(!_0(i))throw new uh("Assertion failed: Desc is not a valid Property Descriptor");return LS(zS,MS,OS,e,t,i)},S0=J,FS=Yn,HS=ZS,VS=ao,BS=function(e,t,r){if(!FS(e))throw new S0("Assertion failed: Type(O) is not Object");if(!VS(t))throw new S0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return HS(e,t,i)},jS=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,qS=Cf,WS=qS.setPrototypeOf||null,GS=wu,A0=io,YS=J,R1={};try{R1.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var KS=!("toString"in R1),hh=A0&&A0(Object.prototype,"__proto__"),JS=KS&&(!!hh&&typeof hh.set=="function"&&GS([hh.set])||function(e,t){if(e==null)throw new YS("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),k0=jS,XS=WS,E0=JS,QS=J,e8=k0?function(e,t){if(k0(e,t))return e;throw new QS("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:XS||(E0?function(e,t){return E0(e,t),e}:null),$0=J,t8=Yn,C0=w1,n8=function(e){if(!t8(e))throw new $0("Assertion failed: O must be an Object");if(!C0)throw new $0("This environment does not support fetching prototypes.");return C0(e)},r8=J,i8=e8,s8=Yn,o8=n8,a8=function(e,t){if(t!==null&&!s8(t))throw new r8("Assertion failed: V must be Object or Null");try{i8(e,t)}catch{return!1}return o8(e)===t},dh=Of,T0=BS,I1=a8,l8=yu(),zf=f1;function pl(n,e,t){var r=new zf(t);return I1(r,ac),delete r.constructor,T0(r,"error",n),T0(r,"suppressed",e),r}l8&&Object.defineProperty(pl,"prototype",{writable:!1});var ac=pl.prototype;if(!dh(ac,"constructor",pl)||!dh(ac,"message","")||!dh(ac,"name","SuppressedError"))throw new zf("unable to install SuppressedError.prototype properties; please report this!");I1(pl.prototype,zf.prototype);var c8=pl,u8=c8,x1=function(){return typeof SuppressedError=="function"?SuppressedError:u8},h8=Fi,R0=$f(),d8=x1,f8=function(){var e=d8();return h8(R0,{SuppressedError:e},{SuppressedError:function(){return R0.SuppressedError!==e}}),e};f8();var p8=J,m8=oo,g8=A1,v8=function(e){if(typeof e<"u"&&!m8(e))throw new p8("Assertion failed: `Desc` must be a Property Descriptor");return g8(e)},y8=J,I0=Kn,w8=oo,b8=function(e){if(typeof e>"u")return!1;if(!w8(e))throw new y8("Assertion failed: `Desc` must be a Property Descriptor");return!(!I0(e,"[[Value]]")&&!I0(e,"[[Writable]]"))},x0=Rf,_8=function(e,t){return e===t?e===0?1/e===1/t:!0:x0(e)&&x0(t)},lo=T1,S8=function(e){return!!e},Ut=Kn,Dl=J,A8=Yn,P0=lo,fh=S8,k8=function(e){if(!A8(e))throw new Dl("ToPropertyDescriptor requires an object");var t={};if(Ut(e,"enumerable")&&(t["[[Enumerable]]"]=fh(e.enumerable)),Ut(e,"configurable")&&(t["[[Configurable]]"]=fh(e.configurable)),Ut(e,"value")&&(t["[[Value]]"]=e.value),Ut(e,"writable")&&(t["[[Writable]]"]=fh(e.writable)),Ut(e,"get")){var r=e.get;if(typeof r<"u"&&!P0(r))throw new Dl("getter must be a function");t["[[Get]]"]=r}if(Ut(e,"set")){var i=e.set;if(typeof i<"u"&&!P0(i))throw new Dl("setter must be a function");t["[[Set]]"]=i}if((Ut(t,"[[Get]]")||Ut(t,"[[Set]]"))&&(Ut(t,"[[Value]]")||Ut(t,"[[Writable]]")))throw new Dl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},ph=J,E8=Yn,D0=oo,$8=Lf,C8=v8,T8=b8,R8=ao,I8=_8,x8=k8,ml=function(e,t,r){if(!E8(e))throw new ph("Assertion failed: Type(O) is not Object");if(!R8(t))throw new ph("Assertion failed: P is not a Property Key");var i=D0(r)?r:x8(r);if(!D0(i))throw new ph("Assertion failed: Desc is not a valid Property Descriptor");return $8(T8,I8,C8,e,t,i)},P8=so(),D8=P8?Symbol.dispose||Symbol("Symbol.dispose"):null,L8=so,O8=D8,Nf=function(){return L8()&&Symbol.dispose||O8},z8=If,N8=ml,M8=Nf,U8=function(){var e=M8();return z8()&&N8(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},Z8=so(),F8=Z8?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,H8=so,V8=F8,Mf=function(){return H8()&&Symbol.asyncDispose||V8},B8=If,j8=ml,q8=Mf,W8=function(){var e=q8();return B8()&&j8(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},G8=Df(),Y8=_t,K8=Lr(),J8=J,X8=G8,Q8=Y8("%Reflect.apply%",!0)||K8("Function.prototype.apply"),bu=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!X8(r))throw new J8("Assertion failed: optional `argumentsList`, if provided, must be a List");return Q8(e,t,r)};const e6={},t6=Object.freeze(Object.defineProperty({__proto__:null,default:e6},Symbol.toStringTag,{value:"Module"})),n6=$b(t6);var Uf=typeof Map=="function"&&Map.prototype,mh=Object.getOwnPropertyDescriptor&&Uf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Oc=Uf&&mh&&typeof mh.get=="function"?mh.get:null,L0=Uf&&Map.prototype.forEach,Zf=typeof Set=="function"&&Set.prototype,gh=Object.getOwnPropertyDescriptor&&Zf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zc=Zf&&gh&&typeof gh.get=="function"?gh.get:null,O0=Zf&&Set.prototype.forEach,r6=typeof WeakMap=="function"&&WeakMap.prototype,Xo=r6?WeakMap.prototype.has:null,i6=typeof WeakSet=="function"&&WeakSet.prototype,Qo=i6?WeakSet.prototype.has:null,s6=typeof WeakRef=="function"&&WeakRef.prototype,z0=s6?WeakRef.prototype.deref:null,o6=Boolean.prototype.valueOf,a6=Object.prototype.toString,l6=Function.prototype.toString,c6=String.prototype.match,Ff=String.prototype.slice,$r=String.prototype.replace,u6=String.prototype.toUpperCase,N0=String.prototype.toLowerCase,P1=RegExp.prototype.test,M0=Array.prototype.concat,pn=Array.prototype.join,h6=Array.prototype.slice,U0=Math.floor,Jh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vh=Object.getOwnPropertySymbols,Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ea=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qs||!0)?Symbol.toStringTag:null,D1=Object.prototype.propertyIsEnumerable,Z0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function F0(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||P1.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-U0(-n):U0(n);if(r!==n){var i=String(r),s=Ff.call(e,i.length+1);return $r.call(i,t,"$&_")+"."+$r.call($r.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $r.call(e,t,"$&_")}var Qh=n6,H0=Qh.custom,V0=z1(H0)?H0:null,L1={__proto__:null,double:'"',single:"'"},d6={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},co=function n(e,t,r,i){var s=t||{};if(Cn(s,"quoteStyle")&&!Cn(L1,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Cn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Cn(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Cn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Cn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return M1(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?F0(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return l?F0(e,u):u}var f=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return ed(e)?"[Array]":"[Object]";var m=I6(s,r);if(typeof i>"u")i=[];else if(N1(i,e)>=0)return"[Circular]";function g(Ot,Jn,Hu){if(Jn&&(i=h6.call(i),i.push(Jn)),Hu){var Al={depth:s.depth};return Cn(s,"quoteStyle")&&(Al.quoteStyle=s.quoteStyle),n(Ot,Al,r+1,i)}return n(Ot,s,r+1,i)}if(typeof e=="function"&&!B0(e)){var y=_6(e),k=Ll(e,g);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(k.length>0?" { "+pn.call(k,", ")+" }":"")}if(z1(e)){var A=Qs?$r.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Xh.call(e);return typeof e=="object"&&!Qs?So(A):A}if(C6(e)){for(var x="<"+N0.call(String(e.nodeName)),M=e.attributes||[],Z=0;Z<M.length;Z++)x+=" "+M[Z].name+"="+O1(f6(M[Z].value),"double",s);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+N0.call(String(e.nodeName))+">",x}if(ed(e)){if(e.length===0)return"[]";var G=Ll(e,g);return m&&!R6(G)?"["+td(G,m)+"]":"[ "+pn.call(G,", ")+" ]"}if(m6(e)){var F=Ll(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!D1.call(e,"cause")?"{ ["+String(e)+"] "+pn.call(M0.call("[cause]: "+g(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+pn.call(F,", ")+" }"}if(typeof e=="object"&&o){if(V0&&typeof e[V0]=="function"&&Qh)return Qh(e,{depth:f-r});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(S6(e)){var W=[];return L0&&L0.call(e,function(Ot,Jn){W.push(g(Jn,e,!0)+" => "+g(Ot,e))}),j0("Map",Oc.call(e),W,m)}if(E6(e)){var re=[];return O0&&O0.call(e,function(Ot){re.push(g(Ot,e))}),j0("Set",zc.call(e),re,m)}if(A6(e))return yh("WeakMap");if($6(e))return yh("WeakSet");if(k6(e))return yh("WeakRef");if(v6(e))return So(g(Number(e)));if(w6(e))return So(g(Jh.call(e)));if(y6(e))return So(o6.call(e));if(g6(e))return So(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Wr<"u"&&e===Wr)return"{ [object globalThis] }";if(!p6(e)&&!B0(e)){var Q=Ll(e,g),oe=Z0?Z0(e)===Object.prototype:e instanceof Object||e.constructor===Object,vn=e instanceof Object?"":"null prototype",yn=!oe&&ea&&Object(e)===e&&ea in e?Ff.call(Or(e),8,-1):vn?"Object":"",we=oe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",wn=we+(yn||vn?"["+pn.call(M0.call([],yn||[],vn||[]),": ")+"] ":"");return Q.length===0?wn+"{}":m?wn+"{"+td(Q,m)+"}":wn+"{ "+pn.call(Q,", ")+" }"}return String(e)};function O1(n,e,t){var r=t.quoteStyle||e,i=L1[r];return i+n+i}function f6(n){return $r.call(String(n),/"/g,""")}function Hi(n){return!ea||!(typeof n=="object"&&(ea in n||typeof n[ea]<"u"))}function ed(n){return Or(n)==="[object Array]"&&Hi(n)}function p6(n){return Or(n)==="[object Date]"&&Hi(n)}function B0(n){return Or(n)==="[object RegExp]"&&Hi(n)}function m6(n){return Or(n)==="[object Error]"&&Hi(n)}function g6(n){return Or(n)==="[object String]"&&Hi(n)}function v6(n){return Or(n)==="[object Number]"&&Hi(n)}function y6(n){return Or(n)==="[object Boolean]"&&Hi(n)}function z1(n){if(Qs)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Xh)return!1;try{return Xh.call(n),!0}catch{}return!1}function w6(n){if(!n||typeof n!="object"||!Jh)return!1;try{return Jh.call(n),!0}catch{}return!1}var b6=Object.prototype.hasOwnProperty||function(n){return n in this};function Cn(n,e){return b6.call(n,e)}function Or(n){return a6.call(n)}function _6(n){if(n.name)return n.name;var e=c6.call(l6.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function N1(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function S6(n){if(!Oc||!n||typeof n!="object")return!1;try{Oc.call(n);try{zc.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function A6(n){if(!Xo||!n||typeof n!="object")return!1;try{Xo.call(n,Xo);try{Qo.call(n,Qo)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function k6(n){if(!z0||!n||typeof n!="object")return!1;try{return z0.call(n),!0}catch{}return!1}function E6(n){if(!zc||!n||typeof n!="object")return!1;try{zc.call(n);try{Oc.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function $6(n){if(!Qo||!n||typeof n!="object")return!1;try{Qo.call(n,Qo);try{Xo.call(n,Xo)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function C6(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function M1(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return M1(Ff.call(n,0,e.maxStringLength),e)+r}var i=d6[e.quoteStyle||"single"];i.lastIndex=0;var s=$r.call($r.call(n,i,"\\$1"),/[\x00-\x1f]/g,T6);return O1(s,"single",e)}function T6(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+u6.call(e.toString(16))}function So(n){return"Object("+n+")"}function yh(n){return n+" { ? }"}function j0(n,e,t,r){var i=r?td(t,r):pn.call(t,", ");return n+" ("+e+") {"+i+"}"}function R6(n){for(var e=0;e<n.length;e++)if(N1(n[e],`
|
|
2
|
-
`)>=0)return!1;return!0}function
|
|
1
|
+
var vb=Object.defineProperty;var t0=n=>{throw TypeError(n)};var yb=(n,e,t)=>e in n?vb(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>yb(n,typeof e!="symbol"?e+"":e,t),nh=(n,e,t)=>e.has(n)||t0("Cannot "+t);var a=(n,e,t)=>(nh(n,e,"read from private field"),t?t.call(n):e.get(n)),g=(n,e,t)=>e.has(n)?t0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),d=(n,e,t,r)=>(nh(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),h=(n,e,t)=>(nh(n,e,"access private method"),t);var rh=(n,e,t,r)=>({set _(i){d(n,e,i,t)},get _(){return a(n,e,r)}});import{i as wb,a as bb,b as _b,c as Sb,d as Ab,e as kb,f as Eb,U as $b,A as Cb,g as Tb}from"./artifact-bridge-BXDhGuL-.js";import{m as Rb,a as Ib,b as xb}from"./missing-artifact-page-DVzJ41AE.js";var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pb(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var n0=Object.prototype.toString,u1=function(e){var t=n0.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&n0.call(e.callee)==="[object Function]"),r},ih,r0;function Db(){if(r0)return ih;r0=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=u1,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(v){var y=v.constructor;return y&&y.prototype===v},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var v in window)try{if(!u["$"+v]&&e.call(window,v)&&window[v]!==null&&typeof window[v]=="object")try{c(window[v])}catch{return!0}}catch{return!0}return!1}(),m=function(v){if(typeof window>"u"||!f)return c(v);try{return c(v)}catch{return!1}};n=function(y){var k=y!==null&&typeof y=="object",S=t.call(y)==="[object Function]",x=r(y),M=k&&t.call(y)==="[object String]",Z=[];if(!k&&!S&&!x)throw new TypeError("Object.keys called on a non-object");var G=o&&S;if(M&&y.length>0&&!e.call(y,0))for(var F=0;F<y.length;++F)Z.push(String(F));if(x&&y.length>0)for(var W=0;W<y.length;++W)Z.push(String(W));else for(var re in y)!(G&&re==="prototype")&&e.call(y,re)&&Z.push(String(re));if(s)for(var Q=m(y),oe=0;oe<l.length;++oe)!(Q&&l[oe]==="constructor")&&e.call(y,l[oe])&&Z.push(l[oe]);return Z}}return ih=n,ih}var Lb=Array.prototype.slice,Ob=u1,i0=Object.keys,rc=i0?function(e){return i0(e)}:Db(),s0=Object.keys;rc.shim=function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=function(r){return Ob(r)?s0(Lb.call(r)):s0(r)})}else Object.keys=rc;return Object.keys||rc};var zb=rc,ic=Object.defineProperty||!1;if(ic)try{ic({},"a",{value:1})}catch{ic=!1}var dl=ic,Gn=SyntaxError,J=TypeError,Nb=Object.getOwnPropertyDescriptor,sc=Nb;if(sc)try{sc([],"length")}catch{sc=null}var so=sc,o0=dl,Mb=Gn,Ji=J,a0=so,h1=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Ji("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ji("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ji("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ji("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ji("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ji("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!a0&&a0(e,t);if(o0)o0(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(l||!i&&!s&&!o)e[t]=r;else throw new Mb("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Jh=dl,d1=function(){return!!Jh};d1.hasArrayLengthDefineBug=function(){if(!Jh)return null;try{return Jh([],"length",{value:1}).length!==1}catch{return!0}};var bu=d1,Ub=zb,Zb=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Fb=Object.prototype.toString,Hb=Array.prototype.concat,l0=h1,Vb=function(n){return typeof n=="function"&&Fb.call(n)==="[object Function]"},f1=bu(),Bb=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!Vb(r)||!r())return}f1?l0(n,e,t,!0):l0(n,e,t)},p1=function(n,e){var t=arguments.length>2?arguments[2]:{},r=Ub(e);Zb&&(r=Hb.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)Bb(n,r[i],e[r[i]],t[r[i]])};p1.supportsDescriptors=!!f1;var Fi=p1,oc={exports:{}};typeof self<"u"?oc.exports=self:typeof window<"u"?oc.exports=window:oc.exports=Function("return this")();var m1=oc.exports,qb=m1,g1=function(){return typeof Wr!="object"||!Wr||Wr.Math!==Math||Wr.Array!==Array?qb:Wr},jb=Fi,Wb=so,Gb=g1,Yb=function(){var e=Gb();if(jb.supportsDescriptors){var t=Wb(e,"globalThis");(!t||t.configurable&&(t.enumerable||!t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!0})}else(typeof globalThis!="object"||globalThis!==e)&&(e.globalThis=e);return e},Kb=Fi,Jb=m1,v1=g1,Xb=Yb,Qb=v1(),y1=function(){return Qb};Kb(y1,{getPolyfill:v1,implementation:Jb,shim:Xb});var If=y1,Yn=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},xf=Object,w1=Error,e_=EvalError,t_=RangeError,Pf=ReferenceError,n_=URIError,r_=Math.abs,i_=Math.floor,s_=Math.max,o_=Math.min,a_=Math.pow,l_=Math.round,Df=Number.isNaN||function(e){return e!==e},c_=Df,u_=function(e){return c_(e)||e===0?e:e<0?-1:1},oo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==i||l.enumerable!==!0)return!1}return!0},c0=typeof Symbol<"u"&&Symbol,h_=oo,Lf=function(){return typeof c0!="function"||typeof Symbol!="function"||typeof c0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h_()},sh,u0;function b1(){return u0||(u0=1,sh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),sh}var oh,h0;function _1(){if(h0)return oh;h0=1;var n=xf;return oh=n.getPrototypeOf||null,oh}var d_="Function.prototype.bind called on incompatible ",f_=Object.prototype.toString,p_=Math.max,m_="[object Function]",d0=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var s=0;s<t.length;s+=1)r[s+e.length]=t[s];return r},g_=function(e,t){for(var r=[],i=t,s=0;i<e.length;i+=1,s+=1)r[s]=e[i];return r},v_=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},y_=function(e){var t=this;if(typeof t!="function"||f_.apply(t)!==m_)throw new TypeError(d_+t);for(var r=g_(arguments,1),i,s=function(){if(this instanceof i){var f=t.apply(this,d0(r,arguments));return Object(f)===f?f:this}return t.apply(e,d0(r,arguments))},o=p_(0,t.length-r.length),l=[],c=0;c<o;c++)l[c]="$"+c;if(i=Function("binder","return function ("+v_(l,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var u=function(){};u.prototype=t.prototype,i.prototype=new u,u.prototype=null}return i},w_=y_,fl=Function.prototype.bind||w_,Of=Function.prototype.call,zf=Function.prototype.apply,b_=typeof Reflect<"u"&&Reflect&&Reflect.apply,__=fl,S_=zf,A_=Of,k_=b_,S1=k_||__.call(A_,S_),E_=fl,$_=J,C_=Of,T_=S1,_u=function(e){if(e.length<1||typeof e[0]!="function")throw new $_("a function is required");return T_(E_,C_,e)},R_=_u,f0=so,A1;try{A1=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var ah=!!A1&&f0&&f0(Object.prototype,"__proto__"),k1=Object,p0=k1.getPrototypeOf,I_=ah&&typeof ah.get=="function"?R_([ah.get]):typeof p0=="function"?function(e){return p0(e==null?e:k1(e))}:!1,m0=b1(),g0=_1(),v0=I_,E1=m0?function(e){return m0(e)}:g0?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return g0(e)}:v0?function(e){return v0(e)}:null,x_=Function.prototype.call,P_=Object.prototype.hasOwnProperty,D_=fl,Kn=D_.call(x_,P_),K,L_=xf,O_=w1,z_=e_,N_=t_,M_=Pf,Qs=Gn,ms=J,U_=n_,Z_=r_,F_=i_,H_=s_,V_=o_,B_=a_,q_=l_,j_=u_,$1=Function,lh=function(n){try{return $1('"use strict"; return ('+n+").constructor;")()}catch{}},oa=so,W_=dl,ch=function(){throw new ms},G_=oa?function(){try{return arguments.callee,ch}catch{try{return oa(arguments,"callee").get}catch{return ch}}}():ch,Xi=Lf(),Re=E1,Y_=_1(),K_=b1(),C1=zf,pl=Of,rs={},J_=typeof Uint8Array>"u"||!Re?K:Re(Uint8Array),zi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":Xi&&Re?Re([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":rs,"%AsyncGenerator%":rs,"%AsyncGeneratorFunction%":rs,"%AsyncIteratorPrototype%":rs,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":O_,"%eval%":eval,"%EvalError%":z_,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":$1,"%GeneratorFunction%":rs,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xi&&Re?Re(Re([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xi||!Re?K:Re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":L_,"%Object.getOwnPropertyDescriptor%":oa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":N_,"%ReferenceError%":M_,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xi||!Re?K:Re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xi&&Re?Re(""[Symbol.iterator]()):K,"%Symbol%":Xi?Symbol:K,"%SyntaxError%":Qs,"%ThrowTypeError%":G_,"%TypedArray%":J_,"%TypeError%":ms,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":U_,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":pl,"%Function.prototype.apply%":C1,"%Object.defineProperty%":W_,"%Object.getPrototypeOf%":Y_,"%Math.abs%":Z_,"%Math.floor%":F_,"%Math.max%":H_,"%Math.min%":V_,"%Math.pow%":B_,"%Math.round%":q_,"%Math.sign%":j_,"%Reflect.getPrototypeOf%":K_};if(Re)try{null.error}catch(n){var X_=Re(Re(n));zi["%Error.prototype%"]=X_}var Q_=function n(e){var t;if(e==="%AsyncFunction%")t=lh("async function () {}");else if(e==="%GeneratorFunction%")t=lh("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=lh("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Re&&(t=Re(i.prototype))}return zi[e]=t,t},y0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ml=fl,Lc=Kn,eS=ml.call(pl,Array.prototype.concat),tS=ml.call(C1,Array.prototype.splice),w0=ml.call(pl,String.prototype.replace),Oc=ml.call(pl,String.prototype.slice),nS=ml.call(pl,RegExp.prototype.exec),rS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iS=/\\(\\)?/g,sS=function(e){var t=Oc(e,0,1),r=Oc(e,-1);if(t==="%"&&r!=="%")throw new Qs("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new Qs("invalid intrinsic syntax, expected opening `%`");var i=[];return w0(e,rS,function(s,o,l,c){i[i.length]=l?w0(c,iS,"$1"):o||s}),i},oS=function(e,t){var r=e,i;if(Lc(y0,r)&&(i=y0[r],r="%"+i[0]+"%"),Lc(zi,r)){var s=zi[r];if(s===rs&&(s=Q_(r)),typeof s>"u"&&!t)throw new ms("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Qs("intrinsic "+e+" does not exist!")},_t=function(e,t){if(typeof e!="string"||e.length===0)throw new ms("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ms('"allowMissing" argument must be a boolean');if(nS(/^%?[^%]*%?$/,e)===null)throw new Qs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=sS(e),i=r.length>0?r[0]:"",s=oS("%"+i+"%",t),o=s.name,l=s.value,c=!1,u=s.alias;u&&(i=u[0],tS(r,eS([0,1],u)));for(var f=1,m=!0;f<r.length;f+=1){var v=r[f],y=Oc(v,0,1),k=Oc(v,-1);if((y==='"'||y==="'"||y==="`"||k==='"'||k==="'"||k==="`")&&y!==k)throw new Qs("property names with quotes must have matching quotes");if((v==="constructor"||!m)&&(c=!0),i+="."+v,o="%"+i+"%",Lc(zi,o))l=zi[o];else if(l!=null){if(!(v in l)){if(!t)throw new ms("base intrinsic for "+e+" exists, but the property is not available.");return}if(oa&&f+1>=r.length){var S=oa(l,v);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?l=S.get:l=l[v]}else m=Lc(l,v),l=l[v];m&&!c&&(zi[o]=l)}}return l},uh,b0;function Lr(){if(b0)return uh;b0=1;var n=_t,e=_u,t=e([n("%String.prototype.indexOf%")]);return uh=function(i,s){var o=n(i,!!s);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},uh}var hh,_0;function Nf(){if(_0)return hh;_0=1;var n=_t,e=n("%Array%"),t=!e.isArray&&Lr()("Object.prototype.toString");return hh=e.isArray||function(i){return t(i)==="[object Array]"},hh}var aS=bu,S0=dl,T1=aS.hasArrayLengthDefineBug(),lS=T1&&Nf(),cS=Lr(),uS=cS("Object.prototype.propertyIsEnumerable"),Mf=function(e,t,r,i,s,o){if(!S0){if(!e(o)||!o["[[Configurable]]"]||!o["[[Writable]]"]||s in i&&uS(i,s)!==!!o["[[Enumerable]]"])return!1;var l=o["[[Value]]"];return i[s]=l,t(i[s],l)}return T1&&s==="length"&&"[[Value]]"in o&&lS(i)&&i.length!==o["[[Value]]"]?(i.length=o["[[Value]]"],i.length===o["[[Value]]"]):(S0(i,s,r(o)),!0)},hS=J,So=Kn,dS={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},ao=function(e){if(!e||typeof e!="object")return!1;for(var t in e)if(So(e,t)&&!dS[t])return!1;var r=So(e,"[[Value]]")||So(e,"[[Writable]]"),i=So(e,"[[Get]]")||So(e,"[[Set]]");if(r&&i)throw new hS("Property Descriptors may not be both accessor and data descriptors");return!0},R1=function(e){if(typeof e>"u")return e;var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=!!e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=!!e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=!!e["[[Configurable]]"]),t},fS=J,pS=ao,mS=R1,I1=function(e){if(typeof e<"u"&&!pS(e))throw new fS("Assertion failed: `Desc` must be a Property Descriptor");return mS(e)},gS=J,A0=Kn,vS=ao,x1=function(e){if(typeof e>"u")return!1;if(!vS(e))throw new gS("Assertion failed: `Desc` must be a Property Descriptor");return!(!A0(e,"[[Value]]")&&!A0(e,"[[Writable]]"))},lo=function(e){return typeof e=="string"||typeof e=="symbol"},k0=Df,P1=function(e,t){return e===t?e===0?1/e===1/t:!0:k0(e)&&k0(t)},E0=J,yS=Yn,wS=Mf,bS=I1,_S=x1,SS=lo,AS=P1,Uf=function(e,t,r){if(!yS(e))throw new E0("Assertion failed: Type(O) is not Object");if(!SS(t))throw new E0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return wS(_S,AS,bS,e,t,i)},D1=Function.prototype.toString,hs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Xh,ac;if(typeof hs=="function"&&typeof Object.defineProperty=="function")try{Xh=Object.defineProperty({},"length",{get:function(){throw ac}}),ac={},hs(function(){throw 42},null,Xh)}catch(n){n!==ac&&(hs=null)}else hs=null;var kS=/^\s*class\b/,Qh=function(e){try{var t=D1.call(e);return kS.test(t)}catch{return!1}},dh=function(e){try{return Qh(e)?!1:(D1.call(e),!0)}catch{return!1}},lc=Object.prototype.toString,ES="[object Object]",$S="[object Function]",CS="[object GeneratorFunction]",TS="[object HTMLAllCollection]",RS="[object HTML document.all class]",IS="[object HTMLCollection]",xS=typeof Symbol=="function"&&!!Symbol.toStringTag,PS=!(0 in[,]),ed=function(){return!1};if(typeof document=="object"){var DS=document.all;lc.call(DS)===lc.call(document.all)&&(ed=function(e){if((PS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=lc.call(e);return(t===TS||t===RS||t===IS||t===ES)&&e("")==null}catch{}return!1})}var L1=hs?function(e){if(ed(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{hs(e,null,Xh)}catch(t){if(t!==ac)return!1}return!Qh(e)&&dh(e)}:function(e){if(ed(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(xS)return dh(e);if(Qh(e))return!1;var t=lc.call(e);return t!==$S&&t!==CS&&!/^\[object HTML/.test(t)?!1:dh(e)},LS=L1,OS=function(e){return!!e},Mt=Kn,Ll=J,zS=Yn,$0=LS,fh=OS,NS=function(e){if(!zS(e))throw new Ll("ToPropertyDescriptor requires an object");var t={};if(Mt(e,"enumerable")&&(t["[[Enumerable]]"]=fh(e.enumerable)),Mt(e,"configurable")&&(t["[[Configurable]]"]=fh(e.configurable)),Mt(e,"value")&&(t["[[Value]]"]=e.value),Mt(e,"writable")&&(t["[[Writable]]"]=fh(e.writable)),Mt(e,"get")){var r=e.get;if(typeof r<"u"&&!$0(r))throw new Ll("getter must be a function");t["[[Get]]"]=r}if(Mt(e,"set")){var i=e.set;if(typeof i<"u"&&!$0(i))throw new Ll("setter must be a function");t["[[Set]]"]=i}if((Mt(t,"[[Get]]")||Mt(t,"[[Set]]"))&&(Mt(t,"[[Value]]")||Mt(t,"[[Writable]]")))throw new Ll("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},ph=J,MS=Yn,C0=ao,US=Mf,ZS=I1,FS=x1,HS=lo,VS=P1,BS=NS,qS=function(e,t,r){if(!MS(e))throw new ph("Assertion failed: Type(O) is not Object");if(!HS(t))throw new ph("Assertion failed: P is not a Property Key");var i=C0(r)?r:BS(r);if(!C0(i))throw new ph("Assertion failed: Desc is not a valid Property Descriptor");return US(FS,VS,ZS,e,t,i)},T0=J,jS=Yn,WS=qS,GS=lo,YS=function(e,t,r){if(!jS(e))throw new T0("Assertion failed: Type(O) is not Object");if(!GS(t))throw new T0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return WS(e,t,i)},KS=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,JS=xf,XS=JS.setPrototypeOf||null,QS=_u,R0=so,e8=J,O1={};try{O1.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var t8=!("toString"in O1),mh=R0&&R0(Object.prototype,"__proto__"),n8=t8&&(!!mh&&typeof mh.set=="function"&&QS([mh.set])||function(e,t){if(e==null)throw new e8("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),I0=KS,r8=XS,x0=n8,i8=J,s8=I0?function(e,t){if(I0(e,t))return e;throw new i8("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:r8||(x0?function(e,t){return x0(e,t),e}:null),P0=J,o8=Yn,D0=E1,a8=function(e){if(!o8(e))throw new P0("Assertion failed: O must be an Object");if(!D0)throw new P0("This environment does not support fetching prototypes.");return D0(e)},l8=J,c8=s8,u8=Yn,h8=a8,d8=function(e,t){if(t!==null&&!u8(t))throw new l8("Assertion failed: V must be Object or Null");try{c8(e,t)}catch{return!1}return h8(e)===t},gh=Uf,L0=YS,z1=d8,f8=bu(),Zf=w1;function gl(n,e,t){var r=new Zf(t);return z1(r,cc),delete r.constructor,L0(r,"error",n),L0(r,"suppressed",e),r}f8&&Object.defineProperty(gl,"prototype",{writable:!1});var cc=gl.prototype;if(!gh(cc,"constructor",gl)||!gh(cc,"message","")||!gh(cc,"name","SuppressedError"))throw new Zf("unable to install SuppressedError.prototype properties; please report this!");z1(gl.prototype,Zf.prototype);var p8=gl,m8=p8,N1=function(){return typeof SuppressedError=="function"?SuppressedError:m8},g8=Fi,O0=If(),v8=N1,y8=function(){var e=v8();return g8(O0,{SuppressedError:e},{SuppressedError:function(){return O0.SuppressedError!==e}}),e};y8();var w8=J,b8=ao,_8=R1,S8=function(e){if(typeof e<"u"&&!b8(e))throw new w8("Assertion failed: `Desc` must be a Property Descriptor");return _8(e)},A8=J,z0=Kn,k8=ao,E8=function(e){if(typeof e>"u")return!1;if(!k8(e))throw new A8("Assertion failed: `Desc` must be a Property Descriptor");return!(!z0(e,"[[Value]]")&&!z0(e,"[[Writable]]"))},N0=Df,$8=function(e,t){return e===t?e===0?1/e===1/t:!0:N0(e)&&N0(t)},co=L1,C8=function(e){return!!e},Ut=Kn,Ol=J,T8=Yn,M0=co,vh=C8,R8=function(e){if(!T8(e))throw new Ol("ToPropertyDescriptor requires an object");var t={};if(Ut(e,"enumerable")&&(t["[[Enumerable]]"]=vh(e.enumerable)),Ut(e,"configurable")&&(t["[[Configurable]]"]=vh(e.configurable)),Ut(e,"value")&&(t["[[Value]]"]=e.value),Ut(e,"writable")&&(t["[[Writable]]"]=vh(e.writable)),Ut(e,"get")){var r=e.get;if(typeof r<"u"&&!M0(r))throw new Ol("getter must be a function");t["[[Get]]"]=r}if(Ut(e,"set")){var i=e.set;if(typeof i<"u"&&!M0(i))throw new Ol("setter must be a function");t["[[Set]]"]=i}if((Ut(t,"[[Get]]")||Ut(t,"[[Set]]"))&&(Ut(t,"[[Value]]")||Ut(t,"[[Writable]]")))throw new Ol("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},yh=J,I8=Yn,U0=ao,x8=Mf,P8=S8,D8=E8,L8=lo,O8=$8,z8=R8,vl=function(e,t,r){if(!I8(e))throw new yh("Assertion failed: Type(O) is not Object");if(!L8(t))throw new yh("Assertion failed: P is not a Property Key");var i=U0(r)?r:z8(r);if(!U0(i))throw new yh("Assertion failed: Desc is not a valid Property Descriptor");return x8(D8,O8,P8,e,t,i)},N8=oo(),M8=N8?Symbol.dispose||Symbol("Symbol.dispose"):null,U8=oo,Z8=M8,Ff=function(){return U8()&&Symbol.dispose||Z8},F8=Lf,H8=vl,V8=Ff,B8=function(){var e=V8();return F8()&&H8(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},q8=oo(),j8=q8?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,W8=oo,G8=j8,Hf=function(){return W8()&&Symbol.asyncDispose||G8},Y8=Lf,K8=vl,J8=Hf,X8=function(){var e=J8();return Y8()&&K8(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},Q8=Nf(),e6=_t,t6=Lr(),n6=J,r6=Q8,i6=e6("%Reflect.apply%",!0)||t6("Function.prototype.apply"),Su=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!r6(r))throw new n6("Assertion failed: optional `argumentsList`, if provided, must be a List");return i6(e,t,r)};const s6={},o6=Object.freeze(Object.defineProperty({__proto__:null,default:s6},Symbol.toStringTag,{value:"Module"})),a6=Pb(o6);var Vf=typeof Map=="function"&&Map.prototype,wh=Object.getOwnPropertyDescriptor&&Vf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,zc=Vf&&wh&&typeof wh.get=="function"?wh.get:null,Z0=Vf&&Map.prototype.forEach,Bf=typeof Set=="function"&&Set.prototype,bh=Object.getOwnPropertyDescriptor&&Bf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Nc=Bf&&bh&&typeof bh.get=="function"?bh.get:null,F0=Bf&&Set.prototype.forEach,l6=typeof WeakMap=="function"&&WeakMap.prototype,ea=l6?WeakMap.prototype.has:null,c6=typeof WeakSet=="function"&&WeakSet.prototype,ta=c6?WeakSet.prototype.has:null,u6=typeof WeakRef=="function"&&WeakRef.prototype,H0=u6?WeakRef.prototype.deref:null,h6=Boolean.prototype.valueOf,d6=Object.prototype.toString,f6=Function.prototype.toString,p6=String.prototype.match,qf=String.prototype.slice,$r=String.prototype.replace,m6=String.prototype.toUpperCase,V0=String.prototype.toLowerCase,M1=RegExp.prototype.test,B0=Array.prototype.concat,pn=Array.prototype.join,g6=Array.prototype.slice,q0=Math.floor,td=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_h=Object.getOwnPropertySymbols,nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,eo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",na=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===eo||!0)?Symbol.toStringTag:null,U1=Object.prototype.propertyIsEnumerable,j0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function W0(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||M1.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-q0(-n):q0(n);if(r!==n){var i=String(r),s=qf.call(e,i.length+1);return $r.call(i,t,"$&_")+"."+$r.call($r.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $r.call(e,t,"$&_")}var rd=a6,G0=rd.custom,Y0=H1(G0)?G0:null,Z1={__proto__:null,double:'"',single:"'"},v6={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},uo=function n(e,t,r,i){var s=t||{};if(Tn(s,"quoteStyle")&&!Tn(Z1,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Tn(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Tn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Tn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return B1(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?W0(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return l?W0(e,u):u}var f=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return id(e)?"[Array]":"[Object]";var m=O6(s,r);if(typeof i>"u")i=[];else if(V1(i,e)>=0)return"[Circular]";function v(Ot,Jn,Bu){if(Jn&&(i=g6.call(i),i.push(Jn)),Bu){var El={depth:s.depth};return Tn(s,"quoteStyle")&&(El.quoteStyle=s.quoteStyle),n(Ot,El,r+1,i)}return n(Ot,s,r+1,i)}if(typeof e=="function"&&!K0(e)){var y=$6(e),k=zl(e,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(k.length>0?" { "+pn.call(k,", ")+" }":"")}if(H1(e)){var S=eo?$r.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):nd.call(e);return typeof e=="object"&&!eo?Ao(S):S}if(P6(e)){for(var x="<"+V0.call(String(e.nodeName)),M=e.attributes||[],Z=0;Z<M.length;Z++)x+=" "+M[Z].name+"="+F1(y6(M[Z].value),"double",s);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+V0.call(String(e.nodeName))+">",x}if(id(e)){if(e.length===0)return"[]";var G=zl(e,v);return m&&!L6(G)?"["+sd(G,m)+"]":"[ "+pn.call(G,", ")+" ]"}if(b6(e)){var F=zl(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!U1.call(e,"cause")?"{ ["+String(e)+"] "+pn.call(B0.call("[cause]: "+v(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+pn.call(F,", ")+" }"}if(typeof e=="object"&&o){if(Y0&&typeof e[Y0]=="function"&&rd)return rd(e,{depth:f-r});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(C6(e)){var W=[];return Z0&&Z0.call(e,function(Ot,Jn){W.push(v(Jn,e,!0)+" => "+v(Ot,e))}),J0("Map",zc.call(e),W,m)}if(I6(e)){var re=[];return F0&&F0.call(e,function(Ot){re.push(v(Ot,e))}),J0("Set",Nc.call(e),re,m)}if(T6(e))return Sh("WeakMap");if(x6(e))return Sh("WeakSet");if(R6(e))return Sh("WeakRef");if(S6(e))return Ao(v(Number(e)));if(k6(e))return Ao(v(td.call(e)));if(A6(e))return Ao(h6.call(e));if(_6(e))return Ao(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Wr<"u"&&e===Wr)return"{ [object globalThis] }";if(!w6(e)&&!K0(e)){var Q=zl(e,v),oe=j0?j0(e)===Object.prototype:e instanceof Object||e.constructor===Object,yn=e instanceof Object?"":"null prototype",wn=!oe&&na&&Object(e)===e&&na in e?qf.call(Or(e),8,-1):yn?"Object":"",we=oe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",bn=we+(wn||yn?"["+pn.call(B0.call([],wn||[],yn||[]),": ")+"] ":"");return Q.length===0?bn+"{}":m?bn+"{"+sd(Q,m)+"}":bn+"{ "+pn.call(Q,", ")+" }"}return String(e)};function F1(n,e,t){var r=t.quoteStyle||e,i=Z1[r];return i+n+i}function y6(n){return $r.call(String(n),/"/g,""")}function Hi(n){return!na||!(typeof n=="object"&&(na in n||typeof n[na]<"u"))}function id(n){return Or(n)==="[object Array]"&&Hi(n)}function w6(n){return Or(n)==="[object Date]"&&Hi(n)}function K0(n){return Or(n)==="[object RegExp]"&&Hi(n)}function b6(n){return Or(n)==="[object Error]"&&Hi(n)}function _6(n){return Or(n)==="[object String]"&&Hi(n)}function S6(n){return Or(n)==="[object Number]"&&Hi(n)}function A6(n){return Or(n)==="[object Boolean]"&&Hi(n)}function H1(n){if(eo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!nd)return!1;try{return nd.call(n),!0}catch{}return!1}function k6(n){if(!n||typeof n!="object"||!td)return!1;try{return td.call(n),!0}catch{}return!1}var E6=Object.prototype.hasOwnProperty||function(n){return n in this};function Tn(n,e){return E6.call(n,e)}function Or(n){return d6.call(n)}function $6(n){if(n.name)return n.name;var e=p6.call(f6.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function V1(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function C6(n){if(!zc||!n||typeof n!="object")return!1;try{zc.call(n);try{Nc.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function T6(n){if(!ea||!n||typeof n!="object")return!1;try{ea.call(n,ea);try{ta.call(n,ta)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function R6(n){if(!H0||!n||typeof n!="object")return!1;try{return H0.call(n),!0}catch{}return!1}function I6(n){if(!Nc||!n||typeof n!="object")return!1;try{Nc.call(n);try{zc.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function x6(n){if(!ta||!n||typeof n!="object")return!1;try{ta.call(n,ta);try{ea.call(n,ea)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function P6(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function B1(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return B1(qf.call(n,0,e.maxStringLength),e)+r}var i=v6[e.quoteStyle||"single"];i.lastIndex=0;var s=$r.call($r.call(n,i,"\\$1"),/[\x00-\x1f]/g,D6);return F1(s,"single",e)}function D6(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+m6.call(e.toString(16))}function Ao(n){return"Object("+n+")"}function Sh(n){return n+" { ? }"}function J0(n,e,t,r){var i=r?sd(t,r):pn.call(t,", ");return n+" ("+e+") {"+i+"}"}function L6(n){for(var e=0;e<n.length;e++)if(V1(n[e],`
|
|
2
|
+
`)>=0)return!1;return!0}function O6(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=pn.call(Array(n.indent+1)," ");else return null;return{base:t,prev:pn.call(Array(e+1),t)}}function sd(n,e){if(n.length===0)return"";var t=`
|
|
3
3
|
`+e.prev+e.base;return t+pn.call(n,","+t)+`
|
|
4
|
-
`+e.prev}function Ll(n,e){var t=ed(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Cn(n,i)?e(n[i],n):""}var s=typeof vh=="function"?vh(n):[],o;if(Qs){o={};for(var l=0;l<s.length;l++)o["$"+s[l]]=s[l]}for(var c in n)Cn(n,c)&&(t&&String(Number(c))===c&&c<n.length||Qs&&o["$"+c]instanceof Symbol||(P1.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof vh=="function")for(var u=0;u<s.length;u++)D1.call(n,s[u])&&r.push("["+e(s[u])+"]: "+e(n[s[u]],n));return r}var x6=co,P6=J,_u=function(n,e,t){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===e)return r.next=i.next,t||(i.next=n.next,n.next=i),i},D6=function(n,e){if(n){var t=_u(n,e);return t&&t.value}},L6=function(n,e,t){var r=_u(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},O6=function(n,e){return n?!!_u(n,e):!1},z6=function(n,e){if(n)return _u(n,e,!0)},N6=function(){var e,t={assert:function(r){if(!t.has(r))throw new P6("Side channel does not contain "+x6(r))},delete:function(r){var i=z6(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return D6(e,r)},has:function(r){return O6(e,r)},set:function(r,i){e||(e={next:void 0}),L6(e,r,i)}};return t},M6=_t,gl=Lr(),U6=co,Z6=J,q0=M6("%Map%",!0),F6=gl("Map.prototype.get",!0),H6=gl("Map.prototype.set",!0),V6=gl("Map.prototype.has",!0),B6=gl("Map.prototype.delete",!0),j6=gl("Map.prototype.size",!0),U1=!!q0&&function(){var e,t={assert:function(r){if(!t.has(r))throw new Z6("Side channel does not contain "+U6(r))},delete:function(r){if(e){var i=B6(e,r);return j6(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return F6(e,r)},has:function(r){return e?V6(e,r):!1},set:function(r,i){e||(e=new q0),H6(e,r,i)}};return t},q6=_t,Su=Lr(),W6=co,Ol=U1,G6=J,Qi=q6("%WeakMap%",!0),Y6=Su("WeakMap.prototype.get",!0),K6=Su("WeakMap.prototype.set",!0),J6=Su("WeakMap.prototype.has",!0),X6=Su("WeakMap.prototype.delete",!0),Q6=Qi?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new G6("Side channel does not contain "+W6(i))},delete:function(i){if(Qi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return X6(e,i)}else if(Ol&&t)return t.delete(i);return!1},get:function(i){return Qi&&i&&(typeof i=="object"||typeof i=="function")&&e?Y6(e,i):t&&t.get(i)},has:function(i){return Qi&&i&&(typeof i=="object"||typeof i=="function")&&e?J6(e,i):!!t&&t.has(i)},set:function(i,s){Qi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Qi),K6(e,i,s)):Ol&&(t||(t=Ol()),t.set(i,s))}};return r}:Ol,eA=J,tA=co,nA=N6,rA=U1,iA=Q6,sA=iA||rA||nA,oA=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":tA(r);throw new eA("Side channel does not contain "+i)}},delete:function(r){return!!e&&e.delete(r)},get:function(r){return e&&e.get(r)},has:function(r){return!!e&&e.has(r)},set:function(r,i){e||(e=sA()),e.set(r,i)}};return t},aA=Kn,Ao=oA(),An=J,Hf={assert:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new An("`O` is not an object");if(typeof e!="string")throw new An("`slot` must be a string");if(Ao.assert(n),!Hf.has(n,e))throw new An("`"+e+"` is not present on `O`")},get:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new An("`O` is not an object");if(typeof e!="string")throw new An("`slot` must be a string");var t=Ao.get(n);return t&&t["$"+e]},has:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new An("`O` is not an object");if(typeof e!="string")throw new An("`slot` must be a string");var t=Ao.get(n);return!!t&&aA(t,"$"+e)},set:function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new An("`O` is not an object");if(typeof e!="string")throw new An("`slot` must be a string");var r=Ao.get(n);r||(r={},Ao.set(n,r)),r["$"+e]=t}};Object.freeze&&Object.freeze(Hf);var Vf=Hf,Z1=Gn,Tr=Vf,vl=function n(e,t){if(!(this instanceof n))return new n(e,t);if(e!=="normal"&&e!=="break"&&e!=="continue"&&e!=="return"&&e!=="throw")throw new Z1('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Tr.set(this,"[[Type]]",e),Tr.set(this,"[[Value]]",t)};vl.prototype.type=function(){return Tr.get(this,"[[Type]]")};vl.prototype.value=function(){return Tr.get(this,"[[Value]]")};vl.prototype["?"]=function(){var e=Tr.get(this,"[[Type]]"),t=Tr.get(this,"[[Value]]");if(e==="throw")throw t;return t};vl.prototype["!"]=function(){var e=Tr.get(this,"[[Type]]");if(e!=="normal")throw new Z1('Assertion failed: Completion Record is not of type "normal"');return Tr.get(this,"[[Value]]")};var Bf=vl,lA=Bf,jf=function(e){return new lA("normal",e)},wh,W0;function cA(){if(W0)return wh;W0=1;var n=so;return wh=function(){return n()&&!!Symbol.toStringTag},wh}var uA=_t,G0=uA("%Object.defineProperty%",!0),hA=cA()(),dA=Kn,fA=J,zl=hA?Symbol.toStringTag:null,F1=function(e,t){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new fA("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");zl&&(r||!dA(e,zl))&&(G0?G0(e,zl,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[zl]=t)},H1={exports:{}},pA=_t,Y0=s1,mA=yu(),K0=io,J0=J,gA=pA("%Math.floor%"),vA=function(e,t){if(typeof e!="function")throw new J0("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||gA(t)!==t)throw new J0("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&K0){var o=K0(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!r)&&(mA?Y0(e,"length",t,!0,!0):Y0(e,"length",t)),e},yA=hl,wA=Pf,bA=g1,_A=function(){return bA(yA,wA,arguments)};(function(n){var e=vA,t=ul,r=wu,i=_A;n.exports=function(o){var l=r(arguments),c=1+o.length-(arguments.length-1);return e(l,c>0?c:0,!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(H1);var qf=H1.exports,SA=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},AA=Object,kA=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||AA(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},EA=Kn,$A=Df(),CA=SA,TA=kA,RA=function(e){return e&&typeof e=="object"&&EA(e,"[[DisposableResourceStack]]")&&$A(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||CA(e["[[DisposableResourceStack]]"],TA))},IA=Yn,xA=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(IA(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},PA=xA,Wf=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":PA(e)},DA=J,LA=co,OA=ao,zA=function(e,t){if(!OA(t))throw new DA("Assertion failed: P is not a Property Key, got "+LA(t));return e[t]},X0=J,NA=zA,MA=lo,UA=ao,Q0=co,ZA=function(e,t){if(!UA(t))throw new X0("Assertion failed: P is not a Property Key");var r=NA(e,t);if(r!=null){if(!MA(r))throw new X0(Q0(t)+" is not a function: "+Q0(r));return r}},nd={exports:{}},FA=_t,HA=FA,em=HA("%Reflect.construct%",!0),Nc=ml;try{Nc({},"",{"[[Get]]":function(){}})}catch{Nc=null}if(Nc&&em){var tm={},nm={};Nc(nm,"length",{"[[Get]]":function(){throw tm},"[[Enumerable]]":!0}),nd.exports=function(e){try{em(e,nm)}catch(t){return t===tm}}}else nd.exports=function(e){return typeof e=="function"&&!!e.prototype};var VA=nd.exports,bh=J,rm=lo,BA=VA,jA=function(e){if(!BA(e))throw new bh("C must be a constructor");var t={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new e(function(i,s){if(typeof t["[[Resolve]]"]<"u"||typeof t["[[Reject]]"]<"u")throw new bh("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=s});if(!rm(t["[[Resolve]]"])||!rm(t["[[Reject]]"]))throw new bh("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},im=Gn,qA=J,_h=bu,sm=ZA,WA=jA,GA=Wf,om=Nf(),am=Mf(),YA=function(e,t){if(GA(e)!=="Object")throw new qA("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new im("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&am&&(r=sm(e,am)),!r){if(!om)throw new im("`Symbol.dispose` is not supported");if(r=sm(e,om),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var s=WA(Promise);try{_h(r,i),_h(s["[[Resolve]]"],void 0,[void 0])}catch(o){s["[[Reject]]"](o)}return s["[[Promise]]"]}_h(r,i)}}return r},KA=Gn,Sh=J,JA=lo,XA=Wf,QA=YA,ek=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new KA("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(e==null)e=void 0,r=void 0;else{if(typeof e<"u"&&XA(e)!=="Object")throw new Sh("`V` must be an Object, or `null` or `undefined`");if(r=QA(e,t),typeof r>"u")throw new Sh("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!JA(r))throw new Sh("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},tk=Gn,Nl=J,nk=RA,lm=ek,rk=Lr(),ik=rk("Array.prototype.push"),V1=function(e,t,r){if(!nk(e))throw new Nl("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new tk("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var i=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof i!="function")throw new Nl("Assertion failed: `method`, when present, must be a function");if(!e["[[DisposableResourceStack]]"])throw new Nl("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(t==null&&r==="SYNC_DISPOSE")return"UNUSED";s=lm(t,r)}else{if(typeof t<"u")throw new Nl("Assertion failed: `V` must be undefined when `method` is present");s=lm(void 0,r,i)}return ik(e["[[DisposableResourceStack]]"],s),"UNUSED"},Ah,cm;function Gf(){if(cm)return Ah;cm=1;var n=_t,e=qf,t=Gn,r=n("%Promise.resolve%",!0),i=r&&e(r);return Ah=function(o,l){if(!i)throw new t("This environment does not support Promises.");return i(o,l)},Ah}var kh,um;function sk(){if(um)return kh;um=1;var n=_t,e=Gn,t=n("%Promise%",!0),r=bu,i=Gf(),s=Wf;return kh=function(l,c,u){if(typeof l<"u"&&s(l)!=="Object")throw new e("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new e("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new e("Assertion failed: `method` must be `undefined` or a function");var f=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(t,f)},kh}var Eh,hm;function ok(){if(hm)return Eh;hm=1;var n=Bf;return Eh=function(t){return new n("throw",t)},Eh}var ak=_t,$h=Gn,dm=J,lk=ak("%Promise%",!0),ck=Lr(),fm=ck("Promise.prototype.then",!0),uk=Bf,pm=sk(),hk=jf,dk=Gf(),mm=ok(),fk=x1(),B1=function(e,t){if(!(t instanceof uk))throw new dm("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new dm("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,s=r.length-1;s>=0;s-=1)if(!i)i=r[s]["[[Hint]]"];else if(i!==r[s]["[[Hint]]"])throw new $h("mixed hint stacks are not supported");for(var o=i==="ASYNC-DISPOSE"&&dk(lk,t),l=function(g){if(t.type()==="throw"){var y=t.value(),k=new fk(g,y);t=mm(k)}else t=mm(g)},c=i==="ASYNC-DISPOSE"&&function(y){return fm(o,function(){var k=pm(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!k)throw new $h("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return fm(k,hk)},l)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")o=c(r[u]);else{var f=r[u];try{var m=pm(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(m)throw new $h("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(g){l(g)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?o:t},j1=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Au=Tf,Yf=J,pk=bu,uo=Of,mk=ml,q1=lo,gk=jf,Je=Vf,vk=F1,W1=Fi.supportsDescriptors,yk=qf,Kf=V1,wk=B1,G1=j1,gm=Nf(),yt=function n(){if(!(this instanceof n)||Je.has(this,"[[DisposableState]]")||Je.has(this,"[[DisposeCapability]]"))throw new Yf("can only be used with new");Je.set(this,"[[DisposableState]]","PENDING"),Je.set(this,"[[DisposeCapability]]",G1())},Y1=function(){var e=this;return Je.assert(e,"[[DisposableState]]"),Je.get(e,"[[DisposableState]]")==="DISPOSED"},yl=yk(Y1);W1?mk(yt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Y1}):yt.prototype.disposed=!1;var K1=function(e){Je.set(e,"[[DisposableState]]","DISPOSED"),W1||(e.disposed=!0)};uo(yt.prototype,"dispose",function(){var e=this;if(!yl(e))return K1(e),wk(Je.get(e,"[[DisposeCapability]]"),gk())["?"]()});uo(yt.prototype,"use",function(e){var t=this;if(yl(t))throw new Au("a disposed stack can not use anything new");return Kf(Je.get(t,"[[DisposeCapability]]"),e,"SYNC-DISPOSE"),e});uo(yt.prototype,"adopt",function(e,t){var r=this;if(yl(r))throw new Au("a disposed stack can not use anything new");if(!q1(t))throw new Yf("`onDispose` must be a function");var i=function(){return pk(t,void 0,[e])};return Kf(Je.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),e});uo(yt.prototype,"defer",function(e){var t=this;if(yl(t))throw new Au("a disposed stack can not defer anything new");if(!q1(e))throw new Yf("`onDispose` must be a function");Kf(Je.get(t,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",e)});uo(yt.prototype,"move",function(){var e=this;if(yl(e))throw new Au("a disposed stack can not use anything new");var t=new yt;return Je.set(t,"[[DisposeCapability]]",Je.get(e,"[[DisposeCapability]]")),Je.set(e,"[[DisposeCapability]]",G1()),K1(e),t});gm&&uo(yt.prototype,gm,yt.prototype.dispose);vk(yt.prototype,"DisposableStack");var bk=yt,_k=bk,Sk=function(){return typeof DisposableStack=="function"?DisposableStack:_k},Ak=Fi,kk=$f(),Ek=Sk,$k=function(){var e=Ek();return Ak(kk,{DisposableStack:e},{DisposableStack:!0}),e},Ck=_t,ku=Tf,Jf=J,vm=Ck("%Promise%",!0),Xf=V1,Tk=bu,ho=Of,Rk=ml,Ik=B1,J1=lo,X1=j1,xk=jf,ym=Gf(),Xe=Vf,Pk=F1,Q1=Fi.supportsDescriptors,Dk=qf,Lk=Lr(),Ok=Lk("Promise.prototype.then",!0),wm=Mf(),wt=function n(){if(!(this instanceof n)||Xe.has(this,"[[AsyncDisposableState]]")||Xe.has(this,"[[DisposeCapability]]"))throw new Jf("can only be used with new");Xe.set(this,"[[AsyncDisposableState]]","pending"),Xe.set(this,"[[DisposeCapability]]",X1())},ev=function(){var e=this;return Xe.assert(e,"[[AsyncDisposableState]]"),Xe.get(e,"[[AsyncDisposableState]]")==="disposed"},wl=Dk(ev);Q1?Rk(wt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":ev}):wt.prototype.disposed=!1;var tv=function(e){Xe.set(e,"[[AsyncDisposableState]]","disposed"),Q1||(e.disposed=!0)};ho(wt.prototype,"disposeAsync",function(){var e=this;return wl(e)?ym(vm):(tv(e),Ok(ym(vm,Ik(Xe.get(e,"[[DisposeCapability]]"),xk())),function(t){return t["?"]()}))});ho(wt.prototype,"use",function(e){var t=this;if(wl(t))throw new ku("a disposed stack can not use anything new");return Xf(Xe.get(t,"[[DisposeCapability]]"),e,"ASYNC-DISPOSE"),e});ho(wt.prototype,"adopt",function(e,t){var r=this;if(wl(r))throw new ku("a disposed stack can not use anything new");if(!J1(t))throw new Jf("`onDisposeAsync` must be a function");var i=function(){return Tk(t,void 0,[e])};return i.value=e,Xf(Xe.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),e});ho(wt.prototype,"defer",function(e){var t=this;if(wl(t))throw new ku("a disposed stack can not defer anything new");if(!J1(e))throw new Jf("`onDispose` must be a function");Xf(Xe.get(t,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",e)});ho(wt.prototype,"move",function(){var e=this;if(wl(e))throw new ku("a disposed stack can not use anything new");var t=new wt;return Xe.set(t,"[[DisposeCapability]]",Xe.get(e,"[[DisposeCapability]]")),Xe.set(e,"[[DisposeCapability]]",X1()),tv(e),t});wm&&ho(wt.prototype,wm,wt.prototype.disposeAsync);Pk(wt.prototype,"AsyncDisposableStack");var zk=wt,Nk=zk,Mk=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:Nk},Uk=Fi,Zk=$f(),Fk=Mk,Hk=function(){var e=Fk();return Uk(Zk,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},Vk=U8,Bk=W8,jk=$k,qk=Hk,Wk=function(){Vk(),Bk(),jk(),qk()};Wk();const bm=new WeakMap;function Gk(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function es(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function _m(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function Yk(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class Kk{constructor(){$(this,"entries",new Map);$(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw _m();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw _m();if(t.constructor.name==="AsyncFunction")throw Yk();this.storeFactory(e,t)}has(e){var t;return((t=this.entries.get(e))==null?void 0:t.factory)!==void 0}resolve(e){return this.resolveAny(e)}storeFactory(e,t){const r=this.getOrCreateEntry(e);r.factory=t,r.instance=void 0,r.error=void 0}validateClassRegistration(e){const t=bm.get(e);if(t){if(e.length!==t.length)throw new Error(`${es(e)} cannot be registered with register(Class). @injectable(...) declared ${t.length} dependencies but constructor arity is ${e.length}. Use register(Key, () => value) instead.`);return}if(e.length!==0)throw new Error(`${es(e)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(e){const t=bm.get(e);if(!t)return new e;const r=t.map(i=>this.resolveAny(i));return new e(...r)}resolveAny(e){return this.getOrCreateEntry(e).proxy}getOrCreateEntry(e){let t=this.entries.get(e);return t||(t={key:e},t.proxy=this.createProxy(t),this.entries.set(e,t),t)}createProxy(e){return new Proxy({},{get:(t,r)=>{if(r==="then")return;const i=this.getInstance(e),s=Reflect.get(i,r,i);return typeof s=="function"?s.bind(i):s},set:(t,r,i)=>{const s=this.getInstance(e);return Reflect.set(s,r,i,s)},has:(t,r)=>{const i=this.getInstance(e);return r in i}})}getInstance(e){if(e.instance)return e.instance;if(e.error)throw e.error;if(!e.factory)throw new Error(`${es(e.key)} was resolved but never registered`);const t=this.constructionStack.indexOf(e.key);if(t!==-1){const r=[...this.constructionStack.slice(t),e.key].map(i=>es(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(e.key);try{const r=e.factory();if(Gk(r))throw new Error(`Factory for ${es(e.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${es(e.key)} returned a non-object value. Wrap primitives in an object.`);return e.instance=r,r}catch(r){throw e.error=r,r}finally{this.constructionStack.pop()}}}const nv=new Kk,Jk=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function Xk(n){for(const e of Object.keys(n))if(Jk.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function Qk(n,e){Xk(e);for(const t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0})}function Lt(){class n extends Event{constructor(t,r){const{type:i,bubbles:s,cancelable:o,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(t,{bubbles:s,cancelable:o,composed:l}),Qk(this,c)}}return n}class zr extends globalThis.EventTarget{}const eE="X-Television-Client-Meta",tE="telemetry-activity",nE="telemetry-signal",rv={kind:"single",full_screen:!1},iv={width:560,height:740};function rE(n){return n.layout.flatMap(e=>e.artifactIds)}function iE(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const e=[];for(const[t,r]of n.entries())sE(r,t,e);return{valid:e.length===0,errors:e}}function sa(n){return n.flatMap(e=>e.artifactIds)}function rd(n,e){return n.flatMap(t=>{if(!t.artifactIds.includes(e))return[t];const r=t.artifactIds.filter(i=>i!==e);return r.length===0?[]:[{...t,artifactIds:r}]})}function sE(n,e,t){if(!Ch(n)){t.push(`Page ${e} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&t.push(`Page ${e} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?t.push(`Page ${e} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&t.push(`Page ${e} artifact ids must be non-empty strings`),!Ch(n.geometry)){t.push(`Page ${e} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&t.push(`Page ${e} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){t.push(`Page ${e} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&t.push(`Page ${e} single geometry must include a boolean full_screen`),!Ch(n.size)){t.push(`Page ${e} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&t.push(`Page ${e} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&t.push(`Page ${e} size ${r} must be a finite positive number`)}}function Ch(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const gt=Lt(),lc=Lt(),Sm=Lt(),oE=Lt(),aE=Lt();function sv(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const fo=sv("RequestError"),Am=sv("ValidationError"),lE=200,cE=300,Ml=401;class uE{constructor(e,t){$(this,"serverURL");$(this,"token");$(this,"onUnauthorized");$(this,"telemetryMeta");this.serverURL=e.replace(/\/$/,""),this.token=t.token,this.onUnauthorized=t.onUnauthorized,this.telemetryMeta=t.telemetryMeta}async requestJSON(e,t,r){var o;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),s=await hE(i);if(!i.ok||i.status<lE||i.status>=cE)throw i.status===Ml&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(typeof s.error=="string"?s.error:i.statusText,i.status);return s}async requestVoid(e,t,r){var s;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Ml&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Th(i,i.statusText),i.status)}async requestText(e,t){var i;const r=await this.request(e,t);if(!r.ok)throw r.status===Ml&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Th(r,r.statusText),r.status);return r.text()}async requestRawVoid(e,t,r){var s;const i=await this.request(e,t,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Ml&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Th(i,i.statusText),i.status)}createError(e,t){const r={serverURL:this.serverURL};return t!==void 0&&(r.status=t),new fo(e,r)}async request(e,t,r,i){const s=`${this.serverURL}${t}`;try{return await fetch(s,{method:e,headers:this.buildHeaders(i),body:r})}catch(o){throw this.createError(o instanceof Error?o.message:"Failed to reach server")}}buildHeaders(e){const t={...e??{}};return this.token&&(t.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(t[eE]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function hE(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function Th(n,e){try{const t=await n.json();if(typeof t.error=="string")return t.error;if(typeof t.message=="string")return t.message}catch{}return e}function dE(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var Rn,Xc,ov;class fE{constructor(e){v(this,Xc);v(this,Rn);d(this,Rn,e)}list(){return a(this,Rn).requestJSON("GET","/channels")}async get(e={}){const t=await h(this,Xc,ov).call(this,e.channelID);return a(this,Rn).requestJSON("GET",`/channels/${encodeURIComponent(t)}`)}create(e){const t={name:e.name};return e.id!==void 0&&(t.id=e.id),a(this,Rn).requestJSON("POST","/channels",t)}update(e){const{channelID:t,...r}=e;return a(this,Rn).requestJSON("PATCH",`/channels/${encodeURIComponent(t)}`,r)}remove(e){return a(this,Rn).requestJSON("DELETE",`/channels/${encodeURIComponent(e.channelID)}`)}}Rn=new WeakMap,Xc=new WeakSet,ov=async function(e){if(e!==void 0)return e;const{channels:t}=await this.list();if(t.length===1)return t[0].id;throw t.length===0?new Am("channelID is required, but no channels exist."):new Am(`channelID is required when multiple channels exist. Available channels: ${dE(t)}`)};var In;class pE{constructor(e){v(this,In);d(this,In,e)}create(e){const t={kind:e.kind,title:e.title};switch(e.kind){case"path":t.path=e.path;break;case"url":t.url=e.url;break}return t.channelID=e.channelID,a(this,In).requestJSON("POST","/artifacts",t)}list(e={}){const t=new URLSearchParams;e.channelID!==void 0&&t.set("channelID",e.channelID);const r=t.toString();return a(this,In).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(e){return a(this,In).requestJSON("GET",`/artifacts/${encodeURIComponent(e.artifactID)}`)}update(e){const t={};return e.title!==void 0&&(t.title=e.title),e.path!==void 0&&(t.path=e.path),e.url!==void 0&&(t.url=e.url),a(this,In).requestJSON("PATCH",`/artifacts/${encodeURIComponent(e.artifactID)}`,t)}delete(e){return a(this,In).requestJSON("DELETE",`/artifacts/${encodeURIComponent(e.artifactID)}`)}}In=new WeakMap;var ys;class mE{constructor(e){v(this,ys);d(this,ys,e)}get(e){return a(this,ys).requestText("GET",`/markdown/${encodeURIComponent(e.artifactID)}`)}update(e){return a(this,ys).requestRawVoid("PUT",`/markdown/${encodeURIComponent(e.artifactID)}`,e.content)}}ys=new WeakMap;var Xr;class gE{constructor(e){v(this,Xr);d(this,Xr,e)}status(){return a(this,Xr).requestJSON("GET","/telemetry")}enable(){return a(this,Xr).requestJSON("POST","/telemetry/enable")}disable(){return a(this,Xr).requestJSON("POST","/telemetry/disable")}}Xr=new WeakMap;var Qr;class vE{constructor(e){v(this,Qr);d(this,Qr,e)}get(){return a(this,Qr).requestJSON("GET","/display")}patch(e){const t={};return e.focusedChannelId!==void 0&&(t.focusedChannelId=e.focusedChannelId),e.pinnedChannelIds!==void 0&&(t.pinnedChannelIds=e.pinnedChannelIds),e.activeThemeName!==void 0&&(t.activeThemeName=e.activeThemeName),a(this,Qr).requestVoid("PATCH","/display",t)}focus(e){return a(this,Qr).requestJSON("POST","/display/focus",{artifactID:e.artifactID})}}Qr=new WeakMap;var Vt;class yE{constructor(e,t={}){$(this,"channels");$(this,"artifacts");$(this,"display");$(this,"markdown");$(this,"telemetry");v(this,Vt);d(this,Vt,new uE(e,t)),this.channels=new fE(a(this,Vt)),this.artifacts=new pE(a(this,Vt)),this.display=new vE(a(this,Vt)),this.markdown=new mE(a(this,Vt)),this.telemetry=new gE(a(this,Vt))}health(){return a(this,Vt).requestJSON("GET","/health")}}Vt=new WeakMap;const id="0.0.0",wE=/^\d+\.\d+\.\d+$/,bE=3;function Qf(n){return wE.test(n)}function av(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<bE;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function _E(n,e){return n===id||e===id?!1:n!==e}const SE=400,AE=404,lv=500,kE=600,EE={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,acpEnabled:!1};var ee,da,fa,xn,Ae,ae,ei,nr,ti,Pn,tt,ws,pa,P,Vr,sd,od,cv,ad,uv,cc,ld,hv,is,dv,En,cd,fv,Ze;class $E extends zr{constructor(t){super();v(this,P);v(this,ee);v(this,da);v(this,fa);v(this,xn,new Set);$(this,"pendingPageWrites",new Map);v(this,Ae,new Map);v(this,ae,RE());v(this,ei);v(this,nr,!1);v(this,ti,!1);v(this,Pn,0);v(this,tt,!1);v(this,ws,()=>{if(a(this,tt))return;const t=a(this,ee).connection.status==="connected";t&&!a(this,ti)?(d(this,ti,!0),h(this,P,dv).call(this)):!t&&a(this,ti)&&(d(this,ti,!1),d(this,Pn,a(this,Pn)+1)),h(this,P,En).call(this)});v(this,pa,t=>{if(a(this,tt)||t.serverURL!==a(this,ee).connection.url)return;for(const i of a(this,xn))i.push(t.event);const r=t.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Sm("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){a(this,nr)&&Mc(a(this,ae),a(this,Ae),r.channelID,r.artifactID)&&h(this,P,En).call(this),this.dispatchEvent(new oE("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new aE("theme-changed",{themeName:r.themeName})),a(this,nr)&&(Ul(a(this,ae),r,this.pendingPageWrites,a(this,Ae)),Rh(a(this,ae),a(this,Ae)),h(this,P,En).call(this))});d(this,ee,t.connectionOwner),d(this,da,t.navigationKeyHandler),d(this,fa,t.retainedGateHalted??(()=>!1)),d(this,ei,h(this,P,cd).call(this)),a(this,ee).addEventListener("change",a(this,ws)),a(this,ee).addEventListener("server-event",a(this,pa)),a(this,ws).call(this)}get snapshot(){return a(this,ei)}handleNavigationKey(t){var r;h(this,P,Ze).call(this),(r=a(this,da))==null||r.call(this,t)}authenticate(t){return h(this,P,Ze).call(this),a(this,ee).authenticate(t)}async createChannel(t){h(this,P,Ze).call(this);const{channel:r}=await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.create({name:t}),()=>h(this,P,cv).call(this));return r}focusChannel(t){return h(this,P,Ze).call(this),h(this,P,Vr).call(this,a(this,ee).connection.client.display.patch({focusedChannelId:t}),()=>h(this,P,od).call(this))}setPinnedChannelIds(t){return h(this,P,Ze).call(this),h(this,P,Vr).call(this,a(this,ee).connection.client.display.patch({pinnedChannelIds:[...t]}),()=>h(this,P,od).call(this))}selectPage(t,r){h(this,P,Ze).call(this),Mc(a(this,ae),a(this,Ae),t,r)&&h(this,P,En).call(this)}async renameChannel(t,r){h(this,P,Ze).call(this),await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>h(this,P,ad).call(this,t))}async deleteChannel(t){h(this,P,Ze).call(this),await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.remove({channelID:t}),()=>h(this,P,uv).call(this,t))}updateChannelPages(t,r){h(this,P,Ze).call(this);const i=iE(r),s=a(this,ae).channels.get(t);if(!i.valid||!s)return Promise.resolve();const o=Yr(r),l=Yr(s.channel.layout),c={previousPages:l};return Ni(a(this,Ae),t,l,o),s.channel={...s.channel,layout:o},this.pendingPageWrites.set(t,c),h(this,P,En).call(this),a(this,ee).connection.client.channels.update({channelID:t,layout:Yr(o)}).then(()=>{this.pendingPageWrites.get(t)===c&&this.pendingPageWrites.delete(t)},async u=>{if(a(this,tt))throw u;const f=this.pendingPageWrites.get(t)===c;if(f&&this.pendingPageWrites.delete(t),Em(u))throw await h(this,P,sd).call(this,()=>h(this,P,ad).call(this,t)),u;if(!f||!LE(u))throw u;const m=a(this,ae).channels.get(t);if(!m)throw u;const g=Yr(c.previousPages);throw Ni(a(this,Ae),t,m.channel.layout,g),m.channel={...m.channel,layout:g},h(this,P,En).call(this),u})}async deleteArtifact(t){h(this,P,Ze).call(this);const r=$m(a(this,ae),t);await h(this,P,Vr).call(this,a(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>h(this,P,hv).call(this,t,r))}readMarkdown(t){return h(this,P,Ze).call(this),a(this,ee).connection.client.markdown.get({artifactID:t})}writeMarkdown(t,r){return h(this,P,Ze).call(this),a(this,ee).connection.client.markdown.update({artifactID:t,content:r})}getArtifactViewURL(t){return h(this,P,Ze).call(this),a(this,ee).connection.getViewURL(t)}getArtifactContentURL(t){return h(this,P,Ze).call(this),a(this,ee).connection.getContentURL(t)}dispose(){a(this,tt)||(d(this,tt,!0),d(this,Pn,a(this,Pn)+1),a(this,xn).clear(),this.pendingPageWrites.clear(),a(this,Ae).clear(),a(this,ee).removeEventListener("change",a(this,ws)),a(this,ee).removeEventListener("server-event",a(this,pa)))}}ee=new WeakMap,da=new WeakMap,fa=new WeakMap,xn=new WeakMap,Ae=new WeakMap,ae=new WeakMap,ei=new WeakMap,nr=new WeakMap,ti=new WeakMap,Pn=new WeakMap,tt=new WeakMap,ws=new WeakMap,pa=new WeakMap,P=new WeakSet,Vr=async function(t,r){try{return await t}catch(i){throw!a(this,tt)&&Em(i)&&await h(this,P,sd).call(this,r),i}},sd=async function(t){try{await t()}catch{}},od=function(){const t=a(this,ee).connection.client;return h(this,P,is).call(this,()=>t.display.get(),r=>h(this,P,cc).call(this,r))},cv=function(){const t=a(this,ee).connection.client;return h(this,P,is).call(this,async()=>{const[{channels:r},i]=await Promise.all([t.channels.list(),t.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const s=new Set(r.map(({id:o})=>o));for(const o of a(this,ae).channels.keys())s.has(o)||(this.pendingPageWrites.delete(o),a(this,Ae).delete(o),a(this,ae).channels.delete(o));for(const o of r)a(this,ae).channels.has(o.id)||a(this,ae).channels.set(o.id,{channel:gs(o),artifacts:new Map});h(this,P,cc).call(this,i)})},ad=function(t){const r=a(this,ee).connection.client;return h(this,P,is).call(this,()=>Ih(()=>r.channels.get({channelID:t})),i=>h(this,P,ld).call(this,t,i))},uv=function(t){const r=a(this,ee).connection.client;return h(this,P,is).call(this,async()=>{const[i,s]=await Promise.all([Ih(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:s}},({detail:i,display:s})=>{h(this,P,ld).call(this,t,i),h(this,P,cc).call(this,s)})},cc=function(t){a(this,ae).display=hd(t),a(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},ld=function(t,r){this.pendingPageWrites.delete(t);const i=a(this,ae).channels.get(t);if(r===null){a(this,Ae).delete(t),a(this,ae).channels.delete(t);return}Ni(a(this,Ae),t,(i==null?void 0:i.channel.layout)??[],r.channel.layout),a(this,ae).channels.set(t,{channel:gs(r.channel),artifacts:new Map(r.artifacts.map(s=>[s.id,structuredClone(s)]))})},hv=function(t,r){const i=a(this,ee).connection.client;return h(this,P,is).call(this,()=>Ih(()=>i.artifacts.get({artifactID:t})),s=>{const o=$m(a(this,ae),t)??r;if(s===null){o!==null&&Ul(a(this,ae),{type:"artifact-removed",channelID:o,artifactID:t},this.pendingPageWrites,a(this,Ae));return}const l=o===null?void 0:a(this,ae).channels.get(o);l==null||l.artifacts.set(t,structuredClone(s.artifact))})},is=async function(t,r){const i=a(this,Pn),s=[];a(this,xn).add(s);try{const o=await t();if(a(this,tt)||i!==a(this,Pn))return;r(o);for(const l of s)Ul(a(this,ae),l,this.pendingPageWrites,a(this,Ae));Rh(a(this,ae),a(this,Ae)),h(this,P,En).call(this)}finally{a(this,xn).delete(s)}},dv=async function(){const t=++th(this,Pn)._,r=a(this,ee).connection,i=r.client,s=[];a(this,xn).add(s);try{const[{channels:o},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(o.map(({id:m})=>i.channels.get({channelID:m})));if(a(this,tt)||t!==a(this,Pn))return;const u={channels:new Map,display:hd(l)};for(const m of c)u.channels.set(m.channel.id,{channel:gs(m.channel),artifacts:new Map(m.artifacts.map(g=>[g.id,structuredClone(g)]))});IE(a(this,Ae),a(this,ae),u);for(const m of s)Ul(u,m,this.pendingPageWrites,a(this,Ae));Rh(u,a(this,Ae));const f=a(this,nr)?CE(a(this,ae),u):[];this.pendingPageWrites.clear(),d(this,ae,u),d(this,nr,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,P,En).call(this);for(const m of f)this.dispatchEvent(new Sm("artifact-content-changed",{artifactID:m}))}catch{}finally{a(this,xn).delete(s)}},En=function(){a(this,tt)||(d(this,ei,h(this,P,cd).call(this)),h(this,P,fv).call(this),this.dispatchEvent(new gt("change")))},cd=function(){var s;const t=[...a(this,ae).channels.values()].map(o=>PE(o,a(this,Ae).get(o.channel.id))),r=t.find(({id:o})=>o===a(this,ae).display.focusedChannelId)??null,i=a(this,ee).connection;return Object.freeze({ready:a(this,nr),channels:Object.freeze(t),display:DE(a(this,ae).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||a(this,fa).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:a(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:TE(((s=i.updateState)==null?void 0:s.desktop)??null)})})},fv=function(){const t=a(this,ei).focusedChannel;a(this,ee).connection.acpClient.setChannelContext(t?{channelID:t.id,channelName:t.name}:null)},Ze=function(){if(a(this,tt))throw new Error("ApplicationService is disposed")};function CE(n,e){const t=e.display.focusedChannelId;if(t===null||n.display.focusedChannelId!==t)return[];const r=n.channels.get(t),i=e.channels.get(t);if(!r||!i)return[];const s=new Set(sa(r.channel.layout));return sa(i.channel.layout).filter(o=>{var l,c;return s.has(o)&&((l=r.artifacts.get(o))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(o))==null?void 0:c.kind)==="path"})}function TE(n){return n===null?null:Object.freeze({...n})}function RE(){return{channels:new Map,display:hd(EE)}}function Ul(n,e,t,r){switch(e.type){case"channel-created":r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:gs(e.channel),artifacts:new Map});return;case"channel-updated":{t.delete(e.channel.id);const i=n.channels.get(e.channel.id);if(!i){r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:gs(e.channel),artifacts:new Map});return}Ni(r,e.channel.id,i.channel.layout,e.channel.layout);const s=new Set(sa(e.channel.layout));i.channel=gs(e.channel);for(const o of i.artifacts.keys())s.has(o)||i.artifacts.delete(o);return}case"channel-removed":t.delete(e.channelID),r.delete(e.channelID),n.channels.delete(e.channelID);return;case"channel-changed":n.display.focusedChannelId=e.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...e.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=e.themeName;return;case"artifact-created":{const i=n.channels.get(e.channelID);if(!i)return;const s=t.get(e.channelID);if(s&&(s.previousPages=km(s.previousPages,e.artifact.id)),!sa(i.channel.layout).includes(e.artifact.id)){const o=i.channel.layout,l=km(o,e.artifact.id);Ni(r,e.channelID,o,l),i.channel={...i.channel,layout:l}}i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(e.artifact.id)){i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}return;case"artifact-removed":{const i=n.channels.get(e.channelID);if(!i)return;const s=t.get(e.channelID);s&&(s.previousPages=rd(s.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const o=i.channel.layout,l=rd(o,e.artifactID);Ni(r,e.channelID,o,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Mc(n,r,e.channelID,e.artifactID);return;case"artifact-content-changed":return;default:return OE(e)}}function IE(n,e,t){var r;for(const i of n.keys())t.channels.has(i)||n.delete(i);for(const[i,s]of t.channels)Ni(n,i,((r=e.channels.get(i))==null?void 0:r.channel.layout)??[],s.channel.layout)}function Ni(n,e,t,r){const i=n.get(e);if(i===void 0)return;if(r.length===0){n.delete(e);return}const s=ud(r,i);if(s!==-1){n.set(e,[...r[s].artifactIds]);return}const o=ud(t,i),l=o===-1?0:Math.min(o,r.length-1);n.set(e,[...r[l].artifactIds])}function Mc(n,e,t,r){const i=n.channels.get(t),s=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!s)return!1;const o=e.get(t);return o&&xE(o,s.artifactIds)?!1:(e.set(t,[...s.artifactIds]),!0)}function Rh(n,e){var i,s;const t=n.display.focusedChannelId;if(t===null||e.has(t))return;const r=(s=(i=n.channels.get(t))==null?void 0:i.channel.layout[0])==null?void 0:s.artifactIds[0];r!==void 0&&Mc(n,e,t,r)}function ud(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function xE(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function PE(n,e){const t=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=e===void 0?0:ud(n.channel.layout,e),i=t[r]??t[0]??null,s=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),o={id:n.channel.id,name:n.channel.name,pages:t,selectedPage:i,artifacts:s};return Object.freeze(n.channel.onboarding?{...o,onboarding:Object.freeze({...n.channel.onboarding})}:o)}function DE(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled})}function km(n,e){return sa(n).includes(e)?Yr(n):[...Yr(n),{artifactIds:[e],geometry:{...rv},size:{...iv}}]}function LE(n){return n instanceof fo&&n.status!==void 0&&n.status>=SE&&n.status<lv}function Em(n){return n instanceof fo&&(n.status===void 0||n.status>=lv&&n.status<kE)}async function Ih(n){try{return await n()}catch(e){if(e instanceof fo&&e.status===AE)return null;throw e}}function $m(n,e){for(const[t,r]of n.channels)if(r.artifacts.has(e))return t;return null}function Yr(n){return n.map(e=>({artifactIds:[...e.artifactIds],geometry:{...e.geometry},size:{...e.size}}))}function gs(n){return{id:n.id,name:n.name,layout:Yr(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function hd(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled}}function OE(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function zE(n,e){var c;const t=n.snapshot,r=t.focusedChannel;if(e==="ArrowLeft"||e==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),f=u+(e==="ArrowLeft"?-1:1),m=(c=r.pages[f])==null?void 0:c.artifactIds[0];return u===-1||m===void 0?!1:(Cm(),n.selectPage(r.id,m),!0)}const i=NE(t),s=r===null?-1:i.indexOf(r.id),o=s+(e==="ArrowUp"?-1:1),l=i[o];return s===-1||l===void 0?!1:(Cm(),n.focusChannel(l).catch(()=>{}),!0)}function NE(n){const e=new Map(n.channels.map(s=>[s.id,s])),t=n.display.pinnedChannelIds.filter(s=>e.has(s)),r=new Set(t),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return[...t,...i]}function Cm(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const pv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Uc=32,ME=16,mv=10,Tm=0xffffffffffff;var Kr;(function(n){n.Base32IncorrectEncoding="B32_ENC_INVALID",n.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",n.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",n.EncodeTimeNegative="ENC_TIME_NEG",n.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",n.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",n.PRNGDetectFailure="PRNG_DETECT",n.ULIDInvalid="ULID_INVALID",n.Unexpected="UNEXPECTED",n.UUIDInvalid="UUID_INVALID"})(Kr||(Kr={}));class Lo extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function UE(n){const e=Math.floor(n()*Uc)%Uc;return pv.charAt(e)}function ZE(n){const e=FE(),t=e&&(e.crypto||e.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]/256};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/256;throw new Lo(Kr.PRNGDetectFailure,"Failed to find a reliable PRNG")}function FE(){return BE()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function HE(n,e){let t="";for(;n>0;n--)t=UE(e)+t;return t}function VE(n,e=mv){if(isNaN(n))throw new Lo(Kr.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>Tm)throw new Lo(Kr.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Tm}: ${n}`);if(n<0)throw new Lo(Kr.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Lo(Kr.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let t,r="";for(let i=e;i>0;i--)t=n%Uc,r=pv.charAt(t)+r,n=(n-t)/Uc;return r}function BE(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ep(n,e){const t=ZE(),r=Date.now();return VE(r,mv)+HE(ME,t)}const Oo=Lt(),gv=Lt(),vv=Lt(),jE=Lt(),xh=Lt(),qE="store-";function Rr(n){return new URL(n).origin}function WE(){return{authTokens:{}}}var ni,ri,ii;class GE extends zr{constructor(t,r,i={}){super();v(this,ni);v(this,ri);v(this,ii);d(this,ni,`${qE}${t}`),d(this,ri,i.storage??KE());const s=a(this,ri).getItem(a(this,ni));s===null?(d(this,ii,r),a(this,ri).setItem(a(this,ni),JSON.stringify(r))):d(this,ii,JE(JSON.parse(s),r))}get(){return a(this,ii)}set(t){d(this,ii,t),a(this,ri).setItem(a(this,ni),JSON.stringify(t)),this.dispatchEvent(new gt("change"))}}ni=new WeakMap,ri=new WeakMap,ii=new WeakMap;function Rm(n,e){return n.authTokens[Rr(e)]??null}function Im(n,e,t){return{authTokens:{...n.authTokens,[Rr(e)]:t}}}function YE(n,e){const t=Rr(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function KE(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function JE(n,e){if(typeof n!="object"||n===null||Array.isArray(n))return e;const t=n.authTokens;if(typeof t!="object"||t===null||Array.isArray(t))return e;const r={};for(const[i,s]of Object.entries(t))if(typeof s=="string")try{r[Rr(i)]=s}catch{}return{authTokens:r}}function E(n,e,t){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),e(l,c);const u=o.prototype,f=Object.keys(u);for(let m=0;m<f.length;m++){const g=f[m];g in l||(l[g]=u[g].bind(l))}}const i=(t==null?void 0:t.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function o(l){var c;const u=t!=null&&t.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var c,u;return t!=null&&t.Parent&&l instanceof t.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(o,"name",{value:n}),o}class vs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class yv extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const wv={};function Ir(n){return wv}function bv(n){const e=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>e.indexOf(+r)===-1).map(([r,i])=>i)}function dd(n,e){return typeof e=="bigint"?e.toString():e}function Eu(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function tp(n){return n==null}function np(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function XE(n,e){const t=(n.toString().split(".")[1]||"").length,r=e.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=t>i?t:i,o=Number.parseInt(n.toFixed(s).replace(".","")),l=Number.parseInt(e.toFixed(s).replace(".",""));return o%l/10**s}const xm=Symbol("evaluating");function se(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==xm)return r===void 0&&(r=xm,r=t()),r},set(i){Object.defineProperty(n,e,{value:i})},configurable:!0})}function Vi(n,e,t){Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Nr(...n){const e={};for(const t of n){const r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function Pm(n){return JSON.stringify(n)}function QE(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const _v="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function oa(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const e4=Eu(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function eo(n){if(oa(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(oa(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Sv(n){return eo(n)?{...n}:Array.isArray(n)?[...n]:n}const t4=new Set(["string","number","symbol"]);function to(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mr(n,e,t){const r=new n._zod.constr(e??n._zod.def);return(!e||t!=null&&t.parent)&&(r._zod.parent=n),r}function N(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function n4(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const r4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function i4(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Nr(n._zod.def,{get shape(){const o={};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(o[l]=t.shape[l])}return Vi(this,"shape",o),o},checks:[]});return Mr(n,s)}function s4(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Nr(n._zod.def,{get shape(){const o={...n._zod.def.shape};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete o[l]}return Vi(this,"shape",o),o},checks:[]});return Mr(n,s)}function o4(n,e){if(!eo(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const s=n._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Nr(n._zod.def,{get shape(){const s={...n._zod.def.shape,...e};return Vi(this,"shape",s),s}});return Mr(n,i)}function a4(n,e){if(!eo(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Nr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return Vi(this,"shape",r),r}});return Mr(n,t)}function l4(n,e){const t=Nr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e._zod.def.shape};return Vi(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Mr(n,t)}function c4(n,e,t){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Nr(e._zod.def,{get shape(){const l=e._zod.def.shape,c={...l};if(t)for(const u in t){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return Vi(this,"shape",c),c},checks:[]});return Mr(e,o)}function u4(n,e,t){const r=Nr(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(t)for(const o in t){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=new n({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new n({type:"nonoptional",innerType:i[o]});return Vi(this,"shape",s),s}});return Mr(e,r)}function ds(n,e=0){var t;if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(((t=n.issues[r])==null?void 0:t.continue)!==!0)return!0;return!1}function fs(n,e){return e.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(n),t})}function Zl(n){return typeof n=="string"?n:n==null?void 0:n.message}function xr(n,e,t){var i,s,o,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const f=Zl((o=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,n))??Zl((l=e==null?void 0:e.error)==null?void 0:l.call(e,n))??Zl((c=t.customError)==null?void 0:c.call(t,n))??Zl((u=t.localeError)==null?void 0:u.call(t,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function rp(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function aa(...n){const[e,t,r]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}const Av=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,dd,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},kv=E("$ZodError",Av),Ev=E("$ZodError",Av,{Parent:Error});function h4(n,e=t=>t.message){const t={},r=[];for(const i of n.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}function d4(n,e=t=>t.message){const t={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)t._errors.push(e(s));else{let o=t,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(e(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return r(n),t}const ip=n=>(e,t,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise)throw new vs;if(o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>xr(c,s,Ir())));throw _v(l,i==null?void 0:i.callee),l}return o.value},sp=n=>async(e,t,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>xr(c,s,Ir())));throw _v(l,i==null?void 0:i.callee),l}return o.value},$u=n=>(e,t,r)=>{const i=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:t,issues:[]},i);if(s instanceof Promise)throw new vs;return s.issues.length?{success:!1,error:new(n??kv)(s.issues.map(o=>xr(o,i,Ir())))}:{success:!0,data:s.value}},f4=$u(Ev),Cu=n=>async(e,t,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=e._zod.run({value:t,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new n(s.issues.map(o=>xr(o,i,Ir())))}:{success:!0,data:s.value}},p4=Cu(Ev),m4=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ip(n)(e,t,i)},g4=n=>(e,t,r)=>ip(n)(e,t,r),v4=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return sp(n)(e,t,i)},y4=n=>async(e,t,r)=>sp(n)(e,t,r),w4=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $u(n)(e,t,i)},b4=n=>(e,t,r)=>$u(n)(e,t,r),_4=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Cu(n)(e,t,i)},S4=n=>async(e,t,r)=>Cu(n)(e,t,r),A4=/^[cC][^\s-]{8,}$/,k4=/^[0-9a-z]+$/,E4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$4=/^[0-9a-vA-V]{20}$/,C4=/^[A-Za-z0-9]{27}$/,T4=/^[a-zA-Z0-9_-]{21}$/,R4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,I4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Dm=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,x4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,P4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function D4(){return new RegExp(P4,"u")}const L4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,z4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,N4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,M4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$v=/^[A-Za-z0-9_-]*$/,U4=/^\+[1-9]\d{6,14}$/,Cv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Z4=new RegExp(`^${Cv}$`);function Tv(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function F4(n){return new RegExp(`^${Tv(n)}$`)}function H4(n){const e=Tv({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${t.join("|")})`;return new RegExp(`^${Cv}T(?:${r})$`)}const V4=n=>{const e=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},B4=/^-?\d+$/,Rv=/^-?\d+(?:\.\d+)?$/,j4=/^(?:true|false)$/i,q4=/^[^A-Z]*$/,W4=/^[^a-z]*$/,Qe=E("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),Iv={number:"number",bigint:"bigint",object:"date"},xv=E("$ZodCheckLessThan",(n,e)=>{Qe.init(n,e);const t=Iv[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Pv=E("$ZodCheckGreaterThan",(n,e)=>{Qe.init(n,e);const t=Iv[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),G4=E("$ZodCheckMultipleOf",(n,e)=>{Qe.init(n,e),n._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):XE(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),Y4=E("$ZodCheckNumberFormat",(n,e)=>{var o;Qe.init(n,e),e.format=e.format||"float64";const t=(o=e.format)==null?void 0:o.includes("int"),r=t?"int":"number",[i,s]=r4[e.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=e.format,c.minimum=i,c.maximum=s,t&&(c.pattern=B4)}),n._zod.check=l=>{const c=l.value;if(t){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!e.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!e.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!e.abort})}}),K4=E("$ZodCheckMaxLength",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!tp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const o=rp(i);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),J4=E("$ZodCheckMinLength",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!tp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const o=rp(i);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),X4=E("$ZodCheckLengthEquals",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!tp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),n._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const o=rp(i),l=s>e.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!e.abort})}}),Tu=E("$ZodCheckStringFormat",(n,e)=>{var t,r;Qe.init(n,e),n._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(r=n._zod).check??(r.check=()=>{})}),Q4=E("$ZodCheckRegex",(n,e)=>{Tu.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),e$=E("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=q4),Tu.init(n,e)}),t$=E("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=W4),Tu.init(n,e)}),n$=E("$ZodCheckIncludes",(n,e)=>{Qe.init(n,e);const t=to(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=r,n._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),n._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:n,continue:!e.abort})}}),r$=E("$ZodCheckStartsWith",(n,e)=>{Qe.init(n,e);const t=new RegExp(`^${to(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:n,continue:!e.abort})}}),i$=E("$ZodCheckEndsWith",(n,e)=>{Qe.init(n,e);const t=new RegExp(`.*${to(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:n,continue:!e.abort})}}),s$=E("$ZodCheckOverwrite",(n,e)=>{Qe.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class o${constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
4
|
+
`+e.prev}function zl(n,e){var t=id(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Tn(n,i)?e(n[i],n):""}var s=typeof _h=="function"?_h(n):[],o;if(eo){o={};for(var l=0;l<s.length;l++)o["$"+s[l]]=s[l]}for(var c in n)Tn(n,c)&&(t&&String(Number(c))===c&&c<n.length||eo&&o["$"+c]instanceof Symbol||(M1.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof _h=="function")for(var u=0;u<s.length;u++)U1.call(n,s[u])&&r.push("["+e(s[u])+"]: "+e(n[s[u]],n));return r}var z6=uo,N6=J,Au=function(n,e,t){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===e)return r.next=i.next,t||(i.next=n.next,n.next=i),i},M6=function(n,e){if(n){var t=Au(n,e);return t&&t.value}},U6=function(n,e,t){var r=Au(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},Z6=function(n,e){return n?!!Au(n,e):!1},F6=function(n,e){if(n)return Au(n,e,!0)},H6=function(){var e,t={assert:function(r){if(!t.has(r))throw new N6("Side channel does not contain "+z6(r))},delete:function(r){var i=F6(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return M6(e,r)},has:function(r){return Z6(e,r)},set:function(r,i){e||(e={next:void 0}),U6(e,r,i)}};return t},V6=_t,yl=Lr(),B6=uo,q6=J,X0=V6("%Map%",!0),j6=yl("Map.prototype.get",!0),W6=yl("Map.prototype.set",!0),G6=yl("Map.prototype.has",!0),Y6=yl("Map.prototype.delete",!0),K6=yl("Map.prototype.size",!0),q1=!!X0&&function(){var e,t={assert:function(r){if(!t.has(r))throw new q6("Side channel does not contain "+B6(r))},delete:function(r){if(e){var i=Y6(e,r);return K6(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return j6(e,r)},has:function(r){return e?G6(e,r):!1},set:function(r,i){e||(e=new X0),W6(e,r,i)}};return t},J6=_t,ku=Lr(),X6=uo,Nl=q1,Q6=J,Qi=J6("%WeakMap%",!0),eA=ku("WeakMap.prototype.get",!0),tA=ku("WeakMap.prototype.set",!0),nA=ku("WeakMap.prototype.has",!0),rA=ku("WeakMap.prototype.delete",!0),iA=Qi?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new Q6("Side channel does not contain "+X6(i))},delete:function(i){if(Qi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return rA(e,i)}else if(Nl&&t)return t.delete(i);return!1},get:function(i){return Qi&&i&&(typeof i=="object"||typeof i=="function")&&e?eA(e,i):t&&t.get(i)},has:function(i){return Qi&&i&&(typeof i=="object"||typeof i=="function")&&e?nA(e,i):!!t&&t.has(i)},set:function(i,s){Qi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Qi),tA(e,i,s)):Nl&&(t||(t=Nl()),t.set(i,s))}};return r}:Nl,sA=J,oA=uo,aA=H6,lA=q1,cA=iA,uA=cA||lA||aA,hA=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":oA(r);throw new sA("Side channel does not contain "+i)}},delete:function(r){return!!e&&e.delete(r)},get:function(r){return e&&e.get(r)},has:function(r){return!!e&&e.has(r)},set:function(r,i){e||(e=uA()),e.set(r,i)}};return t},dA=Kn,ko=hA(),kn=J,jf={assert:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof e!="string")throw new kn("`slot` must be a string");if(ko.assert(n),!jf.has(n,e))throw new kn("`"+e+"` is not present on `O`")},get:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof e!="string")throw new kn("`slot` must be a string");var t=ko.get(n);return t&&t["$"+e]},has:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof e!="string")throw new kn("`slot` must be a string");var t=ko.get(n);return!!t&&dA(t,"$"+e)},set:function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof e!="string")throw new kn("`slot` must be a string");var r=ko.get(n);r||(r={},ko.set(n,r)),r["$"+e]=t}};Object.freeze&&Object.freeze(jf);var Wf=jf,j1=Gn,Tr=Wf,wl=function n(e,t){if(!(this instanceof n))return new n(e,t);if(e!=="normal"&&e!=="break"&&e!=="continue"&&e!=="return"&&e!=="throw")throw new j1('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Tr.set(this,"[[Type]]",e),Tr.set(this,"[[Value]]",t)};wl.prototype.type=function(){return Tr.get(this,"[[Type]]")};wl.prototype.value=function(){return Tr.get(this,"[[Value]]")};wl.prototype["?"]=function(){var e=Tr.get(this,"[[Type]]"),t=Tr.get(this,"[[Value]]");if(e==="throw")throw t;return t};wl.prototype["!"]=function(){var e=Tr.get(this,"[[Type]]");if(e!=="normal")throw new j1('Assertion failed: Completion Record is not of type "normal"');return Tr.get(this,"[[Value]]")};var Gf=wl,fA=Gf,Yf=function(e){return new fA("normal",e)},Ah,Q0;function pA(){if(Q0)return Ah;Q0=1;var n=oo;return Ah=function(){return n()&&!!Symbol.toStringTag},Ah}var mA=_t,em=mA("%Object.defineProperty%",!0),gA=pA()(),vA=Kn,yA=J,Ml=gA?Symbol.toStringTag:null,W1=function(e,t){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new yA("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ml&&(r||!vA(e,Ml))&&(em?em(e,Ml,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[Ml]=t)},G1={exports:{}},wA=_t,tm=h1,bA=bu(),nm=so,rm=J,_A=wA("%Math.floor%"),SA=function(e,t){if(typeof e!="function")throw new rm("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||_A(t)!==t)throw new rm("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&nm){var o=nm(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!r)&&(bA?tm(e,"length",t,!0,!0):tm(e,"length",t)),e},AA=fl,kA=zf,EA=S1,$A=function(){return EA(AA,kA,arguments)};(function(n){var e=SA,t=dl,r=_u,i=$A;n.exports=function(o){var l=r(arguments),c=1+o.length-(arguments.length-1);return e(l,c>0?c:0,!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(G1);var Kf=G1.exports,CA=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},TA=Object,RA=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||TA(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},IA=Kn,xA=Nf(),PA=CA,DA=RA,LA=function(e){return e&&typeof e=="object"&&IA(e,"[[DisposableResourceStack]]")&&xA(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||PA(e["[[DisposableResourceStack]]"],DA))},OA=Yn,zA=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(OA(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},NA=zA,Jf=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":NA(e)},MA=J,UA=uo,ZA=lo,FA=function(e,t){if(!ZA(t))throw new MA("Assertion failed: P is not a Property Key, got "+UA(t));return e[t]},im=J,HA=FA,VA=co,BA=lo,sm=uo,qA=function(e,t){if(!BA(t))throw new im("Assertion failed: P is not a Property Key");var r=HA(e,t);if(r!=null){if(!VA(r))throw new im(sm(t)+" is not a function: "+sm(r));return r}},od={exports:{}},jA=_t,WA=jA,om=WA("%Reflect.construct%",!0),Mc=vl;try{Mc({},"",{"[[Get]]":function(){}})}catch{Mc=null}if(Mc&&om){var am={},lm={};Mc(lm,"length",{"[[Get]]":function(){throw am},"[[Enumerable]]":!0}),od.exports=function(e){try{om(e,lm)}catch(t){return t===am}}}else od.exports=function(e){return typeof e=="function"&&!!e.prototype};var GA=od.exports,kh=J,cm=co,YA=GA,KA=function(e){if(!YA(e))throw new kh("C must be a constructor");var t={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new e(function(i,s){if(typeof t["[[Resolve]]"]<"u"||typeof t["[[Reject]]"]<"u")throw new kh("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=s});if(!cm(t["[[Resolve]]"])||!cm(t["[[Reject]]"]))throw new kh("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},um=Gn,JA=J,Eh=Su,hm=qA,XA=KA,QA=Jf,dm=Ff(),fm=Hf(),ek=function(e,t){if(QA(e)!=="Object")throw new JA("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new um("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&fm&&(r=hm(e,fm)),!r){if(!dm)throw new um("`Symbol.dispose` is not supported");if(r=hm(e,dm),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var s=XA(Promise);try{Eh(r,i),Eh(s["[[Resolve]]"],void 0,[void 0])}catch(o){s["[[Reject]]"](o)}return s["[[Promise]]"]}Eh(r,i)}}return r},tk=Gn,$h=J,nk=co,rk=Jf,ik=ek,sk=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new tk("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(e==null)e=void 0,r=void 0;else{if(typeof e<"u"&&rk(e)!=="Object")throw new $h("`V` must be an Object, or `null` or `undefined`");if(r=ik(e,t),typeof r>"u")throw new $h("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!nk(r))throw new $h("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},ok=Gn,Ul=J,ak=LA,pm=sk,lk=Lr(),ck=lk("Array.prototype.push"),Y1=function(e,t,r){if(!ak(e))throw new Ul("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new ok("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var i=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof i!="function")throw new Ul("Assertion failed: `method`, when present, must be a function");if(!e["[[DisposableResourceStack]]"])throw new Ul("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(t==null&&r==="SYNC_DISPOSE")return"UNUSED";s=pm(t,r)}else{if(typeof t<"u")throw new Ul("Assertion failed: `V` must be undefined when `method` is present");s=pm(void 0,r,i)}return ck(e["[[DisposableResourceStack]]"],s),"UNUSED"},Ch,mm;function Xf(){if(mm)return Ch;mm=1;var n=_t,e=Kf,t=Gn,r=n("%Promise.resolve%",!0),i=r&&e(r);return Ch=function(o,l){if(!i)throw new t("This environment does not support Promises.");return i(o,l)},Ch}var Th,gm;function uk(){if(gm)return Th;gm=1;var n=_t,e=Gn,t=n("%Promise%",!0),r=Su,i=Xf(),s=Jf;return Th=function(l,c,u){if(typeof l<"u"&&s(l)!=="Object")throw new e("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new e("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new e("Assertion failed: `method` must be `undefined` or a function");var f=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(t,f)},Th}var Rh,vm;function hk(){if(vm)return Rh;vm=1;var n=Gf;return Rh=function(t){return new n("throw",t)},Rh}var dk=_t,Ih=Gn,ym=J,fk=dk("%Promise%",!0),pk=Lr(),wm=pk("Promise.prototype.then",!0),mk=Gf,bm=uk(),gk=Yf,vk=Xf(),_m=hk(),yk=N1(),K1=function(e,t){if(!(t instanceof mk))throw new ym("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new ym("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,s=r.length-1;s>=0;s-=1)if(!i)i=r[s]["[[Hint]]"];else if(i!==r[s]["[[Hint]]"])throw new Ih("mixed hint stacks are not supported");for(var o=i==="ASYNC-DISPOSE"&&vk(fk,t),l=function(v){if(t.type()==="throw"){var y=t.value(),k=new yk(v,y);t=_m(k)}else t=_m(v)},c=i==="ASYNC-DISPOSE"&&function(y){return wm(o,function(){var k=bm(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!k)throw new Ih("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return wm(k,gk)},l)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")o=c(r[u]);else{var f=r[u];try{var m=bm(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(m)throw new Ih("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(v){l(v)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?o:t},J1=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Eu=Pf,Qf=J,wk=Su,ho=Uf,bk=vl,X1=co,_k=Yf,Je=Wf,Sk=W1,Q1=Fi.supportsDescriptors,Ak=Kf,ep=Y1,kk=K1,ev=J1,Sm=Ff(),yt=function n(){if(!(this instanceof n)||Je.has(this,"[[DisposableState]]")||Je.has(this,"[[DisposeCapability]]"))throw new Qf("can only be used with new");Je.set(this,"[[DisposableState]]","PENDING"),Je.set(this,"[[DisposeCapability]]",ev())},tv=function(){var e=this;return Je.assert(e,"[[DisposableState]]"),Je.get(e,"[[DisposableState]]")==="DISPOSED"},bl=Ak(tv);Q1?bk(yt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":tv}):yt.prototype.disposed=!1;var nv=function(e){Je.set(e,"[[DisposableState]]","DISPOSED"),Q1||(e.disposed=!0)};ho(yt.prototype,"dispose",function(){var e=this;if(!bl(e))return nv(e),kk(Je.get(e,"[[DisposeCapability]]"),_k())["?"]()});ho(yt.prototype,"use",function(e){var t=this;if(bl(t))throw new Eu("a disposed stack can not use anything new");return ep(Je.get(t,"[[DisposeCapability]]"),e,"SYNC-DISPOSE"),e});ho(yt.prototype,"adopt",function(e,t){var r=this;if(bl(r))throw new Eu("a disposed stack can not use anything new");if(!X1(t))throw new Qf("`onDispose` must be a function");var i=function(){return wk(t,void 0,[e])};return ep(Je.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),e});ho(yt.prototype,"defer",function(e){var t=this;if(bl(t))throw new Eu("a disposed stack can not defer anything new");if(!X1(e))throw new Qf("`onDispose` must be a function");ep(Je.get(t,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",e)});ho(yt.prototype,"move",function(){var e=this;if(bl(e))throw new Eu("a disposed stack can not use anything new");var t=new yt;return Je.set(t,"[[DisposeCapability]]",Je.get(e,"[[DisposeCapability]]")),Je.set(e,"[[DisposeCapability]]",ev()),nv(e),t});Sm&&ho(yt.prototype,Sm,yt.prototype.dispose);Sk(yt.prototype,"DisposableStack");var Ek=yt,$k=Ek,Ck=function(){return typeof DisposableStack=="function"?DisposableStack:$k},Tk=Fi,Rk=If(),Ik=Ck,xk=function(){var e=Ik();return Tk(Rk,{DisposableStack:e},{DisposableStack:!0}),e},Pk=_t,$u=Pf,tp=J,Am=Pk("%Promise%",!0),np=Y1,Dk=Su,fo=Uf,Lk=vl,Ok=K1,rv=co,iv=J1,zk=Yf,km=Xf(),Xe=Wf,Nk=W1,sv=Fi.supportsDescriptors,Mk=Kf,Uk=Lr(),Zk=Uk("Promise.prototype.then",!0),Em=Hf(),wt=function n(){if(!(this instanceof n)||Xe.has(this,"[[AsyncDisposableState]]")||Xe.has(this,"[[DisposeCapability]]"))throw new tp("can only be used with new");Xe.set(this,"[[AsyncDisposableState]]","pending"),Xe.set(this,"[[DisposeCapability]]",iv())},ov=function(){var e=this;return Xe.assert(e,"[[AsyncDisposableState]]"),Xe.get(e,"[[AsyncDisposableState]]")==="disposed"},_l=Mk(ov);sv?Lk(wt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":ov}):wt.prototype.disposed=!1;var av=function(e){Xe.set(e,"[[AsyncDisposableState]]","disposed"),sv||(e.disposed=!0)};fo(wt.prototype,"disposeAsync",function(){var e=this;return _l(e)?km(Am):(av(e),Zk(km(Am,Ok(Xe.get(e,"[[DisposeCapability]]"),zk())),function(t){return t["?"]()}))});fo(wt.prototype,"use",function(e){var t=this;if(_l(t))throw new $u("a disposed stack can not use anything new");return np(Xe.get(t,"[[DisposeCapability]]"),e,"ASYNC-DISPOSE"),e});fo(wt.prototype,"adopt",function(e,t){var r=this;if(_l(r))throw new $u("a disposed stack can not use anything new");if(!rv(t))throw new tp("`onDisposeAsync` must be a function");var i=function(){return Dk(t,void 0,[e])};return i.value=e,np(Xe.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),e});fo(wt.prototype,"defer",function(e){var t=this;if(_l(t))throw new $u("a disposed stack can not defer anything new");if(!rv(e))throw new tp("`onDispose` must be a function");np(Xe.get(t,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",e)});fo(wt.prototype,"move",function(){var e=this;if(_l(e))throw new $u("a disposed stack can not use anything new");var t=new wt;return Xe.set(t,"[[DisposeCapability]]",Xe.get(e,"[[DisposeCapability]]")),Xe.set(e,"[[DisposeCapability]]",iv()),av(e),t});Em&&fo(wt.prototype,Em,wt.prototype.disposeAsync);Nk(wt.prototype,"AsyncDisposableStack");var Fk=wt,Hk=Fk,Vk=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:Hk},Bk=Fi,qk=If(),jk=Vk,Wk=function(){var e=jk();return Bk(qk,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},Gk=B8,Yk=X8,Kk=xk,Jk=Wk,Xk=function(){Gk(),Yk(),Kk(),Jk()};Xk();const $m=new WeakMap;function Qk(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function es(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function Cm(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function eE(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class tE{constructor(){$(this,"entries",new Map);$(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw Cm();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw Cm();if(t.constructor.name==="AsyncFunction")throw eE();this.storeFactory(e,t)}has(e){var t;return((t=this.entries.get(e))==null?void 0:t.factory)!==void 0}resolve(e){return this.resolveAny(e)}storeFactory(e,t){const r=this.getOrCreateEntry(e);r.factory=t,r.instance=void 0,r.error=void 0}validateClassRegistration(e){const t=$m.get(e);if(t){if(e.length!==t.length)throw new Error(`${es(e)} cannot be registered with register(Class). @injectable(...) declared ${t.length} dependencies but constructor arity is ${e.length}. Use register(Key, () => value) instead.`);return}if(e.length!==0)throw new Error(`${es(e)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(e){const t=$m.get(e);if(!t)return new e;const r=t.map(i=>this.resolveAny(i));return new e(...r)}resolveAny(e){return this.getOrCreateEntry(e).proxy}getOrCreateEntry(e){let t=this.entries.get(e);return t||(t={key:e},t.proxy=this.createProxy(t),this.entries.set(e,t),t)}createProxy(e){return new Proxy({},{get:(t,r)=>{if(r==="then")return;const i=this.getInstance(e),s=Reflect.get(i,r,i);return typeof s=="function"?s.bind(i):s},set:(t,r,i)=>{const s=this.getInstance(e);return Reflect.set(s,r,i,s)},has:(t,r)=>{const i=this.getInstance(e);return r in i}})}getInstance(e){if(e.instance)return e.instance;if(e.error)throw e.error;if(!e.factory)throw new Error(`${es(e.key)} was resolved but never registered`);const t=this.constructionStack.indexOf(e.key);if(t!==-1){const r=[...this.constructionStack.slice(t),e.key].map(i=>es(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(e.key);try{const r=e.factory();if(Qk(r))throw new Error(`Factory for ${es(e.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${es(e.key)} returned a non-object value. Wrap primitives in an object.`);return e.instance=r,r}catch(r){throw e.error=r,r}finally{this.constructionStack.pop()}}}const lv=new tE,nE=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function rE(n){for(const e of Object.keys(n))if(nE.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function iE(n,e){rE(e);for(const t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0})}function Lt(){class n extends Event{constructor(t,r){const{type:i,bubbles:s,cancelable:o,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(t,{bubbles:s,cancelable:o,composed:l}),iE(this,c)}}return n}class zr extends globalThis.EventTarget{}const sE="X-Television-Client-Meta",oE="telemetry-activity",aE="telemetry-signal",cv={kind:"single",full_screen:!1},uv={width:560,height:740};function lE(n){return n.layout.flatMap(e=>e.artifactIds)}function cE(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const e=[];for(const[t,r]of n.entries())uE(r,t,e);return{valid:e.length===0,errors:e}}function aa(n){return n.flatMap(e=>e.artifactIds)}function ad(n,e){return n.flatMap(t=>{if(!t.artifactIds.includes(e))return[t];const r=t.artifactIds.filter(i=>i!==e);return r.length===0?[]:[{...t,artifactIds:r}]})}function uE(n,e,t){if(!xh(n)){t.push(`Page ${e} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&t.push(`Page ${e} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?t.push(`Page ${e} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&t.push(`Page ${e} artifact ids must be non-empty strings`),!xh(n.geometry)){t.push(`Page ${e} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&t.push(`Page ${e} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){t.push(`Page ${e} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&t.push(`Page ${e} single geometry must include a boolean full_screen`),!xh(n.size)){t.push(`Page ${e} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&t.push(`Page ${e} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&t.push(`Page ${e} size ${r} must be a finite positive number`)}}function xh(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const gt=Lt(),uc=Lt(),Tm=Lt(),hE=Lt(),dE=Lt();function hv(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const po=hv("RequestError"),Rm=hv("ValidationError"),fE=200,pE=300,Zl=401;class mE{constructor(e,t){$(this,"serverURL");$(this,"token");$(this,"onUnauthorized");$(this,"telemetryMeta");this.serverURL=e.replace(/\/$/,""),this.token=t.token,this.onUnauthorized=t.onUnauthorized,this.telemetryMeta=t.telemetryMeta}async requestJSON(e,t,r){var o;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),s=await gE(i);if(!i.ok||i.status<fE||i.status>=pE)throw i.status===Zl&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(typeof s.error=="string"?s.error:i.statusText,i.status);return s}async requestVoid(e,t,r){var s;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Zl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Ph(i,i.statusText),i.status)}async requestText(e,t){var i;const r=await this.request(e,t);if(!r.ok)throw r.status===Zl&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Ph(r,r.statusText),r.status);return r.text()}async requestRawVoid(e,t,r){var s;const i=await this.request(e,t,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Zl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Ph(i,i.statusText),i.status)}createError(e,t){const r={serverURL:this.serverURL};return t!==void 0&&(r.status=t),new po(e,r)}async request(e,t,r,i){const s=`${this.serverURL}${t}`;try{return await fetch(s,{method:e,headers:this.buildHeaders(i),body:r})}catch(o){throw this.createError(o instanceof Error?o.message:"Failed to reach server")}}buildHeaders(e){const t={...e??{}};return this.token&&(t.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(t[sE]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function gE(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function Ph(n,e){try{const t=await n.json();if(typeof t.error=="string")return t.error;if(typeof t.message=="string")return t.message}catch{}return e}function vE(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var In,Qc,dv;class yE{constructor(e){g(this,Qc);g(this,In);d(this,In,e)}list(){return a(this,In).requestJSON("GET","/channels")}async get(e={}){const t=await h(this,Qc,dv).call(this,e.channelID);return a(this,In).requestJSON("GET",`/channels/${encodeURIComponent(t)}`)}create(e){const t={name:e.name};return e.id!==void 0&&(t.id=e.id),a(this,In).requestJSON("POST","/channels",t)}update(e){const{channelID:t,...r}=e;return a(this,In).requestJSON("PATCH",`/channels/${encodeURIComponent(t)}`,r)}remove(e){return a(this,In).requestJSON("DELETE",`/channels/${encodeURIComponent(e.channelID)}`)}}In=new WeakMap,Qc=new WeakSet,dv=async function(e){if(e!==void 0)return e;const{channels:t}=await this.list();if(t.length===1)return t[0].id;throw t.length===0?new Rm("channelID is required, but no channels exist."):new Rm(`channelID is required when multiple channels exist. Available channels: ${vE(t)}`)};var xn;class wE{constructor(e){g(this,xn);d(this,xn,e)}create(e){const t={kind:e.kind,title:e.title};switch(e.kind){case"path":t.path=e.path;break;case"url":t.url=e.url;break}return t.channelID=e.channelID,a(this,xn).requestJSON("POST","/artifacts",t)}list(e={}){const t=new URLSearchParams;e.channelID!==void 0&&t.set("channelID",e.channelID);const r=t.toString();return a(this,xn).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(e){return a(this,xn).requestJSON("GET",`/artifacts/${encodeURIComponent(e.artifactID)}`)}update(e){const t={};return e.title!==void 0&&(t.title=e.title),e.path!==void 0&&(t.path=e.path),e.url!==void 0&&(t.url=e.url),a(this,xn).requestJSON("PATCH",`/artifacts/${encodeURIComponent(e.artifactID)}`,t)}delete(e){return a(this,xn).requestJSON("DELETE",`/artifacts/${encodeURIComponent(e.artifactID)}`)}}xn=new WeakMap;var ys;class bE{constructor(e){g(this,ys);d(this,ys,e)}get(e){return a(this,ys).requestText("GET",`/markdown/${encodeURIComponent(e.artifactID)}`)}update(e){return a(this,ys).requestRawVoid("PUT",`/markdown/${encodeURIComponent(e.artifactID)}`,e.content)}}ys=new WeakMap;var Xr;class _E{constructor(e){g(this,Xr);d(this,Xr,e)}status(){return a(this,Xr).requestJSON("GET","/telemetry")}enable(){return a(this,Xr).requestJSON("POST","/telemetry/enable")}disable(){return a(this,Xr).requestJSON("POST","/telemetry/disable")}}Xr=new WeakMap;var Qr;class SE{constructor(e){g(this,Qr);d(this,Qr,e)}get(){return a(this,Qr).requestJSON("GET","/display")}patch(e){const t={};return e.focusedChannelId!==void 0&&(t.focusedChannelId=e.focusedChannelId),e.pinnedChannelIds!==void 0&&(t.pinnedChannelIds=e.pinnedChannelIds),e.activeThemeName!==void 0&&(t.activeThemeName=e.activeThemeName),a(this,Qr).requestVoid("PATCH","/display",t)}focus(e){return a(this,Qr).requestJSON("POST","/display/focus",{artifactID:e.artifactID})}}Qr=new WeakMap;var Vt;class AE{constructor(e,t={}){$(this,"channels");$(this,"artifacts");$(this,"display");$(this,"markdown");$(this,"telemetry");g(this,Vt);d(this,Vt,new mE(e,t)),this.channels=new yE(a(this,Vt)),this.artifacts=new wE(a(this,Vt)),this.display=new SE(a(this,Vt)),this.markdown=new bE(a(this,Vt)),this.telemetry=new _E(a(this,Vt))}health(){return a(this,Vt).requestJSON("GET","/health")}}Vt=new WeakMap;const ld="0.0.0",kE=/^\d+\.\d+\.\d+$/,EE=3;function rp(n){return kE.test(n)}function fv(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<EE;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function $E(n,e){return n===ld||e===ld?!1:n!==e}const CE=400,TE=404,pv=500,RE=600,IE={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,acpEnabled:!1};var ee,pa,ma,Pn,Ae,ae,ei,nr,ti,Dn,tt,ws,ga,P,Vr,cd,ud,mv,hd,gv,hc,dd,vv,is,yv,$n,fd,wv,Ze;class xE extends zr{constructor(t){super();g(this,P);g(this,ee);g(this,pa);g(this,ma);g(this,Pn,new Set);$(this,"pendingPageWrites",new Map);g(this,Ae,new Map);g(this,ae,LE());g(this,ei);g(this,nr,!1);g(this,ti,!1);g(this,Dn,0);g(this,tt,!1);g(this,ws,()=>{if(a(this,tt))return;const t=a(this,ee).connection.status==="connected";t&&!a(this,ti)?(d(this,ti,!0),h(this,P,yv).call(this)):!t&&a(this,ti)&&(d(this,ti,!1),d(this,Dn,a(this,Dn)+1)),h(this,P,$n).call(this)});g(this,ga,t=>{if(a(this,tt)||t.serverURL!==a(this,ee).connection.url)return;for(const i of a(this,Pn))i.push(t.event);const r=t.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Tm("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){a(this,nr)&&Uc(a(this,ae),a(this,Ae),r.channelID,r.artifactID)&&h(this,P,$n).call(this),this.dispatchEvent(new hE("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new dE("theme-changed",{themeName:r.themeName})),a(this,nr)&&(Fl(a(this,ae),r,this.pendingPageWrites,a(this,Ae)),Dh(a(this,ae),a(this,Ae)),h(this,P,$n).call(this))});d(this,ee,t.connectionOwner),d(this,pa,t.navigationKeyHandler),d(this,ma,t.retainedGateHalted??(()=>!1)),d(this,ei,h(this,P,fd).call(this)),a(this,ee).addEventListener("change",a(this,ws)),a(this,ee).addEventListener("server-event",a(this,ga)),a(this,ws).call(this)}get snapshot(){return a(this,ei)}handleNavigationKey(t){var r;h(this,P,Ze).call(this),(r=a(this,pa))==null||r.call(this,t)}authenticate(t){return h(this,P,Ze).call(this),a(this,ee).authenticate(t)}async createChannel(t){h(this,P,Ze).call(this);const{channel:r}=await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.create({name:t}),()=>h(this,P,mv).call(this));return r}focusChannel(t){return h(this,P,Ze).call(this),h(this,P,Vr).call(this,a(this,ee).connection.client.display.patch({focusedChannelId:t}),()=>h(this,P,ud).call(this))}setPinnedChannelIds(t){return h(this,P,Ze).call(this),h(this,P,Vr).call(this,a(this,ee).connection.client.display.patch({pinnedChannelIds:[...t]}),()=>h(this,P,ud).call(this))}selectPage(t,r){h(this,P,Ze).call(this),Uc(a(this,ae),a(this,Ae),t,r)&&h(this,P,$n).call(this)}async renameChannel(t,r){h(this,P,Ze).call(this),await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>h(this,P,hd).call(this,t))}async deleteChannel(t){h(this,P,Ze).call(this),await h(this,P,Vr).call(this,a(this,ee).connection.client.channels.remove({channelID:t}),()=>h(this,P,gv).call(this,t))}updateChannelPages(t,r){h(this,P,Ze).call(this);const i=cE(r),s=a(this,ae).channels.get(t);if(!i.valid||!s)return Promise.resolve();const o=Yr(r),l=Yr(s.channel.layout),c={previousPages:l};return Ni(a(this,Ae),t,l,o),s.channel={...s.channel,layout:o},this.pendingPageWrites.set(t,c),h(this,P,$n).call(this),a(this,ee).connection.client.channels.update({channelID:t,layout:Yr(o)}).then(()=>{this.pendingPageWrites.get(t)===c&&this.pendingPageWrites.delete(t)},async u=>{if(a(this,tt))throw u;const f=this.pendingPageWrites.get(t)===c;if(f&&this.pendingPageWrites.delete(t),xm(u))throw await h(this,P,cd).call(this,()=>h(this,P,hd).call(this,t)),u;if(!f||!UE(u))throw u;const m=a(this,ae).channels.get(t);if(!m)throw u;const v=Yr(c.previousPages);throw Ni(a(this,Ae),t,m.channel.layout,v),m.channel={...m.channel,layout:v},h(this,P,$n).call(this),u})}async deleteArtifact(t){h(this,P,Ze).call(this);const r=Pm(a(this,ae),t);await h(this,P,Vr).call(this,a(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>h(this,P,vv).call(this,t,r))}readMarkdown(t){return h(this,P,Ze).call(this),a(this,ee).connection.client.markdown.get({artifactID:t})}writeMarkdown(t,r){return h(this,P,Ze).call(this),a(this,ee).connection.client.markdown.update({artifactID:t,content:r})}getArtifactViewURL(t){return h(this,P,Ze).call(this),a(this,ee).connection.getViewURL(t)}getArtifactContentURL(t){return h(this,P,Ze).call(this),a(this,ee).connection.getContentURL(t)}dispose(){a(this,tt)||(d(this,tt,!0),d(this,Dn,a(this,Dn)+1),a(this,Pn).clear(),this.pendingPageWrites.clear(),a(this,Ae).clear(),a(this,ee).removeEventListener("change",a(this,ws)),a(this,ee).removeEventListener("server-event",a(this,ga)))}}ee=new WeakMap,pa=new WeakMap,ma=new WeakMap,Pn=new WeakMap,Ae=new WeakMap,ae=new WeakMap,ei=new WeakMap,nr=new WeakMap,ti=new WeakMap,Dn=new WeakMap,tt=new WeakMap,ws=new WeakMap,ga=new WeakMap,P=new WeakSet,Vr=async function(t,r){try{return await t}catch(i){throw!a(this,tt)&&xm(i)&&await h(this,P,cd).call(this,r),i}},cd=async function(t){try{await t()}catch{}},ud=function(){const t=a(this,ee).connection.client;return h(this,P,is).call(this,()=>t.display.get(),r=>h(this,P,hc).call(this,r))},mv=function(){const t=a(this,ee).connection.client;return h(this,P,is).call(this,async()=>{const[{channels:r},i]=await Promise.all([t.channels.list(),t.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const s=new Set(r.map(({id:o})=>o));for(const o of a(this,ae).channels.keys())s.has(o)||(this.pendingPageWrites.delete(o),a(this,Ae).delete(o),a(this,ae).channels.delete(o));for(const o of r)a(this,ae).channels.has(o.id)||a(this,ae).channels.set(o.id,{channel:gs(o),artifacts:new Map});h(this,P,hc).call(this,i)})},hd=function(t){const r=a(this,ee).connection.client;return h(this,P,is).call(this,()=>Lh(()=>r.channels.get({channelID:t})),i=>h(this,P,dd).call(this,t,i))},gv=function(t){const r=a(this,ee).connection.client;return h(this,P,is).call(this,async()=>{const[i,s]=await Promise.all([Lh(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:s}},({detail:i,display:s})=>{h(this,P,dd).call(this,t,i),h(this,P,hc).call(this,s)})},hc=function(t){a(this,ae).display=md(t),a(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},dd=function(t,r){this.pendingPageWrites.delete(t);const i=a(this,ae).channels.get(t);if(r===null){a(this,Ae).delete(t),a(this,ae).channels.delete(t);return}Ni(a(this,Ae),t,(i==null?void 0:i.channel.layout)??[],r.channel.layout),a(this,ae).channels.set(t,{channel:gs(r.channel),artifacts:new Map(r.artifacts.map(s=>[s.id,structuredClone(s)]))})},vv=function(t,r){const i=a(this,ee).connection.client;return h(this,P,is).call(this,()=>Lh(()=>i.artifacts.get({artifactID:t})),s=>{const o=Pm(a(this,ae),t)??r;if(s===null){o!==null&&Fl(a(this,ae),{type:"artifact-removed",channelID:o,artifactID:t},this.pendingPageWrites,a(this,Ae));return}const l=o===null?void 0:a(this,ae).channels.get(o);l==null||l.artifacts.set(t,structuredClone(s.artifact))})},is=async function(t,r){const i=a(this,Dn),s=[];a(this,Pn).add(s);try{const o=await t();if(a(this,tt)||i!==a(this,Dn))return;r(o);for(const l of s)Fl(a(this,ae),l,this.pendingPageWrites,a(this,Ae));Dh(a(this,ae),a(this,Ae)),h(this,P,$n).call(this)}finally{a(this,Pn).delete(s)}},yv=async function(){const t=++rh(this,Dn)._,r=a(this,ee).connection,i=r.client,s=[];a(this,Pn).add(s);try{const[{channels:o},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(o.map(({id:m})=>i.channels.get({channelID:m})));if(a(this,tt)||t!==a(this,Dn))return;const u={channels:new Map,display:md(l)};for(const m of c)u.channels.set(m.channel.id,{channel:gs(m.channel),artifacts:new Map(m.artifacts.map(v=>[v.id,structuredClone(v)]))});OE(a(this,Ae),a(this,ae),u);for(const m of s)Fl(u,m,this.pendingPageWrites,a(this,Ae));Dh(u,a(this,Ae));const f=a(this,nr)?PE(a(this,ae),u):[];this.pendingPageWrites.clear(),d(this,ae,u),d(this,nr,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,P,$n).call(this);for(const m of f)this.dispatchEvent(new Tm("artifact-content-changed",{artifactID:m}))}catch{}finally{a(this,Pn).delete(s)}},$n=function(){a(this,tt)||(d(this,ei,h(this,P,fd).call(this)),h(this,P,wv).call(this),this.dispatchEvent(new gt("change")))},fd=function(){var s;const t=[...a(this,ae).channels.values()].map(o=>NE(o,a(this,Ae).get(o.channel.id))),r=t.find(({id:o})=>o===a(this,ae).display.focusedChannelId)??null,i=a(this,ee).connection;return Object.freeze({ready:a(this,nr),channels:Object.freeze(t),display:ME(a(this,ae).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||a(this,ma).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:a(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:DE(((s=i.updateState)==null?void 0:s.desktop)??null)})})},wv=function(){const t=a(this,ei).focusedChannel;a(this,ee).connection.acpClient.setChannelContext(t?{channelID:t.id,channelName:t.name}:null)},Ze=function(){if(a(this,tt))throw new Error("ApplicationService is disposed")};function PE(n,e){const t=e.display.focusedChannelId;if(t===null||n.display.focusedChannelId!==t)return[];const r=n.channels.get(t),i=e.channels.get(t);if(!r||!i)return[];const s=new Set(aa(r.channel.layout));return aa(i.channel.layout).filter(o=>{var l,c;return s.has(o)&&((l=r.artifacts.get(o))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(o))==null?void 0:c.kind)==="path"})}function DE(n){return n===null?null:Object.freeze({...n})}function LE(){return{channels:new Map,display:md(IE)}}function Fl(n,e,t,r){switch(e.type){case"channel-created":r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:gs(e.channel),artifacts:new Map});return;case"channel-updated":{t.delete(e.channel.id);const i=n.channels.get(e.channel.id);if(!i){r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:gs(e.channel),artifacts:new Map});return}Ni(r,e.channel.id,i.channel.layout,e.channel.layout);const s=new Set(aa(e.channel.layout));i.channel=gs(e.channel);for(const o of i.artifacts.keys())s.has(o)||i.artifacts.delete(o);return}case"channel-removed":t.delete(e.channelID),r.delete(e.channelID),n.channels.delete(e.channelID);return;case"channel-changed":n.display.focusedChannelId=e.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...e.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=e.themeName;return;case"artifact-created":{const i=n.channels.get(e.channelID);if(!i)return;const s=t.get(e.channelID);if(s&&(s.previousPages=Im(s.previousPages,e.artifact.id)),!aa(i.channel.layout).includes(e.artifact.id)){const o=i.channel.layout,l=Im(o,e.artifact.id);Ni(r,e.channelID,o,l),i.channel={...i.channel,layout:l}}i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(e.artifact.id)){i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}return;case"artifact-removed":{const i=n.channels.get(e.channelID);if(!i)return;const s=t.get(e.channelID);s&&(s.previousPages=ad(s.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const o=i.channel.layout,l=ad(o,e.artifactID);Ni(r,e.channelID,o,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Uc(n,r,e.channelID,e.artifactID);return;case"artifact-content-changed":return;default:return ZE(e)}}function OE(n,e,t){var r;for(const i of n.keys())t.channels.has(i)||n.delete(i);for(const[i,s]of t.channels)Ni(n,i,((r=e.channels.get(i))==null?void 0:r.channel.layout)??[],s.channel.layout)}function Ni(n,e,t,r){const i=n.get(e);if(i===void 0)return;if(r.length===0){n.delete(e);return}const s=pd(r,i);if(s!==-1){n.set(e,[...r[s].artifactIds]);return}const o=pd(t,i),l=o===-1?0:Math.min(o,r.length-1);n.set(e,[...r[l].artifactIds])}function Uc(n,e,t,r){const i=n.channels.get(t),s=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!s)return!1;const o=e.get(t);return o&&zE(o,s.artifactIds)?!1:(e.set(t,[...s.artifactIds]),!0)}function Dh(n,e){var i,s;const t=n.display.focusedChannelId;if(t===null||e.has(t))return;const r=(s=(i=n.channels.get(t))==null?void 0:i.channel.layout[0])==null?void 0:s.artifactIds[0];r!==void 0&&Uc(n,e,t,r)}function pd(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function zE(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function NE(n,e){const t=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=e===void 0?0:pd(n.channel.layout,e),i=t[r]??t[0]??null,s=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),o={id:n.channel.id,name:n.channel.name,pages:t,selectedPage:i,artifacts:s};return Object.freeze(n.channel.onboarding?{...o,onboarding:Object.freeze({...n.channel.onboarding})}:o)}function ME(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled})}function Im(n,e){return aa(n).includes(e)?Yr(n):[...Yr(n),{artifactIds:[e],geometry:{...cv},size:{...uv}}]}function UE(n){return n instanceof po&&n.status!==void 0&&n.status>=CE&&n.status<pv}function xm(n){return n instanceof po&&(n.status===void 0||n.status>=pv&&n.status<RE)}async function Lh(n){try{return await n()}catch(e){if(e instanceof po&&e.status===TE)return null;throw e}}function Pm(n,e){for(const[t,r]of n.channels)if(r.artifacts.has(e))return t;return null}function Yr(n){return n.map(e=>({artifactIds:[...e.artifactIds],geometry:{...e.geometry},size:{...e.size}}))}function gs(n){return{id:n.id,name:n.name,layout:Yr(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function md(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled}}function ZE(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function FE(n,e){var c;const t=n.snapshot,r=t.focusedChannel;if(e==="ArrowLeft"||e==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),f=u+(e==="ArrowLeft"?-1:1),m=(c=r.pages[f])==null?void 0:c.artifactIds[0];return u===-1||m===void 0?!1:(Dm(),n.selectPage(r.id,m),!0)}const i=HE(t),s=r===null?-1:i.indexOf(r.id),o=s+(e==="ArrowUp"?-1:1),l=i[o];return s===-1||l===void 0?!1:(Dm(),n.focusChannel(l).catch(()=>{}),!0)}function HE(n){const e=new Map(n.channels.map(s=>[s.id,s])),t=n.display.pinnedChannelIds.filter(s=>e.has(s)),r=new Set(t),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return[...t,...i]}function Dm(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const bv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Zc=32,VE=16,_v=10,Lm=0xffffffffffff;var Kr;(function(n){n.Base32IncorrectEncoding="B32_ENC_INVALID",n.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",n.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",n.EncodeTimeNegative="ENC_TIME_NEG",n.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",n.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",n.PRNGDetectFailure="PRNG_DETECT",n.ULIDInvalid="ULID_INVALID",n.Unexpected="UNEXPECTED",n.UUIDInvalid="UUID_INVALID"})(Kr||(Kr={}));class Oo extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function BE(n){const e=Math.floor(n()*Zc)%Zc;return bv.charAt(e)}function qE(n){const e=jE(),t=e&&(e.crypto||e.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]/256};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/256;throw new Oo(Kr.PRNGDetectFailure,"Failed to find a reliable PRNG")}function jE(){return YE()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function WE(n,e){let t="";for(;n>0;n--)t=BE(e)+t;return t}function GE(n,e=_v){if(isNaN(n))throw new Oo(Kr.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>Lm)throw new Oo(Kr.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Lm}: ${n}`);if(n<0)throw new Oo(Kr.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Oo(Kr.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let t,r="";for(let i=e;i>0;i--)t=n%Zc,r=bv.charAt(t)+r,n=(n-t)/Zc;return r}function YE(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ip(n,e){const t=qE(),r=Date.now();return GE(r,_v)+WE(VE,t)}const zo=Lt(),Sv=Lt(),Av=Lt(),KE=Lt(),Oh=Lt(),JE="store-";function Rr(n){return new URL(n).origin}function XE(){return{authTokens:{}}}var ni,ri,ii;class QE extends zr{constructor(t,r,i={}){super();g(this,ni);g(this,ri);g(this,ii);d(this,ni,`${JE}${t}`),d(this,ri,i.storage??t4());const s=a(this,ri).getItem(a(this,ni));s===null?(d(this,ii,r),a(this,ri).setItem(a(this,ni),JSON.stringify(r))):d(this,ii,n4(JSON.parse(s),r))}get(){return a(this,ii)}set(t){d(this,ii,t),a(this,ri).setItem(a(this,ni),JSON.stringify(t)),this.dispatchEvent(new gt("change"))}}ni=new WeakMap,ri=new WeakMap,ii=new WeakMap;function Om(n,e){return n.authTokens[Rr(e)]??null}function zm(n,e,t){return{authTokens:{...n.authTokens,[Rr(e)]:t}}}function e4(n,e){const t=Rr(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function t4(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function n4(n,e){if(typeof n!="object"||n===null||Array.isArray(n))return e;const t=n.authTokens;if(typeof t!="object"||t===null||Array.isArray(t))return e;const r={};for(const[i,s]of Object.entries(t))if(typeof s=="string")try{r[Rr(i)]=s}catch{}return{authTokens:r}}function E(n,e,t){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),e(l,c);const u=o.prototype,f=Object.keys(u);for(let m=0;m<f.length;m++){const v=f[m];v in l||(l[v]=u[v].bind(l))}}const i=(t==null?void 0:t.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function o(l){var c;const u=t!=null&&t.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var c,u;return t!=null&&t.Parent&&l instanceof t.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(o,"name",{value:n}),o}class vs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class kv extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ev={};function Ir(n){return Ev}function $v(n){const e=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>e.indexOf(+r)===-1).map(([r,i])=>i)}function gd(n,e){return typeof e=="bigint"?e.toString():e}function Cu(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function sp(n){return n==null}function op(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function r4(n,e){const t=(n.toString().split(".")[1]||"").length,r=e.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=t>i?t:i,o=Number.parseInt(n.toFixed(s).replace(".","")),l=Number.parseInt(e.toFixed(s).replace(".",""));return o%l/10**s}const Nm=Symbol("evaluating");function se(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==Nm)return r===void 0&&(r=Nm,r=t()),r},set(i){Object.defineProperty(n,e,{value:i})},configurable:!0})}function Vi(n,e,t){Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Nr(...n){const e={};for(const t of n){const r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function Mm(n){return JSON.stringify(n)}function i4(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Cv="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function la(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const s4=Cu(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function to(n){if(la(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(la(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Tv(n){return to(n)?{...n}:Array.isArray(n)?[...n]:n}const o4=new Set(["string","number","symbol"]);function no(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mr(n,e,t){const r=new n._zod.constr(e??n._zod.def);return(!e||t!=null&&t.parent)&&(r._zod.parent=n),r}function N(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function a4(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const l4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function c4(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Nr(n._zod.def,{get shape(){const o={};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(o[l]=t.shape[l])}return Vi(this,"shape",o),o},checks:[]});return Mr(n,s)}function u4(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Nr(n._zod.def,{get shape(){const o={...n._zod.def.shape};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete o[l]}return Vi(this,"shape",o),o},checks:[]});return Mr(n,s)}function h4(n,e){if(!to(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const s=n._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Nr(n._zod.def,{get shape(){const s={...n._zod.def.shape,...e};return Vi(this,"shape",s),s}});return Mr(n,i)}function d4(n,e){if(!to(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Nr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return Vi(this,"shape",r),r}});return Mr(n,t)}function f4(n,e){const t=Nr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e._zod.def.shape};return Vi(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Mr(n,t)}function p4(n,e,t){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Nr(e._zod.def,{get shape(){const l=e._zod.def.shape,c={...l};if(t)for(const u in t){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return Vi(this,"shape",c),c},checks:[]});return Mr(e,o)}function m4(n,e,t){const r=Nr(e._zod.def,{get shape(){const i=e._zod.def.shape,s={...i};if(t)for(const o in t){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=new n({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new n({type:"nonoptional",innerType:i[o]});return Vi(this,"shape",s),s}});return Mr(e,r)}function ds(n,e=0){var t;if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(((t=n.issues[r])==null?void 0:t.continue)!==!0)return!0;return!1}function fs(n,e){return e.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(n),t})}function Hl(n){return typeof n=="string"?n:n==null?void 0:n.message}function xr(n,e,t){var i,s,o,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const f=Hl((o=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,n))??Hl((l=e==null?void 0:e.error)==null?void 0:l.call(e,n))??Hl((c=t.customError)==null?void 0:c.call(t,n))??Hl((u=t.localeError)==null?void 0:u.call(t,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function ap(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function ca(...n){const[e,t,r]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}const Rv=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,gd,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Iv=E("$ZodError",Rv),xv=E("$ZodError",Rv,{Parent:Error});function g4(n,e=t=>t.message){const t={},r=[];for(const i of n.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}function v4(n,e=t=>t.message){const t={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)t._errors.push(e(s));else{let o=t,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(e(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return r(n),t}const lp=n=>(e,t,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise)throw new vs;if(o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>xr(c,s,Ir())));throw Cv(l,i==null?void 0:i.callee),l}return o.value},cp=n=>async(e,t,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>xr(c,s,Ir())));throw Cv(l,i==null?void 0:i.callee),l}return o.value},Tu=n=>(e,t,r)=>{const i=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:t,issues:[]},i);if(s instanceof Promise)throw new vs;return s.issues.length?{success:!1,error:new(n??Iv)(s.issues.map(o=>xr(o,i,Ir())))}:{success:!0,data:s.value}},y4=Tu(xv),Ru=n=>async(e,t,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=e._zod.run({value:t,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new n(s.issues.map(o=>xr(o,i,Ir())))}:{success:!0,data:s.value}},w4=Ru(xv),b4=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lp(n)(e,t,i)},_4=n=>(e,t,r)=>lp(n)(e,t,r),S4=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return cp(n)(e,t,i)},A4=n=>async(e,t,r)=>cp(n)(e,t,r),k4=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Tu(n)(e,t,i)},E4=n=>(e,t,r)=>Tu(n)(e,t,r),$4=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ru(n)(e,t,i)},C4=n=>async(e,t,r)=>Ru(n)(e,t,r),T4=/^[cC][^\s-]{8,}$/,R4=/^[0-9a-z]+$/,I4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x4=/^[0-9a-vA-V]{20}$/,P4=/^[A-Za-z0-9]{27}$/,D4=/^[a-zA-Z0-9_-]{21}$/,L4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,O4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Um=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,z4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,N4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function M4(){return new RegExp(N4,"u")}const U4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Z4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,H4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pv=/^[A-Za-z0-9_-]*$/,B4=/^\+[1-9]\d{6,14}$/,Dv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",q4=new RegExp(`^${Dv}$`);function Lv(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function j4(n){return new RegExp(`^${Lv(n)}$`)}function W4(n){const e=Lv({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${t.join("|")})`;return new RegExp(`^${Dv}T(?:${r})$`)}const G4=n=>{const e=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Y4=/^-?\d+$/,Ov=/^-?\d+(?:\.\d+)?$/,K4=/^(?:true|false)$/i,J4=/^[^A-Z]*$/,X4=/^[^a-z]*$/,Qe=E("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),zv={number:"number",bigint:"bigint",object:"date"},Nv=E("$ZodCheckLessThan",(n,e)=>{Qe.init(n,e);const t=zv[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Mv=E("$ZodCheckGreaterThan",(n,e)=>{Qe.init(n,e);const t=zv[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Q4=E("$ZodCheckMultipleOf",(n,e)=>{Qe.init(n,e),n._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):r4(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),e$=E("$ZodCheckNumberFormat",(n,e)=>{var o;Qe.init(n,e),e.format=e.format||"float64";const t=(o=e.format)==null?void 0:o.includes("int"),r=t?"int":"number",[i,s]=l4[e.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=e.format,c.minimum=i,c.maximum=s,t&&(c.pattern=Y4)}),n._zod.check=l=>{const c=l.value;if(t){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!e.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!e.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!e.abort})}}),t$=E("$ZodCheckMaxLength",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!sp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const o=ap(i);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),n$=E("$ZodCheckMinLength",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!sp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const o=ap(i);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),r$=E("$ZodCheckLengthEquals",(n,e)=>{var t;Qe.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!sp(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),n._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const o=ap(i),l=s>e.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!e.abort})}}),Iu=E("$ZodCheckStringFormat",(n,e)=>{var t,r;Qe.init(n,e),n._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(r=n._zod).check??(r.check=()=>{})}),i$=E("$ZodCheckRegex",(n,e)=>{Iu.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),s$=E("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=J4),Iu.init(n,e)}),o$=E("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=X4),Iu.init(n,e)}),a$=E("$ZodCheckIncludes",(n,e)=>{Qe.init(n,e);const t=no(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=r,n._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),n._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:n,continue:!e.abort})}}),l$=E("$ZodCheckStartsWith",(n,e)=>{Qe.init(n,e);const t=new RegExp(`^${no(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:n,continue:!e.abort})}}),c$=E("$ZodCheckEndsWith",(n,e)=>{Qe.init(n,e);const t=new RegExp(`.*${no(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:n,continue:!e.abort})}}),u$=E("$ZodCheckOverwrite",(n,e)=>{Qe.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class h${constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
5
5
|
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const e=Function,t=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new e(...t,i.join(`
|
|
6
|
-
`))}}const
|
|
6
|
+
`))}}const d$={major:4,minor:3,patch:6},ge=E("$ZodType",(n,e)=>{var i;var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=d$;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const s of r)for(const o of s._zod.onattach)o(n);if(r.length===0)(t=n._zod).deferred??(t.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const s=(l,c,u)=>{let f=ds(l),m;for(const v of c){if(v._zod.def.when){if(!v._zod.def.when(l))continue}else if(f)continue;const y=l.issues.length,k=v._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new vs;if(m||k instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await k,l.issues.length!==y&&(f||(f=ds(l,y)))});else{if(l.issues.length===y)continue;f||(f=ds(l,y))}}return m?m.then(()=>l):l},o=(l,c,u)=>{if(ds(l))return l.aborted=!0,l;const f=s(c,r,u);if(f instanceof Promise){if(u.async===!1)throw new vs;return f.then(m=>n._zod.parse(m,u))}return n._zod.parse(f,u)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const f=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(m=>o(m,l,c)):o(f,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new vs;return u.then(f=>s(f,r,c))}return s(u,r,c)}}se(n,"~standard",()=>({validate:s=>{var o;try{const l=y4(n,s);return l.success?{value:l.data}:{issues:(o=l.error)==null?void 0:o.issues}}catch{return w4(n,s).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),up=E("$ZodString",(n,e)=>{var t;ge.init(n,e),n._zod.pattern=[...((t=n==null?void 0:n._zod.bag)==null?void 0:t.patterns)??[]].pop()??G4(n._zod.bag),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),pe=E("$ZodStringFormat",(n,e)=>{Iu.init(n,e),up.init(n,e)}),f$=E("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=O4),pe.init(n,e)}),p$=E("$ZodUUID",(n,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Um(r))}else e.pattern??(e.pattern=Um());pe.init(n,e)}),m$=E("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=z4),pe.init(n,e)}),g$=E("$ZodURL",(n,e)=>{pe.init(n,e),n._zod.check=t=>{try{const r=t.value.trim(),i=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=i.href:t.value=r;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),v$=E("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=M4()),pe.init(n,e)}),y$=E("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=D4),pe.init(n,e)}),w$=E("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=T4),pe.init(n,e)}),b$=E("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=R4),pe.init(n,e)}),_$=E("$ZodULID",(n,e)=>{e.pattern??(e.pattern=I4),pe.init(n,e)}),S$=E("$ZodXID",(n,e)=>{e.pattern??(e.pattern=x4),pe.init(n,e)}),A$=E("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=P4),pe.init(n,e)}),k$=E("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=W4(e)),pe.init(n,e)}),E$=E("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=q4),pe.init(n,e)}),$$=E("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=j4(e)),pe.init(n,e)}),C$=E("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=L4),pe.init(n,e)}),T$=E("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=U4),pe.init(n,e),n._zod.bag.format="ipv4"}),R$=E("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Z4),pe.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),I$=E("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=F4),pe.init(n,e)}),x$=E("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=H4),pe.init(n,e),n._zod.check=t=>{const r=t.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function Uv(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const P$=E("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=V4),pe.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{Uv(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function D$(n){if(!Pv.test(n))return!1;const e=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return Uv(t)}const L$=E("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Pv),pe.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{D$(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),O$=E("$ZodE164",(n,e)=>{e.pattern??(e.pattern=B4),pe.init(n,e)});function z$(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[r]=t;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const N$=E("$ZodJWT",(n,e)=>{pe.init(n,e),n._zod.check=t=>{z$(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),Zv=E("$ZodNumber",(n,e)=>{ge.init(n,e),n._zod.pattern=n._zod.bag.pattern??Ov,n._zod.parse=(t,r)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...s?{received:s}:{}}),t}}),M$=E("$ZodNumberFormat",(n,e)=>{e$.init(n,e),Zv.init(n,e)}),U$=E("$ZodBoolean",(n,e)=>{ge.init(n,e),n._zod.pattern=K4,n._zod.parse=(t,r)=>{if(e.coerce)try{t.value=!!t.value}catch{}const i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),t}}),Z$=E("$ZodUnknown",(n,e)=>{ge.init(n,e),n._zod.parse=t=>t}),F$=E("$ZodNever",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function Zm(n,e,t){n.issues.length&&e.issues.push(...fs(t,n.issues)),e.value[t]=n.value}const H$=E("$ZodArray",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),t;t.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const l=i[o],c=e.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(u=>Zm(u,t,o))):Zm(c,t,o)}return s.length?Promise.all(s).then(()=>t):t}});function Fc(n,e,t,r,i){if(n.issues.length){if(i&&!(t in r))return;e.issues.push(...fs(t,n.issues))}n.value===void 0?t in r&&(e.value[t]=void 0):e.value[t]=n.value}function Fv(n){var r,i,s,o;const e=Object.keys(n.shape);for(const l of e)if(!((o=(s=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const t=a4(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Hv(n,e,t,r,i,s){const o=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,f=c.optout==="optional";for(const m in e){if(l.has(m))continue;if(u==="never"){o.push(m);continue}const v=c.run({value:e[m],issues:[]},r);v instanceof Promise?n.push(v.then(y=>Fc(y,t,m,e,f))):Fc(v,t,m,e,f)}return o.length&&t.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),n.length?Promise.all(n).then(()=>t):t}const V$=E("$ZodObject",(n,e)=>{ge.init(n,e);const t=Object.getOwnPropertyDescriptor(e,"shape");if(!(t!=null&&t.get)){const l=e.shape;Object.defineProperty(e,"shape",{get:()=>{const c={...l};return Object.defineProperty(e,"shape",{value:c}),c}})}const r=Cu(()=>Fv(e));se(n._zod,"propValues",()=>{const l=e.shape,c={};for(const u in l){const f=l[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const m of f.values)c[u].add(m)}}return c});const i=la,s=e.catchall;let o;n._zod.parse=(l,c)=>{o??(o=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const f=[],m=o.shape;for(const v of o.keys){const y=m[v],k=y._zod.optout==="optional",S=y._zod.run({value:u[v],issues:[]},c);S instanceof Promise?f.push(S.then(x=>Fc(x,l,v,u,k))):Fc(S,l,v,u,k)}return s?Hv(f,u,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),B$=E("$ZodObjectJIT",(n,e)=>{V$.init(n,e);const t=n._zod.parse,r=Cu(()=>Fv(e)),i=v=>{var G;const y=new h$(["shape","payload","ctx"]),k=r.value,S=F=>{const W=Mm(F);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};y.write("const input = payload.value;");const x=Object.create(null);let M=0;for(const F of k.keys)x[F]=`key_${M++}`;y.write("const newResult = {};");for(const F of k.keys){const W=x[F],re=Mm(F),Q=v[F],oe=((G=Q==null?void 0:Q._zod)==null?void 0:G.optout)==="optional";y.write(`const ${W} = ${S(F)};`),oe?y.write(`
|
|
7
7
|
if (${W}.issues.length) {
|
|
8
8
|
if (${re} in input) {
|
|
9
9
|
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
|
|
@@ -37,10 +37,10 @@ var hb=Object.defineProperty;var Jp=n=>{throw TypeError(n)};var db=(n,e,t)=>e in
|
|
|
37
37
|
newResult[${re}] = ${W}.value;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");const Z=y.compile();return(F,W)=>Z(g,F,W)};let s;const o=oa,l=!wv.jitless,u=l&&e4.value,f=e.catchall;let m;n._zod.parse=(g,y)=>{m??(m=r.value);const k=g.value;return o(k)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(e.shape)),g=s(g,y),f?zv([],k,g,y,m,n):g):t(g,y):(g.issues.push({expected:"object",code:"invalid_type",input:k,inst:n}),g)}});function Om(n,e,t,r){for(const s of n)if(s.issues.length===0)return e.value=s.value,e;const i=n.filter(s=>!ds(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(s=>s.issues.map(o=>xr(o,r,Ir())))}),e)}const Nv=E("$ZodUnion",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),se(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),se(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),se(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>np(s.source)).join("|")})$`)}});const t=e.options.length===1,r=e.options[0]._zod.run;n._zod.parse=(i,s)=>{if(t)return r(i,s);let o=!1;const l=[];for(const c of e.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)l.push(u),o=!0;else{if(u.issues.length===0)return u;l.push(u)}}return o?Promise.all(l).then(c=>Om(c,i,n,s)):Om(l,i,n,s)}}),Z$=E("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Nv.init(n,e);const t=n._zod.parse;se(n._zod,"propValues",()=>{const i={};for(const s of e.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[l,c]of Object.entries(o)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Eu(()=>{var o;const i=e.options,s=new Map;for(const l of i){const c=(o=l._zod.propValues)==null?void 0:o[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(l)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,l)}}return s});n._zod.parse=(i,s)=>{const o=i.value;if(!oa(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:n}),i;const l=r.value.get(o==null?void 0:o[e.discriminator]);return l?l._zod.run(i,s):e.unionFallback?t(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:n}),i)}}),F$=E("$ZodIntersection",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{const i=t.value,s=e.left._zod.run({value:i,issues:[]},r),o=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,u])=>zm(t,c,u)):zm(t,s,o)}});function fd(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(eo(n)&&eo(e)){const t=Object.keys(e),r=Object.keys(n).filter(s=>t.indexOf(s)!==-1),i={...n,...e};for(const s of r){const o=fd(n[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<n.length;r++){const i=n[r],s=e[r],o=fd(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};t.push(o.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function zm(n,e,t){const r=new Map;let i;for(const l of e.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of t.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&n.issues.push({...i,keys:s}),ds(n))return n;const o=fd(e.value,t.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return n.value=o.data,n}const H$=E("$ZodRecord",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!eo(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),t;const s=[],o=e.keyType._zod.values;if(o){t.value={};const l=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const f=e.valueType._zod.run({value:i[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&t.issues.push(...fs(u,m.issues)),t.value[u]=m.value})):(f.issues.length&&t.issues.push(...fs(u,f.issues)),t.value[u]=f.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{t.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=e.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Rv.test(l)&&c.issues.length){const m=e.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(c=m)}if(c.issues.length){e.mode==="loose"?t.value[l]=i[l]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(m=>xr(m,r,Ir())),input:l,path:[l],inst:n});continue}const f=e.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&t.issues.push(...fs(l,m.issues)),t.value[c.value]=m.value})):(f.issues.length&&t.issues.push(...fs(l,f.issues)),t.value[c.value]=f.value)}}return s.length?Promise.all(s).then(()=>t):t}}),V$=E("$ZodEnum",(n,e)=>{ge.init(n,e);const t=bv(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>t4.has(typeof i)).map(i=>typeof i=="string"?to(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t,input:o,inst:n}),i}}),B$=E("$ZodLiteral",(n,e)=>{if(ge.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?to(r):r?to(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const s=r.value;return t.has(s)||r.issues.push({code:"invalid_value",values:e.values,input:s,inst:n}),r}}),j$=E("$ZodTransform",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new yv(n.constructor.name);const i=e.transform(t.value,t);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(t.value=o,t));if(i instanceof Promise)throw new vs;return t.value=i,t}});function Nm(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const Mv=E("$ZodOptional",(n,e)=>{ge.init(n,e),n._zod.optin="optional",n._zod.optout="optional",se(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),se(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${np(t.source)})?$`):void 0}),n._zod.parse=(t,r)=>{if(e.innerType._zod.optin==="optional"){const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>Nm(s,t.value)):Nm(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),q$=E("$ZodExactOptional",(n,e)=>{Mv.init(n,e),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),W$=E("$ZodNullable",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${np(t.source)}|null)$`):void 0}),se(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,r)=>t.value===null?t:e.innerType._zod.run(t,r)}),G$=E("$ZodDefault",(n,e)=>{ge.init(n,e),n._zod.optin="optional",se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);if(t.value===void 0)return t.value=e.defaultValue,t;const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>Mm(s,e)):Mm(i,e)}});function Mm(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const Y$=E("$ZodPrefault",(n,e)=>{ge.init(n,e),n._zod.optin="optional",se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),K$=E("$ZodNonOptional",(n,e)=>{ge.init(n,e),se(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),n._zod.parse=(t,r)=>{const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>Um(s,n)):Um(i,n)}});function Um(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const J$=E("$ZodCatch",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>(t.value=s.value,s.issues.length&&(t.value=e.catchValue({...t,error:{issues:s.issues.map(o=>xr(o,r,Ir()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(s=>xr(s,r,Ir()))},input:t.value}),t.issues=[]),t)}}),X$=E("$ZodPipe",(n,e)=>{ge.init(n,e),se(n._zod,"values",()=>e.in._zod.values),se(n._zod,"optin",()=>e.in._zod.optin),se(n._zod,"optout",()=>e.out._zod.optout),se(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=e.out._zod.run(t,r);return s instanceof Promise?s.then(o=>Fl(o,e.in,r)):Fl(s,e.in,r)}const i=e.in._zod.run(t,r);return i instanceof Promise?i.then(s=>Fl(s,e.out,r)):Fl(i,e.out,r)}});function Fl(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},t)}const Q$=E("$ZodReadonly",(n,e)=>{ge.init(n,e),se(n._zod,"propValues",()=>e.innerType._zod.propValues),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"optin",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optin}),se(n._zod,"optout",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optout}),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(Zm):Zm(i)}});function Zm(n){return n.value=Object.freeze(n.value),n}const eC=E("$ZodCustom",(n,e)=>{Qe.init(n,e),ge.init(n,e),n._zod.parse=(t,r)=>t,n._zod.check=t=>{const r=t.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>Fm(s,t,r,n));Fm(i,t,r,n)}});function Fm(n,e,t,r){if(!n){const i={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(aa(i))}}var Hm;class tC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function nC(){return new tC}(Hm=globalThis).__zod_globalRegistry??(Hm.__zod_globalRegistry=nC());const zo=globalThis.__zod_globalRegistry;function rC(n,e){return new n({type:"string",...N(e)})}function iC(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...N(e)})}function Vm(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...N(e)})}function sC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...N(e)})}function oC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...N(e)})}function aC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...N(e)})}function lC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...N(e)})}function cC(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...N(e)})}function uC(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...N(e)})}function hC(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...N(e)})}function dC(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...N(e)})}function fC(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...N(e)})}function pC(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...N(e)})}function mC(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...N(e)})}function gC(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...N(e)})}function vC(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...N(e)})}function yC(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...N(e)})}function wC(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...N(e)})}function bC(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...N(e)})}function _C(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...N(e)})}function SC(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...N(e)})}function AC(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...N(e)})}function kC(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...N(e)})}function EC(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...N(e)})}function $C(n,e){return new n({type:"string",format:"date",check:"string_format",...N(e)})}function CC(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...N(e)})}function TC(n,e){return new n({type:"string",format:"duration",check:"string_format",...N(e)})}function RC(n,e){return new n({type:"number",checks:[],...N(e)})}function IC(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...N(e)})}function xC(n,e){return new n({type:"boolean",...N(e)})}function PC(n){return new n({type:"unknown"})}function DC(n,e){return new n({type:"never",...N(e)})}function Bm(n,e){return new xv({check:"less_than",...N(e),value:n,inclusive:!1})}function Ph(n,e){return new xv({check:"less_than",...N(e),value:n,inclusive:!0})}function jm(n,e){return new Pv({check:"greater_than",...N(e),value:n,inclusive:!1})}function Dh(n,e){return new Pv({check:"greater_than",...N(e),value:n,inclusive:!0})}function qm(n,e){return new G4({check:"multiple_of",...N(e),value:n})}function Uv(n,e){return new K4({check:"max_length",...N(e),maximum:n})}function Fc(n,e){return new J4({check:"min_length",...N(e),minimum:n})}function Zv(n,e){return new X4({check:"length_equals",...N(e),length:n})}function LC(n,e){return new Q4({check:"string_format",format:"regex",...N(e),pattern:n})}function OC(n){return new e$({check:"string_format",format:"lowercase",...N(n)})}function zC(n){return new t$({check:"string_format",format:"uppercase",...N(n)})}function NC(n,e){return new n$({check:"string_format",format:"includes",...N(e),includes:n})}function MC(n,e){return new r$({check:"string_format",format:"starts_with",...N(e),prefix:n})}function UC(n,e){return new i$({check:"string_format",format:"ends_with",...N(e),suffix:n})}function po(n){return new s$({check:"overwrite",tx:n})}function ZC(n){return po(e=>e.normalize(n))}function FC(){return po(n=>n.trim())}function HC(){return po(n=>n.toLowerCase())}function VC(){return po(n=>n.toUpperCase())}function BC(){return po(n=>QE(n))}function jC(n,e,t){return new n({type:"array",element:e,...N(t)})}function qC(n,e,t){return new n({type:"custom",check:"custom",fn:e,...N(t)})}function WC(n){const e=GC(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(aa(r,t.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(aa(i))}},n(t.value,t)));return e}function GC(n,e){const t=new Qe({check:"custom",...N(e)});return t._zod.check=n,t}function Fv(n){let e=(n==null?void 0:n.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??zo,target:e,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Ee(n,e,t={path:[],schemaPath:[]}){var f,m;var r;const i=n._zod.def,s=e.seen.get(n);if(s)return s.count++,t.schemaPath.includes(n)&&(s.cycle=t.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,o);const l=(m=(f=n._zod).toJSONSchema)==null?void 0:m.call(f);if(l)o.schema=l;else{const g={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,o.schema,g);else{const k=o.schema,A=e.processors[i.type];if(!A)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);A(n,e,k,g)}const y=n._zod.parent;y&&(o.ref||(o.ref=y),Ee(y,e,g),e.seen.get(y).isParent=!0)}const c=e.metadataRegistry.get(n);return c&&Object.assign(o.schema,c),e.io==="input"&&Fe(n)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(n).schema}function Hv(n,e){var o,l,c,u;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const f of n.seen.entries()){const m=(o=n.metadataRegistry.get(f[0]))==null?void 0:o.id;if(m){const g=r.get(m);if(g&&g!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,f[0])}}const i=f=>{var A;const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(A=n.external.registry.get(f[0]))==null?void 0:A.id,M=n.external.uri??(G=>G);if(x)return{ref:M(x)};const Z=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=Z,{defId:Z,ref:`${M("__shared")}#/${m}/${Z}`}}if(f[1]===t)return{ref:"#"};const y=`#/${m}/`,k=f[1].schema.id??`__schema${n.counter++}`;return{defId:k,ref:y+k}},s=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:g,defId:y}=i(f);m.def={...m.schema},y&&(m.defId=y);const k=m.schema;for(const A in k)delete k[A];k.$ref=g};if(n.cycles==="throw")for(const f of n.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.cycle)==null?void 0:l.join("/")}/<root>
|
|
40
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");const Z=y.compile();return(F,W)=>Z(v,F,W)};let s;const o=la,l=!Ev.jitless,u=l&&s4.value,f=e.catchall;let m;n._zod.parse=(v,y)=>{m??(m=r.value);const k=v.value;return o(k)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(e.shape)),v=s(v,y),f?Hv([],k,v,y,m,n):v):t(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:k,inst:n}),v)}});function Fm(n,e,t,r){for(const s of n)if(s.issues.length===0)return e.value=s.value,e;const i=n.filter(s=>!ds(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(s=>s.issues.map(o=>xr(o,r,Ir())))}),e)}const Vv=E("$ZodUnion",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),se(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),se(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),se(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>op(s.source)).join("|")})$`)}});const t=e.options.length===1,r=e.options[0]._zod.run;n._zod.parse=(i,s)=>{if(t)return r(i,s);let o=!1;const l=[];for(const c of e.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)l.push(u),o=!0;else{if(u.issues.length===0)return u;l.push(u)}}return o?Promise.all(l).then(c=>Fm(c,i,n,s)):Fm(l,i,n,s)}}),q$=E("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Vv.init(n,e);const t=n._zod.parse;se(n._zod,"propValues",()=>{const i={};for(const s of e.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[l,c]of Object.entries(o)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Cu(()=>{var o;const i=e.options,s=new Map;for(const l of i){const c=(o=l._zod.propValues)==null?void 0:o[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(l)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,l)}}return s});n._zod.parse=(i,s)=>{const o=i.value;if(!la(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:n}),i;const l=r.value.get(o==null?void 0:o[e.discriminator]);return l?l._zod.run(i,s):e.unionFallback?t(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:n}),i)}}),j$=E("$ZodIntersection",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{const i=t.value,s=e.left._zod.run({value:i,issues:[]},r),o=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,u])=>Hm(t,c,u)):Hm(t,s,o)}});function vd(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(to(n)&&to(e)){const t=Object.keys(e),r=Object.keys(n).filter(s=>t.indexOf(s)!==-1),i={...n,...e};for(const s of r){const o=vd(n[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<n.length;r++){const i=n[r],s=e[r],o=vd(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};t.push(o.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Hm(n,e,t){const r=new Map;let i;for(const l of e.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of t.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&n.issues.push({...i,keys:s}),ds(n))return n;const o=vd(e.value,t.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return n.value=o.data,n}const W$=E("$ZodRecord",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!to(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),t;const s=[],o=e.keyType._zod.values;if(o){t.value={};const l=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const f=e.valueType._zod.run({value:i[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&t.issues.push(...fs(u,m.issues)),t.value[u]=m.value})):(f.issues.length&&t.issues.push(...fs(u,f.issues)),t.value[u]=f.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{t.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=e.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ov.test(l)&&c.issues.length){const m=e.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(c=m)}if(c.issues.length){e.mode==="loose"?t.value[l]=i[l]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(m=>xr(m,r,Ir())),input:l,path:[l],inst:n});continue}const f=e.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&t.issues.push(...fs(l,m.issues)),t.value[c.value]=m.value})):(f.issues.length&&t.issues.push(...fs(l,f.issues)),t.value[c.value]=f.value)}}return s.length?Promise.all(s).then(()=>t):t}}),G$=E("$ZodEnum",(n,e)=>{ge.init(n,e);const t=$v(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>o4.has(typeof i)).map(i=>typeof i=="string"?no(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t,input:o,inst:n}),i}}),Y$=E("$ZodLiteral",(n,e)=>{if(ge.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?no(r):r?no(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const s=r.value;return t.has(s)||r.issues.push({code:"invalid_value",values:e.values,input:s,inst:n}),r}}),K$=E("$ZodTransform",(n,e)=>{ge.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new kv(n.constructor.name);const i=e.transform(t.value,t);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(t.value=o,t));if(i instanceof Promise)throw new vs;return t.value=i,t}});function Vm(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const Bv=E("$ZodOptional",(n,e)=>{ge.init(n,e),n._zod.optin="optional",n._zod.optout="optional",se(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),se(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${op(t.source)})?$`):void 0}),n._zod.parse=(t,r)=>{if(e.innerType._zod.optin==="optional"){const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>Vm(s,t.value)):Vm(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),J$=E("$ZodExactOptional",(n,e)=>{Bv.init(n,e),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),X$=E("$ZodNullable",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${op(t.source)}|null)$`):void 0}),se(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,r)=>t.value===null?t:e.innerType._zod.run(t,r)}),Q$=E("$ZodDefault",(n,e)=>{ge.init(n,e),n._zod.optin="optional",se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);if(t.value===void 0)return t.value=e.defaultValue,t;const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>Bm(s,e)):Bm(i,e)}});function Bm(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const eC=E("$ZodPrefault",(n,e)=>{ge.init(n,e),n._zod.optin="optional",se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),tC=E("$ZodNonOptional",(n,e)=>{ge.init(n,e),se(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),n._zod.parse=(t,r)=>{const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>qm(s,n)):qm(i,n)}});function qm(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const nC=E("$ZodCatch",(n,e)=>{ge.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(s=>(t.value=s.value,s.issues.length&&(t.value=e.catchValue({...t,error:{issues:s.issues.map(o=>xr(o,r,Ir()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(s=>xr(s,r,Ir()))},input:t.value}),t.issues=[]),t)}}),rC=E("$ZodPipe",(n,e)=>{ge.init(n,e),se(n._zod,"values",()=>e.in._zod.values),se(n._zod,"optin",()=>e.in._zod.optin),se(n._zod,"optout",()=>e.out._zod.optout),se(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=e.out._zod.run(t,r);return s instanceof Promise?s.then(o=>Vl(o,e.in,r)):Vl(s,e.in,r)}const i=e.in._zod.run(t,r);return i instanceof Promise?i.then(s=>Vl(s,e.out,r)):Vl(i,e.out,r)}});function Vl(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},t)}const iC=E("$ZodReadonly",(n,e)=>{ge.init(n,e),se(n._zod,"propValues",()=>e.innerType._zod.propValues),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"optin",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optin}),se(n._zod,"optout",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optout}),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(jm):jm(i)}});function jm(n){return n.value=Object.freeze(n.value),n}const sC=E("$ZodCustom",(n,e)=>{Qe.init(n,e),ge.init(n,e),n._zod.parse=(t,r)=>t,n._zod.check=t=>{const r=t.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>Wm(s,t,r,n));Wm(i,t,r,n)}});function Wm(n,e,t,r){if(!n){const i={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(ca(i))}}var Gm;class oC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function aC(){return new oC}(Gm=globalThis).__zod_globalRegistry??(Gm.__zod_globalRegistry=aC());const No=globalThis.__zod_globalRegistry;function lC(n,e){return new n({type:"string",...N(e)})}function cC(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...N(e)})}function Ym(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...N(e)})}function uC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...N(e)})}function hC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...N(e)})}function dC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...N(e)})}function fC(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...N(e)})}function pC(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...N(e)})}function mC(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...N(e)})}function gC(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...N(e)})}function vC(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...N(e)})}function yC(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...N(e)})}function wC(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...N(e)})}function bC(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...N(e)})}function _C(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...N(e)})}function SC(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...N(e)})}function AC(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...N(e)})}function kC(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...N(e)})}function EC(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...N(e)})}function $C(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...N(e)})}function CC(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...N(e)})}function TC(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...N(e)})}function RC(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...N(e)})}function IC(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...N(e)})}function xC(n,e){return new n({type:"string",format:"date",check:"string_format",...N(e)})}function PC(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...N(e)})}function DC(n,e){return new n({type:"string",format:"duration",check:"string_format",...N(e)})}function LC(n,e){return new n({type:"number",checks:[],...N(e)})}function OC(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...N(e)})}function zC(n,e){return new n({type:"boolean",...N(e)})}function NC(n){return new n({type:"unknown"})}function MC(n,e){return new n({type:"never",...N(e)})}function Km(n,e){return new Nv({check:"less_than",...N(e),value:n,inclusive:!1})}function zh(n,e){return new Nv({check:"less_than",...N(e),value:n,inclusive:!0})}function Jm(n,e){return new Mv({check:"greater_than",...N(e),value:n,inclusive:!1})}function Nh(n,e){return new Mv({check:"greater_than",...N(e),value:n,inclusive:!0})}function Xm(n,e){return new Q4({check:"multiple_of",...N(e),value:n})}function qv(n,e){return new t$({check:"max_length",...N(e),maximum:n})}function Hc(n,e){return new n$({check:"min_length",...N(e),minimum:n})}function jv(n,e){return new r$({check:"length_equals",...N(e),length:n})}function UC(n,e){return new i$({check:"string_format",format:"regex",...N(e),pattern:n})}function ZC(n){return new s$({check:"string_format",format:"lowercase",...N(n)})}function FC(n){return new o$({check:"string_format",format:"uppercase",...N(n)})}function HC(n,e){return new a$({check:"string_format",format:"includes",...N(e),includes:n})}function VC(n,e){return new l$({check:"string_format",format:"starts_with",...N(e),prefix:n})}function BC(n,e){return new c$({check:"string_format",format:"ends_with",...N(e),suffix:n})}function mo(n){return new u$({check:"overwrite",tx:n})}function qC(n){return mo(e=>e.normalize(n))}function jC(){return mo(n=>n.trim())}function WC(){return mo(n=>n.toLowerCase())}function GC(){return mo(n=>n.toUpperCase())}function YC(){return mo(n=>i4(n))}function KC(n,e,t){return new n({type:"array",element:e,...N(t)})}function JC(n,e,t){return new n({type:"custom",check:"custom",fn:e,...N(t)})}function XC(n){const e=QC(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(ca(r,t.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(ca(i))}},n(t.value,t)));return e}function QC(n,e){const t=new Qe({check:"custom",...N(e)});return t._zod.check=n,t}function Wv(n){let e=(n==null?void 0:n.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??No,target:e,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Ee(n,e,t={path:[],schemaPath:[]}){var f,m;var r;const i=n._zod.def,s=e.seen.get(n);if(s)return s.count++,t.schemaPath.includes(n)&&(s.cycle=t.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,o);const l=(m=(f=n._zod).toJSONSchema)==null?void 0:m.call(f);if(l)o.schema=l;else{const v={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,o.schema,v);else{const k=o.schema,S=e.processors[i.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);S(n,e,k,v)}const y=n._zod.parent;y&&(o.ref||(o.ref=y),Ee(y,e,v),e.seen.get(y).isParent=!0)}const c=e.metadataRegistry.get(n);return c&&Object.assign(o.schema,c),e.io==="input"&&Fe(n)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(n).schema}function Gv(n,e){var o,l,c,u;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const f of n.seen.entries()){const m=(o=n.metadataRegistry.get(f[0]))==null?void 0:o.id;if(m){const v=r.get(m);if(v&&v!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,f[0])}}const i=f=>{var S;const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(S=n.external.registry.get(f[0]))==null?void 0:S.id,M=n.external.uri??(G=>G);if(x)return{ref:M(x)};const Z=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=Z,{defId:Z,ref:`${M("__shared")}#/${m}/${Z}`}}if(f[1]===t)return{ref:"#"};const y=`#/${m}/`,k=f[1].schema.id??`__schema${n.counter++}`;return{defId:k,ref:y+k}},s=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:v,defId:y}=i(f);m.def={...m.schema},y&&(m.defId=y);const k=m.schema;for(const S in k)delete k[S];k.$ref=v};if(n.cycles==="throw")for(const f of n.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.cycle)==null?void 0:l.join("/")}/<root>
|
|
41
41
|
|
|
42
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const m=f[1];if(e===f[0]){s(f);continue}if(n.external){const y=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&y){s(f);continue}}if((u=n.metadataRegistry.get(f[0]))==null?void 0:u.id){s(f);continue}if(m.cycle){s(f);continue}if(m.count>1&&n.reused==="ref"){s(f);continue}}}function Vv(n,e){var o,l,c;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const f=n.seen.get(u);if(f.ref===null)return;const m=f.def??f.schema,g={...m},y=f.ref;if(f.ref=null,y){r(y);const A=n.seen.get(y),x=A.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,g),u._zod.parent===y)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in g||delete m[Z];if(x.$ref&&A.def)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in A.def&&JSON.stringify(m[Z])===JSON.stringify(A.def[Z])&&delete m[Z]}const k=u._zod.parent;if(k&&k!==y){r(k);const A=n.seen.get(k);if(A!=null&&A.schema.$ref&&(m.$ref=A.schema.$ref,A.def))for(const x in m)x==="$ref"||x==="allOf"||x in A.def&&JSON.stringify(m[x])===JSON.stringify(A.def[x])&&delete m[x]}n.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(o=n.external)!=null&&o.uri){const u=(l=n.external.registry.get(e))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,t.def??t.schema);const s=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const f=u[1];f.def&&f.defId&&(s[f.defId]=f.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:Hc(e,"input",n.processors),output:Hc(e,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Fe(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Fe(r.element,t);if(r.type==="set")return Fe(r.valueType,t);if(r.type==="lazy")return Fe(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Fe(r.innerType,t);if(r.type==="intersection")return Fe(r.left,t)||Fe(r.right,t);if(r.type==="record"||r.type==="map")return Fe(r.keyType,t)||Fe(r.valueType,t);if(r.type==="pipe")return Fe(r.in,t)||Fe(r.out,t);if(r.type==="object"){for(const i in r.shape)if(Fe(r.shape[i],t))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Fe(i,t))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Fe(i,t))return!0;return!!(r.rest&&Fe(r.rest,t))}return!1}const YC=(n,e={})=>t=>{const r=Fv({...t,processors:e});return Ee(n,r),Hv(r,n),Vv(r,n)},Hc=(n,e,t={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=Fv({...i??{},target:s,io:e,processors:t});return Ee(n,o),Hv(o,n),Vv(o,n)},KC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},JC=(n,e,t,r)=>{const i=t;i.type="string";const{minimum:s,maximum:o,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),l&&(i.format=KC[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},XC=(n,e,t,r)=>{const i=t,{minimum:s,maximum:o,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof f=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f),typeof s=="number"&&(i.minimum=s,typeof f=="number"&&e.target!=="draft-04"&&(f>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof o=="number"&&(i.maximum=o,typeof u=="number"&&e.target!=="draft-04"&&(u<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},QC=(n,e,t,r)=>{t.type="boolean"},eT=(n,e,t,r)=>{t.not={}},tT=(n,e,t,r)=>{},nT=(n,e,t,r)=>{const i=n._zod.def,s=bv(i.entries);s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),t.enum=s},rT=(n,e,t,r)=>{const i=n._zod.def,s=[];for(const o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];t.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[o]:t.const=o}else s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),s.every(o=>typeof o=="boolean")&&(t.type="boolean"),s.every(o=>o===null)&&(t.type="null"),t.enum=s},iT=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sT=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oT=(n,e,t,r)=>{const i=t,s=n._zod.def,{minimum:o,maximum:l}=n._zod.bag;typeof o=="number"&&(i.minItems=o),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Ee(s.element,e,{...r,path:[...r.path,"items"]})},aT=(n,e,t,r)=>{var u;const i=t,s=n._zod.def;i.type="object",i.properties={};const o=s.shape;for(const f in o)i.properties[f]=Ee(o[f],e,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(o)),c=new Set([...l].filter(f=>{const m=s.shape[f]._zod;return e.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Ee(s.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},lT=(n,e,t,r)=>{const i=n._zod.def,s=i.inclusive===!1,o=i.options.map((l,c)=>Ee(l,e,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?t.oneOf=o:t.anyOf=o},cT=(n,e,t,r)=>{const i=n._zod.def,s=Ee(i.left,e,{...r,path:[...r.path,"allOf",0]}),o=Ee(i.right,e,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];t.allOf=c},uT=(n,e,t,r)=>{const i=t,s=n._zod.def;i.type="object";const o=s.keyType,l=o._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const f=Ee(s.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of c)i.patternProperties[m.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ee(s.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Ee(s.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const f=[...u].filter(m=>typeof m=="string"||typeof m=="number");f.length>0&&(i.required=f)}},hT=(n,e,t,r)=>{const i=n._zod.def,s=Ee(i.innerType,e,r),o=e.seen.get(n);e.target==="openapi-3.0"?(o.ref=i.innerType,t.nullable=!0):t.anyOf=[s,{type:"null"}]},dT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType},fT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},pT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},mT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=o},gT=(n,e,t,r)=>{const i=n._zod.def,s=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ee(s,e,r);const o=e.seen.get(n);o.ref=s},vT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,t.readOnly=!0},Bv=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType},yT=E("ZodISODateTime",(n,e)=>{w$.init(n,e),ye.init(n,e)});function wT(n){return EC(yT,n)}const bT=E("ZodISODate",(n,e)=>{b$.init(n,e),ye.init(n,e)});function _T(n){return $C(bT,n)}const ST=E("ZodISOTime",(n,e)=>{_$.init(n,e),ye.init(n,e)});function AT(n){return CC(ST,n)}const kT=E("ZodISODuration",(n,e)=>{S$.init(n,e),ye.init(n,e)});function ET(n){return TC(kT,n)}const jv=(n,e)=>{kv.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>d4(n,t)},flatten:{value:t=>h4(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,dd,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,dd,2)}},isEmpty:{get(){return n.issues.length===0}}})},Wm=E("ZodError",jv),St=E("ZodError",jv,{Parent:Error}),$T=ip(St),CT=sp(St),TT=$u(St),RT=Cu(St),IT=m4(St),xT=g4(St),PT=v4(St),DT=y4(St),LT=w4(St),OT=b4(St),zT=_4(St),NT=S4(St),ve=E("ZodType",(n,e)=>(ge.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Hc(n,"input"),output:Hc(n,"output")}}),n.toJSONSchema=YC(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...t)=>n.clone(Nr(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(t,r)=>Mr(n,t,r),n.brand=()=>n,n.register=(t,r)=>(t.add(n,r),n),n.parse=(t,r)=>$T(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>TT(n,t,r),n.parseAsync=async(t,r)=>CT(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>RT(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>IT(n,t,r),n.decode=(t,r)=>xT(n,t,r),n.encodeAsync=async(t,r)=>PT(n,t,r),n.decodeAsync=async(t,r)=>DT(n,t,r),n.safeEncode=(t,r)=>LT(n,t,r),n.safeDecode=(t,r)=>OT(n,t,r),n.safeEncodeAsync=async(t,r)=>zT(n,t,r),n.safeDecodeAsync=async(t,r)=>NT(n,t,r),n.refine=(t,r)=>n.check(RR(t,r)),n.superRefine=t=>n.check(IR(t)),n.overwrite=t=>n.check(po(t)),n.optional=()=>Km(n),n.exactOptional=()=>gR(n),n.nullable=()=>Jm(n),n.nullish=()=>Km(Jm(n)),n.nonoptional=t=>SR(n,t),n.array=()=>z(n),n.or=t=>q([n,t]),n.and=t=>Ru(n,t),n.transform=t=>Xm(n,pR(t)),n.default=t=>wR(n,t),n.prefault=t=>_R(n,t),n.catch=t=>kR(n,t),n.pipe=t=>Xm(n,t),n.readonly=()=>CR(n),n.describe=t=>{const r=n.clone();return zo.add(r,{description:t}),r},Object.defineProperty(n,"description",{get(){var t;return(t=zo.get(n))==null?void 0:t.description},configurable:!0}),n.meta=(...t)=>{if(t.length===0)return zo.get(n);const r=n.clone();return zo.add(r,t[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=t=>t(n),n)),qv=E("_ZodString",(n,e)=>{op.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>JC(n,r,i);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,n.regex=(...r)=>n.check(LC(...r)),n.includes=(...r)=>n.check(NC(...r)),n.startsWith=(...r)=>n.check(MC(...r)),n.endsWith=(...r)=>n.check(UC(...r)),n.min=(...r)=>n.check(Fc(...r)),n.max=(...r)=>n.check(Uv(...r)),n.length=(...r)=>n.check(Zv(...r)),n.nonempty=(...r)=>n.check(Fc(1,...r)),n.lowercase=r=>n.check(OC(r)),n.uppercase=r=>n.check(zC(r)),n.trim=()=>n.check(FC()),n.normalize=(...r)=>n.check(ZC(...r)),n.toLowerCase=()=>n.check(HC()),n.toUpperCase=()=>n.check(VC()),n.slugify=()=>n.check(BC())}),MT=E("ZodString",(n,e)=>{op.init(n,e),qv.init(n,e),n.email=t=>n.check(iC(UT,t)),n.url=t=>n.check(cC(ZT,t)),n.jwt=t=>n.check(kC(tR,t)),n.emoji=t=>n.check(uC(FT,t)),n.guid=t=>n.check(Vm(Gm,t)),n.uuid=t=>n.check(sC(Hl,t)),n.uuidv4=t=>n.check(oC(Hl,t)),n.uuidv6=t=>n.check(aC(Hl,t)),n.uuidv7=t=>n.check(lC(Hl,t)),n.nanoid=t=>n.check(hC(HT,t)),n.guid=t=>n.check(Vm(Gm,t)),n.cuid=t=>n.check(dC(VT,t)),n.cuid2=t=>n.check(fC(BT,t)),n.ulid=t=>n.check(pC(jT,t)),n.base64=t=>n.check(_C(XT,t)),n.base64url=t=>n.check(SC(QT,t)),n.xid=t=>n.check(mC(qT,t)),n.ksuid=t=>n.check(gC(WT,t)),n.ipv4=t=>n.check(vC(GT,t)),n.ipv6=t=>n.check(yC(YT,t)),n.cidrv4=t=>n.check(wC(KT,t)),n.cidrv6=t=>n.check(bC(JT,t)),n.e164=t=>n.check(AC(eR,t)),n.datetime=t=>n.check(wT(t)),n.date=t=>n.check(_T(t)),n.time=t=>n.check(AT(t)),n.duration=t=>n.check(ET(t))});function p(n){return rC(MT,n)}const ye=E("ZodStringFormat",(n,e)=>{pe.init(n,e),qv.init(n,e)}),UT=E("ZodEmail",(n,e)=>{u$.init(n,e),ye.init(n,e)}),Gm=E("ZodGUID",(n,e)=>{l$.init(n,e),ye.init(n,e)}),Hl=E("ZodUUID",(n,e)=>{c$.init(n,e),ye.init(n,e)}),ZT=E("ZodURL",(n,e)=>{h$.init(n,e),ye.init(n,e)}),FT=E("ZodEmoji",(n,e)=>{d$.init(n,e),ye.init(n,e)}),HT=E("ZodNanoID",(n,e)=>{f$.init(n,e),ye.init(n,e)}),VT=E("ZodCUID",(n,e)=>{p$.init(n,e),ye.init(n,e)}),BT=E("ZodCUID2",(n,e)=>{m$.init(n,e),ye.init(n,e)}),jT=E("ZodULID",(n,e)=>{g$.init(n,e),ye.init(n,e)}),qT=E("ZodXID",(n,e)=>{v$.init(n,e),ye.init(n,e)}),WT=E("ZodKSUID",(n,e)=>{y$.init(n,e),ye.init(n,e)}),GT=E("ZodIPv4",(n,e)=>{A$.init(n,e),ye.init(n,e)}),YT=E("ZodIPv6",(n,e)=>{k$.init(n,e),ye.init(n,e)}),KT=E("ZodCIDRv4",(n,e)=>{E$.init(n,e),ye.init(n,e)}),JT=E("ZodCIDRv6",(n,e)=>{$$.init(n,e),ye.init(n,e)}),XT=E("ZodBase64",(n,e)=>{C$.init(n,e),ye.init(n,e)}),QT=E("ZodBase64URL",(n,e)=>{R$.init(n,e),ye.init(n,e)}),eR=E("ZodE164",(n,e)=>{I$.init(n,e),ye.init(n,e)}),tR=E("ZodJWT",(n,e)=>{P$.init(n,e),ye.init(n,e)}),Wv=E("ZodNumber",(n,e)=>{Lv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>XC(n,r,i),n.gt=(r,i)=>n.check(jm(r,i)),n.gte=(r,i)=>n.check(Dh(r,i)),n.min=(r,i)=>n.check(Dh(r,i)),n.lt=(r,i)=>n.check(Bm(r,i)),n.lte=(r,i)=>n.check(Ph(r,i)),n.max=(r,i)=>n.check(Ph(r,i)),n.int=r=>n.check(Ym(r)),n.safe=r=>n.check(Ym(r)),n.positive=r=>n.check(jm(0,r)),n.nonnegative=r=>n.check(Dh(0,r)),n.negative=r=>n.check(Bm(0,r)),n.nonpositive=r=>n.check(Ph(0,r)),n.multipleOf=(r,i)=>n.check(qm(r,i)),n.step=(r,i)=>n.check(qm(r,i)),n.finite=()=>n;const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function H(n){return RC(Wv,n)}const nR=E("ZodNumberFormat",(n,e)=>{D$.init(n,e),Wv.init(n,e)});function Ym(n){return IC(nR,n)}const rR=E("ZodBoolean",(n,e)=>{L$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>QC(n,t,r)});function Ie(n){return xC(rR,n)}const iR=E("ZodUnknown",(n,e)=>{O$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>tT()});function _(){return PC(iR)}const sR=E("ZodNever",(n,e)=>{z$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>eT(n,t,r)});function oR(n){return DC(sR,n)}const aR=E("ZodArray",(n,e)=>{N$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>oT(n,t,r,i),n.element=e.element,n.min=(t,r)=>n.check(Fc(t,r)),n.nonempty=t=>n.check(Fc(1,t)),n.max=(t,r)=>n.check(Uv(t,r)),n.length=(t,r)=>n.check(Zv(t,r)),n.unwrap=()=>n.element});function z(n,e){return jC(aR,n,e)}const Gv=E("ZodObject",(n,e)=>{U$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>aT(n,t,r,i),se(n,"shape",()=>e.shape),n.keyof=()=>Jv(Object.keys(n._zod.def.shape)),n.catchall=t=>n.clone({...n._zod.def,catchall:t}),n.passthrough=()=>n.clone({...n._zod.def,catchall:_()}),n.loose=()=>n.clone({...n._zod.def,catchall:_()}),n.strict=()=>n.clone({...n._zod.def,catchall:oR()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>o4(n,t),n.safeExtend=t=>a4(n,t),n.merge=t=>l4(n,t),n.pick=t=>i4(n,t),n.omit=t=>s4(n,t),n.partial=(...t)=>c4(Xv,n,t[0]),n.required=(...t)=>u4(Qv,n,t[0])});function Yv(n,e){const t={type:"object",shape:n??{},...N(e)};return new Gv(t)}function w(n,e){return new Gv({type:"object",shape:n,catchall:_(),...N(e)})}const Kv=E("ZodUnion",(n,e)=>{Nv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>lT(n,t,r,i),n.options=e.options});function q(n,e){return new Kv({type:"union",options:n,...N(e)})}const lR=E("ZodDiscriminatedUnion",(n,e)=>{Kv.init(n,e),Z$.init(n,e)});function cR(n,e,t){return new lR({type:"union",options:e,discriminator:n,...N(t)})}const uR=E("ZodIntersection",(n,e)=>{F$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>cT(n,t,r,i)});function Ru(n,e){return new uR({type:"intersection",left:n,right:e})}const hR=E("ZodRecord",(n,e)=>{H$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>uT(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function S(n,e,t){return new hR({type:"record",keyType:n,valueType:e,...N(t)})}const pd=E("ZodEnum",(n,e)=>{V$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>nT(n,r,i),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(r,i)=>{const s={};for(const o of r)if(t.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new pd({...e,checks:[],...N(i),entries:s})},n.exclude=(r,i)=>{const s={...e.entries};for(const o of r)if(t.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new pd({...e,checks:[],...N(i),entries:s})}});function Jv(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new pd({type:"enum",entries:t,...N(e)})}const dR=E("ZodLiteral",(n,e)=>{B$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>rT(n,t,r),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(n,e){return new dR({type:"literal",values:Array.isArray(n)?n:[n],...N(e)})}const fR=E("ZodTransform",(n,e)=>{j$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>sT(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new yv(n.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(aa(s,t.value,e));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),t.issues.push(aa(o))}};const i=e.transform(t.value,t);return i instanceof Promise?i.then(s=>(t.value=s,t)):(t.value=i,t)}});function pR(n){return new fR({type:"transform",transform:n})}const Xv=E("ZodOptional",(n,e)=>{Mv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Bv(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Km(n){return new Xv({type:"optional",innerType:n})}const mR=E("ZodExactOptional",(n,e)=>{q$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Bv(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function gR(n){return new mR({type:"optional",innerType:n})}const vR=E("ZodNullable",(n,e)=>{W$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>hT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Jm(n){return new vR({type:"nullable",innerType:n})}const yR=E("ZodDefault",(n,e)=>{G$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>fT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function wR(n,e){return new yR({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():Sv(e)}})}const bR=E("ZodPrefault",(n,e)=>{Y$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>pT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function _R(n,e){return new bR({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():Sv(e)}})}const Qv=E("ZodNonOptional",(n,e)=>{K$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>dT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function SR(n,e){return new Qv({type:"nonoptional",innerType:n,...N(e)})}const AR=E("ZodCatch",(n,e)=>{J$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function kR(n,e){return new AR({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const ER=E("ZodPipe",(n,e)=>{X$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>gT(n,t,r,i),n.in=e.in,n.out=e.out});function Xm(n,e){return new ER({type:"pipe",in:n,out:e})}const $R=E("ZodReadonly",(n,e)=>{Q$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>vT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function CR(n){return new $R({type:"readonly",innerType:n})}const TR=E("ZodCustom",(n,e)=>{eC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>iT(n,t)});function RR(n,e={}){return qC(TR,n,e)}function IR(n){return WC(n)}const xR=[".md",".markdown"];function ey(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function ty(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function PR(n){return ty(n).toLowerCase()}function DR(n,e){const t=PR(n);return e.some(r=>t.endsWith(r))}function ny(n){return!ey(n)&&DR(n,xR)}function LR(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Tn(n){try{const{pathname:e}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e)}catch{return!1}}const OR=Yv({id:p().min(1),kind:C("path"),title:p(),path:p()}).strict(),zR=Yv({id:p().min(1),kind:C("url"),title:p(),url:p().refine(LR,{message:"url must be an http(s) URL"})}).strict();cR("kind",[OR,zR]);const NR="/views/markdown/",MR="/views/url-unsupported/";function ry(n){return`/artifact/${encodeURIComponent(n)}`}function UR(n,e){return`${ry(n)}/${encodeURIComponent(e)}`}function ZR(n){return`/markdown/${encodeURIComponent(n)}`}function md(n,e={electron:!1}){if(n.kind==="url")return e.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Tn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:MR,contentURL:null};if(ny(n.path)){const r={viewURL:NR,contentURL:ZR(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=ey(n.path)?`${ry(n.id)}/`:UR(n.id,ty(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const FR="serverURL",HR="token",VR="mode",BR="desktopAppVersion",jR="electron";function qR(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(FR);return r?new URL(r).origin:new URL(e).origin}function WR(n=window.location.search){return new URLSearchParams(n).get(HR)}function jn(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(VR)===jR}function iy(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(BR)}const Qm="tv.telemetry.clientId",GR=5,YR=60,KR=1e3,JR=GR*YR*KR,eg=["pointerdown","scroll","keydown"],tg=["focus"],ng=["visibilitychange"],XR="hidden";function QR(n,e=i3){const t=n.getItem(Qm);if(t)return t;const r=e();return n.setItem(Qm,r),r}function e3(n){return{clientId:QR(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function t3(n){const e=new URLSearchParams;return e.set("clientId",n.clientId),e.set("userAgent",n.userAgent),e.set("clientApp",n.clientApp),n.desktopAppVersion&&e.set("desktopAppVersion",n.desktopAppVersion),e}function n3(n){return new r3(n)}var ma,Dn,rr,ga,va,lt,si,ya,Qc,sy;class r3{constructor(e){v(this,Qc);v(this,ma);v(this,Dn);v(this,rr);v(this,ga);v(this,va);v(this,lt);v(this,si,!1);v(this,ya,Number.NEGATIVE_INFINITY);d(this,ma,e.meta),d(this,Dn,e.documentTarget),d(this,rr,e.windowTarget),d(this,ga,e.send),d(this,va,e.nowMs??Date.now),d(this,lt,()=>h(this,Qc,sy).call(this))}start(){if(!a(this,si)){d(this,si,!0);for(const e of eg)a(this,rr).addEventListener(e,a(this,lt)),a(this,Dn).addEventListener(e,a(this,lt));for(const e of tg)a(this,rr).addEventListener(e,a(this,lt));for(const e of ng)a(this,Dn).addEventListener(e,a(this,lt))}}stop(){if(a(this,si)){d(this,si,!1);for(const e of eg)a(this,rr).removeEventListener(e,a(this,lt)),a(this,Dn).removeEventListener(e,a(this,lt));for(const e of tg)a(this,rr).removeEventListener(e,a(this,lt));for(const e of ng)a(this,Dn).removeEventListener(e,a(this,lt))}}}ma=new WeakMap,Dn=new WeakMap,rr=new WeakMap,ga=new WeakMap,va=new WeakMap,lt=new WeakMap,si=new WeakMap,ya=new WeakMap,Qc=new WeakSet,sy=function(){if(a(this,Dn).visibilityState===XR)return;const e=a(this,va).call(this);e-a(this,ya)<JR||(d(this,ya,e),a(this,ga).call(this,{type:tE,clientId:a(this,ma).clientId}))};function i3(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ep().toLowerCase()}const fe={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},kn={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},s3=1,o3=w({_meta:S(p(),_()).nullish(),terminal:Ie().optional().default(!1)}),a3=w({_meta:S(p(),_()).nullish(),label:p().nullish(),name:p(),optional:Ie().optional().default(!1),secret:Ie().optional().default(!0)}),l3=w({_meta:S(p(),_()).nullish(),description:p().nullish(),id:p(),name:p()}),c3=w({_meta:S(p(),_()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:z(a3)}),u3=w({_meta:S(p(),_()).nullish(),args:z(p()).optional(),description:p().nullish(),env:S(p(),p()).optional(),id:p(),name:p()}),h3=q([c3.and(w({type:C("env_var")})),u3.and(w({type:C("terminal")})),l3]),d3=w({_meta:S(p(),_()).nullish(),methodId:p()}),f3=w({_meta:S(p(),_()).nullish()}),p3=w({_meta:S(p(),_()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),m3=w({default:Ie().nullish(),description:p().nullish(),title:p().nullish()}),g3=w({_meta:S(p(),_()).nullish()}),v3=w({_meta:S(p(),_()).nullish()}),y3=w({amount:H(),currency:p()}),w3=w({_meta:S(p(),_()).nullish(),terminalId:p()}),b3=w({_meta:S(p(),_()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),_3=q([p(),H(),H(),Ie(),z(p())]),S3=w({content:S(p(),_3).nullish()}),A3=q([S3.and(w({action:C("accept")})),w({action:C("decline")}),w({action:C("cancel")})]),k3=w({_meta:S(p(),_()).nullish()}),oy=p(),E3=w({_meta:S(p(),_()).nullish(),elicitationId:oy}),$3=w({_meta:S(p(),_()).nullish(),action:A3}),C3=C("object"),T3=C("string"),R3=w({_meta:S(p(),_()).nullish()}),I3=w({_meta:S(p(),_()).nullish(),form:k3.nullish(),url:R3.nullish()}),x3=w({elicitationId:oy,url:p().url()}),ay=w({const:p(),title:p()}),ly=w({_meta:S(p(),_()).nullish(),name:p(),value:p()}),P3=q([C(-32700),C(-32600),C(-32601),C(-32602),C(-32603),C(-32800),C(-32e3),C(-32002),C(-32042),H().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),cy=w({code:P3,data:_().optional(),message:p()}),uy=_(),hy=_(),dy=_(),D3=w({_meta:S(p(),_()).nullish(),readTextFile:Ie().optional().default(!1),writeTextFile:Ie().optional().default(!1)}),fy=w({_meta:S(p(),_()).nullish(),name:p(),value:p()}),py=w({_meta:S(p(),_()).nullish(),name:p(),title:p().nullish(),version:p()}),L3=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),O3=w({_meta:S(p(),_()).nullish()}),z3=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),N3=w({_meta:S(p(),_()).nullish()}),M3=w({_meta:S(p(),_()).nullish(),logout:N3.nullish()}),U3=w({_meta:S(p(),_()).nullish()}),Z3=w({_meta:S(p(),_()).nullish()}),F3=w({_meta:S(p(),_()).nullish(),http:Ie().optional().default(!1),sse:Ie().optional().default(!1)}),H3=w({_meta:S(p(),_()).nullish(),headers:z(fy),name:p(),url:p()}),V3=w({_meta:S(p(),_()).nullish(),headers:z(fy),name:p(),url:p()}),B3=w({_meta:S(p(),_()).nullish(),args:z(p()),command:p(),env:z(ly),name:p()}),Iu=q([H3.and(w({type:C("http")})),V3.and(w({type:C("sse")})),B3]),ap=p(),j3=w({_meta:S(p(),_()).nullish(),description:p().nullish(),modelId:ap,name:p()}),q3=q([C("error"),C("warning"),C("information"),C("hint")]),W3=w({_meta:S(p(),_()).nullish()}),G3=w({_meta:S(p(),_()).nullish()}),Y3=w({_meta:S(p(),_()).nullish()}),K3=w({_meta:S(p(),_()).nullish()}),J3=w({_meta:S(p(),_()).nullish()}),X3=w({_meta:S(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Q3=w({diff:p(),uri:p()}),eI=w({endLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:p()}),tI=w({_meta:S(p(),_()).nullish()}),nI=w({_meta:S(p(),_()).nullish()}),rI=w({languageId:p(),text:p(),uri:p()}),iI=w({_meta:S(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),sI=q([C("rejected"),C("ignored"),C("replaced"),C("cancelled")]),oI=w({excerpts:z(eI),uri:p()}),aI=w({_meta:S(p(),_()).nullish()}),lI=w({_meta:S(p(),_()).nullish()}),cI=w({name:p(),owner:p(),remoteUrl:p()}),uI=w({_meta:S(p(),_()).nullish()}),hI=w({_meta:S(p(),_()).nullish(),jump:tI.nullish(),rename:lI.nullish(),searchAndReplace:uI.nullish()}),dI=w({id:p(),isRegex:Ie().nullish(),replace:p(),search:p(),uri:p()}),fI=q([C("automatic"),C("diagnostic"),C("manual")]),pI=w({_meta:S(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),mI=w({_meta:S(p(),_()).nullish(),diagnostics:W3.nullish(),editHistory:X3.nullish(),openFiles:nI.nullish(),recentFiles:iI.nullish(),relatedSnippets:aI.nullish(),userActions:pI.nullish()}),gI=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Iu)}),vI=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),my=p(),yI=q([C("allow_once"),C("allow_always"),C("reject_once"),C("reject_always")]),wI=w({_meta:S(p(),_()).nullish(),kind:yI,name:p(),optionId:my}),bI=q([C("high"),C("medium"),C("low")]),_I=q([C("pending"),C("in_progress"),C("completed")]),SI=w({_meta:S(p(),_()).nullish(),content:p(),priority:bI,status:_I}),AI=w({_meta:S(p(),_()).nullish(),entries:z(SI)}),Pr=w({character:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),kI=w({id:p(),position:Pr,uri:p()}),EI=w({id:p(),newName:p(),position:Pr,uri:p()}),$I=w({action:p(),position:Pr,timestampMs:H(),uri:p()}),gy=q([C("utf-16"),C("utf-32"),C("utf-8")]),CI=w({_meta:S(p(),_()).nullish(),auth:o3.optional().default({terminal:!1}),elicitation:I3.nullish(),fs:D3.optional().default({readTextFile:!1,writeTextFile:!1}),nes:hI.nullish(),positionEncodings:z(gy).optional(),terminal:Ie().optional().default(!1)}),TI=w({_meta:S(p(),_()).nullish(),audio:Ie().optional().default(!1),embeddedContext:Ie().optional().default(!1),image:Ie().optional().default(!1)}),vy=H().int().gte(0).lte(65535),RI=w({_meta:S(p(),_()).nullish(),clientCapabilities:CI.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:py.nullish(),protocolVersion:vy}),mo=w({end:Pr,start:Pr}),II=w({message:p(),range:mo,severity:q3,uri:p()}),xI=w({languageId:p(),lastFocusedMs:H().nullish(),uri:p(),visibleRange:mo.nullish()}),PI=w({_meta:S(p(),_()).nullish(),diagnostics:z(II).nullish(),editHistory:z(Q3).nullish(),openFiles:z(xI).nullish(),recentFiles:z(rI).nullish(),relatedSnippets:z(oI).nullish(),userActions:z($I).nullish()}),DI=w({newText:p(),range:mo}),LI=w({cursorPosition:Pr.nullish(),edits:z(DI),id:p(),uri:p()}),OI=q([LI.and(w({kind:C("edit")})),kI.and(w({kind:C("jump")})),EI.and(w({kind:C("rename")})),dI.and(w({kind:C("searchAndReplace")}))]),zI=w({_meta:S(p(),_()).nullish(),content:p()}),NI=w({_meta:S(p(),_()).nullish()}),Mi=q([H(),p()]).nullable();w({_meta:S(p(),_()).nullish(),requestId:Mi});const MI=Jv(["assistant","user"]),bl=w({_meta:S(p(),_()).nullish(),audience:z(MI).nullish(),lastModified:p().nullish(),priority:H().nullish()}),UI=w({_meta:S(p(),_()).nullish(),annotations:bl.nullish(),data:p(),mimeType:p()}),ZI=w({_meta:S(p(),_()).nullish(),annotations:bl.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),FI=w({_meta:S(p(),_()).nullish(),annotations:bl.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:H().nullish(),title:p().nullish(),uri:p()}),HI=w({_meta:S(p(),_()).nullish(),optionId:my}),VI=q([w({outcome:C("cancelled")}),HI.and(w({outcome:C("selected")}))]),BI=w({_meta:S(p(),_()).nullish(),outcome:VI}),jI=w({_meta:S(p(),_()).nullish()}),qI=w({_meta:S(p(),_()).nullish()}),WI=w({currentValue:Ie()}),GI=p(),yy=p(),YI=q([C("mode"),C("model"),C("thought_level"),p()]),lp=p(),wy=w({_meta:S(p(),_()).nullish(),description:p().nullish(),name:p(),value:lp}),KI=w({_meta:S(p(),_()).nullish(),group:GI,name:p(),options:z(wy)}),JI=q([z(wy),z(KI)]),XI=w({currentValue:lp,options:JI}),go=Ru(q([XI.and(w({type:C("select")})),WI.and(w({type:C("boolean")}))]),w({_meta:S(p(),_()).nullish(),category:YI.nullish(),description:p().nullish(),id:yy,name:p()})),QI=w({_meta:S(p(),_()).nullish(),configOptions:z(go)}),ex=w({_meta:S(p(),_()).nullish()}),ne=p(),tx=w({_meta:S(p(),_()).nullish(),id:p(),sessionId:ne}),nx=w({_meta:S(p(),_()).nullish(),sessionId:ne}),rx=w({_meta:S(p(),_()).nullish(),sessionId:ne}),ix=w({_meta:S(p(),_()).nullish(),sessionId:ne}),by=w({_meta:S(p(),_()).nullish(),args:z(p()).optional(),command:p(),cwd:p().nullish(),env:z(ly).optional(),outputByteLimit:H().nullish(),sessionId:ne}),sx=w({_meta:S(p(),_()).nullish(),sessionId:ne,uri:p()}),ox=w({_meta:S(p(),_()).nullish(),position:Pr,sessionId:ne,uri:p(),version:H(),visibleRange:mo}),ax=w({_meta:S(p(),_()).nullish(),languageId:p(),sessionId:ne,text:p(),uri:p(),version:H()}),lx=w({_meta:S(p(),_()).nullish(),sessionId:ne,uri:p()}),cx=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Iu).optional(),sessionId:ne}),_y=w({_meta:S(p(),_()).nullish(),sessionId:ne,terminalId:p()}),ux=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Iu),sessionId:ne}),Sy=w({_meta:S(p(),_()).nullish(),limit:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p(),sessionId:ne}),hx=w({_meta:S(p(),_()).nullish(),id:p(),reason:sI.nullish(),sessionId:ne}),Ay=w({_meta:S(p(),_()).nullish(),sessionId:ne,terminalId:p()}),dx=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Iu).optional(),sessionId:ne}),fx=w({_meta:S(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),sessionId:ne,title:p().nullish(),updatedAt:p().nullish()}),px=w({_meta:S(p(),_()).nullish(),nextCursor:p().nullish(),sessions:z(fx)}),mx=w({_meta:S(p(),_()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),gx=w({_meta:S(p(),_()).nullish()}),xu=p(),vx=w({_meta:S(p(),_()).nullish(),currentModeId:xu}),yx=w({_meta:S(p(),_()).nullish(),description:p().nullish(),id:xu,name:p()}),Pu=w({_meta:S(p(),_()).nullish(),availableModes:z(yx),currentModeId:xu}),Du=w({_meta:S(p(),_()).nullish(),availableModels:z(j3),currentModelId:ap}),wx=w({_meta:S(p(),_()).nullish(),configOptions:z(go).nullish(),models:Du.nullish(),modes:Pu.nullish(),sessionId:ne}),bx=w({_meta:S(p(),_()).nullish(),configOptions:z(go).nullish(),models:Du.nullish(),modes:Pu.nullish()}),_x=w({_meta:S(p(),_()).nullish(),configOptions:z(go).nullish(),models:Du.nullish(),modes:Pu.nullish(),sessionId:ne}),Sx=w({_meta:S(p(),_()).nullish(),configOptions:z(go).nullish(),models:Du.nullish(),modes:Pu.nullish()}),Ax=w({_meta:S(p(),_()).nullish()}),kx=w({_meta:S(p(),_()).nullish(),additionalDirectories:jI.nullish(),close:qI.nullish(),fork:ex.nullish(),list:gx.nullish(),resume:Ax.nullish()}),Ex=Ru(q([w({type:C("boolean"),value:Ie()}),w({value:lp})]),w({_meta:S(p(),_()).nullish(),configId:yy,sessionId:ne})),$x=w({_meta:S(p(),_()).nullish(),configOptions:z(go)}),Cx=w({_meta:S(p(),_()).nullish(),modeId:xu,sessionId:ne}),Tx=w({_meta:S(p(),_()).nullish()}),Rx=w({_meta:S(p(),_()).nullish(),modelId:ap,sessionId:ne}),Ix=w({_meta:S(p(),_()).nullish()}),xx=w({_meta:S(p(),_()).nullish(),sessionId:ne}),Px=q([C("end_turn"),C("max_tokens"),C("max_turn_requests"),C("refusal"),C("cancelled")]),Dx=q([C("email"),C("uri"),C("date"),C("date-time")]),Lx=w({default:p().nullish(),description:p().nullish(),enum:z(p()).nullish(),format:Dx.nullish(),maxLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(ay).nullish(),pattern:p().nullish(),title:p().nullish()}),Ox=w({_meta:S(p(),_()).nullish(),context:PI.nullish(),position:Pr,selection:mo.nullish(),sessionId:ne,triggerKind:fI,uri:p(),version:H()}),zx=w({_meta:S(p(),_()).nullish(),suggestions:z(OI)}),Nx=w({_meta:S(p(),_()).nullish(),terminalId:p()}),Mx=w({_meta:S(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),ky=w({_meta:S(p(),_()).nullish(),sessionId:ne,terminalId:p()}),Ux=w({_meta:S(p(),_()).nullish(),exitStatus:Mx.nullish(),output:p(),truncated:Ie()}),Zx=w({_meta:S(p(),_()).nullish(),annotations:bl.nullish(),text:p()}),Fx=w({range:mo.nullish(),text:p()}),Hx=w({_meta:S(p(),_()).nullish(),contentChanges:z(Fx),sessionId:ne,uri:p(),version:H()});w({method:p(),params:q([nx,ax,Hx,sx,lx,ox,tx,hx,uy]).nullish()});const Vx=q([C("full"),C("incremental")]),Bx=w({_meta:S(p(),_()).nullish(),syncKind:Vx}),jx=w({_meta:S(p(),_()).nullish(),didChange:Bx.nullish(),didClose:G3.nullish(),didFocus:Y3.nullish(),didOpen:K3.nullish(),didSave:J3.nullish()}),qx=w({_meta:S(p(),_()).nullish(),document:jx.nullish()}),Wx=w({_meta:S(p(),_()).nullish(),context:mI.nullish(),events:qx.nullish()}),Gx=w({_meta:S(p(),_()).nullish(),auth:M3.optional().default({}),loadSession:Ie().optional().default(!1),mcpCapabilities:F3.optional().default({http:!1,sse:!1}),nes:Wx.nullish(),positionEncoding:gy.nullish(),promptCapabilities:TI.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:kx.optional().default({})}),Yx=w({_meta:S(p(),_()).nullish(),agentCapabilities:Gx.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:py.nullish(),authMethods:z(h3).optional().default([]),protocolVersion:vy}),Kx=w({_meta:S(p(),_()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Jx=q([Kx,p3]),Xx=w({_meta:S(p(),_()).nullish(),annotations:bl.nullish(),resource:Jx}),cp=q([Zx.and(w({type:C("text")})),ZI.and(w({type:C("image")})),UI.and(w({type:C("audio")})),FI.and(w({type:C("resource_link")})),Xx.and(w({type:C("resource")}))]),Qx=w({_meta:S(p(),_()).nullish(),content:cp}),Lh=w({_meta:S(p(),_()).nullish(),content:cp,messageId:p().nullish()}),eP=w({_meta:S(p(),_()).nullish(),messageId:p().nullish(),prompt:z(cp),sessionId:ne}),tP=w({anyOf:z(ay)}),Ey=q([Qx.and(w({type:C("content")})),b3.and(w({type:C("diff")})),Nx.and(w({type:C("terminal")}))]),$y=p(),Cy=w({_meta:S(p(),_()).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p()}),Ty=q([C("pending"),C("in_progress"),C("completed"),C("failed")]),Ry=q([C("read"),C("edit"),C("delete"),C("move"),C("search"),C("execute"),C("think"),C("fetch"),C("switch_mode"),C("other")]),nP=w({_meta:S(p(),_()).nullish(),content:z(Ey).optional(),kind:Ry.optional(),locations:z(Cy).optional(),rawInput:_().optional(),rawOutput:_().optional(),status:Ty.optional(),title:p(),toolCallId:$y}),Iy=w({_meta:S(p(),_()).nullish(),content:z(Ey).nullish(),kind:Ry.nullish(),locations:z(Cy).nullish(),rawInput:_().optional(),rawOutput:_().optional(),status:Ty.nullish(),title:p().nullish(),toolCallId:$y}),xy=w({_meta:S(p(),_()).nullish(),options:z(wI),sessionId:ne,toolCall:Iy}),rP=w({_meta:S(p(),_()).nullish(),hint:p()}),iP=rP,sP=w({_meta:S(p(),_()).nullish(),description:p(),input:iP.nullish(),name:p()}),oP=w({_meta:S(p(),_()).nullish(),availableCommands:z(sP)}),aP=w({enum:z(p()),type:T3}),lP=q([aP,tP]),cP=w({default:z(p()).nullish(),description:p().nullish(),items:lP,maxItems:H().nullish(),minItems:H().nullish(),title:p().nullish()}),uP=q([Lx.and(w({type:C("string")})),vI.and(w({type:C("number")})),L3.and(w({type:C("integer")})),m3.and(w({type:C("boolean")})),cP.and(w({type:C("array")}))]),hP=w({description:p().nullish(),properties:S(p(),uP).optional().default({}),required:z(p()).nullish(),title:p().nullish(),type:C3.optional().default("object")}),dP=w({requestedSchema:hP}),fP=Ru(q([dP.and(w({mode:C("form")})),x3.and(w({mode:C("url")}))]),w({_meta:S(p(),_()).nullish(),message:p(),sessionId:ne})),pP=w({cachedReadTokens:H().nullish(),cachedWriteTokens:H().nullish(),inputTokens:H(),outputTokens:H(),thoughtTokens:H().nullish(),totalTokens:H()}),mP=w({_meta:S(p(),_()).nullish(),stopReason:Px,usage:pP.nullish(),userMessageId:p().nullish()});q([w({id:Mi,result:q([Yx,f3,Z3,_x,bx,px,wx,Sx,v3,Tx,$x,mP,Ix,xx,zx,g3,dy])}),w({error:cy,id:Mi})]);const gP=w({_meta:S(p(),_()).nullish(),cost:y3.nullish(),size:H(),used:H()}),vP=q([Lh.and(w({sessionUpdate:C("user_message_chunk")})),Lh.and(w({sessionUpdate:C("agent_message_chunk")})),Lh.and(w({sessionUpdate:C("agent_thought_chunk")})),nP.and(w({sessionUpdate:C("tool_call")})),Iy.and(w({sessionUpdate:C("tool_call_update")})),AI.and(w({sessionUpdate:C("plan")})),oP.and(w({sessionUpdate:C("available_commands_update")})),vx.and(w({sessionUpdate:C("current_mode_update")})),QI.and(w({sessionUpdate:C("config_option_update")})),mx.and(w({sessionUpdate:C("session_info_update")})),gP.and(w({sessionUpdate:C("usage_update")}))]),Py=w({_meta:S(p(),_()).nullish(),sessionId:ne,update:vP});w({method:p(),params:q([Py,E3,uy]).nullish()});const Dy=w({_meta:S(p(),_()).nullish(),sessionId:ne,terminalId:p()}),yP=w({_meta:S(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),wP=w({name:p(),uri:p()}),bP=w({_meta:S(p(),_()).nullish(),repository:cI.nullish(),workspaceFolders:z(wP).nullish(),workspaceUri:p().nullish()});w({id:Mi,method:p(),params:q([RI,d3,U3,gI,ux,z3,cx,dx,ix,Cx,Ex,eP,Rx,bP,Ox,rx,hy]).nullish()});const Ly=w({_meta:S(p(),_()).nullish(),content:p(),path:p(),sessionId:ne});w({id:Mi,method:p(),params:q([Ly,Sy,xy,by,ky,Ay,Dy,_y,fP,hy]).nullish()});const _P=w({_meta:S(p(),_()).nullish()});q([w({id:Mi,result:q([_P,zI,BI,w3,Ux,NI,yP,O3,$3,dy])}),w({error:cy,id:Mi})]);var te;class SP{constructor(e,t){v(this,te);const r=e(this),i=async(o,l)=>{var c,u,f,m,g,y,k;switch(o){case kn.fs_write_text_file:{const A=Ly.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,A)}case kn.fs_read_text_file:{const A=Sy.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,A)}case kn.session_request_permission:{const A=xy.parse(l);return r.requestPermission(A)}case kn.terminal_create:{const A=by.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,A)}case kn.terminal_output:{const A=ky.parse(l);return(m=r.terminalOutput)==null?void 0:m.call(r,A)}case kn.terminal_release:{const A=Ay.parse(l);return await((g=r.releaseTerminal)==null?void 0:g.call(r,A))??{}}case kn.terminal_wait_for_exit:{const A=Dy.parse(l);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,A)}case kn.terminal_kill:{const A=_y.parse(l);return await((k=r.killTerminal)==null?void 0:k.call(r,A))??{}}default:if(r.extMethod)return r.extMethod(o,l);throw Ce.methodNotFound(o)}},s=async(o,l)=>{switch(o){case kn.session_update:{const c=Py.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(o,l);throw Ce.methodNotFound(o)}};d(this,te,new AP(i,s,t))}async initialize(e){return await a(this,te).sendRequest(fe.initialize,e)}async newSession(e){return await a(this,te).sendRequest(fe.session_new,e)}async loadSession(e){return await a(this,te).sendRequest(fe.session_load,e)??{}}async unstable_forkSession(e){return await a(this,te).sendRequest(fe.session_fork,e)}async listSessions(e){return await a(this,te).sendRequest(fe.session_list,e)}async unstable_resumeSession(e){return await a(this,te).sendRequest(fe.session_resume,e)}async unstable_closeSession(e){return await a(this,te).sendRequest(fe.session_close,e)}async setSessionMode(e){return await a(this,te).sendRequest(fe.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await a(this,te).sendRequest(fe.session_set_model,e)??{}}async setSessionConfigOption(e){return await a(this,te).sendRequest(fe.session_set_config_option,e)}async authenticate(e){return await a(this,te).sendRequest(fe.authenticate,e)??{}}async unstable_logout(e){return await a(this,te).sendRequest(fe.logout,e)??{}}async prompt(e){return await a(this,te).sendRequest(fe.session_prompt,e)}async cancel(e){return await a(this,te).sendNotification(fe.session_cancel,e)}async unstable_startNes(e){return await a(this,te).sendRequest(fe.nes_start,e)}async unstable_suggestNes(e){return await a(this,te).sendRequest(fe.nes_suggest,e)}async unstable_closeNes(e){return await a(this,te).sendRequest(fe.nes_close,e)??{}}async unstable_didOpenDocument(e){return await a(this,te).sendNotification(fe.document_did_open,e)}async unstable_didChangeDocument(e){return await a(this,te).sendNotification(fe.document_did_change,e)}async unstable_didCloseDocument(e){return await a(this,te).sendNotification(fe.document_did_close,e)}async unstable_didSaveDocument(e){return await a(this,te).sendNotification(fe.document_did_save,e)}async unstable_didFocusDocument(e){return await a(this,te).sendNotification(fe.document_did_focus,e)}async unstable_acceptNes(e){return await a(this,te).sendNotification(fe.nes_accept,e)}async unstable_rejectNes(e){return await a(this,te).sendNotification(fe.nes_reject,e)}async extMethod(e,t){return await a(this,te).sendRequest(e,t)}async extNotification(e,t){return await a(this,te).sendNotification(e,t)}get signal(){return a(this,te).signal}get closed(){return a(this,te).closed}}te=new WeakMap;var ir,eu,wa,ba,bs,_s,Bt,_a,me,Oy,gd,zy,Ny,My,Uy,vd,No;class AP{constructor(e,t,r){v(this,me);v(this,ir,new Map);v(this,eu,0);v(this,wa);v(this,ba);v(this,bs);v(this,_s,Promise.resolve());v(this,Bt,new AbortController);v(this,_a);d(this,wa,e),d(this,ba,t),d(this,bs,r),d(this,_a,new Promise(i=>{a(this,Bt).signal.addEventListener("abort",()=>i())})),h(this,me,Oy).call(this)}get signal(){return a(this,Bt).signal}get closed(){return a(this,_a)}async sendRequest(e,t){h(this,me,vd).call(this);const r=th(this,eu)._++,i=new Promise((s,o)=>{a(this,ir).set(r,{resolve:s,reject:o})});return await h(this,me,No).call(this,{jsonrpc:"2.0",id:r,method:e,params:t}),i}async sendNotification(e,t){h(this,me,vd).call(this),await h(this,me,No).call(this,{jsonrpc:"2.0",method:e,params:t})}}ir=new WeakMap,eu=new WeakMap,wa=new WeakMap,ba=new WeakMap,bs=new WeakMap,_s=new WeakMap,Bt=new WeakMap,_a=new WeakMap,me=new WeakSet,Oy=async function(){let e;try{const t=a(this,bs).readable.getReader();try{for(;!a(this,Bt).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{h(this,me,zy).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&h(this,me,No).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{t.releaseLock()}}catch(t){e=t}finally{h(this,me,gd).call(this,e)}},gd=function(e){if(a(this,Bt).signal.aborted)return;const t=e??new Error("ACP connection closed");for(const r of a(this,ir).values())r.reject(t);a(this,ir).clear(),a(this,Bt).abort(t)},zy=async function(e){if("method"in e&&"id"in e){const t=await h(this,me,Ny).call(this,e.method,e.params);"error"in t&&console.error("Error handling request",e,t.error),await h(this,me,No).call(this,{jsonrpc:"2.0",id:e.id,...t})}else if("method"in e){const t=await h(this,me,My).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?h(this,me,Uy).call(this,e):console.error("Invalid message",{message:e})},Ny=async function(e,t){try{return{result:await a(this,wa).call(this,e,t)??null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Wm)return Ce.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},My=async function(e,t){try{return await a(this,ba).call(this,e,t),{result:null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Wm)return Ce.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},Uy=function(e){const t=a(this,ir).get(e.id);if(t){if("result"in e)t.resolve(e.result);else if("error"in e){const{code:r,message:i,data:s}=e.error;t.reject(new Ce(r,i,s))}a(this,ir).delete(e.id)}else console.error("Got response to unknown request",e.id)},vd=function(){if(a(this,Bt).signal.aborted)throw a(this,Bt).signal.reason??new Error("ACP connection closed")},No=async function(e){return d(this,_s,a(this,_s).then(async()=>{const t=a(this,bs).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{h(this,me,gd).call(this,t)})),a(this,_s)};class Ce extends Error{constructor(t,r,i){super(r);$(this,"code");$(this,"data");this.code=t,this.name="RequestError",this.data=i}static parseError(t,r){return new Ce(-32700,`Parse error${r?`: ${r}`:""}`,t)}static invalidRequest(t,r){return new Ce(-32600,`Invalid request${r?`: ${r}`:""}`,t)}static methodNotFound(t){return new Ce(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,r){return new Ce(-32602,`Invalid params${r?`: ${r}`:""}`,t)}static internalError(t,r){return new Ce(-32603,`Internal error${r?`: ${r}`:""}`,t)}static authRequired(t,r){return new Ce(-32e3,`Authentication required${r?`: ${r}`:""}`,t)}static resourceNotFound(t){return new Ce(-32002,`Resource not found${t?`: ${t}`:""}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function kP(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function Zy(n){var t;class e extends n{constructor(...s){super(...s);v(this,t,!1);kP(this,()=>a(this,t),()=>{d(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return a(this,t)}}return t=new WeakMap,e}const EP=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,$P=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,CP=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,TP=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,RP=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,IP="single_session",xP={name:"television-acp-client",version:"0.0.0"},Fy="agent:main:television",PP=Zy(zr);var Ss,jt,nt,qt,sr,Et,Ln,Wt,Gt,or,$t,As,ks,Yt,He,On,Es,oi,zn,ar,Sa,Ct,Kt,tu,Jt,T,yd,Hy,Vy,By,uc,jy,qy,Wy,Gy,Yy,Ky,Jy,Br,ss,os,$n,Xy,as,wd,bd,hc,Qy,dc,_d,Sd,Aa,ka,fc,ls,Ad,ew;class DP extends PP{constructor(t){super();v(this,T);v(this,Ss,"disconnected");v(this,jt,null);v(this,nt,new Map);v(this,qt,null);v(this,sr,null);v(this,Et,null);v(this,Ln,null);v(this,Wt,null);v(this,Gt,null);v(this,or);v(this,$t,null);v(this,As,0);v(this,ks,1);v(this,Yt,null);v(this,He,null);v(this,On,!1);v(this,Es,!1);v(this,oi,!1);v(this,zn,null);v(this,ar,new Set);v(this,Sa);v(this,Ct);v(this,Kt);v(this,tu,t=>{h(this,T,Vy).call(this,t)});v(this,Jt,null);v(this,Aa,()=>{h(this,T,ls).call(this,"ACP bridge websocket closed")});v(this,ka,()=>{h(this,T,ls).call(this,"ACP bridge websocket error")});d(this,Ct,t),d(this,Kt,t.sessionMode??IP),d(this,or,t.mappedSessionStore??LP()),d(this,Sa,t.createSocket??(r=>new WebSocket(r)))}get status(){return a(this,Ss)}get messages(){return[...a(this,nt).values()]}get enabled(){return a(this,Ct).enabled??!1}setToken(t){a(this,Ct).token=t??""}setEnabled(t){a(this,Ct).enabled=t,t||(h(this,T,fc).call(this),d(this,jt,null),h(this,T,$n).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){a(this,sr)===null&&(d(this,jt,null),d(this,sr,h(this,T,Hy).call(this)));try{await a(this,sr),await h(this,T,uc).call(this)}catch(t){throw h(this,T,ls).call(this,Oh(t)),t}}}dispose(){h(this,T,fc).call(this),d(this,jt,null),h(this,T,$n).call(this,"disposed")}async sendMessage(t){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,T,yd).call(this,"ready")),(a(this,Wt)===null||a(this,$t)!==h(this,T,dc).call(this))&&await h(this,T,uc).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=t.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,T,ss).call(this,{id:h(this,T,as).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,T,$n).call(this,"running");try{const i=await h(this,T,hc).call(this).prompt({sessionId:h(this,T,bd).call(this),prompt:[{type:"text",text:h(this,T,Xy).call(this,r)}]});h(this,T,Br).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,T,$n).call(this,"ready")}catch(i){throw h(this,T,ew).call(this)||(h(this,T,Br).call(this,"error"),h(this,T,$n).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,T,yd).call(this,"ready"));const t=h(this,T,dc).call(this);((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="mapped"?a(this,or).clearActualSessionId(t):d(this,As,a(this,As)+1),d(this,Et,null),d(this,Ln,null),d(this,Wt,null),d(this,$t,null),h(this,T,Ad).call(this)}async cancel(){this.status==="running"&&(h(this,T,$n).call(this,"cancelling"),await h(this,T,hc).call(this).cancel({sessionId:h(this,T,bd).call(this)}))}setChannelContext(t){var s,o,l;if(t===null){if(a(this,He)===null)return;d(this,He,null),d(this,On,!1);return}const r={channelID:t.channelID,channelName:t.channelName};if(((s=a(this,He))==null?void 0:s.channelID)===r.channelID&&((o=a(this,He))==null?void 0:o.channelName)===r.channelName)return;const i=((l=a(this,He))==null?void 0:l.channelID)??null;if(d(this,He,r),a(this,Kt)==="single_session"){(!a(this,$t)||i!==r.channelID)&&d(this,On,!0);return}a(this,$t)!==h(this,T,_d).call(this,r.channelID)&&(d(this,Et,null),d(this,Ln,null),a(this,qt)&&this.status==="ready"&&h(this,T,uc).call(this).catch(c=>{h(this,T,ls).call(this,Oh(c))}))}}Ss=new WeakMap,jt=new WeakMap,nt=new WeakMap,qt=new WeakMap,sr=new WeakMap,Et=new WeakMap,Ln=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,or=new WeakMap,$t=new WeakMap,As=new WeakMap,ks=new WeakMap,Yt=new WeakMap,He=new WeakMap,On=new WeakMap,Es=new WeakMap,oi=new WeakMap,zn=new WeakMap,ar=new WeakMap,Sa=new WeakMap,Ct=new WeakMap,Kt=new WeakMap,tu=new WeakMap,Jt=new WeakMap,T=new WeakSet,yd=async function(t){if(this.status!==t){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(a(this,jt)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",o)},o=()=>{if(this.status===t){s(),r();return}if(this.status==="disposed"){s(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(s(),i(new Error(a(this,jt)??"ACPClient is disconnected")))};this.addEventListener("status-changed",o)})}},Hy=async function(){try{const{stream:t,socket:r,metadata:i}=await MP({serverURL:a(this,Ct).serverURL,token:a(this,Ct).token,createSocket:a(this,Sa),onDisconnect:a(this,tu)});d(this,Gt,i),d(this,Jt,r),r.addEventListener("close",a(this,Aa)),r.addEventListener("error",a(this,ka)),d(this,qt,new SP(s=>({connection:s,sessionUpdate:async o=>{await h(this,T,qy).call(this,o)},requestPermission:async o=>h(this,T,Wy).call(this,o)}),t)),await a(this,qt).initialize({protocolVersion:s3,clientCapabilities:{},clientInfo:xP})}catch(t){throw t}},Vy=function(t){h(this,T,ls).call(this,Oh(t))},By=function(t){const r=t==null?void 0:t.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(s=>s.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},uc=async function(){const t=h(this,T,dc).call(this);if(a(this,Et)&&a(this,Ln)===t){await a(this,Et);return}d(this,Ln,t),d(this,Et,h(this,T,jy).call(this,t)),await a(this,Et)},jy=async function(t){var c;const r=h(this,T,hc).call(this);h(this,T,Ad).call(this);let i,s=!1,o=null;const l={cwd:h(this,T,Qy).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(d(this,oi,!0),d(this,zn,null),((c=a(this,Gt))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=a(this,or).getActualSessionId(t);if(u)try{const f=await r.loadSession({...l,sessionId:u});if(OP(f))throw new Error("Mapped ACP session was not found");o=f,i=u,s=!0}catch{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,or).setActualSessionId(t,i),s=!1}else{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,or).setActualSessionId(t,i),s=!1}}else try{o=await r.loadSession({...l,sessionId:t}),i=t,s=a(this,nt).size>0}catch{const u=await r.newSession(l);o=u,i=u.sessionId,s=!1}}finally{d(this,oi,!1),d(this,zn,null),h(this,T,Br).call(this,"final")}h(this,T,By).call(this,o),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,Wt,i),d(this,$t,t),d(this,Es,!0),s?(a(this,ar).add(t),a(this,Kt)==="single_session"&&d(this,On,!1)):(a(this,ar).delete(t),d(this,On,a(this,Kt)==="single_session")),d(this,jt,null),h(this,T,$n).call(this,"ready")},qy=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,T,Jy).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,T,Gy).call(this,r.content.text);return;case"tool_call":h(this,T,Yy).call(this,r);return;case"tool_call_update":h(this,T,Ky).call(this,r);return;case"agent_thought_chunk":return;default:return}},Wy=async function(t){return{outcome:{outcome:"cancelled"}}},Gy=function(t){d(this,zn,null);const r=NP(t);if(!r)return;if(!a(this,Yt)){const s={id:h(this,T,as).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,Yt,s.id),h(this,T,ss).call(this,s);return}const i=a(this,nt).get(a(this,Yt));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,T,os).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Yy=function(t){h(this,T,Br).call(this,"final");const r=h(this,T,wd).call(this,t.toolCallId),i=ig("content"in t?t.content:void 0),s={id:(r==null?void 0:r.id)??h(this,T,as).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:t.title,toolKind:t.kind??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:t.locations??(r==null?void 0:r.locations)};if(r){h(this,T,os).call(this,s);return}h(this,T,ss).call(this,s)},Ky=function(t){const r=h(this,T,wd).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",s=ig(t.content),o=s?`${i}${s}`:i,l={id:(r==null?void 0:r.id)??h(this,T,as).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:(r==null?void 0:r.title)??t.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:o,locations:t.locations??(r==null?void 0:r.locations)};if(r){h(this,T,os).call(this,l);return}h(this,T,ss).call(this,l)},Jy=function(t){if(h(this,T,Br).call(this,"final"),!t)return;const r=a(this,oi)?a(this,zn):null;if(!r){const s=rg(t);if(!s)return;const o={id:h(this,T,as).call(this,"user"),kind:"user",text:s,status:"final"};h(this,T,ss).call(this,o),a(this,oi)&&d(this,zn,o.id);return}const i=a(this,nt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,T,os).call(this,{...i,text:rg(`${i.text}${t}`)})},Br=function(t){if(!a(this,Yt))return;const r=a(this,nt).get(a(this,Yt));(r==null?void 0:r.kind)==="assistant"&&h(this,T,os).call(this,{...r,status:t}),d(this,Yt,null)},ss=function(t){a(this,nt).set(t.id,t),this.dispatchEvent(new xh("messages-changed"))},os=function(t){a(this,nt).set(t.id,t),this.dispatchEvent(new xh("messages-changed"))},$n=function(t){a(this,Ss)!==t&&(d(this,Ss,t),this.dispatchEvent(new jE("status-changed")))},Xy=function(t){const r=a(this,$t);if(!r)return t;const i=a(this,He)?a(this,Kt)==="single_session"?a(this,On)||!a(this,ar).has(r):!a(this,ar).has(r):!1,s=a(this,Es)&&(a(this,He)!==null||TP.test(t));if(!(s||i))return t;s&&d(this,Es,!1),i&&(d(this,On,!1),a(this,ar).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."];return a(this,He)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${a(this,He).channelID}`),l.push(`channel_name: ${a(this,He).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",t),l.join(`
|
|
43
|
-
`)},as=function(t){const r=`${t}-${a(this,ks)}`;return d(this,ks,a(this,ks)+1),r},wd=function(t){for(const r of a(this,nt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===t)return r;return null},bd=function(){if(!a(this,Wt))throw new Error("ACP session is not ready");return a(this,Wt)},hc=function(){if(!a(this,qt))throw new Error("ACP connection is not ready");return a(this,qt)},Qy=function(){var r;const t=(r=a(this,Gt))==null?void 0:r.sessionCwd;if(!t)throw new Error("ACP bridge session cwd is not ready");return t},dc=function(){var r;if(a(this,Kt)==="single_session")return h(this,T,Sd).call(this,`${Fy}-${(a(this,Ct).clientGUID??"default-client").toLowerCase()}`);const t=(r=a(this,He))==null?void 0:r.channelID;if(!t)throw new Error("Channel context is required for per-channel session mode");return h(this,T,_d).call(this,t)},_d=function(t){return h(this,T,Sd).call(this,zP(a(this,Kt),t,a(this,Ct).clientGUID??"default-client"))},Sd=function(t){var r;return((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="deterministic"&&a(this,As)>0?`${t}:epoch-${a(this,As)}`:t},Aa=new WeakMap,ka=new WeakMap,fc=function(){d(this,qt,null),d(this,sr,null),d(this,Et,null),d(this,Ln,null),d(this,Wt,null),d(this,$t,null),d(this,Gt,null),a(this,Jt)&&(a(this,Jt).removeEventListener("close",a(this,Aa)),a(this,Jt).removeEventListener("error",a(this,ka)),a(this,Jt).close(),d(this,Jt,null))},ls=function(t){const r=a(this,qt)!==null||a(this,sr)!==null||a(this,Et)!==null||a(this,Ln)!==null||a(this,Wt)!==null||a(this,$t)!==null||a(this,Gt)!==null||a(this,Jt)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,T,Br).call(this,"error"),h(this,T,fc).call(this),d(this,jt,t??null),h(this,T,$n).call(this,"disconnected"))},Ad=function(){const t=a(this,nt).size>0;d(this,Yt,null),d(this,zn,null),d(this,ks,1),a(this,nt).clear(),t&&this.dispatchEvent(new xh("messages-changed"))},ew=function(){return this.status==="disconnected"};function LP(){const n=new Map;return{getActualSessionId(e){return n.get(e)??null},setActualSessionId(e,t){n.set(e,t)},clearActualSessionId(e){n.delete(e)}}}function OP(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function zP(n,e,t){return n==="single_session"?`${Fy}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function tw(n){return n.replace(/^(?:\s*\n)+/,"")}function rg(n){let e=n;return e=e.replace(EP,""),e=e.replace($P,""),e=e.replace(CP,""),e=tw(e),e}function NP(n){let e=n;return e=e.replace(RP,""),e=tw(e),e}function ig(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function MP(n){const e=n.createSocket(FP(n.serverURL,n.token));let t=!1,r,i;const s=new Promise((u,f)=>{r=u,i=f}),o=new ReadableStream({start(u){let f=!1;const m=()=>{e.send(JSON.stringify({type:"acp-bridge-connect"}))},g=A=>{const x=ZP(A);if(!x)return;let M;try{M=JSON.parse(x)}catch(Z){const G=Z instanceof Error?Z:new Error(String(Z));i(G),u.error(G);return}switch(M.type){case"acp-bridge-status":if(M.status==="ready"){let Z;try{Z=UP(M)}catch(G){const F=G instanceof Error?G:new Error(String(G));t||i(F),u.error(F);return}t||(t=!0,r(Z));return}if(M.status==="error"||M.status==="exited"){const Z=new Error(M.error??`ACP bridge ${M.status}`);t||i(Z),u.error(Z)}return;case"acp-bridge-message":u.enqueue(M.message);return}},y=()=>{var x;if(f)return;f=!0;const A=new Error("ACP bridge websocket closed");t||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.close()},k=()=>{var x;if(f)return;f=!0;const A=new Error("ACP bridge websocket error");t||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.error(A)};e.addEventListener("open",m),e.addEventListener("message",g),e.addEventListener("close",y),e.addEventListener("error",k)}}),l=new WritableStream({async write(u){await s,e.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){e.close()},abort(){e.close()}}),c=await s;return{stream:{readable:o,writable:l},socket:e,metadata:c}}function UP(n){const{agent:e,sessionIdStrategy:t,sessionCwd:r}=n;if((e==="openclaw"||e==="hermes")&&(t==="deterministic"||t==="mapped")&&typeof r=="string"&&r.length>0)return{agent:e,sessionIdStrategy:t,sessionCwd:r};throw new Error("ACP bridge ready status missing bootstrap metadata")}function ZP(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const e=n.data;if(typeof e=="string")return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(Array.isArray(e))return Buffer.concat(e).toString("utf8")}return null}function FP(n,e){const t=new URL(n);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.pathname="/acp",t.search="",t.searchParams.set("token",e),t.hash="",t.toString()}function Oh(n){return n instanceof Error?n.message:String(n)}const sg="television.acpClientGUID",og="television.acpMappedSessions",ag=1;var $s;class HP{constructor(){v(this,$s,new Map)}getActualSessionId(e){return a(this,$s).get(e)??null}setActualSessionId(e,t){a(this,$s).set(e,t)}clearActualSessionId(e){a(this,$s).delete(e)}}$s=new WeakMap;var Cs,Ea,ot,pc,mc,kd;class VP{constructor(e,t){v(this,ot);v(this,Cs);v(this,Ea);d(this,Cs,e),d(this,Ea,t)}getActualSessionId(e){const t=h(this,ot,mc).call(this)[h(this,ot,pc).call(this,e)];return typeof t=="string"&&t.length>0?t:null}setActualSessionId(e,t){const r=h(this,ot,mc).call(this);r[h(this,ot,pc).call(this,e)]=t,h(this,ot,kd).call(this,r)}clearActualSessionId(e){const t=h(this,ot,mc).call(this);delete t[h(this,ot,pc).call(this,e)],h(this,ot,kd).call(this,t)}}Cs=new WeakMap,Ea=new WeakMap,ot=new WeakSet,pc=function(e){return JSON.stringify([a(this,Ea),e])},mc=function(){const e=a(this,Cs).getItem(og);if(!e)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!="object"||t===null||Array.isArray(t))return{};const r=t;return r.version!==ag?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},kd=function(e){const t={version:ag,entries:e};a(this,Cs).setItem(og,JSON.stringify(t))};function nw(){return typeof window>"u"?null:window.localStorage}function BP(n){const e=n.getItem(sg);if(e)return e;const t=ep().toLowerCase();return n.setItem(sg,t),t}const lg=4401,jP=401,Vl=1e3,qP=3e4;class gc extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class WP extends zr{constructor(t){var o,l;super();$(this,"url");$(this,"name");$(this,"telemetryMeta");$(this,"status","unauthorized");$(this,"channels",new Map);$(this,"client");$(this,"acpClient");$(this,"_token");$(this,"attempting",!1);$(this,"nextRetryAt",null);$(this,"hasEverConnected",!1);$(this,"hasAuthRejected",!1);$(this,"hasAuthTokenRejected",!1);$(this,"bootState","pending");$(this,"serverVersion",null);$(this,"updateState",null);$(this,"decideBoot");$(this,"navigationPending");$(this,"createSocket");$(this,"createClient");$(this,"socket",null);$(this,"connectAttempt",0);$(this,"autoReconnect",!1);$(this,"retryTimer",null);$(this,"retryDelay",Vl);$(this,"visibilityEventTarget");$(this,"networkEventTarget");$(this,"onVisibilityChange");$(this,"onNetworkOnline");$(this,"telemetryActivityAgent");this.url=Rr(t.url),this.name=t.name,this.decideBoot=t.decideBoot??null,this.navigationPending=t.navigationPending??(()=>!1),this._token=t.token??null,this.telemetryMeta=t.telemetryMeta??null,this.createSocket=t.createSocket??(c=>new WebSocket(c)),this.createClient=t.createClient??((c,u,f)=>new yE(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...f?{telemetryMeta:f}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=t.mappedSessionStore??(t.acpStorage?new VP(t.acpStorage,this.url):new HP);this.acpClient=new DP({serverURL:this.url,token:this._token??"",...t.createACPSocket?{createSocket:t.createACPSocket}:t.createSocket?{createSocket:t.createSocket}:{},...t.clientGUID?{clientGUID:t.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=t.visibilityEventTarget!==void 0?t.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=t.networkEventTarget!==void 0?t.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(o=this.visibilityEventTarget)==null||o.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=t.telemetryDocumentTarget!==void 0?t.telemetryDocumentTarget:typeof document<"u"?document:null,s=t.telemetryWindowTarget!==void 0?t.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&s?n3({meta:this.telemetryMeta,documentTarget:i,windowTarget:s,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(t){this._token=t,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(t),this.cancelRetryTimer(),this.retryDelay=Vl,this.autoReconnect=!0,await this.attempt()}dispose(){var t,r,i,s;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(t=this.socket)==null||t.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(s=this.telemetryActivityAgent)==null||s.stop(),this.acpClient.dispose()}getViewURL(t){const r=md(t,{electron:jn()});return jn()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(t){const r=md(t,{electron:jn()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(t){const{channel:r}=await this.client.channels.create({name:t});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(t){switch(t.type){case"channel-created":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Oo("channels-changed"));break;case"channel-updated":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Oo("channels-changed"));break;case"channel-removed":this.channels.delete(t.channelID),this.dispatchEvent(new Oo("channels-changed"));break;case"artifact-created":{const r=this.channels.get(t.channelID);r&&!rE(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...rv},size:{...iv}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=rd(r.layout,t.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"artifact-focus":break;default:return GP(t,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const t=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new gt("change"));const r=this.createSocket(YP(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,o)=>{let l=!1;const c=()=>{var m;l||this.connectAttempt!==t||(l=!0,this.retryDelay=Vl,this.hasEverConnected=!0,this.setStatus("connected"),(m=this.telemetryActivityAgent)==null||m.start(),s())},u=m=>{l||this.connectAttempt!==t||(l=!0,o(m))},f=async()=>{const m=this.hasEverConnected;try{const[{channels:g},y]=await Promise.all([this.client.channels.list(),this.client.display.get()]);this.channels=new Map(g.map(k=>[k.id,structuredClone(k)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new gt("change")),m&&this.dispatchEvent(new Oo("channels-changed")),this.dispatchEvent(new lc("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:y.focusedChannelId}})),this.dispatchEvent(new lc("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...y.pinnedChannelIds]}})),c(),m&&this.connectAttempt===t&&this.dispatchEvent(new gv("server-reconnected",{serverURL:this.url}))}catch(g){if(t5(g)){u(new gc);return}u(g instanceof Error?g:new Error(String(g)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",m=>{const g=e5(m);if(!g)return;if(g.type==="server-status"){const k=g;this.serverVersion=k.version,this.updateState=k.update??null;let A=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===t&&(this.decideBoot(k)==="boot"?(this.bootState="booted",A=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new vv("server-status",{serverURL:this.url,message:k})),A?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new gt("change"));return}if(!QP(g.type))return;const y=g;this.applyServerEvent(y),this.dispatchEvent(new lc("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",m=>{if(this.connectAttempt!==t)return;this.socket=null;const g=KP(m);if(!l){u(g===lg?new gc:new Error("Connection closed before initialization"));return}if(g===lg){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===t){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},s=>{throw this.attempting=!1,this.handleAttemptFailure(s),s})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(t){if(t instanceof gc){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(t){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const t=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,qP),this.nextRetryAt=Date.now()+t,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},t),this.dispatchEvent(new gt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new gt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Vl,this.attempt().catch(()=>{})))}sendTelemetryActivity(t){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(t)))}sendTelemetrySignal(t,r){var s;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:nE,clientId:this.telemetryMeta.clientId,event:t,properties:r};(s=this.socket)==null||s.send(JSON.stringify(i))}setStatus(t){this.status!==t&&(this.status=t,this.dispatchEvent(new gt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function GP(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function YP(n,e,t=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",e&&r.searchParams.set("token",e),t)for(const[i,s]of t3(t))r.searchParams.set(i,s);return r.hash="",r.toString()}function KP(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const JP={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"artifact-focus":!0},XP=new Set(Object.keys(JP));function QP(n){return XP.has(n)}function e5(n){const e=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||!("type"in t)||typeof t.type!="string"?null:t}function t5(n){return n instanceof fo&&n.status===jP}const n5="Local";var ct,Tt,mn,Ed,$d,rw,$a,Ca,Ta,Ra,Ia;class r5 extends zr{constructor(t){super();v(this,mn);$(this,"connection");$(this,"clientGUID");$(this,"acpStorage");$(this,"connectError",null);v(this,ct);v(this,Tt,!1);v(this,$a,()=>{a(this,Tt)||(h(this,mn,rw).call(this),this.dispatchEvent(new gt("change")))});v(this,Ca,t=>{a(this,Tt)||this.dispatchEvent(new lc("server-event",{serverURL:t.serverURL,event:t.event}))});v(this,Ta,()=>{a(this,Tt)||this.dispatchEvent(new Oo("channels-changed"))});v(this,Ra,t=>{a(this,Tt)||this.dispatchEvent(new gv("server-reconnected",{serverURL:t.serverURL}))});v(this,Ia,t=>{a(this,Tt)||this.dispatchEvent(new vv("server-status",{serverURL:t.serverURL,message:t.message}))});d(this,ct,t.localStore),this.acpStorage=t.acpStorage===void 0?nw():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?BP(this.acpStorage):ep().toLowerCase());const r=Rr(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&a(this,ct).set(Im(a(this,ct).get(),r,t.launchToken));const i=t.launchToken??Rm(a(this,ct).get(),r),s=t.createSocket??(l=>new WebSocket(l)),o=t.createConnection??(l=>new WP(l));this.connection=o({url:r,name:t.connectionName??n5,token:i,createSocket:s,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:t.telemetryMeta??null,decideBoot:t.decideBoot,navigationPending:t.navigationPending}),this.connection.addEventListener("change",a(this,$a)),this.connection.addEventListener("server-event",a(this,Ca)),this.connection.addEventListener("channels-changed",a(this,Ta)),this.connection.addEventListener("server-reconnected",a(this,Ra)),this.connection.addEventListener("server-status",a(this,Ia))}get storedAuthToken(){return Rm(a(this,ct).get(),this.connection.url)}async connect(){await h(this,mn,Ed).call(this,this.connection.token)}async authenticate(t){a(this,ct).set(Im(a(this,ct).get(),this.connection.url,t)),await h(this,mn,Ed).call(this,t)}dispose(){a(this,Tt)||(d(this,Tt,!0),this.connection.removeEventListener("change",a(this,$a)),this.connection.removeEventListener("server-event",a(this,Ca)),this.connection.removeEventListener("channels-changed",a(this,Ta)),this.connection.removeEventListener("server-reconnected",a(this,Ra)),this.connection.removeEventListener("server-status",a(this,Ia)),this.connection.dispose())}}ct=new WeakMap,Tt=new WeakMap,mn=new WeakSet,Ed=async function(t){if(!a(this,Tt)){h(this,mn,$d).call(this,null);try{await this.connection.connect(t)}catch(r){h(this,mn,$d).call(this,r instanceof gc?null:r instanceof Error?r.message:String(r))}}},$d=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new gt("change")))},rw=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=a(this,ct).get(),r=YE(t,this.connection.url);r!==t&&a(this,ct).set(r),this.connection.token!==null&&this.connection.clearToken()},$a=new WeakMap,Ca=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Ia=new WeakMap;const Cd="tv-nav:",no="tv-reload",cg=100,i5=1e3,s5=60,o5=60,a5=24,l5=30,c5=l5*a5*o5*s5*i5;function qn(n){try{const e=new URL(n,window.location.href),t=e.searchParams.has(no);return e.searchParams.delete(no),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:t?e.toString():n}catch{return n}}var xa,Ts,he,ce,ai,ke,iw,er,sw,Td,Rd;class u5 extends zr{constructor(t,r){super();v(this,ke);v(this,xa);v(this,Ts);v(this,he,[]);v(this,ce,-1);v(this,ai,0);d(this,xa,t),d(this,Ts,qn(r)),h(this,ke,iw).call(this)}get currentURL(){var t;return a(this,ce)===-1?null:((t=a(this,he)[a(this,ce)])==null?void 0:t.url)??null}get canGoBack(){return a(this,ce)>-1}get canGoForward(){return a(this,ce)<a(this,he).length-1}get entries(){return a(this,he).map(t=>({...t}))}get cursor(){return a(this,ce)}navigate(t){const r=qn(t);if(r===a(this,Ts)){if(a(this,ce)===-1)return;d(this,ce,-1),h(this,ke,er).call(this);return}a(this,ce)<a(this,he).length-1&&d(this,he,a(this,he).slice(0,a(this,ce)+1)),a(this,he).push({url:r}),d(this,ce,a(this,he).length-1),h(this,ke,Td).call(this),h(this,ke,er).call(this)}replace(t){var i;if(a(this,ce)===-1){this.navigate(t);return}const r=qn(t);if(r===a(this,Ts)){d(this,he,a(this,he).filter((s,o)=>o!==a(this,ce))),d(this,ce,-1),h(this,ke,er).call(this);return}((i=a(this,he)[a(this,ce)])==null?void 0:i.url)!==r&&(d(this,he,a(this,he).map((s,o)=>o===a(this,ce)?{url:r}:s)),h(this,ke,er).call(this))}back(){a(this,ce)!==-1&&(d(this,ce,a(this,ce)-1),h(this,ke,er).call(this))}forward(){this.canGoForward&&(d(this,ce,a(this,ce)+1),h(this,ke,er).call(this))}reset(){a(this,ce)===-1&&a(this,he).length===0||(d(this,he,[]),d(this,ce,-1),h(this,ke,er).call(this))}}xa=new WeakMap,Ts=new WeakMap,he=new WeakMap,ce=new WeakMap,ai=new WeakMap,ke=new WeakSet,iw=function(){const t=localStorage.getItem(a(this,ke,Rd));if(t!==null)try{const r=JSON.parse(t);if(!ow(r))return;d(this,he,r.entries.map(i=>({url:i.url}))),d(this,ce,r.cursor),d(this,ai,r.lastWritten),h(this,ke,Td).call(this)}catch{d(this,he,[]),d(this,ce,-1),d(this,ai,0)}},er=function(){d(this,ai,Date.now());try{localStorage.setItem(a(this,ke,Rd),JSON.stringify(h(this,ke,sw).call(this)))}catch(t){if(!f5(t))throw t}this.dispatchEvent(new gt("change"))},sw=function(){return{v:1,entries:a(this,he).map(t=>({...t})),cursor:a(this,ce),lastWritten:a(this,ai)}},Td=function(){if(a(this,he).length<=cg)return;const t=a(this,he).length-cg;d(this,he,a(this,he).slice(t)),d(this,ce,Math.max(-1,a(this,ce)-t))},Rd=function(){return h5(a(this,xa))};function h5(n){return`${Cd}${n}`}function d5(n){const e=Date.now()-c5,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(Cd)))continue;const s=i.slice(Cd.length),o=localStorage.getItem(i);if(o===null)continue;let l;try{l=JSON.parse(o)}catch{t.push(i);continue}if(!ow(l)){t.push(i);continue}!n.has(s)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function f5(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function ow(n){if(typeof n!="object"||n===null)return!1;const e=n;if(e.v!==1||!Array.isArray(e.entries))return!1;const t=e.cursor;return typeof t!="number"||!Number.isInteger(t)||typeof e.lastWritten!="number"||!Number.isFinite(e.lastWritten)||t<-1||t>=e.entries.length?!1:e.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const p5="0.1.208";function up(n=p5){return n!==void 0&&n.length>0?n:"0.0.0"}function hp(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const Id="tv-reload-attempted";function m5(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:_E(n.bundleVersion,n.serverVersion)?n.marker!==null&&n.marker.serverVersion===n.serverVersion?{action:"none"}:{action:"reload",marker:{serverVersion:n.serverVersion,fromVersion:n.bundleVersion}}:{action:"none"}:{action:"none"}}function g5(n){const e=n.getItem(Id);if(e===null)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const r=t;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function v5(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??hp(),i=n.bundleVersion??up();if(e===null)return{dispose(){}};let s=null;const o=()=>{if(s===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const f=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=u=>{if(r.pending)return;const f=m5({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:g5(e)});switch(f.action){case"reload":e.setItem(Id,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(Id),s={fromVersion:f.fromVersion,toVersion:f.toVersion},o();return;case"none":return}},c=()=>{o()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function y5(n){const e=jn(n.search),t=iy(n.search),r=t!==null&&Qf(t)?t:null;return{electron:e,shellVersion:r}}function w5(n){return!n.electron||n.requiredDesktopVersion===null||!Qf(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===id?!1:av(n.requiredDesktopVersion,n.shellVersion)}const b5=`# Desktop app upgrade required
|
|
42
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const m=f[1];if(e===f[0]){s(f);continue}if(n.external){const y=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&y){s(f);continue}}if((u=n.metadataRegistry.get(f[0]))==null?void 0:u.id){s(f);continue}if(m.cycle){s(f);continue}if(m.count>1&&n.reused==="ref"){s(f);continue}}}function Yv(n,e){var o,l,c;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const f=n.seen.get(u);if(f.ref===null)return;const m=f.def??f.schema,v={...m},y=f.ref;if(f.ref=null,y){r(y);const S=n.seen.get(y),x=S.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,v),u._zod.parent===y)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in v||delete m[Z];if(x.$ref&&S.def)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in S.def&&JSON.stringify(m[Z])===JSON.stringify(S.def[Z])&&delete m[Z]}const k=u._zod.parent;if(k&&k!==y){r(k);const S=n.seen.get(k);if(S!=null&&S.schema.$ref&&(m.$ref=S.schema.$ref,S.def))for(const x in m)x==="$ref"||x==="allOf"||x in S.def&&JSON.stringify(m[x])===JSON.stringify(S.def[x])&&delete m[x]}n.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(o=n.external)!=null&&o.uri){const u=(l=n.external.registry.get(e))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,t.def??t.schema);const s=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const f=u[1];f.def&&f.defId&&(s[f.defId]=f.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:Vc(e,"input",n.processors),output:Vc(e,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Fe(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Fe(r.element,t);if(r.type==="set")return Fe(r.valueType,t);if(r.type==="lazy")return Fe(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Fe(r.innerType,t);if(r.type==="intersection")return Fe(r.left,t)||Fe(r.right,t);if(r.type==="record"||r.type==="map")return Fe(r.keyType,t)||Fe(r.valueType,t);if(r.type==="pipe")return Fe(r.in,t)||Fe(r.out,t);if(r.type==="object"){for(const i in r.shape)if(Fe(r.shape[i],t))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Fe(i,t))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Fe(i,t))return!0;return!!(r.rest&&Fe(r.rest,t))}return!1}const eT=(n,e={})=>t=>{const r=Wv({...t,processors:e});return Ee(n,r),Gv(r,n),Yv(r,n)},Vc=(n,e,t={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=Wv({...i??{},target:s,io:e,processors:t});return Ee(n,o),Gv(o,n),Yv(o,n)},tT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nT=(n,e,t,r)=>{const i=t;i.type="string";const{minimum:s,maximum:o,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),l&&(i.format=tT[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},rT=(n,e,t,r)=>{const i=t,{minimum:s,maximum:o,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof f=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f),typeof s=="number"&&(i.minimum=s,typeof f=="number"&&e.target!=="draft-04"&&(f>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof o=="number"&&(i.maximum=o,typeof u=="number"&&e.target!=="draft-04"&&(u<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},iT=(n,e,t,r)=>{t.type="boolean"},sT=(n,e,t,r)=>{t.not={}},oT=(n,e,t,r)=>{},aT=(n,e,t,r)=>{const i=n._zod.def,s=$v(i.entries);s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),t.enum=s},lT=(n,e,t,r)=>{const i=n._zod.def,s=[];for(const o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];t.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[o]:t.const=o}else s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),s.every(o=>typeof o=="boolean")&&(t.type="boolean"),s.every(o=>o===null)&&(t.type="null"),t.enum=s},cT=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uT=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hT=(n,e,t,r)=>{const i=t,s=n._zod.def,{minimum:o,maximum:l}=n._zod.bag;typeof o=="number"&&(i.minItems=o),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Ee(s.element,e,{...r,path:[...r.path,"items"]})},dT=(n,e,t,r)=>{var u;const i=t,s=n._zod.def;i.type="object",i.properties={};const o=s.shape;for(const f in o)i.properties[f]=Ee(o[f],e,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(o)),c=new Set([...l].filter(f=>{const m=s.shape[f]._zod;return e.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Ee(s.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},fT=(n,e,t,r)=>{const i=n._zod.def,s=i.inclusive===!1,o=i.options.map((l,c)=>Ee(l,e,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?t.oneOf=o:t.anyOf=o},pT=(n,e,t,r)=>{const i=n._zod.def,s=Ee(i.left,e,{...r,path:[...r.path,"allOf",0]}),o=Ee(i.right,e,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];t.allOf=c},mT=(n,e,t,r)=>{const i=t,s=n._zod.def;i.type="object";const o=s.keyType,l=o._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const f=Ee(s.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of c)i.patternProperties[m.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ee(s.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Ee(s.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const f=[...u].filter(m=>typeof m=="string"||typeof m=="number");f.length>0&&(i.required=f)}},gT=(n,e,t,r)=>{const i=n._zod.def,s=Ee(i.innerType,e,r),o=e.seen.get(n);e.target==="openapi-3.0"?(o.ref=i.innerType,t.nullable=!0):t.anyOf=[s,{type:"null"}]},vT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType},yT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},wT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},bT=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=o},_T=(n,e,t,r)=>{const i=n._zod.def,s=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ee(s,e,r);const o=e.seen.get(n);o.ref=s},ST=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType,t.readOnly=!0},Kv=(n,e,t,r)=>{const i=n._zod.def;Ee(i.innerType,e,r);const s=e.seen.get(n);s.ref=i.innerType},AT=E("ZodISODateTime",(n,e)=>{k$.init(n,e),ye.init(n,e)});function kT(n){return IC(AT,n)}const ET=E("ZodISODate",(n,e)=>{E$.init(n,e),ye.init(n,e)});function $T(n){return xC(ET,n)}const CT=E("ZodISOTime",(n,e)=>{$$.init(n,e),ye.init(n,e)});function TT(n){return PC(CT,n)}const RT=E("ZodISODuration",(n,e)=>{C$.init(n,e),ye.init(n,e)});function IT(n){return DC(RT,n)}const Jv=(n,e)=>{Iv.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>v4(n,t)},flatten:{value:t=>g4(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,gd,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,gd,2)}},isEmpty:{get(){return n.issues.length===0}}})},Qm=E("ZodError",Jv),St=E("ZodError",Jv,{Parent:Error}),xT=lp(St),PT=cp(St),DT=Tu(St),LT=Ru(St),OT=b4(St),zT=_4(St),NT=S4(St),MT=A4(St),UT=k4(St),ZT=E4(St),FT=$4(St),HT=C4(St),ve=E("ZodType",(n,e)=>(ge.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Vc(n,"input"),output:Vc(n,"output")}}),n.toJSONSchema=eT(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...t)=>n.clone(Nr(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(t,r)=>Mr(n,t,r),n.brand=()=>n,n.register=(t,r)=>(t.add(n,r),n),n.parse=(t,r)=>xT(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>DT(n,t,r),n.parseAsync=async(t,r)=>PT(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>LT(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>OT(n,t,r),n.decode=(t,r)=>zT(n,t,r),n.encodeAsync=async(t,r)=>NT(n,t,r),n.decodeAsync=async(t,r)=>MT(n,t,r),n.safeEncode=(t,r)=>UT(n,t,r),n.safeDecode=(t,r)=>ZT(n,t,r),n.safeEncodeAsync=async(t,r)=>FT(n,t,r),n.safeDecodeAsync=async(t,r)=>HT(n,t,r),n.refine=(t,r)=>n.check(LR(t,r)),n.superRefine=t=>n.check(OR(t)),n.overwrite=t=>n.check(mo(t)),n.optional=()=>ng(n),n.exactOptional=()=>_R(n),n.nullable=()=>rg(n),n.nullish=()=>ng(rg(n)),n.nonoptional=t=>CR(n,t),n.array=()=>z(n),n.or=t=>j([n,t]),n.and=t=>xu(n,t),n.transform=t=>ig(n,wR(t)),n.default=t=>kR(n,t),n.prefault=t=>$R(n,t),n.catch=t=>RR(n,t),n.pipe=t=>ig(n,t),n.readonly=()=>PR(n),n.describe=t=>{const r=n.clone();return No.add(r,{description:t}),r},Object.defineProperty(n,"description",{get(){var t;return(t=No.get(n))==null?void 0:t.description},configurable:!0}),n.meta=(...t)=>{if(t.length===0)return No.get(n);const r=n.clone();return No.add(r,t[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=t=>t(n),n)),Xv=E("_ZodString",(n,e)=>{up.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>nT(n,r,i);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,n.regex=(...r)=>n.check(UC(...r)),n.includes=(...r)=>n.check(HC(...r)),n.startsWith=(...r)=>n.check(VC(...r)),n.endsWith=(...r)=>n.check(BC(...r)),n.min=(...r)=>n.check(Hc(...r)),n.max=(...r)=>n.check(qv(...r)),n.length=(...r)=>n.check(jv(...r)),n.nonempty=(...r)=>n.check(Hc(1,...r)),n.lowercase=r=>n.check(ZC(r)),n.uppercase=r=>n.check(FC(r)),n.trim=()=>n.check(jC()),n.normalize=(...r)=>n.check(qC(...r)),n.toLowerCase=()=>n.check(WC()),n.toUpperCase=()=>n.check(GC()),n.slugify=()=>n.check(YC())}),VT=E("ZodString",(n,e)=>{up.init(n,e),Xv.init(n,e),n.email=t=>n.check(cC(BT,t)),n.url=t=>n.check(pC(qT,t)),n.jwt=t=>n.check(RC(oR,t)),n.emoji=t=>n.check(mC(jT,t)),n.guid=t=>n.check(Ym(eg,t)),n.uuid=t=>n.check(uC(Bl,t)),n.uuidv4=t=>n.check(hC(Bl,t)),n.uuidv6=t=>n.check(dC(Bl,t)),n.uuidv7=t=>n.check(fC(Bl,t)),n.nanoid=t=>n.check(gC(WT,t)),n.guid=t=>n.check(Ym(eg,t)),n.cuid=t=>n.check(vC(GT,t)),n.cuid2=t=>n.check(yC(YT,t)),n.ulid=t=>n.check(wC(KT,t)),n.base64=t=>n.check($C(rR,t)),n.base64url=t=>n.check(CC(iR,t)),n.xid=t=>n.check(bC(JT,t)),n.ksuid=t=>n.check(_C(XT,t)),n.ipv4=t=>n.check(SC(QT,t)),n.ipv6=t=>n.check(AC(eR,t)),n.cidrv4=t=>n.check(kC(tR,t)),n.cidrv6=t=>n.check(EC(nR,t)),n.e164=t=>n.check(TC(sR,t)),n.datetime=t=>n.check(kT(t)),n.date=t=>n.check($T(t)),n.time=t=>n.check(TT(t)),n.duration=t=>n.check(IT(t))});function p(n){return lC(VT,n)}const ye=E("ZodStringFormat",(n,e)=>{pe.init(n,e),Xv.init(n,e)}),BT=E("ZodEmail",(n,e)=>{m$.init(n,e),ye.init(n,e)}),eg=E("ZodGUID",(n,e)=>{f$.init(n,e),ye.init(n,e)}),Bl=E("ZodUUID",(n,e)=>{p$.init(n,e),ye.init(n,e)}),qT=E("ZodURL",(n,e)=>{g$.init(n,e),ye.init(n,e)}),jT=E("ZodEmoji",(n,e)=>{v$.init(n,e),ye.init(n,e)}),WT=E("ZodNanoID",(n,e)=>{y$.init(n,e),ye.init(n,e)}),GT=E("ZodCUID",(n,e)=>{w$.init(n,e),ye.init(n,e)}),YT=E("ZodCUID2",(n,e)=>{b$.init(n,e),ye.init(n,e)}),KT=E("ZodULID",(n,e)=>{_$.init(n,e),ye.init(n,e)}),JT=E("ZodXID",(n,e)=>{S$.init(n,e),ye.init(n,e)}),XT=E("ZodKSUID",(n,e)=>{A$.init(n,e),ye.init(n,e)}),QT=E("ZodIPv4",(n,e)=>{T$.init(n,e),ye.init(n,e)}),eR=E("ZodIPv6",(n,e)=>{R$.init(n,e),ye.init(n,e)}),tR=E("ZodCIDRv4",(n,e)=>{I$.init(n,e),ye.init(n,e)}),nR=E("ZodCIDRv6",(n,e)=>{x$.init(n,e),ye.init(n,e)}),rR=E("ZodBase64",(n,e)=>{P$.init(n,e),ye.init(n,e)}),iR=E("ZodBase64URL",(n,e)=>{L$.init(n,e),ye.init(n,e)}),sR=E("ZodE164",(n,e)=>{O$.init(n,e),ye.init(n,e)}),oR=E("ZodJWT",(n,e)=>{N$.init(n,e),ye.init(n,e)}),Qv=E("ZodNumber",(n,e)=>{Zv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>rT(n,r,i),n.gt=(r,i)=>n.check(Jm(r,i)),n.gte=(r,i)=>n.check(Nh(r,i)),n.min=(r,i)=>n.check(Nh(r,i)),n.lt=(r,i)=>n.check(Km(r,i)),n.lte=(r,i)=>n.check(zh(r,i)),n.max=(r,i)=>n.check(zh(r,i)),n.int=r=>n.check(tg(r)),n.safe=r=>n.check(tg(r)),n.positive=r=>n.check(Jm(0,r)),n.nonnegative=r=>n.check(Nh(0,r)),n.negative=r=>n.check(Km(0,r)),n.nonpositive=r=>n.check(zh(0,r)),n.multipleOf=(r,i)=>n.check(Xm(r,i)),n.step=(r,i)=>n.check(Xm(r,i)),n.finite=()=>n;const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function H(n){return LC(Qv,n)}const aR=E("ZodNumberFormat",(n,e)=>{M$.init(n,e),Qv.init(n,e)});function tg(n){return OC(aR,n)}const lR=E("ZodBoolean",(n,e)=>{U$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>iT(n,t,r)});function Ie(n){return zC(lR,n)}const cR=E("ZodUnknown",(n,e)=>{Z$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>oT()});function _(){return NC(cR)}const uR=E("ZodNever",(n,e)=>{F$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>sT(n,t,r)});function hR(n){return MC(uR,n)}const dR=E("ZodArray",(n,e)=>{H$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>hT(n,t,r,i),n.element=e.element,n.min=(t,r)=>n.check(Hc(t,r)),n.nonempty=t=>n.check(Hc(1,t)),n.max=(t,r)=>n.check(qv(t,r)),n.length=(t,r)=>n.check(jv(t,r)),n.unwrap=()=>n.element});function z(n,e){return KC(dR,n,e)}const ey=E("ZodObject",(n,e)=>{B$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>dT(n,t,r,i),se(n,"shape",()=>e.shape),n.keyof=()=>ry(Object.keys(n._zod.def.shape)),n.catchall=t=>n.clone({...n._zod.def,catchall:t}),n.passthrough=()=>n.clone({...n._zod.def,catchall:_()}),n.loose=()=>n.clone({...n._zod.def,catchall:_()}),n.strict=()=>n.clone({...n._zod.def,catchall:hR()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>h4(n,t),n.safeExtend=t=>d4(n,t),n.merge=t=>f4(n,t),n.pick=t=>c4(n,t),n.omit=t=>u4(n,t),n.partial=(...t)=>p4(iy,n,t[0]),n.required=(...t)=>m4(sy,n,t[0])});function ty(n,e){const t={type:"object",shape:n??{},...N(e)};return new ey(t)}function w(n,e){return new ey({type:"object",shape:n,catchall:_(),...N(e)})}const ny=E("ZodUnion",(n,e)=>{Vv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>fT(n,t,r,i),n.options=e.options});function j(n,e){return new ny({type:"union",options:n,...N(e)})}const fR=E("ZodDiscriminatedUnion",(n,e)=>{ny.init(n,e),q$.init(n,e)});function pR(n,e,t){return new fR({type:"union",options:e,discriminator:n,...N(t)})}const mR=E("ZodIntersection",(n,e)=>{j$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>pT(n,t,r,i)});function xu(n,e){return new mR({type:"intersection",left:n,right:e})}const gR=E("ZodRecord",(n,e)=>{W$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mT(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function A(n,e,t){return new gR({type:"record",keyType:n,valueType:e,...N(t)})}const yd=E("ZodEnum",(n,e)=>{G$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(r,i,s)=>aT(n,r,i),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(r,i)=>{const s={};for(const o of r)if(t.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new yd({...e,checks:[],...N(i),entries:s})},n.exclude=(r,i)=>{const s={...e.entries};for(const o of r)if(t.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new yd({...e,checks:[],...N(i),entries:s})}});function ry(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new yd({type:"enum",entries:t,...N(e)})}const vR=E("ZodLiteral",(n,e)=>{Y$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>lT(n,t,r),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(n,e){return new vR({type:"literal",values:Array.isArray(n)?n:[n],...N(e)})}const yR=E("ZodTransform",(n,e)=>{K$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>uT(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new kv(n.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(ca(s,t.value,e));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),t.issues.push(ca(o))}};const i=e.transform(t.value,t);return i instanceof Promise?i.then(s=>(t.value=s,t)):(t.value=i,t)}});function wR(n){return new yR({type:"transform",transform:n})}const iy=E("ZodOptional",(n,e)=>{Bv.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Kv(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function ng(n){return new iy({type:"optional",innerType:n})}const bR=E("ZodExactOptional",(n,e)=>{J$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Kv(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function _R(n){return new bR({type:"optional",innerType:n})}const SR=E("ZodNullable",(n,e)=>{X$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>gT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function rg(n){return new SR({type:"nullable",innerType:n})}const AR=E("ZodDefault",(n,e)=>{Q$.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>yT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function kR(n,e){return new AR({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():Tv(e)}})}const ER=E("ZodPrefault",(n,e)=>{eC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>wT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function $R(n,e){return new ER({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():Tv(e)}})}const sy=E("ZodNonOptional",(n,e)=>{tC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>vT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function CR(n,e){return new sy({type:"nonoptional",innerType:n,...N(e)})}const TR=E("ZodCatch",(n,e)=>{nC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>bT(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function RR(n,e){return new TR({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const IR=E("ZodPipe",(n,e)=>{rC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>_T(n,t,r,i),n.in=e.in,n.out=e.out});function ig(n,e){return new IR({type:"pipe",in:n,out:e})}const xR=E("ZodReadonly",(n,e)=>{iC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>ST(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function PR(n){return new xR({type:"readonly",innerType:n})}const DR=E("ZodCustom",(n,e)=>{sC.init(n,e),ve.init(n,e),n._zod.processJSONSchema=(t,r,i)=>cT(n,t)});function LR(n,e={}){return JC(DR,n,e)}function OR(n){return XC(n)}const zR=[".md",".markdown"];function oy(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function ay(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function NR(n){return ay(n).toLowerCase()}function MR(n,e){const t=NR(n);return e.some(r=>t.endsWith(r))}function ly(n){return!oy(n)&&MR(n,zR)}function UR(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Rn(n){try{const{pathname:e}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e)}catch{return!1}}const ZR=ty({id:p().min(1),kind:C("path"),title:p(),path:p()}).strict(),FR=ty({id:p().min(1),kind:C("url"),title:p(),url:p().refine(UR,{message:"url must be an http(s) URL"})}).strict();pR("kind",[ZR,FR]);const HR="/views/markdown/",VR="/views/url-unsupported/";function cy(n){return`/artifact/${encodeURIComponent(n)}`}function BR(n,e){return`${cy(n)}/${encodeURIComponent(e)}`}function qR(n){return`/markdown/${encodeURIComponent(n)}`}function wd(n,e={electron:!1}){if(n.kind==="url")return e.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Rn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:VR,contentURL:null};if(ly(n.path)){const r={viewURL:HR,contentURL:qR(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=oy(n.path)?`${cy(n.id)}/`:BR(n.id,ay(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const jR="serverURL",WR="token",GR="mode",YR="desktopAppVersion",KR="electron";function JR(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(jR);return r?new URL(r).origin:new URL(e).origin}function XR(n=window.location.search){return new URLSearchParams(n).get(WR)}function jn(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(GR)===KR}function uy(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(YR)}const sg="tv.telemetry.clientId",QR=5,e3=60,t3=1e3,n3=QR*e3*t3,og=["pointerdown","scroll","keydown"],ag=["focus"],lg=["visibilitychange"],r3="hidden";function i3(n,e=c3){const t=n.getItem(sg);if(t)return t;const r=e();return n.setItem(sg,r),r}function s3(n){return{clientId:i3(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function o3(n){const e=new URLSearchParams;return e.set("clientId",n.clientId),e.set("userAgent",n.userAgent),e.set("clientApp",n.clientApp),n.desktopAppVersion&&e.set("desktopAppVersion",n.desktopAppVersion),e}function a3(n){return new l3(n)}var va,Ln,rr,ya,wa,lt,si,ba,eu,hy;class l3{constructor(e){g(this,eu);g(this,va);g(this,Ln);g(this,rr);g(this,ya);g(this,wa);g(this,lt);g(this,si,!1);g(this,ba,Number.NEGATIVE_INFINITY);d(this,va,e.meta),d(this,Ln,e.documentTarget),d(this,rr,e.windowTarget),d(this,ya,e.send),d(this,wa,e.nowMs??Date.now),d(this,lt,()=>h(this,eu,hy).call(this))}start(){if(!a(this,si)){d(this,si,!0);for(const e of og)a(this,rr).addEventListener(e,a(this,lt)),a(this,Ln).addEventListener(e,a(this,lt));for(const e of ag)a(this,rr).addEventListener(e,a(this,lt));for(const e of lg)a(this,Ln).addEventListener(e,a(this,lt))}}stop(){if(a(this,si)){d(this,si,!1);for(const e of og)a(this,rr).removeEventListener(e,a(this,lt)),a(this,Ln).removeEventListener(e,a(this,lt));for(const e of ag)a(this,rr).removeEventListener(e,a(this,lt));for(const e of lg)a(this,Ln).removeEventListener(e,a(this,lt))}}}va=new WeakMap,Ln=new WeakMap,rr=new WeakMap,ya=new WeakMap,wa=new WeakMap,lt=new WeakMap,si=new WeakMap,ba=new WeakMap,eu=new WeakSet,hy=function(){if(a(this,Ln).visibilityState===r3)return;const e=a(this,wa).call(this);e-a(this,ba)<n3||(d(this,ba,e),a(this,ya).call(this,{type:oE,clientId:a(this,va).clientId}))};function c3(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ip().toLowerCase()}const fe={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},En={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},u3=1,h3=w({_meta:A(p(),_()).nullish(),terminal:Ie().optional().default(!1)}),d3=w({_meta:A(p(),_()).nullish(),label:p().nullish(),name:p(),optional:Ie().optional().default(!1),secret:Ie().optional().default(!0)}),f3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:p(),name:p()}),p3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:z(d3)}),m3=w({_meta:A(p(),_()).nullish(),args:z(p()).optional(),description:p().nullish(),env:A(p(),p()).optional(),id:p(),name:p()}),g3=j([p3.and(w({type:C("env_var")})),m3.and(w({type:C("terminal")})),f3]),v3=w({_meta:A(p(),_()).nullish(),methodId:p()}),y3=w({_meta:A(p(),_()).nullish()}),w3=w({_meta:A(p(),_()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),b3=w({default:Ie().nullish(),description:p().nullish(),title:p().nullish()}),_3=w({_meta:A(p(),_()).nullish()}),S3=w({_meta:A(p(),_()).nullish()}),A3=w({amount:H(),currency:p()}),k3=w({_meta:A(p(),_()).nullish(),terminalId:p()}),E3=w({_meta:A(p(),_()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),$3=j([p(),H(),H(),Ie(),z(p())]),C3=w({content:A(p(),$3).nullish()}),T3=j([C3.and(w({action:C("accept")})),w({action:C("decline")}),w({action:C("cancel")})]),R3=w({_meta:A(p(),_()).nullish()}),dy=p(),I3=w({_meta:A(p(),_()).nullish(),elicitationId:dy}),x3=w({_meta:A(p(),_()).nullish(),action:T3}),P3=C("object"),D3=C("string"),L3=w({_meta:A(p(),_()).nullish()}),O3=w({_meta:A(p(),_()).nullish(),form:R3.nullish(),url:L3.nullish()}),z3=w({elicitationId:dy,url:p().url()}),fy=w({const:p(),title:p()}),py=w({_meta:A(p(),_()).nullish(),name:p(),value:p()}),N3=j([C(-32700),C(-32600),C(-32601),C(-32602),C(-32603),C(-32800),C(-32e3),C(-32002),C(-32042),H().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),my=w({code:N3,data:_().optional(),message:p()}),gy=_(),vy=_(),yy=_(),M3=w({_meta:A(p(),_()).nullish(),readTextFile:Ie().optional().default(!1),writeTextFile:Ie().optional().default(!1)}),wy=w({_meta:A(p(),_()).nullish(),name:p(),value:p()}),by=w({_meta:A(p(),_()).nullish(),name:p(),title:p().nullish(),version:p()}),U3=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),Z3=w({_meta:A(p(),_()).nullish()}),F3=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),H3=w({_meta:A(p(),_()).nullish()}),V3=w({_meta:A(p(),_()).nullish(),logout:H3.nullish()}),B3=w({_meta:A(p(),_()).nullish()}),q3=w({_meta:A(p(),_()).nullish()}),j3=w({_meta:A(p(),_()).nullish(),http:Ie().optional().default(!1),sse:Ie().optional().default(!1)}),W3=w({_meta:A(p(),_()).nullish(),headers:z(wy),name:p(),url:p()}),G3=w({_meta:A(p(),_()).nullish(),headers:z(wy),name:p(),url:p()}),Y3=w({_meta:A(p(),_()).nullish(),args:z(p()),command:p(),env:z(py),name:p()}),Pu=j([W3.and(w({type:C("http")})),G3.and(w({type:C("sse")})),Y3]),hp=p(),K3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),modelId:hp,name:p()}),J3=j([C("error"),C("warning"),C("information"),C("hint")]),X3=w({_meta:A(p(),_()).nullish()}),Q3=w({_meta:A(p(),_()).nullish()}),eI=w({_meta:A(p(),_()).nullish()}),tI=w({_meta:A(p(),_()).nullish()}),nI=w({_meta:A(p(),_()).nullish()}),rI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),iI=w({diff:p(),uri:p()}),sI=w({endLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:p()}),oI=w({_meta:A(p(),_()).nullish()}),aI=w({_meta:A(p(),_()).nullish()}),lI=w({languageId:p(),text:p(),uri:p()}),cI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),uI=j([C("rejected"),C("ignored"),C("replaced"),C("cancelled")]),hI=w({excerpts:z(sI),uri:p()}),dI=w({_meta:A(p(),_()).nullish()}),fI=w({_meta:A(p(),_()).nullish()}),pI=w({name:p(),owner:p(),remoteUrl:p()}),mI=w({_meta:A(p(),_()).nullish()}),gI=w({_meta:A(p(),_()).nullish(),jump:oI.nullish(),rename:fI.nullish(),searchAndReplace:mI.nullish()}),vI=w({id:p(),isRegex:Ie().nullish(),replace:p(),search:p(),uri:p()}),yI=j([C("automatic"),C("diagnostic"),C("manual")]),wI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),bI=w({_meta:A(p(),_()).nullish(),diagnostics:X3.nullish(),editHistory:rI.nullish(),openFiles:aI.nullish(),recentFiles:cI.nullish(),relatedSnippets:dI.nullish(),userActions:wI.nullish()}),_I=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Pu)}),SI=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),_y=p(),AI=j([C("allow_once"),C("allow_always"),C("reject_once"),C("reject_always")]),kI=w({_meta:A(p(),_()).nullish(),kind:AI,name:p(),optionId:_y}),EI=j([C("high"),C("medium"),C("low")]),$I=j([C("pending"),C("in_progress"),C("completed")]),CI=w({_meta:A(p(),_()).nullish(),content:p(),priority:EI,status:$I}),TI=w({_meta:A(p(),_()).nullish(),entries:z(CI)}),Pr=w({character:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),RI=w({id:p(),position:Pr,uri:p()}),II=w({id:p(),newName:p(),position:Pr,uri:p()}),xI=w({action:p(),position:Pr,timestampMs:H(),uri:p()}),Sy=j([C("utf-16"),C("utf-32"),C("utf-8")]),PI=w({_meta:A(p(),_()).nullish(),auth:h3.optional().default({terminal:!1}),elicitation:O3.nullish(),fs:M3.optional().default({readTextFile:!1,writeTextFile:!1}),nes:gI.nullish(),positionEncodings:z(Sy).optional(),terminal:Ie().optional().default(!1)}),DI=w({_meta:A(p(),_()).nullish(),audio:Ie().optional().default(!1),embeddedContext:Ie().optional().default(!1),image:Ie().optional().default(!1)}),Ay=H().int().gte(0).lte(65535),LI=w({_meta:A(p(),_()).nullish(),clientCapabilities:PI.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:by.nullish(),protocolVersion:Ay}),go=w({end:Pr,start:Pr}),OI=w({message:p(),range:go,severity:J3,uri:p()}),zI=w({languageId:p(),lastFocusedMs:H().nullish(),uri:p(),visibleRange:go.nullish()}),NI=w({_meta:A(p(),_()).nullish(),diagnostics:z(OI).nullish(),editHistory:z(iI).nullish(),openFiles:z(zI).nullish(),recentFiles:z(lI).nullish(),relatedSnippets:z(hI).nullish(),userActions:z(xI).nullish()}),MI=w({newText:p(),range:go}),UI=w({cursorPosition:Pr.nullish(),edits:z(MI),id:p(),uri:p()}),ZI=j([UI.and(w({kind:C("edit")})),RI.and(w({kind:C("jump")})),II.and(w({kind:C("rename")})),vI.and(w({kind:C("searchAndReplace")}))]),FI=w({_meta:A(p(),_()).nullish(),content:p()}),HI=w({_meta:A(p(),_()).nullish()}),Mi=j([H(),p()]).nullable();w({_meta:A(p(),_()).nullish(),requestId:Mi});const VI=ry(["assistant","user"]),Sl=w({_meta:A(p(),_()).nullish(),audience:z(VI).nullish(),lastModified:p().nullish(),priority:H().nullish()}),BI=w({_meta:A(p(),_()).nullish(),annotations:Sl.nullish(),data:p(),mimeType:p()}),qI=w({_meta:A(p(),_()).nullish(),annotations:Sl.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),jI=w({_meta:A(p(),_()).nullish(),annotations:Sl.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:H().nullish(),title:p().nullish(),uri:p()}),WI=w({_meta:A(p(),_()).nullish(),optionId:_y}),GI=j([w({outcome:C("cancelled")}),WI.and(w({outcome:C("selected")}))]),YI=w({_meta:A(p(),_()).nullish(),outcome:GI}),KI=w({_meta:A(p(),_()).nullish()}),JI=w({_meta:A(p(),_()).nullish()}),XI=w({currentValue:Ie()}),QI=p(),ky=p(),ex=j([C("mode"),C("model"),C("thought_level"),p()]),dp=p(),Ey=w({_meta:A(p(),_()).nullish(),description:p().nullish(),name:p(),value:dp}),tx=w({_meta:A(p(),_()).nullish(),group:QI,name:p(),options:z(Ey)}),nx=j([z(Ey),z(tx)]),rx=w({currentValue:dp,options:nx}),vo=xu(j([rx.and(w({type:C("select")})),XI.and(w({type:C("boolean")}))]),w({_meta:A(p(),_()).nullish(),category:ex.nullish(),description:p().nullish(),id:ky,name:p()})),ix=w({_meta:A(p(),_()).nullish(),configOptions:z(vo)}),sx=w({_meta:A(p(),_()).nullish()}),ne=p(),ox=w({_meta:A(p(),_()).nullish(),id:p(),sessionId:ne}),ax=w({_meta:A(p(),_()).nullish(),sessionId:ne}),lx=w({_meta:A(p(),_()).nullish(),sessionId:ne}),cx=w({_meta:A(p(),_()).nullish(),sessionId:ne}),$y=w({_meta:A(p(),_()).nullish(),args:z(p()).optional(),command:p(),cwd:p().nullish(),env:z(py).optional(),outputByteLimit:H().nullish(),sessionId:ne}),ux=w({_meta:A(p(),_()).nullish(),sessionId:ne,uri:p()}),hx=w({_meta:A(p(),_()).nullish(),position:Pr,sessionId:ne,uri:p(),version:H(),visibleRange:go}),dx=w({_meta:A(p(),_()).nullish(),languageId:p(),sessionId:ne,text:p(),uri:p(),version:H()}),fx=w({_meta:A(p(),_()).nullish(),sessionId:ne,uri:p()}),px=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Pu).optional(),sessionId:ne}),Cy=w({_meta:A(p(),_()).nullish(),sessionId:ne,terminalId:p()}),mx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Pu),sessionId:ne}),Ty=w({_meta:A(p(),_()).nullish(),limit:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p(),sessionId:ne}),gx=w({_meta:A(p(),_()).nullish(),id:p(),reason:uI.nullish(),sessionId:ne}),Ry=w({_meta:A(p(),_()).nullish(),sessionId:ne,terminalId:p()}),vx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Pu).optional(),sessionId:ne}),yx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),sessionId:ne,title:p().nullish(),updatedAt:p().nullish()}),wx=w({_meta:A(p(),_()).nullish(),nextCursor:p().nullish(),sessions:z(yx)}),bx=w({_meta:A(p(),_()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),_x=w({_meta:A(p(),_()).nullish()}),Du=p(),Sx=w({_meta:A(p(),_()).nullish(),currentModeId:Du}),Ax=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:Du,name:p()}),Lu=w({_meta:A(p(),_()).nullish(),availableModes:z(Ax),currentModeId:Du}),Ou=w({_meta:A(p(),_()).nullish(),availableModels:z(K3),currentModelId:hp}),kx=w({_meta:A(p(),_()).nullish(),configOptions:z(vo).nullish(),models:Ou.nullish(),modes:Lu.nullish(),sessionId:ne}),Ex=w({_meta:A(p(),_()).nullish(),configOptions:z(vo).nullish(),models:Ou.nullish(),modes:Lu.nullish()}),$x=w({_meta:A(p(),_()).nullish(),configOptions:z(vo).nullish(),models:Ou.nullish(),modes:Lu.nullish(),sessionId:ne}),Cx=w({_meta:A(p(),_()).nullish(),configOptions:z(vo).nullish(),models:Ou.nullish(),modes:Lu.nullish()}),Tx=w({_meta:A(p(),_()).nullish()}),Rx=w({_meta:A(p(),_()).nullish(),additionalDirectories:KI.nullish(),close:JI.nullish(),fork:sx.nullish(),list:_x.nullish(),resume:Tx.nullish()}),Ix=xu(j([w({type:C("boolean"),value:Ie()}),w({value:dp})]),w({_meta:A(p(),_()).nullish(),configId:ky,sessionId:ne})),xx=w({_meta:A(p(),_()).nullish(),configOptions:z(vo)}),Px=w({_meta:A(p(),_()).nullish(),modeId:Du,sessionId:ne}),Dx=w({_meta:A(p(),_()).nullish()}),Lx=w({_meta:A(p(),_()).nullish(),modelId:hp,sessionId:ne}),Ox=w({_meta:A(p(),_()).nullish()}),zx=w({_meta:A(p(),_()).nullish(),sessionId:ne}),Nx=j([C("end_turn"),C("max_tokens"),C("max_turn_requests"),C("refusal"),C("cancelled")]),Mx=j([C("email"),C("uri"),C("date"),C("date-time")]),Ux=w({default:p().nullish(),description:p().nullish(),enum:z(p()).nullish(),format:Mx.nullish(),maxLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(fy).nullish(),pattern:p().nullish(),title:p().nullish()}),Zx=w({_meta:A(p(),_()).nullish(),context:NI.nullish(),position:Pr,selection:go.nullish(),sessionId:ne,triggerKind:yI,uri:p(),version:H()}),Fx=w({_meta:A(p(),_()).nullish(),suggestions:z(ZI)}),Hx=w({_meta:A(p(),_()).nullish(),terminalId:p()}),Vx=w({_meta:A(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),Iy=w({_meta:A(p(),_()).nullish(),sessionId:ne,terminalId:p()}),Bx=w({_meta:A(p(),_()).nullish(),exitStatus:Vx.nullish(),output:p(),truncated:Ie()}),qx=w({_meta:A(p(),_()).nullish(),annotations:Sl.nullish(),text:p()}),jx=w({range:go.nullish(),text:p()}),Wx=w({_meta:A(p(),_()).nullish(),contentChanges:z(jx),sessionId:ne,uri:p(),version:H()});w({method:p(),params:j([ax,dx,Wx,ux,fx,hx,ox,gx,gy]).nullish()});const Gx=j([C("full"),C("incremental")]),Yx=w({_meta:A(p(),_()).nullish(),syncKind:Gx}),Kx=w({_meta:A(p(),_()).nullish(),didChange:Yx.nullish(),didClose:Q3.nullish(),didFocus:eI.nullish(),didOpen:tI.nullish(),didSave:nI.nullish()}),Jx=w({_meta:A(p(),_()).nullish(),document:Kx.nullish()}),Xx=w({_meta:A(p(),_()).nullish(),context:bI.nullish(),events:Jx.nullish()}),Qx=w({_meta:A(p(),_()).nullish(),auth:V3.optional().default({}),loadSession:Ie().optional().default(!1),mcpCapabilities:j3.optional().default({http:!1,sse:!1}),nes:Xx.nullish(),positionEncoding:Sy.nullish(),promptCapabilities:DI.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Rx.optional().default({})}),eP=w({_meta:A(p(),_()).nullish(),agentCapabilities:Qx.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:by.nullish(),authMethods:z(g3).optional().default([]),protocolVersion:Ay}),tP=w({_meta:A(p(),_()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),nP=j([tP,w3]),rP=w({_meta:A(p(),_()).nullish(),annotations:Sl.nullish(),resource:nP}),fp=j([qx.and(w({type:C("text")})),qI.and(w({type:C("image")})),BI.and(w({type:C("audio")})),jI.and(w({type:C("resource_link")})),rP.and(w({type:C("resource")}))]),iP=w({_meta:A(p(),_()).nullish(),content:fp}),Mh=w({_meta:A(p(),_()).nullish(),content:fp,messageId:p().nullish()}),sP=w({_meta:A(p(),_()).nullish(),messageId:p().nullish(),prompt:z(fp),sessionId:ne}),oP=w({anyOf:z(fy)}),xy=j([iP.and(w({type:C("content")})),E3.and(w({type:C("diff")})),Hx.and(w({type:C("terminal")}))]),Py=p(),Dy=w({_meta:A(p(),_()).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p()}),Ly=j([C("pending"),C("in_progress"),C("completed"),C("failed")]),Oy=j([C("read"),C("edit"),C("delete"),C("move"),C("search"),C("execute"),C("think"),C("fetch"),C("switch_mode"),C("other")]),aP=w({_meta:A(p(),_()).nullish(),content:z(xy).optional(),kind:Oy.optional(),locations:z(Dy).optional(),rawInput:_().optional(),rawOutput:_().optional(),status:Ly.optional(),title:p(),toolCallId:Py}),zy=w({_meta:A(p(),_()).nullish(),content:z(xy).nullish(),kind:Oy.nullish(),locations:z(Dy).nullish(),rawInput:_().optional(),rawOutput:_().optional(),status:Ly.nullish(),title:p().nullish(),toolCallId:Py}),Ny=w({_meta:A(p(),_()).nullish(),options:z(kI),sessionId:ne,toolCall:zy}),lP=w({_meta:A(p(),_()).nullish(),hint:p()}),cP=lP,uP=w({_meta:A(p(),_()).nullish(),description:p(),input:cP.nullish(),name:p()}),hP=w({_meta:A(p(),_()).nullish(),availableCommands:z(uP)}),dP=w({enum:z(p()),type:D3}),fP=j([dP,oP]),pP=w({default:z(p()).nullish(),description:p().nullish(),items:fP,maxItems:H().nullish(),minItems:H().nullish(),title:p().nullish()}),mP=j([Ux.and(w({type:C("string")})),SI.and(w({type:C("number")})),U3.and(w({type:C("integer")})),b3.and(w({type:C("boolean")})),pP.and(w({type:C("array")}))]),gP=w({description:p().nullish(),properties:A(p(),mP).optional().default({}),required:z(p()).nullish(),title:p().nullish(),type:P3.optional().default("object")}),vP=w({requestedSchema:gP}),yP=xu(j([vP.and(w({mode:C("form")})),z3.and(w({mode:C("url")}))]),w({_meta:A(p(),_()).nullish(),message:p(),sessionId:ne})),wP=w({cachedReadTokens:H().nullish(),cachedWriteTokens:H().nullish(),inputTokens:H(),outputTokens:H(),thoughtTokens:H().nullish(),totalTokens:H()}),bP=w({_meta:A(p(),_()).nullish(),stopReason:Nx,usage:wP.nullish(),userMessageId:p().nullish()});j([w({id:Mi,result:j([eP,y3,q3,$x,Ex,wx,kx,Cx,S3,Dx,xx,bP,Ox,zx,Fx,_3,yy])}),w({error:my,id:Mi})]);const _P=w({_meta:A(p(),_()).nullish(),cost:A3.nullish(),size:H(),used:H()}),SP=j([Mh.and(w({sessionUpdate:C("user_message_chunk")})),Mh.and(w({sessionUpdate:C("agent_message_chunk")})),Mh.and(w({sessionUpdate:C("agent_thought_chunk")})),aP.and(w({sessionUpdate:C("tool_call")})),zy.and(w({sessionUpdate:C("tool_call_update")})),TI.and(w({sessionUpdate:C("plan")})),hP.and(w({sessionUpdate:C("available_commands_update")})),Sx.and(w({sessionUpdate:C("current_mode_update")})),ix.and(w({sessionUpdate:C("config_option_update")})),bx.and(w({sessionUpdate:C("session_info_update")})),_P.and(w({sessionUpdate:C("usage_update")}))]),My=w({_meta:A(p(),_()).nullish(),sessionId:ne,update:SP});w({method:p(),params:j([My,I3,gy]).nullish()});const Uy=w({_meta:A(p(),_()).nullish(),sessionId:ne,terminalId:p()}),AP=w({_meta:A(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),kP=w({name:p(),uri:p()}),EP=w({_meta:A(p(),_()).nullish(),repository:pI.nullish(),workspaceFolders:z(kP).nullish(),workspaceUri:p().nullish()});w({id:Mi,method:p(),params:j([LI,v3,B3,_I,mx,F3,px,vx,cx,Px,Ix,sP,Lx,EP,Zx,lx,vy]).nullish()});const Zy=w({_meta:A(p(),_()).nullish(),content:p(),path:p(),sessionId:ne});w({id:Mi,method:p(),params:j([Zy,Ty,Ny,$y,Iy,Ry,Uy,Cy,yP,vy]).nullish()});const $P=w({_meta:A(p(),_()).nullish()});j([w({id:Mi,result:j([$P,FI,YI,k3,Bx,HI,AP,Z3,x3,yy])}),w({error:my,id:Mi})]);var te;class CP{constructor(e,t){g(this,te);const r=e(this),i=async(o,l)=>{var c,u,f,m,v,y,k;switch(o){case En.fs_write_text_file:{const S=Zy.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,S)}case En.fs_read_text_file:{const S=Ty.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,S)}case En.session_request_permission:{const S=Ny.parse(l);return r.requestPermission(S)}case En.terminal_create:{const S=$y.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,S)}case En.terminal_output:{const S=Iy.parse(l);return(m=r.terminalOutput)==null?void 0:m.call(r,S)}case En.terminal_release:{const S=Ry.parse(l);return await((v=r.releaseTerminal)==null?void 0:v.call(r,S))??{}}case En.terminal_wait_for_exit:{const S=Uy.parse(l);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,S)}case En.terminal_kill:{const S=Cy.parse(l);return await((k=r.killTerminal)==null?void 0:k.call(r,S))??{}}default:if(r.extMethod)return r.extMethod(o,l);throw Ce.methodNotFound(o)}},s=async(o,l)=>{switch(o){case En.session_update:{const c=My.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(o,l);throw Ce.methodNotFound(o)}};d(this,te,new TP(i,s,t))}async initialize(e){return await a(this,te).sendRequest(fe.initialize,e)}async newSession(e){return await a(this,te).sendRequest(fe.session_new,e)}async loadSession(e){return await a(this,te).sendRequest(fe.session_load,e)??{}}async unstable_forkSession(e){return await a(this,te).sendRequest(fe.session_fork,e)}async listSessions(e){return await a(this,te).sendRequest(fe.session_list,e)}async unstable_resumeSession(e){return await a(this,te).sendRequest(fe.session_resume,e)}async unstable_closeSession(e){return await a(this,te).sendRequest(fe.session_close,e)}async setSessionMode(e){return await a(this,te).sendRequest(fe.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await a(this,te).sendRequest(fe.session_set_model,e)??{}}async setSessionConfigOption(e){return await a(this,te).sendRequest(fe.session_set_config_option,e)}async authenticate(e){return await a(this,te).sendRequest(fe.authenticate,e)??{}}async unstable_logout(e){return await a(this,te).sendRequest(fe.logout,e)??{}}async prompt(e){return await a(this,te).sendRequest(fe.session_prompt,e)}async cancel(e){return await a(this,te).sendNotification(fe.session_cancel,e)}async unstable_startNes(e){return await a(this,te).sendRequest(fe.nes_start,e)}async unstable_suggestNes(e){return await a(this,te).sendRequest(fe.nes_suggest,e)}async unstable_closeNes(e){return await a(this,te).sendRequest(fe.nes_close,e)??{}}async unstable_didOpenDocument(e){return await a(this,te).sendNotification(fe.document_did_open,e)}async unstable_didChangeDocument(e){return await a(this,te).sendNotification(fe.document_did_change,e)}async unstable_didCloseDocument(e){return await a(this,te).sendNotification(fe.document_did_close,e)}async unstable_didSaveDocument(e){return await a(this,te).sendNotification(fe.document_did_save,e)}async unstable_didFocusDocument(e){return await a(this,te).sendNotification(fe.document_did_focus,e)}async unstable_acceptNes(e){return await a(this,te).sendNotification(fe.nes_accept,e)}async unstable_rejectNes(e){return await a(this,te).sendNotification(fe.nes_reject,e)}async extMethod(e,t){return await a(this,te).sendRequest(e,t)}async extNotification(e,t){return await a(this,te).sendNotification(e,t)}get signal(){return a(this,te).signal}get closed(){return a(this,te).closed}}te=new WeakMap;var ir,tu,_a,Sa,bs,_s,Bt,Aa,me,Fy,bd,Hy,Vy,By,qy,_d,Mo;class TP{constructor(e,t,r){g(this,me);g(this,ir,new Map);g(this,tu,0);g(this,_a);g(this,Sa);g(this,bs);g(this,_s,Promise.resolve());g(this,Bt,new AbortController);g(this,Aa);d(this,_a,e),d(this,Sa,t),d(this,bs,r),d(this,Aa,new Promise(i=>{a(this,Bt).signal.addEventListener("abort",()=>i())})),h(this,me,Fy).call(this)}get signal(){return a(this,Bt).signal}get closed(){return a(this,Aa)}async sendRequest(e,t){h(this,me,_d).call(this);const r=rh(this,tu)._++,i=new Promise((s,o)=>{a(this,ir).set(r,{resolve:s,reject:o})});return await h(this,me,Mo).call(this,{jsonrpc:"2.0",id:r,method:e,params:t}),i}async sendNotification(e,t){h(this,me,_d).call(this),await h(this,me,Mo).call(this,{jsonrpc:"2.0",method:e,params:t})}}ir=new WeakMap,tu=new WeakMap,_a=new WeakMap,Sa=new WeakMap,bs=new WeakMap,_s=new WeakMap,Bt=new WeakMap,Aa=new WeakMap,me=new WeakSet,Fy=async function(){let e;try{const t=a(this,bs).readable.getReader();try{for(;!a(this,Bt).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{h(this,me,Hy).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&h(this,me,Mo).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{t.releaseLock()}}catch(t){e=t}finally{h(this,me,bd).call(this,e)}},bd=function(e){if(a(this,Bt).signal.aborted)return;const t=e??new Error("ACP connection closed");for(const r of a(this,ir).values())r.reject(t);a(this,ir).clear(),a(this,Bt).abort(t)},Hy=async function(e){if("method"in e&&"id"in e){const t=await h(this,me,Vy).call(this,e.method,e.params);"error"in t&&console.error("Error handling request",e,t.error),await h(this,me,Mo).call(this,{jsonrpc:"2.0",id:e.id,...t})}else if("method"in e){const t=await h(this,me,By).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?h(this,me,qy).call(this,e):console.error("Invalid message",{message:e})},Vy=async function(e,t){try{return{result:await a(this,_a).call(this,e,t)??null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Qm)return Ce.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},By=async function(e,t){try{return await a(this,Sa).call(this,e,t),{result:null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Qm)return Ce.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},qy=function(e){const t=a(this,ir).get(e.id);if(t){if("result"in e)t.resolve(e.result);else if("error"in e){const{code:r,message:i,data:s}=e.error;t.reject(new Ce(r,i,s))}a(this,ir).delete(e.id)}else console.error("Got response to unknown request",e.id)},_d=function(){if(a(this,Bt).signal.aborted)throw a(this,Bt).signal.reason??new Error("ACP connection closed")},Mo=async function(e){return d(this,_s,a(this,_s).then(async()=>{const t=a(this,bs).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{h(this,me,bd).call(this,t)})),a(this,_s)};class Ce extends Error{constructor(t,r,i){super(r);$(this,"code");$(this,"data");this.code=t,this.name="RequestError",this.data=i}static parseError(t,r){return new Ce(-32700,`Parse error${r?`: ${r}`:""}`,t)}static invalidRequest(t,r){return new Ce(-32600,`Invalid request${r?`: ${r}`:""}`,t)}static methodNotFound(t){return new Ce(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,r){return new Ce(-32602,`Invalid params${r?`: ${r}`:""}`,t)}static internalError(t,r){return new Ce(-32603,`Internal error${r?`: ${r}`:""}`,t)}static authRequired(t,r){return new Ce(-32e3,`Authentication required${r?`: ${r}`:""}`,t)}static resourceNotFound(t){return new Ce(-32002,`Resource not found${t?`: ${t}`:""}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function RP(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function jy(n){var t;class e extends n{constructor(...s){super(...s);g(this,t,!1);RP(this,()=>a(this,t),()=>{d(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return a(this,t)}}return t=new WeakMap,e}const IP=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,xP=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,PP=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,DP=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,LP=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,OP="single_session",zP={name:"television-acp-client",version:"0.0.0"},Wy="agent:main:television",NP=jy(zr);var Ss,qt,nt,jt,sr,Et,On,Wt,Gt,or,$t,As,ks,Yt,He,zn,Es,oi,Nn,ar,ka,Ct,Kt,nu,Jt,T,Sd,Gy,Yy,Ky,dc,Jy,Xy,Qy,ew,tw,nw,rw,Br,ss,os,Cn,iw,as,Ad,kd,fc,sw,pc,Ed,$d,Ea,$a,mc,ls,Cd,ow;class MP extends NP{constructor(t){super();g(this,T);g(this,Ss,"disconnected");g(this,qt,null);g(this,nt,new Map);g(this,jt,null);g(this,sr,null);g(this,Et,null);g(this,On,null);g(this,Wt,null);g(this,Gt,null);g(this,or);g(this,$t,null);g(this,As,0);g(this,ks,1);g(this,Yt,null);g(this,He,null);g(this,zn,!1);g(this,Es,!1);g(this,oi,!1);g(this,Nn,null);g(this,ar,new Set);g(this,ka);g(this,Ct);g(this,Kt);g(this,nu,t=>{h(this,T,Yy).call(this,t)});g(this,Jt,null);g(this,Ea,()=>{h(this,T,ls).call(this,"ACP bridge websocket closed")});g(this,$a,()=>{h(this,T,ls).call(this,"ACP bridge websocket error")});d(this,Ct,t),d(this,Kt,t.sessionMode??OP),d(this,or,t.mappedSessionStore??UP()),d(this,ka,t.createSocket??(r=>new WebSocket(r)))}get status(){return a(this,Ss)}get messages(){return[...a(this,nt).values()]}get enabled(){return a(this,Ct).enabled??!1}setToken(t){a(this,Ct).token=t??""}setEnabled(t){a(this,Ct).enabled=t,t||(h(this,T,mc).call(this),d(this,qt,null),h(this,T,Cn).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){a(this,sr)===null&&(d(this,qt,null),d(this,sr,h(this,T,Gy).call(this)));try{await a(this,sr),await h(this,T,dc).call(this)}catch(t){throw h(this,T,ls).call(this,Uh(t)),t}}}dispose(){h(this,T,mc).call(this),d(this,qt,null),h(this,T,Cn).call(this,"disposed")}async sendMessage(t){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,T,Sd).call(this,"ready")),(a(this,Wt)===null||a(this,$t)!==h(this,T,pc).call(this))&&await h(this,T,dc).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=t.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,T,ss).call(this,{id:h(this,T,as).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,T,Cn).call(this,"running");try{const i=await h(this,T,fc).call(this).prompt({sessionId:h(this,T,kd).call(this),prompt:[{type:"text",text:h(this,T,iw).call(this,r)}]});h(this,T,Br).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,T,Cn).call(this,"ready")}catch(i){throw h(this,T,ow).call(this)||(h(this,T,Br).call(this,"error"),h(this,T,Cn).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,T,Sd).call(this,"ready"));const t=h(this,T,pc).call(this);((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="mapped"?a(this,or).clearActualSessionId(t):d(this,As,a(this,As)+1),d(this,Et,null),d(this,On,null),d(this,Wt,null),d(this,$t,null),h(this,T,Cd).call(this)}async cancel(){this.status==="running"&&(h(this,T,Cn).call(this,"cancelling"),await h(this,T,fc).call(this).cancel({sessionId:h(this,T,kd).call(this)}))}setChannelContext(t){var s,o,l;if(t===null){if(a(this,He)===null)return;d(this,He,null),d(this,zn,!1);return}const r={channelID:t.channelID,channelName:t.channelName};if(((s=a(this,He))==null?void 0:s.channelID)===r.channelID&&((o=a(this,He))==null?void 0:o.channelName)===r.channelName)return;const i=((l=a(this,He))==null?void 0:l.channelID)??null;if(d(this,He,r),a(this,Kt)==="single_session"){(!a(this,$t)||i!==r.channelID)&&d(this,zn,!0);return}a(this,$t)!==h(this,T,Ed).call(this,r.channelID)&&(d(this,Et,null),d(this,On,null),a(this,jt)&&this.status==="ready"&&h(this,T,dc).call(this).catch(c=>{h(this,T,ls).call(this,Uh(c))}))}}Ss=new WeakMap,qt=new WeakMap,nt=new WeakMap,jt=new WeakMap,sr=new WeakMap,Et=new WeakMap,On=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,or=new WeakMap,$t=new WeakMap,As=new WeakMap,ks=new WeakMap,Yt=new WeakMap,He=new WeakMap,zn=new WeakMap,Es=new WeakMap,oi=new WeakMap,Nn=new WeakMap,ar=new WeakMap,ka=new WeakMap,Ct=new WeakMap,Kt=new WeakMap,nu=new WeakMap,Jt=new WeakMap,T=new WeakSet,Sd=async function(t){if(this.status!==t){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(a(this,qt)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",o)},o=()=>{if(this.status===t){s(),r();return}if(this.status==="disposed"){s(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(s(),i(new Error(a(this,qt)??"ACPClient is disconnected")))};this.addEventListener("status-changed",o)})}},Gy=async function(){try{const{stream:t,socket:r,metadata:i}=await VP({serverURL:a(this,Ct).serverURL,token:a(this,Ct).token,createSocket:a(this,ka),onDisconnect:a(this,nu)});d(this,Gt,i),d(this,Jt,r),r.addEventListener("close",a(this,Ea)),r.addEventListener("error",a(this,$a)),d(this,jt,new CP(s=>({connection:s,sessionUpdate:async o=>{await h(this,T,Xy).call(this,o)},requestPermission:async o=>h(this,T,Qy).call(this,o)}),t)),await a(this,jt).initialize({protocolVersion:u3,clientCapabilities:{},clientInfo:zP})}catch(t){throw t}},Yy=function(t){h(this,T,ls).call(this,Uh(t))},Ky=function(t){const r=t==null?void 0:t.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(s=>s.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},dc=async function(){const t=h(this,T,pc).call(this);if(a(this,Et)&&a(this,On)===t){await a(this,Et);return}d(this,On,t),d(this,Et,h(this,T,Jy).call(this,t)),await a(this,Et)},Jy=async function(t){var c;const r=h(this,T,fc).call(this);h(this,T,Cd).call(this);let i,s=!1,o=null;const l={cwd:h(this,T,sw).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(d(this,oi,!0),d(this,Nn,null),((c=a(this,Gt))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=a(this,or).getActualSessionId(t);if(u)try{const f=await r.loadSession({...l,sessionId:u});if(ZP(f))throw new Error("Mapped ACP session was not found");o=f,i=u,s=!0}catch{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,or).setActualSessionId(t,i),s=!1}else{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,or).setActualSessionId(t,i),s=!1}}else try{o=await r.loadSession({...l,sessionId:t}),i=t,s=a(this,nt).size>0}catch{const u=await r.newSession(l);o=u,i=u.sessionId,s=!1}}finally{d(this,oi,!1),d(this,Nn,null),h(this,T,Br).call(this,"final")}h(this,T,Ky).call(this,o),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,Wt,i),d(this,$t,t),d(this,Es,!0),s?(a(this,ar).add(t),a(this,Kt)==="single_session"&&d(this,zn,!1)):(a(this,ar).delete(t),d(this,zn,a(this,Kt)==="single_session")),d(this,qt,null),h(this,T,Cn).call(this,"ready")},Xy=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,T,rw).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,T,ew).call(this,r.content.text);return;case"tool_call":h(this,T,tw).call(this,r);return;case"tool_call_update":h(this,T,nw).call(this,r);return;case"agent_thought_chunk":return;default:return}},Qy=async function(t){return{outcome:{outcome:"cancelled"}}},ew=function(t){d(this,Nn,null);const r=HP(t);if(!r)return;if(!a(this,Yt)){const s={id:h(this,T,as).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,Yt,s.id),h(this,T,ss).call(this,s);return}const i=a(this,nt).get(a(this,Yt));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,T,os).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},tw=function(t){h(this,T,Br).call(this,"final");const r=h(this,T,Ad).call(this,t.toolCallId),i=ug("content"in t?t.content:void 0),s={id:(r==null?void 0:r.id)??h(this,T,as).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:t.title,toolKind:t.kind??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:t.locations??(r==null?void 0:r.locations)};if(r){h(this,T,os).call(this,s);return}h(this,T,ss).call(this,s)},nw=function(t){const r=h(this,T,Ad).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",s=ug(t.content),o=s?`${i}${s}`:i,l={id:(r==null?void 0:r.id)??h(this,T,as).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:(r==null?void 0:r.title)??t.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:o,locations:t.locations??(r==null?void 0:r.locations)};if(r){h(this,T,os).call(this,l);return}h(this,T,ss).call(this,l)},rw=function(t){if(h(this,T,Br).call(this,"final"),!t)return;const r=a(this,oi)?a(this,Nn):null;if(!r){const s=cg(t);if(!s)return;const o={id:h(this,T,as).call(this,"user"),kind:"user",text:s,status:"final"};h(this,T,ss).call(this,o),a(this,oi)&&d(this,Nn,o.id);return}const i=a(this,nt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,T,os).call(this,{...i,text:cg(`${i.text}${t}`)})},Br=function(t){if(!a(this,Yt))return;const r=a(this,nt).get(a(this,Yt));(r==null?void 0:r.kind)==="assistant"&&h(this,T,os).call(this,{...r,status:t}),d(this,Yt,null)},ss=function(t){a(this,nt).set(t.id,t),this.dispatchEvent(new Oh("messages-changed"))},os=function(t){a(this,nt).set(t.id,t),this.dispatchEvent(new Oh("messages-changed"))},Cn=function(t){a(this,Ss)!==t&&(d(this,Ss,t),this.dispatchEvent(new KE("status-changed")))},iw=function(t){const r=a(this,$t);if(!r)return t;const i=a(this,He)?a(this,Kt)==="single_session"?a(this,zn)||!a(this,ar).has(r):!a(this,ar).has(r):!1,s=a(this,Es)&&(a(this,He)!==null||DP.test(t));if(!(s||i))return t;s&&d(this,Es,!1),i&&(d(this,zn,!1),a(this,ar).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."];return a(this,He)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${a(this,He).channelID}`),l.push(`channel_name: ${a(this,He).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",t),l.join(`
|
|
43
|
+
`)},as=function(t){const r=`${t}-${a(this,ks)}`;return d(this,ks,a(this,ks)+1),r},Ad=function(t){for(const r of a(this,nt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===t)return r;return null},kd=function(){if(!a(this,Wt))throw new Error("ACP session is not ready");return a(this,Wt)},fc=function(){if(!a(this,jt))throw new Error("ACP connection is not ready");return a(this,jt)},sw=function(){var r;const t=(r=a(this,Gt))==null?void 0:r.sessionCwd;if(!t)throw new Error("ACP bridge session cwd is not ready");return t},pc=function(){var r;if(a(this,Kt)==="single_session")return h(this,T,$d).call(this,`${Wy}-${(a(this,Ct).clientGUID??"default-client").toLowerCase()}`);const t=(r=a(this,He))==null?void 0:r.channelID;if(!t)throw new Error("Channel context is required for per-channel session mode");return h(this,T,Ed).call(this,t)},Ed=function(t){return h(this,T,$d).call(this,FP(a(this,Kt),t,a(this,Ct).clientGUID??"default-client"))},$d=function(t){var r;return((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="deterministic"&&a(this,As)>0?`${t}:epoch-${a(this,As)}`:t},Ea=new WeakMap,$a=new WeakMap,mc=function(){d(this,jt,null),d(this,sr,null),d(this,Et,null),d(this,On,null),d(this,Wt,null),d(this,$t,null),d(this,Gt,null),a(this,Jt)&&(a(this,Jt).removeEventListener("close",a(this,Ea)),a(this,Jt).removeEventListener("error",a(this,$a)),a(this,Jt).close(),d(this,Jt,null))},ls=function(t){const r=a(this,jt)!==null||a(this,sr)!==null||a(this,Et)!==null||a(this,On)!==null||a(this,Wt)!==null||a(this,$t)!==null||a(this,Gt)!==null||a(this,Jt)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,T,Br).call(this,"error"),h(this,T,mc).call(this),d(this,qt,t??null),h(this,T,Cn).call(this,"disconnected"))},Cd=function(){const t=a(this,nt).size>0;d(this,Yt,null),d(this,Nn,null),d(this,ks,1),a(this,nt).clear(),t&&this.dispatchEvent(new Oh("messages-changed"))},ow=function(){return this.status==="disconnected"};function UP(){const n=new Map;return{getActualSessionId(e){return n.get(e)??null},setActualSessionId(e,t){n.set(e,t)},clearActualSessionId(e){n.delete(e)}}}function ZP(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function FP(n,e,t){return n==="single_session"?`${Wy}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function aw(n){return n.replace(/^(?:\s*\n)+/,"")}function cg(n){let e=n;return e=e.replace(IP,""),e=e.replace(xP,""),e=e.replace(PP,""),e=aw(e),e}function HP(n){let e=n;return e=e.replace(LP,""),e=aw(e),e}function ug(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function VP(n){const e=n.createSocket(jP(n.serverURL,n.token));let t=!1,r,i;const s=new Promise((u,f)=>{r=u,i=f}),o=new ReadableStream({start(u){let f=!1;const m=()=>{e.send(JSON.stringify({type:"acp-bridge-connect"}))},v=S=>{const x=qP(S);if(!x)return;let M;try{M=JSON.parse(x)}catch(Z){const G=Z instanceof Error?Z:new Error(String(Z));i(G),u.error(G);return}switch(M.type){case"acp-bridge-status":if(M.status==="ready"){let Z;try{Z=BP(M)}catch(G){const F=G instanceof Error?G:new Error(String(G));t||i(F),u.error(F);return}t||(t=!0,r(Z));return}if(M.status==="error"||M.status==="exited"){const Z=new Error(M.error??`ACP bridge ${M.status}`);t||i(Z),u.error(Z)}return;case"acp-bridge-message":u.enqueue(M.message);return}},y=()=>{var x;if(f)return;f=!0;const S=new Error("ACP bridge websocket closed");t||i(S),(x=n.onDisconnect)==null||x.call(n,S),u.close()},k=()=>{var x;if(f)return;f=!0;const S=new Error("ACP bridge websocket error");t||i(S),(x=n.onDisconnect)==null||x.call(n,S),u.error(S)};e.addEventListener("open",m),e.addEventListener("message",v),e.addEventListener("close",y),e.addEventListener("error",k)}}),l=new WritableStream({async write(u){await s,e.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){e.close()},abort(){e.close()}}),c=await s;return{stream:{readable:o,writable:l},socket:e,metadata:c}}function BP(n){const{agent:e,sessionIdStrategy:t,sessionCwd:r}=n;if((e==="openclaw"||e==="hermes")&&(t==="deterministic"||t==="mapped")&&typeof r=="string"&&r.length>0)return{agent:e,sessionIdStrategy:t,sessionCwd:r};throw new Error("ACP bridge ready status missing bootstrap metadata")}function qP(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const e=n.data;if(typeof e=="string")return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(Array.isArray(e))return Buffer.concat(e).toString("utf8")}return null}function jP(n,e){const t=new URL(n);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.pathname="/acp",t.search="",t.searchParams.set("token",e),t.hash="",t.toString()}function Uh(n){return n instanceof Error?n.message:String(n)}const hg="television.acpClientGUID",dg="television.acpMappedSessions",fg=1;var $s;class WP{constructor(){g(this,$s,new Map)}getActualSessionId(e){return a(this,$s).get(e)??null}setActualSessionId(e,t){a(this,$s).set(e,t)}clearActualSessionId(e){a(this,$s).delete(e)}}$s=new WeakMap;var Cs,Ca,ot,gc,vc,Td;class GP{constructor(e,t){g(this,ot);g(this,Cs);g(this,Ca);d(this,Cs,e),d(this,Ca,t)}getActualSessionId(e){const t=h(this,ot,vc).call(this)[h(this,ot,gc).call(this,e)];return typeof t=="string"&&t.length>0?t:null}setActualSessionId(e,t){const r=h(this,ot,vc).call(this);r[h(this,ot,gc).call(this,e)]=t,h(this,ot,Td).call(this,r)}clearActualSessionId(e){const t=h(this,ot,vc).call(this);delete t[h(this,ot,gc).call(this,e)],h(this,ot,Td).call(this,t)}}Cs=new WeakMap,Ca=new WeakMap,ot=new WeakSet,gc=function(e){return JSON.stringify([a(this,Ca),e])},vc=function(){const e=a(this,Cs).getItem(dg);if(!e)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!="object"||t===null||Array.isArray(t))return{};const r=t;return r.version!==fg?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},Td=function(e){const t={version:fg,entries:e};a(this,Cs).setItem(dg,JSON.stringify(t))};function lw(){return typeof window>"u"?null:window.localStorage}function YP(n){const e=n.getItem(hg);if(e)return e;const t=ip().toLowerCase();return n.setItem(hg,t),t}const pg=4401,KP=401,ql=1e3,JP=3e4;class yc extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class XP extends zr{constructor(t){var o,l;super();$(this,"url");$(this,"name");$(this,"telemetryMeta");$(this,"status","unauthorized");$(this,"channels",new Map);$(this,"client");$(this,"acpClient");$(this,"_token");$(this,"attempting",!1);$(this,"nextRetryAt",null);$(this,"hasEverConnected",!1);$(this,"hasAuthRejected",!1);$(this,"hasAuthTokenRejected",!1);$(this,"bootState","pending");$(this,"serverVersion",null);$(this,"updateState",null);$(this,"decideBoot");$(this,"navigationPending");$(this,"createSocket");$(this,"createClient");$(this,"socket",null);$(this,"connectAttempt",0);$(this,"autoReconnect",!1);$(this,"retryTimer",null);$(this,"retryDelay",ql);$(this,"visibilityEventTarget");$(this,"networkEventTarget");$(this,"onVisibilityChange");$(this,"onNetworkOnline");$(this,"telemetryActivityAgent");this.url=Rr(t.url),this.name=t.name,this.decideBoot=t.decideBoot??null,this.navigationPending=t.navigationPending??(()=>!1),this._token=t.token??null,this.telemetryMeta=t.telemetryMeta??null,this.createSocket=t.createSocket??(c=>new WebSocket(c)),this.createClient=t.createClient??((c,u,f)=>new AE(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...f?{telemetryMeta:f}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=t.mappedSessionStore??(t.acpStorage?new GP(t.acpStorage,this.url):new WP);this.acpClient=new MP({serverURL:this.url,token:this._token??"",...t.createACPSocket?{createSocket:t.createACPSocket}:t.createSocket?{createSocket:t.createSocket}:{},...t.clientGUID?{clientGUID:t.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=t.visibilityEventTarget!==void 0?t.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=t.networkEventTarget!==void 0?t.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(o=this.visibilityEventTarget)==null||o.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=t.telemetryDocumentTarget!==void 0?t.telemetryDocumentTarget:typeof document<"u"?document:null,s=t.telemetryWindowTarget!==void 0?t.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&s?a3({meta:this.telemetryMeta,documentTarget:i,windowTarget:s,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(t){this._token=t,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(t),this.cancelRetryTimer(),this.retryDelay=ql,this.autoReconnect=!0,await this.attempt()}dispose(){var t,r,i,s;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(t=this.socket)==null||t.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(s=this.telemetryActivityAgent)==null||s.stop(),this.acpClient.dispose()}getViewURL(t){const r=wd(t,{electron:jn()});return jn()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(t){const r=wd(t,{electron:jn()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(t){const{channel:r}=await this.client.channels.create({name:t});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(t){switch(t.type){case"channel-created":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new zo("channels-changed"));break;case"channel-updated":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new zo("channels-changed"));break;case"channel-removed":this.channels.delete(t.channelID),this.dispatchEvent(new zo("channels-changed"));break;case"artifact-created":{const r=this.channels.get(t.channelID);r&&!lE(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...cv},size:{...uv}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=ad(r.layout,t.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"artifact-focus":break;default:return QP(t,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const t=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new gt("change"));const r=this.createSocket(e5(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,o)=>{let l=!1;const c=()=>{var m;l||this.connectAttempt!==t||(l=!0,this.retryDelay=ql,this.hasEverConnected=!0,this.setStatus("connected"),(m=this.telemetryActivityAgent)==null||m.start(),s())},u=m=>{l||this.connectAttempt!==t||(l=!0,o(m))},f=async()=>{const m=this.hasEverConnected;try{const[{channels:v},y]=await Promise.all([this.client.channels.list(),this.client.display.get()]);this.channels=new Map(v.map(k=>[k.id,structuredClone(k)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new gt("change")),m&&this.dispatchEvent(new zo("channels-changed")),this.dispatchEvent(new uc("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:y.focusedChannelId}})),this.dispatchEvent(new uc("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...y.pinnedChannelIds]}})),c(),m&&this.connectAttempt===t&&this.dispatchEvent(new Sv("server-reconnected",{serverURL:this.url}))}catch(v){if(o5(v)){u(new yc);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",m=>{const v=s5(m);if(!v)return;if(v.type==="server-status"){const k=v;this.serverVersion=k.version,this.updateState=k.update??null;let S=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===t&&(this.decideBoot(k)==="boot"?(this.bootState="booted",S=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new Av("server-status",{serverURL:this.url,message:k})),S?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new gt("change"));return}if(!i5(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new uc("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",m=>{if(this.connectAttempt!==t)return;this.socket=null;const v=t5(m);if(!l){u(v===pg?new yc:new Error("Connection closed before initialization"));return}if(v===pg){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===t){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},s=>{throw this.attempting=!1,this.handleAttemptFailure(s),s})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(t){if(t instanceof yc){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(t){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const t=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,JP),this.nextRetryAt=Date.now()+t,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},t),this.dispatchEvent(new gt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new gt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=ql,this.attempt().catch(()=>{})))}sendTelemetryActivity(t){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(t)))}sendTelemetrySignal(t,r){var s;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:aE,clientId:this.telemetryMeta.clientId,event:t,properties:r};(s=this.socket)==null||s.send(JSON.stringify(i))}setStatus(t){this.status!==t&&(this.status=t,this.dispatchEvent(new gt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function QP(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function e5(n,e,t=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",e&&r.searchParams.set("token",e),t)for(const[i,s]of o3(t))r.searchParams.set(i,s);return r.hash="",r.toString()}function t5(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const n5={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"artifact-focus":!0},r5=new Set(Object.keys(n5));function i5(n){return r5.has(n)}function s5(n){const e=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||!("type"in t)||typeof t.type!="string"?null:t}function o5(n){return n instanceof po&&n.status===KP}const a5="Local";var ct,Tt,gn,Rd,Id,cw,Ta,Ra,Ia,xa,Pa;class l5 extends zr{constructor(t){super();g(this,gn);$(this,"connection");$(this,"clientGUID");$(this,"acpStorage");$(this,"connectError",null);g(this,ct);g(this,Tt,!1);g(this,Ta,()=>{a(this,Tt)||(h(this,gn,cw).call(this),this.dispatchEvent(new gt("change")))});g(this,Ra,t=>{a(this,Tt)||this.dispatchEvent(new uc("server-event",{serverURL:t.serverURL,event:t.event}))});g(this,Ia,()=>{a(this,Tt)||this.dispatchEvent(new zo("channels-changed"))});g(this,xa,t=>{a(this,Tt)||this.dispatchEvent(new Sv("server-reconnected",{serverURL:t.serverURL}))});g(this,Pa,t=>{a(this,Tt)||this.dispatchEvent(new Av("server-status",{serverURL:t.serverURL,message:t.message}))});d(this,ct,t.localStore),this.acpStorage=t.acpStorage===void 0?lw():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?YP(this.acpStorage):ip().toLowerCase());const r=Rr(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&a(this,ct).set(zm(a(this,ct).get(),r,t.launchToken));const i=t.launchToken??Om(a(this,ct).get(),r),s=t.createSocket??(l=>new WebSocket(l)),o=t.createConnection??(l=>new XP(l));this.connection=o({url:r,name:t.connectionName??a5,token:i,createSocket:s,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:t.telemetryMeta??null,decideBoot:t.decideBoot,navigationPending:t.navigationPending}),this.connection.addEventListener("change",a(this,Ta)),this.connection.addEventListener("server-event",a(this,Ra)),this.connection.addEventListener("channels-changed",a(this,Ia)),this.connection.addEventListener("server-reconnected",a(this,xa)),this.connection.addEventListener("server-status",a(this,Pa))}get storedAuthToken(){return Om(a(this,ct).get(),this.connection.url)}async connect(){await h(this,gn,Rd).call(this,this.connection.token)}async authenticate(t){a(this,ct).set(zm(a(this,ct).get(),this.connection.url,t)),await h(this,gn,Rd).call(this,t)}dispose(){a(this,Tt)||(d(this,Tt,!0),this.connection.removeEventListener("change",a(this,Ta)),this.connection.removeEventListener("server-event",a(this,Ra)),this.connection.removeEventListener("channels-changed",a(this,Ia)),this.connection.removeEventListener("server-reconnected",a(this,xa)),this.connection.removeEventListener("server-status",a(this,Pa)),this.connection.dispose())}}ct=new WeakMap,Tt=new WeakMap,gn=new WeakSet,Rd=async function(t){if(!a(this,Tt)){h(this,gn,Id).call(this,null);try{await this.connection.connect(t)}catch(r){h(this,gn,Id).call(this,r instanceof yc?null:r instanceof Error?r.message:String(r))}}},Id=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new gt("change")))},cw=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=a(this,ct).get(),r=e4(t,this.connection.url);r!==t&&a(this,ct).set(r),this.connection.token!==null&&this.connection.clearToken()},Ta=new WeakMap,Ra=new WeakMap,Ia=new WeakMap,xa=new WeakMap,Pa=new WeakMap;const xd="tv-nav:",ro="tv-reload",mg=100,c5=1e3,u5=60,h5=60,d5=24,f5=30,p5=f5*d5*h5*u5*c5;function Wn(n){try{const e=new URL(n,window.location.href),t=e.searchParams.has(ro);return e.searchParams.delete(ro),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:t?e.toString():n}catch{return n}}var Da,Ts,he,ce,ai,ke,uw,er,hw,Pd,Dd;class m5 extends zr{constructor(t,r){super();g(this,ke);g(this,Da);g(this,Ts);g(this,he,[]);g(this,ce,-1);g(this,ai,0);d(this,Da,t),d(this,Ts,Wn(r)),h(this,ke,uw).call(this)}get currentURL(){var t;return a(this,ce)===-1?null:((t=a(this,he)[a(this,ce)])==null?void 0:t.url)??null}get canGoBack(){return a(this,ce)>-1}get canGoForward(){return a(this,ce)<a(this,he).length-1}get entries(){return a(this,he).map(t=>({...t}))}get cursor(){return a(this,ce)}navigate(t){const r=Wn(t);if(r===a(this,Ts)){if(a(this,ce)===-1)return;d(this,ce,-1),h(this,ke,er).call(this);return}a(this,ce)<a(this,he).length-1&&d(this,he,a(this,he).slice(0,a(this,ce)+1)),a(this,he).push({url:r}),d(this,ce,a(this,he).length-1),h(this,ke,Pd).call(this),h(this,ke,er).call(this)}replace(t){var i;if(a(this,ce)===-1){this.navigate(t);return}const r=Wn(t);if(r===a(this,Ts)){d(this,he,a(this,he).filter((s,o)=>o!==a(this,ce))),d(this,ce,-1),h(this,ke,er).call(this);return}((i=a(this,he)[a(this,ce)])==null?void 0:i.url)!==r&&(d(this,he,a(this,he).map((s,o)=>o===a(this,ce)?{url:r}:s)),h(this,ke,er).call(this))}back(){a(this,ce)!==-1&&(d(this,ce,a(this,ce)-1),h(this,ke,er).call(this))}forward(){this.canGoForward&&(d(this,ce,a(this,ce)+1),h(this,ke,er).call(this))}reset(){a(this,ce)===-1&&a(this,he).length===0||(d(this,he,[]),d(this,ce,-1),h(this,ke,er).call(this))}}Da=new WeakMap,Ts=new WeakMap,he=new WeakMap,ce=new WeakMap,ai=new WeakMap,ke=new WeakSet,uw=function(){const t=localStorage.getItem(a(this,ke,Dd));if(t!==null)try{const r=JSON.parse(t);if(!dw(r))return;d(this,he,r.entries.map(i=>({url:i.url}))),d(this,ce,r.cursor),d(this,ai,r.lastWritten),h(this,ke,Pd).call(this)}catch{d(this,he,[]),d(this,ce,-1),d(this,ai,0)}},er=function(){d(this,ai,Date.now());try{localStorage.setItem(a(this,ke,Dd),JSON.stringify(h(this,ke,hw).call(this)))}catch(t){if(!y5(t))throw t}this.dispatchEvent(new gt("change"))},hw=function(){return{v:1,entries:a(this,he).map(t=>({...t})),cursor:a(this,ce),lastWritten:a(this,ai)}},Pd=function(){if(a(this,he).length<=mg)return;const t=a(this,he).length-mg;d(this,he,a(this,he).slice(t)),d(this,ce,Math.max(-1,a(this,ce)-t))},Dd=function(){return g5(a(this,Da))};function g5(n){return`${xd}${n}`}function v5(n){const e=Date.now()-p5,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(xd)))continue;const s=i.slice(xd.length),o=localStorage.getItem(i);if(o===null)continue;let l;try{l=JSON.parse(o)}catch{t.push(i);continue}if(!dw(l)){t.push(i);continue}!n.has(s)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function y5(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function dw(n){if(typeof n!="object"||n===null)return!1;const e=n;if(e.v!==1||!Array.isArray(e.entries))return!1;const t=e.cursor;return typeof t!="number"||!Number.isInteger(t)||typeof e.lastWritten!="number"||!Number.isFinite(e.lastWritten)||t<-1||t>=e.entries.length?!1:e.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const w5="0.1.210";function pp(n=w5){return n!==void 0&&n.length>0?n:"0.0.0"}function mp(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const Ld="tv-reload-attempted";function b5(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:$E(n.bundleVersion,n.serverVersion)?n.marker!==null&&n.marker.serverVersion===n.serverVersion?{action:"none"}:{action:"reload",marker:{serverVersion:n.serverVersion,fromVersion:n.bundleVersion}}:{action:"none"}:{action:"none"}}function _5(n){const e=n.getItem(Ld);if(e===null)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const r=t;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function S5(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??mp(),i=n.bundleVersion??pp();if(e===null)return{dispose(){}};let s=null;const o=()=>{if(s===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const f=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=u=>{if(r.pending)return;const f=b5({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:_5(e)});switch(f.action){case"reload":e.setItem(Ld,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(Ld),s={fromVersion:f.fromVersion,toVersion:f.toVersion},o();return;case"none":return}},c=()=>{o()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function A5(n){const e=jn(n.search),t=uy(n.search),r=t!==null&&rp(t)?t:null;return{electron:e,shellVersion:r}}function k5(n){return!n.electron||n.requiredDesktopVersion===null||!rp(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===ld?!1:fv(n.requiredDesktopVersion,n.shellVersion)}const E5=`# Desktop app upgrade required
|
|
44
44
|
|
|
45
45
|
Your Television server requires a newer version of this desktop app.
|
|
46
46
|
In a terminal, please upgrade:
|
|
@@ -53,34 +53,34 @@ Then quit this app, and relaunch it from the terminal with:
|
|
|
53
53
|
|
|
54
54
|
\`\`\`bash
|
|
55
55
|
tv-desktop
|
|
56
|
-
\`\`\``;function
|
|
56
|
+
\`\`\``;function fw(n){return n===null?E5:n.upgradeMarkdown}function $5(n){const e=k5(n);return{gated:e,instructionsMarkdown:e?fw(n.desktop):null,suppressUpdateToast:e}}function C5(n){const e=n.reload??(()=>location.reload()),t=n.navigationLatch??mp();let r=null,i=!1;const s=new Set,o=f=>{var m;return $5({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((m=f.update)==null?void 0:m.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const m=f.requiredDesktopVersion;if(m===null||s.has(m))return;s.add(m);const v=r==null?void 0:r.connection;(v==null?void 0:v.url)===n.primaryServerURL&&v.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:m})}const u=f=>{t.pending||f.serverURL===n.primaryServerURL&&(o(f.message).gated?(i=!0,l(),c(f.message)):i&&t.begin(e))};return{get gated(){return i},decideBoot(f){return o(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var Rs;class T5 extends zr{constructor(){super(...arguments);g(this,Rs,!1)}get toastsSuppressed(){return a(this,Rs)}suppressToasts(){a(this,Rs)||(d(this,Rs,!0),this.dispatchEvent(new gt("change")))}}Rs=new WeakMap;function pw(n){return typeof n=="object"&&n!==null}function mw(n){return!pw(n)||n.type!=="ready"?!1:!("id"in n)}function gw(n){return!(!pw(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const vw=Lt(),yw="No handler registered for update-content",ww="handleUpdateContent: handler already registered",gg="television-artifact-bridge";function bw(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const _w=jy(zr);var Is,xs,Ps,li,ci,La,De,Od,Sw,Aw,Uo,zd,c1;let R5=(c1=class extends _w{constructor(t){super();g(this,De);g(this,Is);g(this,xs);g(this,Ps);g(this,li,null);g(this,ci,null);g(this,La,!1);d(this,Is,t);const r=t.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,xs,r),d(this,Ps,i=>h(this,De,Sw).call(this,i)),a(this,xs).addEventListener("message",a(this,Ps))}get content(){return a(this,ci)}set content(t){h(this,De,zd).call(this),d(this,ci,t),a(this,La)&&h(this,De,Od).call(this,t)}handleUpdateContent(t){if(h(this,De,zd).call(this),a(this,li)!==null)throw new Error(ww);d(this,li,t)}dispose(){a(this,xs).removeEventListener("message",a(this,Ps)),d(this,li,null)}},Is=new WeakMap,xs=new WeakMap,Ps=new WeakMap,li=new WeakMap,ci=new WeakMap,La=new WeakMap,De=new WeakSet,Od=function(t){const r={type:"content-updated",content:t};h(this,De,Uo).call(this,r)},Sw=function(t){if(this.disposed||t.source!==a(this,Is).contentWindow)return;const r=t.data;if(mw(r)){d(this,La,!0),this.dispatchEvent(new vw("ready")),a(this,ci)!==null&&h(this,De,Od).call(this,a(this,ci));return}if(gw(r)){h(this,De,Aw).call(this,r);return}},Aw=async function(t){const r=a(this,li);if(r===null){h(this,De,Uo).call(this,{type:"response",id:t.id,error:{message:yw}});return}try{await r(t.content)}catch(i){if(this.disposed)return;h(this,De,Uo).call(this,{type:"response",id:t.id,error:{message:bw(i)}});return}this.disposed||h(this,De,Uo).call(this,{type:"response",id:t.id,result:{}})},Uo=function(t){const r=a(this,Is).contentWindow;r&&r.postMessage(t,"*")},zd=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},c1);var ui,Ds,hi,di,Oa,Le,Nd,kw,Ew,Zo,Md;class I5 extends _w{constructor(t){super();g(this,Le);g(this,ui);g(this,Ds);g(this,hi,null);g(this,di,null);g(this,Oa,!1);d(this,ui,t),d(this,Ds,r=>h(this,Le,kw).call(this,r)),a(this,ui).addEventListener("ipc-message",a(this,Ds))}get content(){return a(this,di)}set content(t){h(this,Le,Md).call(this),d(this,di,t),a(this,Oa)&&h(this,Le,Nd).call(this,t)}handleUpdateContent(t){if(h(this,Le,Md).call(this),a(this,hi)!==null)throw new Error(ww);d(this,hi,t)}dispose(){a(this,ui).removeEventListener("ipc-message",a(this,Ds)),d(this,hi,null)}}ui=new WeakMap,Ds=new WeakMap,hi=new WeakMap,di=new WeakMap,Oa=new WeakMap,Le=new WeakSet,Nd=function(t){const r={type:"content-updated",content:t};h(this,Le,Zo).call(this,r)},kw=function(t){var s;if(this.disposed)return;const r=t.detail??t;if(!r||r.channel!==gg)return;const i=(s=r.args)==null?void 0:s[0];if(mw(i)){d(this,Oa,!0),this.dispatchEvent(new vw("ready")),a(this,di)!==null&&h(this,Le,Nd).call(this,a(this,di));return}if(gw(i)){h(this,Le,Ew).call(this,i);return}},Ew=async function(t){const r=a(this,hi);if(r===null){h(this,Le,Zo).call(this,{type:"response",id:t.id,error:{message:yw}});return}try{await r(t.content)}catch(i){if(this.disposed)return;h(this,Le,Zo).call(this,{type:"response",id:t.id,error:{message:bw(i)}});return}this.disposed||h(this,Le,Zo).call(this,{type:"response",id:t.id,result:{}})},Zo=function(t){var r,i;(i=(r=a(this,ui)).send)==null||i.call(r,gg,t)},Md=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
|
|
57
57
|
* @license
|
|
58
58
|
* Copyright 2017 Google LLC
|
|
59
59
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
-
*/const
|
|
61
|
-
\f\r]`,
|
|
62
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
60
|
+
*/const ra=globalThis,vg=n=>n,Bc=ra.trustedTypes,yg=Bc?Bc.createPolicy("lit-html",{createHTML:n=>n}):void 0,$w="$lit$",tr=`lit$${Math.random().toFixed(9).slice(2)}$`,Cw="?"+tr,x5=`<${Cw}>`,Ui=document,ua=()=>Ui.createComment(""),ha=n=>n===null||typeof n!="object"&&typeof n!="function",gp=Array.isArray,P5=n=>gp(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Zh=`[
|
|
61
|
+
\f\r]`,Eo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wg=/-->/g,bg=/>/g,Fr=RegExp(`>|${Zh}(?:([^\\s"'>=/]+)(${Zh}*=${Zh}*(?:[^
|
|
62
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),_g=/'/g,Sg=/"/g,Tw=/^(?:script|style|textarea|title)$/i,D5=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),V=D5(1),Pt=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),Ag=new WeakMap,Jr=Ui.createTreeWalker(Ui,129);function Rw(n,e){if(!gp(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return yg!==void 0?yg.createHTML(e):e}const L5=(n,e)=>{const t=n.length-1,r=[];let i,s=e===2?"<svg>":e===3?"<math>":"",o=Eo;for(let l=0;l<t;l++){const c=n[l];let u,f,m=-1,v=0;for(;v<c.length&&(o.lastIndex=v,f=o.exec(c),f!==null);)v=o.lastIndex,o===Eo?f[1]==="!--"?o=wg:f[1]!==void 0?o=bg:f[2]!==void 0?(Tw.test(f[2])&&(i=RegExp("</"+f[2],"g")),o=Fr):f[3]!==void 0&&(o=Fr):o===Fr?f[0]===">"?(o=i??Eo,m=-1):f[1]===void 0?m=-2:(m=o.lastIndex-f[2].length,u=f[1],o=f[3]===void 0?Fr:f[3]==='"'?Sg:_g):o===Sg||o===_g?o=Fr:o===wg||o===bg?o=Eo:(o=Fr,i=void 0);const y=o===Fr&&n[l+1].startsWith("/>")?" ":"";s+=o===Eo?c+x5:m>=0?(r.push(u),c.slice(0,m)+$w+c.slice(m)+tr+y):c+tr+(m===-2?l:y)}return[Rw(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class da{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,o=0;const l=e.length-1,c=this.parts,[u,f]=L5(e,t);if(this.el=da.createElement(u,r),Jr.currentNode=this.el.content,t===2||t===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Jr.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith($w)){const v=f[o++],y=i.getAttribute(m).split(tr),k=/([.?@])?(.*)/.exec(v);c.push({type:1,index:s,name:k[2],strings:y,ctor:k[1]==="."?z5:k[1]==="?"?N5:k[1]==="@"?M5:Nu}),i.removeAttribute(m)}else m.startsWith(tr)&&(c.push({type:6,index:s}),i.removeAttribute(m));if(Tw.test(i.tagName)){const m=i.textContent.split(tr),v=m.length-1;if(v>0){i.textContent=Bc?Bc.emptyScript:"";for(let y=0;y<v;y++)i.append(m[y],ua()),Jr.nextNode(),c.push({type:2,index:++s});i.append(m[v],ua())}}}else if(i.nodeType===8)if(i.data===Cw)c.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(tr,m+1))!==-1;)c.push({type:7,index:s}),m+=tr.length-1}s++}}static createElement(e,t){const r=Ui.createElement("template");return r.innerHTML=e,r}}function io(n,e,t=n,r){var o,l;if(e===Pt)return e;let i=r!==void 0?(o=t._$Co)==null?void 0:o[r]:t._$Cl;const s=ha(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),s===void 0?i=void 0:(i=new s(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=io(n,i._$AS(n,e.values),i,r)),e}class O5{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,i=((e==null?void 0:e.creationScope)??Ui).importNode(t,!0);Jr.currentNode=i;let s=Jr.nextNode(),o=0,l=0,c=r[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new zu(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new U5(s,this,e)),this._$AV.push(u),c=r[++l]}o!==(c==null?void 0:c.index)&&(s=Jr.nextNode(),o++)}return Jr.currentNode=Ui,i}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}let zu=class Iw{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=ue,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=io(this,e,t),ha(e)?e===ue||e==null||e===""?(this._$AH!==ue&&this._$AR(),this._$AH=ue):e!==this._$AH&&e!==Pt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):P5(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ue&&ha(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ui.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=da.createElement(Rw(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{const o=new O5(i,this),l=o.u(this.options);o.p(t),this.T(l),this._$AH=o}}_$AC(e){let t=Ag.get(e.strings);return t===void 0&&Ag.set(e.strings,t=new da(e)),t}k(e){gp(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const s of e)i===t.length?t.push(r=new Iw(this.O(ua()),this.O(ua()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){const i=vg(e).nextSibling;vg(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Nu=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=ue,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ue}_$AI(e,t=this,r,i){const s=this.strings;let o=!1;if(s===void 0)e=io(this,e,t,0),o=!ha(e)||e!==this._$AH&&e!==Pt,o&&(this._$AH=e);else{const l=e;let c,u;for(e=s[0],c=0;c<s.length-1;c++)u=io(this,l[r+c],t,c),u===Pt&&(u=this._$AH[c]),o||(o=!ha(u)||u!==this._$AH[c]),u===ue?e=ue:e!==ue&&(e+=(u??"")+s[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===ue?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},z5=class extends Nu{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ue?void 0:e}},N5=class extends Nu{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ue)}},M5=class extends Nu{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){if((e=io(this,e,t,0)??ue)===Pt)return;const r=this._$AH,i=e===ue&&r!==ue||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==ue&&(r===ue||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}};class U5{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){io(this,e)}}const Z5={I:zu},Fh=ra.litHtmlPolyfillSupport;Fh==null||Fh(da,zu),(ra.litHtmlVersions??(ra.litHtmlVersions=[])).push("3.3.2");const wc=(n,e,t)=>{const r=e;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new zu(e.insertBefore(ua(),null),null,void 0,{})),i._$AI(n),i};/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2020 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const{I:
|
|
66
|
+
*/const{I:F5}=Z5,kg=n=>n,H5=n=>n.strings===void 0,Eg=()=>document.createComment(""),$o=(n,e,t)=>{var s;const r=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const o=r.insertBefore(Eg(),i),l=r.insertBefore(Eg(),i);t=new F5(o,l,n,n.options)}else{const o=t._$AB.nextSibling,l=t._$AM,c=l!==n;if(c){let u;(s=t._$AQ)==null||s.call(t,n),t._$AM=n,t._$AP!==void 0&&(u=n._$AU)!==l._$AU&&t._$AP(u)}if(o!==i||c){let u=t._$AA;for(;u!==o;){const f=kg(u).nextSibling;kg(r).insertBefore(u,i),u=f}}}return t},Hr=(n,e,t=n)=>(n._$AI(e,t),n),V5={},B5=(n,e=V5)=>n._$AH=e,q5=n=>n._$AH,Hh=n=>{n._$AR(),n._$AA.remove()};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const Mu={ATTRIBUTE:1,CHILD:2},Al=n=>(...e)=>({_$litDirective$:n,values:e});let Uu=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2017 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const
|
|
75
|
-
id=${a(this,
|
|
74
|
+
*/const ia=(n,e)=>{var r;const t=n._$AN;if(t===void 0)return!1;for(const i of t)(r=i._$AO)==null||r.call(i,e,!1),ia(i,e);return!0},qc=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},xw=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),G5(e)}};function j5(n){this._$AN!==void 0?(qc(this),this._$AM=n,xw(this)):this._$AM=n}function W5(n,e=!1,t=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)ia(r[s],!1),qc(r[s]);else r!=null&&(ia(r,!1),qc(r));else ia(this,n)}const G5=n=>{n.type==Mu.CHILD&&(n._$AP??(n._$AP=W5),n._$AQ??(n._$AQ=j5))};class Pw extends Uu{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),xw(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(ia(this,e),qc(this))}setValue(e){if(H5(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}var za,Na,lr,fi;class At extends Pw{constructor(){super(...arguments);g(this,za,[]);g(this,Na,!1);g(this,lr,!1);g(this,fi,!1)}connected(){}template(...t){return Pt}render(...t){return!this.isConnected||a(this,lr)||this.setValue(t.length?t[0]:this.template(...a(this,za))),Pt}update(t,r){d(this,za,r),d(this,fi,!1),d(this,lr,!0);try{return a(this,Na)||(d(this,Na,!0),this.connected()),this.template(...r)}finally{d(this,lr,!1)}}reconnected(){d(this,lr,!0);try{this.connected()}finally{d(this,lr,!1)}d(this,fi,!0),queueMicrotask(()=>{a(this,fi)&&(d(this,fi,!1),this.render())})}}za=new WeakMap,Na=new WeakMap,lr=new WeakMap,fi=new WeakMap;function kt(n){return Al(n)}function Y5(n,e){var r;const t=n.connection;return t.authorizationRequired?t.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:t.gateHalted?{kind:"needs-upgrade",instructions:t.upgradeInstructions}:t.status!=="connected"?t.hasEverConnected?{kind:"disconnected",nextRetryAt:t.nextRetryAt}:t.firstConnectError!==null?{kind:"error",serverURL:e,message:t.firstConnectError}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}function Zu(n,{overlay:e=!1}={}){const t=V`<dialog open>${n}</dialog>`;return e?V`<div class="dialog-overlay">${t}</div>`:t}function Fu(n,e){let t=!1;const r=s=>{s.preventDefault(),e("escape")},i=s=>{if(s.target!==n)return;const o=n.getBoundingClientRect();s.clientX>=o.left&&s.clientX<=o.right&&s.clientY>=o.top&&s.clientY<=o.bottom||e("backdrop")};return n.addEventListener("cancel",r),n.addEventListener("click",i),n.removeAttribute("open"),n.showModal(),{withdraw(){t||(t=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}let K5=0;function J5(n){return"separator"in n}function Dw(n){return[...n.querySelectorAll(".menu-item")]}function X5(n){var e;n.newState!=="open"||!(n.currentTarget instanceof HTMLElement)||(e=Dw(n.currentTarget)[0])==null||e.focus()}function Q5(n){var i;if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||!(n.currentTarget instanceof HTMLElement))return;n.preventDefault();const e=Dw(n.currentTarget),t=e.indexOf(document.activeElement),r=n.key==="ArrowDown"?Math.min(t+1,e.length-1):Math.max(t-1,0);(i=e[r])==null||i.focus()}var Ma;class eD extends At{constructor(){super(...arguments);g(this,Ma,`menu-${++K5}`)}template(t,{placement:r="bottom-start",trigger:i}){return V`${i(a(this,Ma))}<div
|
|
75
|
+
id=${a(this,Ma)}
|
|
76
76
|
popover
|
|
77
77
|
placement=${r}
|
|
78
78
|
class="menu"
|
|
79
79
|
role="menu"
|
|
80
|
-
@toggle=${
|
|
81
|
-
@keydown=${
|
|
80
|
+
@toggle=${X5}
|
|
81
|
+
@keydown=${Q5}
|
|
82
82
|
>
|
|
83
|
-
${t.map(s=>
|
|
83
|
+
${t.map(s=>J5(s)?V`<hr class="menu-separator" />`:V`<button
|
|
84
84
|
class=${s.destructive?"menu-item destructive":"menu-item"}
|
|
85
85
|
full-row
|
|
86
86
|
role="menuitem"
|
|
@@ -88,33 +88,33 @@ tv-desktop
|
|
|
88
88
|
>
|
|
89
89
|
${s.label}
|
|
90
90
|
</button>`)}
|
|
91
|
-
</div>`}}
|
|
91
|
+
</div>`}}Ma=new WeakMap;const Lw=kt(eD);/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2020 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/const Cr=()=>new
|
|
95
|
+
*/const Cr=()=>new tD;class tD{}const Vh=new WeakMap,mn=Al(class extends Pw{render(n){return ue}update(n,[e]){var r;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),ue}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Vh.get(e);t===void 0&&(t=new WeakMap,Vh.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,e;return typeof this.G=="function"?(n=Vh.get(this.ht??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
-
*/const
|
|
99
|
+
*/const $g=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},jc=Al(class extends Uu{constructor(n){if(super(n),n.type!==Mu.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const i=[],s=[];let o=0;for(const l of n)i[o]=r?r(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=q5(n),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=o,s;const l=this.ut??(this.ut=[]),c=[];let u,f,m=0,v=i.length-1,y=0,k=s.length-1;for(;m<=v&&y<=k;)if(i[m]===null)m++;else if(i[v]===null)v--;else if(l[m]===o[y])c[y]=Hr(i[m],s[y]),m++,y++;else if(l[v]===o[k])c[k]=Hr(i[v],s[k]),v--,k--;else if(l[m]===o[k])c[k]=Hr(i[m],s[k]),$o(n,c[k+1],i[m]),m++,k--;else if(l[v]===o[y])c[y]=Hr(i[v],s[y]),$o(n,i[m],i[v]),v--,y++;else if(u===void 0&&(u=$g(o,y,k),f=$g(l,m,v)),u.has(l[m]))if(u.has(l[v])){const S=f.get(o[y]),x=S!==void 0?i[S]:null;if(x===null){const M=$o(n,i[m]);Hr(M,s[y]),c[y]=M}else c[y]=Hr(x,s[y]),$o(n,i[m],x),i[S]=null;y++}else Hh(i[v]),v--;else Hh(i[m]),m++;for(;y<=k;){const S=$o(n,c[k+1]);Hr(S,s[y]),c[y++]=S}for(;m<=v;){const S=i[m++];S!==null&&Hh(S)}return this.ut=o,B5(n,c),Pt}});/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2018 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/const Rw="important",J5=" !"+Rw,qc=_l(class extends Nu{constructor(n){var e;if(super(n),n.type!==zu.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const i=e[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(J5);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?Rw:""):t[r]=i}}return Pt}}),X5=24;function Q5(n){return!_g(n.source)||!_g(n.current)||!oD(n.source,n.current)||!aD(n)||!sD(n.geometry)?{kind:"invalidated"}:nD(n.pointer,n.geometry)==="pinned"?eD(n):tD(n)}function eD(n){var c;const{source:e,current:t,pointer:r,geometry:i}=n,o=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??rD(r.y,i.pinnedRows),l=t.pinnedChannelIds.filter(u=>u!==e.channelId);return l.splice(o,0,e.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:o},operation:l}}function tD(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?iD(t.unpinnedChannelIds,e.channelId):e.unpinnedChannelIds.indexOf(e.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&t.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?t.pinnedChannelIds.filter(s=>s!==e.channelId):null}}function nD(n,e){const{sidebar:t}=e;if(n.x<t.left||n.x>t.right||n.y<t.top||n.y>t.bottom)return"unpinned";const i=e.unpinnedGroupTop??(e.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:e.pinnedContentBottom+X5);return n.y<i?"pinned":"unpinned"}function rD(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function iD(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function sD(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function _g(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function oD(n,e){return Od(n.pinnedChannelIds,e.pinnedChannelIds)&&Od(n.unpinnedChannelIds,e.unpinnedChannelIds)}function aD(n){const e=n.current.pinnedChannelIds.filter(s=>s!==n.source.channelId),t=n.geometry.pinnedRows.map(({channelId:s})=>s),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?e.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&Od(e,t)&&i}function Od(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const lD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',cD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',uD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',hD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',dD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',fD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',pD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',mD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',gD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',vD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',yD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',wD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',bD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',_D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',SD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',AD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',kD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',ED='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',$D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',CD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',TD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',RD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',ID='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',xD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',PD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',DD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',LD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',OD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',zD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',ND='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',MD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',UD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',ZD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',FD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',HD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',VD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',BD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',jD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',qD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',WD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',GD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',YD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',KD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',JD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',XD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',QD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',eL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',tL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',nL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',rL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',iL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',sL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',oL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',aL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',lL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',cL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',uL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',hL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',dL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',fL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',pL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',mL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',gL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',vL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',yL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',wL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',bL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',_L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',SL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',AL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',kL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',EL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',$L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',CL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',TL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',RL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',IL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',xL=':host{display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]){font-size:16px}:host([size="md"]){font-size:20px}:host([size="lg"]){font-size:24px}:host([size="xl"]){font-size:32px}tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}tv-icon:not(:defined)[size=sm]{font-size:16px}tv-icon:not(:defined)[size=md]{font-size:20px}tv-icon:not(:defined)[size=lg]{font-size:24px}tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media (prefers-reduced-motion: reduce){:host([spinning])>svg{animation:none}}',Iw=new CSSStyleSheet;Iw.replaceSync(xL);const xw={check:lD,close:cD,copy:uD,pin:hD,search:dD,add:fD,more:pD,settings:mD,expand:gD,collapse:vD,"collapse-up":yD,skills:wD,notification:bD,artifact:_D,spinner:SD,locked:AD,unpin:kD,back:ED,forward:$D,television:CD,calendar:TD,grid:RD,hash:ID,delete:xD,edit:PD,link:DD,external:LD,download:OD,reload:zD,warning:ND,info:MD,file:UD,folder:ZD,clock:FD,user:HD,upload:VD,star:BD,home:jD,send:qD,filter:WD,sort:GD,help:YD,chart:KD,image:JD,chat:XD,location:QD,play:eL,pause:tL,stop:nL,video:rL,music:iL,error:sL,email:oL,phone:aL,web:lL,tag:cL,bookmark:uL,table:hL,code:dL,group:fL,up:pL,down:mL,money:gL,bank:vL,card:yL,wallet:wL,gauge:bL,activity:_L,"trend-up":SL,"trend-down":AL,database:kL,server:EL,deploy:$L,list:CL,terminal:TL,branch:RL,shield:IL};function PL(n){return n!==null&&Object.hasOwn(xw,n)}var Na,zd;class Pw extends HTMLElement{constructor(){super(...arguments);v(this,Na)}connectedCallback(){h(this,Na,zd).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Na,zd).call(this)}}Na=new WeakSet,zd=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[Iw],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=PL(r)?xw[r]:""},$(Pw,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",Pw);const Nd=4,ps=200,vt=28,Wc=800,Bl="ease",Sg=.5,$o=.5,DL="New channel",ts=".channel-group:not(.channel-group-withdrawal) .channel-row",LL=24;var rt,Ye,it,Xt,pi,_e,ie,ut,Qt,ht,Ke,dt,cr,en,tn,Ls,Os,zs,R,Md,Dw,Lw,nu,Ow,zw,yc,Nw,Mw,Uw,Zw,Ud,Zd,Zo,ru,iu,su,ou,Fw,Fd,Hw,Ma,Vw,Bw,Fo,Hd,jw,qw,Ho,Vd,Bd,jd,Ww,wc,Ua,Za,Fa,Ha,Gw,qd,bc,_c,Vo,Yw,Wd,au;class OL extends At{constructor(){super(...arguments);v(this,R);v(this,rt,null);v(this,Ye,null);v(this,it,null);v(this,Xt,"");v(this,pi,!1);v(this,_e,null);v(this,ie,null);v(this,ut,null);v(this,Qt,null);v(this,ht,null);v(this,Ke,null);v(this,dt,null);v(this,cr,null);v(this,en,null);v(this,tn,null);v(this,Ls,Cr());v(this,Os,Cr());v(this,zs,Cr());v(this,nu,()=>{const t=a(this,rt),r=a(this,Ye);if(t===null||r===null||a(this,ut)!==null)return;const i={resultChannelId:null};d(this,ut,i),this.render(),t.createChannel(DL).then(s=>{i.resultChannelId=s.id,t.focusChannel(s.id).catch(()=>{}),a(this,ut)===i&&this.render()},()=>{a(this,ut)!==i||a(this,Qt)!==null||(d(this,ut,null),this.render())})});v(this,ru,t=>{d(this,Xt,t.currentTarget.value)});v(this,iu,t=>{t.key==="Enter"?(t.preventDefault(),h(this,R,Zo).call(this,!0)):t.key==="Escape"&&(t.preventDefault(),h(this,R,Zo).call(this,!1))});v(this,su,()=>{h(this,R,Zo).call(this,!0)});v(this,ou,t=>{t.preventDefault(),h(this,R,Zo).call(this,!0)});v(this,Ma,t=>{const r=a(this,ie);if(r!==null){if(r.pointerId!==t.pointerId)return;t.preventDefault(),h(this,R,Fo).call(this,r,t);return}const i=a(this,_e);if(!(i===null||i.pointerId!==t.pointerId)){if(t.buttons===0){d(this,_e,null);return}Math.hypot(t.clientX-i.x,t.clientY-i.y)<=Nd||h(this,R,Vw).call(this,i,t)}});v(this,Ua,t=>{var s;const r=a(this,ie);if(r!==null&&r.pointerId===t.pointerId){if(r.completed)return;const o=r.captureTarget.hasPointerCapture(t.pointerId);h(this,R,Fo).call(this,r,t);const l=o&&r.placement.kind==="placement"?r.placement.operation:null,c=a(this,rt);if(l===null||c===null){h(this,R,Vo).call(this,r,!1);return}r.completed=!0,h(this,R,Ho).call(this,r),r.operation=[...l],c.setPinnedChannelIds([...l]).then(()=>{a(this,ie)===r&&(r.operationResolved=!0,h(this,R,qd).call(this,a(this,Ye)))},()=>{a(this,ie)===r&&(r.operationResolved=!0,r.operationRejected=!0,h(this,R,bc).call(this,r))});return}const i=a(this,_e);d(this,_e,null),!(i===null||i.pointerId!==t.pointerId||Math.hypot(t.clientX-i.x,t.clientY-i.y)>Nd)&&((s=a(this,rt))==null||s.focusChannel(i.channelId).catch(()=>{}))});v(this,Za,t=>{var r,i;((r=a(this,ie))==null?void 0:r.pointerId)===t.pointerId&&!a(this,ie).completed?h(this,R,_c).call(this):((i=a(this,_e))==null?void 0:i.pointerId)===t.pointerId&&d(this,_e,null)});v(this,Fa,t=>{const r=a(this,ie);r===null||r.pointerId!==t.pointerId||r.completed||h(this,R,Vo).call(this,r,!1)});v(this,Ha,t=>{t.key!=="Escape"||a(this,ie)===null||a(this,ie).completed||(t.preventDefault(),h(this,R,_c).call(this))});v(this,au,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){window.addEventListener("pointermove",a(this,Ma)),window.addEventListener("pointerup",a(this,Ua)),window.addEventListener("pointercancel",a(this,Za)),window.addEventListener("lostpointercapture",a(this,Fa)),window.addEventListener("keydown",a(this,Ha))}template(t,r,i){var l;const s=a(this,Ye);d(this,rt,t),d(this,Ye,r),h(this,R,Gw).call(this,r),h(this,R,Ow).call(this,r),h(this,R,Uw).call(this,s,r),a(this,it)!==null&&!r.channels.some(({id:c})=>c===a(this,it))&&(d(this,it,null),d(this,Xt,"")),h(this,R,qd).call(this,r);const o=h(this,R,Zw).call(this,Ag(r,(l=a(this,ie))==null?void 0:l.source));return V`
|
|
103
|
+
*/const Ow="important",nD=" !"+Ow,Wc=Al(class extends Uu{constructor(n){var e;if(super(n),n.type!==Mu.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const i=e[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(nD);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?Ow:""):t[r]=i}}return Pt}}),rD=24;function iD(n){return!Cg(n.source)||!Cg(n.current)||!hD(n.source,n.current)||!dD(n)||!uD(n.geometry)?{kind:"invalidated"}:aD(n.pointer,n.geometry)==="pinned"?sD(n):oD(n)}function sD(n){var c;const{source:e,current:t,pointer:r,geometry:i}=n,o=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??lD(r.y,i.pinnedRows),l=t.pinnedChannelIds.filter(u=>u!==e.channelId);return l.splice(o,0,e.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:o},operation:l}}function oD(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?cD(t.unpinnedChannelIds,e.channelId):e.unpinnedChannelIds.indexOf(e.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&t.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?t.pinnedChannelIds.filter(s=>s!==e.channelId):null}}function aD(n,e){const{sidebar:t}=e;if(n.x<t.left||n.x>t.right||n.y<t.top||n.y>t.bottom)return"unpinned";const i=e.unpinnedGroupTop??(e.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:e.pinnedContentBottom+rD);return n.y<i?"pinned":"unpinned"}function lD(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function cD(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function uD(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function Cg(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function hD(n,e){return Ud(n.pinnedChannelIds,e.pinnedChannelIds)&&Ud(n.unpinnedChannelIds,e.unpinnedChannelIds)}function dD(n){const e=n.current.pinnedChannelIds.filter(s=>s!==n.source.channelId),t=n.geometry.pinnedRows.map(({channelId:s})=>s),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?e.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&Ud(e,t)&&i}function Ud(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const fD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',pD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',mD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',gD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',vD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',yD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',wD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',bD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',_D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',SD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',AD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',kD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',ED='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',$D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',CD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',TD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',RD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',ID='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',xD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',PD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',DD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',LD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',OD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',zD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',ND='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',MD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',UD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',ZD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',FD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',HD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',VD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',BD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',qD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',jD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',WD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',GD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',YD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',KD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',JD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',XD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',QD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',eL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',tL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',nL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',rL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',iL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',sL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',oL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',aL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',lL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',cL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',uL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',hL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',dL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',fL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',pL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',mL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',gL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',vL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',yL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',wL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',bL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',_L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',SL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',AL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',kL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',EL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',$L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',CL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',TL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',RL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',IL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',xL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',PL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',DL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',LL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',OL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',zL=':host{display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]){font-size:16px}:host([size="md"]){font-size:20px}:host([size="lg"]){font-size:24px}:host([size="xl"]){font-size:32px}tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}tv-icon:not(:defined)[size=sm]{font-size:16px}tv-icon:not(:defined)[size=md]{font-size:20px}tv-icon:not(:defined)[size=lg]{font-size:24px}tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media (prefers-reduced-motion: reduce){:host([spinning])>svg{animation:none}}',zw=new CSSStyleSheet;zw.replaceSync(zL);const Nw={check:fD,close:pD,copy:mD,pin:gD,search:vD,add:yD,more:wD,settings:bD,expand:_D,collapse:SD,"collapse-up":AD,skills:kD,notification:ED,artifact:$D,spinner:CD,locked:TD,unpin:RD,back:ID,forward:xD,television:PD,calendar:DD,grid:LD,hash:OD,delete:zD,edit:ND,link:MD,external:UD,download:ZD,reload:FD,warning:HD,info:VD,file:BD,folder:qD,clock:jD,user:WD,upload:GD,star:YD,home:KD,send:JD,filter:XD,sort:QD,help:eL,chart:tL,image:nL,chat:rL,location:iL,play:sL,pause:oL,stop:aL,video:lL,music:cL,error:uL,email:hL,phone:dL,web:fL,tag:pL,bookmark:mL,table:gL,code:vL,group:yL,up:wL,down:bL,money:_L,bank:SL,card:AL,wallet:kL,gauge:EL,activity:$L,"trend-up":CL,"trend-down":TL,database:RL,server:IL,deploy:xL,list:PL,terminal:DL,branch:LL,shield:OL};function NL(n){return n!==null&&Object.hasOwn(Nw,n)}var Ua,Zd;class Mw extends HTMLElement{constructor(){super(...arguments);g(this,Ua)}connectedCallback(){h(this,Ua,Zd).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Ua,Zd).call(this)}}Ua=new WeakSet,Zd=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[zw],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=NL(r)?Nw[r]:""},$(Mw,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",Mw);const Fd=4,ps=200,vt=28,Gc=800,jl="ease",Tg=.5,Co=.5,ML="New channel",ts=".channel-group:not(.channel-group-withdrawal) .channel-row",UL=24;var rt,Ye,it,Xt,pi,_e,ie,ut,Qt,ht,Ke,dt,cr,en,tn,Ls,Os,zs,R,Hd,Uw,Zw,ru,Fw,Hw,bc,Vw,Bw,qw,jw,Vd,Bd,Fo,iu,su,ou,au,Ww,qd,Gw,Za,Yw,Kw,Ho,jd,Jw,Xw,Vo,Wd,Gd,Yd,Qw,_c,Fa,Ha,Va,Ba,e2,Kd,Sc,Ac,Bo,t2,Jd,lu;class ZL extends At{constructor(){super(...arguments);g(this,R);g(this,rt,null);g(this,Ye,null);g(this,it,null);g(this,Xt,"");g(this,pi,!1);g(this,_e,null);g(this,ie,null);g(this,ut,null);g(this,Qt,null);g(this,ht,null);g(this,Ke,null);g(this,dt,null);g(this,cr,null);g(this,en,null);g(this,tn,null);g(this,Ls,Cr());g(this,Os,Cr());g(this,zs,Cr());g(this,ru,()=>{const t=a(this,rt),r=a(this,Ye);if(t===null||r===null||a(this,ut)!==null)return;const i={resultChannelId:null};d(this,ut,i),this.render(),t.createChannel(ML).then(s=>{i.resultChannelId=s.id,t.focusChannel(s.id).catch(()=>{}),a(this,ut)===i&&this.render()},()=>{a(this,ut)!==i||a(this,Qt)!==null||(d(this,ut,null),this.render())})});g(this,iu,t=>{d(this,Xt,t.currentTarget.value)});g(this,su,t=>{t.key==="Enter"?(t.preventDefault(),h(this,R,Fo).call(this,!0)):t.key==="Escape"&&(t.preventDefault(),h(this,R,Fo).call(this,!1))});g(this,ou,()=>{h(this,R,Fo).call(this,!0)});g(this,au,t=>{t.preventDefault(),h(this,R,Fo).call(this,!0)});g(this,Za,t=>{const r=a(this,ie);if(r!==null){if(r.pointerId!==t.pointerId)return;t.preventDefault(),h(this,R,Ho).call(this,r,t);return}const i=a(this,_e);if(!(i===null||i.pointerId!==t.pointerId)){if(t.buttons===0){d(this,_e,null);return}Math.hypot(t.clientX-i.x,t.clientY-i.y)<=Fd||h(this,R,Yw).call(this,i,t)}});g(this,Fa,t=>{var s;const r=a(this,ie);if(r!==null&&r.pointerId===t.pointerId){if(r.completed)return;const o=r.captureTarget.hasPointerCapture(t.pointerId);h(this,R,Ho).call(this,r,t);const l=o&&r.placement.kind==="placement"?r.placement.operation:null,c=a(this,rt);if(l===null||c===null){h(this,R,Bo).call(this,r,!1);return}r.completed=!0,h(this,R,Vo).call(this,r),r.operation=[...l],c.setPinnedChannelIds([...l]).then(()=>{a(this,ie)===r&&(r.operationResolved=!0,h(this,R,Kd).call(this,a(this,Ye)))},()=>{a(this,ie)===r&&(r.operationResolved=!0,r.operationRejected=!0,h(this,R,Sc).call(this,r))});return}const i=a(this,_e);d(this,_e,null),!(i===null||i.pointerId!==t.pointerId||Math.hypot(t.clientX-i.x,t.clientY-i.y)>Fd)&&((s=a(this,rt))==null||s.focusChannel(i.channelId).catch(()=>{}))});g(this,Ha,t=>{var r,i;((r=a(this,ie))==null?void 0:r.pointerId)===t.pointerId&&!a(this,ie).completed?h(this,R,Ac).call(this):((i=a(this,_e))==null?void 0:i.pointerId)===t.pointerId&&d(this,_e,null)});g(this,Va,t=>{const r=a(this,ie);r===null||r.pointerId!==t.pointerId||r.completed||h(this,R,Bo).call(this,r,!1)});g(this,Ba,t=>{t.key!=="Escape"||a(this,ie)===null||a(this,ie).completed||(t.preventDefault(),h(this,R,Ac).call(this))});g(this,lu,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){window.addEventListener("pointermove",a(this,Za)),window.addEventListener("pointerup",a(this,Fa)),window.addEventListener("pointercancel",a(this,Ha)),window.addEventListener("lostpointercapture",a(this,Va)),window.addEventListener("keydown",a(this,Ba))}template(t,r,i){var l;const s=a(this,Ye);d(this,rt,t),d(this,Ye,r),h(this,R,e2).call(this,r),h(this,R,Fw).call(this,r),h(this,R,qw).call(this,s,r),a(this,it)!==null&&!r.channels.some(({id:c})=>c===a(this,it))&&(d(this,it,null),d(this,Xt,"")),h(this,R,Kd).call(this,r);const o=h(this,R,jw).call(this,Rg(r,(l=a(this,ie))==null?void 0:l.source));return V`
|
|
104
104
|
<nav
|
|
105
105
|
class="sidebar"
|
|
106
106
|
aria-label="Channels"
|
|
107
107
|
?dragging=${a(this,ie)!==null}
|
|
108
|
-
${
|
|
108
|
+
${mn(a(this,Ls))}
|
|
109
109
|
>
|
|
110
110
|
<header
|
|
111
111
|
class="sidebar-titlebar"
|
|
112
112
|
?electron-draggable=${i}
|
|
113
113
|
></header>
|
|
114
114
|
|
|
115
|
-
<div class="sidebar-body" @scroll=${a(this,
|
|
116
|
-
${h(this,R,
|
|
117
|
-
${h(this,R,
|
|
115
|
+
<div class="sidebar-body" @scroll=${a(this,lu)}>
|
|
116
|
+
${h(this,R,Hd).call(this,"Pinned",o.pinned)}
|
|
117
|
+
${h(this,R,Hd).call(this,"Recent",o.unpinned)}
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<footer class="sidebar-foot">
|
|
@@ -124,38 +124,38 @@ tv-desktop
|
|
|
124
124
|
variant="ghost"
|
|
125
125
|
type="button"
|
|
126
126
|
?disabled=${a(this,ut)!==null}
|
|
127
|
-
@click=${a(this,
|
|
127
|
+
@click=${a(this,ru)}
|
|
128
128
|
>
|
|
129
129
|
<tv-icon name="add"></tv-icon>
|
|
130
130
|
New channel
|
|
131
131
|
</button>
|
|
132
132
|
</footer>
|
|
133
133
|
</nav>
|
|
134
|
-
${h(this,R,
|
|
135
|
-
`}disconnected(){var t,r,i;window.removeEventListener("pointermove",a(this,
|
|
134
|
+
${h(this,R,Bw).call(this)}
|
|
135
|
+
`}disconnected(){var t,r,i;window.removeEventListener("pointermove",a(this,Za)),window.removeEventListener("pointerup",a(this,Fa)),window.removeEventListener("pointercancel",a(this,Ha)),window.removeEventListener("lostpointercapture",a(this,Va)),window.removeEventListener("keydown",a(this,Ba)),h(this,R,t2).call(this),(t=a(this,tn))==null||t.withdraw(),d(this,tn,null),(r=a(this,cr))==null||r.cancel(),d(this,cr,null),(i=a(this,en))==null||i.cancel(),d(this,en,null),d(this,rt,null),d(this,Ye,null),d(this,it,null),d(this,Xt,""),d(this,pi,!1),d(this,_e,null),d(this,ut,null),d(this,Qt,null),d(this,ht,null),d(this,Ke,null),d(this,dt,null)}}rt=new WeakMap,Ye=new WeakMap,it=new WeakMap,Xt=new WeakMap,pi=new WeakMap,_e=new WeakMap,ie=new WeakMap,ut=new WeakMap,Qt=new WeakMap,ht=new WeakMap,Ke=new WeakMap,dt=new WeakMap,cr=new WeakMap,en=new WeakMap,tn=new WeakMap,Ls=new WeakMap,Os=new WeakMap,zs=new WeakMap,R=new WeakSet,Hd=function(t,r){var m;const i=t==="Pinned"?"pinned":"unpinned",s=a(this,ie);if(s===null&&r.length===0)return null;const o=s===null?void 0:r.find(({channel:v})=>v.id===s.channelId),l=s===null?r:r.filter(({channel:v})=>v.id!==s.channelId),c=(s==null?void 0:s.placement.kind)==="placement"&&((m=s.placement.placeholder)==null?void 0:m.side)===i?s.placement.placeholder:null,u=l.map(v=>({kind:"row",row:v}));c!==null&&u.splice(c.index,0,{kind:"placeholder",key:`channel-placeholder-${i}`}),o!==void 0&&u.push({kind:"row",row:o});const f=s!==null&&l.length===0&&c===null;return V`
|
|
136
136
|
<section
|
|
137
137
|
class="channel-group"
|
|
138
138
|
data-channel-side=${i}
|
|
139
139
|
?drag-collapsed=${f}
|
|
140
140
|
>
|
|
141
141
|
<h2 class="channel-group-label">${t}</h2>
|
|
142
|
-
${jc(u,
|
|
142
|
+
${jc(u,v=>v.kind==="row"?v.row.channel.id:v.key,v=>v.kind==="row"?h(this,R,Uw).call(this,v.row):V`
|
|
143
143
|
<span
|
|
144
144
|
class="channel-placeholder"
|
|
145
145
|
aria-hidden="true"
|
|
146
146
|
data-channel-side=${i}
|
|
147
147
|
data-channel-index=${(c==null?void 0:c.index)??0}
|
|
148
|
-
style=${
|
|
148
|
+
style=${Wc({height:`${(s==null?void 0:s.rowHeight)??0}px`})}
|
|
149
149
|
></span>
|
|
150
150
|
`)}
|
|
151
151
|
</section>
|
|
152
|
-
`},
|
|
152
|
+
`},Uw=function(t){var u;const{channel:r,pinned:i,selected:s}=t,o=((u=a(this,ie))==null?void 0:u.channelId)===r.id?a(this,ie):null,l=o!==null&&i&&o.placement.kind==="placement"&&o.placement.side==="unpinned",c=r.id===a(this,it);return V`
|
|
153
153
|
<div
|
|
154
154
|
class="channel-row"
|
|
155
155
|
data-channel-id=${r.id}
|
|
156
156
|
?dragged=${o!==null}
|
|
157
157
|
?unpinning=${l}
|
|
158
|
-
style=${
|
|
158
|
+
style=${Wc(o===null?{}:{left:`${o.currentX-o.grip.previewOffsetX}px`,top:`${o.currentY-o.grip.offsetY}px`,width:`${o.rowWidth}px`,height:`${o.rowHeight}px`})}
|
|
159
159
|
>
|
|
160
160
|
${l?V`
|
|
161
161
|
<span class="channel-drag-action" aria-hidden="true">
|
|
@@ -168,10 +168,10 @@ tv-desktop
|
|
|
168
168
|
class="channel-rename"
|
|
169
169
|
aria-label="Channel name"
|
|
170
170
|
.value=${a(this,Xt)}
|
|
171
|
-
@input=${a(this,
|
|
172
|
-
@keydown=${a(this,
|
|
173
|
-
@blur=${a(this,
|
|
174
|
-
${
|
|
171
|
+
@input=${a(this,iu)}
|
|
172
|
+
@keydown=${a(this,su)}
|
|
173
|
+
@blur=${a(this,ou)}
|
|
174
|
+
${mn(a(this,Os))}
|
|
175
175
|
/>
|
|
176
176
|
<button
|
|
177
177
|
class="channel-rename-commit"
|
|
@@ -181,7 +181,7 @@ tv-desktop
|
|
|
181
181
|
type="button"
|
|
182
182
|
tabindex="-1"
|
|
183
183
|
aria-label="Rename"
|
|
184
|
-
@pointerdown=${a(this,
|
|
184
|
+
@pointerdown=${a(this,au)}
|
|
185
185
|
>
|
|
186
186
|
<tv-icon name="check"></tv-icon>
|
|
187
187
|
</button>
|
|
@@ -190,11 +190,11 @@ tv-desktop
|
|
|
190
190
|
class="channel"
|
|
191
191
|
type="button"
|
|
192
192
|
aria-current=${s?"true":ue}
|
|
193
|
-
@pointerdown=${f=>h(this,R,
|
|
193
|
+
@pointerdown=${f=>h(this,R,Gw).call(this,r.id,f)}
|
|
194
194
|
>
|
|
195
195
|
${r.name}
|
|
196
196
|
</button>
|
|
197
|
-
${
|
|
197
|
+
${Lw(h(this,R,Zw).call(this,t),{trigger:f=>V`
|
|
198
198
|
<button
|
|
199
199
|
class="channel-menu-trigger"
|
|
200
200
|
variant="ghost"
|
|
@@ -210,40 +210,40 @@ tv-desktop
|
|
|
210
210
|
`})}
|
|
211
211
|
`}
|
|
212
212
|
</div>
|
|
213
|
-
`},
|
|
213
|
+
`},Zw=function(t){const{channel:r,pinned:i}=t;return[{label:"Rename",action:()=>h(this,R,Bd).call(this,r.id)},{label:i?"Unpin":"Pin",action:()=>h(this,R,Ww).call(this,r.id,!i)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,R,Hw).call(this,r.id,r.name)}]},ru=new WeakMap,Fw=function(t){const r=a(this,ut);if(r===null||a(this,Qt)!==null||r.resultChannelId===null)return;const i=t.channels.find(({id:s})=>s===r.resultChannelId);i!==void 0&&(d(this,Qt,i.id),queueMicrotask(()=>h(this,R,Vd).call(this,"create",i.id)))},Hw=function(t,r){var s,o,l;if(a(this,ht)!==null||a(this,Ke)!==null)return;h(this,R,qd).call(this,t),d(this,ht,{channelId:t,name:r}),this.render();const i=(s=a(this,zs).value)==null?void 0:s.closest("dialog");i instanceof HTMLDialogElement&&(d(this,tn,Fu(i,()=>{h(this,R,bc).call(this)})),(l=(o=a(this,zs).value)==null?void 0:o.querySelector(".dialog-actions button"))==null||l.focus())},bc=function(){const t=a(this,tn);d(this,tn,null),d(this,ht,null),t==null||t.withdraw(),this.render()},Vw=function(){const t=a(this,rt),r=a(this,ht);t===null||r===null||a(this,Ke)!==null||(d(this,Ke,r.channelId),h(this,R,bc).call(this),t.deleteChannel(r.channelId).catch(()=>{a(this,Ke)!==r.channelId||a(this,dt)!==null||(d(this,Ke,null),this.render())}))},Bw=function(){const t=a(this,ht);return t===null?null:Zu(V`
|
|
214
214
|
<div
|
|
215
215
|
class="dialog-alert channel-delete-alert"
|
|
216
216
|
role="alertdialog"
|
|
217
217
|
aria-labelledby="channel-delete-title"
|
|
218
218
|
aria-describedby="channel-delete-body"
|
|
219
|
-
${
|
|
219
|
+
${mn(a(this,zs))}
|
|
220
220
|
>
|
|
221
221
|
<h2 id="channel-delete-title">Delete “${t.name}”?</h2>
|
|
222
222
|
<p id="channel-delete-body">
|
|
223
223
|
This will permanently delete this channel from Television.
|
|
224
224
|
</p>
|
|
225
225
|
<div class="dialog-actions">
|
|
226
|
-
<button type="button" autofocus @click=${()=>h(this,R,
|
|
226
|
+
<button type="button" autofocus @click=${()=>h(this,R,bc).call(this)}>
|
|
227
227
|
Cancel
|
|
228
228
|
</button>
|
|
229
|
-
<button type="button" variant="danger" @click=${()=>h(this,R,
|
|
229
|
+
<button type="button" variant="danger" @click=${()=>h(this,R,Vw).call(this)}>
|
|
230
230
|
Delete
|
|
231
231
|
</button>
|
|
232
232
|
</div>
|
|
233
233
|
</div>
|
|
234
|
-
`,{overlay:!0})},Uw=function(t,r){var f,m;a(this,ht)!==null&&!r.channels.some(({id:g})=>{var y;return g===((y=a(this,ht))==null?void 0:y.channelId)})&&((f=a(this,tn))==null||f.withdraw(),d(this,tn,null),d(this,ht,null));const i=a(this,dt);if(i!==null&&r.channels.some(({id:g})=>g===i.row.channel.id)){(m=a(this,en))==null||m.cancel(),d(this,en,null),d(this,dt,null),d(this,Ke,null);return}const s=a(this,Ke);if(s===null||i!==null||r.channels.some(({id:g})=>g===s))return;if(t===null){d(this,Ke,null);return}const o=Ag(t),l=o.pinned.findIndex(({channel:g})=>g.id===s),c=o.unpinned.findIndex(({channel:g})=>g.id===s),u=l>=0?o.pinned[l]:o.unpinned[c];if(u===void 0){d(this,Ke,null);return}d(this,dt,{row:{...u,selected:!1},side:l>=0?"pinned":"unpinned",index:l>=0?l:c}),queueMicrotask(()=>h(this,R,Ud).call(this,"delete",s))},Zw=function(t){const r=a(this,dt);if(r===null)return t;const i=[...t[r.side]];return i.some(({channel:s})=>s.id===r.row.channel.id)||i.splice(r.index,0,r.row),{...t,[r.side]:i}},Ud=function(t,r){var u,f;if(t==="create"&&a(this,Qt)!==r||t==="delete"&&((u=a(this,dt))==null?void 0:u.row.channel.id)!==r)return;const i=[...((f=a(this,Ls).value)==null?void 0:f.querySelectorAll(ts))??[]].find(m=>m.dataset.channelId===r);if(i===void 0)return;const s=()=>{var m;if(t==="create"){if(a(this,Qt)!==r)return;d(this,Qt,null),d(this,ut,null),h(this,R,Zd).call(this,r)}else{if(((m=a(this,dt))==null?void 0:m.row.channel.id)!==r)return;d(this,dt,null),d(this,Ke,null),this.render()}};if(typeof i.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){s();return}const o=i.getBoundingClientRect().height,l=t==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${o}px`,opacity:1}]:[{maxHeight:`${o}px`,opacity:1},{maxHeight:"0px",opacity:0}],c=i.animate(l,{duration:ps,easing:Bl});t==="create"?d(this,cr,c):d(this,en,c),c.finished.then(()=>{t==="create"&&a(this,cr)!==c||t==="delete"&&a(this,en)!==c||(t==="create"?d(this,cr,null):d(this,en,null),s())},()=>{})},Zd=function(t){var i;const r=(i=a(this,Ye))==null?void 0:i.channels.find(({id:s})=>s===t);r!==void 0&&(d(this,it,t),d(this,Xt,r.name),d(this,_e,null),this.render(),queueMicrotask(()=>{var s,o;a(this,it)===t&&((s=a(this,Os).value)==null||s.focus(),(o=a(this,Os).value)==null||o.select())}))},Zo=function(t){if(a(this,it)===null||a(this,pi)||a(this,rt)===null)return;d(this,pi,!0);const r=a(this,it),i=a(this,Xt).trim();d(this,it,null),d(this,Xt,""),this.render(),d(this,pi,!1),t&&i.length>0&&a(this,rt).renameChannel(r,i).catch(()=>{})},ru=new WeakMap,iu=new WeakMap,su=new WeakMap,ou=new WeakMap,Fw=function(t,r){if(a(this,rt)===null||a(this,Ye)===null)return;h(this,R,Fd).call(this,t);const i=a(this,Ye).display.pinnedChannelIds,s=r?[...i.filter(o=>o!==t),t]:i.filter(o=>o!==t);a(this,rt).setPinnedChannelIds(s).catch(()=>{})},Fd=function(t){var s;const r=[...((s=a(this,Ls).value)==null?void 0:s.querySelectorAll(ts))??[]].find(o=>o.dataset.channelId===t),i=r==null?void 0:r.querySelector(".menu");i&&typeof i.hidePopover=="function"&&i.matches(":popover-open")&&i.hidePopover()},Hw=function(t,r){if(r.button!==0||a(this,_e)!==null||a(this,ie)!==null||a(this,Ye)===null)return;const s=r.currentTarget.closest(".sidebar");if(s===null)return;const o=Bo(a(this,Ye));!o.pinnedChannelIds.includes(t)&&!o.unpinnedChannelIds.includes(t)||d(this,_e,{channelId:t,pointerId:r.pointerId,x:r.clientX,y:r.clientY,source:{channelId:t,...o},captureTarget:s})},Ma=new WeakMap,Vw=function(t,r){const i=[...t.captureTarget.querySelectorAll(ts)].find(m=>m.dataset.channelId===t.channelId);if(i===void 0){d(this,_e,null);return}const s=i.getBoundingClientRect(),o=h(this,R,Bw).call(this,i),l=NL({wideRow:s,compactPreviewWidth:o,pointer:{x:t.x,y:t.y}}),c=t.captureTarget.querySelector('[data-channel-side="pinned"]'),u=t.captureTarget.querySelector('[data-channel-side="unpinned"]');try{t.captureTarget.setPointerCapture(t.pointerId)}catch{d(this,_e,null);return}t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${l.previewOffsetX}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${l.offsetY}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${l.correctionX}px`);const f={...t,placement:{kind:"invalidated"},currentX:r.clientX,currentY:r.clientY,grip:l,rowWidth:o,rowHeight:s.height,originPinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,_e,null),d(this,ie,f),h(this,R,Fo).call(this,f,r)},Bw=function(t){const r=t.cloneNode(!0);for(const s of[r,...r.querySelectorAll("[id], [popovertarget]")])s.removeAttribute("id"),s.removeAttribute("popovertarget");r.setAttribute("dragged",""),r.style.position="fixed",r.style.left="-10000px",r.style.top="-10000px",r.style.visibility="hidden",r.style.pointerEvents="none",document.body.append(r);const i=r.getBoundingClientRect().width;return r.remove(),i},Fo=function(t,r,i=!0){if(t.completed)return;const s=a(this,Ye);if(s===null){t.placement={kind:"invalidated"};return}t.currentX=r.clientX,t.currentY=r.clientY;const o=Bo(s),l=new Map([...t.captureTarget.querySelectorAll(ts)].map(G=>[G.dataset.channelId,G])),c=o.pinnedChannelIds.filter(G=>G!==t.channelId).flatMap(G=>{const F=l.get(G);if(F===void 0)return[];const W=F.getBoundingClientRect();return[{channelId:G,top:W.top,bottom:W.bottom}]}),u=t.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=t.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),m=t.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),g=m==null?void 0:m.getBoundingClientRect(),y=m==null?void 0:m.dataset.channelSide,k=Number(m==null?void 0:m.dataset.channelIndex),A=t.captureTarget.getBoundingClientRect(),x=Q5({source:t.source,current:o,pointer:{x:r.clientX,y:r.clientY},geometry:{sidebar:{left:A.left,right:A.right,top:A.top,bottom:A.bottom},pinnedRows:c,unpinnedGroupTop:(f==null?void 0:f.getBoundingClientRect().top)??t.originUnpinnedGroupTop,pinnedContentBottom:(u==null?void 0:u.getBoundingClientRect().bottom)??t.originPinnedContentBottom,placeholder:g!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(k)?{side:y,index:k,top:g.top,bottom:g.bottom}:null}}),M=!ML(t.placement,x),Z=M?h(this,R,Bd).call(this,t):null;t.placement=x,(M||i)&&h(this,R,jd).call(this,t,Z,!1),h(this,R,Hd).call(this,t)},Hd=function(t){const r=t.captureTarget.querySelector(".sidebar-body"),i=r?h(this,R,Vd).call(this,r,t.currentY):0,s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=i<0?((r==null?void 0:r.scrollTop)??0)<=Sg:((r==null?void 0:r.scrollTop)??0)>=s-Sg;if(t.completed||i===0||s===0||o||typeof requestAnimationFrame!="function"){h(this,R,Ho).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{h(this,R,jw).call(this,t,l)}))},jw=function(t,r){if(t.edgeScrollFrame=0,a(this,ie)!==t||t.completed){t.edgeScrollTimestamp=null;return}const i=t.captureTarget.querySelector(".sidebar-body");if(i===null){t.edgeScrollTimestamp=null;return}const s=h(this,R,Vd).call(this,i,t.currentY),o=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,s!==0&&o!==null){const l=Math.max(0,r-o)/1e3,c=Math.max(0,i.scrollHeight-i.clientHeight),u=i.scrollTop,f=s*l+t.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+f));i.scrollTop=m;const g=i.scrollTop-u;if(t.edgeScrollRemainder=m===0||m===c?0:f-g,g!==0){i.toggleAttribute("continues-start",i.scrollTop>0),h(this,R,qw).call(this,t);return}}h(this,R,Hd).call(this,t)},qw=function(t){h(this,R,Fo).call(this,t,{clientX:t.currentX,clientY:t.currentY},!1)},Ho=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},Vd=function(t,r){const i=t.getBoundingClientRect();return r>=i.top&&r<i.top+vt?-Wc*(i.top+vt-r)/vt:r>i.bottom-vt&&r<=i.bottom?Wc*(r-(i.bottom-vt))/vt:0},Bd=function(t){var s;for(const o of t.displacementAnimations)o.cancel();t.displacementAnimations.clear();const r=new Map;for(const o of t.captureTarget.querySelectorAll(ts)){const l=o.dataset.channelId;if(l===void 0)continue;const c=o.getBoundingClientRect();r.set(l,{left:c.left,top:c.top})}const i=new Map;for(const o of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const l=o.dataset.channelSide;if(l!=="pinned"&&l!=="unpinned")continue;const c=o.getBoundingClientRect(),u=o.cloneNode(!0);for(const f of[u,...u.querySelectorAll("[id], [popovertarget]")])f.removeAttribute("id"),f.removeAttribute("popovertarget");(s=u.querySelector(".channel-row[dragged]"))==null||s.remove(),u.classList.add("channel-group-withdrawal"),u.setAttribute("aria-hidden","true"),u.removeAttribute("drag-collapsed"),i.set(l,{left:c.left,top:c.top,width:c.width,height:o.hasAttribute("drag-collapsed")?0:c.height,withdrawal:u})}return{rows:r,groups:i}},jd=function(t,r,i){const s=t.captureTarget.querySelector(".sidebar-body"),o=(s==null?void 0:s.scrollTop)??0;this.render(),queueMicrotask(()=>{const l=t.captureTarget.querySelector(".sidebar-body");l!==null&&(l.scrollTop=o),r!==null&&h(this,R,Ww).call(this,t,r,i)})},Ww=function(t,r,i){if(!(typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const s of t.captureTarget.querySelectorAll(ts)){const o=s.dataset.channelId;if(o===void 0||!i&&o===t.channelId)continue;const l=r.rows.get(o);if(l===void 0)continue;const c=s.getBoundingClientRect(),u=l.left-c.left,f=l.top-c.top;Math.hypot(u,f)<=$o||h(this,R,wc).call(this,t,s.animate({translate:[`${u}px ${f}px`,"0px 0px"]},{duration:ps,easing:Bl}))}for(const s of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=s.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const l=r.groups.get(o),c=s.getBoundingClientRect(),u=s.hasAttribute("drag-collapsed")?0:c.height;if(l!==void 0){if(l.height<=$o&&u>$o)h(this,R,wc).call(this,t,s.animate([{opacity:0,translate:`0px -${u}px`},{opacity:1,translate:"0px 0px"}],{duration:ps,easing:Bl}));else if(l.height>$o&&u<=$o&&l.withdrawal.childElementCount>0){const f=l.withdrawal;f.style.left=`${l.left}px`,f.style.top=`${l.top}px`,f.style.width=`${l.width}px`,f.style.height=`${l.height}px`,t.captureTarget.append(f);const m=f.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${l.height}px`}],{duration:ps,easing:Bl});h(this,R,wc).call(this,t,m),m.finished.finally(()=>f.remove()).catch(()=>{})}}}}},wc=function(t,r){t.displacementAnimations.add(r),r.finished.finally(()=>{t.displacementAnimations.delete(r)}).catch(()=>{})},Ua=new WeakMap,Za=new WeakMap,Fa=new WeakMap,Ha=new WeakMap,Gw=function(t){const r=Bo(t);a(this,ie)!==null&&!a(this,ie).completed&&!kg(a(this,ie).source,r)&&h(this,R,_c).call(this),a(this,_e)!==null&&!kg(a(this,_e).source,r)&&d(this,_e,null)},qd=function(t){const r=a(this,ie);if(t===null||r===null||!r.completed||!r.operationResolved||r.restorationQueued)return;if(r.operationRejected){h(this,R,bc).call(this,r);return}const i=r.operation;i!==null&&Gc(Bo(t).pinnedChannelIds,i)&&h(this,R,bc).call(this,r)},bc=function(t){a(this,ie)!==t||t.restorationQueued||(t.restorationQueued=!0,queueMicrotask(()=>{a(this,ie)===t&&h(this,R,Vo).call(this,t,!1)}))},_c=function(){d(this,_e,null);const t=a(this,ie);t!==null&&h(this,R,Vo).call(this,t,!0)},Vo=function(t,r){if(a(this,ie)!==t)return;h(this,R,Ho).call(this,t);const i=h(this,R,Bd).call(this,t);d(this,ie,null),h(this,R,Wd).call(this,t),r&&t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId),h(this,R,jd).call(this,t,i,!0)},Yw=function(){d(this,_e,null);const t=a(this,ie);if(d(this,ie,null),t!==null){h(this,R,Ho).call(this,t);for(const r of t.displacementAnimations)r.cancel();t.displacementAnimations.clear(),h(this,R,Wd).call(this,t),t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId)}},Wd=function(t){t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")},au=new WeakMap;const zL=kt(OL);function NL(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=Eg(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-LL));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:Eg(n.pointer.y-n.wideRow.top,0,t)}}function Ag(n,e=Bo(n)){var l,c;const t=new Map(n.channels.map(u=>[u.id,u])),r=e.pinnedChannelIds.flatMap(u=>{const f=t.get(u);return f===void 0?[]:[f]}),i=e.unpinnedChannelIds.flatMap(u=>{const f=t.get(u);return f===void 0?[]:[f]}),s=n.display.focusedChannelId,o=s!==null&&t.has(s)?s:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===o})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===o}))}}function Bo(n){const e=new Set(n.channels.map(({id:s})=>s)),t=n.display.pinnedChannelIds.filter(s=>e.has(s)),r=new Set(t),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return{pinnedChannelIds:t,unpinnedChannelIds:i}}function kg(n,e){return Gc(n.pinnedChannelIds,e.pinnedChannelIds)&&Gc(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Gc(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function ML(n,e){var t,r,i,s;return n.kind!==e.kind?!1:n.kind==="invalidated"||e.kind==="invalidated"?!0:n.side===e.side&&((t=n.placeholder)==null?void 0:t.side)===((r=e.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((s=e.placeholder)==null?void 0:s.index)&&n.operation===null==(e.operation===null)&&(n.operation===null||e.operation===null||Gc(n.operation,e.operation))}function Eg(n,e,t){return Math.max(e,Math.min(t,n))}const UL=404,ZL="/views/url-unsupported/";function Sc(n){const e=md(n.artifact,{electron:n.electron});let t;if(n.currentURL===null){const r=n.viewURL??e.viewURL;e.renderer==="markdown"?t={renderer:"markdown",viewURL:r,contentURL:n.contentURL??e.contentURL}:e.renderer==="url-webview"&&e.contentURL!==null?t={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??e.contentURL}:t={...e,viewURL:r}}else $g(n.currentURL)&&!n.electron?t=Tn(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:ZL,contentURL:null}:$g(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:VL(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var ze,ft,Ns,mi,gi,Rt,vi,Ms,pt,Us,Zs,nn,ur,hr,yi,B,Ac,Kw,Jw,Gd,Xw,rn,kc,jo,Yd,Qw,Kd,Jd,jr;class FL extends At{constructor(){super(...arguments);v(this,B);v(this,ze,null);v(this,ft,null);v(this,Ns,"");v(this,mi,()=>{});v(this,gi,()=>{});v(this,Rt,null);v(this,vi,null);v(this,Ms,null);v(this,pt,null);v(this,Us,null);v(this,Zs,null);v(this,nn,null);v(this,ur,null);v(this,hr,null);v(this,yi,null);v(this,rn,()=>{!a(this,ft)||a(this,ft)!==a(this,Rt)||a(this,mi).call(this,!0)})}get currentFrame(){return a(this,ft)}connected(){h(this,B,kc).call(this),h(this,B,Yd).call(this)}disconnected(){h(this,B,jo).call(this),h(this,B,jr).call(this)}template(t,r,i=()=>{}){return d(this,mi,r),d(this,gi,i),t(this),a(this,Ns)}assignSource(t){const r=a(this,ze),i=r?!BL(r.artifact,t.artifact):!0;((r==null?void 0:r.artifact.id)!==t.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&t.artifact.kind==="path"&&r.artifact.path!==t.artifact.path)&&d(this,yi,null),i&&(d(this,nn,null),a(this,pt)&&(a(this,pt).content=""),d(this,ur,null),d(this,hr,null)),d(this,ze,t),h(this,B,Ac).call(this)}handleArtifactContentChanged(t){const r=a(this,ze);return t!==(r==null?void 0:r.artifact.id)||!a(this,pt)&&!h(this,B,Jd).call(this)?!1:(h(this,B,Kd).call(this),!0)}refreshFrameLoadState(){h(this,B,kc).call(this)}}ze=new WeakMap,ft=new WeakMap,Ns=new WeakMap,mi=new WeakMap,gi=new WeakMap,Rt=new WeakMap,vi=new WeakMap,Ms=new WeakMap,pt=new WeakMap,Us=new WeakMap,Zs=new WeakMap,nn=new WeakMap,ur=new WeakMap,hr=new WeakMap,yi=new WeakMap,B=new WeakSet,Ac=function(){const t=a(this,ze);if(!t)return;if(t.artifact.kind==="path"&&h(this,B,Jd).call(this)){h(this,B,Xw).call(this,t.artifact);return}const r=Sc(t),i=h(this,B,Kw).call(this,r.renderer);h(this,B,Jw).call(this,i,r),h(this,B,Gd).call(this,i),h(this,B,kc).call(this),h(this,B,Yd).call(this)},Kw=function(t){var s;const r=t==="url-webview"?"webview":"iframe";if(((s=a(this,ft))==null?void 0:s.tagName.toLowerCase())===r)return a(this,ft);h(this,B,jo).call(this),h(this,B,jr).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,ft,i),i},Jw=function(t,r){t.getAttribute("src")!==r.viewURL&&(a(this,gi).call(this,null),a(this,gi).call(this,t),t.setAttribute("src",r.viewURL)),r.contentURL===null?delete t.dataset.contentUrl:t.dataset.contentUrl=r.contentURL},Gd=function(t){a(this,Ns)!==t&&(d(this,Ns,t),this.render(t))},Xw=function(t){a(this,gi).call(this,null),h(this,B,jo).call(this),h(this,B,jr).call(this),d(this,ft,null),a(this,mi).call(this,!1),h(this,B,Gd).call(this,V`
|
|
234
|
+
`,{overlay:!0})},qw=function(t,r){var f,m;a(this,ht)!==null&&!r.channels.some(({id:v})=>{var y;return v===((y=a(this,ht))==null?void 0:y.channelId)})&&((f=a(this,tn))==null||f.withdraw(),d(this,tn,null),d(this,ht,null));const i=a(this,dt);if(i!==null&&r.channels.some(({id:v})=>v===i.row.channel.id)){(m=a(this,en))==null||m.cancel(),d(this,en,null),d(this,dt,null),d(this,Ke,null);return}const s=a(this,Ke);if(s===null||i!==null||r.channels.some(({id:v})=>v===s))return;if(t===null){d(this,Ke,null);return}const o=Rg(t),l=o.pinned.findIndex(({channel:v})=>v.id===s),c=o.unpinned.findIndex(({channel:v})=>v.id===s),u=l>=0?o.pinned[l]:o.unpinned[c];if(u===void 0){d(this,Ke,null);return}d(this,dt,{row:{...u,selected:!1},side:l>=0?"pinned":"unpinned",index:l>=0?l:c}),queueMicrotask(()=>h(this,R,Vd).call(this,"delete",s))},jw=function(t){const r=a(this,dt);if(r===null)return t;const i=[...t[r.side]];return i.some(({channel:s})=>s.id===r.row.channel.id)||i.splice(r.index,0,r.row),{...t,[r.side]:i}},Vd=function(t,r){var u,f;if(t==="create"&&a(this,Qt)!==r||t==="delete"&&((u=a(this,dt))==null?void 0:u.row.channel.id)!==r)return;const i=[...((f=a(this,Ls).value)==null?void 0:f.querySelectorAll(ts))??[]].find(m=>m.dataset.channelId===r);if(i===void 0)return;const s=()=>{var m;if(t==="create"){if(a(this,Qt)!==r)return;d(this,Qt,null),d(this,ut,null),h(this,R,Bd).call(this,r)}else{if(((m=a(this,dt))==null?void 0:m.row.channel.id)!==r)return;d(this,dt,null),d(this,Ke,null),this.render()}};if(typeof i.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){s();return}const o=i.getBoundingClientRect().height,l=t==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${o}px`,opacity:1}]:[{maxHeight:`${o}px`,opacity:1},{maxHeight:"0px",opacity:0}],c=i.animate(l,{duration:ps,easing:jl});t==="create"?d(this,cr,c):d(this,en,c),c.finished.then(()=>{t==="create"&&a(this,cr)!==c||t==="delete"&&a(this,en)!==c||(t==="create"?d(this,cr,null):d(this,en,null),s())},()=>{})},Bd=function(t){var i;const r=(i=a(this,Ye))==null?void 0:i.channels.find(({id:s})=>s===t);r!==void 0&&(d(this,it,t),d(this,Xt,r.name),d(this,_e,null),this.render(),queueMicrotask(()=>{var s,o;a(this,it)===t&&((s=a(this,Os).value)==null||s.focus(),(o=a(this,Os).value)==null||o.select())}))},Fo=function(t){if(a(this,it)===null||a(this,pi)||a(this,rt)===null)return;d(this,pi,!0);const r=a(this,it),i=a(this,Xt).trim();d(this,it,null),d(this,Xt,""),this.render(),d(this,pi,!1),t&&i.length>0&&a(this,rt).renameChannel(r,i).catch(()=>{})},iu=new WeakMap,su=new WeakMap,ou=new WeakMap,au=new WeakMap,Ww=function(t,r){if(a(this,rt)===null||a(this,Ye)===null)return;h(this,R,qd).call(this,t);const i=a(this,Ye).display.pinnedChannelIds,s=r?[...i.filter(o=>o!==t),t]:i.filter(o=>o!==t);a(this,rt).setPinnedChannelIds(s).catch(()=>{})},qd=function(t){var s;const r=[...((s=a(this,Ls).value)==null?void 0:s.querySelectorAll(ts))??[]].find(o=>o.dataset.channelId===t),i=r==null?void 0:r.querySelector(".menu");i&&typeof i.hidePopover=="function"&&i.matches(":popover-open")&&i.hidePopover()},Gw=function(t,r){if(r.button!==0||a(this,_e)!==null||a(this,ie)!==null||a(this,Ye)===null)return;const s=r.currentTarget.closest(".sidebar");if(s===null)return;const o=qo(a(this,Ye));!o.pinnedChannelIds.includes(t)&&!o.unpinnedChannelIds.includes(t)||d(this,_e,{channelId:t,pointerId:r.pointerId,x:r.clientX,y:r.clientY,source:{channelId:t,...o},captureTarget:s})},Za=new WeakMap,Yw=function(t,r){const i=[...t.captureTarget.querySelectorAll(ts)].find(m=>m.dataset.channelId===t.channelId);if(i===void 0){d(this,_e,null);return}const s=i.getBoundingClientRect(),o=h(this,R,Kw).call(this,i),l=HL({wideRow:s,compactPreviewWidth:o,pointer:{x:t.x,y:t.y}}),c=t.captureTarget.querySelector('[data-channel-side="pinned"]'),u=t.captureTarget.querySelector('[data-channel-side="unpinned"]');try{t.captureTarget.setPointerCapture(t.pointerId)}catch{d(this,_e,null);return}t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${l.previewOffsetX}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${l.offsetY}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${l.correctionX}px`);const f={...t,placement:{kind:"invalidated"},currentX:r.clientX,currentY:r.clientY,grip:l,rowWidth:o,rowHeight:s.height,originPinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,_e,null),d(this,ie,f),h(this,R,Ho).call(this,f,r)},Kw=function(t){const r=t.cloneNode(!0);for(const s of[r,...r.querySelectorAll("[id], [popovertarget]")])s.removeAttribute("id"),s.removeAttribute("popovertarget");r.setAttribute("dragged",""),r.style.position="fixed",r.style.left="-10000px",r.style.top="-10000px",r.style.visibility="hidden",r.style.pointerEvents="none",document.body.append(r);const i=r.getBoundingClientRect().width;return r.remove(),i},Ho=function(t,r,i=!0){if(t.completed)return;const s=a(this,Ye);if(s===null){t.placement={kind:"invalidated"};return}t.currentX=r.clientX,t.currentY=r.clientY;const o=qo(s),l=new Map([...t.captureTarget.querySelectorAll(ts)].map(G=>[G.dataset.channelId,G])),c=o.pinnedChannelIds.filter(G=>G!==t.channelId).flatMap(G=>{const F=l.get(G);if(F===void 0)return[];const W=F.getBoundingClientRect();return[{channelId:G,top:W.top,bottom:W.bottom}]}),u=t.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=t.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),m=t.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),v=m==null?void 0:m.getBoundingClientRect(),y=m==null?void 0:m.dataset.channelSide,k=Number(m==null?void 0:m.dataset.channelIndex),S=t.captureTarget.getBoundingClientRect(),x=iD({source:t.source,current:o,pointer:{x:r.clientX,y:r.clientY},geometry:{sidebar:{left:S.left,right:S.right,top:S.top,bottom:S.bottom},pinnedRows:c,unpinnedGroupTop:(f==null?void 0:f.getBoundingClientRect().top)??t.originUnpinnedGroupTop,pinnedContentBottom:(u==null?void 0:u.getBoundingClientRect().bottom)??t.originPinnedContentBottom,placeholder:v!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(k)?{side:y,index:k,top:v.top,bottom:v.bottom}:null}}),M=!VL(t.placement,x),Z=M?h(this,R,Gd).call(this,t):null;t.placement=x,(M||i)&&h(this,R,Yd).call(this,t,Z,!1),h(this,R,jd).call(this,t)},jd=function(t){const r=t.captureTarget.querySelector(".sidebar-body"),i=r?h(this,R,Wd).call(this,r,t.currentY):0,s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=i<0?((r==null?void 0:r.scrollTop)??0)<=Tg:((r==null?void 0:r.scrollTop)??0)>=s-Tg;if(t.completed||i===0||s===0||o||typeof requestAnimationFrame!="function"){h(this,R,Vo).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{h(this,R,Jw).call(this,t,l)}))},Jw=function(t,r){if(t.edgeScrollFrame=0,a(this,ie)!==t||t.completed){t.edgeScrollTimestamp=null;return}const i=t.captureTarget.querySelector(".sidebar-body");if(i===null){t.edgeScrollTimestamp=null;return}const s=h(this,R,Wd).call(this,i,t.currentY),o=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,s!==0&&o!==null){const l=Math.max(0,r-o)/1e3,c=Math.max(0,i.scrollHeight-i.clientHeight),u=i.scrollTop,f=s*l+t.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+f));i.scrollTop=m;const v=i.scrollTop-u;if(t.edgeScrollRemainder=m===0||m===c?0:f-v,v!==0){i.toggleAttribute("continues-start",i.scrollTop>0),h(this,R,Xw).call(this,t);return}}h(this,R,jd).call(this,t)},Xw=function(t){h(this,R,Ho).call(this,t,{clientX:t.currentX,clientY:t.currentY},!1)},Vo=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},Wd=function(t,r){const i=t.getBoundingClientRect();return r>=i.top&&r<i.top+vt?-Gc*(i.top+vt-r)/vt:r>i.bottom-vt&&r<=i.bottom?Gc*(r-(i.bottom-vt))/vt:0},Gd=function(t){var s;for(const o of t.displacementAnimations)o.cancel();t.displacementAnimations.clear();const r=new Map;for(const o of t.captureTarget.querySelectorAll(ts)){const l=o.dataset.channelId;if(l===void 0)continue;const c=o.getBoundingClientRect();r.set(l,{left:c.left,top:c.top})}const i=new Map;for(const o of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const l=o.dataset.channelSide;if(l!=="pinned"&&l!=="unpinned")continue;const c=o.getBoundingClientRect(),u=o.cloneNode(!0);for(const f of[u,...u.querySelectorAll("[id], [popovertarget]")])f.removeAttribute("id"),f.removeAttribute("popovertarget");(s=u.querySelector(".channel-row[dragged]"))==null||s.remove(),u.classList.add("channel-group-withdrawal"),u.setAttribute("aria-hidden","true"),u.removeAttribute("drag-collapsed"),i.set(l,{left:c.left,top:c.top,width:c.width,height:o.hasAttribute("drag-collapsed")?0:c.height,withdrawal:u})}return{rows:r,groups:i}},Yd=function(t,r,i){const s=t.captureTarget.querySelector(".sidebar-body"),o=(s==null?void 0:s.scrollTop)??0;this.render(),queueMicrotask(()=>{const l=t.captureTarget.querySelector(".sidebar-body");l!==null&&(l.scrollTop=o),r!==null&&h(this,R,Qw).call(this,t,r,i)})},Qw=function(t,r,i){if(!(typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const s of t.captureTarget.querySelectorAll(ts)){const o=s.dataset.channelId;if(o===void 0||!i&&o===t.channelId)continue;const l=r.rows.get(o);if(l===void 0)continue;const c=s.getBoundingClientRect(),u=l.left-c.left,f=l.top-c.top;Math.hypot(u,f)<=Co||h(this,R,_c).call(this,t,s.animate({translate:[`${u}px ${f}px`,"0px 0px"]},{duration:ps,easing:jl}))}for(const s of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=s.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const l=r.groups.get(o),c=s.getBoundingClientRect(),u=s.hasAttribute("drag-collapsed")?0:c.height;if(l!==void 0){if(l.height<=Co&&u>Co)h(this,R,_c).call(this,t,s.animate([{opacity:0,translate:`0px -${u}px`},{opacity:1,translate:"0px 0px"}],{duration:ps,easing:jl}));else if(l.height>Co&&u<=Co&&l.withdrawal.childElementCount>0){const f=l.withdrawal;f.style.left=`${l.left}px`,f.style.top=`${l.top}px`,f.style.width=`${l.width}px`,f.style.height=`${l.height}px`,t.captureTarget.append(f);const m=f.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${l.height}px`}],{duration:ps,easing:jl});h(this,R,_c).call(this,t,m),m.finished.finally(()=>f.remove()).catch(()=>{})}}}}},_c=function(t,r){t.displacementAnimations.add(r),r.finished.finally(()=>{t.displacementAnimations.delete(r)}).catch(()=>{})},Fa=new WeakMap,Ha=new WeakMap,Va=new WeakMap,Ba=new WeakMap,e2=function(t){const r=qo(t);a(this,ie)!==null&&!a(this,ie).completed&&!Ig(a(this,ie).source,r)&&h(this,R,Ac).call(this),a(this,_e)!==null&&!Ig(a(this,_e).source,r)&&d(this,_e,null)},Kd=function(t){const r=a(this,ie);if(t===null||r===null||!r.completed||!r.operationResolved||r.restorationQueued)return;if(r.operationRejected){h(this,R,Sc).call(this,r);return}const i=r.operation;i!==null&&Yc(qo(t).pinnedChannelIds,i)&&h(this,R,Sc).call(this,r)},Sc=function(t){a(this,ie)!==t||t.restorationQueued||(t.restorationQueued=!0,queueMicrotask(()=>{a(this,ie)===t&&h(this,R,Bo).call(this,t,!1)}))},Ac=function(){d(this,_e,null);const t=a(this,ie);t!==null&&h(this,R,Bo).call(this,t,!0)},Bo=function(t,r){if(a(this,ie)!==t)return;h(this,R,Vo).call(this,t);const i=h(this,R,Gd).call(this,t);d(this,ie,null),h(this,R,Jd).call(this,t),r&&t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId),h(this,R,Yd).call(this,t,i,!0)},t2=function(){d(this,_e,null);const t=a(this,ie);if(d(this,ie,null),t!==null){h(this,R,Vo).call(this,t);for(const r of t.displacementAnimations)r.cancel();t.displacementAnimations.clear(),h(this,R,Jd).call(this,t),t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId)}},Jd=function(t){t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")},lu=new WeakMap;const FL=kt(ZL);function HL(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=xg(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-UL));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:xg(n.pointer.y-n.wideRow.top,0,t)}}function Rg(n,e=qo(n)){var l,c;const t=new Map(n.channels.map(u=>[u.id,u])),r=e.pinnedChannelIds.flatMap(u=>{const f=t.get(u);return f===void 0?[]:[f]}),i=e.unpinnedChannelIds.flatMap(u=>{const f=t.get(u);return f===void 0?[]:[f]}),s=n.display.focusedChannelId,o=s!==null&&t.has(s)?s:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===o})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===o}))}}function qo(n){const e=new Set(n.channels.map(({id:s})=>s)),t=n.display.pinnedChannelIds.filter(s=>e.has(s)),r=new Set(t),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return{pinnedChannelIds:t,unpinnedChannelIds:i}}function Ig(n,e){return Yc(n.pinnedChannelIds,e.pinnedChannelIds)&&Yc(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Yc(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function VL(n,e){var t,r,i,s;return n.kind!==e.kind?!1:n.kind==="invalidated"||e.kind==="invalidated"?!0:n.side===e.side&&((t=n.placeholder)==null?void 0:t.side)===((r=e.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((s=e.placeholder)==null?void 0:s.index)&&n.operation===null==(e.operation===null)&&(n.operation===null||e.operation===null||Yc(n.operation,e.operation))}function xg(n,e,t){return Math.max(e,Math.min(t,n))}const BL=404,qL="/views/url-unsupported/";function kc(n){const e=wd(n.artifact,{electron:n.electron});let t;if(n.currentURL===null){const r=n.viewURL??e.viewURL;e.renderer==="markdown"?t={renderer:"markdown",viewURL:r,contentURL:n.contentURL??e.contentURL}:e.renderer==="url-webview"&&e.contentURL!==null?t={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??e.contentURL}:t={...e,viewURL:r}}else Pg(n.currentURL)&&!n.electron?t=Rn(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:qL,contentURL:null}:Pg(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:GL(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var ze,ft,Ns,mi,gi,Rt,vi,Ms,pt,Us,Zs,nn,ur,hr,yi,B,Ec,n2,r2,Xd,i2,rn,$c,jo,Qd,s2,ef,tf,qr;class jL extends At{constructor(){super(...arguments);g(this,B);g(this,ze,null);g(this,ft,null);g(this,Ns,"");g(this,mi,()=>{});g(this,gi,()=>{});g(this,Rt,null);g(this,vi,null);g(this,Ms,null);g(this,pt,null);g(this,Us,null);g(this,Zs,null);g(this,nn,null);g(this,ur,null);g(this,hr,null);g(this,yi,null);g(this,rn,()=>{!a(this,ft)||a(this,ft)!==a(this,Rt)||a(this,mi).call(this,!0)})}get currentFrame(){return a(this,ft)}connected(){h(this,B,$c).call(this),h(this,B,Qd).call(this)}disconnected(){h(this,B,jo).call(this),h(this,B,qr).call(this)}template(t,r,i=()=>{}){return d(this,mi,r),d(this,gi,i),t(this),a(this,Ns)}assignSource(t){const r=a(this,ze),i=r?!YL(r.artifact,t.artifact):!0;((r==null?void 0:r.artifact.id)!==t.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&t.artifact.kind==="path"&&r.artifact.path!==t.artifact.path)&&d(this,yi,null),i&&(d(this,nn,null),a(this,pt)&&(a(this,pt).content=""),d(this,ur,null),d(this,hr,null)),d(this,ze,t),h(this,B,Ec).call(this)}handleArtifactContentChanged(t){const r=a(this,ze);return t!==(r==null?void 0:r.artifact.id)||!a(this,pt)&&!h(this,B,tf).call(this)?!1:(h(this,B,ef).call(this),!0)}refreshFrameLoadState(){h(this,B,$c).call(this)}}ze=new WeakMap,ft=new WeakMap,Ns=new WeakMap,mi=new WeakMap,gi=new WeakMap,Rt=new WeakMap,vi=new WeakMap,Ms=new WeakMap,pt=new WeakMap,Us=new WeakMap,Zs=new WeakMap,nn=new WeakMap,ur=new WeakMap,hr=new WeakMap,yi=new WeakMap,B=new WeakSet,Ec=function(){const t=a(this,ze);if(!t)return;if(t.artifact.kind==="path"&&h(this,B,tf).call(this)){h(this,B,i2).call(this,t.artifact);return}const r=kc(t),i=h(this,B,n2).call(this,r.renderer);h(this,B,r2).call(this,i,r),h(this,B,Xd).call(this,i),h(this,B,$c).call(this),h(this,B,Qd).call(this)},n2=function(t){var s;const r=t==="url-webview"?"webview":"iframe";if(((s=a(this,ft))==null?void 0:s.tagName.toLowerCase())===r)return a(this,ft);h(this,B,jo).call(this),h(this,B,qr).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,ft,i),i},r2=function(t,r){t.getAttribute("src")!==r.viewURL&&(a(this,gi).call(this,null),a(this,gi).call(this,t),t.setAttribute("src",r.viewURL)),r.contentURL===null?delete t.dataset.contentUrl:t.dataset.contentUrl=r.contentURL},Xd=function(t){a(this,Ns)!==t&&(d(this,Ns,t),this.render(t))},i2=function(t){a(this,gi).call(this,null),h(this,B,jo).call(this),h(this,B,qr).call(this),d(this,ft,null),a(this,mi).call(this,!1),h(this,B,Xd).call(this,V`
|
|
235
235
|
<section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
|
|
236
236
|
<div class="artifact-missing-wrapper">
|
|
237
|
-
<h1>${
|
|
238
|
-
<p>${
|
|
237
|
+
<h1>${Rb()}</h1>
|
|
238
|
+
<p>${Ib()}</p>
|
|
239
239
|
<section class="artifact-missing-path" aria-label="Missing artifact path">
|
|
240
240
|
<p class="artifact-missing-path-label">Registered path:</p>
|
|
241
241
|
<p><code>${t.path}</code></p>
|
|
242
242
|
</section>
|
|
243
|
-
<p>${
|
|
243
|
+
<p>${xb()}</p>
|
|
244
244
|
</div>
|
|
245
245
|
</section>
|
|
246
|
-
`)},rn=new WeakMap,kc=function(){var s;const t=a(this,ft),r=t?`${t.tagName.toLowerCase()}:${t.getAttribute("src")??""}:${t.dataset.contentUrl??""}`:null;if(t&&t===a(this,Rt)&&r===a(this,vi)||(h(this,B,jo).call(this),a(this,mi).call(this,!1),!t||!r||!this.isConnected))return;if(d(this,Rt,t),d(this,vi,r),t.tagName.toLowerCase()==="webview"){t.addEventListener("did-finish-load",a(this,rn)),t.addEventListener("did-fail-load",a(this,rn));return}t.addEventListener("load",a(this,rn));const i=t;try{i.isConnected&&((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&a(this,rn).call(this)}catch{}},jo=function(){if(!a(this,Rt)){d(this,vi,null);return}a(this,Rt).removeEventListener("load",a(this,rn)),a(this,Rt).removeEventListener("did-finish-load",a(this,rn)),a(this,Rt).removeEventListener("did-fail-load",a(this,rn)),d(this,Rt,null),d(this,vi,null)},Yd=function(){const t=a(this,ze),r=a(this,ft),i=(r==null?void 0:r.dataset.contentUrl)??null,s=(t==null?void 0:t.artifact.id)??null;if(!t||!r||!i||!s){h(this,B,jr).call(this,{clearContent:!0});return}if(r!==a(this,Ms)||s!==a(this,Zs)){h(this,B,jr).call(this),d(this,Ms,r),d(this,Us,i),d(this,Zs,s);const o=r.tagName.toLowerCase()==="webview"?new E5(r):new k5(r);d(this,pt,o),o.handleUpdateContent(async l=>{const c=a(this,ze),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,nn,l),a(this,pt)===o&&(o.content=l)}),a(this,nn)!==null&&(o.content=a(this,nn))}else d(this,Us,i);h(this,B,Qw).call(this)},Qw=function(){const t=a(this,ze),r=t==null?void 0:t.application;!t||!r||!a(this,pt)||a(this,ur)===t.artifact.id&&a(this,hr)===r||(d(this,ur,t.artifact.id),d(this,hr,r),h(this,B,Kd).call(this))},Kd=async function(){var s,o;const t=a(this,ze),r=t==null?void 0:t.application;if(!t||!r)return;const i=t.artifact.id;try{const l=await r.readMarkdown(i);if(((s=a(this,ze))==null?void 0:s.artifact.id)!==i||a(this,ze).application!==r)return;d(this,yi,null),d(this,nn,l);const c=a(this,pt);if(!c){h(this,B,Ac).call(this);return}c.content=l}catch(l){if(((o=a(this,ze))==null?void 0:o.artifact.id)!==i||a(this,ze).application!==r)return;if(l instanceof fo&&l.status===UL){d(this,yi,i),d(this,nn,null),h(this,B,jr).call(this),h(this,B,Ac).call(this);return}d(this,ur,null),d(this,hr,null)}},Jd=function(){var r;const t=(r=a(this,ze))==null?void 0:r.artifact;return a(this,yi)===(t==null?void 0:t.id)&&t.kind==="path"&&ny(t.path)},jr=function(t={}){var r;(r=a(this,pt))==null||r.dispose(),d(this,pt,null),d(this,Ms,null),d(this,Us,null),d(this,Zs,null),d(this,ur,null),d(this,hr,null),t.clearContent&&d(this,nn,null)};const HL=kt(FL);function $g(n){return n.startsWith("http://")||n.startsWith("https://")}function VL(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function BL(n,e){return n.id!==e.id||n.kind!==e.kind?!1:n.kind==="path"&&e.kind==="path"?n.path===e.path:n.kind==="url"&&e.kind==="url"?n.url===e.url:!0}var Va,Fs,sn,Nn,dr,fr,pr,Ba,ja,qa,Wa,at,Xd,Ec,$c;class jL{constructor(e,t=()=>{}){v(this,at);v(this,Va);v(this,Fs);v(this,sn,null);v(this,Nn,null);v(this,dr,null);v(this,fr,null);v(this,pr,!1);v(this,Ba,e=>{const t=Tg(e.data);if(!t)return;const r=a(this,dr);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,s=i.contentWindow;if(s===null)return;const o=t.type==="leaving",l=t.type==="navigation-request"&&t.native===!0&&t.sameDocument!==!0,c=s===e.source,u=(o||l)&&a(this,Nn)!==null&&a(this,Nn)===e.source,f=o&&WL(i)===e.origin;!c&&!u&&!f||h(this,at,Xd).call(this,t,i,{send:m=>{var g;return(g=i.contentWindow)==null?void 0:g.postMessage(m,"*")}})});v(this,ja,e=>{var s;const t=e.detail??e;if(!t||t.channel!==Cg)return;const r=Tg((s=t.args)==null?void 0:s[0]),i=a(this,fr);!r||!i||h(this,at,Xd).call(this,r,i,{send:o=>{var l;return(l=i.send)==null?void 0:l.call(i,Cg,o)}})});v(this,qa,e=>{const t=Rg(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});v(this,Wa,e=>{Rg(e).isMainFrame!==!1&&this.reset()});d(this,Va,e),d(this,Fs,t)}get currentGuid(){return a(this,sn)}get lifecycleWindow(){return a(this,Nn)}get trustState(){return{currentGuid:a(this,sn),lifecycleWindow:a(this,Nn)}}connect(){a(this,pr)||(d(this,pr,!0),window.addEventListener("message",a(this,Ba)),h(this,at,Ec).call(this))}disconnect(){a(this,pr)&&(window.removeEventListener("message",a(this,Ba)),d(this,pr,!1),h(this,at,$c).call(this))}reset(){d(this,sn,null),d(this,Nn,null),a(this,Fs).call(this)}setCurrentFrame(e){if(e===a(this,dr)){h(this,at,Ec).call(this);return}h(this,at,$c).call(this),a(this,dr)!==null&&this.reset(),d(this,dr,qL(e)?e:null),h(this,at,Ec).call(this)}}Va=new WeakMap,Fs=new WeakMap,sn=new WeakMap,Nn=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,Ba=new WeakMap,ja=new WeakMap,qa=new WeakMap,Wa=new WeakMap,at=new WeakSet,Xd=function(e,t,r){e.type==="bridge-ready"&&e.guid!==a(this,sn)?(a(this,sn)!==null&&a(this,Fs).call(this),d(this,sn,e.guid),d(this,Nn,t.tagName.toLowerCase()==="iframe"?t.contentWindow:null)):e.type==="leaving"&&e.guid===a(this,sn)&&this.reset(),a(this,Va).call(this,e,r)},Ec=function(){if(!a(this,pr))return;const e=a(this,dr),t=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;t!==a(this,fr)&&(h(this,at,$c).call(this),t&&(t.addEventListener("ipc-message",a(this,ja)),t.addEventListener("did-start-navigation",a(this,qa)),t.addEventListener("did-fail-load",a(this,Wa)),d(this,fr,t)))},$c=function(){const e=a(this,fr);e&&(e.removeEventListener("ipc-message",a(this,ja)),e.removeEventListener("did-start-navigation",a(this,qa)),e.removeEventListener("did-fail-load",a(this,Wa)),d(this,fr,null))};const Cg="television-artifact-bridge";function Tg(n){return fb(n)||pb(n)||mb(n)||gb(n)||vb(n)||yb(n)||wb(n)?n:null}function qL(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function WL(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function Rg(n){return n.detail??n}const GL="/views/url-unsupported/";class YL extends At{constructor(){super(...arguments);$(this,"_artifact",null);$(this,"_viewURL",null);$(this,"_contentURL",null);$(this,"_application",null);$(this,"_fullScreen",!1);$(this,"_inert",!1);$(this,"_onFullScreenChange",()=>{});$(this,"_connected",!1);$(this,"_deleteConfirmationOpen",!1);$(this,"_dialogPresentation",null);$(this,"_subscribedWebview",null);$(this,"_documentHost",null);$(this,"_pendingDocumentSource",null);$(this,"_rootRef",Cr());$(this,"_trustedChannel",new jL((t,r)=>{this.handleTrustedFrameMessage(t,r)},()=>{this._missingArtifactReplyTransport=null}));$(this,"_activeReloadFrameSrc",null);$(this,"_applicationSubscriptionsAttached",!1);$(this,"_proxyReloadVersion",0);$(this,"_navigationState",null);$(this,"_navigationArtifactId",null);$(this,"_navigationCanonicalURL",null);$(this,"_preserveFrameSrcOnNavigationRender",!1);$(this,"_missingArtifactReplyTransport",null);$(this,"handleNavigationChange",()=>{const t=this._preserveFrameSrcOnNavigationRender,r=!t;r&&!jn()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:t,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});$(this,"handleArtifactContentChanged",t=>{var s;const r=t.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((s=this._documentHost)!=null&&s.handleArtifactContentChanged(r))||this.reloadProxyFrame()});$(this,"handleThemeChanged",()=>{var t;((t=this._artifact)==null?void 0:t.kind)==="url"&&Tn(this._artifact.url)||this.reloadProxyFrame()});$(this,"handleWebviewDidNavigate",t=>{this.handleWebviewNavigationEvent(t)});$(this,"handleWebviewDidNavigateInPage",t=>{this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(t)||(this._preserveFrameSrcOnNavigationRender=!1)});$(this,"captureDocumentHost",t=>{this._documentHost=t,this._pendingDocumentSource&&(t.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});$(this,"handleEmbedLoadChange",t=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",t)});$(this,"handleDocumentFrameChange",t=>{t===null&&this.resetTrustedFrame(),this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(t),this.syncWebviewSubscription(t)});$(this,"handleTitleBarDoubleClick",t=>{const r=t.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(t,r){var u;const[i,s,o]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==s){const f=c?!XL(c,s):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=s,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&QL(c,s)){const m=this.currentMissingArtifactMessage();m&&((u=this._missingArtifactReplyTransport)==null||u.send(m))}}else f&&this.resetTrustedFrame()}return this._viewURL!==o.viewURL&&(this._viewURL=o.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==o.contentURL&&(this._contentURL=o.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==o.fullScreen&&(this._fullScreen=o.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=o.inert,this._onFullScreenChange=o.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(t,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var t;this._connected=!1,(t=this._dialogPresentation)==null||t.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(t,r){var i;switch(t.type){case"url-target-request":r.send({type:bb,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const s=this.currentMissingArtifactMessage();s&&(this._missingArtifactReplyTransport=r,r.send(s));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(t);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(t.key);return;case"bridge-ready":case"leaving":return}}currentExternalTargetURL(){var r,i;const t=((r=this._navigationState)==null?void 0:r.currentURL)??null;return t&&JL(t)?t:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const t=this._artifact;return(t==null?void 0:t.kind)!=="path"?null:{type:_b,title:t.title,path:t.path}}handleProxyContentChanged(){var t;((t=this._artifact)==null?void 0:t.kind)!=="url"||!Tn(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(t){this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===GL||i===r.currentURL)return;const s=t.native===!0;(t.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),t.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact){this.disposeNavigationState();return}const t=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===t||(this.disposeNavigationState(),this._navigationState=new u5(this._artifact.id,t),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=t,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var t;(t=this._navigationState)==null||t.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(t){const r=Sc({artifact:t,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return t.kind==="url"&&Tn(t.url)||r.renderer==="url-webview"?qn(i):Ig(i,i)}convertIframeNavigationURL(t){var i,s;if(((i=this._artifact)==null?void 0:i.kind)==="url"&&Tn(this._artifact.url)&&Tn(t))return qn(t);const r=(s=this.currentFrame)==null?void 0:s.getAttribute("src");return Ig(t,r??this._viewURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string")return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=qn(r);return s===i.currentURL?!1:(i.navigate(s),!0)}syncWebviewSubscription(t=this.currentFrame){const r=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var t;return((t=this._documentHost)==null?void 0:t.currentFrame)??null}syncFrameSubscriptions(){const t=this.currentFrame;this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(t),this.syncWebviewSubscription(t)}syncFrameTitle(t){t&&this._artifact&&t.getAttribute("title")!==this._artifact.title&&t.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(t={}){var f,m,g;const r=this._artifact;if(!r)return;t.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},s=Sc(i),o=(m=this.currentFrame)==null?void 0:m.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(e2(this._activeReloadFrameSrc,s.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=t.frameSrcOverride??l??(t.preserveFrameSrc&&o?o:s.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(g=this._documentHost)==null||g.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var o,l,c,u,f;const t=this.currentFrame;if(!t||t.hasAttribute("data-content-url")||t.tagName.toLowerCase()==="webview"&&!(((o=this._artifact)==null?void 0:o.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Tn(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Tn(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??t.getAttribute("src"):t.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(no,String(++this._proxyReloadVersion));const s=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:s,resetTrust:!0})}forceCurrentFrameSrc(){var s,o,l;if(!this._artifact)return;const t=Sc({artifact:this._artifact,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((s=this._navigationState)==null?void 0:s.currentURL)??null});if(t.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(o=this._rootRef.value)==null||o.removeAttribute("data-embed-loaded"),i.setAttribute("src",t.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var r;const t=(r=this._rootRef.value)==null?void 0:r.querySelector(".menu");t&&typeof t.hidePopover=="function"&&t.matches(":popover-open")&&t.hidePopover()}requestFullScreen(t){this.closeMenu(),this._onFullScreenChange(t)}showDeleteConfirmation(){var r,i,s;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const t=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");t&&(this._dialogPresentation=Uu(t,()=>this.dismissDeleteConfirmation()),(s=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||s.focus())}dismissDeleteConfirmation(){const t=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,t==null||t.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const t=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!t||!r)&&r.deleteArtifact(t).catch(()=>{})}navigationControlsTemplate(){const t=this._navigationState;return!t||!t.canGoBack&&!t.canGoForward?null:V`
|
|
246
|
+
`)},rn=new WeakMap,$c=function(){var s;const t=a(this,ft),r=t?`${t.tagName.toLowerCase()}:${t.getAttribute("src")??""}:${t.dataset.contentUrl??""}`:null;if(t&&t===a(this,Rt)&&r===a(this,vi)||(h(this,B,jo).call(this),a(this,mi).call(this,!1),!t||!r||!this.isConnected))return;if(d(this,Rt,t),d(this,vi,r),t.tagName.toLowerCase()==="webview"){t.addEventListener("did-finish-load",a(this,rn)),t.addEventListener("did-fail-load",a(this,rn));return}t.addEventListener("load",a(this,rn));const i=t;try{i.isConnected&&((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&a(this,rn).call(this)}catch{}},jo=function(){if(!a(this,Rt)){d(this,vi,null);return}a(this,Rt).removeEventListener("load",a(this,rn)),a(this,Rt).removeEventListener("did-finish-load",a(this,rn)),a(this,Rt).removeEventListener("did-fail-load",a(this,rn)),d(this,Rt,null),d(this,vi,null)},Qd=function(){const t=a(this,ze),r=a(this,ft),i=(r==null?void 0:r.dataset.contentUrl)??null,s=(t==null?void 0:t.artifact.id)??null;if(!t||!r||!i||!s){h(this,B,qr).call(this,{clearContent:!0});return}if(r!==a(this,Ms)||s!==a(this,Zs)){h(this,B,qr).call(this),d(this,Ms,r),d(this,Us,i),d(this,Zs,s);const o=r.tagName.toLowerCase()==="webview"?new I5(r):new R5(r);d(this,pt,o),o.handleUpdateContent(async l=>{const c=a(this,ze),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,nn,l),a(this,pt)===o&&(o.content=l)}),a(this,nn)!==null&&(o.content=a(this,nn))}else d(this,Us,i);h(this,B,s2).call(this)},s2=function(){const t=a(this,ze),r=t==null?void 0:t.application;!t||!r||!a(this,pt)||a(this,ur)===t.artifact.id&&a(this,hr)===r||(d(this,ur,t.artifact.id),d(this,hr,r),h(this,B,ef).call(this))},ef=async function(){var s,o;const t=a(this,ze),r=t==null?void 0:t.application;if(!t||!r)return;const i=t.artifact.id;try{const l=await r.readMarkdown(i);if(((s=a(this,ze))==null?void 0:s.artifact.id)!==i||a(this,ze).application!==r)return;d(this,yi,null),d(this,nn,l);const c=a(this,pt);if(!c){h(this,B,Ec).call(this);return}c.content=l}catch(l){if(((o=a(this,ze))==null?void 0:o.artifact.id)!==i||a(this,ze).application!==r)return;if(l instanceof po&&l.status===BL){d(this,yi,i),d(this,nn,null),h(this,B,qr).call(this),h(this,B,Ec).call(this);return}d(this,ur,null),d(this,hr,null)}},tf=function(){var r;const t=(r=a(this,ze))==null?void 0:r.artifact;return a(this,yi)===(t==null?void 0:t.id)&&t.kind==="path"&&ly(t.path)},qr=function(t={}){var r;(r=a(this,pt))==null||r.dispose(),d(this,pt,null),d(this,Ms,null),d(this,Us,null),d(this,Zs,null),d(this,ur,null),d(this,hr,null),t.clearContent&&d(this,nn,null)};const WL=kt(jL);function Pg(n){return n.startsWith("http://")||n.startsWith("https://")}function GL(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function YL(n,e){return n.id!==e.id||n.kind!==e.kind?!1:n.kind==="path"&&e.kind==="path"?n.path===e.path:n.kind==="url"&&e.kind==="url"?n.url===e.url:!0}var qa,Fs,sn,Mn,dr,fr,pr,ja,Wa,Ga,Ya,at,nf,Cc,Tc;class KL{constructor(e,t=()=>{}){g(this,at);g(this,qa);g(this,Fs);g(this,sn,null);g(this,Mn,null);g(this,dr,null);g(this,fr,null);g(this,pr,!1);g(this,ja,e=>{const t=Lg(e.data);if(!t)return;const r=a(this,dr);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,s=i.contentWindow;if(s===null)return;const o=t.type==="leaving",l=t.type==="navigation-request"&&t.native===!0&&t.sameDocument!==!0,c=s===e.source,u=(o||l)&&a(this,Mn)!==null&&a(this,Mn)===e.source,f=o&&XL(i)===e.origin;!c&&!u&&!f||h(this,at,nf).call(this,t,i,{send:m=>{var v;return(v=i.contentWindow)==null?void 0:v.postMessage(m,"*")}})});g(this,Wa,e=>{var s;const t=e.detail??e;if(!t||t.channel!==Dg)return;const r=Lg((s=t.args)==null?void 0:s[0]),i=a(this,fr);!r||!i||h(this,at,nf).call(this,r,i,{send:o=>{var l;return(l=i.send)==null?void 0:l.call(i,Dg,o)}})});g(this,Ga,e=>{const t=Og(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});g(this,Ya,e=>{Og(e).isMainFrame!==!1&&this.reset()});d(this,qa,e),d(this,Fs,t)}get currentGuid(){return a(this,sn)}get lifecycleWindow(){return a(this,Mn)}get trustState(){return{currentGuid:a(this,sn),lifecycleWindow:a(this,Mn)}}connect(){a(this,pr)||(d(this,pr,!0),window.addEventListener("message",a(this,ja)),h(this,at,Cc).call(this))}disconnect(){a(this,pr)&&(window.removeEventListener("message",a(this,ja)),d(this,pr,!1),h(this,at,Tc).call(this))}reset(){d(this,sn,null),d(this,Mn,null),a(this,Fs).call(this)}setCurrentFrame(e){if(e===a(this,dr)){h(this,at,Cc).call(this);return}h(this,at,Tc).call(this),a(this,dr)!==null&&this.reset(),d(this,dr,JL(e)?e:null),h(this,at,Cc).call(this)}}qa=new WeakMap,Fs=new WeakMap,sn=new WeakMap,Mn=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,ja=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,Ya=new WeakMap,at=new WeakSet,nf=function(e,t,r){e.type==="bridge-ready"&&e.guid!==a(this,sn)?(a(this,sn)!==null&&a(this,Fs).call(this),d(this,sn,e.guid),d(this,Mn,t.tagName.toLowerCase()==="iframe"?t.contentWindow:null)):e.type==="leaving"&&e.guid===a(this,sn)&&this.reset(),a(this,qa).call(this,e,r)},Cc=function(){if(!a(this,pr))return;const e=a(this,dr),t=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;t!==a(this,fr)&&(h(this,at,Tc).call(this),t&&(t.addEventListener("ipc-message",a(this,Wa)),t.addEventListener("did-start-navigation",a(this,Ga)),t.addEventListener("did-fail-load",a(this,Ya)),d(this,fr,t)))},Tc=function(){const e=a(this,fr);e&&(e.removeEventListener("ipc-message",a(this,Wa)),e.removeEventListener("did-start-navigation",a(this,Ga)),e.removeEventListener("did-fail-load",a(this,Ya)),d(this,fr,null))};const Dg="television-artifact-bridge";function Lg(n){return wb(n)||bb(n)||_b(n)||Sb(n)||Ab(n)||kb(n)||Eb(n)?n:null}function JL(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function XL(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function Og(n){return n.detail??n}const QL="/views/url-unsupported/";class eO extends At{constructor(){super(...arguments);$(this,"_artifact",null);$(this,"_viewURL",null);$(this,"_contentURL",null);$(this,"_application",null);$(this,"_fullScreen",!1);$(this,"_inert",!1);$(this,"_onFullScreenChange",()=>{});$(this,"_connected",!1);$(this,"_deleteConfirmationOpen",!1);$(this,"_dialogPresentation",null);$(this,"_subscribedWebview",null);$(this,"_documentHost",null);$(this,"_pendingDocumentSource",null);$(this,"_rootRef",Cr());$(this,"_trustedChannel",new KL((t,r)=>{this.handleTrustedFrameMessage(t,r)},()=>{this._missingArtifactReplyTransport=null}));$(this,"_activeReloadFrameSrc",null);$(this,"_applicationSubscriptionsAttached",!1);$(this,"_proxyReloadVersion",0);$(this,"_navigationState",null);$(this,"_navigationArtifactId",null);$(this,"_navigationCanonicalURL",null);$(this,"_preserveFrameSrcOnNavigationRender",!1);$(this,"_missingArtifactReplyTransport",null);$(this,"handleNavigationChange",()=>{const t=this._preserveFrameSrcOnNavigationRender,r=!t;r&&!jn()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:t,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});$(this,"handleArtifactContentChanged",t=>{var s;const r=t.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((s=this._documentHost)!=null&&s.handleArtifactContentChanged(r))||this.reloadProxyFrame()});$(this,"handleThemeChanged",()=>{var t;((t=this._artifact)==null?void 0:t.kind)==="url"&&Rn(this._artifact.url)||this.reloadProxyFrame()});$(this,"handleWebviewDidNavigate",t=>{this.handleWebviewNavigationEvent(t)});$(this,"handleWebviewDidNavigateInPage",t=>{this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(t)||(this._preserveFrameSrcOnNavigationRender=!1)});$(this,"captureDocumentHost",t=>{this._documentHost=t,this._pendingDocumentSource&&(t.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});$(this,"handleEmbedLoadChange",t=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",t)});$(this,"handleDocumentFrameChange",t=>{t===null&&this.resetTrustedFrame(),this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(t),this.syncWebviewSubscription(t)});$(this,"handleTitleBarDoubleClick",t=>{const r=t.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(t,r){var u;const[i,s,o]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==s){const f=c?!rO(c,s):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=s,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&iO(c,s)){const m=this.currentMissingArtifactMessage();m&&((u=this._missingArtifactReplyTransport)==null||u.send(m))}}else f&&this.resetTrustedFrame()}return this._viewURL!==o.viewURL&&(this._viewURL=o.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==o.contentURL&&(this._contentURL=o.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==o.fullScreen&&(this._fullScreen=o.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=o.inert,this._onFullScreenChange=o.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(t,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var t;this._connected=!1,(t=this._dialogPresentation)==null||t.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(t,r){var i;switch(t.type){case"url-target-request":r.send({type:$b,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const s=this.currentMissingArtifactMessage();s&&(this._missingArtifactReplyTransport=r,r.send(s));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(t);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(t.key);return;case"bridge-ready":case"leaving":return}}currentExternalTargetURL(){var r,i;const t=((r=this._navigationState)==null?void 0:r.currentURL)??null;return t&&nO(t)?t:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const t=this._artifact;return(t==null?void 0:t.kind)!=="path"?null:{type:Cb,title:t.title,path:t.path}}handleProxyContentChanged(){var t;((t=this._artifact)==null?void 0:t.kind)!=="url"||!Rn(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(t){this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===QL||i===r.currentURL)return;const s=t.native===!0;(t.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),t.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact){this.disposeNavigationState();return}const t=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===t||(this.disposeNavigationState(),this._navigationState=new m5(this._artifact.id,t),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=t,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var t;(t=this._navigationState)==null||t.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(t){const r=kc({artifact:t,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return t.kind==="url"&&Rn(t.url)||r.renderer==="url-webview"?Wn(i):zg(i,i)}convertIframeNavigationURL(t){var i,s;if(((i=this._artifact)==null?void 0:i.kind)==="url"&&Rn(this._artifact.url)&&Rn(t))return Wn(t);const r=(s=this.currentFrame)==null?void 0:s.getAttribute("src");return zg(t,r??this._viewURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string")return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=Wn(r);return s===i.currentURL?!1:(i.navigate(s),!0)}syncWebviewSubscription(t=this.currentFrame){const r=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var t;return((t=this._documentHost)==null?void 0:t.currentFrame)??null}syncFrameSubscriptions(){const t=this.currentFrame;this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(t),this.syncWebviewSubscription(t)}syncFrameTitle(t){t&&this._artifact&&t.getAttribute("title")!==this._artifact.title&&t.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(t={}){var f,m,v;const r=this._artifact;if(!r)return;t.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},s=kc(i),o=(m=this.currentFrame)==null?void 0:m.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(o2(this._activeReloadFrameSrc,s.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=t.frameSrcOverride??l??(t.preserveFrameSrc&&o?o:s.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(v=this._documentHost)==null||v.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var o,l,c,u,f;const t=this.currentFrame;if(!t||t.hasAttribute("data-content-url")||t.tagName.toLowerCase()==="webview"&&!(((o=this._artifact)==null?void 0:o.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Rn(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Rn(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??t.getAttribute("src"):t.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(ro,String(++this._proxyReloadVersion));const s=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:s,resetTrust:!0})}forceCurrentFrameSrc(){var s,o,l;if(!this._artifact)return;const t=kc({artifact:this._artifact,application:this._application,electron:jn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((s=this._navigationState)==null?void 0:s.currentURL)??null});if(t.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(o=this._rootRef.value)==null||o.removeAttribute("data-embed-loaded"),i.setAttribute("src",t.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var r;const t=(r=this._rootRef.value)==null?void 0:r.querySelector(".menu");t&&typeof t.hidePopover=="function"&&t.matches(":popover-open")&&t.hidePopover()}requestFullScreen(t){this.closeMenu(),this._onFullScreenChange(t)}showDeleteConfirmation(){var r,i,s;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const t=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");t&&(this._dialogPresentation=Fu(t,()=>this.dismissDeleteConfirmation()),(s=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||s.focus())}dismissDeleteConfirmation(){const t=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,t==null||t.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const t=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!t||!r)&&r.deleteArtifact(t).catch(()=>{})}navigationControlsTemplate(){const t=this._navigationState;return!t||!t.canGoBack&&!t.canGoForward?null:V`
|
|
247
247
|
<button
|
|
248
248
|
icon-only
|
|
249
249
|
size="sm"
|
|
@@ -267,7 +267,7 @@ tv-desktop
|
|
|
267
267
|
<tv-icon name="forward" size="sm"></tv-icon>
|
|
268
268
|
</button>
|
|
269
269
|
<span class="artifact-bar-divider" aria-hidden="true"></span>
|
|
270
|
-
`}deleteConfirmationTemplate(){return!this._deleteConfirmationOpen||!this._artifact?null:
|
|
270
|
+
`}deleteConfirmationTemplate(){return!this._deleteConfirmationOpen||!this._artifact?null:Zu(V`
|
|
271
271
|
<div class="dialog-alert" role="alertdialog">
|
|
272
272
|
<h2>Delete “${this._artifact.title}”?</h2>
|
|
273
273
|
<p>It’s removed from this channel; the file or web page it points to is not deleted.</p>
|
|
@@ -283,14 +283,14 @@ tv-desktop
|
|
|
283
283
|
?full-screen=${this._fullScreen}
|
|
284
284
|
?inert=${this._inert}
|
|
285
285
|
._trustedChannel=${this._trustedChannel}
|
|
286
|
-
${
|
|
286
|
+
${mn(this._rootRef)}
|
|
287
287
|
>
|
|
288
|
-
${
|
|
288
|
+
${WL(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
|
|
289
289
|
<footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
|
|
290
290
|
<tv-icon name="artifact" size="sm"></tv-icon>
|
|
291
291
|
<span class="artifact-title">${s.title}</span>
|
|
292
292
|
${this.navigationControlsTemplate()}
|
|
293
|
-
${
|
|
293
|
+
${Lw(this.menuEntries(),{placement:"top-end",trigger:o=>V`
|
|
294
294
|
<button
|
|
295
295
|
icon-only
|
|
296
296
|
size="sm"
|
|
@@ -305,11 +305,11 @@ tv-desktop
|
|
|
305
305
|
</footer>
|
|
306
306
|
${this.deleteConfirmationTemplate()}
|
|
307
307
|
</div>
|
|
308
|
-
`}renderArtifact(t={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:t.preserveFrameSrc??!1,frameSrcOverride:t.frameSrcOverride,resetTrust:t.resetTrust}),this.render(),t.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const
|
|
308
|
+
`}renderArtifact(t={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:t.preserveFrameSrc??!1,frameSrcOverride:t.frameSrcOverride,resetTrust:t.resetTrust}),this.render(),t.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const tO=kt(eO);function nO(n){return n.startsWith("http://")||n.startsWith("https://")}function rO(n,e){return n.id!==e.id||n.kind!==e.kind?!1:n.kind==="path"&&e.kind==="path"?n.path===e.path:n.kind==="url"&&e.kind==="url"?o2(n.url,e.url):!0}function iO(n,e){return n.kind==="path"&&e.kind==="path"&&n.id===e.id&&(n.title!==e.title||n.path!==e.path)}function o2(n,e){try{const t=new URL(n,window.location.href),r=new URL(e,window.location.href);return t.searchParams.delete(ro),r.searchParams.delete(ro),t.origin===r.origin&&t.pathname===r.pathname&&t.search===r.search}catch{return!1}}function zg(n,e){try{const t=new URL(n,window.location.href);if(e){const r=new URL(e,window.location.href);if(t.origin===r.origin)return t.searchParams.delete(ro),`${t.pathname}${t.search}${t.hash}`}}catch{return Wn(n)}return Wn(n)}function a2(n,e,t,r,i){const s=e.pages.map(o=>({artifactIds:[...o.artifactIds],geometry:{...o.geometry,full_screen:o===t?i:o.geometry.full_screen},size:o===t?{...r}:{...o.size}}));n.updateChannelPages(e.id,s).catch(()=>{})}function rf(n,e,t,r){a2(n,e,t,t.size,r)}const sO=1280,oO=800,Ng=.4,Mg=.4,l2=280,aO=14,lO=45,cO=16,Ug=64,uO=100,hO=1,dO=230,fO=230;function vp(n){return{width:1-Ng+Ng*n.width/sO,height:1-Mg+Mg*n.height/oO}}function c2(n){return{width:Math.min(dO,n.width),height:Math.min(fO,n.height)}}function Zg(n,e){const t=vp(e),r=c2(e);return{width:Math.min(e.width,Math.max(r.width,n.width*t.width)),height:Math.min(e.height,Math.max(r.height,n.height*t.height))}}function pO(n,e){const t=vp(e);return{width:n.width/t.width,height:n.height/t.height}}const Bh=.5,mO=4,Wl=2,gO=120,vO=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var wi,on,Hs,Un,Vs,bi,mr,gr,vr,Zn,_i,Si,an,Bs,Fn,ln,Ve,Ai,L,u2,h2,Wo,d2,Go,sf,Rc,f2,Ka,Ja,Xa,Qa,ki,el,of,Zt,af,cs,p2,m2,Ic,xc;class yO extends At{constructor(){super(...arguments);g(this,L);g(this,wi,Cr());g(this,on,Cr());g(this,Hs);g(this,Un);g(this,Vs);g(this,bi);g(this,mr);g(this,gr,0);g(this,vr,0);g(this,Zn,null);g(this,_i,null);g(this,Si,null);g(this,an,null);g(this,Bs,[]);g(this,Fn,null);g(this,ln,null);g(this,Ve,null);g(this,Ai,new Set);g(this,Ka,t=>{const r=a(this,Ve);!r||t.pointerId!==r.pointerId||(r.lastPointer={x:t.clientX,y:t.clientY},r.option=t.altKey,h(this,L,of).call(this,r))});g(this,Ja,t=>{var r;t.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,L,Zt).call(this,!0)});g(this,Xa,t=>{var r;t.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,L,Zt).call(this,!1)});g(this,Qa,t=>{var r;t.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,L,Zt).call(this,!1)});g(this,ki,t=>{const r=a(this,Ve);if(r){if(t.type==="keydown"&&t.key==="Escape"){t.preventDefault(),h(this,L,Zt).call(this,!1);return}r.option!==t.altKey&&(r.option=t.altKey,h(this,L,of).call(this,r))}});g(this,el,()=>{const t=a(this,Ve);!t||Fg(h(this,L,Wo).call(this,t.filmstrip),t.pageBox)||(h(this,L,sf).call(this),h(this,L,Zt).call(this,!1))})}connected(){d(this,Hs,void 0),d(this,Un,void 0),d(this,Vs,void 0),d(this,bi,void 0),d(this,mr,void 0)}template(t,r,i){var re;const s=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,o=bO(r,(s==null?void 0:s.pages)??(r==null?void 0:r.pages)),l=(r==null?void 0:r.selectedPage)??null,c=(r==null?void 0:r.id)??null,u=(l==null?void 0:l.artifactIds[0])??null,f=(l==null?void 0:l.geometry.full_screen)??null,m=a(this,bi)!==void 0,v=o.map(({key:Q,page:oe})=>`${Q}:${oe.geometry.full_screen}:${oe.size.width}:${oe.size.height}`).sort().join("|"),y=s===null?null:o.map(({key:Q})=>Q).join("|"),k=c!==a(this,Hs),S=u!==a(this,Un),x=f!==a(this,Vs),M=v!==a(this,bi),Z=y!==a(this,mr),F=s!==null&&a(this,mr)!==void 0&&a(this,mr)!==null&&Z?h(this,L,p2).call(this):null,W=S&&!k&&a(this,Un)!==void 0&&a(this,Un)!==null&&u!==null;return a(this,Ve)&&(k||S||x)&&h(this,L,Zt).call(this,!1),d(this,Hs,c),d(this,Un,u),d(this,Vs,f),d(this,bi,v),d(this,mr,y),d(this,Bs,o),M&&m&&h(this,L,Rc).call(this),k&&((re=a(this,an))==null||re.disconnect(),d(this,_i,null),d(this,Si,null),d(this,Fn,null)),queueMicrotask(()=>h(this,L,Go).call(this)),k||S||M?queueMicrotask(()=>h(this,L,u2).call(this,u,W)):Z&&queueMicrotask(()=>{const Q=a(this,on).value;Q&&(h(this,L,cs).call(this,Q,u,!1),F&&h(this,L,m2).call(this,F))}),V`
|
|
309
309
|
<section
|
|
310
310
|
class="stage"
|
|
311
|
-
${
|
|
312
|
-
style=${`--handle-band: ${
|
|
311
|
+
${mn(a(this,wi))}
|
|
312
|
+
style=${`--handle-band: ${aO}px; --handle-reach: ${lO}px; --handle-thickness: ${cO}px;`}
|
|
313
313
|
>
|
|
314
314
|
${r!==null&&o.length===0?V`
|
|
315
315
|
<div class="stage-empty">
|
|
@@ -318,24 +318,24 @@ tv-desktop
|
|
|
318
318
|
</div>
|
|
319
319
|
`:null}
|
|
320
320
|
${jc([c],Q=>Q,()=>V`
|
|
321
|
-
<div class="filmstrip" ${
|
|
321
|
+
<div class="filmstrip" ${mn(a(this,on))}>
|
|
322
322
|
<div class="filmstrip-inner" ?tab-held=${s!==null}>
|
|
323
|
-
${jc(o,({key:Q})=>Q,({page:Q,artifact:oe,key:
|
|
323
|
+
${jc(o,({key:Q})=>Q,({page:Q,artifact:oe,key:yn})=>{if(r===null)return null;const wn=yn===u;return V`
|
|
324
324
|
<div
|
|
325
325
|
class="page"
|
|
326
|
-
data-page-key=${
|
|
327
|
-
?selected=${
|
|
326
|
+
data-page-key=${yn}
|
|
327
|
+
?selected=${wn}
|
|
328
328
|
?full-screen=${Q.geometry.full_screen}
|
|
329
|
-
style=${h(this,L,
|
|
330
|
-
@click=${
|
|
329
|
+
style=${h(this,L,d2).call(this,Q)}
|
|
330
|
+
@click=${wn||oe===null?null:()=>t.selectPage(r.id,oe.id)}
|
|
331
331
|
>
|
|
332
|
-
${oe?
|
|
333
|
-
${
|
|
332
|
+
${oe?tO(t,oe,{viewURL:t.getArtifactViewURL(oe),contentURL:t.getArtifactContentURL(oe),fullScreen:Q.geometry.full_screen,inert:!wn,onFullScreenChange:we=>rf(t,r,Q,we)}):null}
|
|
333
|
+
${wn?V`
|
|
334
334
|
<div class="page-handles" aria-hidden="true">
|
|
335
|
-
${
|
|
335
|
+
${vO.map(we=>V`
|
|
336
336
|
<span
|
|
337
337
|
class="page-handle ${we}"
|
|
338
|
-
@pointerdown=${
|
|
338
|
+
@pointerdown=${bn=>h(this,L,f2).call(this,bn,we,t,r,Q,yn)}
|
|
339
339
|
></span>
|
|
340
340
|
`)}
|
|
341
341
|
</div>
|
|
@@ -346,37 +346,37 @@ tv-desktop
|
|
|
346
346
|
</div>
|
|
347
347
|
`)}
|
|
348
348
|
</section>
|
|
349
|
-
`}disconnected(){var t;h(this,L,Zt).call(this,!1),h(this,L,
|
|
349
|
+
`}disconnected(){var t;h(this,L,Zt).call(this,!1),h(this,L,Rc).call(this),h(this,L,xc).call(this),cancelAnimationFrame(a(this,gr)),d(this,gr,0),(t=a(this,an))==null||t.disconnect(),d(this,an,null),d(this,_i,null),d(this,Si,null),d(this,Fn,null),d(this,Bs,[]);for(const r of a(this,Ai))r.cancel();a(this,Ai).clear()}}wi=new WeakMap,on=new WeakMap,Hs=new WeakMap,Un=new WeakMap,Vs=new WeakMap,bi=new WeakMap,mr=new WeakMap,gr=new WeakMap,vr=new WeakMap,Zn=new WeakMap,_i=new WeakMap,Si=new WeakMap,an=new WeakMap,Bs=new WeakMap,Fn=new WeakMap,ln=new WeakMap,Ve=new WeakMap,Ai=new WeakMap,L=new WeakSet,u2=function(t,r){const i=a(this,on).value;i&&(cancelAnimationFrame(a(this,gr)),d(this,gr,requestAnimationFrame(()=>{d(this,gr,0),h(this,L,cs).call(this,i,t,r)})))},h2=function(t,r){var i;typeof ResizeObserver>"u"||t===a(this,_i)&&r===a(this,Si)||((i=a(this,an))==null||i.disconnect(),d(this,_i,t),d(this,Si,r),d(this,an,new ResizeObserver(()=>{const s=h(this,L,Wo).call(this,t);Fg(s,a(this,Fn))||(h(this,L,sf).call(this),a(this,Ve)&&h(this,L,Zt).call(this,!1),h(this,L,Go).call(this,t)),a(this,Zn)===null&&h(this,L,cs).call(this,t,a(this,Un)??null,!1)})),a(this,an).observe(t),a(this,an).observe(r))},Wo=function(t){const r=Number.parseFloat(getComputedStyle(t).getPropertyValue("--stage-inset"))||0;return{width:Math.max(0,t.clientWidth-2*r),height:Math.max(0,t.clientHeight-r)}},d2=function(t){if(t.geometry.full_screen||a(this,Fn)===null)return"";const r=Zg(t.size,a(this,Fn));return`width: ${r.width}px; height: ${r.height}px;`},Go=function(t=a(this,on).value){var s;if(!t)return;const r=h(this,L,Wo).call(this,t);d(this,Fn,r);const i=new Map(a(this,Bs).map(o=>[o.key,o.page]));for(const o of t.querySelectorAll(".page")){if(o===((s=a(this,Ve))==null?void 0:s.pageElement))continue;const l=i.get(o.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){o.style.width="",o.style.height="";continue}const c=Zg(l.size,r);o.style.width=`${c.width}px`,o.style.height=`${c.height}px`}},sf=function(){const t=a(this,wi).value;t&&(t.setAttribute("window-tracking",""),a(this,ln)!==null&&clearTimeout(a(this,ln)),d(this,ln,setTimeout(()=>{d(this,ln,null),t.removeAttribute("window-tracking")},gO)))},Rc=function(){var t;a(this,ln)!==null&&(clearTimeout(a(this,ln)),d(this,ln,null)),(t=a(this,wi).value)==null||t.removeAttribute("window-tracking")},f2=function(t,r,i,s,o,l){if(t.button!==0||!t.isPrimary)return;const c=t.currentTarget,u=c.closest(".page"),f=a(this,on).value,m=a(this,wi).value;if(!u||!f||!m)return;h(this,L,Zt).call(this,!1),h(this,L,Rc).call(this),t.preventDefault(),t.stopPropagation();const v=u.getBoundingClientRect(),y=h(this,L,Wo).call(this,f),k=vp(y),S=o.geometry.full_screen,x=r.includes("left")||r.includes("right"),M=r.includes("top")||r.includes("bottom");d(this,Ve,{application:i,channel:s,page:o,pageKey:l,pageElement:u,filmstrip:f,stage:m,handle:c,pointerId:t.pointerId,startPointer:{x:t.clientX,y:t.clientY},lastPointer:{x:t.clientX,y:t.clientY},startRendered:{width:v.width,height:v.height},rendered:{width:v.width,height:v.height},baselineSize:S?{width:y.width/k.width,height:y.height/k.height}:{...o.size},pageBox:y,wasFullScreen:S,horizontal:x,vertical:M,leftish:r.includes("left"),topish:r.includes("top"),option:t.altKey,armed:!1,leftFullScreen:!1}),m.setAttribute("resizing",""),c.addEventListener("pointermove",a(this,Ka)),c.addEventListener("pointerup",a(this,Ja)),c.addEventListener("pointercancel",a(this,Xa)),c.addEventListener("lostpointercapture",a(this,Qa)),window.addEventListener("keydown",a(this,ki)),window.addEventListener("keyup",a(this,ki)),window.addEventListener("resize",a(this,el)),c.setPointerCapture(t.pointerId)},Ka=new WeakMap,Ja=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,ki=new WeakMap,el=new WeakMap,of=function(t){const r=t.lastPointer.x!==t.startPointer.x||t.lastPointer.y!==t.startPointer.y;if(t.wasFullScreen&&!t.leftFullScreen){if(!r)return;t.leftFullScreen=!0,t.pageElement.removeAttribute("full-screen")}const i=c2(t.pageBox);let s=t.startRendered.width,o=t.startRendered.height;if(t.horizontal){const l=t.leftish?-Wl:Wl;s=Math.min(t.pageBox.width,Math.max(i.width,t.startRendered.width+(t.lastPointer.x-t.startPointer.x)*l))}if(t.vertical){const l=t.topish?-Wl:Wl;o=Math.min(t.pageBox.height,Math.max(i.height,t.startRendered.height+(t.lastPointer.y-t.startPointer.y)*l))}t.armed=!t.option&&t.horizontal&&t.vertical&&s>=t.pageBox.width-Ug&&o>=t.pageBox.height-Ug,t.rendered=t.armed?{...t.pageBox}:{width:s,height:o},t.pageElement.style.width=`${t.rendered.width}px`,t.pageElement.style.height=`${t.rendered.height}px`,h(this,L,af).call(this,t.stage,t.armed),h(this,L,cs).call(this,t.filmstrip,t.pageKey,!1)},Zt=function(t){const r=a(this,Ve);if(r){if(d(this,Ve,null),r.handle.removeEventListener("pointermove",a(this,Ka)),r.handle.removeEventListener("pointerup",a(this,Ja)),r.handle.removeEventListener("pointercancel",a(this,Xa)),r.handle.removeEventListener("lostpointercapture",a(this,Qa)),window.removeEventListener("keydown",a(this,ki)),window.removeEventListener("keyup",a(this,ki)),window.removeEventListener("resize",a(this,el)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,L,af).call(this,r.stage,!1),t&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),rf(r.application,r.channel,r.page,!0);else if(t){const i={...r.baselineSize},s=pO(r.rendered,r.pageBox);let o=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=s.width,o=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=s.height,o=!0),o?a2(r.application,r.channel,r.page,i,!1):h(this,L,Go).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,L,Go).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,L,cs).call(this,r.filmstrip,r.pageKey,!1)}},af=function(t,r){const i=t.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const s=document.createElement("div");s.className="snap-outline",s.setAttribute("aria-hidden","true"),t.append(s)},cs=function(t,r,i){const s=[...t.querySelectorAll(".page")].find(v=>v.dataset.pageKey===r);if(!s){h(this,L,xc).call(this);return}h(this,L,h2).call(this,t,s);const o=s.getBoundingClientRect(),l=t.getBoundingClientRect(),c=Math.max(0,Math.min(t.scrollLeft+o.left+o.width/2-(l.left+l.width/2),t.scrollWidth-t.clientWidth));if(h(this,L,xc).call(this),!i||Math.abs(c-t.scrollLeft)<Bh||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;for(let v=0;v<mO;v+=1){h(this,L,Ic).call(this,t);const y=s.getBoundingClientRect(),k=t.getBoundingClientRect(),S=y.left+y.width/2-(k.left+k.width/2);if(Math.abs(S)<Bh)break;t.scrollLeft+=S}h(this,L,Ic).call(this,t);return}const u=t.scrollLeft,f=t.animate([{},{}],{duration:l2,easing:"ease"});d(this,Zn,f);const m=()=>{var y;if(f!==a(this,Zn))return;const v=f.playState==="finished"?1:((y=f.effect)==null?void 0:y.getComputedTiming().progress)??0;t.scrollLeft=u+(c-u)*v,h(this,L,Ic).call(this,t),f.playState==="finished"?(t.scrollLeft=c,d(this,Zn,null),d(this,vr,0)):d(this,vr,requestAnimationFrame(m))};d(this,vr,requestAnimationFrame(m))},p2=function(){const t=a(this,on).value;return t?new Map([...t.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},m2=function(t){const r=a(this,on).value,i=r==null?void 0:r.querySelector(".filmstrip-inner");if(!r||!i)return;const s=i.clientWidth===0?1:i.getBoundingClientRect().width/i.clientWidth;for(const o of r.querySelectorAll(".page")){if(o.hasAttribute("selected"))continue;const l=t.get(o.dataset.pageKey??"");if(l===void 0)continue;const c=(l-o.getBoundingClientRect().left)/(s||1);if(Math.abs(c)<=Bh)continue;const u=o.animate({translate:[`${c}px 0`,"0px 0"]},{duration:ps,easing:"ease"});a(this,Ai).add(u),u.finished.finally(()=>{a(this,Ai).delete(u)}).catch(()=>{})}},Ic=function(t){const r=t.querySelector(".filmstrip-inner");r&&(r.style.transformOrigin=`${t.scrollLeft+t.clientWidth/2}px center`)},xc=function(){var t;cancelAnimationFrame(a(this,vr)),d(this,vr,0),(t=a(this,Zn))==null||t.cancel(),d(this,Zn,null)};const wO=kt(yO);function bO(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{const s=r.artifactIds[0];return{page:r,artifact:s===void 0?null:t.get(s)??null,key:s??`empty-page-${i}`}})}function Fg(n,e){return e!==null&&n.width===e.width&&n.height===e.height}/**
|
|
350
350
|
* @license
|
|
351
351
|
* Copyright 2017 Google LLC
|
|
352
352
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
353
|
-
*/class rf extends Nu{constructor(e){if(super(e),this.it=ue,e.type!==zu.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ue||e==null)return this._t=void 0,this.it=e;if(e===Pt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}rf.directiveName="unsafeHTML",rf.resultType=1;const u2=_l(rf);/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:h2,setPrototypeOf:zg,isFrozen:gO,getPrototypeOf:vO,getOwnPropertyDescriptor:yO}=Object;let{freeze:qe,seal:bt,create:Ic}=Object,{apply:sf,construct:of}=typeof Reflect<"u"&&Reflect;qe||(qe=function(e){return e});bt||(bt=function(e){return e});sf||(sf=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(t,i)});of||(of=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const ql=We(Array.prototype.forEach),wO=We(Array.prototype.lastIndexOf),Ng=We(Array.prototype.pop),Co=We(Array.prototype.push),bO=We(Array.prototype.splice),xc=We(String.prototype.toLowerCase),Fh=We(String.prototype.toString),Hh=We(String.prototype.match),To=We(String.prototype.replace),_O=We(String.prototype.indexOf),SO=We(String.prototype.trim),et=We(Object.prototype.hasOwnProperty),Ue=We(RegExp.prototype.test),Ro=AO(TypeError);function We(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return sf(n,e,r)}}function AO(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return of(n,t)}}function Y(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xc;zg&&zg(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=t(i);s!==i&&(gO(e)||(e[r]=s),i=s)}n[i]=!0}return n}function kO(n){for(let e=0;e<n.length;e++)et(n,e)||(n[e]=null);return n}function Ft(n){const e=Ic(null);for(const[t,r]of h2(n))et(n,t)&&(Array.isArray(r)?e[t]=kO(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Ft(r):e[t]=r);return e}function Io(n,e){for(;n!==null;){const r=yO(n,e);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}n=vO(n)}function t(){return null}return t}const Mg=qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Vh=qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Bh=qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),EO=qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jh=qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$O=qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ug=qe(["#text"]),Zg=qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qh=qe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fg=qe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Wl=qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),CO=bt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),TO=bt(/<%[\w\W]*|[\w\W]*%>/gm),RO=bt(/\$\{[\w\W]*/gm),IO=bt(/^data-[\-\w.\u00B7-\uFFFF]+$/),xO=bt(/^aria-[\-\w]+$/),d2=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),PO=bt(/^(?:\w+script|data):/i),DO=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),f2=bt(/^html$/i),LO=bt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Hg=Object.freeze({__proto__:null,ARIA_ATTR:xO,ATTR_WHITESPACE:DO,CUSTOM_ELEMENT:LO,DATA_ATTR:IO,DOCTYPE_NAME:f2,ERB_EXPR:TO,IS_ALLOWED_URI:d2,IS_SCRIPT_OR_DATA:PO,MUSTACHE_EXPR:CO,TMPLIT_EXPR:RO});const xo={element:1,text:3,progressingInstruction:7,comment:8,document:9},OO=function(){return typeof window>"u"?null:window},zO=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Vg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function p2(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OO();const e=U=>p2(U);if(e.version="3.3.3",e.removed=[],!n||!n.document||n.document.nodeType!==xo.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:u,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:y}=n,k=c.prototype,A=Io(k,"cloneNode"),x=Io(k,"remove"),M=Io(k,"nextSibling"),Z=Io(k,"childNodes"),G=Io(k,"parentNode");if(typeof o=="function"){const U=t.createElement("template");U.content&&U.content.ownerDocument&&(t=U.content.ownerDocument)}let F,W="";const{implementation:re,createNodeIterator:Q,createDocumentFragment:oe,getElementsByTagName:vn}=t,{importNode:yn}=r;let we=Vg();e.isSupported=typeof h2=="function"&&typeof G=="function"&&re&&re.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:wn,ERB_EXPR:Ot,TMPLIT_EXPR:Jn,DATA_ATTR:Hu,ARIA_ATTR:Al,IS_SCRIPT_OR_DATA:tb,ATTR_WHITESPACE:Cp,CUSTOM_ELEMENT:nb}=Hg;let{IS_ALLOWED_URI:Tp}=Hg,Te=null;const Rp=Y({},[...Mg,...Vh,...Bh,...jh,...Ug]);let xe=null;const Ip=Y({},[...Zg,...qh,...Fg,...Wl]);let be=Object.seal(Ic(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yo=null,kl=null;const Xn=Object.seal(Ic(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xp=!0,Vu=!0,Pp=!1,Dp=!0,ji=!1,El=!0,Ur=!1,Bu=!1,ju=!1,qi=!1,$l=!1,Cl=!1,Lp=!0,Op=!1;const rb="user-content-";let qu=!0,wo=!1,Wi={},zt=null;const Wu=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let zp=null;const Np=Y({},["audio","video","img","source","image","track"]);let Gu=null;const Mp=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tl="http://www.w3.org/1998/Math/MathML",Rl="http://www.w3.org/2000/svg",bn="http://www.w3.org/1999/xhtml";let Gi=bn,Yu=!1,Ku=null;const ib=Y({},[Tl,Rl,bn],Fh);let Il=Y({},["mi","mo","mn","ms","mtext"]),xl=Y({},["annotation-xml"]);const sb=Y({},["title","style","font","a","script"]);let bo=null;const ob=["application/xhtml+xml","text/html"],ab="text/html";let $e=null,Yi=null;const lb=t.createElement("form"),Up=function(b){return b instanceof RegExp||b instanceof Function},Ju=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Yi&&Yi===b)){if((!b||typeof b!="object")&&(b={}),b=Ft(b),bo=ob.indexOf(b.PARSER_MEDIA_TYPE)===-1?ab:b.PARSER_MEDIA_TYPE,$e=bo==="application/xhtml+xml"?Fh:xc,Te=et(b,"ALLOWED_TAGS")?Y({},b.ALLOWED_TAGS,$e):Rp,xe=et(b,"ALLOWED_ATTR")?Y({},b.ALLOWED_ATTR,$e):Ip,Ku=et(b,"ALLOWED_NAMESPACES")?Y({},b.ALLOWED_NAMESPACES,Fh):ib,Gu=et(b,"ADD_URI_SAFE_ATTR")?Y(Ft(Mp),b.ADD_URI_SAFE_ATTR,$e):Mp,zp=et(b,"ADD_DATA_URI_TAGS")?Y(Ft(Np),b.ADD_DATA_URI_TAGS,$e):Np,zt=et(b,"FORBID_CONTENTS")?Y({},b.FORBID_CONTENTS,$e):Wu,yo=et(b,"FORBID_TAGS")?Y({},b.FORBID_TAGS,$e):Ft({}),kl=et(b,"FORBID_ATTR")?Y({},b.FORBID_ATTR,$e):Ft({}),Wi=et(b,"USE_PROFILES")?b.USE_PROFILES:!1,xp=b.ALLOW_ARIA_ATTR!==!1,Vu=b.ALLOW_DATA_ATTR!==!1,Pp=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Dp=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ji=b.SAFE_FOR_TEMPLATES||!1,El=b.SAFE_FOR_XML!==!1,Ur=b.WHOLE_DOCUMENT||!1,qi=b.RETURN_DOM||!1,$l=b.RETURN_DOM_FRAGMENT||!1,Cl=b.RETURN_TRUSTED_TYPE||!1,ju=b.FORCE_BODY||!1,Lp=b.SANITIZE_DOM!==!1,Op=b.SANITIZE_NAMED_PROPS||!1,qu=b.KEEP_CONTENT!==!1,wo=b.IN_PLACE||!1,Tp=b.ALLOWED_URI_REGEXP||d2,Gi=b.NAMESPACE||bn,Il=b.MATHML_TEXT_INTEGRATION_POINTS||Il,xl=b.HTML_INTEGRATION_POINTS||xl,be=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&Up(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&Up(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ji&&(Vu=!1),$l&&(qi=!0),Wi&&(Te=Y({},Ug),xe=Ic(null),Wi.html===!0&&(Y(Te,Mg),Y(xe,Zg)),Wi.svg===!0&&(Y(Te,Vh),Y(xe,qh),Y(xe,Wl)),Wi.svgFilters===!0&&(Y(Te,Bh),Y(xe,qh),Y(xe,Wl)),Wi.mathMl===!0&&(Y(Te,jh),Y(xe,Fg),Y(xe,Wl))),et(b,"ADD_TAGS")||(Xn.tagCheck=null),et(b,"ADD_ATTR")||(Xn.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Xn.tagCheck=b.ADD_TAGS:(Te===Rp&&(Te=Ft(Te)),Y(Te,b.ADD_TAGS,$e))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xn.attributeCheck=b.ADD_ATTR:(xe===Ip&&(xe=Ft(xe)),Y(xe,b.ADD_ATTR,$e))),b.ADD_URI_SAFE_ATTR&&Y(Gu,b.ADD_URI_SAFE_ATTR,$e),b.FORBID_CONTENTS&&(zt===Wu&&(zt=Ft(zt)),Y(zt,b.FORBID_CONTENTS,$e)),b.ADD_FORBID_CONTENTS&&(zt===Wu&&(zt=Ft(zt)),Y(zt,b.ADD_FORBID_CONTENTS,$e)),qu&&(Te["#text"]=!0),Ur&&Y(Te,["html","head","body"]),Te.table&&(Y(Te,["tbody"]),delete yo.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ro('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ro('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=b.TRUSTED_TYPES_POLICY,W=F.createHTML("")}else F===void 0&&(F=zO(y,i)),F!==null&&typeof W=="string"&&(W=F.createHTML(""));qe&&qe(b),Yi=b}},Zp=Y({},[...Vh,...Bh,...EO]),Fp=Y({},[...jh,...$O]),cb=function(b){let I=G(b);(!I||!I.tagName)&&(I={namespaceURI:Gi,tagName:"template"});const D=xc(b.tagName),de=xc(I.tagName);return Ku[b.namespaceURI]?b.namespaceURI===Rl?I.namespaceURI===bn?D==="svg":I.namespaceURI===Tl?D==="svg"&&(de==="annotation-xml"||Il[de]):!!Zp[D]:b.namespaceURI===Tl?I.namespaceURI===bn?D==="math":I.namespaceURI===Rl?D==="math"&&xl[de]:!!Fp[D]:b.namespaceURI===bn?I.namespaceURI===Rl&&!xl[de]||I.namespaceURI===Tl&&!Il[de]?!1:!Fp[D]&&(sb[D]||!Zp[D]):!!(bo==="application/xhtml+xml"&&Ku[b.namespaceURI]):!1},Nt=function(b){Co(e.removed,{element:b});try{G(b).removeChild(b)}catch{x(b)}},Zr=function(b,I){try{Co(e.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Co(e.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(qi||$l)try{Nt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},Hp=function(b){let I=null,D=null;if(ju)b="<remove></remove>"+b;else{const Se=Hh(b,/^[\r\n\t ]+/);D=Se&&Se[0]}bo==="application/xhtml+xml"&&Gi===bn&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const de=F?F.createHTML(b):b;if(Gi===bn)try{I=new g().parseFromString(de,bo)}catch{}if(!I||!I.documentElement){I=re.createDocument(Gi,"template",null);try{I.documentElement.innerHTML=Yu?W:de}catch{}}const Oe=I.body||I.documentElement;return b&&D&&Oe.insertBefore(t.createTextNode(D),Oe.childNodes[0]||null),Gi===bn?vn.call(I,Ur?"html":"body")[0]:Ur?I.documentElement:Oe},Vp=function(b){return Q.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Xu=function(b){return b instanceof m&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof f)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},Bp=function(b){return typeof l=="function"&&b instanceof l};function _n(U,b,I){ql(U,D=>{D.call(e,b,I,Yi)})}const jp=function(b){let I=null;if(_n(we.beforeSanitizeElements,b,null),Xu(b))return Nt(b),!0;const D=$e(b.nodeName);if(_n(we.uponSanitizeElement,b,{tagName:D,allowedTags:Te}),El&&b.hasChildNodes()&&!Bp(b.firstElementChild)&&Ue(/<[/\w!]/g,b.innerHTML)&&Ue(/<[/\w!]/g,b.textContent)||b.nodeType===xo.progressingInstruction||El&&b.nodeType===xo.comment&&Ue(/<[/\w]/g,b.data))return Nt(b),!0;if(!(Xn.tagCheck instanceof Function&&Xn.tagCheck(D))&&(!Te[D]||yo[D])){if(!yo[D]&&Wp(D)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,D)||be.tagNameCheck instanceof Function&&be.tagNameCheck(D)))return!1;if(qu&&!zt[D]){const de=G(b)||b.parentNode,Oe=Z(b)||b.childNodes;if(Oe&&de){const Se=Oe.length;for(let Ge=Se-1;Ge>=0;--Ge){const Sn=A(Oe[Ge],!0);Sn.__removalCount=(b.__removalCount||0)+1,de.insertBefore(Sn,M(b))}}}return Nt(b),!0}return b instanceof c&&!cb(b)||(D==="noscript"||D==="noembed"||D==="noframes")&&Ue(/<\/no(script|embed|frames)/i,b.innerHTML)?(Nt(b),!0):(ji&&b.nodeType===xo.text&&(I=b.textContent,ql([wn,Ot,Jn],de=>{I=To(I,de," ")}),b.textContent!==I&&(Co(e.removed,{element:b.cloneNode()}),b.textContent=I)),_n(we.afterSanitizeElements,b,null),!1)},qp=function(b,I,D){if(kl[I]||Lp&&(I==="id"||I==="name")&&(D in t||D in lb))return!1;if(!(Vu&&!kl[I]&&Ue(Hu,I))){if(!(xp&&Ue(Al,I))){if(!(Xn.attributeCheck instanceof Function&&Xn.attributeCheck(I,b))){if(!xe[I]||kl[I]){if(!(Wp(b)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,b)||be.tagNameCheck instanceof Function&&be.tagNameCheck(b))&&(be.attributeNameCheck instanceof RegExp&&Ue(be.attributeNameCheck,I)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(I,b))||I==="is"&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,D)||be.tagNameCheck instanceof Function&&be.tagNameCheck(D))))return!1}else if(!Gu[I]){if(!Ue(Tp,To(D,Cp,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&_O(D,"data:")===0&&zp[b])){if(!(Pp&&!Ue(tb,To(D,Cp,"")))){if(D)return!1}}}}}}}return!0},Wp=function(b){return b!=="annotation-xml"&&Hh(b,nb)},Gp=function(b){_n(we.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||Xu(b))return;const D={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let de=I.length;for(;de--;){const Oe=I[de],{name:Se,namespaceURI:Ge,value:Sn}=Oe,Ki=$e(Se),Qu=Sn;let Pe=Se==="value"?Qu:SO(Qu);if(D.attrName=Ki,D.attrValue=Pe,D.keepAttr=!0,D.forceKeepAttr=void 0,_n(we.uponSanitizeAttribute,b,D),Pe=D.attrValue,Op&&(Ki==="id"||Ki==="name")&&(Zr(Se,b),Pe=rb+Pe),El&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){Zr(Se,b);continue}if(Ki==="attributename"&&Hh(Pe,"href")){Zr(Se,b);continue}if(D.forceKeepAttr)continue;if(!D.keepAttr){Zr(Se,b);continue}if(!Dp&&Ue(/\/>/i,Pe)){Zr(Se,b);continue}ji&&ql([wn,Ot,Jn],Kp=>{Pe=To(Pe,Kp," ")});const Yp=$e(b.nodeName);if(!qp(Yp,Ki,Pe)){Zr(Se,b);continue}if(F&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Ge)switch(y.getAttributeType(Yp,Ki)){case"TrustedHTML":{Pe=F.createHTML(Pe);break}case"TrustedScriptURL":{Pe=F.createScriptURL(Pe);break}}if(Pe!==Qu)try{Ge?b.setAttributeNS(Ge,Se,Pe):b.setAttribute(Se,Pe),Xu(b)?Nt(b):Ng(e.removed)}catch{Zr(Se,b)}}_n(we.afterSanitizeAttributes,b,null)},ub=function U(b){let I=null;const D=Vp(b);for(_n(we.beforeSanitizeShadowDOM,b,null);I=D.nextNode();)_n(we.uponSanitizeShadowNode,I,null),jp(I),Gp(I),I.content instanceof s&&U(I.content);_n(we.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(U){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,D=null,de=null,Oe=null;if(Yu=!U,Yu&&(U="<!-->"),typeof U!="string"&&!Bp(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw Ro("dirty is not a string, aborting")}else throw Ro("toString is not a function");if(!e.isSupported)return U;if(Bu||Ju(b),e.removed=[],typeof U=="string"&&(wo=!1),wo){if(U.nodeName){const Sn=$e(U.nodeName);if(!Te[Sn]||yo[Sn])throw Ro("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof l)I=Hp("<!---->"),D=I.ownerDocument.importNode(U,!0),D.nodeType===xo.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?I=D:I.appendChild(D);else{if(!qi&&!ji&&!Ur&&U.indexOf("<")===-1)return F&&Cl?F.createHTML(U):U;if(I=Hp(U),!I)return qi?null:Cl?W:""}I&&ju&&Nt(I.firstChild);const Se=Vp(wo?U:I);for(;de=Se.nextNode();)jp(de),Gp(de),de.content instanceof s&&ub(de.content);if(wo)return U;if(qi){if($l)for(Oe=oe.call(I.ownerDocument);I.firstChild;)Oe.appendChild(I.firstChild);else Oe=I;return(xe.shadowroot||xe.shadowrootmode)&&(Oe=yn.call(r,Oe,!0)),Oe}let Ge=Ur?I.outerHTML:I.innerHTML;return Ur&&Te["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Ue(f2,I.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
354
|
-
`+Ge),
|
|
355
|
-
]`).replace("lheading",
|
|
353
|
+
*/class lf extends Uu{constructor(e){if(super(e),this.it=ue,e.type!==Mu.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ue||e==null)return this._t=void 0,this.it=e;if(e===Pt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}lf.directiveName="unsafeHTML",lf.resultType=1;const g2=Al(lf);/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:v2,setPrototypeOf:Hg,isFrozen:_O,getPrototypeOf:SO,getOwnPropertyDescriptor:AO}=Object;let{freeze:je,seal:bt,create:Pc}=Object,{apply:cf,construct:uf}=typeof Reflect<"u"&&Reflect;je||(je=function(e){return e});bt||(bt=function(e){return e});cf||(cf=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(t,i)});uf||(uf=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const Gl=We(Array.prototype.forEach),kO=We(Array.prototype.lastIndexOf),Vg=We(Array.prototype.pop),To=We(Array.prototype.push),EO=We(Array.prototype.splice),Dc=We(String.prototype.toLowerCase),qh=We(String.prototype.toString),jh=We(String.prototype.match),Ro=We(String.prototype.replace),$O=We(String.prototype.indexOf),CO=We(String.prototype.trim),et=We(Object.prototype.hasOwnProperty),Ue=We(RegExp.prototype.test),Io=TO(TypeError);function We(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return cf(n,e,r)}}function TO(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return uf(n,t)}}function Y(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dc;Hg&&Hg(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=t(i);s!==i&&(_O(e)||(e[r]=s),i=s)}n[i]=!0}return n}function RO(n){for(let e=0;e<n.length;e++)et(n,e)||(n[e]=null);return n}function Ft(n){const e=Pc(null);for(const[t,r]of v2(n))et(n,t)&&(Array.isArray(r)?e[t]=RO(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Ft(r):e[t]=r);return e}function xo(n,e){for(;n!==null;){const r=AO(n,e);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}n=SO(n)}function t(){return null}return t}const Bg=je(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wh=je(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gh=je(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),IO=je(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Yh=je(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xO=je(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qg=je(["#text"]),jg=je(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Kh=je(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wg=je(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yl=je(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),PO=bt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),DO=bt(/<%[\w\W]*|[\w\W]*%>/gm),LO=bt(/\$\{[\w\W]*/gm),OO=bt(/^data-[\-\w.\u00B7-\uFFFF]+$/),zO=bt(/^aria-[\-\w]+$/),y2=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NO=bt(/^(?:\w+script|data):/i),MO=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),w2=bt(/^html$/i),UO=bt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Gg=Object.freeze({__proto__:null,ARIA_ATTR:zO,ATTR_WHITESPACE:MO,CUSTOM_ELEMENT:UO,DATA_ATTR:OO,DOCTYPE_NAME:w2,ERB_EXPR:DO,IS_ALLOWED_URI:y2,IS_SCRIPT_OR_DATA:NO,MUSTACHE_EXPR:PO,TMPLIT_EXPR:LO});const Po={element:1,text:3,progressingInstruction:7,comment:8,document:9},ZO=function(){return typeof window>"u"?null:window},FO=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Yg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function b2(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZO();const e=U=>b2(U);if(e.version="3.3.3",e.removed=[],!n||!n.document||n.document.nodeType!==Po.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:u,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:y}=n,k=c.prototype,S=xo(k,"cloneNode"),x=xo(k,"remove"),M=xo(k,"nextSibling"),Z=xo(k,"childNodes"),G=xo(k,"parentNode");if(typeof o=="function"){const U=t.createElement("template");U.content&&U.content.ownerDocument&&(t=U.content.ownerDocument)}let F,W="";const{implementation:re,createNodeIterator:Q,createDocumentFragment:oe,getElementsByTagName:yn}=t,{importNode:wn}=r;let we=Yg();e.isSupported=typeof v2=="function"&&typeof G=="function"&&re&&re.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:bn,ERB_EXPR:Ot,TMPLIT_EXPR:Jn,DATA_ATTR:Bu,ARIA_ATTR:El,IS_SCRIPT_OR_DATA:ab,ATTR_WHITESPACE:xp,CUSTOM_ELEMENT:lb}=Gg;let{IS_ALLOWED_URI:Pp}=Gg,Te=null;const Dp=Y({},[...Bg,...Wh,...Gh,...Yh,...qg]);let xe=null;const Lp=Y({},[...jg,...Kh,...Wg,...Yl]);let be=Object.seal(Pc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wo=null,$l=null;const Xn=Object.seal(Pc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Op=!0,qu=!0,zp=!1,Np=!0,qi=!1,Cl=!0,Ur=!1,ju=!1,Wu=!1,ji=!1,Tl=!1,Rl=!1,Mp=!0,Up=!1;const cb="user-content-";let Gu=!0,bo=!1,Wi={},zt=null;const Yu=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Zp=null;const Fp=Y({},["audio","video","img","source","image","track"]);let Ku=null;const Hp=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Il="http://www.w3.org/1998/Math/MathML",xl="http://www.w3.org/2000/svg",_n="http://www.w3.org/1999/xhtml";let Gi=_n,Ju=!1,Xu=null;const ub=Y({},[Il,xl,_n],qh);let Pl=Y({},["mi","mo","mn","ms","mtext"]),Dl=Y({},["annotation-xml"]);const hb=Y({},["title","style","font","a","script"]);let _o=null;const db=["application/xhtml+xml","text/html"],fb="text/html";let $e=null,Yi=null;const pb=t.createElement("form"),Vp=function(b){return b instanceof RegExp||b instanceof Function},Qu=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Yi&&Yi===b)){if((!b||typeof b!="object")&&(b={}),b=Ft(b),_o=db.indexOf(b.PARSER_MEDIA_TYPE)===-1?fb:b.PARSER_MEDIA_TYPE,$e=_o==="application/xhtml+xml"?qh:Dc,Te=et(b,"ALLOWED_TAGS")?Y({},b.ALLOWED_TAGS,$e):Dp,xe=et(b,"ALLOWED_ATTR")?Y({},b.ALLOWED_ATTR,$e):Lp,Xu=et(b,"ALLOWED_NAMESPACES")?Y({},b.ALLOWED_NAMESPACES,qh):ub,Ku=et(b,"ADD_URI_SAFE_ATTR")?Y(Ft(Hp),b.ADD_URI_SAFE_ATTR,$e):Hp,Zp=et(b,"ADD_DATA_URI_TAGS")?Y(Ft(Fp),b.ADD_DATA_URI_TAGS,$e):Fp,zt=et(b,"FORBID_CONTENTS")?Y({},b.FORBID_CONTENTS,$e):Yu,wo=et(b,"FORBID_TAGS")?Y({},b.FORBID_TAGS,$e):Ft({}),$l=et(b,"FORBID_ATTR")?Y({},b.FORBID_ATTR,$e):Ft({}),Wi=et(b,"USE_PROFILES")?b.USE_PROFILES:!1,Op=b.ALLOW_ARIA_ATTR!==!1,qu=b.ALLOW_DATA_ATTR!==!1,zp=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Np=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qi=b.SAFE_FOR_TEMPLATES||!1,Cl=b.SAFE_FOR_XML!==!1,Ur=b.WHOLE_DOCUMENT||!1,ji=b.RETURN_DOM||!1,Tl=b.RETURN_DOM_FRAGMENT||!1,Rl=b.RETURN_TRUSTED_TYPE||!1,Wu=b.FORCE_BODY||!1,Mp=b.SANITIZE_DOM!==!1,Up=b.SANITIZE_NAMED_PROPS||!1,Gu=b.KEEP_CONTENT!==!1,bo=b.IN_PLACE||!1,Pp=b.ALLOWED_URI_REGEXP||y2,Gi=b.NAMESPACE||_n,Pl=b.MATHML_TEXT_INTEGRATION_POINTS||Pl,Dl=b.HTML_INTEGRATION_POINTS||Dl,be=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&Vp(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&Vp(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),qi&&(qu=!1),Tl&&(ji=!0),Wi&&(Te=Y({},qg),xe=Pc(null),Wi.html===!0&&(Y(Te,Bg),Y(xe,jg)),Wi.svg===!0&&(Y(Te,Wh),Y(xe,Kh),Y(xe,Yl)),Wi.svgFilters===!0&&(Y(Te,Gh),Y(xe,Kh),Y(xe,Yl)),Wi.mathMl===!0&&(Y(Te,Yh),Y(xe,Wg),Y(xe,Yl))),et(b,"ADD_TAGS")||(Xn.tagCheck=null),et(b,"ADD_ATTR")||(Xn.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Xn.tagCheck=b.ADD_TAGS:(Te===Dp&&(Te=Ft(Te)),Y(Te,b.ADD_TAGS,$e))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xn.attributeCheck=b.ADD_ATTR:(xe===Lp&&(xe=Ft(xe)),Y(xe,b.ADD_ATTR,$e))),b.ADD_URI_SAFE_ATTR&&Y(Ku,b.ADD_URI_SAFE_ATTR,$e),b.FORBID_CONTENTS&&(zt===Yu&&(zt=Ft(zt)),Y(zt,b.FORBID_CONTENTS,$e)),b.ADD_FORBID_CONTENTS&&(zt===Yu&&(zt=Ft(zt)),Y(zt,b.ADD_FORBID_CONTENTS,$e)),Gu&&(Te["#text"]=!0),Ur&&Y(Te,["html","head","body"]),Te.table&&(Y(Te,["tbody"]),delete wo.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Io('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Io('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=b.TRUSTED_TYPES_POLICY,W=F.createHTML("")}else F===void 0&&(F=FO(y,i)),F!==null&&typeof W=="string"&&(W=F.createHTML(""));je&&je(b),Yi=b}},Bp=Y({},[...Wh,...Gh,...IO]),qp=Y({},[...Yh,...xO]),mb=function(b){let I=G(b);(!I||!I.tagName)&&(I={namespaceURI:Gi,tagName:"template"});const D=Dc(b.tagName),de=Dc(I.tagName);return Xu[b.namespaceURI]?b.namespaceURI===xl?I.namespaceURI===_n?D==="svg":I.namespaceURI===Il?D==="svg"&&(de==="annotation-xml"||Pl[de]):!!Bp[D]:b.namespaceURI===Il?I.namespaceURI===_n?D==="math":I.namespaceURI===xl?D==="math"&&Dl[de]:!!qp[D]:b.namespaceURI===_n?I.namespaceURI===xl&&!Dl[de]||I.namespaceURI===Il&&!Pl[de]?!1:!qp[D]&&(hb[D]||!Bp[D]):!!(_o==="application/xhtml+xml"&&Xu[b.namespaceURI]):!1},Nt=function(b){To(e.removed,{element:b});try{G(b).removeChild(b)}catch{x(b)}},Zr=function(b,I){try{To(e.removed,{attribute:I.getAttributeNode(b),from:I})}catch{To(e.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(ji||Tl)try{Nt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},jp=function(b){let I=null,D=null;if(Wu)b="<remove></remove>"+b;else{const Se=jh(b,/^[\r\n\t ]+/);D=Se&&Se[0]}_o==="application/xhtml+xml"&&Gi===_n&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const de=F?F.createHTML(b):b;if(Gi===_n)try{I=new v().parseFromString(de,_o)}catch{}if(!I||!I.documentElement){I=re.createDocument(Gi,"template",null);try{I.documentElement.innerHTML=Ju?W:de}catch{}}const Oe=I.body||I.documentElement;return b&&D&&Oe.insertBefore(t.createTextNode(D),Oe.childNodes[0]||null),Gi===_n?yn.call(I,Ur?"html":"body")[0]:Ur?I.documentElement:Oe},Wp=function(b){return Q.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},eh=function(b){return b instanceof m&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof f)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},Gp=function(b){return typeof l=="function"&&b instanceof l};function Sn(U,b,I){Gl(U,D=>{D.call(e,b,I,Yi)})}const Yp=function(b){let I=null;if(Sn(we.beforeSanitizeElements,b,null),eh(b))return Nt(b),!0;const D=$e(b.nodeName);if(Sn(we.uponSanitizeElement,b,{tagName:D,allowedTags:Te}),Cl&&b.hasChildNodes()&&!Gp(b.firstElementChild)&&Ue(/<[/\w!]/g,b.innerHTML)&&Ue(/<[/\w!]/g,b.textContent)||b.nodeType===Po.progressingInstruction||Cl&&b.nodeType===Po.comment&&Ue(/<[/\w]/g,b.data))return Nt(b),!0;if(!(Xn.tagCheck instanceof Function&&Xn.tagCheck(D))&&(!Te[D]||wo[D])){if(!wo[D]&&Jp(D)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,D)||be.tagNameCheck instanceof Function&&be.tagNameCheck(D)))return!1;if(Gu&&!zt[D]){const de=G(b)||b.parentNode,Oe=Z(b)||b.childNodes;if(Oe&&de){const Se=Oe.length;for(let Ge=Se-1;Ge>=0;--Ge){const An=S(Oe[Ge],!0);An.__removalCount=(b.__removalCount||0)+1,de.insertBefore(An,M(b))}}}return Nt(b),!0}return b instanceof c&&!mb(b)||(D==="noscript"||D==="noembed"||D==="noframes")&&Ue(/<\/no(script|embed|frames)/i,b.innerHTML)?(Nt(b),!0):(qi&&b.nodeType===Po.text&&(I=b.textContent,Gl([bn,Ot,Jn],de=>{I=Ro(I,de," ")}),b.textContent!==I&&(To(e.removed,{element:b.cloneNode()}),b.textContent=I)),Sn(we.afterSanitizeElements,b,null),!1)},Kp=function(b,I,D){if($l[I]||Mp&&(I==="id"||I==="name")&&(D in t||D in pb))return!1;if(!(qu&&!$l[I]&&Ue(Bu,I))){if(!(Op&&Ue(El,I))){if(!(Xn.attributeCheck instanceof Function&&Xn.attributeCheck(I,b))){if(!xe[I]||$l[I]){if(!(Jp(b)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,b)||be.tagNameCheck instanceof Function&&be.tagNameCheck(b))&&(be.attributeNameCheck instanceof RegExp&&Ue(be.attributeNameCheck,I)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(I,b))||I==="is"&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,D)||be.tagNameCheck instanceof Function&&be.tagNameCheck(D))))return!1}else if(!Ku[I]){if(!Ue(Pp,Ro(D,xp,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&$O(D,"data:")===0&&Zp[b])){if(!(zp&&!Ue(ab,Ro(D,xp,"")))){if(D)return!1}}}}}}}return!0},Jp=function(b){return b!=="annotation-xml"&&jh(b,lb)},Xp=function(b){Sn(we.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||eh(b))return;const D={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let de=I.length;for(;de--;){const Oe=I[de],{name:Se,namespaceURI:Ge,value:An}=Oe,Ki=$e(Se),th=An;let Pe=Se==="value"?th:CO(th);if(D.attrName=Ki,D.attrValue=Pe,D.keepAttr=!0,D.forceKeepAttr=void 0,Sn(we.uponSanitizeAttribute,b,D),Pe=D.attrValue,Up&&(Ki==="id"||Ki==="name")&&(Zr(Se,b),Pe=cb+Pe),Cl&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){Zr(Se,b);continue}if(Ki==="attributename"&&jh(Pe,"href")){Zr(Se,b);continue}if(D.forceKeepAttr)continue;if(!D.keepAttr){Zr(Se,b);continue}if(!Np&&Ue(/\/>/i,Pe)){Zr(Se,b);continue}qi&&Gl([bn,Ot,Jn],e0=>{Pe=Ro(Pe,e0," ")});const Qp=$e(b.nodeName);if(!Kp(Qp,Ki,Pe)){Zr(Se,b);continue}if(F&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Ge)switch(y.getAttributeType(Qp,Ki)){case"TrustedHTML":{Pe=F.createHTML(Pe);break}case"TrustedScriptURL":{Pe=F.createScriptURL(Pe);break}}if(Pe!==th)try{Ge?b.setAttributeNS(Ge,Se,Pe):b.setAttribute(Se,Pe),eh(b)?Nt(b):Vg(e.removed)}catch{Zr(Se,b)}}Sn(we.afterSanitizeAttributes,b,null)},gb=function U(b){let I=null;const D=Wp(b);for(Sn(we.beforeSanitizeShadowDOM,b,null);I=D.nextNode();)Sn(we.uponSanitizeShadowNode,I,null),Yp(I),Xp(I),I.content instanceof s&&U(I.content);Sn(we.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(U){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,D=null,de=null,Oe=null;if(Ju=!U,Ju&&(U="<!-->"),typeof U!="string"&&!Gp(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw Io("dirty is not a string, aborting")}else throw Io("toString is not a function");if(!e.isSupported)return U;if(ju||Qu(b),e.removed=[],typeof U=="string"&&(bo=!1),bo){if(U.nodeName){const An=$e(U.nodeName);if(!Te[An]||wo[An])throw Io("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof l)I=jp("<!---->"),D=I.ownerDocument.importNode(U,!0),D.nodeType===Po.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?I=D:I.appendChild(D);else{if(!ji&&!qi&&!Ur&&U.indexOf("<")===-1)return F&&Rl?F.createHTML(U):U;if(I=jp(U),!I)return ji?null:Rl?W:""}I&&Wu&&Nt(I.firstChild);const Se=Wp(bo?U:I);for(;de=Se.nextNode();)Yp(de),Xp(de),de.content instanceof s&&gb(de.content);if(bo)return U;if(ji){if(Tl)for(Oe=oe.call(I.ownerDocument);I.firstChild;)Oe.appendChild(I.firstChild);else Oe=I;return(xe.shadowroot||xe.shadowrootmode)&&(Oe=wn.call(r,Oe,!0)),Oe}let Ge=Ur?I.outerHTML:I.innerHTML;return Ur&&Te["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Ue(w2,I.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
354
|
+
`+Ge),qi&&Gl([bn,Ot,Jn],An=>{Ge=Ro(Ge,An," ")}),F&&Rl?F.createHTML(Ge):Ge},e.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qu(U),ju=!0},e.clearConfig=function(){Yi=null,ju=!1},e.isValidAttribute=function(U,b,I){Yi||Qu({});const D=$e(U),de=$e(b);return Kp(D,de,I)},e.addHook=function(U,b){typeof b=="function"&&To(we[U],b)},e.removeHook=function(U,b){if(b!==void 0){const I=kO(we[U],b);return I===-1?void 0:EO(we[U],I,1)[0]}return Vg(we[U])},e.removeHooks=function(U){we[U]=[]},e.removeAllHooks=function(){we=Yg()},e}var _2=b2();function yp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bi=yp();function S2(n){Bi=n}var Gr={exec:()=>null};function X(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Be.caret,"$1"),t=t.replace(i,o),r},getRegex:()=>new RegExp(t,e)};return r}var HO=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},VO=/^(?:[ \t]*(?:\n|$))+/,BO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,A2=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,k2=X(A2).replace(/bull/g,wp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),WO=X(A2).replace(/bull/g,wp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,GO=/^[^\n]+/,_p=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,YO=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_p).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),KO=X(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wp).getRegex(),Hu="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,JO=X("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Sp).replace("tag",Hu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),E2=X(bp).replace("hr",kl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hu).getRegex(),XO=X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",E2).getRegex(),Ap={blockquote:XO,code:BO,def:YO,fences:qO,heading:jO,hr:kl,html:JO,lheading:k2,list:KO,newline:VO,paragraph:E2,table:Gr,text:GO},Kg=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hu).getRegex(),QO={...Ap,lheading:WO,table:Kg,paragraph:X(bp).replace("hr",kl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kg).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hu).getRegex()},ez={...Ap,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Gr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(bp).replace("hr",kl).replace("heading",` *#{1,6} *[^
|
|
355
|
+
]`).replace("lheading",k2).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$2=/^( {2,}|\\)\n(?!\s*$)/,rz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yo=/[\p{P}\p{S}]/u,Vu=/[\s\p{P}\p{S}]/u,kp=/[^\s\p{P}\p{S}]/u,iz=X(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vu).getRegex(),C2=/(?!~)[\p{P}\p{S}]/u,sz=/(?!~)[\s\p{P}\p{S}]/u,oz=/(?:[^\s\p{P}\p{S}]|~)/u,az=X(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",HO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),T2=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lz=X(T2,"u").replace(/punct/g,yo).getRegex(),cz=X(T2,"u").replace(/punct/g,C2).getRegex(),R2="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uz=X(R2,"gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Vu).replace(/punct/g,yo).getRegex(),hz=X(R2,"gu").replace(/notPunctSpace/g,oz).replace(/punctSpace/g,sz).replace(/punct/g,C2).getRegex(),dz=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Vu).replace(/punct/g,yo).getRegex(),fz=X(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yo).getRegex(),pz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",mz=X(pz,"gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Vu).replace(/punct/g,yo).getRegex(),gz=X(/\\(punct)/,"gu").replace(/punct/g,yo).getRegex(),vz=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yz=X(Sp).replace("(?:-->|$)","-->").getRegex(),wz=X("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",yz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bz=X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),I2=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Kc).replace("ref",_p).getRegex(),x2=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",_p).getRegex(),_z=X("reflink|nolink(?!\\()","g").replace("reflink",I2).replace("nolink",x2).getRegex(),Jg=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ep={_backpedal:Gr,anyPunctuation:gz,autolink:vz,blockSkip:az,br:$2,code:nz,del:Gr,delLDelim:Gr,delRDelim:Gr,emStrongLDelim:lz,emStrongRDelimAst:uz,emStrongRDelimUnd:dz,escape:tz,link:bz,nolink:x2,punctuation:iz,reflink:I2,reflinkSearch:_z,tag:wz,text:rz,url:Gr},Sz={...Ep,link:X(/^!?\[(label)\]\((.*?)\)/).replace("label",Kc).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kc).getRegex()},hf={...Ep,emStrongRDelimAst:hz,emStrongLDelim:cz,delLDelim:fz,delRDelim:mz,url:X(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Jg).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:X(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Jg).getRegex()},Az={...hf,br:X($2).replace("{2,}","*").getRegex(),text:X(hf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Kl={normal:Ap,gfm:QO,pedantic:ez},Do={normal:Ep,gfm:hf,breaks:Az,pedantic:Sz},kz={"&":"&","<":"<",">":">",'"':""","'":"'"},Xg=n=>kz[n];function Ht(n,e){if(e){if(Be.escapeTest.test(n))return n.replace(Be.escapeReplace,Xg)}else if(Be.escapeTestNoEncode.test(n))return n.replace(Be.escapeReplaceNoEncode,Xg);return n}function Qg(n){try{n=encodeURI(n).replace(Be.percentDecode,"%")}catch{return null}return n}function e1(n,e){var s;let t=n.replace(Be.findPipe,(o,l,c)=>{let u=!1,f=l;for(;--f>=0&&c[f]==="\\";)u=!u;return u?"|":" |"}),r=t.split(Be.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Be.slashPipe,"|");return r}function Lo(n,e,t){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===e;)i++;return n.slice(0,r-i)}function Ez(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function $z(n,e=0){let t=e,r="";for(let i of n)if(i===" "){let s=4-t%4;r+=" ".repeat(s),t+=s}else r+=i,t++;return r}function t1(n,e,t,r,i){let s=e.href,o=e.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function Cz(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
|
|
356
356
|
`).map(s=>{let o=s.match(t.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=i.length?s.slice(i.length):s}).join(`
|
|
357
|
-
`)}var
|
|
358
|
-
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=
|
|
359
|
-
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=
|
|
357
|
+
`)}var Jc=class{constructor(n){$(this,"options");$(this,"rules");$(this,"lexer");this.options=n||Bi}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Lo(t,`
|
|
358
|
+
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=Cz(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=Lo(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Lo(e[0],`
|
|
359
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Lo(e[0],`
|
|
360
360
|
`).split(`
|
|
361
361
|
`),r="",i="",s=[];for(;t.length>0;){let o=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),o=!0;else if(!o)l.push(t[c]);else break;t=t.slice(c);let u=l.join(`
|
|
362
362
|
`),f=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
363
363
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
364
364
|
${u}`:u,i=i?`${i}
|
|
365
|
-
${f}`:f;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,s,!0),this.lexer.state.top=m,t.length===0)break;let
|
|
365
|
+
${f}`:f;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,s,!0),this.lexer.state.top=m,t.length===0)break;let v=s.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let y=v,k=y.raw+`
|
|
366
366
|
`+t.join(`
|
|
367
|
-
`),
|
|
367
|
+
`),S=this.blockquote(k);s[s.length-1]=S,r=r.substring(0,r.length-y.raw.length)+S.raw,i=i.substring(0,i.length-y.text.length)+S.text;break}else if((v==null?void 0:v.type)==="list"){let y=v,k=y.raw+`
|
|
368
368
|
`+t.join(`
|
|
369
|
-
`),
|
|
370
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let i=e[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,m="",
|
|
369
|
+
`),S=this.list(k);s[s.length-1]=S,r=r.substring(0,r.length-v.raw.length)+S.raw,i=i.substring(0,i.length-y.raw.length)+S.raw,t=k.substring(s.at(-1).raw.length).split(`
|
|
370
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let i=e[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,m="",v="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;m=e[0],n=n.substring(m.length);let y=$z(e[2].split(`
|
|
371
371
|
`,1)[0],e[1].length),k=n.split(`
|
|
372
|
-
`,1)[0],
|
|
372
|
+
`,1)[0],S=!y.trim(),x=0;if(this.options.pedantic?(x=2,v=y.trimStart()):S?x=e[1].length+1:(x=y.search(this.rules.other.nonSpaceChar),x=x>4?1:x,v=y.slice(x),x+=e[1].length),S&&this.rules.other.blankLine.test(k)&&(m+=k+`
|
|
373
373
|
`,n=n.substring(k.length+1),f=!0),!f){let M=this.rules.other.nextBulletRegex(x),Z=this.rules.other.hrRegex(x),G=this.rules.other.fencesBeginRegex(x),F=this.rules.other.headingBeginRegex(x),W=this.rules.other.htmlBeginRegex(x),re=this.rules.other.blockquoteBeginRegex(x);for(;n;){let Q=n.split(`
|
|
374
|
-
`,1)[0],oe;if(k=Q,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),oe=k):oe=k.replace(this.rules.other.tabCharGlobal," "),G.test(k)||F.test(k)||W.test(k)||re.test(k)||M.test(k)||Z.test(k))break;if(oe.search(this.rules.other.nonSpaceChar)>=x||!k.trim())
|
|
375
|
-
`+oe.slice(x);else{if(
|
|
376
|
-
`+k}
|
|
377
|
-
`,n=n.substring(Q.length+1),y=oe.slice(x)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),o.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(
|
|
378
|
-
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<t.length;l++)s.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(
|
|
379
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let s=
|
|
374
|
+
`,1)[0],oe;if(k=Q,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),oe=k):oe=k.replace(this.rules.other.tabCharGlobal," "),G.test(k)||F.test(k)||W.test(k)||re.test(k)||M.test(k)||Z.test(k))break;if(oe.search(this.rules.other.nonSpaceChar)>=x||!k.trim())v+=`
|
|
375
|
+
`+oe.slice(x);else{if(S||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(y)||F.test(y)||Z.test(y))break;v+=`
|
|
376
|
+
`+k}S=!k.trim(),m+=Q+`
|
|
377
|
+
`,n=n.substring(Q.length+1),y=oe.slice(x)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),o.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(v),loose:!1,text:v,tokens:[]}),o.raw+=m}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f of o.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),((t=f.tokens[0])==null?void 0:t.type)==="text"||((r=f.tokens[0])==null?void 0:r.type)==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(f.raw);if(m){let v={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};f.checked=v.checked,o.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=v.raw+f.tokens[0].raw,f.tokens[0].text=v.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(v)):f.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):f.tokens.unshift(v)}}if(!o.loose){let m=f.tokens.filter(y=>y.type==="space"),v=m.length>0&&m.some(y=>this.rules.other.anyLine.test(y.raw));o.loose=v}}if(o.loose)for(let f of o.items){f.loose=!0;for(let m of f.tokens)m.type==="text"&&(m.type="paragraph")}return o}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:i}}}table(n){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=e1(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
378
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<t.length;l++)s.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(e1(l,s.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[u]})));return s}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
379
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let s=Lo(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{let s=Ez(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),t1(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return t1(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...r[0]].length-1,s,o,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+i);(r=u.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let f=[...r[0]][0].length,m=n.slice(0,i+r.index+f+o);if(Math.min(i,o)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...r[0]].length-1,s,o,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*n.length+i);(r=c.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(o=[...s].length,o!==i))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let u=[...r[0]][0].length,f=n.slice(0,i+r.index+u+o),m=f.slice(i,-i);return{type:"del",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let s;do s=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(s!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},It=class df{constructor(e){$(this,"tokens");$(this,"options");$(this,"state");$(this,"inlineQueue");$(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Bi,this.options.tokenizer=this.options.tokenizer||new Jc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Be,block:Kl.normal,inline:Do.normal};this.options.pedantic?(t.block=Kl.pedantic,t.inline=Do.pedantic):this.options.gfm&&(t.block=Kl.gfm,this.options.breaks?t.inline=Do.breaks:t.inline=Do.gfm),this.tokenizer.rules=t}static get rules(){return{block:Kl,inline:Do}}static lex(e,t){return new df(t).lex(e)}static lexInline(e,t){return new df(t).inlineTokens(e)}lex(e){e=e.replace(Be.carriageReturn,`
|
|
380
380
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){var i,s,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Be.tabCharGlobal," ").replace(Be.spaceLine,""));e;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(u=>(l=u.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let u=t.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
381
381
|
`:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
382
382
|
`)?"":`
|
|
@@ -384,13 +384,13 @@ ${f}`:f;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
384
384
|
`+l.text,this.inlineQueue.at(-1).src=u.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
385
385
|
`)?"":`
|
|
386
386
|
`)+l.raw,u.text+=`
|
|
387
|
-
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},t.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0,f=e.slice(1),m;this.options.extensions.startBlock.forEach(
|
|
387
|
+
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},t.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0,f=e.slice(1),m;this.options.extensions.startBlock.forEach(v=>{m=v.call({lexer:this},f),typeof m=="number"&&m>=0&&(u=Math.min(u,m))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let u=t.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
388
388
|
`)?"":`
|
|
389
389
|
`)+l.raw,u.text+=`
|
|
390
390
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(l),r=c.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
391
391
|
`)?"":`
|
|
392
392
|
`)+l.raw,u.text+=`
|
|
393
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(l);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,f,m,
|
|
393
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(l);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,f,m,v;this.tokenizer.lexer=this;let r=e,i=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)y.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let o=!1,l="";for(;e;){o||(l=""),o=!1;let y;if((m=(f=this.options.extensions)==null?void 0:f.inline)!=null&&m.some(S=>(y=S.call({lexer:this},e,t))?(e=e.substring(y.raw.length),t.push(y),!0):!1))continue;if(y=this.tokenizer.escape(e)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.tag(e)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.link(e)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(y.raw.length);let S=t.at(-1);y.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):t.push(y);continue}if(y=this.tokenizer.emStrong(e,r,l)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.codespan(e)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.br(e)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.del(e,r,l)){e=e.substring(y.raw.length),t.push(y);continue}if(y=this.tokenizer.autolink(e)){e=e.substring(y.raw.length),t.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(e))){e=e.substring(y.raw.length),t.push(y);continue}let k=e;if((v=this.options.extensions)!=null&&v.startInline){let S=1/0,x=e.slice(1),M;this.options.extensions.startInline.forEach(Z=>{M=Z.call({lexer:this},x),typeof M=="number"&&M>=0&&(S=Math.min(S,M))}),S<1/0&&S>=0&&(k=e.substring(0,S+1))}if(y=this.tokenizer.inlineText(k)){e=e.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(l=y.raw.slice(-1)),o=!0;let S=t.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):t.push(y);continue}if(e){let S="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return t}},Xc=class{constructor(n){$(this,"options");$(this,"parser");this.options=n||Bi}space(n){return""}code({text:n,lang:e,escaped:t}){var s;let r=(s=(e||"").match(Be.notSpaceStart))==null?void 0:s[0],i=n.replace(Be.endingNewline,"")+`
|
|
394
394
|
`;return r?'<pre><code class="language-'+Ht(r)+'">'+(t?i:Ht(i,!0))+`</code></pre>
|
|
395
395
|
`:"<pre><code>"+(t?i:Ht(i,!0))+`</code></pre>
|
|
396
396
|
`}blockquote({tokens:n}){return`<blockquote>
|
|
@@ -408,12 +408,12 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
408
408
|
`}tablerow({text:n}){return`<tr>
|
|
409
409
|
${n}</tr>
|
|
410
410
|
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
411
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Ht(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),i=
|
|
412
|
-
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+Ht(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},Zi=new
|
|
413
|
-
<div class="desktop-upgrade-gate" ${
|
|
414
|
-
${
|
|
411
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Ht(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),i=Qg(n);if(i===null)return r;n=i;let s='<a href="'+n+'"';return e&&(s+=' title="'+Ht(e)+'"'),s+=">"+r+"</a>",s}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let i=Qg(n);if(i===null)return Ht(t);n=i;let s=`<img src="${n}" alt="${Ht(t)}"`;return e&&(s+=` title="${Ht(e)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Ht(n.text)}},$p=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},xt=class ff{constructor(e){$(this,"options");$(this,"renderer");$(this,"textRenderer");this.options=e||Bi,this.options.renderer=this.options.renderer||new Xc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $p}static parse(e,t){return new ff(t).parse(e)}static parseInline(e,t){return new ff(t).parseInline(e)}parse(e){var r,i;this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let o=e[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=u||"";continue}}let l=o;switch(l.type){case"space":{t+=this.renderer.space(l);break}case"hr":{t+=this.renderer.hr(l);break}case"heading":{t+=this.renderer.heading(l);break}case"code":{t+=this.renderer.code(l);break}case"table":{t+=this.renderer.table(l);break}case"blockquote":{t+=this.renderer.blockquote(l);break}case"list":{t+=this.renderer.list(l);break}case"checkbox":{t+=this.renderer.checkbox(l);break}case"html":{t+=this.renderer.html(l);break}case"def":{t+=this.renderer.def(l);break}case"paragraph":{t+=this.renderer.paragraph(l);break}case"text":{t+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return t}parseInline(e,t=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let o=0;o<e.length;o++){let l=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=t.text(c);break}case"html":{r+=t.html(c);break}case"link":{r+=t.link(c);break}case"image":{r+=t.image(c);break}case"checkbox":{r+=t.checkbox(c);break}case"strong":{r+=t.strong(c);break}case"em":{r+=t.em(c);break}case"codespan":{r+=t.codespan(c);break}case"br":{r+=t.br(c);break}case"del":{r+=t.del(c);break}case"text":{r+=t.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},nc,Yo=(nc=class{constructor(n){$(this,"options");$(this,"block");this.options=n||Bi}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?It.lex:It.lexInline}provideParser(){return this.block?xt.parse:xt.parseInline}},$(nc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$(nc,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),nc),Tz=class{constructor(...n){$(this,"defaults",yp());$(this,"options",this.setOptions);$(this,"parse",this.parseMarkdown(!0));$(this,"parseInline",this.parseMarkdown(!1));$(this,"Parser",xt);$(this,"Renderer",Xc);$(this,"TextRenderer",$p);$(this,"Lexer",It);$(this,"Tokenizer",Jc);$(this,"Hooks",Yo);this.use(...n)}walkTokens(n,e){var r,i;let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of o.rows)for(let c of l)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let o=s;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let c=o[l].flat(1/0);t=t.concat(this.walkTokens(c,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...o){let l=i.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),t.renderer){let i=this.defaults.renderer||new Xc(this.defaults);for(let s in t.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=t.renderer[o],c=i[o];i[o]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f||""}}r.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Jc(this.defaults);for(let s in t.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=t.tokenizer[o],c=i[o];i[o]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new Yo;for(let s in t.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=t.hooks[o],c=i[o];Yo.passThroughHooks.has(s)?i[o]=u=>{if(this.defaults.async&&Yo.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await l.call(i,u);return c.call(i,m)})();let f=l.call(i,u);return c.call(i,f)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(i,u);return m===!1&&(m=await c.apply(i,u)),m})();let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,s=t.walkTokens;r.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return It.lex(n,e??this.defaults)}parser(n,e){return xt.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,l=await(i.hooks?await i.hooks.provideLexer():n?It.lex:It.lexInline)(o,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?xt.parse:xt.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer():n?It.lex:It.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?xt.parse:xt.parseInline)(o,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(n,e){return t=>{if(t.message+=`
|
|
412
|
+
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+Ht(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},Zi=new Tz;function le(n,e){return Zi.parse(n,e)}le.options=le.setOptions=function(n){return Zi.setOptions(n),le.defaults=Zi.defaults,S2(le.defaults),le};le.getDefaults=yp;le.defaults=Bi;le.use=function(...n){return Zi.use(...n),le.defaults=Zi.defaults,S2(le.defaults),le};le.walkTokens=function(n,e){return Zi.walkTokens(n,e)};le.parseInline=Zi.parseInline;le.Parser=xt;le.parser=xt.parse;le.Renderer=Xc;le.TextRenderer=$p;le.Lexer=It;le.lexer=It.lex;le.Tokenizer=Jc;le.Hooks=Yo;le.parse=le;le.options;le.setOptions;le.use;le.walkTokens;le.parseInline;xt.parse;It.lex;_2.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function P2(n){const e=le.parse(n,{async:!1});return _2.sanitize(e,{USE_PROFILES:{html:!0}})}var Ei,tl;class Rz extends At{constructor(){super(...arguments);g(this,Ei,null);g(this,tl,Cr())}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||a(this,Ei)!==null)return;const t=((r=a(this,tl).value)==null?void 0:r.querySelector("dialog"))??null;if(t===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,Ei,Fu(t,()=>{}))})}disconnected(){var t;(t=a(this,Ei))==null||t.withdraw(),d(this,Ei,null)}template(t){return V`
|
|
413
|
+
<div class="desktop-upgrade-gate" ${mn(a(this,tl))}>
|
|
414
|
+
${Zu(V`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${g2(P2(fw(t)))}</div>`,{overlay:!0})}
|
|
415
415
|
</div>
|
|
416
|
-
`}}Ei=new WeakMap,
|
|
416
|
+
`}}Ei=new WeakMap,tl=new WeakMap;const Iz=kt(Rz),xz=250,Pz=1e3;var cn,un,$i,yr,Ci,qs,Dt,D2,cu,uu,L2,pf,O2;class Dz extends At{constructor(){super(...arguments);g(this,Dt);g(this,cn,Oz());g(this,un,null);g(this,$i,!1);g(this,yr,null);g(this,Ci,"");g(this,qs,null);g(this,cu,t=>{d(this,Ci,t.currentTarget.value)});g(this,uu,t=>{t.preventDefault();const r=a(this,Ci).trim();r.length===0||a(this,qs)===null||a(this,qs).authenticate(r)})}disconnected(){var t;h(this,Dt,pf).call(this),(t=a(this,un))==null||t.withdraw(),d(this,un,null),d(this,$i,!1),wc(null,a(this,cn))}template(t,r){var i;return d(this,qs,r),h(this,Dt,L2).call(this,t),t.kind==="needs-upgrade"?((i=a(this,un))==null||i.withdraw(),d(this,un,null),wc(Iz(t.instructions),a(this,cn)),a(this,cn)):(wc(Zu(h(this,Dt,D2).call(this,t),{overlay:!0}),a(this,cn)),h(this,Dt,O2).call(this),a(this,cn))}}cn=new WeakMap,un=new WeakMap,$i=new WeakMap,yr=new WeakMap,Ci=new WeakMap,qs=new WeakMap,Dt=new WeakSet,D2=function(t){switch(t.kind){case"connecting":return V`
|
|
417
417
|
<div class="system-modal" role="status" aria-live="polite">
|
|
418
418
|
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
419
419
|
<h2>Connecting</h2>
|
|
@@ -422,10 +422,10 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
422
422
|
<div class="system-modal" role="status" aria-live="polite">
|
|
423
423
|
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
424
424
|
<h2>Disconnected</h2>
|
|
425
|
-
<p>${
|
|
425
|
+
<p>${zz(t.nextRetryAt)}</p>
|
|
426
426
|
</div>
|
|
427
427
|
`;case"unauthorized":{const r=!!t.invalid;return r&&d(this,Ci,""),V`
|
|
428
|
-
<form class="system-modal auth-form" @submit=${a(this,
|
|
428
|
+
<form class="system-modal auth-form" @submit=${a(this,uu)}>
|
|
429
429
|
<tv-icon name="locked" size="xl"></tv-icon>
|
|
430
430
|
<h2>Enter access token</h2>
|
|
431
431
|
<p>This server requires an access token to connect.</p>
|
|
@@ -436,7 +436,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
436
436
|
placeholder="paste token here"
|
|
437
437
|
aria-label="Access token"
|
|
438
438
|
.value=${a(this,Ci)}
|
|
439
|
-
@input=${a(this,
|
|
439
|
+
@input=${a(this,cu)}
|
|
440
440
|
autofocus
|
|
441
441
|
required
|
|
442
442
|
/>
|
|
@@ -453,7 +453,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
453
453
|
<p class="server-url">${t.serverURL}</p>
|
|
454
454
|
<p>${t.message}</p>
|
|
455
455
|
</div>
|
|
456
|
-
`}},
|
|
456
|
+
`}},cu=new WeakMap,uu=new WeakMap,L2=function(t){const r=t.kind==="disconnected"&&t.nextRetryAt!==null;r&&a(this,yr)===null?d(this,yr,setInterval(()=>this.render(),xz)):r||h(this,Dt,pf).call(this)},pf=function(){a(this,yr)!==null&&(clearInterval(a(this,yr)),d(this,yr,null))},O2=function(){a(this,un)!==null||a(this,$i)||(d(this,$i,!0),queueMicrotask(()=>{if(d(this,$i,!1),!this.isConnected||!a(this,cn).isConnected||a(this,un)!==null)return;const t=a(this,cn).querySelector("dialog");t!==null&&d(this,un,Fu(t,()=>{}))}))};const Lz=kt(Dz);function Oz(){const n=document.createElement("section");return n.className="system-modal-host",n}function zz(n){if(n===null)return"Reattempting now…";const e=n-Date.now();return e<=0?"Reattempting now…":`Reattempting in ${Math.ceil(e/Pz)}s…`}const Nz=1400,Jl=new WeakMap;function Mz(n,e){var s;const t=e.ownerDocument,r=(s=t.defaultView)==null?void 0:s.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=t.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",t.body.append(i),i.select();try{t.execCommand("copy")}catch{}i.remove()}const Uz={writeClipboard:Mz,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function Zz(n,e,t){const r=n.currentTarget;if(!r)return;e.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,s=i!=null&&i.classList.contains("copy-button-status")?i:null;s&&(s.textContent="",s.textContent="Copied");const o=Jl.get(r);o&&o.scheduler.clearTimeout(o.handle);const l={handle:void 0,scheduler:e.scheduler};l.handle=e.scheduler.setTimeout(()=>{Jl.get(r)===l&&(Jl.delete(r),r.toggleAttribute("copied",!1),s&&(s.textContent=""))},Nz),Jl.set(r,l),t()}function z2({label:n,prompt:e="",variant:t,copied:r=!1,onActivate:i=()=>{}},s=Uz){return V`
|
|
457
457
|
<button
|
|
458
458
|
class="copy-button"
|
|
459
459
|
size="sm"
|
|
@@ -461,7 +461,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
461
461
|
variant=${t??ue}
|
|
462
462
|
?copied=${r}
|
|
463
463
|
prompt=${e}
|
|
464
|
-
@click=${o=>
|
|
464
|
+
@click=${o=>Zz(o,s,i)}
|
|
465
465
|
>
|
|
466
466
|
<span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
|
|
467
467
|
<span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
|
|
@@ -472,50 +472,51 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
472
472
|
aria-live="polite"
|
|
473
473
|
>${r?"Copied":ue}</span
|
|
474
474
|
>
|
|
475
|
-
`}const
|
|
475
|
+
`}const n1="tv-update-dismissed",Xl={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later"},r1="update-popover";function N2(n){try{return n.matches(":popover-open")}catch{return!1}}function Fz(n){const e=n.nextElementSibling;return e instanceof HTMLElement&&e.hasAttribute("popover")?e:null}function mf(n){typeof n.hidePopover=="function"&&N2(n)&&n.hidePopover()}function Hz(n,e){const t=n.target;if(!(t instanceof Element))return!1;const r=t.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&e.contains(r)}class Vz extends At{template({body:e,prompt:t,copied:r=!1,presented:i=!1,panelRef:s,bellRef:o,onPresent:l=()=>{},onDismiss:c=()=>{},onCopy:u=()=>{}}){const f=y=>{const k=y.currentTarget,S=Fz(k);if(S!==null){if(typeof S.showPopover=="function"){S.addEventListener("toggle",x=>{x.newState==="open"?l():c()},{once:!0});return}i?c():l()}},m=y=>{const S=y.currentTarget.closest("[popover]");S!==null&&mf(S),c()},v=y=>{const k=y.currentTarget;y.key!=="Escape"||!Hz(y,k)||(y.preventDefault(),y.stopPropagation(),mf(k),c())};return V`
|
|
476
476
|
<button
|
|
477
477
|
class="update-bell"
|
|
478
478
|
icon-only
|
|
479
|
-
popovertarget=${
|
|
480
|
-
aria-label=${
|
|
481
|
-
title=${
|
|
482
|
-
|
|
479
|
+
popovertarget=${r1}
|
|
480
|
+
aria-label=${Xl.update_available}
|
|
481
|
+
title=${Xl.update_available}
|
|
482
|
+
${mn(o)}
|
|
483
|
+
@click=${f}
|
|
483
484
|
>
|
|
484
485
|
<tv-icon name="notification" size="sm"></tv-icon>
|
|
485
486
|
</button>
|
|
486
487
|
|
|
487
488
|
<div
|
|
488
|
-
id=${
|
|
489
|
+
id=${r1}
|
|
489
490
|
popover="manual"
|
|
490
491
|
placement="bottom-end"
|
|
491
492
|
role="status"
|
|
492
493
|
class="update-popover"
|
|
493
|
-
${
|
|
494
|
-
@keydown=${
|
|
494
|
+
${mn(s)}
|
|
495
|
+
@keydown=${v}
|
|
495
496
|
>
|
|
496
497
|
${e}
|
|
497
498
|
<div class="update-actions">
|
|
498
|
-
<button size="sm" class="update-later" @click=${
|
|
499
|
-
>${
|
|
499
|
+
<button size="sm" class="update-later" @click=${m}
|
|
500
|
+
>${Xl.later}</button
|
|
500
501
|
>
|
|
501
|
-
${t===void 0?ue:
|
|
502
|
+
${t===void 0?ue:z2({label:Xl.copy_prompt,prompt:t,variant:"primary",copied:r,onActivate:u})}
|
|
502
503
|
</div>
|
|
503
504
|
</div>
|
|
504
|
-
`}}const
|
|
505
|
+
`}}const Bz=kt(Vz);function qz(n,e){return e===null?!0:fv(n,e)}const i1=new Set;var mt,hn,nl,js,Hn,Ti,Ri,Ws,Ne,Vn,Ii,Gs,Ys,xi,wr,q,gf,vf,yf,wf,bf,rl,Pi,jr,M2,_f,Sf,Af,hu,du,fu,pu,mu,Ko,U2;class jz{constructor(e=()=>{}){g(this,q);g(this,mt,null);g(this,hn,null);g(this,nl,"");g(this,js);g(this,Hn,!1);g(this,Ti,!1);g(this,Ri,!1);g(this,Ws,null);g(this,Ne,!1);g(this,Vn,!1);g(this,Ii,null);g(this,Gs,null);g(this,Ys,!1);g(this,xi,[]);g(this,wr);g(this,rl,()=>{a(this,wr).call(this)});g(this,Pi,()=>{h(this,q,Af).call(this),a(this,wr).call(this)});g(this,hu,()=>{var t,r;const e=((r=(t=h(this,q,jr).call(this))==null?void 0:t.updateState)==null?void 0:r.toast)??null;e===null||a(this,Ne)||(d(this,Ne,!0),h(this,q,_f).call(this,e),a(this,wr).call(this))});g(this,du,()=>{var t,r,i;if(!a(this,Ne))return;const e=((r=(t=h(this,q,jr).call(this))==null?void 0:t.updateState)==null?void 0:r.toast)??null;e!==null&&((i=h(this,q,gf).call(this))==null||i.setItem(n1,e.version)),d(this,Ne,!1),d(this,Vn,!0),a(this,wr).call(this)});g(this,fu,()=>{var t,r;const e=((r=(t=h(this,q,jr).call(this))==null?void 0:t.updateState)==null?void 0:r.toast)??null;(e==null?void 0:e.prompt)!==void 0&&h(this,q,Sf).call(this,"update_prompt_copy_clicked",e)});g(this,pu,e=>{d(this,Ii,e instanceof HTMLElement?e:null),h(this,q,Ko).call(this)});g(this,mu,e=>{d(this,Gs,e instanceof HTMLElement?e:null),h(this,q,Ko).call(this)});d(this,wr,e)}get presented(){return a(this,Ne)}configure({connectionOwner:e=null,primaryServerURL:t="",presentation:r=null,dismissalStorage:i}){e!==a(this,mt)&&(h(this,q,yf).call(this),d(this,mt,e),h(this,q,vf).call(this)),r!==a(this,hn)&&(h(this,q,bf).call(this),d(this,hn,r),h(this,q,wf).call(this)),d(this,nl,t),d(this,js,i)}connect(){a(this,Hn)||(d(this,Hn,!0),h(this,q,vf).call(this),h(this,q,wf).call(this))}disconnect(){a(this,Hn)&&(h(this,q,yf).call(this),h(this,q,bf).call(this),d(this,Hn,!1),d(this,Ii,null),d(this,Gs,null))}template(){var o,l,c,u;const e=((l=(o=h(this,q,jr).call(this))==null?void 0:o.updateState)==null?void 0:l.toast)??null,t=((c=a(this,hn))==null?void 0:c.toastsSuppressed)??!1;if(e===null?(d(this,Ws,null),d(this,Ne,!1),d(this,Vn,!0)):e.version!==a(this,Ws)&&(d(this,Ws,e.version),d(this,Ne,qz(e.version,h(this,q,M2).call(this))),d(this,Vn,!0),a(this,Ne)&&!t&&h(this,q,_f).call(this,e)),e===null||t)return d(this,Ne,!1),d(this,Vn,!0),h(this,q,Ko).call(this),ue;const r=(u=a(this,Ii))==null?void 0:u.querySelector(".copy-button"),i=a(this,Ne)&&!a(this,Vn)&&(r==null?void 0:r.hasAttribute("copied"))===!0,s=Bz({body:g2(P2(e.markdown)),prompt:e.prompt,copied:i,presented:a(this,Ne),panelRef:a(this,pu),bellRef:a(this,mu),onPresent:a(this,hu),onDismiss:a(this,du),onCopy:a(this,fu)});return d(this,Vn,!1),h(this,q,Ko).call(this),s}}mt=new WeakMap,hn=new WeakMap,nl=new WeakMap,js=new WeakMap,Hn=new WeakMap,Ti=new WeakMap,Ri=new WeakMap,Ws=new WeakMap,Ne=new WeakMap,Vn=new WeakMap,Ii=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,xi=new WeakMap,wr=new WeakMap,q=new WeakSet,gf=function(){return a(this,js)!==void 0?a(this,js):typeof localStorage>"u"?null:localStorage},vf=function(){!a(this,Hn)||a(this,Ti)||a(this,mt)===null||(a(this,mt).addEventListener("server-status",a(this,Pi)),a(this,mt).addEventListener("change",a(this,Pi)),d(this,Ti,!0))},yf=function(){!a(this,Ti)||a(this,mt)===null||(a(this,mt).removeEventListener("server-status",a(this,Pi)),a(this,mt).removeEventListener("change",a(this,Pi)),d(this,Ti,!1))},wf=function(){!a(this,Hn)||a(this,Ri)||a(this,hn)===null||(a(this,hn).addEventListener("change",a(this,rl)),d(this,Ri,!0))},bf=function(){!a(this,Ri)||a(this,hn)===null||(a(this,hn).removeEventListener("change",a(this,rl)),d(this,Ri,!1))},rl=new WeakMap,Pi=new WeakMap,jr=function(){var t;const e=((t=a(this,mt))==null?void 0:t.connection)??null;return(e==null?void 0:e.url)===a(this,nl)?e:null},M2=function(){var t;const e=((t=h(this,q,gf).call(this))==null?void 0:t.getItem(n1))??null;return e!==null&&rp(e)?e:null},_f=function(e){i1.has(e.version)||(i1.add(e.version),h(this,q,Sf).call(this,"update_toast_shown",e))},Sf=function(e,t){var r;a(this,xi).push({event:e,properties:{server_version:((r=h(this,q,jr).call(this))==null?void 0:r.serverVersion)??"",channel_version:t.version}}),h(this,q,Af).call(this)},Af=function(){if(a(this,xi).length===0)return;const e=h(this,q,jr).call(this);if(!e||e.status!=="connected")return;const t=a(this,xi);d(this,xi,[]);for(const r of t)e.sendTelemetrySignal(r.event,r.properties)},hu=new WeakMap,du=new WeakMap,fu=new WeakMap,pu=new WeakMap,mu=new WeakMap,Ko=function(){a(this,Ys)||(d(this,Ys,!0),queueMicrotask(()=>{d(this,Ys,!1),h(this,q,U2).call(this)}))},U2=function(){const e=a(this,Ii);if(e!==null)if(a(this,Ne)&&!N2(e)&&typeof e.showPopover=="function"){const t=a(this,Gs);if(t===null)return;e.showPopover({source:t})}else a(this,Ne)||mf(e)};const Wz=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,Gz=""+new URL("table-oeG9uAN1.png",import.meta.url).href,Yz=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,Kz=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,s1="Artifact skills",Jz="Artifact skills",Xz="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",Qz="Copy prompt";function Ql({artifactSkill:n,name:e,description:t,prompt:r,thumbnail:i},s){return V`
|
|
505
506
|
<article class="skill-card">
|
|
506
507
|
<div class="skill-thumb"><img src=${i} alt="" /></div>
|
|
507
508
|
<div class="skill-name">${e}</div>
|
|
508
509
|
<p class="skill-desc">${t}</p>
|
|
509
|
-
${
|
|
510
|
+
${z2({label:Qz,prompt:r,onActivate:()=>s==null?void 0:s.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
|
|
510
511
|
</article>
|
|
511
|
-
`}class
|
|
512
|
+
`}class eN extends At{template(e=null){return V`
|
|
512
513
|
<button
|
|
513
514
|
class="skill-trigger"
|
|
514
515
|
variant="ghost"
|
|
515
516
|
icon-only
|
|
516
517
|
popovertarget="skills-popover"
|
|
517
|
-
aria-label=${
|
|
518
|
-
title=${
|
|
518
|
+
aria-label=${s1}
|
|
519
|
+
title=${s1}
|
|
519
520
|
>
|
|
520
521
|
<tv-icon name="skills" size="sm"></tv-icon>
|
|
521
522
|
</button>
|
|
@@ -526,68 +527,68 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
|
|
|
526
527
|
placement="bottom-end"
|
|
527
528
|
class="skill-popover"
|
|
528
529
|
>
|
|
529
|
-
<div class="skill-heading">${
|
|
530
|
-
<p class="skill-intro">${
|
|
530
|
+
<div class="skill-heading">${Jz}</div>
|
|
531
|
+
<p class="skill-intro">${Xz}</p>
|
|
531
532
|
<div class="skill-grid">
|
|
532
|
-
${
|
|
533
|
-
${
|
|
534
|
-
${
|
|
535
|
-
${
|
|
533
|
+
${Ql({artifactSkill:"calendar",name:"Calendar",description:"Visualize your calendar events across day and week views.",prompt:"Use the tv-calendar skill to make a calendar artifact for the following request, and put it on TV: ",thumbnail:Wz},e)}
|
|
534
|
+
${Ql({artifactSkill:"table",name:"Table",description:"Beautiful tables with headers, grouping, and chips for displaying data.",prompt:"Use the tv-table skill to make a table artifact for the following request, and put it on TV: ",thumbnail:Gz},e)}
|
|
535
|
+
${Ql({artifactSkill:"tasks",name:"Tasks",description:"Track tasks and plans in a checklist, with due dates, projects, and labels.",prompt:"Use the tv-tasks skill to make a task list artifact for the following request, and put it on TV: ",thumbnail:Yz},e)}
|
|
536
|
+
${Ql({artifactSkill:"markdown",name:"Markdown",description:"An interactive markdown editor for Obsidian notes and other formatted docs.",prompt:"Make a markdown artifact for the following request, and put it on TV: ",thumbnail:Kz},e)}
|
|
536
537
|
</div>
|
|
537
538
|
</div>
|
|
538
|
-
`}}const
|
|
539
|
+
`}}const tN=kt(eN),ns=.5;var st,Ks,Js,Di,br,Bn,qn,_r,Sr,Ar,dn,kr,Xs,il,Me,Er,gu,O,Z2,sl,ol,al,vu,ll,us,kf,F2,Ef,$f,Cf,Tf,H2,V2,B2,q2,cl,j2,Jo,Rf,W2,G2,Y2,Xo,Qo;class nN extends At{constructor(){super(...arguments);g(this,O);g(this,st,Cr());g(this,Ks);g(this,Js);g(this,Di,!1);g(this,br,0);g(this,Bn,!1);g(this,qn,!1);g(this,_r,!1);g(this,Sr,0);g(this,Ar,null);g(this,dn,!1);g(this,kr,null);g(this,Xs,null);g(this,il,!1);g(this,Me,null);g(this,Er,!1);g(this,gu,()=>{h(this,O,Qo).call(this)});g(this,sl,t=>{var s;const r=a(this,Me);if(r===null||r.pointerId!==t.pointerId||!r.dragging&&Math.hypot(t.clientX-r.originX,t.clientY-r.originY)<=Fd)return;const i=a(this,st).value;if(i){if(r.currentX=t.clientX,r.currentY=t.clientY,r.dragging)this.render();else{h(this,O,Xo).call(this);const o=r.tab.getBoundingClientRect();r.dragging=!0,r.tabLeft=o.left,r.tabTop=o.top,r.tabWidth=o.width,r.tabHeight=o.height,i.setPointerCapture(t.pointerId),this.render(),(s=r.onReorderChange)==null||s.call(r,h(this,O,Tf).call(this,r))}h(this,O,Cf).call(this,r),h(this,O,kf).call(this,r)}});g(this,ol,t=>{const r=a(this,Me);if(r===null||r.pointerId!==t.pointerId)return;const i=!r.dragging&&t.composedPath().includes(r.tab);h(this,O,us).call(this,!0,!0),i&&r.application.selectPage(r.channelId,r.artifactId)});g(this,al,t=>{var r;((r=a(this,Me))==null?void 0:r.pointerId)===t.pointerId&&h(this,O,us).call(this,!1,!0)});g(this,vu,t=>{var r;((r=a(this,Me))==null?void 0:r.pointerId)===t.pointerId&&h(this,O,us).call(this,!1,!0)});g(this,ll,t=>{var r;t.key!=="Escape"||!((r=a(this,Me))!=null&&r.dragging)||(t.preventDefault(),h(this,O,us).call(this,!1,!0))});g(this,cl,()=>{d(this,dn,!0),h(this,O,Jo).call(this,!0)})}connected(){var t;d(this,Ks,void 0),d(this,Js,void 0),d(this,dn,!1),h(this,O,j2).call(this),typeof document<"u"&&((t=document.fonts)==null||t.addEventListener("loadingdone",a(this,cl),{once:!0})),window.addEventListener("pointermove",a(this,sl)),window.addEventListener("pointerup",a(this,ol)),window.addEventListener("pointercancel",a(this,al)),window.addEventListener("keydown",a(this,ll))}template(t,r,i=null,s){var S,x;const o=(S=a(this,Me))!=null&&S.dragging?a(this,Me):null,l=(o==null?void 0:o.provisionalPages)??(r==null?void 0:r.pages),c=iN(r,l),u=(o==null?void 0:o.artifactId)??i,f=((x=r==null?void 0:r.selectedPage)==null?void 0:x.artifactIds[0])??null,m=`${(r==null?void 0:r.id)??""}:${c.map(({key:M,label:Z})=>`${M}:${Z}`).join("|")}`,v=f!==a(this,Ks),y=m!==a(this,Js);v&&d(this,Er,!1);const k=v||o===null&&y;return y&&d(this,dn,!0),d(this,Ks,f),d(this,Js,m),h(this,O,Jo).call(this,k,v,v&&!y),V`
|
|
539
540
|
<div
|
|
540
541
|
class="tab-strip"
|
|
541
542
|
role="tablist"
|
|
542
|
-
${
|
|
543
|
+
${mn(a(this,st))}
|
|
543
544
|
?tab-held=${o!==null}
|
|
544
|
-
@scroll=${a(this,
|
|
545
|
-
@lostpointercapture=${a(this,
|
|
545
|
+
@scroll=${a(this,gu)}
|
|
546
|
+
@lostpointercapture=${a(this,vu)}
|
|
546
547
|
>
|
|
547
548
|
${jc(c,({key:M})=>M,(M,Z)=>{const G=M.artifactId!==null&&M.artifactId===f,F=M.artifactId!==null&&M.artifactId===u,W=F&&o!==null;return V`
|
|
548
549
|
${F?V`
|
|
549
550
|
<span
|
|
550
551
|
class="tab-placeholder"
|
|
551
552
|
aria-hidden="true"
|
|
552
|
-
style=${
|
|
553
|
+
style=${Wc(W?{width:`${o.tabWidth}px`,height:`${o.tabHeight}px`}:{})}
|
|
553
554
|
></span>
|
|
554
555
|
`:null}
|
|
555
556
|
<button
|
|
556
557
|
class="tab"
|
|
557
558
|
?dragged=${F}
|
|
558
559
|
?dragging=${W}
|
|
559
|
-
style=${
|
|
560
|
+
style=${Wc(W?{left:`${o.tabLeft+o.currentX-o.originX}px`,top:`${o.tabTop+o.currentY-o.originY}px`,width:`${o.tabWidth}px`,height:`${o.tabHeight}px`}:{})}
|
|
560
561
|
role="tab"
|
|
561
562
|
aria-selected=${G?"true":"false"}
|
|
562
563
|
tabindex=${G?"0":"-1"}
|
|
563
564
|
data-artifact-id=${M.artifactId??""}
|
|
564
|
-
@pointerdown=${u===null?re=>h(this,O,
|
|
565
|
-
@dblclick=${G&&r!==null&&!W?()=>
|
|
566
|
-
@keydown=${re=>h(this,O,
|
|
565
|
+
@pointerdown=${u===null?re=>h(this,O,Z2).call(this,re,t,r,M,s):null}
|
|
566
|
+
@dblclick=${G&&r!==null&&!W?()=>rf(t,r,M.page,!M.page.geometry.full_screen):null}
|
|
567
|
+
@keydown=${re=>h(this,O,B2).call(this,re,t,r,c,Z)}
|
|
567
568
|
>
|
|
568
569
|
<span class="tab-label">${M.label}</span>
|
|
569
570
|
</button>
|
|
570
571
|
`})}
|
|
571
572
|
</div>
|
|
572
|
-
`}disconnected(){var t,r;d(this,Di,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a(this,br)),d(this,br,0),d(this,
|
|
573
|
+
`}disconnected(){var t,r;d(this,Di,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a(this,br)),d(this,br,0),d(this,Bn,!1),d(this,qn,!1),d(this,_r,!1),h(this,O,Xo).call(this),d(this,Er,!1),d(this,dn,!1),(t=a(this,kr))==null||t.disconnect(),d(this,kr,null),d(this,Xs,null),typeof document<"u"&&((r=document.fonts)==null||r.removeEventListener("loadingdone",a(this,cl))),window.removeEventListener("pointermove",a(this,sl)),window.removeEventListener("pointerup",a(this,ol)),window.removeEventListener("pointercancel",a(this,al)),window.removeEventListener("keydown",a(this,ll)),h(this,O,us).call(this,!1,!1)}}st=new WeakMap,Ks=new WeakMap,Js=new WeakMap,Di=new WeakMap,br=new WeakMap,Bn=new WeakMap,qn=new WeakMap,_r=new WeakMap,Sr=new WeakMap,Ar=new WeakMap,dn=new WeakMap,kr=new WeakMap,Xs=new WeakMap,il=new WeakMap,Me=new WeakMap,Er=new WeakMap,gu=new WeakMap,O=new WeakSet,Z2=function(t,r,i,s,o){a(this,Me)!==null||i===null||s.artifactId===null||t.button!==0||!t.isPrimary||d(this,Me,{pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,tab:t.currentTarget,application:r,channelId:i.id,artifactId:s.artifactId,originalPages:i.pages,onReorderChange:o,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(s.page),currentX:t.clientX,currentY:t.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1})},sl=new WeakMap,ol=new WeakMap,al=new WeakMap,vu=new WeakMap,ll=new WeakMap,us=function(t,r){var o;const i=a(this,Me);if(i===null)return;if(h(this,O,Ef).call(this,i),i.edgeScrollMoved&&d(this,Er,!0),i.dragging&&(d(this,Bn,a(this,qn)),a(this,qn)||d(this,_r,!1)),i.dragging&&t&&!sN(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!t)for(const l of i.displacementAnimations)l.cancel();d(this,Me,null),(o=i.onReorderChange)==null||o.call(i,null);const s=a(this,st).value;i.dragging&&(s!=null&&s.hasPointerCapture(i.pointerId))&&s.releasePointerCapture(i.pointerId),r&&this.render()},kf=function(t){const r=a(this,st).value,i=r?h(this,O,$f).call(this,r,t.currentX):0,s=r?Math.max(0,r.scrollWidth-r.clientWidth):0,o=i<0?((r==null?void 0:r.scrollLeft)??0)<=ns:((r==null?void 0:r.scrollLeft)??0)>=s-ns;if(!t.dragging||i===0||s===0||o||typeof requestAnimationFrame!="function"){h(this,O,Ef).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{h(this,O,F2).call(this,t,l)}))},F2=function(t,r){if(t.edgeScrollFrame=0,a(this,Me)!==t||!t.dragging){t.edgeScrollTimestamp=null;return}const i=a(this,st).value;if(!i){t.edgeScrollTimestamp=null;return}const s=h(this,O,$f).call(this,i,t.currentX),o=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,s!==0&&o!==null){const l=Math.max(0,r-o)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,f=s*l+t.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+f));i.scrollLeft=m;const v=i.scrollLeft-u;v!==0&&(t.edgeScrollMoved=!0),t.edgeScrollRemainder=m===0||m===c?0:f-v,v!==0&&(h(this,O,Qo).call(this,i),h(this,O,Cf).call(this,t))}h(this,O,kf).call(this,t)},Ef=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},$f=function(t,r){const i=t.getBoundingClientRect();return r>=i.left&&r<i.left+vt?-Gc*(i.left+vt-r)/vt:r>i.right-vt&&r<=i.right?Gc*(r-(i.right-vt))/vt:0},Cf=function(t){var k;const r=a(this,st).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const s=i.nextElementSibling,o=t.tab.getBoundingClientRect(),l=o.left+o.width/2;let c=t.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const S=u.getBoundingClientRect();if(l>=S.left+S.width/2)break;c-=1,u=u.previousElementSibling}let f=s==null?void 0:s.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const S=f.getBoundingClientRect();if(l<=S.left+S.width/2)break;c+=1,f=f.nextElementSibling}if(c===t.slot)return;const m=h(this,O,H2).call(this,r),v=[...t.provisionalPages],[y]=v.splice(t.slot,1);y&&(v.splice(c,0,y),t.provisionalPages=v,t.slot=c,this.render(),(k=t.onReorderChange)==null||k.call(t,h(this,O,Tf).call(this,t)),queueMicrotask(()=>h(this,O,V2).call(this,t,m)))},Tf=function(t){return{channelId:t.channelId,pages:t.provisionalPages,carriedArtifactId:t.artifactId}},H2=function(t){return new Map([...t.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},V2=function(t,r){const i=a(this,st).value;if(i)for(const s of i.querySelectorAll(".tab:not([dragging])")){const o=r.get(s.dataset.artifactId??"");if(o===void 0)continue;const l=o-s.getBoundingClientRect().left;if(Math.abs(l)<=ns)continue;const c=s.animate({translate:[`${l}px 0`,"0px 0"]},{duration:ps,easing:"ease"});t.displacementAnimations.add(c),c.finished.finally(()=>{t.displacementAnimations.delete(c)}).catch(()=>{})}},B2=function(t,r,i,s,o){var u;if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;t.preventDefault();const l=Math.max(0,Math.min(s.length-1,o+(t.key==="ArrowLeft"?-1:1)));if(l===o||i===null)return;const c=(u=s[l])==null?void 0:u.artifactId;c&&(r.selectPage(i.id,c),queueMicrotask(()=>h(this,O,q2).call(this,c)))},q2=function(t){const r=a(this,st).value;if(!r)return;const i=[...r.querySelectorAll(".tab")].find(s=>s.dataset.artifactId===t);i==null||i.focus({preventScroll:!0})},cl=new WeakMap,j2=function(){a(this,il)||typeof document>"u"||!document.fonts||(d(this,il,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,dn,!0),h(this,O,Jo).call(this,!0))}))},Jo=function(t,r=!1,i=!1){a(this,Bn)||d(this,Bn,t),t&&r&&(d(this,qn,!0),d(this,_r,i)),!(a(this,Di)||a(this,br)!==0)&&(d(this,Di,!0),queueMicrotask(()=>{if(d(this,Di,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,O,Rf).call(this);return}d(this,br,requestAnimationFrame(()=>{d(this,br,0),h(this,O,Rf).call(this)}))}}))},Rf=function(){var l;const t=a(this,st).value;if(!t)return;a(this,dn)&&(d(this,dn,!1),h(this,O,W2).call(this,t)),h(this,O,G2).call(this,t);const r=((l=a(this,Me))==null?void 0:l.dragging)===!0,i=a(this,qn),s=i&&a(this,_r),o=!r&&(i||a(this,Bn)&&!a(this,Er));r?d(this,Bn,i):(d(this,Bn,!1),d(this,qn,!1),d(this,_r,!1),i&&d(this,Er,!1)),o&&h(this,O,Y2).call(this,t,s),h(this,O,Qo).call(this,t)},W2=function(t){var r;for(const i of t.querySelectorAll(".tab")){const s=i.querySelector(".tab-label");if(!s)continue;const o=document.createRange();o.selectNodeContents(s);const l=(r=o.getBoundingClientRect)==null?void 0:r.call(o);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=ec(c.paddingLeft)+ec(c.paddingRight)+ec(c.borderLeftWidth)+ec(c.borderRightWidth),m=Math.ceil(l.width)+u>uO+hO?"capped":"hugging";i.dataset.compression!==m&&(i.dataset.compression=m)}},G2=function(t){var r;typeof ResizeObserver>"u"||a(this,Xs)===t||((r=a(this,kr))==null||r.disconnect(),a(this,kr)??d(this,kr,new ResizeObserver(()=>h(this,O,Jo).call(this,!0))),a(this,kr).observe(t),d(this,Xs,t))},Y2=function(t,r){const i=t.querySelector('.tab[aria-selected="true"]');if(!i){h(this,O,Xo).call(this);return}const s=t.getBoundingClientRect(),o=i.getBoundingClientRect(),l=Math.max(0,Math.min(t.scrollLeft+o.left+o.width/2-(s.left+s.width/2),t.scrollWidth-t.clientWidth));if(h(this,O,Xo).call(this),!r||Math.abs(t.scrollLeft-l)<=ns||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=l;return}const c=t.scrollLeft,u=t.animate([{},{}],{duration:l2,easing:"ease"});d(this,Ar,u);const f=()=>{var v;if(u!==a(this,Ar))return;const m=u.playState==="finished"?1:((v=u.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=c+(l-c)*m,u.playState==="finished"?(t.scrollLeft=l,d(this,Ar,null),d(this,Sr,0),h(this,O,Qo).call(this,t)):d(this,Sr,requestAnimationFrame(f))};d(this,Sr,requestAnimationFrame(f))},Xo=function(){var t;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a(this,Sr)),d(this,Sr,0),(t=a(this,Ar))==null||t.cancel(),d(this,Ar,null)},Qo=function(t=a(this,st).value){if(!t)return;const r=Math.max(0,t.scrollWidth-t.clientWidth);t.toggleAttribute("continues-start",t.scrollLeft>ns),t.toggleAttribute("continues-end",t.scrollLeft<r-ns)};const rN=kt(nN);function iN(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{var o;const s=r.artifactIds[0]??null;return{page:r,artifactId:s,label:s===null?"":((o=t.get(s))==null?void 0:o.title)??"",key:s??`empty-page-${i}`}})}function sN(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function ec(n){const e=Number.parseFloat(n);return Number.isFinite(e)?e:0}var Li;class oN extends At{constructor(){super(...arguments);g(this,Li,new jz(()=>this.render()))}connected(){a(this,Li).connect()}template(t,r,i={}){var s;return a(this,Li).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),V`
|
|
573
574
|
<header class="top-bar" ?electron-draggable=${i.electronMode??!1}>
|
|
574
|
-
${
|
|
575
|
+
${rN(t,r,null,i.onTabReorderChange)}
|
|
575
576
|
<div class="top-bar-controls">
|
|
576
|
-
${
|
|
577
|
+
${tN((s=i.connectionOwner)==null?void 0:s.connection)}
|
|
577
578
|
${a(this,Li).template()}
|
|
578
579
|
</div>
|
|
579
580
|
</header>
|
|
580
|
-
`}disconnected(){a(this,Li).disconnect()}}Li=new WeakMap;const
|
|
581
|
+
`}disconnected(){a(this,Li).disconnect()}}Li=new WeakMap;const aN=kt(oN);var fn,ul,hl,yu,Oi,wu,K2;class lN extends At{constructor(){super(...arguments);g(this,wu);g(this,fn,null);g(this,ul);g(this,hl,t=>{var r;Tb(t,navigator.platform)&&(t.preventDefault(),t.stopPropagation(),(r=a(this,fn))==null||r.handleNavigationKey(t.key))});g(this,yu,t=>{d(this,ul,t??void 0),this.render()});g(this,Oi,()=>{this.render()})}update(t,r){const i=r[0];return a(this,fn)!==i&&(a(this,fn)!==null&&this.isConnected&&(a(this,fn).removeEventListener("change",a(this,Oi)),i.addEventListener("change",a(this,Oi))),d(this,fn,i)),super.update(t,r)}connected(){var t;(t=a(this,fn))==null||t.addEventListener("change",a(this,Oi)),document.addEventListener("keydown",a(this,hl),{capture:!0})}disconnected(){var t;(t=a(this,fn))==null||t.removeEventListener("change",a(this,Oi)),document.removeEventListener("keydown",a(this,hl),{capture:!0})}template(t,r){const i=Y5(t.snapshot,r.runtimeServerURL),s=t.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var o;this.isConnected&&((o=r.onRenderComplete)==null||o.call(r,i.kind))}),V`
|
|
581
582
|
<div id="app" data-app-state=${i.kind}>
|
|
582
|
-
${
|
|
583
|
-
${
|
|
583
|
+
${uN(i)?h(this,wu,K2).call(this,t,s,r):null}
|
|
584
|
+
${hN(i)?Lz(i,t):null}
|
|
584
585
|
</div>
|
|
585
|
-
`}}fn=new WeakMap,
|
|
586
|
+
`}}fn=new WeakMap,ul=new WeakMap,hl=new WeakMap,yu=new WeakMap,Oi=new WeakMap,wu=new WeakSet,K2=function(t,r,i){return V`
|
|
586
587
|
<aside class="app-sidebar">
|
|
587
|
-
${
|
|
588
|
+
${FL(t,r,i.electronMode)}
|
|
588
589
|
</aside>
|
|
589
590
|
<main class="app-main">
|
|
590
|
-
${
|
|
591
|
-
${
|
|
591
|
+
${aN(t,r.focusedChannel,{electronMode:i.electronMode,connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,onTabReorderChange:a(this,yu)})}
|
|
592
|
+
${wO(t,r.focusedChannel,a(this,ul))}
|
|
592
593
|
</main>
|
|
593
|
-
`};const
|
|
594
|
+
`};const cN=kt(lN);function uN(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function hN(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const J2=new CSSStyleSheet;try{"adoptedStyleSheets"in document&&(document.adoptedStyleSheets=[...document.adoptedStyleSheets,J2])}catch{}function X2(n){J2.replaceSync(n)}function fa(){X2("")}let Qn=null;async function dN(n,e){if(Qn==null||Qn.abort(),n===null){Qn=null,fa();return}const t=new AbortController;Qn=t;try{const r=e.token?{Authorization:`Bearer ${e.token}`}:void 0,i=new URL(`/themes/${n}/theme.css`,e.url).toString(),s=await fetch(i,{signal:t.signal,...r?{headers:r}:{}});if(!s.ok)throw new Error(`Theme fetch failed: ${s.status}`);const o=await s.text();if(Qn!==t)return;X2(o)}catch(r){if(r.name==="AbortError")return;fa();const i=r instanceof Error?r.message:String(r);console.warn(`applyTheme: ${i}`)}finally{Qn===t&&(Qn=null)}}document.documentElement.dataset.tvBundleVersion=pp();Object.defineProperty(window,"__tvVersion",{value:pp(),writable:!1,configurable:!1});const Dr=jn(),Cp=JR(),Q2=XR(),fN=new QE(Dr?"television-electron":"television-browser",XE()),o1=lw(),pN=o1?s3({storage:o1,clientApp:Dr?"desktop":"browser",desktopAppVersion:Dr?uy():null}):null,Tp=Rr(Dr?Cp:window.location.origin),eb=A5({search:window.location.search}),Rp=mp(),tb=new T5,Ip=C5({detection:eb,primaryServerURL:Tp,navigationLatch:Rp,presentation:tb}),qe=new l5({localStore:fN,serverURL:Cp,launchToken:Q2,telemetryMeta:pN,navigationPending:()=>Rp.pending,...eb.electron?{decideBoot:n=>Ip.decideBoot(n)}:{}}),mN=n=>{FE(vn,n)},vn=new xE({connectionOwner:qe,navigationKeyHandler:mN,retainedGateHalted:()=>Ip.gated}),a1=globalThis.__televisionNativeBridge;Dr&&a1&&a1.onNavigationKey(n=>vn.handleNavigationKey(n));if(Q2){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`)}S5({owner:qe,primaryServerURL:Tp,navigationLatch:Rp});Ip.attach(qe);const gN=()=>{const n=qe.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));v5(t)}).catch(()=>{})},nb=()=>{if(qe.connection.status!=="connected"){fa();return}gN()};let tc;const rb=n=>{dN(n,qe.connection).catch(()=>{vn.snapshot.connection.status==="connected"&&fa()})},ib=()=>{const n=vn.snapshot;if(n.connection.status!=="connected"){tc=void 0,fa();return}!n.ready||n.display.activeThemeName===tc||(tc=n.display.activeThemeName,rb(tc))},vN=n=>{const e=vn.snapshot;e.connection.status!=="connected"||!e.ready||n.themeName!==e.display.activeThemeName||rb(n.themeName)};nb();ib();qe.addEventListener("change",nb);vn.addEventListener("change",ib);vn.addEventListener("theme-changed",vN);lv.register("ServerConnectionOwner",()=>qe);lv.register("ApplicationService",()=>vn);const sa=globalThis.__telepath??(globalThis.__telepath={});sa.applicationService=vn;sa.connectionOwner=qe;const yN=sa.renderCompleteCallbacks??(sa.renderCompleteCallbacks=new Set);Dr&&document.body.classList.add("electron");let l1=!1;const sb=()=>{l1||(wc(cN(vn,{runtimeServerURL:Cp,electronMode:Dr,connectionOwner:qe,primaryServerURL:Tp,updatePresentation:tb,onRenderComplete(n){for(const e of yN)e(n)}}),document.body),l1=!0)},ob=()=>{const n=qe.connection;n.bootState==="pending"&&!n.hasAuthRejected&&qe.connectError===null||(qe.removeEventListener("change",ob),sb())};Dr?qe.addEventListener("change",ob):sb();qe.connect();
|