@telepath-computer/television 1.4.4 → 1.4.6

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,62 +1,62 @@
1
- var __=Object.defineProperty;var T1=n=>{throw TypeError(n)};var A_=(n,e,t)=>e in n?__(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>A_(n,typeof e!="symbol"?e+"":e,t),hf=(n,e,t)=>e.has(n)||T1("Cannot "+t);var s=(n,e,t)=>(hf(n,e,"read from private field"),t?t.call(n):e.get(n)),p=(n,e,t)=>e.has(n)?T1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),h=(n,e,t,r)=>(hf(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),u=(n,e,t)=>(hf(n,e,"access private method"),t);var nh=(n,e,t,r)=>({set _(i){h(n,e,i,t)},get _(){return s(n,e,r)}});import{i as E_,a as k_,b as C_,c as T_,d as $_,e as R_,f as I_,g as x_,U as P_,A as D_,h as L_}from"./artifact-bridge-BEUWXKq7.js";import{m as M_,a as O_,b as N_}from"./missing-artifact-page-DVzJ41AE.js";var ls=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z_(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 $1=Object.prototype.toString,Vw=function(e){var t=$1.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&$1.call(e.callee)==="[object Function]"),r},df,R1;function U_(){if(R1)return df;R1=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Vw,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(y){var v=y.constructor;return v&&v.prototype===y},d={$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 y in window)try{if(!d["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{c(window[y])}catch{return!0}}catch{return!0}return!1}(),g=function(y){if(typeof window>"u"||!f)return c(y);try{return c(y)}catch{return!1}};n=function(v){var _=v!==null&&typeof v=="object",E=t.call(v)==="[object Function]",x=r(v),B=_&&t.call(v)==="[object String]",P=[];if(!_&&!E&&!x)throw new TypeError("Object.keys called on a non-object");var J=a&&E;if(B&&v.length>0&&!e.call(v,0))for(var O=0;O<v.length;++O)P.push(String(O));if(x&&v.length>0)for(var Y=0;Y<v.length;++Y)P.push(String(Y));else for(var F in v)!(J&&F==="prototype")&&e.call(v,F)&&P.push(String(F));if(o)for(var j=g(v),fe=0;fe<l.length;++fe)!(j&&l[fe]==="constructor")&&e.call(v,l[fe])&&P.push(l[fe]);return P}}return df=n,df}var Z_=Array.prototype.slice,F_=Vw,I1=Object.keys,kh=I1?function(e){return I1(e)}:U_(),x1=Object.keys;kh.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 F_(r)?x1(Z_.call(r)):x1(r)})}else Object.keys=kh;return Object.keys||kh};var H_=kh,Ch=Object.defineProperty||!1;if(Ch)try{Ch({},"a",{value:1})}catch{Ch=!1}var Du=Ch,Gr=SyntaxError,re=TypeError,V_=Object.getOwnPropertyDescriptor,Th=V_;if(Th)try{Th([],"length")}catch{Th=null}var sl=Th,P1=Du,B_=Gr,ko=re,D1=sl,Bw=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new ko("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ko("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ko("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ko("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ko("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ko("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!D1&&D1(e,t);if(P1)P1(e,t,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:o===null&&c?c.writable:!o});else if(l||!i&&!o&&!a)e[t]=r;else throw new B_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},s0=Du,qw=function(){return!!s0};qw.hasArrayLengthDefineBug=function(){if(!s0)return null;try{return s0([],"length",{value:1}).length!==1}catch{return!0}};var Rp=qw,q_=H_,W_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",j_=Object.prototype.toString,G_=Array.prototype.concat,L1=Bw,Y_=function(n){return typeof n=="function"&&j_.call(n)==="[object Function]"},Ww=Rp(),J_=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!Y_(r)||!r())return}Ww?L1(n,e,t,!0):L1(n,e,t)},jw=function(n,e){var t=arguments.length>2?arguments[2]:{},r=q_(e);W_&&(r=G_.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)J_(n,r[i],e[r[i]],t[r[i]])};jw.supportsDescriptors=!!Ww;var mo=jw,$h={exports:{}};typeof self<"u"?$h.exports=self:typeof window<"u"?$h.exports=window:$h.exports=Function("return this")();var Gw=$h.exports,K_=Gw,Yw=function(){return typeof ls!="object"||!ls||ls.Math!==Math||ls.Array!==Array?K_:ls},X_=mo,Q_=sl,eA=Yw,tA=function(){var e=eA();if(X_.supportsDescriptors){var t=Q_(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},nA=mo,rA=Gw,Jw=Yw,iA=tA,sA=Jw(),Kw=function(){return sA};nA(Kw,{getPolyfill:Jw,implementation:rA,shim:iA});var Qm=Kw,Yr=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},eg=Object,Xw=Error,oA=EvalError,aA=RangeError,tg=ReferenceError,lA=URIError,cA=Math.abs,uA=Math.floor,hA=Math.max,dA=Math.min,pA=Math.pow,fA=Math.round,ng=Number.isNaN||function(e){return e!==e},mA=ng,gA=function(e){return mA(e)||e===0?e:e<0?-1:1},ol=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 o 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 a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[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},M1=typeof Symbol<"u"&&Symbol,vA=ol,rg=function(){return typeof M1!="function"||typeof Symbol!="function"||typeof M1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vA()},Qw=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,yA=eg,eb=yA.getPrototypeOf||null,wA="Function.prototype.bind called on incompatible ",bA=Object.prototype.toString,SA=Math.max,_A="[object Function]",O1=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r},AA=function(e,t){for(var r=[],i=t,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},EA=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},kA=function(e){var t=this;if(typeof t!="function"||bA.apply(t)!==_A)throw new TypeError(wA+t);for(var r=AA(arguments,1),i,o=function(){if(this instanceof i){var f=t.apply(this,O1(r,arguments));return Object(f)===f?f:this}return t.apply(e,O1(r,arguments))},a=SA(0,t.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+EA(l,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var d=function(){};d.prototype=t.prototype,i.prototype=new d,d.prototype=null}return i},CA=kA,Lu=Function.prototype.bind||CA,ig=Function.prototype.call,sg=Function.prototype.apply,TA=typeof Reflect<"u"&&Reflect&&Reflect.apply,$A=Lu,RA=sg,IA=ig,xA=TA,tb=xA||$A.call(IA,RA),PA=Lu,DA=re,LA=ig,MA=tb,Ip=function(e){if(e.length<1||typeof e[0]!="function")throw new DA("a function is required");return MA(PA,LA,e)},OA=Ip,N1=sl,nb;try{nb=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var pf=!!nb&&N1&&N1(Object.prototype,"__proto__"),rb=Object,z1=rb.getPrototypeOf,NA=pf&&typeof pf.get=="function"?OA([pf.get]):typeof z1=="function"?function(e){return z1(e==null?e:rb(e))}:!1,U1=Qw,Z1=eb,F1=NA,ib=U1?function(e){return U1(e)}:Z1?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Z1(e)}:F1?function(e){return F1(e)}:null,zA=Function.prototype.call,UA=Object.prototype.hasOwnProperty,ZA=Lu,Jr=ZA.call(zA,UA),ne,FA=eg,HA=Xw,VA=oA,BA=aA,qA=tg,Xa=Gr,Yo=re,WA=lA,jA=cA,GA=uA,YA=hA,JA=dA,KA=pA,XA=fA,QA=gA,sb=Function,ff=function(n){try{return sb('"use strict"; return ('+n+").constructor;")()}catch{}},dc=sl,e4=Du,mf=function(){throw new Yo},t4=dc?function(){try{return arguments.callee,mf}catch{try{return dc(arguments,"callee").get}catch{return mf}}}():mf,Co=rg(),Fe=ib,n4=eb,r4=Qw,ob=sg,Mu=ig,Io={},i4=typeof Uint8Array>"u"||!Fe?ne:Fe(Uint8Array),co={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&Fe?Fe([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Io,"%AsyncGenerator%":Io,"%AsyncGeneratorFunction%":Io,"%AsyncIteratorPrototype%":Io,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":HA,"%eval%":eval,"%EvalError%":VA,"%Float16Array%":typeof Float16Array>"u"?ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":sb,"%GeneratorFunction%":Io,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&Fe?Fe(Fe([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Co||!Fe?ne:Fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":FA,"%Object.getOwnPropertyDescriptor%":dc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":BA,"%ReferenceError%":qA,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Co||!Fe?ne:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&Fe?Fe(""[Symbol.iterator]()):ne,"%Symbol%":Co?Symbol:ne,"%SyntaxError%":Xa,"%ThrowTypeError%":t4,"%TypedArray%":i4,"%TypeError%":Yo,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":WA,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet,"%Function.prototype.call%":Mu,"%Function.prototype.apply%":ob,"%Object.defineProperty%":e4,"%Object.getPrototypeOf%":n4,"%Math.abs%":jA,"%Math.floor%":GA,"%Math.max%":YA,"%Math.min%":JA,"%Math.pow%":KA,"%Math.round%":XA,"%Math.sign%":QA,"%Reflect.getPrototypeOf%":r4};if(Fe)try{null.error}catch(n){var s4=Fe(Fe(n));co["%Error.prototype%"]=s4}var o4=function n(e){var t;if(e==="%AsyncFunction%")t=ff("async function () {}");else if(e==="%GeneratorFunction%")t=ff("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=ff("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Fe&&(t=Fe(i.prototype))}return co[e]=t,t},H1={__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"]},Ou=Lu,dd=Jr,a4=Ou.call(Mu,Array.prototype.concat),l4=Ou.call(ob,Array.prototype.splice),V1=Ou.call(Mu,String.prototype.replace),pd=Ou.call(Mu,String.prototype.slice),c4=Ou.call(Mu,RegExp.prototype.exec),u4=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,h4=/\\(\\)?/g,d4=function(e){var t=pd(e,0,1),r=pd(e,-1);if(t==="%"&&r!=="%")throw new Xa("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new Xa("invalid intrinsic syntax, expected opening `%`");var i=[];return V1(e,u4,function(o,a,l,c){i[i.length]=l?V1(c,h4,"$1"):a||o}),i},p4=function(e,t){var r=e,i;if(dd(H1,r)&&(i=H1[r],r="%"+i[0]+"%"),dd(co,r)){var o=co[r];if(o===Io&&(o=o4(r)),typeof o>"u"&&!t)throw new Yo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Xa("intrinsic "+e+" does not exist!")},rn=function(e,t){if(typeof e!="string"||e.length===0)throw new Yo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Yo('"allowMissing" argument must be a boolean');if(c4(/^%?[^%]*%?$/,e)===null)throw new Xa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=d4(e),i=r.length>0?r[0]:"",o=p4("%"+i+"%",t),a=o.name,l=o.value,c=!1,d=o.alias;d&&(i=d[0],l4(r,a4([0,1],d)));for(var f=1,g=!0;f<r.length;f+=1){var y=r[f],v=pd(y,0,1),_=pd(y,-1);if((v==='"'||v==="'"||v==="`"||_==='"'||_==="'"||_==="`")&&v!==_)throw new Xa("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(c=!0),i+="."+y,a="%"+i+"%",dd(co,a))l=co[a];else if(l!=null){if(!(y in l)){if(!t)throw new Yo("base intrinsic for "+e+" exists, but the property is not available.");return}if(dc&&f+1>=r.length){var E=dc(l,y);g=!!E,g&&"get"in E&&!("originalValue"in E.get)?l=E.get:l=l[y]}else g=dd(l,y),l=l[y];g&&!c&&(co[a]=l)}}return l},gf,B1;function Gi(){if(B1)return gf;B1=1;var n=rn,e=Ip,t=e([n("%String.prototype.indexOf%")]);return gf=function(i,o){var a=n(i,!!o);return typeof a=="function"&&t(i,".prototype.")>-1?e([a]):a},gf}var vf,q1;function og(){if(q1)return vf;q1=1;var n=rn,e=n("%Array%"),t=!e.isArray&&Gi()("Object.prototype.toString");return vf=e.isArray||function(i){return t(i)==="[object Array]"},vf}var f4=Rp,W1=Du,ab=f4.hasArrayLengthDefineBug(),m4=ab&&og(),g4=Gi(),v4=g4("Object.prototype.propertyIsEnumerable"),ag=function(e,t,r,i,o,a){if(!W1){if(!e(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||o in i&&v4(i,o)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[o]=l,t(i[o],l)}return ab&&o==="length"&&"[[Value]]"in a&&m4(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(W1(i,o,r(a)),!0)},y4=re,El=Jr,w4={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},al=function(e){if(!e||typeof e!="object")return!1;for(var t in e)if(El(e,t)&&!w4[t])return!1;var r=El(e,"[[Value]]")||El(e,"[[Writable]]"),i=El(e,"[[Get]]")||El(e,"[[Set]]");if(r&&i)throw new y4("Property Descriptors may not be both accessor and data descriptors");return!0},lb=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},b4=re,S4=al,_4=lb,cb=function(e){if(typeof e<"u"&&!S4(e))throw new b4("Assertion failed: `Desc` must be a Property Descriptor");return _4(e)},A4=re,j1=Jr,E4=al,ub=function(e){if(typeof e>"u")return!1;if(!E4(e))throw new A4("Assertion failed: `Desc` must be a Property Descriptor");return!(!j1(e,"[[Value]]")&&!j1(e,"[[Writable]]"))},ll=function(e){return typeof e=="string"||typeof e=="symbol"},G1=ng,hb=function(e,t){return e===t?e===0?1/e===1/t:!0:G1(e)&&G1(t)},Y1=re,k4=Yr,C4=ag,T4=cb,$4=ub,R4=ll,I4=hb,lg=function(e,t,r){if(!k4(e))throw new Y1("Assertion failed: Type(O) is not Object");if(!R4(t))throw new Y1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return C4($4,I4,T4,e,t,i)},db=Function.prototype.toString,qo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,o0,Rh;if(typeof qo=="function"&&typeof Object.defineProperty=="function")try{o0=Object.defineProperty({},"length",{get:function(){throw Rh}}),Rh={},qo(function(){throw 42},null,o0)}catch(n){n!==Rh&&(qo=null)}else qo=null;var x4=/^\s*class\b/,a0=function(e){try{var t=db.call(e);return x4.test(t)}catch{return!1}},yf=function(e){try{return a0(e)?!1:(db.call(e),!0)}catch{return!1}},Ih=Object.prototype.toString,P4="[object Object]",D4="[object Function]",L4="[object GeneratorFunction]",M4="[object HTMLAllCollection]",O4="[object HTML document.all class]",N4="[object HTMLCollection]",z4=typeof Symbol=="function"&&!!Symbol.toStringTag,U4=!(0 in[,]),l0=function(){return!1};if(typeof document=="object"){var Z4=document.all;Ih.call(Z4)===Ih.call(document.all)&&(l0=function(e){if((U4||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ih.call(e);return(t===M4||t===O4||t===N4||t===P4)&&e("")==null}catch{}return!1})}var pb=qo?function(e){if(l0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{qo(e,null,o0)}catch(t){if(t!==Rh)return!1}return!a0(e)&&yf(e)}:function(e){if(l0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(z4)return yf(e);if(a0(e))return!1;var t=Ih.call(e);return t!==D4&&t!==L4&&!/^\[object HTML/.test(t)?!1:yf(e)},F4=pb,H4=function(e){return!!e},Cn=Jr,rh=re,V4=Yr,J1=F4,wf=H4,B4=function(e){if(!V4(e))throw new rh("ToPropertyDescriptor requires an object");var t={};if(Cn(e,"enumerable")&&(t["[[Enumerable]]"]=wf(e.enumerable)),Cn(e,"configurable")&&(t["[[Configurable]]"]=wf(e.configurable)),Cn(e,"value")&&(t["[[Value]]"]=e.value),Cn(e,"writable")&&(t["[[Writable]]"]=wf(e.writable)),Cn(e,"get")){var r=e.get;if(typeof r<"u"&&!J1(r))throw new rh("getter must be a function");t["[[Get]]"]=r}if(Cn(e,"set")){var i=e.set;if(typeof i<"u"&&!J1(i))throw new rh("setter must be a function");t["[[Set]]"]=i}if((Cn(t,"[[Get]]")||Cn(t,"[[Set]]"))&&(Cn(t,"[[Value]]")||Cn(t,"[[Writable]]")))throw new rh("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},bf=re,q4=Yr,K1=al,W4=ag,j4=cb,G4=ub,Y4=ll,J4=hb,K4=B4,X4=function(e,t,r){if(!q4(e))throw new bf("Assertion failed: Type(O) is not Object");if(!Y4(t))throw new bf("Assertion failed: P is not a Property Key");var i=K1(r)?r:K4(r);if(!K1(i))throw new bf("Assertion failed: Desc is not a valid Property Descriptor");return W4(G4,J4,j4,e,t,i)},X1=re,Q4=Yr,eE=X4,tE=ll,nE=function(e,t,r){if(!Q4(e))throw new X1("Assertion failed: Type(O) is not Object");if(!tE(t))throw new X1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return eE(e,t,i)},rE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,iE=eg,sE=iE.setPrototypeOf||null,oE=Ip,Q1=sl,aE=re,fb={};try{fb.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var lE=!("toString"in fb),Sf=Q1&&Q1(Object.prototype,"__proto__"),cE=lE&&(!!Sf&&typeof Sf.set=="function"&&oE([Sf.set])||function(e,t){if(e==null)throw new aE("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),ev=rE,uE=sE,tv=cE,hE=re,dE=ev?function(e,t){if(ev(e,t))return e;throw new hE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:uE||(tv?function(e,t){return tv(e,t),e}:null),nv=re,pE=Yr,rv=ib,fE=function(e){if(!pE(e))throw new nv("Assertion failed: O must be an Object");if(!rv)throw new nv("This environment does not support fetching prototypes.");return rv(e)},mE=re,gE=dE,vE=Yr,yE=fE,wE=function(e,t){if(t!==null&&!vE(t))throw new mE("Assertion failed: V must be Object or Null");try{gE(e,t)}catch{return!1}return yE(e)===t},_f=lg,iv=nE,mb=wE,bE=Rp(),cg=Xw;function Nu(n,e,t){var r=new cg(t);return mb(r,xh),delete r.constructor,iv(r,"error",n),iv(r,"suppressed",e),r}bE&&Object.defineProperty(Nu,"prototype",{writable:!1});var xh=Nu.prototype;if(!_f(xh,"constructor",Nu)||!_f(xh,"message","")||!_f(xh,"name","SuppressedError"))throw new cg("unable to install SuppressedError.prototype properties; please report this!");mb(Nu.prototype,cg.prototype);var SE=Nu,_E=SE,gb=function(){return typeof SuppressedError=="function"?SuppressedError:_E},AE=mo,sv=Qm(),EE=gb,kE=function(){var e=EE();return AE(sv,{SuppressedError:e},{SuppressedError:function(){return sv.SuppressedError!==e}}),e};kE();var CE=re,TE=al,$E=lb,RE=function(e){if(typeof e<"u"&&!TE(e))throw new CE("Assertion failed: `Desc` must be a Property Descriptor");return $E(e)},IE=re,ov=Jr,xE=al,PE=function(e){if(typeof e>"u")return!1;if(!xE(e))throw new IE("Assertion failed: `Desc` must be a Property Descriptor");return!(!ov(e,"[[Value]]")&&!ov(e,"[[Writable]]"))},av=ng,DE=function(e,t){return e===t?e===0?1/e===1/t:!0:av(e)&&av(t)},cl=pb,LE=function(e){return!!e},Tn=Jr,ih=re,ME=Yr,lv=cl,Af=LE,OE=function(e){if(!ME(e))throw new ih("ToPropertyDescriptor requires an object");var t={};if(Tn(e,"enumerable")&&(t["[[Enumerable]]"]=Af(e.enumerable)),Tn(e,"configurable")&&(t["[[Configurable]]"]=Af(e.configurable)),Tn(e,"value")&&(t["[[Value]]"]=e.value),Tn(e,"writable")&&(t["[[Writable]]"]=Af(e.writable)),Tn(e,"get")){var r=e.get;if(typeof r<"u"&&!lv(r))throw new ih("getter must be a function");t["[[Get]]"]=r}if(Tn(e,"set")){var i=e.set;if(typeof i<"u"&&!lv(i))throw new ih("setter must be a function");t["[[Set]]"]=i}if((Tn(t,"[[Get]]")||Tn(t,"[[Set]]"))&&(Tn(t,"[[Value]]")||Tn(t,"[[Writable]]")))throw new ih("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},Ef=re,NE=Yr,cv=al,zE=ag,UE=RE,ZE=PE,FE=ll,HE=DE,VE=OE,zu=function(e,t,r){if(!NE(e))throw new Ef("Assertion failed: Type(O) is not Object");if(!FE(t))throw new Ef("Assertion failed: P is not a Property Key");var i=cv(r)?r:VE(r);if(!cv(i))throw new Ef("Assertion failed: Desc is not a valid Property Descriptor");return zE(ZE,HE,UE,e,t,i)},BE=ol(),qE=BE?Symbol.dispose||Symbol("Symbol.dispose"):null,WE=ol,jE=qE,ug=function(){return WE()&&Symbol.dispose||jE},GE=rg,YE=zu,JE=ug,KE=function(){var e=JE();return GE()&&YE(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},XE=ol(),QE=XE?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,ek=ol,tk=QE,hg=function(){return ek()&&Symbol.asyncDispose||tk},nk=rg,rk=zu,ik=hg,sk=function(){var e=ik();return nk()&&rk(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},ok=og(),ak=rn,lk=Gi(),ck=re,uk=ok,hk=ak("%Reflect.apply%",!0)||lk("Function.prototype.apply"),xp=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!uk(r))throw new ck("Assertion failed: optional `argumentsList`, if provided, must be a List");return hk(e,t,r)};const dk={},pk=Object.freeze(Object.defineProperty({__proto__:null,default:dk},Symbol.toStringTag,{value:"Module"})),fk=z_(pk);var dg=typeof Map=="function"&&Map.prototype,kf=Object.getOwnPropertyDescriptor&&dg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fd=dg&&kf&&typeof kf.get=="function"?kf.get:null,uv=dg&&Map.prototype.forEach,pg=typeof Set=="function"&&Set.prototype,Cf=Object.getOwnPropertyDescriptor&&pg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,md=pg&&Cf&&typeof Cf.get=="function"?Cf.get:null,hv=pg&&Set.prototype.forEach,mk=typeof WeakMap=="function"&&WeakMap.prototype,oc=mk?WeakMap.prototype.has:null,gk=typeof WeakSet=="function"&&WeakSet.prototype,ac=gk?WeakSet.prototype.has:null,vk=typeof WeakRef=="function"&&WeakRef.prototype,dv=vk?WeakRef.prototype.deref:null,yk=Boolean.prototype.valueOf,wk=Object.prototype.toString,bk=Function.prototype.toString,Sk=String.prototype.match,fg=String.prototype.slice,Ui=String.prototype.replace,_k=String.prototype.toUpperCase,pv=String.prototype.toLowerCase,vb=RegExp.prototype.test,fv=Array.prototype.concat,tr=Array.prototype.join,Ak=Array.prototype.slice,mv=Math.floor,c0=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Tf=Object.getOwnPropertySymbols,u0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",lc=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qa||!0)?Symbol.toStringTag:null,yb=Object.prototype.propertyIsEnumerable,gv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function vv(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||vb.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-mv(-n):mv(n);if(r!==n){var i=String(r),o=fg.call(e,i.length+1);return Ui.call(i,t,"$&_")+"."+Ui.call(Ui.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ui.call(e,t,"$&_")}var h0=fk,yv=h0.custom,wv=Sb(yv)?yv:null,wb={__proto__:null,double:'"',single:"'"},Ek={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ul=function n(e,t,r,i){var o=t||{};if(pr(o,"quoteStyle")&&!pr(wb,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=pr(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.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 Ab(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?vv(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return l?vv(e,d):d}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return d0(e)?"[Array]":"[Object]";var g=Hk(o,r);if(typeof i>"u")i=[];else if(_b(i,e)>=0)return"[Circular]";function y(Ue,le,sr){if(le&&(i=Ak.call(i),i.push(le)),sr){var Ut={depth:o.depth};return pr(o,"quoteStyle")&&(Ut.quoteStyle=o.quoteStyle),n(Ue,Ut,r+1,i)}return n(Ue,o,r+1,i)}if(typeof e=="function"&&!bv(e)){var v=Dk(e),_=sh(e,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(_.length>0?" { "+tr.call(_,", ")+" }":"")}if(Sb(e)){var E=Qa?Ui.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):u0.call(e);return typeof e=="object"&&!Qa?kl(E):E}if(Uk(e)){for(var x="<"+pv.call(String(e.nodeName)),B=e.attributes||[],P=0;P<B.length;P++)x+=" "+B[P].name+"="+bb(kk(B[P].value),"double",o);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+pv.call(String(e.nodeName))+">",x}if(d0(e)){if(e.length===0)return"[]";var J=sh(e,y);return g&&!Fk(J)?"["+p0(J,g)+"]":"[ "+tr.call(J,", ")+" ]"}if(Tk(e)){var O=sh(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!yb.call(e,"cause")?"{ ["+String(e)+"] "+tr.call(fv.call("[cause]: "+y(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+tr.call(O,", ")+" }"}if(typeof e=="object"&&a){if(wv&&typeof e[wv]=="function"&&h0)return h0(e,{depth:f-r});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Lk(e)){var Y=[];return uv&&uv.call(e,function(Ue,le){Y.push(y(le,e,!0)+" => "+y(Ue,e))}),Sv("Map",fd.call(e),Y,g)}if(Nk(e)){var F=[];return hv&&hv.call(e,function(Ue){F.push(y(Ue,e))}),Sv("Set",md.call(e),F,g)}if(Mk(e))return $f("WeakMap");if(zk(e))return $f("WeakSet");if(Ok(e))return $f("WeakRef");if(Rk(e))return kl(y(Number(e)));if(xk(e))return kl(y(c0.call(e)));if(Ik(e))return kl(yk.call(e));if($k(e))return kl(y(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof ls<"u"&&e===ls)return"{ [object globalThis] }";if(!Ck(e)&&!bv(e)){var j=sh(e,y),fe=gv?gv(e)===Object.prototype:e instanceof Object||e.constructor===Object,de=e instanceof Object?"":"null prototype",Ve=!fe&&lc&&Object(e)===e&&lc in e?fg.call(Yi(e),8,-1):de?"Object":"",ve=fe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Xe=ve+(Ve||de?"["+tr.call(fv.call([],Ve||[],de||[]),": ")+"] ":"");return j.length===0?Xe+"{}":g?Xe+"{"+p0(j,g)+"}":Xe+"{ "+tr.call(j,", ")+" }"}return String(e)};function bb(n,e,t){var r=t.quoteStyle||e,i=wb[r];return i+n+i}function kk(n){return Ui.call(String(n),/"/g,"&quot;")}function go(n){return!lc||!(typeof n=="object"&&(lc in n||typeof n[lc]<"u"))}function d0(n){return Yi(n)==="[object Array]"&&go(n)}function Ck(n){return Yi(n)==="[object Date]"&&go(n)}function bv(n){return Yi(n)==="[object RegExp]"&&go(n)}function Tk(n){return Yi(n)==="[object Error]"&&go(n)}function $k(n){return Yi(n)==="[object String]"&&go(n)}function Rk(n){return Yi(n)==="[object Number]"&&go(n)}function Ik(n){return Yi(n)==="[object Boolean]"&&go(n)}function Sb(n){if(Qa)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!u0)return!1;try{return u0.call(n),!0}catch{}return!1}function xk(n){if(!n||typeof n!="object"||!c0)return!1;try{return c0.call(n),!0}catch{}return!1}var Pk=Object.prototype.hasOwnProperty||function(n){return n in this};function pr(n,e){return Pk.call(n,e)}function Yi(n){return wk.call(n)}function Dk(n){if(n.name)return n.name;var e=Sk.call(bk.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function _b(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 Lk(n){if(!fd||!n||typeof n!="object")return!1;try{fd.call(n);try{md.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Mk(n){if(!oc||!n||typeof n!="object")return!1;try{oc.call(n,oc);try{ac.call(n,ac)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ok(n){if(!dv||!n||typeof n!="object")return!1;try{return dv.call(n),!0}catch{}return!1}function Nk(n){if(!md||!n||typeof n!="object")return!1;try{md.call(n);try{fd.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function zk(n){if(!ac||!n||typeof n!="object")return!1;try{ac.call(n,ac);try{oc.call(n,oc)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Uk(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function Ab(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return Ab(fg.call(n,0,e.maxStringLength),e)+r}var i=Ek[e.quoteStyle||"single"];i.lastIndex=0;var o=Ui.call(Ui.call(n,i,"\\$1"),/[\x00-\x1f]/g,Zk);return bb(o,"single",e)}function Zk(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":"")+_k.call(e.toString(16))}function kl(n){return"Object("+n+")"}function $f(n){return n+" { ? }"}function Sv(n,e,t,r){var i=r?p0(t,r):tr.call(t,", ");return n+" ("+e+") {"+i+"}"}function Fk(n){for(var e=0;e<n.length;e++)if(_b(n[e],`
2
- `)>=0)return!1;return!0}function Hk(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=tr.call(Array(n.indent+1)," ");else return null;return{base:t,prev:tr.call(Array(e+1),t)}}function p0(n,e){if(n.length===0)return"";var t=`
1
+ var __=Object.defineProperty;var C1=n=>{throw TypeError(n)};var A_=(n,e,t)=>e in n?__(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>A_(n,typeof e!="symbol"?e+"":e,t),hf=(n,e,t)=>e.has(n)||C1("Cannot "+t);var s=(n,e,t)=>(hf(n,e,"read from private field"),t?t.call(n):e.get(n)),p=(n,e,t)=>e.has(n)?C1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),h=(n,e,t,r)=>(hf(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),u=(n,e,t)=>(hf(n,e,"access private method"),t);var nh=(n,e,t,r)=>({set _(i){h(n,e,i,t)},get _(){return s(n,e,r)}});import{i as E_,a as k_,b as C_,c as T_,d as $_,e as R_,f as I_,g as x_,U as P_,A as L_,h as D_}from"./artifact-bridge-BEUWXKq7.js";import{m as M_,a as O_,b as N_}from"./missing-artifact-page-DVzJ41AE.js";var ls=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z_(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 T1=Object.prototype.toString,Uw=function(e){var t=T1.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&T1.call(e.callee)==="[object Function]"),r},df,$1;function Z_(){if($1)return df;$1=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Uw,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(y){var v=y.constructor;return v&&v.prototype===y},d={$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 y in window)try{if(!d["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{c(window[y])}catch{return!0}}catch{return!0}return!1}(),g=function(y){if(typeof window>"u"||!f)return c(y);try{return c(y)}catch{return!1}};n=function(v){var _=v!==null&&typeof v=="object",E=t.call(v)==="[object Function]",x=r(v),B=_&&t.call(v)==="[object String]",P=[];if(!_&&!E&&!x)throw new TypeError("Object.keys called on a non-object");var J=a&&E;if(B&&v.length>0&&!e.call(v,0))for(var O=0;O<v.length;++O)P.push(String(O));if(x&&v.length>0)for(var Y=0;Y<v.length;++Y)P.push(String(Y));else for(var U in v)!(J&&U==="prototype")&&e.call(v,U)&&P.push(String(U));if(o)for(var j=g(v),fe=0;fe<l.length;++fe)!(j&&l[fe]==="constructor")&&e.call(v,l[fe])&&P.push(l[fe]);return P}}return df=n,df}var H_=Array.prototype.slice,U_=Uw,R1=Object.keys,kh=R1?function(e){return R1(e)}:Z_(),I1=Object.keys;kh.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 U_(r)?I1(H_.call(r)):I1(r)})}else Object.keys=kh;return Object.keys||kh};var V_=kh,Ch=Object.defineProperty||!1;if(Ch)try{Ch({},"a",{value:1})}catch{Ch=!1}var Lu=Ch,Gr=SyntaxError,re=TypeError,F_=Object.getOwnPropertyDescriptor,Th=F_;if(Th)try{Th([],"length")}catch{Th=null}var sl=Th,x1=Lu,B_=Gr,ko=re,P1=sl,Vw=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new ko("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ko("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ko("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ko("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ko("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ko("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!P1&&P1(e,t);if(x1)x1(e,t,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:o===null&&c?c.writable:!o});else if(l||!i&&!o&&!a)e[t]=r;else throw new B_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},i0=Lu,Fw=function(){return!!i0};Fw.hasArrayLengthDefineBug=function(){if(!i0)return null;try{return i0([],"length",{value:1}).length!==1}catch{return!0}};var Rp=Fw,q_=V_,W_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",j_=Object.prototype.toString,G_=Array.prototype.concat,L1=Vw,Y_=function(n){return typeof n=="function"&&j_.call(n)==="[object Function]"},Bw=Rp(),J_=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!Y_(r)||!r())return}Bw?L1(n,e,t,!0):L1(n,e,t)},qw=function(n,e){var t=arguments.length>2?arguments[2]:{},r=q_(e);W_&&(r=G_.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)J_(n,r[i],e[r[i]],t[r[i]])};qw.supportsDescriptors=!!Bw;var mo=qw,$h={exports:{}};typeof self<"u"?$h.exports=self:typeof window<"u"?$h.exports=window:$h.exports=Function("return this")();var Ww=$h.exports,K_=Ww,jw=function(){return typeof ls!="object"||!ls||ls.Math!==Math||ls.Array!==Array?K_:ls},X_=mo,Q_=sl,e4=jw,t4=function(){var e=e4();if(X_.supportsDescriptors){var t=Q_(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},n4=mo,r4=Ww,Gw=jw,i4=t4,s4=Gw(),Yw=function(){return s4};n4(Yw,{getPolyfill:Gw,implementation:r4,shim:i4});var Xm=Yw,Yr=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},Qm=Object,Jw=Error,o4=EvalError,a4=RangeError,eg=ReferenceError,l4=URIError,c4=Math.abs,u4=Math.floor,h4=Math.max,d4=Math.min,p4=Math.pow,f4=Math.round,tg=Number.isNaN||function(e){return e!==e},m4=tg,g4=function(e){return m4(e)||e===0?e:e<0?-1:1},ol=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 o 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 a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[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},D1=typeof Symbol<"u"&&Symbol,v4=ol,ng=function(){return typeof D1!="function"||typeof Symbol!="function"||typeof D1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v4()},Kw=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,y4=Qm,Xw=y4.getPrototypeOf||null,w4="Function.prototype.bind called on incompatible ",b4=Object.prototype.toString,S4=Math.max,_4="[object Function]",M1=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r},A4=function(e,t){for(var r=[],i=t,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},E4=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},k4=function(e){var t=this;if(typeof t!="function"||b4.apply(t)!==_4)throw new TypeError(w4+t);for(var r=A4(arguments,1),i,o=function(){if(this instanceof i){var f=t.apply(this,M1(r,arguments));return Object(f)===f?f:this}return t.apply(e,M1(r,arguments))},a=S4(0,t.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+E4(l,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var d=function(){};d.prototype=t.prototype,i.prototype=new d,d.prototype=null}return i},C4=k4,Du=Function.prototype.bind||C4,rg=Function.prototype.call,ig=Function.prototype.apply,T4=typeof Reflect<"u"&&Reflect&&Reflect.apply,$4=Du,R4=ig,I4=rg,x4=T4,Qw=x4||$4.call(I4,R4),P4=Du,L4=re,D4=rg,M4=Qw,Ip=function(e){if(e.length<1||typeof e[0]!="function")throw new L4("a function is required");return M4(P4,D4,e)},O4=Ip,O1=sl,e2;try{e2=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var pf=!!e2&&O1&&O1(Object.prototype,"__proto__"),t2=Object,N1=t2.getPrototypeOf,N4=pf&&typeof pf.get=="function"?O4([pf.get]):typeof N1=="function"?function(e){return N1(e==null?e:t2(e))}:!1,z1=Kw,Z1=Xw,H1=N4,n2=z1?function(e){return z1(e)}:Z1?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Z1(e)}:H1?function(e){return H1(e)}:null,z4=Function.prototype.call,Z4=Object.prototype.hasOwnProperty,H4=Du,Jr=H4.call(z4,Z4),ne,U4=Qm,V4=Jw,F4=o4,B4=a4,q4=eg,Xa=Gr,Yo=re,W4=l4,j4=c4,G4=u4,Y4=h4,J4=d4,K4=p4,X4=f4,Q4=g4,r2=Function,ff=function(n){try{return r2('"use strict"; return ('+n+").constructor;")()}catch{}},dc=sl,eA=Lu,mf=function(){throw new Yo},tA=dc?function(){try{return arguments.callee,mf}catch{try{return dc(arguments,"callee").get}catch{return mf}}}():mf,Co=ng(),Ue=n2,nA=Xw,rA=Kw,i2=ig,Mu=rg,Io={},iA=typeof Uint8Array>"u"||!Ue?ne:Ue(Uint8Array),co={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&Ue?Ue([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Io,"%AsyncGenerator%":Io,"%AsyncGeneratorFunction%":Io,"%AsyncIteratorPrototype%":Io,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":V4,"%eval%":eval,"%EvalError%":F4,"%Float16Array%":typeof Float16Array>"u"?ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":r2,"%GeneratorFunction%":Io,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&Ue?Ue(Ue([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Co||!Ue?ne:Ue(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":U4,"%Object.getOwnPropertyDescriptor%":dc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":B4,"%ReferenceError%":q4,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Co||!Ue?ne:Ue(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&Ue?Ue(""[Symbol.iterator]()):ne,"%Symbol%":Co?Symbol:ne,"%SyntaxError%":Xa,"%ThrowTypeError%":tA,"%TypedArray%":iA,"%TypeError%":Yo,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":W4,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet,"%Function.prototype.call%":Mu,"%Function.prototype.apply%":i2,"%Object.defineProperty%":eA,"%Object.getPrototypeOf%":nA,"%Math.abs%":j4,"%Math.floor%":G4,"%Math.max%":Y4,"%Math.min%":J4,"%Math.pow%":K4,"%Math.round%":X4,"%Math.sign%":Q4,"%Reflect.getPrototypeOf%":rA};if(Ue)try{null.error}catch(n){var sA=Ue(Ue(n));co["%Error.prototype%"]=sA}var oA=function n(e){var t;if(e==="%AsyncFunction%")t=ff("async function () {}");else if(e==="%GeneratorFunction%")t=ff("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=ff("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Ue&&(t=Ue(i.prototype))}return co[e]=t,t},U1={__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"]},Ou=Du,dd=Jr,aA=Ou.call(Mu,Array.prototype.concat),lA=Ou.call(i2,Array.prototype.splice),V1=Ou.call(Mu,String.prototype.replace),pd=Ou.call(Mu,String.prototype.slice),cA=Ou.call(Mu,RegExp.prototype.exec),uA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hA=/\\(\\)?/g,dA=function(e){var t=pd(e,0,1),r=pd(e,-1);if(t==="%"&&r!=="%")throw new Xa("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new Xa("invalid intrinsic syntax, expected opening `%`");var i=[];return V1(e,uA,function(o,a,l,c){i[i.length]=l?V1(c,hA,"$1"):a||o}),i},pA=function(e,t){var r=e,i;if(dd(U1,r)&&(i=U1[r],r="%"+i[0]+"%"),dd(co,r)){var o=co[r];if(o===Io&&(o=oA(r)),typeof o>"u"&&!t)throw new Yo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Xa("intrinsic "+e+" does not exist!")},rn=function(e,t){if(typeof e!="string"||e.length===0)throw new Yo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Yo('"allowMissing" argument must be a boolean');if(cA(/^%?[^%]*%?$/,e)===null)throw new Xa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=dA(e),i=r.length>0?r[0]:"",o=pA("%"+i+"%",t),a=o.name,l=o.value,c=!1,d=o.alias;d&&(i=d[0],lA(r,aA([0,1],d)));for(var f=1,g=!0;f<r.length;f+=1){var y=r[f],v=pd(y,0,1),_=pd(y,-1);if((v==='"'||v==="'"||v==="`"||_==='"'||_==="'"||_==="`")&&v!==_)throw new Xa("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(c=!0),i+="."+y,a="%"+i+"%",dd(co,a))l=co[a];else if(l!=null){if(!(y in l)){if(!t)throw new Yo("base intrinsic for "+e+" exists, but the property is not available.");return}if(dc&&f+1>=r.length){var E=dc(l,y);g=!!E,g&&"get"in E&&!("originalValue"in E.get)?l=E.get:l=l[y]}else g=dd(l,y),l=l[y];g&&!c&&(co[a]=l)}}return l},s2=rn,o2=Ip,fA=o2([s2("%String.prototype.indexOf%")]),Gi=function(e,t){var r=s2(e,!!t);return typeof r=="function"&&fA(e,".prototype.")>-1?o2([r]):r},gf,F1;function sg(){if(F1)return gf;F1=1;var n=rn,e=n("%Array%"),t=!e.isArray&&Gi("Object.prototype.toString");return gf=e.isArray||function(i){return t(i)==="[object Array]"},gf}var mA=Rp,B1=Lu,a2=mA.hasArrayLengthDefineBug(),gA=a2&&sg(),vA=Gi,yA=vA("Object.prototype.propertyIsEnumerable"),og=function(e,t,r,i,o,a){if(!B1){if(!e(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||o in i&&yA(i,o)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[o]=l,t(i[o],l)}return a2&&o==="length"&&"[[Value]]"in a&&gA(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(B1(i,o,r(a)),!0)},wA=re,El=Jr,bA={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},al=function(e){if(!e||typeof e!="object")return!1;for(var t in e)if(El(e,t)&&!bA[t])return!1;var r=El(e,"[[Value]]")||El(e,"[[Writable]]"),i=El(e,"[[Get]]")||El(e,"[[Set]]");if(r&&i)throw new wA("Property Descriptors may not be both accessor and data descriptors");return!0},l2=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},SA=re,_A=al,AA=l2,c2=function(e){if(typeof e<"u"&&!_A(e))throw new SA("Assertion failed: `Desc` must be a Property Descriptor");return AA(e)},EA=re,q1=Jr,kA=al,u2=function(e){if(typeof e>"u")return!1;if(!kA(e))throw new EA("Assertion failed: `Desc` must be a Property Descriptor");return!(!q1(e,"[[Value]]")&&!q1(e,"[[Writable]]"))},ll=function(e){return typeof e=="string"||typeof e=="symbol"},W1=tg,h2=function(e,t){return e===t?e===0?1/e===1/t:!0:W1(e)&&W1(t)},j1=re,CA=Yr,TA=og,$A=c2,RA=u2,IA=ll,xA=h2,ag=function(e,t,r){if(!CA(e))throw new j1("Assertion failed: Type(O) is not Object");if(!IA(t))throw new j1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return TA(RA,xA,$A,e,t,i)},d2=Function.prototype.toString,qo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,s0,Rh;if(typeof qo=="function"&&typeof Object.defineProperty=="function")try{s0=Object.defineProperty({},"length",{get:function(){throw Rh}}),Rh={},qo(function(){throw 42},null,s0)}catch(n){n!==Rh&&(qo=null)}else qo=null;var PA=/^\s*class\b/,o0=function(e){try{var t=d2.call(e);return PA.test(t)}catch{return!1}},vf=function(e){try{return o0(e)?!1:(d2.call(e),!0)}catch{return!1}},Ih=Object.prototype.toString,LA="[object Object]",DA="[object Function]",MA="[object GeneratorFunction]",OA="[object HTMLAllCollection]",NA="[object HTML document.all class]",zA="[object HTMLCollection]",ZA=typeof Symbol=="function"&&!!Symbol.toStringTag,HA=!(0 in[,]),a0=function(){return!1};if(typeof document=="object"){var UA=document.all;Ih.call(UA)===Ih.call(document.all)&&(a0=function(e){if((HA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ih.call(e);return(t===OA||t===NA||t===zA||t===LA)&&e("")==null}catch{}return!1})}var p2=qo?function(e){if(a0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{qo(e,null,s0)}catch(t){if(t!==Rh)return!1}return!o0(e)&&vf(e)}:function(e){if(a0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(ZA)return vf(e);if(o0(e))return!1;var t=Ih.call(e);return t!==DA&&t!==MA&&!/^\[object HTML/.test(t)?!1:vf(e)},VA=p2,FA=function(e){return!!e},Cn=Jr,rh=re,BA=Yr,G1=VA,yf=FA,qA=function(e){if(!BA(e))throw new rh("ToPropertyDescriptor requires an object");var t={};if(Cn(e,"enumerable")&&(t["[[Enumerable]]"]=yf(e.enumerable)),Cn(e,"configurable")&&(t["[[Configurable]]"]=yf(e.configurable)),Cn(e,"value")&&(t["[[Value]]"]=e.value),Cn(e,"writable")&&(t["[[Writable]]"]=yf(e.writable)),Cn(e,"get")){var r=e.get;if(typeof r<"u"&&!G1(r))throw new rh("getter must be a function");t["[[Get]]"]=r}if(Cn(e,"set")){var i=e.set;if(typeof i<"u"&&!G1(i))throw new rh("setter must be a function");t["[[Set]]"]=i}if((Cn(t,"[[Get]]")||Cn(t,"[[Set]]"))&&(Cn(t,"[[Value]]")||Cn(t,"[[Writable]]")))throw new rh("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},wf=re,WA=Yr,Y1=al,jA=og,GA=c2,YA=u2,JA=ll,KA=h2,XA=qA,QA=function(e,t,r){if(!WA(e))throw new wf("Assertion failed: Type(O) is not Object");if(!JA(t))throw new wf("Assertion failed: P is not a Property Key");var i=Y1(r)?r:XA(r);if(!Y1(i))throw new wf("Assertion failed: Desc is not a valid Property Descriptor");return jA(YA,KA,GA,e,t,i)},J1=re,eE=Yr,tE=QA,nE=ll,rE=function(e,t,r){if(!eE(e))throw new J1("Assertion failed: Type(O) is not Object");if(!nE(t))throw new J1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return tE(e,t,i)},iE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,sE=Qm,oE=sE.setPrototypeOf||null,aE=Ip,K1=sl,lE=re,f2={};try{f2.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var cE=!("toString"in f2),bf=K1&&K1(Object.prototype,"__proto__"),uE=cE&&(!!bf&&typeof bf.set=="function"&&aE([bf.set])||function(e,t){if(e==null)throw new lE("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),X1=iE,hE=oE,Q1=uE,dE=re,pE=X1?function(e,t){if(X1(e,t))return e;throw new dE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:hE||(Q1?function(e,t){return Q1(e,t),e}:null),ev=re,fE=Yr,tv=n2,mE=function(e){if(!fE(e))throw new ev("Assertion failed: O must be an Object");if(!tv)throw new ev("This environment does not support fetching prototypes.");return tv(e)},gE=re,vE=pE,yE=Yr,wE=mE,bE=function(e,t){if(t!==null&&!yE(t))throw new gE("Assertion failed: V must be Object or Null");try{vE(e,t)}catch{return!1}return wE(e)===t},Sf=ag,nv=rE,m2=bE,SE=Rp(),lg=Jw;function Nu(n,e,t){var r=new lg(t);return m2(r,xh),delete r.constructor,nv(r,"error",n),nv(r,"suppressed",e),r}SE&&Object.defineProperty(Nu,"prototype",{writable:!1});var xh=Nu.prototype;if(!Sf(xh,"constructor",Nu)||!Sf(xh,"message","")||!Sf(xh,"name","SuppressedError"))throw new lg("unable to install SuppressedError.prototype properties; please report this!");m2(Nu.prototype,lg.prototype);var _E=Nu,AE=_E,g2=function(){return typeof SuppressedError=="function"?SuppressedError:AE},EE=mo,rv=Xm(),kE=g2,CE=function(){var e=kE();return EE(rv,{SuppressedError:e},{SuppressedError:function(){return rv.SuppressedError!==e}}),e};CE();var TE=re,$E=al,RE=l2,IE=function(e){if(typeof e<"u"&&!$E(e))throw new TE("Assertion failed: `Desc` must be a Property Descriptor");return RE(e)},xE=re,iv=Jr,PE=al,LE=function(e){if(typeof e>"u")return!1;if(!PE(e))throw new xE("Assertion failed: `Desc` must be a Property Descriptor");return!(!iv(e,"[[Value]]")&&!iv(e,"[[Writable]]"))},sv=tg,DE=function(e,t){return e===t?e===0?1/e===1/t:!0:sv(e)&&sv(t)},cl=p2,ME=function(e){return!!e},Tn=Jr,ih=re,OE=Yr,ov=cl,_f=ME,NE=function(e){if(!OE(e))throw new ih("ToPropertyDescriptor requires an object");var t={};if(Tn(e,"enumerable")&&(t["[[Enumerable]]"]=_f(e.enumerable)),Tn(e,"configurable")&&(t["[[Configurable]]"]=_f(e.configurable)),Tn(e,"value")&&(t["[[Value]]"]=e.value),Tn(e,"writable")&&(t["[[Writable]]"]=_f(e.writable)),Tn(e,"get")){var r=e.get;if(typeof r<"u"&&!ov(r))throw new ih("getter must be a function");t["[[Get]]"]=r}if(Tn(e,"set")){var i=e.set;if(typeof i<"u"&&!ov(i))throw new ih("setter must be a function");t["[[Set]]"]=i}if((Tn(t,"[[Get]]")||Tn(t,"[[Set]]"))&&(Tn(t,"[[Value]]")||Tn(t,"[[Writable]]")))throw new ih("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},Af=re,zE=Yr,av=al,ZE=og,HE=IE,UE=LE,VE=ll,FE=DE,BE=NE,zu=function(e,t,r){if(!zE(e))throw new Af("Assertion failed: Type(O) is not Object");if(!VE(t))throw new Af("Assertion failed: P is not a Property Key");var i=av(r)?r:BE(r);if(!av(i))throw new Af("Assertion failed: Desc is not a valid Property Descriptor");return ZE(UE,FE,HE,e,t,i)},qE=ol(),WE=qE?Symbol.dispose||Symbol("Symbol.dispose"):null,jE=ol,GE=WE,cg=function(){return jE()&&Symbol.dispose||GE},YE=ng,JE=zu,KE=cg,XE=function(){var e=KE();return YE()&&JE(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},QE=ol(),ek=QE?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,tk=ol,nk=ek,ug=function(){return tk()&&Symbol.asyncDispose||nk},rk=ng,ik=zu,sk=ug,ok=function(){var e=sk();return rk()&&ik(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},ak=sg(),lk=rn,ck=Gi,uk=re,hk=ak,dk=lk("%Reflect.apply%",!0)||ck("Function.prototype.apply"),xp=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!hk(r))throw new uk("Assertion failed: optional `argumentsList`, if provided, must be a List");return dk(e,t,r)};const pk={},fk=Object.freeze(Object.defineProperty({__proto__:null,default:pk},Symbol.toStringTag,{value:"Module"})),mk=z_(fk);var hg=typeof Map=="function"&&Map.prototype,Ef=Object.getOwnPropertyDescriptor&&hg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fd=hg&&Ef&&typeof Ef.get=="function"?Ef.get:null,lv=hg&&Map.prototype.forEach,dg=typeof Set=="function"&&Set.prototype,kf=Object.getOwnPropertyDescriptor&&dg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,md=dg&&kf&&typeof kf.get=="function"?kf.get:null,cv=dg&&Set.prototype.forEach,gk=typeof WeakMap=="function"&&WeakMap.prototype,oc=gk?WeakMap.prototype.has:null,vk=typeof WeakSet=="function"&&WeakSet.prototype,ac=vk?WeakSet.prototype.has:null,yk=typeof WeakRef=="function"&&WeakRef.prototype,uv=yk?WeakRef.prototype.deref:null,wk=Boolean.prototype.valueOf,bk=Object.prototype.toString,Sk=Function.prototype.toString,_k=String.prototype.match,pg=String.prototype.slice,Zi=String.prototype.replace,Ak=String.prototype.toUpperCase,hv=String.prototype.toLowerCase,v2=RegExp.prototype.test,dv=Array.prototype.concat,tr=Array.prototype.join,Ek=Array.prototype.slice,pv=Math.floor,l0=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Cf=Object.getOwnPropertySymbols,c0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",lc=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qa||!0)?Symbol.toStringTag:null,y2=Object.prototype.propertyIsEnumerable,fv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function mv(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||v2.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-pv(-n):pv(n);if(r!==n){var i=String(r),o=pg.call(e,i.length+1);return Zi.call(i,t,"$&_")+"."+Zi.call(Zi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zi.call(e,t,"$&_")}var u0=mk,gv=u0.custom,vv=S2(gv)?gv:null,w2={__proto__:null,double:'"',single:"'"},kk={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ul=function n(e,t,r,i){var o=t||{};if(pr(o,"quoteStyle")&&!pr(w2,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=pr(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.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 A2(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?mv(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return l?mv(e,d):d}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return h0(e)?"[Array]":"[Object]";var g=Fk(o,r);if(typeof i>"u")i=[];else if(_2(i,e)>=0)return"[Circular]";function y(Ze,le,sr){if(le&&(i=Ek.call(i),i.push(le)),sr){var Zt={depth:o.depth};return pr(o,"quoteStyle")&&(Zt.quoteStyle=o.quoteStyle),n(Ze,Zt,r+1,i)}return n(Ze,o,r+1,i)}if(typeof e=="function"&&!yv(e)){var v=Dk(e),_=sh(e,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(_.length>0?" { "+tr.call(_,", ")+" }":"")}if(S2(e)){var E=Qa?Zi.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):c0.call(e);return typeof e=="object"&&!Qa?kl(E):E}if(Hk(e)){for(var x="<"+hv.call(String(e.nodeName)),B=e.attributes||[],P=0;P<B.length;P++)x+=" "+B[P].name+"="+b2(Ck(B[P].value),"double",o);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+hv.call(String(e.nodeName))+">",x}if(h0(e)){if(e.length===0)return"[]";var J=sh(e,y);return g&&!Vk(J)?"["+d0(J,g)+"]":"[ "+tr.call(J,", ")+" ]"}if($k(e)){var O=sh(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!y2.call(e,"cause")?"{ ["+String(e)+"] "+tr.call(dv.call("[cause]: "+y(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+tr.call(O,", ")+" }"}if(typeof e=="object"&&a){if(vv&&typeof e[vv]=="function"&&u0)return u0(e,{depth:f-r});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Mk(e)){var Y=[];return lv&&lv.call(e,function(Ze,le){Y.push(y(le,e,!0)+" => "+y(Ze,e))}),wv("Map",fd.call(e),Y,g)}if(zk(e)){var U=[];return cv&&cv.call(e,function(Ze){U.push(y(Ze,e))}),wv("Set",md.call(e),U,g)}if(Ok(e))return Tf("WeakMap");if(Zk(e))return Tf("WeakSet");if(Nk(e))return Tf("WeakRef");if(Ik(e))return kl(y(Number(e)));if(Pk(e))return kl(y(l0.call(e)));if(xk(e))return kl(wk.call(e));if(Rk(e))return kl(y(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof ls<"u"&&e===ls)return"{ [object globalThis] }";if(!Tk(e)&&!yv(e)){var j=sh(e,y),fe=fv?fv(e)===Object.prototype:e instanceof Object||e.constructor===Object,de=e instanceof Object?"":"null prototype",Fe=!fe&&lc&&Object(e)===e&&lc in e?pg.call(Yi(e),8,-1):de?"Object":"",ve=fe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Xe=ve+(Fe||de?"["+tr.call(dv.call([],Fe||[],de||[]),": ")+"] ":"");return j.length===0?Xe+"{}":g?Xe+"{"+d0(j,g)+"}":Xe+"{ "+tr.call(j,", ")+" }"}return String(e)};function b2(n,e,t){var r=t.quoteStyle||e,i=w2[r];return i+n+i}function Ck(n){return Zi.call(String(n),/"/g,"&quot;")}function go(n){return!lc||!(typeof n=="object"&&(lc in n||typeof n[lc]<"u"))}function h0(n){return Yi(n)==="[object Array]"&&go(n)}function Tk(n){return Yi(n)==="[object Date]"&&go(n)}function yv(n){return Yi(n)==="[object RegExp]"&&go(n)}function $k(n){return Yi(n)==="[object Error]"&&go(n)}function Rk(n){return Yi(n)==="[object String]"&&go(n)}function Ik(n){return Yi(n)==="[object Number]"&&go(n)}function xk(n){return Yi(n)==="[object Boolean]"&&go(n)}function S2(n){if(Qa)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!c0)return!1;try{return c0.call(n),!0}catch{}return!1}function Pk(n){if(!n||typeof n!="object"||!l0)return!1;try{return l0.call(n),!0}catch{}return!1}var Lk=Object.prototype.hasOwnProperty||function(n){return n in this};function pr(n,e){return Lk.call(n,e)}function Yi(n){return bk.call(n)}function Dk(n){if(n.name)return n.name;var e=_k.call(Sk.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function _2(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 Mk(n){if(!fd||!n||typeof n!="object")return!1;try{fd.call(n);try{md.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Ok(n){if(!oc||!n||typeof n!="object")return!1;try{oc.call(n,oc);try{ac.call(n,ac)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Nk(n){if(!uv||!n||typeof n!="object")return!1;try{return uv.call(n),!0}catch{}return!1}function zk(n){if(!md||!n||typeof n!="object")return!1;try{md.call(n);try{fd.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Zk(n){if(!ac||!n||typeof n!="object")return!1;try{ac.call(n,ac);try{oc.call(n,oc)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Hk(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function A2(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return A2(pg.call(n,0,e.maxStringLength),e)+r}var i=kk[e.quoteStyle||"single"];i.lastIndex=0;var o=Zi.call(Zi.call(n,i,"\\$1"),/[\x00-\x1f]/g,Uk);return b2(o,"single",e)}function Uk(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":"")+Ak.call(e.toString(16))}function kl(n){return"Object("+n+")"}function Tf(n){return n+" { ? }"}function wv(n,e,t,r){var i=r?d0(t,r):tr.call(t,", ");return n+" ("+e+") {"+i+"}"}function Vk(n){for(var e=0;e<n.length;e++)if(_2(n[e],`
2
+ `)>=0)return!1;return!0}function Fk(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=tr.call(Array(n.indent+1)," ");else return null;return{base:t,prev:tr.call(Array(e+1),t)}}function d0(n,e){if(n.length===0)return"";var t=`
3
3
  `+e.prev+e.base;return t+tr.call(n,","+t)+`
4
- `+e.prev}function sh(n,e){var t=d0(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=pr(n,i)?e(n[i],n):""}var o=typeof Tf=="function"?Tf(n):[],a;if(Qa){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var c in n)pr(n,c)&&(t&&String(Number(c))===c&&c<n.length||Qa&&a["$"+c]instanceof Symbol||(vb.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof Tf=="function")for(var d=0;d<o.length;d++)yb.call(n,o[d])&&r.push("["+e(o[d])+"]: "+e(n[o[d]],n));return r}var Vk=ul,Bk=re,Pp=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},qk=function(n,e){if(n){var t=Pp(n,e);return t&&t.value}},Wk=function(n,e,t){var r=Pp(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},jk=function(n,e){return n?!!Pp(n,e):!1},Gk=function(n,e){if(n)return Pp(n,e,!0)},Yk=function(){var e,t={assert:function(r){if(!t.has(r))throw new Bk("Side channel does not contain "+Vk(r))},delete:function(r){var i=Gk(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return qk(e,r)},has:function(r){return jk(e,r)},set:function(r,i){e||(e={next:void 0}),Wk(e,r,i)}};return t},Jk=rn,Uu=Gi(),Kk=ul,Xk=re,_v=Jk("%Map%",!0),Qk=Uu("Map.prototype.get",!0),eC=Uu("Map.prototype.set",!0),tC=Uu("Map.prototype.has",!0),nC=Uu("Map.prototype.delete",!0),rC=Uu("Map.prototype.size",!0),Eb=!!_v&&function(){var e,t={assert:function(r){if(!t.has(r))throw new Xk("Side channel does not contain "+Kk(r))},delete:function(r){if(e){var i=nC(e,r);return rC(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return Qk(e,r)},has:function(r){return e?tC(e,r):!1},set:function(r,i){e||(e=new _v),eC(e,r,i)}};return t},iC=rn,Dp=Gi(),sC=ul,oh=Eb,oC=re,To=iC("%WeakMap%",!0),aC=Dp("WeakMap.prototype.get",!0),lC=Dp("WeakMap.prototype.set",!0),cC=Dp("WeakMap.prototype.has",!0),uC=Dp("WeakMap.prototype.delete",!0),hC=To?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new oC("Side channel does not contain "+sC(i))},delete:function(i){if(To&&i&&(typeof i=="object"||typeof i=="function")){if(e)return uC(e,i)}else if(oh&&t)return t.delete(i);return!1},get:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?aC(e,i):t&&t.get(i)},has:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?cC(e,i):!!t&&t.has(i)},set:function(i,o){To&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new To),lC(e,i,o)):oh&&(t||(t=oh()),t.set(i,o))}};return r}:oh,dC=re,pC=ul,fC=Yk,mC=Eb,gC=hC,vC=gC||mC||fC,yC=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":pC(r);throw new dC("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=vC()),e.set(r,i)}};return t},wC=Jr,Cl=yC(),cr=re,mg={assert:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");if(Cl.assert(n),!mg.has(n,e))throw new cr("`"+e+"` is not present on `O`")},get:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return t&&t["$"+e]},has:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return!!t&&wC(t,"$"+e)},set:function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var r=Cl.get(n);r||(r={},Cl.set(n,r)),r["$"+e]=t}};Object.freeze&&Object.freeze(mg);var gg=mg,kb=Gr,Hi=gg,Zu=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 kb('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Hi.set(this,"[[Type]]",e),Hi.set(this,"[[Value]]",t)};Zu.prototype.type=function(){return Hi.get(this,"[[Type]]")};Zu.prototype.value=function(){return Hi.get(this,"[[Value]]")};Zu.prototype["?"]=function(){var e=Hi.get(this,"[[Type]]"),t=Hi.get(this,"[[Value]]");if(e==="throw")throw t;return t};Zu.prototype["!"]=function(){var e=Hi.get(this,"[[Type]]");if(e!=="normal")throw new kb('Assertion failed: Completion Record is not of type "normal"');return Hi.get(this,"[[Value]]")};var vg=Zu,bC=vg,yg=function(e){return new bC("normal",e)},Rf,Av;function SC(){if(Av)return Rf;Av=1;var n=ol;return Rf=function(){return n()&&!!Symbol.toStringTag},Rf}var _C=rn,Ev=_C("%Object.defineProperty%",!0),AC=SC()(),EC=Jr,kC=re,ah=AC?Symbol.toStringTag:null,Cb=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 kC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ah&&(r||!EC(e,ah))&&(Ev?Ev(e,ah,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[ah]=t)},Tb={exports:{}},CC=rn,kv=Bw,TC=Rp(),Cv=sl,Tv=re,$C=CC("%Math.floor%"),RC=function(e,t){if(typeof e!="function")throw new Tv("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||$C(t)!==t)throw new Tv("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Cv){var a=Cv(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!r)&&(TC?kv(e,"length",t,!0,!0):kv(e,"length",t)),e},IC=Lu,xC=sg,PC=tb,DC=function(){return PC(IC,xC,arguments)};(function(n){var e=RC,t=Du,r=Ip,i=DC;n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return e(l,c>0?c:0,!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(Tb);var wg=Tb.exports,LC=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},MC=Object,OC=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||MC(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},NC=Jr,zC=og(),UC=LC,ZC=OC,FC=function(e){return e&&typeof e=="object"&&NC(e,"[[DisposableResourceStack]]")&&zC(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||UC(e["[[DisposableResourceStack]]"],ZC))},HC=Yr,VC=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(HC(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},BC=VC,bg=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":BC(e)},qC=re,WC=ul,jC=ll,GC=function(e,t){if(!jC(t))throw new qC("Assertion failed: P is not a Property Key, got "+WC(t));return e[t]},$v=re,YC=GC,JC=cl,KC=ll,Rv=ul,XC=function(e,t){if(!KC(t))throw new $v("Assertion failed: P is not a Property Key");var r=YC(e,t);if(r!=null){if(!JC(r))throw new $v(Rv(t)+" is not a function: "+Rv(r));return r}},f0={exports:{}},QC=rn,eT=QC,Iv=eT("%Reflect.construct%",!0),gd=zu;try{gd({},"",{"[[Get]]":function(){}})}catch{gd=null}if(gd&&Iv){var xv={},Pv={};gd(Pv,"length",{"[[Get]]":function(){throw xv},"[[Enumerable]]":!0}),f0.exports=function(e){try{Iv(e,Pv)}catch(t){return t===xv}}}else f0.exports=function(e){return typeof e=="function"&&!!e.prototype};var tT=f0.exports,If=re,Dv=cl,nT=tT,rT=function(e){if(!nT(e))throw new If("C must be a constructor");var t={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new e(function(i,o){if(typeof t["[[Resolve]]"]<"u"||typeof t["[[Reject]]"]<"u")throw new If("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=o});if(!Dv(t["[[Resolve]]"])||!Dv(t["[[Reject]]"]))throw new If("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},Lv=Gr,iT=re,xf=xp,Mv=XC,sT=rT,oT=bg,Ov=ug(),Nv=hg(),aT=function(e,t){if(oT(e)!=="Object")throw new iT("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new Lv("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&Nv&&(r=Mv(e,Nv)),!r){if(!Ov)throw new Lv("`Symbol.dispose` is not supported");if(r=Mv(e,Ov),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var o=sT(Promise);try{xf(r,i),xf(o["[[Resolve]]"],void 0,[void 0])}catch(a){o["[[Reject]]"](a)}return o["[[Promise]]"]}xf(r,i)}}return r},lT=Gr,Pf=re,cT=cl,uT=bg,hT=aT,dT=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new lT("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"&&uT(e)!=="Object")throw new Pf("`V` must be an Object, or `null` or `undefined`");if(r=hT(e,t),typeof r>"u")throw new Pf("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!cT(r))throw new Pf("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},pT=Gr,lh=re,fT=FC,zv=dT,mT=Gi(),gT=mT("Array.prototype.push"),$b=function(e,t,r){if(!fT(e))throw new lh("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new pT("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 lh("Assertion failed: `method`, when present, must be a function");if(!e["[[DisposableResourceStack]]"])throw new lh("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var o;if(arguments.length<4){if(t==null&&r==="SYNC_DISPOSE")return"UNUSED";o=zv(t,r)}else{if(typeof t<"u")throw new lh("Assertion failed: `V` must be undefined when `method` is present");o=zv(void 0,r,i)}return gT(e["[[DisposableResourceStack]]"],o),"UNUSED"},Df,Uv;function Sg(){if(Uv)return Df;Uv=1;var n=rn,e=wg,t=Gr,r=n("%Promise.resolve%",!0),i=r&&e(r);return Df=function(a,l){if(!i)throw new t("This environment does not support Promises.");return i(a,l)},Df}var Lf,Zv;function vT(){if(Zv)return Lf;Zv=1;var n=rn,e=Gr,t=n("%Promise%",!0),r=xp,i=Sg(),o=bg;return Lf=function(l,c,d){if(typeof l<"u"&&o(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 d<"u"&&typeof d!="function")throw new e("Assertion failed: `method` must be `undefined` or a function");var f=typeof d>"u"?d:r(d,l);if(c==="ASYNC-DISPOSE")return i(t,f)},Lf}var Mf,Fv;function yT(){if(Fv)return Mf;Fv=1;var n=vg;return Mf=function(t){return new n("throw",t)},Mf}var wT=rn,Of=Gr,Hv=re,bT=wT("%Promise%",!0),ST=Gi(),Vv=ST("Promise.prototype.then",!0),_T=vg,Bv=vT(),AT=yg,ET=Sg(),qv=yT(),kT=gb(),Rb=function(e,t){if(!(t instanceof _T))throw new Hv("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new Hv("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,o=r.length-1;o>=0;o-=1)if(!i)i=r[o]["[[Hint]]"];else if(i!==r[o]["[[Hint]]"])throw new Of("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&ET(bT,t),l=function(y){if(t.type()==="throw"){var v=t.value(),_=new kT(y,v);t=qv(_)}else t=qv(y)},c=i==="ASYNC-DISPOSE"&&function(v){return Vv(a,function(){var _=Bv(v["[[ResourceValue]]"],v["[[Hint]]"],v["[[DisposeMethod]]"]);if(!_)throw new Of("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return Vv(_,AT)},l)},d=r.length-1;d>=0;d-=1)if(i==="ASYNC-DISPOSE")a=c(r[d]);else{var f=r[d];try{var g=Bv(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(g)throw new Of("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(y){l(y)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:t},Ib=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Lp=tg,_g=re,CT=xp,hl=lg,TT=zu,xb=cl,$T=yg,Et=gg,RT=Cb,Pb=mo.supportsDescriptors,IT=wg,Ag=$b,xT=Rb,Db=Ib,Wv=ug(),en=function n(){if(!(this instanceof n)||Et.has(this,"[[DisposableState]]")||Et.has(this,"[[DisposeCapability]]"))throw new _g("can only be used with new");Et.set(this,"[[DisposableState]]","PENDING"),Et.set(this,"[[DisposeCapability]]",Db())},Lb=function(){var e=this;return Et.assert(e,"[[DisposableState]]"),Et.get(e,"[[DisposableState]]")==="DISPOSED"},Fu=IT(Lb);Pb?TT(en.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Lb}):en.prototype.disposed=!1;var Mb=function(e){Et.set(e,"[[DisposableState]]","DISPOSED"),Pb||(e.disposed=!0)};hl(en.prototype,"dispose",function(){var e=this;if(!Fu(e))return Mb(e),xT(Et.get(e,"[[DisposeCapability]]"),$T())["?"]()});hl(en.prototype,"use",function(e){var t=this;if(Fu(t))throw new Lp("a disposed stack can not use anything new");return Ag(Et.get(t,"[[DisposeCapability]]"),e,"SYNC-DISPOSE"),e});hl(en.prototype,"adopt",function(e,t){var r=this;if(Fu(r))throw new Lp("a disposed stack can not use anything new");if(!xb(t))throw new _g("`onDispose` must be a function");var i=function(){return CT(t,void 0,[e])};return Ag(Et.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),e});hl(en.prototype,"defer",function(e){var t=this;if(Fu(t))throw new Lp("a disposed stack can not defer anything new");if(!xb(e))throw new _g("`onDispose` must be a function");Ag(Et.get(t,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",e)});hl(en.prototype,"move",function(){var e=this;if(Fu(e))throw new Lp("a disposed stack can not use anything new");var t=new en;return Et.set(t,"[[DisposeCapability]]",Et.get(e,"[[DisposeCapability]]")),Et.set(e,"[[DisposeCapability]]",Db()),Mb(e),t});Wv&&hl(en.prototype,Wv,en.prototype.dispose);RT(en.prototype,"DisposableStack");var PT=en,DT=PT,LT=function(){return typeof DisposableStack=="function"?DisposableStack:DT},MT=mo,OT=Qm(),NT=LT,zT=function(){var e=NT();return MT(OT,{DisposableStack:e},{DisposableStack:!0}),e},UT=rn,Mp=tg,Eg=re,jv=UT("%Promise%",!0),kg=$b,ZT=xp,dl=lg,FT=zu,HT=Rb,Ob=cl,Nb=Ib,VT=yg,Gv=Sg(),kt=gg,BT=Cb,zb=mo.supportsDescriptors,qT=wg,WT=Gi(),jT=WT("Promise.prototype.then",!0),Yv=hg(),tn=function n(){if(!(this instanceof n)||kt.has(this,"[[AsyncDisposableState]]")||kt.has(this,"[[DisposeCapability]]"))throw new Eg("can only be used with new");kt.set(this,"[[AsyncDisposableState]]","pending"),kt.set(this,"[[DisposeCapability]]",Nb())},Ub=function(){var e=this;return kt.assert(e,"[[AsyncDisposableState]]"),kt.get(e,"[[AsyncDisposableState]]")==="disposed"},Hu=qT(Ub);zb?FT(tn.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Ub}):tn.prototype.disposed=!1;var Zb=function(e){kt.set(e,"[[AsyncDisposableState]]","disposed"),zb||(e.disposed=!0)};dl(tn.prototype,"disposeAsync",function(){var e=this;return Hu(e)?Gv(jv):(Zb(e),jT(Gv(jv,HT(kt.get(e,"[[DisposeCapability]]"),VT())),function(t){return t["?"]()}))});dl(tn.prototype,"use",function(e){var t=this;if(Hu(t))throw new Mp("a disposed stack can not use anything new");return kg(kt.get(t,"[[DisposeCapability]]"),e,"ASYNC-DISPOSE"),e});dl(tn.prototype,"adopt",function(e,t){var r=this;if(Hu(r))throw new Mp("a disposed stack can not use anything new");if(!Ob(t))throw new Eg("`onDisposeAsync` must be a function");var i=function(){return ZT(t,void 0,[e])};return i.value=e,kg(kt.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),e});dl(tn.prototype,"defer",function(e){var t=this;if(Hu(t))throw new Mp("a disposed stack can not defer anything new");if(!Ob(e))throw new Eg("`onDispose` must be a function");kg(kt.get(t,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",e)});dl(tn.prototype,"move",function(){var e=this;if(Hu(e))throw new Mp("a disposed stack can not use anything new");var t=new tn;return kt.set(t,"[[DisposeCapability]]",kt.get(e,"[[DisposeCapability]]")),kt.set(e,"[[DisposeCapability]]",Nb()),Zb(e),t});Yv&&dl(tn.prototype,Yv,tn.prototype.disposeAsync);BT(tn.prototype,"AsyncDisposableStack");var GT=tn,YT=GT,JT=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:YT},KT=mo,XT=Qm(),QT=JT,e$=function(){var e=QT();return KT(XT,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},t$=KE,n$=sk,r$=zT,i$=e$,s$=function(){t$(),n$(),r$(),i$()};s$();const Jv=new WeakMap;function o$(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function $o(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function Kv(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function a$(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class l${constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw Kv();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw Kv();if(t.constructor.name==="AsyncFunction")throw a$();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=Jv.get(e);if(t){if(e.length!==t.length)throw new Error(`${$o(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(`${$o(e)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(e){const t=Jv.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),o=Reflect.get(i,r,i);return typeof o=="function"?o.bind(i):o},set:(t,r,i)=>{const o=this.getInstance(e);return Reflect.set(o,r,i,o)},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(`${$o(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=>$o(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(e.key);try{const r=e.factory();if(o$(r))throw new Error(`Factory for ${$o(e.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${$o(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 Fb=new l$,c$=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function u$(n){for(const e of Object.keys(n))if(c$.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function h$(n,e){u$(e);for(const t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0})}function sn(){class n extends Event{constructor(t,r){const{type:i,bubbles:o,cancelable:a,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:o,cancelable:a,composed:l}),h$(this,c)}}return n}class Kr extends globalThis.EventTarget{}const d$="X-Television-Client-Meta",p$="telemetry-activity",f$="telemetry-signal",Hb={kind:"single",full_screen:!1},Vb={width:560,height:740};function m$(n){return n.layout.flatMap(e=>e.artifactIds)}function g$(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())v$(r,t,e);return{valid:e.length===0,errors:e}}function pc(n){return n.flatMap(e=>e.artifactIds)}function m0(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 v$(n,e,t){if(!Nf(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`),!Nf(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`),!Nf(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 Nf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const At=sn(),Ph=sn(),Xv=sn(),y$=sn(),w$=sn(),b$=sn();function Bb(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const pl=Bb("RequestError"),Qv=Bb("ValidationError"),S$=200,_$=300,ch=401;class A${constructor(e,t){C(this,"serverURL");C(this,"token");C(this,"onUnauthorized");C(this,"telemetryMeta");this.serverURL=e.replace(/\/$/,""),this.token=t.token,this.onUnauthorized=t.onUnauthorized,this.telemetryMeta=t.telemetryMeta}async requestJSON(e,t,r){var a;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),o=await E$(i);if(!i.ok||i.status<S$||i.status>=_$)throw i.status===ch&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof o.error=="string"?o.error:i.statusText,i.status);return o}async requestVoid(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);if(!i.ok)throw i.status===ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await zf(i,i.statusText),i.status)}async requestText(e,t){var i;const r=await this.request(e,t);if(!r.ok)throw r.status===ch&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await zf(r,r.statusText),r.status);return r.text()}async requestRawVoid(e,t,r){var o;const i=await this.request(e,t,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await zf(i,i.statusText),i.status)}createError(e,t){const r={serverURL:this.serverURL};return t!==void 0&&(r.status=t),new pl(e,r)}async request(e,t,r,i){const o=`${this.serverURL}${t}`;try{return await fetch(o,{method:e,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(e){const t={...e??{}};return this.token&&(t.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(t[d$]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function E$(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function zf(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 k$(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var mr,Md,qb;class C${constructor(e){p(this,Md);p(this,mr);h(this,mr,e)}list(){return s(this,mr).requestJSON("GET","/channels")}async get(e={}){const t=await u(this,Md,qb).call(this,e.channelID);return s(this,mr).requestJSON("GET",`/channels/${encodeURIComponent(t)}`)}create(e){const t={name:e.name};return e.id!==void 0&&(t.id=e.id),s(this,mr).requestJSON("POST","/channels",t)}update(e){const{channelID:t,...r}=e;return s(this,mr).requestJSON("PATCH",`/channels/${encodeURIComponent(t)}`,r)}remove(e){return s(this,mr).requestJSON("DELETE",`/channels/${encodeURIComponent(e.channelID)}`)}}mr=new WeakMap,Md=new WeakSet,qb=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 Qv("channelID is required, but no channels exist."):new Qv(`channelID is required when multiple channels exist. Available channels: ${k$(t)}`)};var gr;class T${constructor(e){p(this,gr);h(this,gr,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,s(this,gr).requestJSON("POST","/artifacts",t)}list(e={}){const t=new URLSearchParams;e.channelID!==void 0&&t.set("channelID",e.channelID);const r=t.toString();return s(this,gr).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(e){return s(this,gr).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),s(this,gr).requestJSON("PATCH",`/artifacts/${encodeURIComponent(e.artifactID)}`,t)}delete(e){return s(this,gr).requestJSON("DELETE",`/artifacts/${encodeURIComponent(e.artifactID)}`)}}gr=new WeakMap;var Xo;class $${constructor(e){p(this,Xo);h(this,Xo,e)}list(){return s(this,Xo).requestJSON("GET","/themes")}refresh(){return s(this,Xo).requestJSON("POST","/themes/refresh")}}Xo=new WeakMap;var Qo;class R${constructor(e){p(this,Qo);h(this,Qo,e)}get(e){return s(this,Qo).requestText("GET",`/markdown/${encodeURIComponent(e.artifactID)}`)}update(e){return s(this,Qo).requestRawVoid("PUT",`/markdown/${encodeURIComponent(e.artifactID)}`,e.content)}}Qo=new WeakMap;var fs;class I${constructor(e){p(this,fs);h(this,fs,e)}status(){return s(this,fs).requestJSON("GET","/telemetry")}enable(){return s(this,fs).requestJSON("POST","/telemetry/enable")}disable(){return s(this,fs).requestJSON("POST","/telemetry/disable")}}fs=new WeakMap;var ms;class x${constructor(e){p(this,ms);h(this,ms,e)}get(){return s(this,ms).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),e.appearanceMode!==void 0&&(t.appearanceMode=e.appearanceMode),e.themeJavaScriptConsentIds!==void 0&&(t.themeJavaScriptConsentIds=e.themeJavaScriptConsentIds),s(this,ms).requestVoid("PATCH","/display",t)}focus(e){return s(this,ms).requestJSON("POST","/display/focus",{artifactID:e.artifactID})}}ms=new WeakMap;var Zt;class P${constructor(e,t={}){C(this,"channels");C(this,"artifacts");C(this,"display");C(this,"themes");C(this,"markdown");C(this,"telemetry");p(this,Zt);h(this,Zt,new A$(e,t)),this.channels=new C$(s(this,Zt)),this.artifacts=new T$(s(this,Zt)),this.display=new x$(s(this,Zt)),this.themes=new $$(s(this,Zt)),this.markdown=new R$(s(this,Zt)),this.telemetry=new I$(s(this,Zt))}health(){return s(this,Zt).requestJSON("GET","/health")}demoMode(){return s(this,Zt).requestJSON("GET","/demo-mode")}}Zt=new WeakMap;const vd="0.0.0",D$=/^\d+\.\d+\.\d+$/,L$=3;function Op(n){return D$.test(n)}function Cg(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<L$;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function M$(n,e){return n===vd||e===vd?!1:n!==e}const O$=400,N$=404,Wb=500,z$=600,U$={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ee,bc,Sc,vr,xe,ce,gs,oi,vs,yr,$t,ea,_c,D,$n,g0,xo,jb,v0,Gb,Dh,y0,Yb,Po,Jb,hr,w0,Kb,Ie;class Z$ extends Kr{constructor(t){super();p(this,D);p(this,ee);p(this,bc);p(this,Sc);p(this,vr,new Set);C(this,"pendingPageWrites",new Map);p(this,xe,new Map);p(this,ce,V$());p(this,gs);p(this,oi,!1);p(this,vs,!1);p(this,yr,0);p(this,$t,!1);p(this,ea,()=>{if(s(this,$t))return;const t=s(this,ee).connection.status==="connected";t&&!s(this,vs)?(h(this,vs,!0),u(this,D,Jb).call(this)):!t&&s(this,vs)&&(h(this,vs,!1),h(this,yr,s(this,yr)+1)),u(this,D,hr).call(this)});p(this,_c,t=>{if(s(this,$t)||t.serverURL!==s(this,ee).connection.url)return;for(const i of s(this,vr))i.push(t.event);const r=t.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Xv("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){s(this,oi)&&yd(s(this,ce),s(this,xe),r.channelID,r.artifactID)&&u(this,D,hr).call(this),this.dispatchEvent(new y$("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new w$("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new b$("appearance-changed",{appearanceMode:r.appearanceMode})),s(this,oi)&&(uh(s(this,ce),r,this.pendingPageWrites,s(this,xe)),Uf(s(this,ce),s(this,xe)),u(this,D,hr).call(this))});h(this,ee,t.connectionOwner),h(this,bc,t.navigationKeyHandler),h(this,Sc,t.retainedGateHalted??(()=>!1)),h(this,gs,u(this,D,w0).call(this)),s(this,ee).addEventListener("change",s(this,ea)),s(this,ee).addEventListener("server-event",s(this,_c)),s(this,ea).call(this)}get snapshot(){return s(this,gs)}handleNavigationKey(t){var r;u(this,D,Ie).call(this),(r=s(this,bc))==null||r.call(this,t)}authenticate(t){return u(this,D,Ie).call(this),s(this,ee).authenticate(t)}async createChannel(t){u(this,D,Ie).call(this);const{channel:r}=await u(this,D,$n).call(this,s(this,ee).connection.client.channels.create({name:t}),()=>u(this,D,jb).call(this));return r}focusChannel(t){return u(this,D,Ie).call(this),u(this,D,$n).call(this,s(this,ee).connection.client.display.patch({focusedChannelId:t}),()=>u(this,D,xo).call(this))}setPinnedChannelIds(t){return u(this,D,Ie).call(this),u(this,D,$n).call(this,s(this,ee).connection.client.display.patch({pinnedChannelIds:[...t]}),()=>u(this,D,xo).call(this))}listThemes(){return u(this,D,Ie).call(this),s(this,ee).connection.client.themes.list()}refreshThemes(){return u(this,D,Ie).call(this),s(this,ee).connection.client.themes.refresh()}setActiveTheme(t){return u(this,D,Ie).call(this),u(this,D,$n).call(this,s(this,ee).connection.client.display.patch({activeThemeName:t}),()=>u(this,D,xo).call(this))}setAppearanceMode(t){return u(this,D,Ie).call(this),u(this,D,$n).call(this,s(this,ee).connection.client.display.patch({appearanceMode:t}),()=>u(this,D,xo).call(this))}setThemeJavaScriptConsent(t,r){u(this,D,Ie).call(this);const i=s(this,ce).display.themeJavaScriptConsentIds,o=r?i.includes(t)?[...i]:[...i,t]:i.filter(a=>a!==t);return u(this,D,$n).call(this,s(this,ee).connection.client.display.patch({themeJavaScriptConsentIds:o}),()=>u(this,D,xo).call(this))}selectPage(t,r){u(this,D,Ie).call(this),yd(s(this,ce),s(this,xe),t,r)&&u(this,D,hr).call(this)}async renameChannel(t,r){u(this,D,Ie).call(this),await u(this,D,$n).call(this,s(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>u(this,D,v0).call(this,t))}async deleteChannel(t){u(this,D,Ie).call(this),await u(this,D,$n).call(this,s(this,ee).connection.client.channels.remove({channelID:t}),()=>u(this,D,Gb).call(this,t))}updateChannelPages(t,r){u(this,D,Ie).call(this);const i=g$(r),o=s(this,ce).channels.get(t);if(!i.valid||!o)return Promise.resolve();const a=us(r),l=us(o.channel.layout),c={previousPages:l};return uo(s(this,xe),t,l,a),o.channel={...o.channel,layout:a},this.pendingPageWrites.set(t,c),u(this,D,hr).call(this),s(this,ee).connection.client.channels.update({channelID:t,layout:us(a)}).then(()=>{this.pendingPageWrites.get(t)===c&&this.pendingPageWrites.delete(t)},async d=>{if(s(this,$t))throw d;const f=this.pendingPageWrites.get(t)===c;if(f&&this.pendingPageWrites.delete(t),ty(d))throw await u(this,D,g0).call(this,()=>u(this,D,v0).call(this,t)),d;if(!f||!G$(d))throw d;const g=s(this,ce).channels.get(t);if(!g)throw d;const y=us(c.previousPages);throw uo(s(this,xe),t,g.channel.layout,y),g.channel={...g.channel,layout:y},u(this,D,hr).call(this),d})}async deleteArtifact(t){u(this,D,Ie).call(this);const r=ny(s(this,ce),t);await u(this,D,$n).call(this,s(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>u(this,D,Yb).call(this,t,r))}readMarkdown(t){return u(this,D,Ie).call(this),s(this,ee).connection.client.markdown.get({artifactID:t})}writeMarkdown(t,r){return u(this,D,Ie).call(this),s(this,ee).connection.client.markdown.update({artifactID:t,content:r})}get browserDemoMode(){return s(this,ee).connection.browserDemoMode}getArtifactViewURL(t){return u(this,D,Ie).call(this),s(this,ee).connection.getViewURL(t)}getArtifactContentURL(t){return u(this,D,Ie).call(this),s(this,ee).connection.getContentURL(t)}dispose(){s(this,$t)||(h(this,$t,!0),h(this,yr,s(this,yr)+1),s(this,vr).clear(),this.pendingPageWrites.clear(),s(this,xe).clear(),s(this,ee).removeEventListener("change",s(this,ea)),s(this,ee).removeEventListener("server-event",s(this,_c)))}}ee=new WeakMap,bc=new WeakMap,Sc=new WeakMap,vr=new WeakMap,xe=new WeakMap,ce=new WeakMap,gs=new WeakMap,oi=new WeakMap,vs=new WeakMap,yr=new WeakMap,$t=new WeakMap,ea=new WeakMap,_c=new WeakMap,D=new WeakSet,$n=async function(t,r){try{return await t}catch(i){throw!s(this,$t)&&ty(i)&&await u(this,D,g0).call(this,r),i}},g0=async function(t){try{await t()}catch{}},xo=function(){const t=s(this,ee).connection.client;return u(this,D,Po).call(this,()=>t.display.get(),r=>u(this,D,Dh).call(this,r))},jb=function(){const t=s(this,ee).connection.client;return u(this,D,Po).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 o=new Set(r.map(({id:a})=>a));for(const a of s(this,ce).channels.keys())o.has(a)||(this.pendingPageWrites.delete(a),s(this,xe).delete(a),s(this,ce).channels.delete(a));for(const a of r)s(this,ce).channels.has(a.id)||s(this,ce).channels.set(a.id,{channel:Jo(a),artifacts:new Map});u(this,D,Dh).call(this,i)})},v0=function(t){const r=s(this,ee).connection.client;return u(this,D,Po).call(this,()=>Zf(()=>r.channels.get({channelID:t})),i=>u(this,D,y0).call(this,t,i))},Gb=function(t){const r=s(this,ee).connection.client;return u(this,D,Po).call(this,async()=>{const[i,o]=await Promise.all([Zf(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{u(this,D,y0).call(this,t,i),u(this,D,Dh).call(this,o)})},Dh=function(t){s(this,ce).display=S0(t),s(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},y0=function(t,r){this.pendingPageWrites.delete(t);const i=s(this,ce).channels.get(t);if(r===null){s(this,xe).delete(t),s(this,ce).channels.delete(t);return}uo(s(this,xe),t,(i==null?void 0:i.channel.layout)??[],r.channel.layout),s(this,ce).channels.set(t,{channel:Jo(r.channel),artifacts:new Map(r.artifacts.map(o=>[o.id,structuredClone(o)]))})},Yb=function(t,r){const i=s(this,ee).connection.client;return u(this,D,Po).call(this,()=>Zf(()=>i.artifacts.get({artifactID:t})),o=>{const a=ny(s(this,ce),t)??r;if(o===null){a!==null&&uh(s(this,ce),{type:"artifact-removed",channelID:a,artifactID:t},this.pendingPageWrites,s(this,xe));return}const l=a===null?void 0:s(this,ce).channels.get(a);l==null||l.artifacts.set(t,structuredClone(o.artifact))})},Po=async function(t,r){const i=s(this,yr),o=[];s(this,vr).add(o);try{const a=await t();if(s(this,$t)||i!==s(this,yr))return;r(a);for(const l of o)uh(s(this,ce),l,this.pendingPageWrites,s(this,xe));Uf(s(this,ce),s(this,xe)),u(this,D,hr).call(this)}finally{s(this,vr).delete(o)}},Jb=async function(){const t=++nh(this,yr)._,r=s(this,ee).connection,i=r.client,o=[];s(this,vr).add(o);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:g})=>i.channels.get({channelID:g})));if(s(this,$t)||t!==s(this,yr))return;const d={channels:new Map,display:S0(l)};for(const g of c)d.channels.set(g.channel.id,{channel:Jo(g.channel),artifacts:new Map(g.artifacts.map(y=>[y.id,structuredClone(y)]))});B$(s(this,xe),s(this,ce),d);for(const g of o)uh(d,g,this.pendingPageWrites,s(this,xe));Uf(d,s(this,xe));const f=s(this,oi)?F$(s(this,ce),d):[];this.pendingPageWrites.clear(),h(this,ce,d),h(this,oi,!0),r.acpClient.setEnabled(l.acpEnabled),u(this,D,hr).call(this);for(const g of f)this.dispatchEvent(new Xv("artifact-content-changed",{artifactID:g}))}catch{}finally{s(this,vr).delete(o)}},hr=function(){s(this,$t)||(h(this,gs,u(this,D,w0).call(this)),u(this,D,Kb).call(this),this.dispatchEvent(new At("change")))},w0=function(){var o;const t=[...s(this,ce).channels.values()].map(a=>W$(a,s(this,xe).get(a.channel.id))),r=t.find(({id:a})=>a===s(this,ce).display.focusedChannelId)??null,i=s(this,ee).connection;return Object.freeze({ready:s(this,oi),channels:Object.freeze(t),display:j$(s(this,ce).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||s(this,Sc).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:s(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:H$(((o=i.updateState)==null?void 0:o.desktop)??null)})})},Kb=function(){const t=s(this,gs).focusedChannel;s(this,ee).connection.acpClient.setChannelContext(t?{channelID:t.id,channelName:t.name}:null)},Ie=function(){if(s(this,$t))throw new Error("ApplicationService is disposed")};function F$(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 o=new Set(pc(r.channel.layout));return pc(i.channel.layout).filter(a=>{var l,c;return o.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function H$(n){return n===null?null:Object.freeze({...n})}function V$(){return{channels:new Map,display:S0(U$)}}function uh(n,e,t,r){switch(e.type){case"channel-created":r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:Jo(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:Jo(e.channel),artifacts:new Map});return}uo(r,e.channel.id,i.channel.layout,e.channel.layout);const o=new Set(pc(e.channel.layout));i.channel=Jo(e.channel);for(const a of i.artifacts.keys())o.has(a)||i.artifacts.delete(a);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,n.display.activeThemeColorScheme=e.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...e.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=e.appearanceMode;return;case"artifact-created":{const i=n.channels.get(e.channelID);if(!i)return;const o=t.get(e.channelID);if(o&&(o.previousPages=ey(o.previousPages,e.artifact.id)),!pc(i.channel.layout).includes(e.artifact.id)){const a=i.channel.layout,l=ey(a,e.artifact.id);uo(r,e.channelID,a,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 o=t.get(e.channelID);o&&(o.previousPages=m0(o.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const a=i.channel.layout,l=m0(a,e.artifactID);uo(r,e.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":yd(n,r,e.channelID,e.artifactID);return;case"artifact-content-changed":return;default:return Y$(e)}}function B$(n,e,t){var r;for(const i of n.keys())t.channels.has(i)||n.delete(i);for(const[i,o]of t.channels)uo(n,i,((r=e.channels.get(i))==null?void 0:r.channel.layout)??[],o.channel.layout)}function uo(n,e,t,r){const i=n.get(e);if(i===void 0)return;if(r.length===0){n.delete(e);return}const o=b0(r,i);if(o!==-1){n.set(e,[...r[o].artifactIds]);return}const a=b0(t,i),l=a===-1?0:Math.min(a,r.length-1);n.set(e,[...r[l].artifactIds])}function yd(n,e,t,r){const i=n.channels.get(t),o=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!o)return!1;const a=e.get(t);return a&&q$(a,o.artifactIds)?!1:(e.set(t,[...o.artifactIds]),!0)}function Uf(n,e){var i,o;const t=n.display.focusedChannelId;if(t===null||e.has(t))return;const r=(o=(i=n.channels.get(t))==null?void 0:i.channel.layout[0])==null?void 0:o.artifactIds[0];r!==void 0&&yd(n,e,t,r)}function b0(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function q$(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function W$(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:b0(n.channel.layout,e),i=t[r]??t[0]??null,o=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:t,selectedPage:i,artifacts:o};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function j$(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function ey(n,e){return pc(n).includes(e)?us(n):[...us(n),{artifactIds:[e],geometry:{...Hb},size:{...Vb}}]}function G$(n){return n instanceof pl&&n.status!==void 0&&n.status>=O$&&n.status<Wb}function ty(n){return n instanceof pl&&(n.status===void 0||n.status>=Wb&&n.status<z$)}async function Zf(n){try{return await n()}catch(e){if(e instanceof pl&&e.status===N$)return null;throw e}}function ny(n,e){for(const[t,r]of n.channels)if(r.artifacts.has(e))return t;return null}function us(n){return n.map(e=>({artifactIds:[...e.artifactIds],geometry:{...e.geometry},size:{...e.size}}))}function Jo(n){return{id:n.id,name:n.name,layout:us(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function S0(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function Y$(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function J$(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 d=r.pages.indexOf(r.selectedPage),f=d+(e==="ArrowLeft"?-1:1),g=(c=r.pages[f])==null?void 0:c.artifactIds[0];return d===-1||g===void 0?!1:(ry(),n.selectPage(r.id,g),!0)}const i=K$(t),o=r===null?-1:i.indexOf(r.id),a=o+(e==="ArrowUp"?-1:1),l=i[a];return o===-1||l===void 0?!1:(ry(),n.focusChannel(l).catch(()=>{}),!0)}function K$(n){const e=new Map(n.channels.map(o=>[o.id,o])),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return[...t,...i]}function ry(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const Xb="0123456789ABCDEFGHJKMNPQRSTVWXYZ",wd=32,X$=16,Qb=10,iy=0xffffffffffff;var hs;(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"})(hs||(hs={}));class Zl extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function Q$(n){const e=Math.floor(n()*wd)%wd;return Xb.charAt(e)}function eR(n){const e=tR(),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 Zl(hs.PRNGDetectFailure,"Failed to find a reliable PRNG")}function tR(){return iR()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function nR(n,e){let t="";for(;n>0;n--)t=Q$(e)+t;return t}function rR(n,e=Qb){if(isNaN(n))throw new Zl(hs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>iy)throw new Zl(hs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${iy}: ${n}`);if(n<0)throw new Zl(hs.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Zl(hs.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let t,r="";for(let i=e;i>0;i--)t=n%wd,r=Xb.charAt(t)+r,n=(n-t)/wd;return r}function iR(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Tg(n,e){const t=eR(),r=Date.now();return rR(r,Qb)+nR(X$,t)}const Fl=sn(),e2=sn(),t2=sn(),sR=sn(),Ff=sn(),oR="store-";function Vi(n){return new URL(n).origin}function aR(){return{authTokens:{}}}var ys,ws,bs;class lR extends Kr{constructor(t,r,i={}){super();p(this,ys);p(this,ws);p(this,bs);h(this,ys,`${oR}${t}`),h(this,ws,i.storage??uR());const o=s(this,ws).getItem(s(this,ys));o===null?(h(this,bs,r),s(this,ws).setItem(s(this,ys),JSON.stringify(r))):h(this,bs,hR(JSON.parse(o),r))}get(){return s(this,bs)}set(t){h(this,bs,t),s(this,ws).setItem(s(this,ys),JSON.stringify(t)),this.dispatchEvent(new At("change"))}}ys=new WeakMap,ws=new WeakMap,bs=new WeakMap;function sy(n,e){return n.authTokens[Vi(e)]??null}function oy(n,e,t){return{authTokens:{...n.authTokens,[Vi(e)]:t}}}function cR(n,e){const t=Vi(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function uR(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function hR(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,o]of Object.entries(t))if(typeof o=="string")try{r[Vi(i)]=o}catch{}return{authTokens:r}}function k(n,e,t){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),e(l,c);const d=a.prototype,f=Object.keys(d);for(let g=0;g<f.length;g++){const y=f[g];y in l||(l[y]=d[y].bind(l))}}const i=(t==null?void 0:t.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:n});function a(l){var c;const d=t!=null&&t.Parent?new o:this;r(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,d;return t!=null&&t.Parent&&l instanceof t.Parent?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class Ko extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n2 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const r2={};function Bi(n){return r2}function i2(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 _0(n,e){return typeof e=="bigint"?e.toString():e}function Np(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function $g(n){return n==null}function Rg(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function dR(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 o=t>i?t:i,a=Number.parseInt(n.toFixed(o).replace(".","")),l=Number.parseInt(e.toFixed(o).replace(".",""));return a%l/10**o}const ay=Symbol("evaluating");function ue(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==ay)return r===void 0&&(r=ay,r=t()),r},set(i){Object.defineProperty(n,e,{value:i})},configurable:!0})}function vo(n,e,t){Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Ji(...n){const e={};for(const t of n){const r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function ly(n){return JSON.stringify(n)}function pR(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const s2="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function fc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const fR=Np(()=>{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 el(n){if(fc(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(fc(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function o2(n){return el(n)?{...n}:Array.isArray(n)?[...n]:n}const mR=new Set(["string","number","symbol"]);function tl(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(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 Z(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 gR(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const vR={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 yR(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 o=Ji(n._zod.def,{get shape(){const a={};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(a[l]=t.shape[l])}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function wR(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 o=Ji(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete a[l]}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function bR(n,e){if(!el(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const o=n._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ji(n._zod.def,{get shape(){const o={...n._zod.def.shape,...e};return vo(this,"shape",o),o}});return Ki(n,i)}function SR(n,e){if(!el(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return vo(this,"shape",r),r}});return Ki(n,t)}function _R(n,e){const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e._zod.def.shape};return vo(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Ki(n,t)}function AR(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 a=Ji(e._zod.def,{get shape(){const l=e._zod.def.shape,c={...l};if(t)for(const d in t){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(c[d]=n?new n({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)c[d]=n?new n({type:"optional",innerType:l[d]}):l[d];return vo(this,"shape",c),c},checks:[]});return Ki(e,a)}function ER(n,e,t){const r=Ji(e._zod.def,{get shape(){const i=e._zod.def.shape,o={...i};if(t)for(const a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new n({type:"nonoptional",innerType:i[a]});return vo(this,"shape",o),o}});return Ki(e,r)}function Wo(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 jo(n,e){return e.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(n),t})}function hh(n){return typeof n=="string"?n:n==null?void 0:n.message}function qi(n,e,t){var i,o,a,l,c,d;const r={...n,path:n.path??[]};if(!n.message){const f=hh((a=(o=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,n))??hh((l=e==null?void 0:e.error)==null?void 0:l.call(e,n))??hh((c=t.customError)==null?void 0:c.call(t,n))??hh((d=t.localeError)==null?void 0:d.call(t,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function Ig(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function mc(...n){const[e,t,r]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}const a2=(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,_0,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},l2=k("$ZodError",a2),c2=k("$ZodError",a2,{Parent:Error});function kR(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 CR(n,e=t=>t.message){const t={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),t}const xg=n=>(e,t,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new Ko;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qi(c,o,Bi())));throw s2(l,i==null?void 0:i.callee),l}return a.value},Pg=n=>async(e,t,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qi(c,o,Bi())));throw s2(l,i==null?void 0:i.callee),l}return a.value},zp=n=>(e,t,r)=>{const i=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new Ko;return o.issues.length?{success:!1,error:new(n??l2)(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},TR=zp(c2),Up=n=>async(e,t,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},$R=Up(c2),RR=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xg(n)(e,t,i)},IR=n=>(e,t,r)=>xg(n)(e,t,r),xR=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pg(n)(e,t,i)},PR=n=>async(e,t,r)=>Pg(n)(e,t,r),DR=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(e,t,i)},LR=n=>(e,t,r)=>zp(n)(e,t,r),MR=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Up(n)(e,t,i)},OR=n=>async(e,t,r)=>Up(n)(e,t,r),NR=/^[cC][^\s-]{8,}$/,zR=/^[0-9a-z]+$/,UR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZR=/^[0-9a-vA-V]{20}$/,FR=/^[A-Za-z0-9]{27}$/,HR=/^[a-zA-Z0-9_-]{21}$/,VR=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BR=/^([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})$/,cy=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)$/,qR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jR(){return new RegExp(WR,"u")}const GR=/^(?:(?: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])$/,YR=/^(([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}|:))$/,JR=/^((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])$/,KR=/^(([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])$/,XR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u2=/^[A-Za-z0-9_-]*$/,QR=/^\+[1-9]\d{6,14}$/,h2="(?:(?:\\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])))",e3=new RegExp(`^${h2}$`);function d2(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 t3(n){return new RegExp(`^${d2(n)}$`)}function n3(n){const e=d2({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(`^${h2}T(?:${r})$`)}const r3=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}$`)},i3=/^-?\d+$/,p2=/^-?\d+(?:\.\d+)?$/,s3=/^(?:true|false)$/i,o3=/^[^A-Z]*$/,a3=/^[^a-z]*$/,Ct=k("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),f2={number:"number",bigint:"bigint",object:"date"},m2=k("$ZodCheckLessThan",(n,e)=>{Ct.init(n,e);const t=f2[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(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})}}),g2=k("$ZodCheckGreaterThan",(n,e)=>{Ct.init(n,e);const t=f2[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(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})}}),l3=k("$ZodCheckMultipleOf",(n,e)=>{Ct.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):dR(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})}}),c3=k("$ZodCheckNumberFormat",(n,e)=>{var a;Ct.init(n,e),e.format=e.format||"float64";const t=(a=e.format)==null?void 0:a.includes("int"),r=t?"int":"number",[i,o]=vR[e.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=e.format,c.minimum=i,c.maximum=o,t&&(c.pattern=i3)}),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>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),u3=k("$ZodCheckMaxLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!$g(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 a=Ig(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),h3=k("$ZodCheckMinLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!$g(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 a=Ig(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),d3=k("$ZodCheckLengthEquals",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!$g(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,o=i.length;if(o===e.length)return;const a=Ig(i),l=o>e.length;r.issues.push({origin:a,...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})}}),Zp=k("$ZodCheckStringFormat",(n,e)=>{var t,r;Ct.init(n,e),n._zod.onattach.push(i=>{const o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.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=()=>{})}),p3=k("$ZodCheckRegex",(n,e)=>{Zp.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})}}),f3=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=o3),Zp.init(n,e)}),m3=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=a3),Zp.init(n,e)}),g3=k("$ZodCheckIncludes",(n,e)=>{Ct.init(n,e);const t=tl(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=r,n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),v3=k("$ZodCheckStartsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`^${tl(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})}}),y3=k("$ZodCheckEndsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`.*${tl(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})}}),w3=k("$ZodCheckOverwrite",(n,e)=>{Ct.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class b3{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 sh(n,e){var t=h0(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=pr(n,i)?e(n[i],n):""}var o=typeof Cf=="function"?Cf(n):[],a;if(Qa){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var c in n)pr(n,c)&&(t&&String(Number(c))===c&&c<n.length||Qa&&a["$"+c]instanceof Symbol||(v2.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof Cf=="function")for(var d=0;d<o.length;d++)y2.call(n,o[d])&&r.push("["+e(o[d])+"]: "+e(n[o[d]],n));return r}var Bk=ul,qk=re,Pp=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},Wk=function(n,e){if(n){var t=Pp(n,e);return t&&t.value}},jk=function(n,e,t){var r=Pp(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},Gk=function(n,e){return n?!!Pp(n,e):!1},Yk=function(n,e){if(n)return Pp(n,e,!0)},Jk=function(){var e,t={assert:function(r){if(!t.has(r))throw new qk("Side channel does not contain "+Bk(r))},delete:function(r){var i=Yk(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return Wk(e,r)},has:function(r){return Gk(e,r)},set:function(r,i){e||(e={next:void 0}),jk(e,r,i)}};return t},Kk=rn,Zu=Gi,Xk=ul,Qk=re,bv=Kk("%Map%",!0),e3=Zu("Map.prototype.get",!0),t3=Zu("Map.prototype.set",!0),n3=Zu("Map.prototype.has",!0),r3=Zu("Map.prototype.delete",!0),i3=Zu("Map.prototype.size",!0),E2=!!bv&&function(){var e,t={assert:function(r){if(!t.has(r))throw new Qk("Side channel does not contain "+Xk(r))},delete:function(r){if(e){var i=r3(e,r);return i3(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return e3(e,r)},has:function(r){return e?n3(e,r):!1},set:function(r,i){e||(e=new bv),t3(e,r,i)}};return t},s3=rn,Lp=Gi,o3=ul,oh=E2,a3=re,To=s3("%WeakMap%",!0),l3=Lp("WeakMap.prototype.get",!0),c3=Lp("WeakMap.prototype.set",!0),u3=Lp("WeakMap.prototype.has",!0),h3=Lp("WeakMap.prototype.delete",!0),d3=To?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new a3("Side channel does not contain "+o3(i))},delete:function(i){if(To&&i&&(typeof i=="object"||typeof i=="function")){if(e)return h3(e,i)}else if(oh&&t)return t.delete(i);return!1},get:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?l3(e,i):t&&t.get(i)},has:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?u3(e,i):!!t&&t.has(i)},set:function(i,o){To&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new To),c3(e,i,o)):oh&&(t||(t=oh()),t.set(i,o))}};return r}:oh,p3=re,f3=ul,m3=Jk,g3=E2,v3=d3,y3=v3||g3||m3,w3=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":f3(r);throw new p3("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=y3()),e.set(r,i)}};return t},b3=Jr,Cl=w3(),cr=re,fg={assert:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");if(Cl.assert(n),!fg.has(n,e))throw new cr("`"+e+"` is not present on `O`")},get:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return t&&t["$"+e]},has:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return!!t&&b3(t,"$"+e)},set:function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var r=Cl.get(n);r||(r={},Cl.set(n,r)),r["$"+e]=t}};Object.freeze&&Object.freeze(fg);var mg=fg,k2=Gr,Vi=mg,Hu=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 k2('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Vi.set(this,"[[Type]]",e),Vi.set(this,"[[Value]]",t)};Hu.prototype.type=function(){return Vi.get(this,"[[Type]]")};Hu.prototype.value=function(){return Vi.get(this,"[[Value]]")};Hu.prototype["?"]=function(){var e=Vi.get(this,"[[Type]]"),t=Vi.get(this,"[[Value]]");if(e==="throw")throw t;return t};Hu.prototype["!"]=function(){var e=Vi.get(this,"[[Type]]");if(e!=="normal")throw new k2('Assertion failed: Completion Record is not of type "normal"');return Vi.get(this,"[[Value]]")};var gg=Hu,S3=gg,vg=function(e){return new S3("normal",e)},$f,Sv;function _3(){if(Sv)return $f;Sv=1;var n=ol;return $f=function(){return n()&&!!Symbol.toStringTag},$f}var A3=rn,_v=A3("%Object.defineProperty%",!0),E3=_3()(),k3=Jr,C3=re,ah=E3?Symbol.toStringTag:null,C2=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 C3("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ah&&(r||!k3(e,ah))&&(_v?_v(e,ah,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[ah]=t)},T2={exports:{}},T3=rn,Av=Vw,$3=Rp(),Ev=sl,kv=re,R3=T3("%Math.floor%"),I3=function(e,t){if(typeof e!="function")throw new kv("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||R3(t)!==t)throw new kv("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Ev){var a=Ev(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!r)&&($3?Av(e,"length",t,!0,!0):Av(e,"length",t)),e},x3=Du,P3=ig,L3=Qw,D3=function(){return L3(x3,P3,arguments)};(function(n){var e=I3,t=Lu,r=Ip,i=D3;n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return e(l,c>0?c:0,!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(T2);var yg=T2.exports,M3=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},O3=Object,N3=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||O3(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},z3=Jr,Z3=sg(),H3=M3,U3=N3,V3=function(e){return e&&typeof e=="object"&&z3(e,"[[DisposableResourceStack]]")&&Z3(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||H3(e["[[DisposableResourceStack]]"],U3))},F3=Yr,B3=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(F3(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},q3=B3,wg=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":q3(e)},W3=re,j3=ul,G3=ll,Y3=function(e,t){if(!G3(t))throw new W3("Assertion failed: P is not a Property Key, got "+j3(t));return e[t]},Cv=re,J3=Y3,K3=cl,X3=ll,Tv=ul,Q3=function(e,t){if(!X3(t))throw new Cv("Assertion failed: P is not a Property Key");var r=J3(e,t);if(r!=null){if(!K3(r))throw new Cv(Tv(t)+" is not a function: "+Tv(r));return r}},p0={exports:{}},eC=rn,tC=eC,$v=tC("%Reflect.construct%",!0),gd=zu;try{gd({},"",{"[[Get]]":function(){}})}catch{gd=null}if(gd&&$v){var Rv={},Iv={};gd(Iv,"length",{"[[Get]]":function(){throw Rv},"[[Enumerable]]":!0}),p0.exports=function(e){try{$v(e,Iv)}catch(t){return t===Rv}}}else p0.exports=function(e){return typeof e=="function"&&!!e.prototype};var nC=p0.exports,Rf=re,xv=cl,rC=nC,iC=function(e){if(!rC(e))throw new Rf("C must be a constructor");var t={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new e(function(i,o){if(typeof t["[[Resolve]]"]<"u"||typeof t["[[Reject]]"]<"u")throw new Rf("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=o});if(!xv(t["[[Resolve]]"])||!xv(t["[[Reject]]"]))throw new Rf("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},Pv=Gr,sC=re,If=xp,Lv=Q3,oC=iC,aC=wg,Dv=cg(),Mv=ug(),lC=function(e,t){if(aC(e)!=="Object")throw new sC("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new Pv("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&Mv&&(r=Lv(e,Mv)),!r){if(!Dv)throw new Pv("`Symbol.dispose` is not supported");if(r=Lv(e,Dv),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var o=oC(Promise);try{If(r,i),If(o["[[Resolve]]"],void 0,[void 0])}catch(a){o["[[Reject]]"](a)}return o["[[Promise]]"]}If(r,i)}}return r},cC=Gr,xf=re,uC=cl,hC=wg,dC=lC,pC=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new cC("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"&&hC(e)!=="Object")throw new xf("`V` must be an Object, or `null` or `undefined`");if(r=dC(e,t),typeof r>"u")throw new xf("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!uC(r))throw new xf("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},fC=Gr,lh=re,mC=V3,Ov=pC,gC=Gi,vC=gC("Array.prototype.push"),$2=function(e,t,r){if(!mC(e))throw new lh("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new fC("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 lh("Assertion failed: `method`, when present, must be a function");if(!e["[[DisposableResourceStack]]"])throw new lh("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var o;if(arguments.length<4){if(t==null&&r==="SYNC_DISPOSE")return"UNUSED";o=Ov(t,r)}else{if(typeof t<"u")throw new lh("Assertion failed: `V` must be undefined when `method` is present");o=Ov(void 0,r,i)}return vC(e["[[DisposableResourceStack]]"],o),"UNUSED"},Pf,Nv;function bg(){if(Nv)return Pf;Nv=1;var n=rn,e=yg,t=Gr,r=n("%Promise.resolve%",!0),i=r&&e(r);return Pf=function(a,l){if(!i)throw new t("This environment does not support Promises.");return i(a,l)},Pf}var Lf,zv;function yC(){if(zv)return Lf;zv=1;var n=rn,e=Gr,t=n("%Promise%",!0),r=xp,i=bg(),o=wg;return Lf=function(l,c,d){if(typeof l<"u"&&o(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 d<"u"&&typeof d!="function")throw new e("Assertion failed: `method` must be `undefined` or a function");var f=typeof d>"u"?d:r(d,l);if(c==="ASYNC-DISPOSE")return i(t,f)},Lf}var Df,Zv;function wC(){if(Zv)return Df;Zv=1;var n=gg;return Df=function(t){return new n("throw",t)},Df}var bC=rn,Mf=Gr,Hv=re,SC=bC("%Promise%",!0),_C=Gi,Uv=_C("Promise.prototype.then",!0),AC=gg,Vv=yC(),EC=vg,kC=bg(),Fv=wC(),CC=g2(),R2=function(e,t){if(!(t instanceof AC))throw new Hv("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new Hv("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,o=r.length-1;o>=0;o-=1)if(!i)i=r[o]["[[Hint]]"];else if(i!==r[o]["[[Hint]]"])throw new Mf("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&kC(SC,t),l=function(y){if(t.type()==="throw"){var v=t.value(),_=new CC(y,v);t=Fv(_)}else t=Fv(y)},c=i==="ASYNC-DISPOSE"&&function(v){return Uv(a,function(){var _=Vv(v["[[ResourceValue]]"],v["[[Hint]]"],v["[[DisposeMethod]]"]);if(!_)throw new Mf("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return Uv(_,EC)},l)},d=r.length-1;d>=0;d-=1)if(i==="ASYNC-DISPOSE")a=c(r[d]);else{var f=r[d];try{var g=Vv(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(g)throw new Mf("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(y){l(y)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:t},I2=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Dp=eg,Sg=re,TC=xp,hl=ag,$C=zu,x2=cl,RC=vg,Et=mg,IC=C2,P2=mo.supportsDescriptors,xC=yg,_g=$2,PC=R2,L2=I2,Bv=cg(),en=function n(){if(!(this instanceof n)||Et.has(this,"[[DisposableState]]")||Et.has(this,"[[DisposeCapability]]"))throw new Sg("can only be used with new");Et.set(this,"[[DisposableState]]","PENDING"),Et.set(this,"[[DisposeCapability]]",L2())},D2=function(){var e=this;return Et.assert(e,"[[DisposableState]]"),Et.get(e,"[[DisposableState]]")==="DISPOSED"},Uu=xC(D2);P2?$C(en.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":D2}):en.prototype.disposed=!1;var M2=function(e){Et.set(e,"[[DisposableState]]","DISPOSED"),P2||(e.disposed=!0)};hl(en.prototype,"dispose",function(){var e=this;if(!Uu(e))return M2(e),PC(Et.get(e,"[[DisposeCapability]]"),RC())["?"]()});hl(en.prototype,"use",function(e){var t=this;if(Uu(t))throw new Dp("a disposed stack can not use anything new");return _g(Et.get(t,"[[DisposeCapability]]"),e,"SYNC-DISPOSE"),e});hl(en.prototype,"adopt",function(e,t){var r=this;if(Uu(r))throw new Dp("a disposed stack can not use anything new");if(!x2(t))throw new Sg("`onDispose` must be a function");var i=function(){return TC(t,void 0,[e])};return _g(Et.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),e});hl(en.prototype,"defer",function(e){var t=this;if(Uu(t))throw new Dp("a disposed stack can not defer anything new");if(!x2(e))throw new Sg("`onDispose` must be a function");_g(Et.get(t,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",e)});hl(en.prototype,"move",function(){var e=this;if(Uu(e))throw new Dp("a disposed stack can not use anything new");var t=new en;return Et.set(t,"[[DisposeCapability]]",Et.get(e,"[[DisposeCapability]]")),Et.set(e,"[[DisposeCapability]]",L2()),M2(e),t});Bv&&hl(en.prototype,Bv,en.prototype.dispose);IC(en.prototype,"DisposableStack");var LC=en,DC=LC,MC=function(){return typeof DisposableStack=="function"?DisposableStack:DC},OC=mo,NC=Xm(),zC=MC,ZC=function(){var e=zC();return OC(NC,{DisposableStack:e},{DisposableStack:!0}),e},HC=rn,Mp=eg,Ag=re,qv=HC("%Promise%",!0),Eg=$2,UC=xp,dl=ag,VC=zu,FC=R2,O2=cl,N2=I2,BC=vg,Wv=bg(),kt=mg,qC=C2,z2=mo.supportsDescriptors,WC=yg,jC=Gi,GC=jC("Promise.prototype.then",!0),jv=ug(),tn=function n(){if(!(this instanceof n)||kt.has(this,"[[AsyncDisposableState]]")||kt.has(this,"[[DisposeCapability]]"))throw new Ag("can only be used with new");kt.set(this,"[[AsyncDisposableState]]","pending"),kt.set(this,"[[DisposeCapability]]",N2())},Z2=function(){var e=this;return kt.assert(e,"[[AsyncDisposableState]]"),kt.get(e,"[[AsyncDisposableState]]")==="disposed"},Vu=WC(Z2);z2?VC(tn.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Z2}):tn.prototype.disposed=!1;var H2=function(e){kt.set(e,"[[AsyncDisposableState]]","disposed"),z2||(e.disposed=!0)};dl(tn.prototype,"disposeAsync",function(){var e=this;return Vu(e)?Wv(qv):(H2(e),GC(Wv(qv,FC(kt.get(e,"[[DisposeCapability]]"),BC())),function(t){return t["?"]()}))});dl(tn.prototype,"use",function(e){var t=this;if(Vu(t))throw new Mp("a disposed stack can not use anything new");return Eg(kt.get(t,"[[DisposeCapability]]"),e,"ASYNC-DISPOSE"),e});dl(tn.prototype,"adopt",function(e,t){var r=this;if(Vu(r))throw new Mp("a disposed stack can not use anything new");if(!O2(t))throw new Ag("`onDisposeAsync` must be a function");var i=function(){return UC(t,void 0,[e])};return i.value=e,Eg(kt.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),e});dl(tn.prototype,"defer",function(e){var t=this;if(Vu(t))throw new Mp("a disposed stack can not defer anything new");if(!O2(e))throw new Ag("`onDispose` must be a function");Eg(kt.get(t,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",e)});dl(tn.prototype,"move",function(){var e=this;if(Vu(e))throw new Mp("a disposed stack can not use anything new");var t=new tn;return kt.set(t,"[[DisposeCapability]]",kt.get(e,"[[DisposeCapability]]")),kt.set(e,"[[DisposeCapability]]",N2()),H2(e),t});jv&&dl(tn.prototype,jv,tn.prototype.disposeAsync);qC(tn.prototype,"AsyncDisposableStack");var YC=tn,JC=YC,KC=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:JC},XC=mo,QC=Xm(),eT=KC,tT=function(){var e=eT();return XC(QC,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},nT=XE,rT=ok,iT=ZC,sT=tT,oT=function(){nT(),rT(),iT(),sT()};oT();const Gv=new WeakMap;function aT(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function $o(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function Yv(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function lT(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class cT{constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw Yv();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw Yv();if(t.constructor.name==="AsyncFunction")throw lT();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=Gv.get(e);if(t){if(e.length!==t.length)throw new Error(`${$o(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(`${$o(e)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(e){const t=Gv.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),o=Reflect.get(i,r,i);return typeof o=="function"?o.bind(i):o},set:(t,r,i)=>{const o=this.getInstance(e);return Reflect.set(o,r,i,o)},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(`${$o(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=>$o(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(e.key);try{const r=e.factory();if(aT(r))throw new Error(`Factory for ${$o(e.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${$o(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 U2=new cT,uT=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function hT(n){for(const e of Object.keys(n))if(uT.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function dT(n,e){hT(e);for(const t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0})}function sn(){class n extends Event{constructor(t,r){const{type:i,bubbles:o,cancelable:a,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:o,cancelable:a,composed:l}),dT(this,c)}}return n}class Kr extends globalThis.EventTarget{}const pT="X-Television-Client-Meta",fT="telemetry-activity",mT="telemetry-signal",V2={kind:"single",full_screen:!1},F2={width:560,height:740};function gT(n){return n.layout.flatMap(e=>e.artifactIds)}function vT(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())yT(r,t,e);return{valid:e.length===0,errors:e}}function pc(n){return n.flatMap(e=>e.artifactIds)}function f0(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 yT(n,e,t){if(!Of(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`),!Of(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`),!Of(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 Of(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const At=sn(),Ph=sn(),Jv=sn(),wT=sn(),bT=sn(),ST=sn();function B2(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const pl=B2("RequestError"),Kv=B2("ValidationError"),_T=200,AT=300,ch=401;class ET{constructor(e,t){C(this,"serverURL");C(this,"token");C(this,"onUnauthorized");C(this,"telemetryMeta");this.serverURL=e.replace(/\/$/,""),this.token=t.token,this.onUnauthorized=t.onUnauthorized,this.telemetryMeta=t.telemetryMeta}async requestJSON(e,t,r){var a;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),o=await kT(i);if(!i.ok||i.status<_T||i.status>=AT)throw i.status===ch&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof o.error=="string"?o.error:i.statusText,i.status);return o}async requestVoid(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);if(!i.ok)throw i.status===ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await Nf(i,i.statusText),i.status)}async requestText(e,t){var i;const r=await this.request(e,t);if(!r.ok)throw r.status===ch&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Nf(r,r.statusText),r.status);return r.text()}async requestRawVoid(e,t,r){var o;const i=await this.request(e,t,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await Nf(i,i.statusText),i.status)}createError(e,t){const r={serverURL:this.serverURL};return t!==void 0&&(r.status=t),new pl(e,r)}async request(e,t,r,i){const o=`${this.serverURL}${t}`;try{return await fetch(o,{method:e,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(e){const t={...e??{}};return this.token&&(t.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(t[pT]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function kT(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function Nf(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 CT(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var mr,Md,q2;class TT{constructor(e){p(this,Md);p(this,mr);h(this,mr,e)}list(){return s(this,mr).requestJSON("GET","/channels")}async get(e={}){const t=await u(this,Md,q2).call(this,e.channelID);return s(this,mr).requestJSON("GET",`/channels/${encodeURIComponent(t)}`)}create(e){const t={name:e.name};return e.id!==void 0&&(t.id=e.id),s(this,mr).requestJSON("POST","/channels",t)}update(e){const{channelID:t,...r}=e;return s(this,mr).requestJSON("PATCH",`/channels/${encodeURIComponent(t)}`,r)}remove(e){return s(this,mr).requestJSON("DELETE",`/channels/${encodeURIComponent(e.channelID)}`)}}mr=new WeakMap,Md=new WeakSet,q2=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 Kv("channelID is required, but no channels exist."):new Kv(`channelID is required when multiple channels exist. Available channels: ${CT(t)}`)};var gr;class $T{constructor(e){p(this,gr);h(this,gr,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,s(this,gr).requestJSON("POST","/artifacts",t)}list(e={}){const t=new URLSearchParams;e.channelID!==void 0&&t.set("channelID",e.channelID);const r=t.toString();return s(this,gr).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(e){return s(this,gr).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),s(this,gr).requestJSON("PATCH",`/artifacts/${encodeURIComponent(e.artifactID)}`,t)}delete(e){return s(this,gr).requestJSON("DELETE",`/artifacts/${encodeURIComponent(e.artifactID)}`)}}gr=new WeakMap;var Xo;class RT{constructor(e){p(this,Xo);h(this,Xo,e)}list(){return s(this,Xo).requestJSON("GET","/themes")}refresh(){return s(this,Xo).requestJSON("POST","/themes/refresh")}}Xo=new WeakMap;var Qo;class IT{constructor(e){p(this,Qo);h(this,Qo,e)}get(e){return s(this,Qo).requestText("GET",`/markdown/${encodeURIComponent(e.artifactID)}`)}update(e){return s(this,Qo).requestRawVoid("PUT",`/markdown/${encodeURIComponent(e.artifactID)}`,e.content)}}Qo=new WeakMap;var fs;class xT{constructor(e){p(this,fs);h(this,fs,e)}status(){return s(this,fs).requestJSON("GET","/telemetry")}enable(){return s(this,fs).requestJSON("POST","/telemetry/enable")}disable(){return s(this,fs).requestJSON("POST","/telemetry/disable")}}fs=new WeakMap;var ms;class PT{constructor(e){p(this,ms);h(this,ms,e)}get(){return s(this,ms).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),e.appearanceMode!==void 0&&(t.appearanceMode=e.appearanceMode),e.themeJavaScriptConsentIds!==void 0&&(t.themeJavaScriptConsentIds=e.themeJavaScriptConsentIds),s(this,ms).requestVoid("PATCH","/display",t)}focus(e){return s(this,ms).requestJSON("POST","/display/focus",{artifactID:e.artifactID})}}ms=new WeakMap;var Ht;class LT{constructor(e,t={}){C(this,"channels");C(this,"artifacts");C(this,"display");C(this,"themes");C(this,"markdown");C(this,"telemetry");p(this,Ht);h(this,Ht,new ET(e,t)),this.channels=new TT(s(this,Ht)),this.artifacts=new $T(s(this,Ht)),this.display=new PT(s(this,Ht)),this.themes=new RT(s(this,Ht)),this.markdown=new IT(s(this,Ht)),this.telemetry=new xT(s(this,Ht))}health(){return s(this,Ht).requestJSON("GET","/health")}demoMode(){return s(this,Ht).requestJSON("GET","/demo-mode")}}Ht=new WeakMap;const vd="0.0.0",DT=/^\d+\.\d+\.\d+$/,MT=3;function Op(n){return DT.test(n)}function kg(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<MT;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function OT(n,e){return n===vd||e===vd?!1:n!==e}const NT=400,zT=404,W2=500,ZT=600,HT={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ee,bc,Sc,vr,xe,ce,gs,oi,vs,yr,$t,ea,_c,L,$n,m0,xo,j2,g0,G2,Lh,v0,Y2,Po,J2,hr,y0,K2,Ie;class UT extends Kr{constructor(t){super();p(this,L);p(this,ee);p(this,bc);p(this,Sc);p(this,vr,new Set);C(this,"pendingPageWrites",new Map);p(this,xe,new Map);p(this,ce,BT());p(this,gs);p(this,oi,!1);p(this,vs,!1);p(this,yr,0);p(this,$t,!1);p(this,ea,()=>{if(s(this,$t))return;const t=s(this,ee).connection.status==="connected";t&&!s(this,vs)?(h(this,vs,!0),u(this,L,J2).call(this)):!t&&s(this,vs)&&(h(this,vs,!1),h(this,yr,s(this,yr)+1)),u(this,L,hr).call(this)});p(this,_c,t=>{if(s(this,$t)||t.serverURL!==s(this,ee).connection.url)return;for(const i of s(this,vr))i.push(t.event);const r=t.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Jv("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){s(this,oi)&&yd(s(this,ce),s(this,xe),r.channelID,r.artifactID)&&u(this,L,hr).call(this),this.dispatchEvent(new wT("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new bT("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new ST("appearance-changed",{appearanceMode:r.appearanceMode})),s(this,oi)&&(uh(s(this,ce),r,this.pendingPageWrites,s(this,xe)),zf(s(this,ce),s(this,xe)),u(this,L,hr).call(this))});h(this,ee,t.connectionOwner),h(this,bc,t.navigationKeyHandler),h(this,Sc,t.retainedGateHalted??(()=>!1)),h(this,gs,u(this,L,y0).call(this)),s(this,ee).addEventListener("change",s(this,ea)),s(this,ee).addEventListener("server-event",s(this,_c)),s(this,ea).call(this)}get snapshot(){return s(this,gs)}handleNavigationKey(t){var r;u(this,L,Ie).call(this),(r=s(this,bc))==null||r.call(this,t)}authenticate(t){return u(this,L,Ie).call(this),s(this,ee).authenticate(t)}async createChannel(t){u(this,L,Ie).call(this);const{channel:r}=await u(this,L,$n).call(this,s(this,ee).connection.client.channels.create({name:t}),()=>u(this,L,j2).call(this));return r}focusChannel(t){return u(this,L,Ie).call(this),u(this,L,$n).call(this,s(this,ee).connection.client.display.patch({focusedChannelId:t}),()=>u(this,L,xo).call(this))}setPinnedChannelIds(t){return u(this,L,Ie).call(this),u(this,L,$n).call(this,s(this,ee).connection.client.display.patch({pinnedChannelIds:[...t]}),()=>u(this,L,xo).call(this))}listThemes(){return u(this,L,Ie).call(this),s(this,ee).connection.client.themes.list()}refreshThemes(){return u(this,L,Ie).call(this),s(this,ee).connection.client.themes.refresh()}setActiveTheme(t){return u(this,L,Ie).call(this),u(this,L,$n).call(this,s(this,ee).connection.client.display.patch({activeThemeName:t}),()=>u(this,L,xo).call(this))}setAppearanceMode(t){return u(this,L,Ie).call(this),u(this,L,$n).call(this,s(this,ee).connection.client.display.patch({appearanceMode:t}),()=>u(this,L,xo).call(this))}setThemeJavaScriptConsent(t,r){u(this,L,Ie).call(this);const i=s(this,ce).display.themeJavaScriptConsentIds,o=r?i.includes(t)?[...i]:[...i,t]:i.filter(a=>a!==t);return u(this,L,$n).call(this,s(this,ee).connection.client.display.patch({themeJavaScriptConsentIds:o}),()=>u(this,L,xo).call(this))}selectPage(t,r){u(this,L,Ie).call(this),yd(s(this,ce),s(this,xe),t,r)&&u(this,L,hr).call(this)}async renameChannel(t,r){u(this,L,Ie).call(this),await u(this,L,$n).call(this,s(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>u(this,L,g0).call(this,t))}async deleteChannel(t){u(this,L,Ie).call(this),await u(this,L,$n).call(this,s(this,ee).connection.client.channels.remove({channelID:t}),()=>u(this,L,G2).call(this,t))}updateChannelPages(t,r){u(this,L,Ie).call(this);const i=vT(r),o=s(this,ce).channels.get(t);if(!i.valid||!o)return Promise.resolve();const a=us(r),l=us(o.channel.layout),c={previousPages:l};return uo(s(this,xe),t,l,a),o.channel={...o.channel,layout:a},this.pendingPageWrites.set(t,c),u(this,L,hr).call(this),s(this,ee).connection.client.channels.update({channelID:t,layout:us(a)}).then(()=>{this.pendingPageWrites.get(t)===c&&this.pendingPageWrites.delete(t)},async d=>{if(s(this,$t))throw d;const f=this.pendingPageWrites.get(t)===c;if(f&&this.pendingPageWrites.delete(t),Qv(d))throw await u(this,L,m0).call(this,()=>u(this,L,g0).call(this,t)),d;if(!f||!YT(d))throw d;const g=s(this,ce).channels.get(t);if(!g)throw d;const y=us(c.previousPages);throw uo(s(this,xe),t,g.channel.layout,y),g.channel={...g.channel,layout:y},u(this,L,hr).call(this),d})}async deleteArtifact(t){u(this,L,Ie).call(this);const r=ey(s(this,ce),t);await u(this,L,$n).call(this,s(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>u(this,L,Y2).call(this,t,r))}readMarkdown(t){return u(this,L,Ie).call(this),s(this,ee).connection.client.markdown.get({artifactID:t})}writeMarkdown(t,r){return u(this,L,Ie).call(this),s(this,ee).connection.client.markdown.update({artifactID:t,content:r})}get browserDemoMode(){return s(this,ee).connection.browserDemoMode}getArtifactViewURL(t){return u(this,L,Ie).call(this),s(this,ee).connection.getViewURL(t)}getArtifactContentURL(t){return u(this,L,Ie).call(this),s(this,ee).connection.getContentURL(t)}dispose(){s(this,$t)||(h(this,$t,!0),h(this,yr,s(this,yr)+1),s(this,vr).clear(),this.pendingPageWrites.clear(),s(this,xe).clear(),s(this,ee).removeEventListener("change",s(this,ea)),s(this,ee).removeEventListener("server-event",s(this,_c)))}}ee=new WeakMap,bc=new WeakMap,Sc=new WeakMap,vr=new WeakMap,xe=new WeakMap,ce=new WeakMap,gs=new WeakMap,oi=new WeakMap,vs=new WeakMap,yr=new WeakMap,$t=new WeakMap,ea=new WeakMap,_c=new WeakMap,L=new WeakSet,$n=async function(t,r){try{return await t}catch(i){throw!s(this,$t)&&Qv(i)&&await u(this,L,m0).call(this,r),i}},m0=async function(t){try{await t()}catch{}},xo=function(){const t=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>t.display.get(),r=>u(this,L,Lh).call(this,r))},j2=function(){const t=s(this,ee).connection.client;return u(this,L,Po).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 o=new Set(r.map(({id:a})=>a));for(const a of s(this,ce).channels.keys())o.has(a)||(this.pendingPageWrites.delete(a),s(this,xe).delete(a),s(this,ce).channels.delete(a));for(const a of r)s(this,ce).channels.has(a.id)||s(this,ce).channels.set(a.id,{channel:Jo(a),artifacts:new Map});u(this,L,Lh).call(this,i)})},g0=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Zf(()=>r.channels.get({channelID:t})),i=>u(this,L,v0).call(this,t,i))},G2=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,async()=>{const[i,o]=await Promise.all([Zf(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{u(this,L,v0).call(this,t,i),u(this,L,Lh).call(this,o)})},Lh=function(t){s(this,ce).display=b0(t),s(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},v0=function(t,r){this.pendingPageWrites.delete(t);const i=s(this,ce).channels.get(t);if(r===null){s(this,xe).delete(t),s(this,ce).channels.delete(t);return}uo(s(this,xe),t,(i==null?void 0:i.channel.layout)??[],r.channel.layout),s(this,ce).channels.set(t,{channel:Jo(r.channel),artifacts:new Map(r.artifacts.map(o=>[o.id,structuredClone(o)]))})},Y2=function(t,r){const i=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Zf(()=>i.artifacts.get({artifactID:t})),o=>{const a=ey(s(this,ce),t)??r;if(o===null){a!==null&&uh(s(this,ce),{type:"artifact-removed",channelID:a,artifactID:t},this.pendingPageWrites,s(this,xe));return}const l=a===null?void 0:s(this,ce).channels.get(a);l==null||l.artifacts.set(t,structuredClone(o.artifact))})},Po=async function(t,r){const i=s(this,yr),o=[];s(this,vr).add(o);try{const a=await t();if(s(this,$t)||i!==s(this,yr))return;r(a);for(const l of o)uh(s(this,ce),l,this.pendingPageWrites,s(this,xe));zf(s(this,ce),s(this,xe)),u(this,L,hr).call(this)}finally{s(this,vr).delete(o)}},J2=async function(){const t=++nh(this,yr)._,r=s(this,ee).connection,i=r.client,o=[];s(this,vr).add(o);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:g})=>i.channels.get({channelID:g})));if(s(this,$t)||t!==s(this,yr))return;const d={channels:new Map,display:b0(l)};for(const g of c)d.channels.set(g.channel.id,{channel:Jo(g.channel),artifacts:new Map(g.artifacts.map(y=>[y.id,structuredClone(y)]))});qT(s(this,xe),s(this,ce),d);for(const g of o)uh(d,g,this.pendingPageWrites,s(this,xe));zf(d,s(this,xe));const f=s(this,oi)?VT(s(this,ce),d):[];this.pendingPageWrites.clear(),h(this,ce,d),h(this,oi,!0),r.acpClient.setEnabled(l.acpEnabled),u(this,L,hr).call(this);for(const g of f)this.dispatchEvent(new Jv("artifact-content-changed",{artifactID:g}))}catch{}finally{s(this,vr).delete(o)}},hr=function(){s(this,$t)||(h(this,gs,u(this,L,y0).call(this)),u(this,L,K2).call(this),this.dispatchEvent(new At("change")))},y0=function(){var o;const t=[...s(this,ce).channels.values()].map(a=>jT(a,s(this,xe).get(a.channel.id))),r=t.find(({id:a})=>a===s(this,ce).display.focusedChannelId)??null,i=s(this,ee).connection;return Object.freeze({ready:s(this,oi),channels:Object.freeze(t),display:GT(s(this,ce).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||s(this,Sc).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:s(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:FT(((o=i.updateState)==null?void 0:o.desktop)??null)})})},K2=function(){const t=s(this,gs).focusedChannel;s(this,ee).connection.acpClient.setChannelContext(t?{channelID:t.id,channelName:t.name}:null)},Ie=function(){if(s(this,$t))throw new Error("ApplicationService is disposed")};function VT(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 o=new Set(pc(r.channel.layout));return pc(i.channel.layout).filter(a=>{var l,c;return o.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function FT(n){return n===null?null:Object.freeze({...n})}function BT(){return{channels:new Map,display:b0(HT)}}function uh(n,e,t,r){switch(e.type){case"channel-created":r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:Jo(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:Jo(e.channel),artifacts:new Map});return}uo(r,e.channel.id,i.channel.layout,e.channel.layout);const o=new Set(pc(e.channel.layout));i.channel=Jo(e.channel);for(const a of i.artifacts.keys())o.has(a)||i.artifacts.delete(a);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,n.display.activeThemeColorScheme=e.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...e.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=e.appearanceMode;return;case"artifact-created":{const i=n.channels.get(e.channelID);if(!i)return;const o=t.get(e.channelID);if(o&&(o.previousPages=Xv(o.previousPages,e.artifact.id)),!pc(i.channel.layout).includes(e.artifact.id)){const a=i.channel.layout,l=Xv(a,e.artifact.id);uo(r,e.channelID,a,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 o=t.get(e.channelID);o&&(o.previousPages=f0(o.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const a=i.channel.layout,l=f0(a,e.artifactID);uo(r,e.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":yd(n,r,e.channelID,e.artifactID);return;case"artifact-content-changed":return;default:return JT(e)}}function qT(n,e,t){var r;for(const i of n.keys())t.channels.has(i)||n.delete(i);for(const[i,o]of t.channels)uo(n,i,((r=e.channels.get(i))==null?void 0:r.channel.layout)??[],o.channel.layout)}function uo(n,e,t,r){const i=n.get(e);if(i===void 0)return;if(r.length===0){n.delete(e);return}const o=w0(r,i);if(o!==-1){n.set(e,[...r[o].artifactIds]);return}const a=w0(t,i),l=a===-1?0:Math.min(a,r.length-1);n.set(e,[...r[l].artifactIds])}function yd(n,e,t,r){const i=n.channels.get(t),o=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!o)return!1;const a=e.get(t);return a&&WT(a,o.artifactIds)?!1:(e.set(t,[...o.artifactIds]),!0)}function zf(n,e){var i,o;const t=n.display.focusedChannelId;if(t===null||e.has(t))return;const r=(o=(i=n.channels.get(t))==null?void 0:i.channel.layout[0])==null?void 0:o.artifactIds[0];r!==void 0&&yd(n,e,t,r)}function w0(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function WT(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function jT(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:w0(n.channel.layout,e),i=t[r]??t[0]??null,o=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:t,selectedPage:i,artifacts:o};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function GT(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function Xv(n,e){return pc(n).includes(e)?us(n):[...us(n),{artifactIds:[e],geometry:{...V2},size:{...F2}}]}function YT(n){return n instanceof pl&&n.status!==void 0&&n.status>=NT&&n.status<W2}function Qv(n){return n instanceof pl&&(n.status===void 0||n.status>=W2&&n.status<ZT)}async function Zf(n){try{return await n()}catch(e){if(e instanceof pl&&e.status===zT)return null;throw e}}function ey(n,e){for(const[t,r]of n.channels)if(r.artifacts.has(e))return t;return null}function us(n){return n.map(e=>({artifactIds:[...e.artifactIds],geometry:{...e.geometry},size:{...e.size}}))}function Jo(n){return{id:n.id,name:n.name,layout:us(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function b0(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function JT(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function KT(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 d=r.pages.indexOf(r.selectedPage),f=d+(e==="ArrowLeft"?-1:1),g=(c=r.pages[f])==null?void 0:c.artifactIds[0];return d===-1||g===void 0?!1:(ty(),n.selectPage(r.id,g),!0)}const i=XT(t),o=r===null?-1:i.indexOf(r.id),a=o+(e==="ArrowUp"?-1:1),l=i[a];return o===-1||l===void 0?!1:(ty(),n.focusChannel(l).catch(()=>{}),!0)}function XT(n){const e=new Map(n.channels.map(o=>[o.id,o])),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return[...t,...i]}function ty(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const X2="0123456789ABCDEFGHJKMNPQRSTVWXYZ",wd=32,QT=16,Q2=10,ny=0xffffffffffff;var hs;(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"})(hs||(hs={}));class Hl extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function e$(n){const e=Math.floor(n()*wd)%wd;return X2.charAt(e)}function t$(n){const e=n$(),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 Hl(hs.PRNGDetectFailure,"Failed to find a reliable PRNG")}function n$(){return s$()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function r$(n,e){let t="";for(;n>0;n--)t=e$(e)+t;return t}function i$(n,e=Q2){if(isNaN(n))throw new Hl(hs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>ny)throw new Hl(hs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${ny}: ${n}`);if(n<0)throw new Hl(hs.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Hl(hs.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let t,r="";for(let i=e;i>0;i--)t=n%wd,r=X2.charAt(t)+r,n=(n-t)/wd;return r}function s$(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Cg(n,e){const t=t$(),r=Date.now();return i$(r,Q2)+r$(QT,t)}const Ul=sn(),e8=sn(),t8=sn(),o$=sn(),Hf=sn(),a$="store-";function Fi(n){return new URL(n).origin}function l$(){return{authTokens:{}}}var ys,ws,bs;class c$ extends Kr{constructor(t,r,i={}){super();p(this,ys);p(this,ws);p(this,bs);h(this,ys,`${a$}${t}`),h(this,ws,i.storage??h$());const o=s(this,ws).getItem(s(this,ys));o===null?(h(this,bs,r),s(this,ws).setItem(s(this,ys),JSON.stringify(r))):h(this,bs,d$(JSON.parse(o),r))}get(){return s(this,bs)}set(t){h(this,bs,t),s(this,ws).setItem(s(this,ys),JSON.stringify(t)),this.dispatchEvent(new At("change"))}}ys=new WeakMap,ws=new WeakMap,bs=new WeakMap;function ry(n,e){return n.authTokens[Fi(e)]??null}function iy(n,e,t){return{authTokens:{...n.authTokens,[Fi(e)]:t}}}function u$(n,e){const t=Fi(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function h$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function d$(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,o]of Object.entries(t))if(typeof o=="string")try{r[Fi(i)]=o}catch{}return{authTokens:r}}function k(n,e,t){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),e(l,c);const d=a.prototype,f=Object.keys(d);for(let g=0;g<f.length;g++){const y=f[g];y in l||(l[y]=d[y].bind(l))}}const i=(t==null?void 0:t.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:n});function a(l){var c;const d=t!=null&&t.Parent?new o:this;r(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,d;return t!=null&&t.Parent&&l instanceof t.Parent?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class Ko extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n8 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const r8={};function Bi(n){return r8}function i8(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 S0(n,e){return typeof e=="bigint"?e.toString():e}function Np(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function Tg(n){return n==null}function $g(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function p$(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 o=t>i?t:i,a=Number.parseInt(n.toFixed(o).replace(".","")),l=Number.parseInt(e.toFixed(o).replace(".",""));return a%l/10**o}const sy=Symbol("evaluating");function ue(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==sy)return r===void 0&&(r=sy,r=t()),r},set(i){Object.defineProperty(n,e,{value:i})},configurable:!0})}function vo(n,e,t){Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Ji(...n){const e={};for(const t of n){const r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function oy(n){return JSON.stringify(n)}function f$(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const s8="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function fc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const m$=Np(()=>{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 el(n){if(fc(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(fc(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function o8(n){return el(n)?{...n}:Array.isArray(n)?[...n]:n}const g$=new Set(["string","number","symbol"]);function tl(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(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 H(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 v$(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const y$={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 w$(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 o=Ji(n._zod.def,{get shape(){const a={};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(a[l]=t.shape[l])}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function b$(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 o=Ji(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete a[l]}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function S$(n,e){if(!el(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const o=n._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ji(n._zod.def,{get shape(){const o={...n._zod.def.shape,...e};return vo(this,"shape",o),o}});return Ki(n,i)}function _$(n,e){if(!el(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return vo(this,"shape",r),r}});return Ki(n,t)}function A$(n,e){const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e._zod.def.shape};return vo(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Ki(n,t)}function E$(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 a=Ji(e._zod.def,{get shape(){const l=e._zod.def.shape,c={...l};if(t)for(const d in t){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(c[d]=n?new n({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)c[d]=n?new n({type:"optional",innerType:l[d]}):l[d];return vo(this,"shape",c),c},checks:[]});return Ki(e,a)}function k$(n,e,t){const r=Ji(e._zod.def,{get shape(){const i=e._zod.def.shape,o={...i};if(t)for(const a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new n({type:"nonoptional",innerType:i[a]});return vo(this,"shape",o),o}});return Ki(e,r)}function Wo(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 jo(n,e){return e.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(n),t})}function hh(n){return typeof n=="string"?n:n==null?void 0:n.message}function qi(n,e,t){var i,o,a,l,c,d;const r={...n,path:n.path??[]};if(!n.message){const f=hh((a=(o=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,n))??hh((l=e==null?void 0:e.error)==null?void 0:l.call(e,n))??hh((c=t.customError)==null?void 0:c.call(t,n))??hh((d=t.localeError)==null?void 0:d.call(t,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function Rg(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function mc(...n){const[e,t,r]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}const a8=(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,S0,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},l8=k("$ZodError",a8),c8=k("$ZodError",a8,{Parent:Error});function C$(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 T$(n,e=t=>t.message){const t={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),t}const Ig=n=>(e,t,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new Ko;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qi(c,o,Bi())));throw s8(l,i==null?void 0:i.callee),l}return a.value},xg=n=>async(e,t,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qi(c,o,Bi())));throw s8(l,i==null?void 0:i.callee),l}return a.value},zp=n=>(e,t,r)=>{const i=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new Ko;return o.issues.length?{success:!1,error:new(n??l8)(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},$$=zp(c8),Zp=n=>async(e,t,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},R$=Zp(c8),I$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ig(n)(e,t,i)},x$=n=>(e,t,r)=>Ig(n)(e,t,r),P$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xg(n)(e,t,i)},L$=n=>async(e,t,r)=>xg(n)(e,t,r),D$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(e,t,i)},M$=n=>(e,t,r)=>zp(n)(e,t,r),O$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zp(n)(e,t,i)},N$=n=>async(e,t,r)=>Zp(n)(e,t,r),z$=/^[cC][^\s-]{8,}$/,Z$=/^[0-9a-z]+$/,H$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U$=/^[0-9a-vA-V]{20}$/,V$=/^[A-Za-z0-9]{27}$/,F$=/^[a-zA-Z0-9_-]{21}$/,B$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,q$=/^([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})$/,ay=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)$/,W$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,j$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function G$(){return new RegExp(j$,"u")}const Y$=/^(?:(?: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])$/,J$=/^(([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}|:))$/,K$=/^((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])$/,X$=/^(([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])$/,Q$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u8=/^[A-Za-z0-9_-]*$/,eR=/^\+[1-9]\d{6,14}$/,h8="(?:(?:\\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])))",tR=new RegExp(`^${h8}$`);function d8(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 nR(n){return new RegExp(`^${d8(n)}$`)}function rR(n){const e=d8({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(`^${h8}T(?:${r})$`)}const iR=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}$`)},sR=/^-?\d+$/,p8=/^-?\d+(?:\.\d+)?$/,oR=/^(?:true|false)$/i,aR=/^[^A-Z]*$/,lR=/^[^a-z]*$/,Ct=k("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),f8={number:"number",bigint:"bigint",object:"date"},m8=k("$ZodCheckLessThan",(n,e)=>{Ct.init(n,e);const t=f8[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(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})}}),g8=k("$ZodCheckGreaterThan",(n,e)=>{Ct.init(n,e);const t=f8[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(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})}}),cR=k("$ZodCheckMultipleOf",(n,e)=>{Ct.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):p$(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})}}),uR=k("$ZodCheckNumberFormat",(n,e)=>{var a;Ct.init(n,e),e.format=e.format||"float64";const t=(a=e.format)==null?void 0:a.includes("int"),r=t?"int":"number",[i,o]=y$[e.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=e.format,c.minimum=i,c.maximum=o,t&&(c.pattern=sR)}),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>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),hR=k("$ZodCheckMaxLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Tg(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 a=Rg(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),dR=k("$ZodCheckMinLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Tg(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 a=Rg(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),pR=k("$ZodCheckLengthEquals",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Tg(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,o=i.length;if(o===e.length)return;const a=Rg(i),l=o>e.length;r.issues.push({origin:a,...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})}}),Hp=k("$ZodCheckStringFormat",(n,e)=>{var t,r;Ct.init(n,e),n._zod.onattach.push(i=>{const o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.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=()=>{})}),fR=k("$ZodCheckRegex",(n,e)=>{Hp.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})}}),mR=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=aR),Hp.init(n,e)}),gR=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=lR),Hp.init(n,e)}),vR=k("$ZodCheckIncludes",(n,e)=>{Ct.init(n,e);const t=tl(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=r,n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),yR=k("$ZodCheckStartsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`^${tl(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})}}),wR=k("$ZodCheckEndsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`.*${tl(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})}}),bR=k("$ZodCheckOverwrite",(n,e)=>{Ct.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class SR{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(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const e=Function,t=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new e(...t,i.join(`
6
- `))}}const S3={major:4,minor:3,patch:6},Ee=k("$ZodType",(n,e)=>{var i;var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=S3;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const o of r)for(const a of o._zod.onattach)a(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 o=(l,c,d)=>{let f=Wo(l),g;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(f)continue;const v=l.issues.length,_=y._zod.check(l);if(_ instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Ko;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,l.issues.length!==v&&(f||(f=Wo(l,v)))});else{if(l.issues.length===v)continue;f||(f=Wo(l,v))}}return g?g.then(()=>l):l},a=(l,c,d)=>{if(Wo(l))return l.aborted=!0,l;const f=o(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ko;return f.then(g=>n._zod.parse(g,d))}return n._zod.parse(f,d)};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(g=>a(g,l,c)):a(f,l,c)}const d=n._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Ko;return d.then(f=>o(f,r,c))}return o(d,r,c)}}ue(n,"~standard",()=>({validate:o=>{var a;try{const l=TR(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return $R(n,o).then(c=>{var d;return c.success?{value:c.data}:{issues:(d=c.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),Dg=k("$ZodString",(n,e)=>{var t;Ee.init(n,e),n._zod.pattern=[...((t=n==null?void 0:n._zod.bag)==null?void 0:t.patterns)??[]].pop()??r3(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}}),_e=k("$ZodStringFormat",(n,e)=>{Zp.init(n,e),Dg.init(n,e)}),_3=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=BR),_e.init(n,e)}),A3=k("$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=cy(r))}else e.pattern??(e.pattern=cy());_e.init(n,e)}),E3=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=qR),_e.init(n,e)}),k3=k("$ZodURL",(n,e)=>{_e.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})}}}),C3=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=jR()),_e.init(n,e)}),T3=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=HR),_e.init(n,e)}),$3=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=NR),_e.init(n,e)}),R3=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=zR),_e.init(n,e)}),I3=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=UR),_e.init(n,e)}),x3=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=ZR),_e.init(n,e)}),P3=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=FR),_e.init(n,e)}),D3=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=n3(e)),_e.init(n,e)}),L3=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=e3),_e.init(n,e)}),M3=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=t3(e)),_e.init(n,e)}),O3=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=VR),_e.init(n,e)}),N3=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=GR),_e.init(n,e),n._zod.bag.format="ipv4"}),z3=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=YR),_e.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})}}}),U3=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=JR),_e.init(n,e)}),Z3=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=KR),_e.init(n,e),n._zod.check=t=>{const r=t.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>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 v2(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const F3=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=XR),_e.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{v2(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function H3(n){if(!u2.test(n))return!1;const e=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return v2(t)}const V3=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=u2),_e.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{H3(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),B3=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=QR),_e.init(n,e)});function q3(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 W3=k("$ZodJWT",(n,e)=>{_e.init(n,e),n._zod.check=t=>{q3(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),y2=k("$ZodNumber",(n,e)=>{Ee.init(n,e),n._zod.pattern=n._zod.bag.pattern??p2,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 o=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,...o?{received:o}:{}}),t}}),j3=k("$ZodNumberFormat",(n,e)=>{c3.init(n,e),y2.init(n,e)}),G3=k("$ZodBoolean",(n,e)=>{Ee.init(n,e),n._zod.pattern=s3,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}}),Y3=k("$ZodUnknown",(n,e)=>{Ee.init(n,e),n._zod.parse=t=>t}),J3=k("$ZodNever",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function uy(n,e,t){n.issues.length&&e.issues.push(...jo(t,n.issues)),e.value[t]=n.value}const K3=k("$ZodArray",(n,e)=>{Ee.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 o=[];for(let a=0;a<i.length;a++){const l=i[a],c=e.element._zod.run({value:l,issues:[]},r);c instanceof Promise?o.push(c.then(d=>uy(d,t,a))):uy(c,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function bd(n,e,t,r,i){if(n.issues.length){if(i&&!(t in r))return;e.issues.push(...jo(t,n.issues))}n.value===void 0?t in r&&(e.value[t]=void 0):e.value[t]=n.value}function w2(n){var r,i,o,a;const e=Object.keys(n.shape);for(const l of e)if(!((a=(o=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const t=gR(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function b2(n,e,t,r,i,o){const a=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,f=c.optout==="optional";for(const g in e){if(l.has(g))continue;if(d==="never"){a.push(g);continue}const y=c.run({value:e[g],issues:[]},r);y instanceof Promise?n.push(y.then(v=>bd(v,t,g,e,f))):bd(y,t,g,e,f)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),n.length?Promise.all(n).then(()=>t):t}const X3=k("$ZodObject",(n,e)=>{Ee.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=Np(()=>w2(e));ue(n._zod,"propValues",()=>{const l=e.shape,c={};for(const d in l){const f=l[d]._zod;if(f.values){c[d]??(c[d]=new Set);for(const g of f.values)c[d].add(g)}}return c});const i=fc,o=e.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:n}),l;l.value={};const f=[],g=a.shape;for(const y of a.keys){const v=g[y],_=v._zod.optout==="optional",E=v._zod.run({value:d[y],issues:[]},c);E instanceof Promise?f.push(E.then(x=>bd(x,l,y,d,_))):bd(E,l,y,d,_)}return o?b2(f,d,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),Q3=k("$ZodObjectJIT",(n,e)=>{X3.init(n,e);const t=n._zod.parse,r=Np(()=>w2(e)),i=y=>{var J;const v=new b3(["shape","payload","ctx"]),_=r.value,E=O=>{const Y=ly(O);return`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`};v.write("const input = payload.value;");const x=Object.create(null);let B=0;for(const O of _.keys)x[O]=`key_${B++}`;v.write("const newResult = {};");for(const O of _.keys){const Y=x[O],F=ly(O),j=y[O],fe=((J=j==null?void 0:j._zod)==null?void 0:J.optout)==="optional";v.write(`const ${Y} = ${E(O)};`),fe?v.write(`
6
+ `))}}const _R={major:4,minor:3,patch:6},Ee=k("$ZodType",(n,e)=>{var i;var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=_R;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const o of r)for(const a of o._zod.onattach)a(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 o=(l,c,d)=>{let f=Wo(l),g;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(f)continue;const v=l.issues.length,_=y._zod.check(l);if(_ instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Ko;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,l.issues.length!==v&&(f||(f=Wo(l,v)))});else{if(l.issues.length===v)continue;f||(f=Wo(l,v))}}return g?g.then(()=>l):l},a=(l,c,d)=>{if(Wo(l))return l.aborted=!0,l;const f=o(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ko;return f.then(g=>n._zod.parse(g,d))}return n._zod.parse(f,d)};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(g=>a(g,l,c)):a(f,l,c)}const d=n._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Ko;return d.then(f=>o(f,r,c))}return o(d,r,c)}}ue(n,"~standard",()=>({validate:o=>{var a;try{const l=$$(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return R$(n,o).then(c=>{var d;return c.success?{value:c.data}:{issues:(d=c.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),Pg=k("$ZodString",(n,e)=>{var t;Ee.init(n,e),n._zod.pattern=[...((t=n==null?void 0:n._zod.bag)==null?void 0:t.patterns)??[]].pop()??iR(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}}),_e=k("$ZodStringFormat",(n,e)=>{Hp.init(n,e),Pg.init(n,e)}),AR=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=q$),_e.init(n,e)}),ER=k("$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=ay(r))}else e.pattern??(e.pattern=ay());_e.init(n,e)}),kR=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=W$),_e.init(n,e)}),CR=k("$ZodURL",(n,e)=>{_e.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})}}}),TR=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=G$()),_e.init(n,e)}),$R=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=F$),_e.init(n,e)}),RR=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=z$),_e.init(n,e)}),IR=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=Z$),_e.init(n,e)}),xR=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=H$),_e.init(n,e)}),PR=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=U$),_e.init(n,e)}),LR=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=V$),_e.init(n,e)}),DR=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=rR(e)),_e.init(n,e)}),MR=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=tR),_e.init(n,e)}),OR=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=nR(e)),_e.init(n,e)}),NR=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=B$),_e.init(n,e)}),zR=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=Y$),_e.init(n,e),n._zod.bag.format="ipv4"}),ZR=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=J$),_e.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})}}}),HR=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=K$),_e.init(n,e)}),UR=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=X$),_e.init(n,e),n._zod.check=t=>{const r=t.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>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 v8(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const VR=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=Q$),_e.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{v8(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function FR(n){if(!u8.test(n))return!1;const e=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return v8(t)}const BR=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=u8),_e.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{FR(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),qR=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=eR),_e.init(n,e)});function WR(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 jR=k("$ZodJWT",(n,e)=>{_e.init(n,e),n._zod.check=t=>{WR(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),y8=k("$ZodNumber",(n,e)=>{Ee.init(n,e),n._zod.pattern=n._zod.bag.pattern??p8,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 o=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,...o?{received:o}:{}}),t}}),GR=k("$ZodNumberFormat",(n,e)=>{uR.init(n,e),y8.init(n,e)}),YR=k("$ZodBoolean",(n,e)=>{Ee.init(n,e),n._zod.pattern=oR,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}}),JR=k("$ZodUnknown",(n,e)=>{Ee.init(n,e),n._zod.parse=t=>t}),KR=k("$ZodNever",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function ly(n,e,t){n.issues.length&&e.issues.push(...jo(t,n.issues)),e.value[t]=n.value}const XR=k("$ZodArray",(n,e)=>{Ee.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 o=[];for(let a=0;a<i.length;a++){const l=i[a],c=e.element._zod.run({value:l,issues:[]},r);c instanceof Promise?o.push(c.then(d=>ly(d,t,a))):ly(c,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function bd(n,e,t,r,i){if(n.issues.length){if(i&&!(t in r))return;e.issues.push(...jo(t,n.issues))}n.value===void 0?t in r&&(e.value[t]=void 0):e.value[t]=n.value}function w8(n){var r,i,o,a;const e=Object.keys(n.shape);for(const l of e)if(!((a=(o=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const t=v$(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function b8(n,e,t,r,i,o){const a=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,f=c.optout==="optional";for(const g in e){if(l.has(g))continue;if(d==="never"){a.push(g);continue}const y=c.run({value:e[g],issues:[]},r);y instanceof Promise?n.push(y.then(v=>bd(v,t,g,e,f))):bd(y,t,g,e,f)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),n.length?Promise.all(n).then(()=>t):t}const QR=k("$ZodObject",(n,e)=>{Ee.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=Np(()=>w8(e));ue(n._zod,"propValues",()=>{const l=e.shape,c={};for(const d in l){const f=l[d]._zod;if(f.values){c[d]??(c[d]=new Set);for(const g of f.values)c[d].add(g)}}return c});const i=fc,o=e.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:n}),l;l.value={};const f=[],g=a.shape;for(const y of a.keys){const v=g[y],_=v._zod.optout==="optional",E=v._zod.run({value:d[y],issues:[]},c);E instanceof Promise?f.push(E.then(x=>bd(x,l,y,d,_))):bd(E,l,y,d,_)}return o?b8(f,d,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),eI=k("$ZodObjectJIT",(n,e)=>{QR.init(n,e);const t=n._zod.parse,r=Np(()=>w8(e)),i=y=>{var J;const v=new SR(["shape","payload","ctx"]),_=r.value,E=O=>{const Y=oy(O);return`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`};v.write("const input = payload.value;");const x=Object.create(null);let B=0;for(const O of _.keys)x[O]=`key_${B++}`;v.write("const newResult = {};");for(const O of _.keys){const Y=x[O],U=oy(O),j=y[O],fe=((J=j==null?void 0:j._zod)==null?void 0:J.optout)==="optional";v.write(`const ${Y} = ${E(O)};`),fe?v.write(`
7
7
  if (${Y}.issues.length) {
8
- if (${F} in input) {
8
+ if (${U} in input) {
9
9
  payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({
10
10
  ...iss,
11
- path: iss.path ? [${F}, ...iss.path] : [${F}]
11
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
12
12
  })));
13
13
  }
14
14
  }
15
15
 
16
16
  if (${Y}.value === undefined) {
17
- if (${F} in input) {
18
- newResult[${F}] = undefined;
17
+ if (${U} in input) {
18
+ newResult[${U}] = undefined;
19
19
  }
20
20
  } else {
21
- newResult[${F}] = ${Y}.value;
21
+ newResult[${U}] = ${Y}.value;
22
22
  }
23
23
 
24
24
  `):v.write(`
25
25
  if (${Y}.issues.length) {
26
26
  payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({
27
27
  ...iss,
28
- path: iss.path ? [${F}, ...iss.path] : [${F}]
28
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
29
29
  })));
30
30
  }
31
31
 
32
32
  if (${Y}.value === undefined) {
33
- if (${F} in input) {
34
- newResult[${F}] = undefined;
33
+ if (${U} in input) {
34
+ newResult[${U}] = undefined;
35
35
  }
36
36
  } else {
37
- newResult[${F}] = ${Y}.value;
37
+ newResult[${U}] = ${Y}.value;
38
38
  }
39
39
 
40
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const P=v.compile();return(O,Y)=>P(y,O,Y)};let o;const a=fc,l=!r2.jitless,d=l&&fR.value,f=e.catchall;let g;n._zod.parse=(y,v)=>{g??(g=r.value);const _=y.value;return a(_)?l&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(o||(o=i(e.shape)),y=o(y,v),f?b2([],_,y,v,g,n):y):t(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:_,inst:n}),y)}});function hy(n,e,t,r){for(const o of n)if(o.issues.length===0)return e.value=o.value,e;const i=n.filter(o=>!Wo(o));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(o=>o.issues.map(a=>qi(a,r,Bi())))}),e)}const S2=k("$ZodUnion",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ue(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ue(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ue(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Rg(o.source)).join("|")})$`)}});const t=e.options.length===1,r=e.options[0]._zod.run;n._zod.parse=(i,o)=>{if(t)return r(i,o);let a=!1;const l=[];for(const c of e.options){const d=c._zod.run({value:i.value,issues:[]},o);if(d instanceof Promise)l.push(d),a=!0;else{if(d.issues.length===0)return d;l.push(d)}}return a?Promise.all(l).then(c=>hy(c,i,n,o)):hy(l,i,n,o)}}),eI=k("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,S2.init(n,e);const t=n._zod.parse;ue(n._zod,"propValues",()=>{const i={};for(const o of e.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const d of c)i[l].add(d)}}return i});const r=Np(()=>{var a;const i=e.options,o=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(l)}"`);for(const d of c){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,l)}}return o});n._zod.parse=(i,o)=>{const a=i.value;if(!fc(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[e.discriminator]);return l?l._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:n}),i)}}),tI=k("$ZodIntersection",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value,o=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,d])=>dy(t,c,d)):dy(t,o,a)}});function A0(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(el(n)&&el(e)){const t=Object.keys(e),r=Object.keys(n).filter(o=>t.indexOf(o)!==-1),i={...n,...e};for(const o of r){const a=A0(n[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.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],o=e[r],a=A0(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function dy(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 o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&n.issues.push({...i,keys:o}),Wo(n))return n;const a=A0(e.value,t.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const nI=k("$ZodRecord",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!el(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),t;const o=[],a=e.keyType._zod.values;if(a){t.value={};const l=new Set;for(const d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);const f=e.valueType._zod.run({value:i[d],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(d,g.issues)),t.value[d]=g.value})):(f.issues.length&&t.issues.push(...jo(d,f.issues)),t.value[d]=f.value)}let c;for(const d in i)l.has(d)||(c=c??[],c.push(d));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"&&p2.test(l)&&c.issues.length){const g=e.keyType._zod.run({value:Number(l),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(c=g)}if(c.issues.length){e.mode==="loose"?t.value[l]=i[l]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(g=>qi(g,r,Bi())),input:l,path:[l],inst:n});continue}const f=e.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(l,g.issues)),t.value[c.value]=g.value})):(f.issues.length&&t.issues.push(...jo(l,f.issues)),t.value[c.value]=f.value)}}return o.length?Promise.all(o).then(()=>t):t}}),rI=k("$ZodEnum",(n,e)=>{Ee.init(n,e);const t=i2(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>mR.has(typeof i)).map(i=>typeof i=="string"?tl(i):i.toString()).join("|")})$`),n._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:t,input:a,inst:n}),i}}),iI=k("$ZodLiteral",(n,e)=>{if(Ee.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"?tl(r):r?tl(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const o=r.value;return t.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),r}}),sI=k("$ZodTransform",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new n2(n.constructor.name);const i=e.transform(t.value,t);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(t.value=a,t));if(i instanceof Promise)throw new Ko;return t.value=i,t}});function py(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const _2=k("$ZodOptional",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",n._zod.optout="optional",ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Rg(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(o=>py(o,t.value)):py(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),oI=k("$ZodExactOptional",(n,e)=>{_2.init(n,e),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),aI=k("$ZodNullable",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Rg(t.source)}|null)$`):void 0}),ue(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)}),lI=k("$ZodDefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(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(o=>fy(o,e)):fy(i,e)}});function fy(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const cI=k("$ZodPrefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(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))}),uI=k("$ZodNonOptional",(n,e)=>{Ee.init(n,e),ue(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(o=>my(o,n)):my(i,n)}});function my(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 hI=k("$ZodCatch",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(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(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>qi(a,r,Bi()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>qi(o,r,Bi()))},input:t.value}),t.issues=[]),t)}}),dI=k("$ZodPipe",(n,e)=>{Ee.init(n,e),ue(n._zod,"values",()=>e.in._zod.values),ue(n._zod,"optin",()=>e.in._zod.optin),ue(n._zod,"optout",()=>e.out._zod.optout),ue(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,r)=>{if(r.direction==="backward"){const o=e.out._zod.run(t,r);return o instanceof Promise?o.then(a=>dh(a,e.in,r)):dh(o,e.in,r)}const i=e.in._zod.run(t,r);return i instanceof Promise?i.then(o=>dh(o,e.out,r)):dh(i,e.out,r)}});function dh(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},t)}const pI=k("$ZodReadonly",(n,e)=>{Ee.init(n,e),ue(n._zod,"propValues",()=>e.innerType._zod.propValues),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"optin",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optin}),ue(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(gy):gy(i)}});function gy(n){return n.value=Object.freeze(n.value),n}const fI=k("$ZodCustom",(n,e)=>{Ct.init(n,e),Ee.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(o=>vy(o,t,r,n));vy(i,t,r,n)}});function vy(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(mc(i))}}var yy;class mI{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 gI(){return new mI}(yy=globalThis).__zod_globalRegistry??(yy.__zod_globalRegistry=gI());const Hl=globalThis.__zod_globalRegistry;function vI(n,e){return new n({type:"string",...Z(e)})}function yI(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Z(e)})}function wy(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Z(e)})}function wI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(e)})}function bI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(e)})}function SI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(e)})}function _I(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(e)})}function AI(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Z(e)})}function EI(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(e)})}function kI(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(e)})}function CI(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(e)})}function TI(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(e)})}function $I(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(e)})}function RI(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Z(e)})}function II(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(e)})}function xI(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(e)})}function PI(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(e)})}function DI(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(e)})}function LI(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(e)})}function MI(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Z(e)})}function OI(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(e)})}function NI(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Z(e)})}function zI(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(e)})}function UI(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(e)})}function ZI(n,e){return new n({type:"string",format:"date",check:"string_format",...Z(e)})}function FI(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...Z(e)})}function HI(n,e){return new n({type:"string",format:"duration",check:"string_format",...Z(e)})}function VI(n,e){return new n({type:"number",checks:[],...Z(e)})}function BI(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(e)})}function qI(n,e){return new n({type:"boolean",...Z(e)})}function WI(n){return new n({type:"unknown"})}function jI(n,e){return new n({type:"never",...Z(e)})}function by(n,e){return new m2({check:"less_than",...Z(e),value:n,inclusive:!1})}function Hf(n,e){return new m2({check:"less_than",...Z(e),value:n,inclusive:!0})}function Sy(n,e){return new g2({check:"greater_than",...Z(e),value:n,inclusive:!1})}function Vf(n,e){return new g2({check:"greater_than",...Z(e),value:n,inclusive:!0})}function _y(n,e){return new l3({check:"multiple_of",...Z(e),value:n})}function A2(n,e){return new u3({check:"max_length",...Z(e),maximum:n})}function Sd(n,e){return new h3({check:"min_length",...Z(e),minimum:n})}function E2(n,e){return new d3({check:"length_equals",...Z(e),length:n})}function GI(n,e){return new p3({check:"string_format",format:"regex",...Z(e),pattern:n})}function YI(n){return new f3({check:"string_format",format:"lowercase",...Z(n)})}function JI(n){return new m3({check:"string_format",format:"uppercase",...Z(n)})}function KI(n,e){return new g3({check:"string_format",format:"includes",...Z(e),includes:n})}function XI(n,e){return new v3({check:"string_format",format:"starts_with",...Z(e),prefix:n})}function QI(n,e){return new y3({check:"string_format",format:"ends_with",...Z(e),suffix:n})}function fl(n){return new w3({check:"overwrite",tx:n})}function ex(n){return fl(e=>e.normalize(n))}function tx(){return fl(n=>n.trim())}function nx(){return fl(n=>n.toLowerCase())}function rx(){return fl(n=>n.toUpperCase())}function ix(){return fl(n=>pR(n))}function sx(n,e,t){return new n({type:"array",element:e,...Z(t)})}function ox(n,e,t){return new n({type:"custom",check:"custom",fn:e,...Z(t)})}function ax(n){const e=lx(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(mc(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(mc(i))}},n(t.value,t)));return e}function lx(n,e){const t=new Ct({check:"custom",...Z(e)});return t._zod.check=n,t}function k2(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)??Hl,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 De(n,e,t={path:[],schemaPath:[]}){var f,g;var r;const i=n._zod.def,o=e.seen.get(n);if(o)return o.count++,t.schemaPath.includes(n)&&(o.cycle=t.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,a);const l=(g=(f=n._zod).toJSONSchema)==null?void 0:g.call(f);if(l)a.schema=l;else{const y={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,a.schema,y);else{const _=a.schema,E=e.processors[i.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);E(n,e,_,y)}const v=n._zod.parent;v&&(a.ref||(a.ref=v),De(v,e,y),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),e.io==="input"&&et(n)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(n).schema}function C2(n,e){var a,l,c,d;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 g=(a=n.metadataRegistry.get(f[0]))==null?void 0:a.id;if(g){const y=r.get(g);if(y&&y!==f[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(g,f[0])}}const i=f=>{var E;const g=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(E=n.external.registry.get(f[0]))==null?void 0:E.id,B=n.external.uri??(J=>J);if(x)return{ref:B(x)};const P=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=P,{defId:P,ref:`${B("__shared")}#/${g}/${P}`}}if(f[1]===t)return{ref:"#"};const v=`#/${g}/`,_=f[1].schema.id??`__schema${n.counter++}`;return{defId:_,ref:v+_}},o=f=>{if(f[1].schema.$ref)return;const g=f[1],{ref:y,defId:v}=i(f);g.def={...g.schema},v&&(g.defId=v);const _=g.schema;for(const E in _)delete _[E];_.$ref=y};if(n.cycles==="throw")for(const f of n.seen.entries()){const g=f[1];if(g.cycle)throw new Error(`Cycle detected: #/${(l=g.cycle)==null?void 0:l.join("/")}/<root>
40
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const P=v.compile();return(O,Y)=>P(y,O,Y)};let o;const a=fc,l=!r8.jitless,d=l&&m$.value,f=e.catchall;let g;n._zod.parse=(y,v)=>{g??(g=r.value);const _=y.value;return a(_)?l&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(o||(o=i(e.shape)),y=o(y,v),f?b8([],_,y,v,g,n):y):t(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:_,inst:n}),y)}});function cy(n,e,t,r){for(const o of n)if(o.issues.length===0)return e.value=o.value,e;const i=n.filter(o=>!Wo(o));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(o=>o.issues.map(a=>qi(a,r,Bi())))}),e)}const S8=k("$ZodUnion",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ue(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ue(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ue(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>$g(o.source)).join("|")})$`)}});const t=e.options.length===1,r=e.options[0]._zod.run;n._zod.parse=(i,o)=>{if(t)return r(i,o);let a=!1;const l=[];for(const c of e.options){const d=c._zod.run({value:i.value,issues:[]},o);if(d instanceof Promise)l.push(d),a=!0;else{if(d.issues.length===0)return d;l.push(d)}}return a?Promise.all(l).then(c=>cy(c,i,n,o)):cy(l,i,n,o)}}),tI=k("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,S8.init(n,e);const t=n._zod.parse;ue(n._zod,"propValues",()=>{const i={};for(const o of e.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const d of c)i[l].add(d)}}return i});const r=Np(()=>{var a;const i=e.options,o=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(l)}"`);for(const d of c){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,l)}}return o});n._zod.parse=(i,o)=>{const a=i.value;if(!fc(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[e.discriminator]);return l?l._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:n}),i)}}),nI=k("$ZodIntersection",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value,o=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,d])=>uy(t,c,d)):uy(t,o,a)}});function _0(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(el(n)&&el(e)){const t=Object.keys(e),r=Object.keys(n).filter(o=>t.indexOf(o)!==-1),i={...n,...e};for(const o of r){const a=_0(n[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.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],o=e[r],a=_0(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function uy(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 o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&n.issues.push({...i,keys:o}),Wo(n))return n;const a=_0(e.value,t.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const rI=k("$ZodRecord",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!el(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),t;const o=[],a=e.keyType._zod.values;if(a){t.value={};const l=new Set;for(const d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);const f=e.valueType._zod.run({value:i[d],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(d,g.issues)),t.value[d]=g.value})):(f.issues.length&&t.issues.push(...jo(d,f.issues)),t.value[d]=f.value)}let c;for(const d in i)l.has(d)||(c=c??[],c.push(d));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"&&p8.test(l)&&c.issues.length){const g=e.keyType._zod.run({value:Number(l),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(c=g)}if(c.issues.length){e.mode==="loose"?t.value[l]=i[l]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(g=>qi(g,r,Bi())),input:l,path:[l],inst:n});continue}const f=e.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(l,g.issues)),t.value[c.value]=g.value})):(f.issues.length&&t.issues.push(...jo(l,f.issues)),t.value[c.value]=f.value)}}return o.length?Promise.all(o).then(()=>t):t}}),iI=k("$ZodEnum",(n,e)=>{Ee.init(n,e);const t=i8(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>g$.has(typeof i)).map(i=>typeof i=="string"?tl(i):i.toString()).join("|")})$`),n._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:t,input:a,inst:n}),i}}),sI=k("$ZodLiteral",(n,e)=>{if(Ee.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"?tl(r):r?tl(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const o=r.value;return t.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),r}}),oI=k("$ZodTransform",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new n8(n.constructor.name);const i=e.transform(t.value,t);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(t.value=a,t));if(i instanceof Promise)throw new Ko;return t.value=i,t}});function hy(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const _8=k("$ZodOptional",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",n._zod.optout="optional",ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${$g(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(o=>hy(o,t.value)):hy(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),aI=k("$ZodExactOptional",(n,e)=>{_8.init(n,e),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),lI=k("$ZodNullable",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${$g(t.source)}|null)$`):void 0}),ue(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)}),cI=k("$ZodDefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(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(o=>dy(o,e)):dy(i,e)}});function dy(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const uI=k("$ZodPrefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(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))}),hI=k("$ZodNonOptional",(n,e)=>{Ee.init(n,e),ue(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(o=>py(o,n)):py(i,n)}});function py(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 dI=k("$ZodCatch",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(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(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>qi(a,r,Bi()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>qi(o,r,Bi()))},input:t.value}),t.issues=[]),t)}}),pI=k("$ZodPipe",(n,e)=>{Ee.init(n,e),ue(n._zod,"values",()=>e.in._zod.values),ue(n._zod,"optin",()=>e.in._zod.optin),ue(n._zod,"optout",()=>e.out._zod.optout),ue(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,r)=>{if(r.direction==="backward"){const o=e.out._zod.run(t,r);return o instanceof Promise?o.then(a=>dh(a,e.in,r)):dh(o,e.in,r)}const i=e.in._zod.run(t,r);return i instanceof Promise?i.then(o=>dh(o,e.out,r)):dh(i,e.out,r)}});function dh(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},t)}const fI=k("$ZodReadonly",(n,e)=>{Ee.init(n,e),ue(n._zod,"propValues",()=>e.innerType._zod.propValues),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"optin",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optin}),ue(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(fy):fy(i)}});function fy(n){return n.value=Object.freeze(n.value),n}const mI=k("$ZodCustom",(n,e)=>{Ct.init(n,e),Ee.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(o=>my(o,t,r,n));my(i,t,r,n)}});function my(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(mc(i))}}var gy;class gI{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 vI(){return new gI}(gy=globalThis).__zod_globalRegistry??(gy.__zod_globalRegistry=vI());const Vl=globalThis.__zod_globalRegistry;function yI(n,e){return new n({type:"string",...H(e)})}function wI(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function vy(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function bI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function SI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function _I(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function AI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function EI(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function kI(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function CI(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function TI(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function $I(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function RI(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function II(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function xI(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function PI(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function LI(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function DI(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function MI(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function OI(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function NI(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function zI(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)})}function ZI(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)})}function HI(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function UI(n,e){return new n({type:"string",format:"date",check:"string_format",...H(e)})}function VI(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function FI(n,e){return new n({type:"string",format:"duration",check:"string_format",...H(e)})}function BI(n,e){return new n({type:"number",checks:[],...H(e)})}function qI(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function WI(n,e){return new n({type:"boolean",...H(e)})}function jI(n){return new n({type:"unknown"})}function GI(n,e){return new n({type:"never",...H(e)})}function yy(n,e){return new m8({check:"less_than",...H(e),value:n,inclusive:!1})}function Uf(n,e){return new m8({check:"less_than",...H(e),value:n,inclusive:!0})}function wy(n,e){return new g8({check:"greater_than",...H(e),value:n,inclusive:!1})}function Vf(n,e){return new g8({check:"greater_than",...H(e),value:n,inclusive:!0})}function by(n,e){return new cR({check:"multiple_of",...H(e),value:n})}function A8(n,e){return new hR({check:"max_length",...H(e),maximum:n})}function Sd(n,e){return new dR({check:"min_length",...H(e),minimum:n})}function E8(n,e){return new pR({check:"length_equals",...H(e),length:n})}function YI(n,e){return new fR({check:"string_format",format:"regex",...H(e),pattern:n})}function JI(n){return new mR({check:"string_format",format:"lowercase",...H(n)})}function KI(n){return new gR({check:"string_format",format:"uppercase",...H(n)})}function XI(n,e){return new vR({check:"string_format",format:"includes",...H(e),includes:n})}function QI(n,e){return new yR({check:"string_format",format:"starts_with",...H(e),prefix:n})}function ex(n,e){return new wR({check:"string_format",format:"ends_with",...H(e),suffix:n})}function fl(n){return new bR({check:"overwrite",tx:n})}function tx(n){return fl(e=>e.normalize(n))}function nx(){return fl(n=>n.trim())}function rx(){return fl(n=>n.toLowerCase())}function ix(){return fl(n=>n.toUpperCase())}function sx(){return fl(n=>f$(n))}function ox(n,e,t){return new n({type:"array",element:e,...H(t)})}function ax(n,e,t){return new n({type:"custom",check:"custom",fn:e,...H(t)})}function lx(n){const e=cx(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(mc(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(mc(i))}},n(t.value,t)));return e}function cx(n,e){const t=new Ct({check:"custom",...H(e)});return t._zod.check=n,t}function k8(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)??Vl,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 Le(n,e,t={path:[],schemaPath:[]}){var f,g;var r;const i=n._zod.def,o=e.seen.get(n);if(o)return o.count++,t.schemaPath.includes(n)&&(o.cycle=t.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,a);const l=(g=(f=n._zod).toJSONSchema)==null?void 0:g.call(f);if(l)a.schema=l;else{const y={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,a.schema,y);else{const _=a.schema,E=e.processors[i.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);E(n,e,_,y)}const v=n._zod.parent;v&&(a.ref||(a.ref=v),Le(v,e,y),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),e.io==="input"&&et(n)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(n).schema}function C8(n,e){var a,l,c,d;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 g=(a=n.metadataRegistry.get(f[0]))==null?void 0:a.id;if(g){const y=r.get(g);if(y&&y!==f[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(g,f[0])}}const i=f=>{var E;const g=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(E=n.external.registry.get(f[0]))==null?void 0:E.id,B=n.external.uri??(J=>J);if(x)return{ref:B(x)};const P=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=P,{defId:P,ref:`${B("__shared")}#/${g}/${P}`}}if(f[1]===t)return{ref:"#"};const v=`#/${g}/`,_=f[1].schema.id??`__schema${n.counter++}`;return{defId:_,ref:v+_}},o=f=>{if(f[1].schema.$ref)return;const g=f[1],{ref:y,defId:v}=i(f);g.def={...g.schema},v&&(g.defId=v);const _=g.schema;for(const E in _)delete _[E];_.$ref=y};if(n.cycles==="throw")for(const f of n.seen.entries()){const g=f[1];if(g.cycle)throw new Error(`Cycle detected: #/${(l=g.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 g=f[1];if(e===f[0]){o(f);continue}if(n.external){const v=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){o(f);continue}}if((d=n.metadataRegistry.get(f[0]))==null?void 0:d.id){o(f);continue}if(g.cycle){o(f);continue}if(g.count>1&&n.reused==="ref"){o(f);continue}}}function T2(n,e){var a,l,c;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const f=n.seen.get(d);if(f.ref===null)return;const g=f.def??f.schema,y={...g},v=f.ref;if(f.ref=null,v){r(v);const E=n.seen.get(v),x=E.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(x)):Object.assign(g,x),Object.assign(g,y),d._zod.parent===v)for(const P in g)P==="$ref"||P==="allOf"||P in y||delete g[P];if(x.$ref&&E.def)for(const P in g)P==="$ref"||P==="allOf"||P in E.def&&JSON.stringify(g[P])===JSON.stringify(E.def[P])&&delete g[P]}const _=d._zod.parent;if(_&&_!==v){r(_);const E=n.seen.get(_);if(E!=null&&E.schema.$ref&&(g.$ref=E.schema.$ref,E.def))for(const x in g)x==="$ref"||x==="allOf"||x in E.def&&JSON.stringify(g[x])===JSON.stringify(E.def[x])&&delete g[x]}n.override({zodSchema:d,jsonSchema:g,path:f.path??[]})};for(const d of[...n.seen.entries()].reverse())r(d[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,(a=n.external)!=null&&a.uri){const d=(l=n.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(d)}Object.assign(i,t.def??t.schema);const o=((c=n.external)==null?void 0:c.defs)??{};for(const d of n.seen.entries()){const f=d[1];f.def&&f.defId&&(o[f.defId]=f.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:_d(e,"input",n.processors),output:_d(e,"output",n.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function et(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 et(r.element,t);if(r.type==="set")return et(r.valueType,t);if(r.type==="lazy")return et(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 et(r.innerType,t);if(r.type==="intersection")return et(r.left,t)||et(r.right,t);if(r.type==="record"||r.type==="map")return et(r.keyType,t)||et(r.valueType,t);if(r.type==="pipe")return et(r.in,t)||et(r.out,t);if(r.type==="object"){for(const i in r.shape)if(et(r.shape[i],t))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(et(i,t))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(et(i,t))return!0;return!!(r.rest&&et(r.rest,t))}return!1}const cx=(n,e={})=>t=>{const r=k2({...t,processors:e});return De(n,r),C2(r,n),T2(r,n)},_d=(n,e,t={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=k2({...i??{},target:o,io:e,processors:t});return De(n,a),C2(a,n),T2(a,n)},ux={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hx=(n,e,t,r)=>{const i=t;i.type="string";const{minimum:o,maximum:a,format:l,patterns:c,contentEncoding:d}=n._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=ux[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),d&&(i.contentEncoding=d),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(g=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},dx=(n,e,t,r)=>{const i=t,{minimum:o,maximum:a,format:l,multipleOf:c,exclusiveMaximum:d,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 o=="number"&&(i.minimum=o,typeof f=="number"&&e.target!=="draft-04"&&(f>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d),typeof a=="number"&&(i.maximum=a,typeof d=="number"&&e.target!=="draft-04"&&(d<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},px=(n,e,t,r)=>{t.type="boolean"},fx=(n,e,t,r)=>{t.not={}},mx=(n,e,t,r)=>{},gx=(n,e,t,r)=>{const i=n._zod.def,o=i2(i.entries);o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),t.enum=o},vx=(n,e,t,r)=>{const i=n._zod.def,o=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];t.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[a]:t.const=a}else o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),o.every(a=>typeof a=="boolean")&&(t.type="boolean"),o.every(a=>a===null)&&(t.type="null"),t.enum=o},yx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bx=(n,e,t,r)=>{const i=t,o=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=De(o.element,e,{...r,path:[...r.path,"items"]})},Sx=(n,e,t,r)=>{var d;const i=t,o=n._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=De(a[f],e,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(f=>{const g=o.shape[f]._zod;return e.io==="input"?g.optin===void 0:g.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((d=o.catchall)==null?void 0:d._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=De(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},_x=(n,e,t,r)=>{const i=n._zod.def,o=i.inclusive===!1,a=i.options.map((l,c)=>De(l,e,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?t.oneOf=a:t.anyOf=a},Ax=(n,e,t,r)=>{const i=n._zod.def,o=De(i.left,e,{...r,path:[...r.path,"allOf",0]}),a=De(i.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];t.allOf=c},Ex=(n,e,t,r)=>{const i=t,o=n._zod.def;i.type="object";const a=o.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(o.mode==="loose"&&c&&c.size>0){const f=De(o.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of c)i.patternProperties[g.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=De(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=De(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const d=a._zod.values;if(d){const f=[...d].filter(g=>typeof g=="string"||typeof g=="number");f.length>0&&(i.required=f)}},kx=(n,e,t,r)=>{const i=n._zod.def,o=De(i.innerType,e,r),a=e.seen.get(n);e.target==="openapi-3.0"?(a.ref=i.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},Cx=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Tx=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},$x=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Rx=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=a},Ix=(n,e,t,r)=>{const i=n._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;De(o,e,r);const a=e.seen.get(n);a.ref=o},xx=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.readOnly=!0},$2=(n,e,t,r)=>{const i=n._zod.def;De(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Px=k("ZodISODateTime",(n,e)=>{D3.init(n,e),Ce.init(n,e)});function Dx(n){return UI(Px,n)}const Lx=k("ZodISODate",(n,e)=>{L3.init(n,e),Ce.init(n,e)});function Mx(n){return ZI(Lx,n)}const Ox=k("ZodISOTime",(n,e)=>{M3.init(n,e),Ce.init(n,e)});function Nx(n){return FI(Ox,n)}const zx=k("ZodISODuration",(n,e)=>{O3.init(n,e),Ce.init(n,e)});function Ux(n){return HI(zx,n)}const R2=(n,e)=>{l2.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>CR(n,t)},flatten:{value:t=>kR(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,_0,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,_0,2)}},isEmpty:{get(){return n.issues.length===0}}})},Ay=k("ZodError",R2),on=k("ZodError",R2,{Parent:Error}),Zx=xg(on),Fx=Pg(on),Hx=zp(on),Vx=Up(on),Bx=RR(on),qx=IR(on),Wx=xR(on),jx=PR(on),Gx=DR(on),Yx=LR(on),Jx=MR(on),Kx=OR(on),ke=k("ZodType",(n,e)=>(Ee.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:_d(n,"input"),output:_d(n,"output")}}),n.toJSONSchema=cx(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...t)=>n.clone(Ji(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)=>Ki(n,t,r),n.brand=()=>n,n.register=(t,r)=>(t.add(n,r),n),n.parse=(t,r)=>Zx(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>Hx(n,t,r),n.parseAsync=async(t,r)=>Fx(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>Vx(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>Bx(n,t,r),n.decode=(t,r)=>qx(n,t,r),n.encodeAsync=async(t,r)=>Wx(n,t,r),n.decodeAsync=async(t,r)=>jx(n,t,r),n.safeEncode=(t,r)=>Gx(n,t,r),n.safeDecode=(t,r)=>Yx(n,t,r),n.safeEncodeAsync=async(t,r)=>Jx(n,t,r),n.safeDecodeAsync=async(t,r)=>Kx(n,t,r),n.refine=(t,r)=>n.check(VP(t,r)),n.superRefine=t=>n.check(BP(t)),n.overwrite=t=>n.check(fl(t)),n.optional=()=>Cy(n),n.exactOptional=()=>IP(n),n.nullable=()=>Ty(n),n.nullish=()=>Cy(Ty(n)),n.nonoptional=t=>OP(n,t),n.array=()=>z(n),n.or=t=>X([n,t]),n.and=t=>Fp(n,t),n.transform=t=>$y(n,$P(t)),n.default=t=>DP(n,t),n.prefault=t=>MP(n,t),n.catch=t=>zP(n,t),n.pipe=t=>$y(n,t),n.readonly=()=>FP(n),n.describe=t=>{const r=n.clone();return Hl.add(r,{description:t}),r},Object.defineProperty(n,"description",{get(){var t;return(t=Hl.get(n))==null?void 0:t.description},configurable:!0}),n.meta=(...t)=>{if(t.length===0)return Hl.get(n);const r=n.clone();return Hl.add(r,t[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=t=>t(n),n)),I2=k("_ZodString",(n,e)=>{Dg.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>hx(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(GI(...r)),n.includes=(...r)=>n.check(KI(...r)),n.startsWith=(...r)=>n.check(XI(...r)),n.endsWith=(...r)=>n.check(QI(...r)),n.min=(...r)=>n.check(Sd(...r)),n.max=(...r)=>n.check(A2(...r)),n.length=(...r)=>n.check(E2(...r)),n.nonempty=(...r)=>n.check(Sd(1,...r)),n.lowercase=r=>n.check(YI(r)),n.uppercase=r=>n.check(JI(r)),n.trim=()=>n.check(tx()),n.normalize=(...r)=>n.check(ex(...r)),n.toLowerCase=()=>n.check(nx()),n.toUpperCase=()=>n.check(rx()),n.slugify=()=>n.check(ix())}),Xx=k("ZodString",(n,e)=>{Dg.init(n,e),I2.init(n,e),n.email=t=>n.check(yI(Qx,t)),n.url=t=>n.check(AI(eP,t)),n.jwt=t=>n.check(zI(mP,t)),n.emoji=t=>n.check(EI(tP,t)),n.guid=t=>n.check(wy(Ey,t)),n.uuid=t=>n.check(wI(ph,t)),n.uuidv4=t=>n.check(bI(ph,t)),n.uuidv6=t=>n.check(SI(ph,t)),n.uuidv7=t=>n.check(_I(ph,t)),n.nanoid=t=>n.check(kI(nP,t)),n.guid=t=>n.check(wy(Ey,t)),n.cuid=t=>n.check(CI(rP,t)),n.cuid2=t=>n.check(TI(iP,t)),n.ulid=t=>n.check($I(sP,t)),n.base64=t=>n.check(MI(dP,t)),n.base64url=t=>n.check(OI(pP,t)),n.xid=t=>n.check(RI(oP,t)),n.ksuid=t=>n.check(II(aP,t)),n.ipv4=t=>n.check(xI(lP,t)),n.ipv6=t=>n.check(PI(cP,t)),n.cidrv4=t=>n.check(DI(uP,t)),n.cidrv6=t=>n.check(LI(hP,t)),n.e164=t=>n.check(NI(fP,t)),n.datetime=t=>n.check(Dx(t)),n.date=t=>n.check(Mx(t)),n.time=t=>n.check(Nx(t)),n.duration=t=>n.check(Ux(t))});function m(n){return vI(Xx,n)}const Ce=k("ZodStringFormat",(n,e)=>{_e.init(n,e),I2.init(n,e)}),Qx=k("ZodEmail",(n,e)=>{E3.init(n,e),Ce.init(n,e)}),Ey=k("ZodGUID",(n,e)=>{_3.init(n,e),Ce.init(n,e)}),ph=k("ZodUUID",(n,e)=>{A3.init(n,e),Ce.init(n,e)}),eP=k("ZodURL",(n,e)=>{k3.init(n,e),Ce.init(n,e)}),tP=k("ZodEmoji",(n,e)=>{C3.init(n,e),Ce.init(n,e)}),nP=k("ZodNanoID",(n,e)=>{T3.init(n,e),Ce.init(n,e)}),rP=k("ZodCUID",(n,e)=>{$3.init(n,e),Ce.init(n,e)}),iP=k("ZodCUID2",(n,e)=>{R3.init(n,e),Ce.init(n,e)}),sP=k("ZodULID",(n,e)=>{I3.init(n,e),Ce.init(n,e)}),oP=k("ZodXID",(n,e)=>{x3.init(n,e),Ce.init(n,e)}),aP=k("ZodKSUID",(n,e)=>{P3.init(n,e),Ce.init(n,e)}),lP=k("ZodIPv4",(n,e)=>{N3.init(n,e),Ce.init(n,e)}),cP=k("ZodIPv6",(n,e)=>{z3.init(n,e),Ce.init(n,e)}),uP=k("ZodCIDRv4",(n,e)=>{U3.init(n,e),Ce.init(n,e)}),hP=k("ZodCIDRv6",(n,e)=>{Z3.init(n,e),Ce.init(n,e)}),dP=k("ZodBase64",(n,e)=>{F3.init(n,e),Ce.init(n,e)}),pP=k("ZodBase64URL",(n,e)=>{V3.init(n,e),Ce.init(n,e)}),fP=k("ZodE164",(n,e)=>{B3.init(n,e),Ce.init(n,e)}),mP=k("ZodJWT",(n,e)=>{W3.init(n,e),Ce.init(n,e)}),x2=k("ZodNumber",(n,e)=>{y2.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>dx(n,r,i),n.gt=(r,i)=>n.check(Sy(r,i)),n.gte=(r,i)=>n.check(Vf(r,i)),n.min=(r,i)=>n.check(Vf(r,i)),n.lt=(r,i)=>n.check(by(r,i)),n.lte=(r,i)=>n.check(Hf(r,i)),n.max=(r,i)=>n.check(Hf(r,i)),n.int=r=>n.check(ky(r)),n.safe=r=>n.check(ky(r)),n.positive=r=>n.check(Sy(0,r)),n.nonnegative=r=>n.check(Vf(0,r)),n.negative=r=>n.check(by(0,r)),n.nonpositive=r=>n.check(Hf(0,r)),n.multipleOf=(r,i)=>n.check(_y(r,i)),n.step=(r,i)=>n.check(_y(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 G(n){return VI(x2,n)}const gP=k("ZodNumberFormat",(n,e)=>{j3.init(n,e),x2.init(n,e)});function ky(n){return BI(gP,n)}const vP=k("ZodBoolean",(n,e)=>{G3.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>px(n,t,r)});function He(n){return qI(vP,n)}const yP=k("ZodUnknown",(n,e)=>{Y3.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mx()});function S(){return WI(yP)}const wP=k("ZodNever",(n,e)=>{J3.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>fx(n,t,r)});function bP(n){return jI(wP,n)}const SP=k("ZodArray",(n,e)=>{K3.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>bx(n,t,r,i),n.element=e.element,n.min=(t,r)=>n.check(Sd(t,r)),n.nonempty=t=>n.check(Sd(1,t)),n.max=(t,r)=>n.check(A2(t,r)),n.length=(t,r)=>n.check(E2(t,r)),n.unwrap=()=>n.element});function z(n,e){return sx(SP,n,e)}const P2=k("ZodObject",(n,e)=>{Q3.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Sx(n,t,r,i),ue(n,"shape",()=>e.shape),n.keyof=()=>M2(Object.keys(n._zod.def.shape)),n.catchall=t=>n.clone({...n._zod.def,catchall:t}),n.passthrough=()=>n.clone({...n._zod.def,catchall:S()}),n.loose=()=>n.clone({...n._zod.def,catchall:S()}),n.strict=()=>n.clone({...n._zod.def,catchall:bP()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>bR(n,t),n.safeExtend=t=>SR(n,t),n.merge=t=>_R(n,t),n.pick=t=>yR(n,t),n.omit=t=>wR(n,t),n.partial=(...t)=>AR(O2,n,t[0]),n.required=(...t)=>ER(N2,n,t[0])});function D2(n,e){const t={type:"object",shape:n??{},...Z(e)};return new P2(t)}function w(n,e){return new P2({type:"object",shape:n,catchall:S(),...Z(e)})}const L2=k("ZodUnion",(n,e)=>{S2.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>_x(n,t,r,i),n.options=e.options});function X(n,e){return new L2({type:"union",options:n,...Z(e)})}const _P=k("ZodDiscriminatedUnion",(n,e)=>{L2.init(n,e),eI.init(n,e)});function AP(n,e,t){return new _P({type:"union",options:e,discriminator:n,...Z(t)})}const EP=k("ZodIntersection",(n,e)=>{tI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ax(n,t,r,i)});function Fp(n,e){return new EP({type:"intersection",left:n,right:e})}const kP=k("ZodRecord",(n,e)=>{nI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ex(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function A(n,e,t){return new kP({type:"record",keyType:n,valueType:e,...Z(t)})}const E0=k("ZodEnum",(n,e)=>{rI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>gx(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 o={};for(const a of r)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new E0({...e,checks:[],...Z(i),entries:o})},n.exclude=(r,i)=>{const o={...e.entries};for(const a of r)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new E0({...e,checks:[],...Z(i),entries:o})}});function M2(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new E0({type:"enum",entries:t,...Z(e)})}const CP=k("ZodLiteral",(n,e)=>{iI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>vx(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 $(n,e){return new CP({type:"literal",values:Array.isArray(n)?n:[n],...Z(e)})}const TP=k("ZodTransform",(n,e)=>{sI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>wx(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new n2(n.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(mc(o,t.value,e));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=n),t.issues.push(mc(a))}};const i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>(t.value=o,t)):(t.value=i,t)}});function $P(n){return new TP({type:"transform",transform:n})}const O2=k("ZodOptional",(n,e)=>{_2.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$2(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Cy(n){return new O2({type:"optional",innerType:n})}const RP=k("ZodExactOptional",(n,e)=>{oI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$2(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function IP(n){return new RP({type:"optional",innerType:n})}const xP=k("ZodNullable",(n,e)=>{aI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>kx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Ty(n){return new xP({type:"nullable",innerType:n})}const PP=k("ZodDefault",(n,e)=>{lI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Tx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function DP(n,e){return new PP({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():o2(e)}})}const LP=k("ZodPrefault",(n,e)=>{cI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$x(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function MP(n,e){return new LP({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():o2(e)}})}const N2=k("ZodNonOptional",(n,e)=>{uI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Cx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function OP(n,e){return new N2({type:"nonoptional",innerType:n,...Z(e)})}const NP=k("ZodCatch",(n,e)=>{hI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Rx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function zP(n,e){return new NP({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const UP=k("ZodPipe",(n,e)=>{dI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ix(n,t,r,i),n.in=e.in,n.out=e.out});function $y(n,e){return new UP({type:"pipe",in:n,out:e})}const ZP=k("ZodReadonly",(n,e)=>{pI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>xx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function FP(n){return new ZP({type:"readonly",innerType:n})}const HP=k("ZodCustom",(n,e)=>{fI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>yx(n,t)});function VP(n,e={}){return ox(HP,n,e)}function BP(n){return ax(n)}const qP=[".md",".markdown"];function z2(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function U2(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function WP(n){return U2(n).toLowerCase()}function jP(n,e){const t=WP(n);return e.some(r=>t.endsWith(r))}function k0(n){return!z2(n)&&jP(n,qP)}function GP(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function fr(n){try{const{pathname:e}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e)}catch{return!1}}const YP=D2({id:m().min(1),kind:$("path"),title:m(),path:m()}).strict(),JP=D2({id:m().min(1),kind:$("url"),title:m(),url:m().refine(GP,{message:"url must be an http(s) URL"})}).strict();AP("kind",[YP,JP]);const KP=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function XP(n,e){try{const t=new URL(e),r=new URL(n,t);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:KP.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Ry(n,e){return XP(n,e).kind==="web"}const QP="/views/markdown/",e5="/views/url-unsupported/";function t5(n){try{const{protocol:e}=new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function Z2(n){return`/artifact/${encodeURIComponent(n)}`}function n5(n,e){return`${Z2(n)}/${encodeURIComponent(e)}`}function r5(n){return`/markdown/${encodeURIComponent(n)}`}function Ad(n,e={electron:!1}){if(n.kind==="url")return e.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:fr(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:e.browserDemo&&t5(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:e5,contentURL:null};if(k0(n.path)){const r={viewURL:QP,contentURL:r5(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=z2(n.path)?`${Z2(n.id)}/`:n5(n.id,U2(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const i5="serverURL",s5="token",o5="mode",a5="desktopAppVersion",l5="electron";function c5(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(i5);return r?new URL(r).origin:new URL(e).origin}function u5(n=window.location.search){return new URLSearchParams(n).get(s5)}function Br(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(o5)===l5}function F2(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(a5)}const Iy="tv.telemetry.clientId",h5=5,d5=60,p5=1e3,f5=h5*d5*p5,xy=["pointerdown","scroll","keydown"],Py=["focus"],Dy=["visibilitychange"],m5="hidden";function g5(n,e=S5){const t=n.getItem(Iy);if(t)return t;const r=e();return n.setItem(Iy,r),r}function v5(n){return{clientId:g5(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function y5(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 w5(n){return new b5(n)}var Ac,wr,ai,Ec,kc,Ft,Ss,Cc,Od,H2;class b5{constructor(e){p(this,Od);p(this,Ac);p(this,wr);p(this,ai);p(this,Ec);p(this,kc);p(this,Ft);p(this,Ss,!1);p(this,Cc,Number.NEGATIVE_INFINITY);h(this,Ac,e.meta),h(this,wr,e.documentTarget),h(this,ai,e.windowTarget),h(this,Ec,e.send),h(this,kc,e.nowMs??Date.now),h(this,Ft,()=>u(this,Od,H2).call(this))}start(){if(!s(this,Ss)){h(this,Ss,!0);for(const e of xy)s(this,ai).addEventListener(e,s(this,Ft)),s(this,wr).addEventListener(e,s(this,Ft));for(const e of Py)s(this,ai).addEventListener(e,s(this,Ft));for(const e of Dy)s(this,wr).addEventListener(e,s(this,Ft))}}stop(){if(s(this,Ss)){h(this,Ss,!1);for(const e of xy)s(this,ai).removeEventListener(e,s(this,Ft)),s(this,wr).removeEventListener(e,s(this,Ft));for(const e of Py)s(this,ai).removeEventListener(e,s(this,Ft));for(const e of Dy)s(this,wr).removeEventListener(e,s(this,Ft))}}}Ac=new WeakMap,wr=new WeakMap,ai=new WeakMap,Ec=new WeakMap,kc=new WeakMap,Ft=new WeakMap,Ss=new WeakMap,Cc=new WeakMap,Od=new WeakSet,H2=function(){if(s(this,wr).visibilityState===m5)return;const e=s(this,kc).call(this);e-s(this,Cc)<f5||(h(this,Cc,e),s(this,Ec).call(this,{type:p$,clientId:s(this,Ac).clientId}))};function S5(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Tg().toLowerCase()}const we={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"},ur={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"},_5=1,A5=w({_meta:A(m(),S()).nullish(),terminal:He().optional().default(!1)}),E5=w({_meta:A(m(),S()).nullish(),label:m().nullish(),name:m(),optional:He().optional().default(!1),secret:He().optional().default(!0)}),k5=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),name:m()}),C5=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),link:m().nullish(),name:m(),vars:z(E5)}),T5=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),description:m().nullish(),env:A(m(),m()).optional(),id:m(),name:m()}),$5=X([C5.and(w({type:$("env_var")})),T5.and(w({type:$("terminal")})),k5]),R5=w({_meta:A(m(),S()).nullish(),methodId:m()}),I5=w({_meta:A(m(),S()).nullish()}),x5=w({_meta:A(m(),S()).nullish(),blob:m(),mimeType:m().nullish(),uri:m()}),P5=w({default:He().nullish(),description:m().nullish(),title:m().nullish()}),D5=w({_meta:A(m(),S()).nullish()}),L5=w({_meta:A(m(),S()).nullish()}),M5=w({amount:G(),currency:m()}),O5=w({_meta:A(m(),S()).nullish(),terminalId:m()}),N5=w({_meta:A(m(),S()).nullish(),newText:m(),oldText:m().nullish(),path:m()}),z5=X([m(),G(),G(),He(),z(m())]),U5=w({content:A(m(),z5).nullish()}),Z5=X([U5.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),F5=w({_meta:A(m(),S()).nullish()}),V2=m(),H5=w({_meta:A(m(),S()).nullish(),elicitationId:V2}),V5=w({_meta:A(m(),S()).nullish(),action:Z5}),B5=$("object"),q5=$("string"),W5=w({_meta:A(m(),S()).nullish()}),j5=w({_meta:A(m(),S()).nullish(),form:F5.nullish(),url:W5.nullish()}),G5=w({elicitationId:V2,url:m().url()}),B2=w({const:m(),title:m()}),q2=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),Y5=X([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),G().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),W2=w({code:Y5,data:S().optional(),message:m()}),j2=S(),G2=S(),Y2=S(),J5=w({_meta:A(m(),S()).nullish(),readTextFile:He().optional().default(!1),writeTextFile:He().optional().default(!1)}),J2=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),K2=w({_meta:A(m(),S()).nullish(),name:m(),title:m().nullish(),version:m()}),K5=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),X5=w({_meta:A(m(),S()).nullish()}),Q5=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cursor:m().nullish(),cwd:m().nullish()}),eD=w({_meta:A(m(),S()).nullish()}),tD=w({_meta:A(m(),S()).nullish(),logout:eD.nullish()}),nD=w({_meta:A(m(),S()).nullish()}),rD=w({_meta:A(m(),S()).nullish()}),iD=w({_meta:A(m(),S()).nullish(),http:He().optional().default(!1),sse:He().optional().default(!1)}),sD=w({_meta:A(m(),S()).nullish(),headers:z(J2),name:m(),url:m()}),oD=w({_meta:A(m(),S()).nullish(),headers:z(J2),name:m(),url:m()}),aD=w({_meta:A(m(),S()).nullish(),args:z(m()),command:m(),env:z(q2),name:m()}),Hp=X([sD.and(w({type:$("http")})),oD.and(w({type:$("sse")})),aD]),Lg=m(),lD=w({_meta:A(m(),S()).nullish(),description:m().nullish(),modelId:Lg,name:m()}),cD=X([$("error"),$("warning"),$("information"),$("hint")]),uD=w({_meta:A(m(),S()).nullish()}),hD=w({_meta:A(m(),S()).nullish()}),dD=w({_meta:A(m(),S()).nullish()}),pD=w({_meta:A(m(),S()).nullish()}),fD=w({_meta:A(m(),S()).nullish()}),mD=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),gD=w({diff:m(),uri:m()}),vD=w({endLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:m()}),yD=w({_meta:A(m(),S()).nullish()}),wD=w({_meta:A(m(),S()).nullish()}),bD=w({languageId:m(),text:m(),uri:m()}),SD=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),_D=X([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),AD=w({excerpts:z(vD),uri:m()}),ED=w({_meta:A(m(),S()).nullish()}),kD=w({_meta:A(m(),S()).nullish()}),CD=w({name:m(),owner:m(),remoteUrl:m()}),TD=w({_meta:A(m(),S()).nullish()}),$D=w({_meta:A(m(),S()).nullish(),jump:yD.nullish(),rename:kD.nullish(),searchAndReplace:TD.nullish()}),RD=w({id:m(),isRegex:He().nullish(),replace:m(),search:m(),uri:m()}),ID=X([$("automatic"),$("diagnostic"),$("manual")]),xD=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),PD=w({_meta:A(m(),S()).nullish(),diagnostics:uD.nullish(),editHistory:mD.nullish(),openFiles:wD.nullish(),recentFiles:SD.nullish(),relatedSnippets:ED.nullish(),userActions:xD.nullish()}),DD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Hp)}),LD=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),X2=m(),MD=X([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),OD=w({_meta:A(m(),S()).nullish(),kind:MD,name:m(),optionId:X2}),ND=X([$("high"),$("medium"),$("low")]),zD=X([$("pending"),$("in_progress"),$("completed")]),UD=w({_meta:A(m(),S()).nullish(),content:m(),priority:ND,status:zD}),ZD=w({_meta:A(m(),S()).nullish(),entries:z(UD)}),Wi=w({character:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),FD=w({id:m(),position:Wi,uri:m()}),HD=w({id:m(),newName:m(),position:Wi,uri:m()}),VD=w({action:m(),position:Wi,timestampMs:G(),uri:m()}),Q2=X([$("utf-16"),$("utf-32"),$("utf-8")]),BD=w({_meta:A(m(),S()).nullish(),auth:A5.optional().default({terminal:!1}),elicitation:j5.nullish(),fs:J5.optional().default({readTextFile:!1,writeTextFile:!1}),nes:$D.nullish(),positionEncodings:z(Q2).optional(),terminal:He().optional().default(!1)}),qD=w({_meta:A(m(),S()).nullish(),audio:He().optional().default(!1),embeddedContext:He().optional().default(!1),image:He().optional().default(!1)}),e8=G().int().gte(0).lte(65535),WD=w({_meta:A(m(),S()).nullish(),clientCapabilities:BD.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:K2.nullish(),protocolVersion:e8}),ml=w({end:Wi,start:Wi}),jD=w({message:m(),range:ml,severity:cD,uri:m()}),GD=w({languageId:m(),lastFocusedMs:G().nullish(),uri:m(),visibleRange:ml.nullish()}),YD=w({_meta:A(m(),S()).nullish(),diagnostics:z(jD).nullish(),editHistory:z(gD).nullish(),openFiles:z(GD).nullish(),recentFiles:z(bD).nullish(),relatedSnippets:z(AD).nullish(),userActions:z(VD).nullish()}),JD=w({newText:m(),range:ml}),KD=w({cursorPosition:Wi.nullish(),edits:z(JD),id:m(),uri:m()}),XD=X([KD.and(w({kind:$("edit")})),FD.and(w({kind:$("jump")})),HD.and(w({kind:$("rename")})),RD.and(w({kind:$("searchAndReplace")}))]),QD=w({_meta:A(m(),S()).nullish(),content:m()}),eL=w({_meta:A(m(),S()).nullish()}),ho=X([G(),m()]).nullable();w({_meta:A(m(),S()).nullish(),requestId:ho});const tL=M2(["assistant","user"]),Vu=w({_meta:A(m(),S()).nullish(),audience:z(tL).nullish(),lastModified:m().nullish(),priority:G().nullish()}),nL=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),data:m(),mimeType:m()}),rL=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),data:m(),mimeType:m(),uri:m().nullish()}),iL=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),description:m().nullish(),mimeType:m().nullish(),name:m(),size:G().nullish(),title:m().nullish(),uri:m()}),sL=w({_meta:A(m(),S()).nullish(),optionId:X2}),oL=X([w({outcome:$("cancelled")}),sL.and(w({outcome:$("selected")}))]),aL=w({_meta:A(m(),S()).nullish(),outcome:oL}),lL=w({_meta:A(m(),S()).nullish()}),cL=w({_meta:A(m(),S()).nullish()}),uL=w({currentValue:He()}),hL=m(),t8=m(),dL=X([$("mode"),$("model"),$("thought_level"),m()]),Mg=m(),n8=w({_meta:A(m(),S()).nullish(),description:m().nullish(),name:m(),value:Mg}),pL=w({_meta:A(m(),S()).nullish(),group:hL,name:m(),options:z(n8)}),fL=X([z(n8),z(pL)]),mL=w({currentValue:Mg,options:fL}),gl=Fp(X([mL.and(w({type:$("select")})),uL.and(w({type:$("boolean")}))]),w({_meta:A(m(),S()).nullish(),category:dL.nullish(),description:m().nullish(),id:t8,name:m()})),gL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),vL=w({_meta:A(m(),S()).nullish()}),ae=m(),yL=w({_meta:A(m(),S()).nullish(),id:m(),sessionId:ae}),wL=w({_meta:A(m(),S()).nullish(),sessionId:ae}),bL=w({_meta:A(m(),S()).nullish(),sessionId:ae}),SL=w({_meta:A(m(),S()).nullish(),sessionId:ae}),r8=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),command:m(),cwd:m().nullish(),env:z(q2).optional(),outputByteLimit:G().nullish(),sessionId:ae}),_L=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),AL=w({_meta:A(m(),S()).nullish(),position:Wi,sessionId:ae,uri:m(),version:G(),visibleRange:ml}),EL=w({_meta:A(m(),S()).nullish(),languageId:m(),sessionId:ae,text:m(),uri:m(),version:G()}),kL=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),CL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Hp).optional(),sessionId:ae}),i8=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),TL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Hp),sessionId:ae}),s8=w({_meta:A(m(),S()).nullish(),limit:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m(),sessionId:ae}),$L=w({_meta:A(m(),S()).nullish(),id:m(),reason:_D.nullish(),sessionId:ae}),o8=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),RL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Hp).optional(),sessionId:ae}),IL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),sessionId:ae,title:m().nullish(),updatedAt:m().nullish()}),xL=w({_meta:A(m(),S()).nullish(),nextCursor:m().nullish(),sessions:z(IL)}),PL=w({_meta:A(m(),S()).nullish(),title:m().nullish(),updatedAt:m().nullish()}),DL=w({_meta:A(m(),S()).nullish()}),Vp=m(),LL=w({_meta:A(m(),S()).nullish(),currentModeId:Vp}),ML=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:Vp,name:m()}),Bp=w({_meta:A(m(),S()).nullish(),availableModes:z(ML),currentModeId:Vp}),qp=w({_meta:A(m(),S()).nullish(),availableModels:z(lD),currentModelId:Lg}),OL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),NL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),zL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),UL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),ZL=w({_meta:A(m(),S()).nullish()}),FL=w({_meta:A(m(),S()).nullish(),additionalDirectories:lL.nullish(),close:cL.nullish(),fork:vL.nullish(),list:DL.nullish(),resume:ZL.nullish()}),HL=Fp(X([w({type:$("boolean"),value:He()}),w({value:Mg})]),w({_meta:A(m(),S()).nullish(),configId:t8,sessionId:ae})),VL=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),BL=w({_meta:A(m(),S()).nullish(),modeId:Vp,sessionId:ae}),qL=w({_meta:A(m(),S()).nullish()}),WL=w({_meta:A(m(),S()).nullish(),modelId:Lg,sessionId:ae}),jL=w({_meta:A(m(),S()).nullish()}),GL=w({_meta:A(m(),S()).nullish(),sessionId:ae}),YL=X([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),JL=X([$("email"),$("uri"),$("date"),$("date-time")]),KL=w({default:m().nullish(),description:m().nullish(),enum:z(m()).nullish(),format:JL.nullish(),maxLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(B2).nullish(),pattern:m().nullish(),title:m().nullish()}),XL=w({_meta:A(m(),S()).nullish(),context:YD.nullish(),position:Wi,selection:ml.nullish(),sessionId:ae,triggerKind:ID,uri:m(),version:G()}),QL=w({_meta:A(m(),S()).nullish(),suggestions:z(XD)}),eM=w({_meta:A(m(),S()).nullish(),terminalId:m()}),tM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),a8=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),nM=w({_meta:A(m(),S()).nullish(),exitStatus:tM.nullish(),output:m(),truncated:He()}),rM=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),text:m()}),iM=w({range:ml.nullish(),text:m()}),sM=w({_meta:A(m(),S()).nullish(),contentChanges:z(iM),sessionId:ae,uri:m(),version:G()});w({method:m(),params:X([wL,EL,sM,_L,kL,AL,yL,$L,j2]).nullish()});const oM=X([$("full"),$("incremental")]),aM=w({_meta:A(m(),S()).nullish(),syncKind:oM}),lM=w({_meta:A(m(),S()).nullish(),didChange:aM.nullish(),didClose:hD.nullish(),didFocus:dD.nullish(),didOpen:pD.nullish(),didSave:fD.nullish()}),cM=w({_meta:A(m(),S()).nullish(),document:lM.nullish()}),uM=w({_meta:A(m(),S()).nullish(),context:PD.nullish(),events:cM.nullish()}),hM=w({_meta:A(m(),S()).nullish(),auth:tD.optional().default({}),loadSession:He().optional().default(!1),mcpCapabilities:iD.optional().default({http:!1,sse:!1}),nes:uM.nullish(),positionEncoding:Q2.nullish(),promptCapabilities:qD.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:FL.optional().default({})}),dM=w({_meta:A(m(),S()).nullish(),agentCapabilities:hM.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:K2.nullish(),authMethods:z($5).optional().default([]),protocolVersion:e8}),pM=w({_meta:A(m(),S()).nullish(),mimeType:m().nullish(),text:m(),uri:m()}),fM=X([pM,x5]),mM=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),resource:fM}),Og=X([rM.and(w({type:$("text")})),rL.and(w({type:$("image")})),nL.and(w({type:$("audio")})),iL.and(w({type:$("resource_link")})),mM.and(w({type:$("resource")}))]),gM=w({_meta:A(m(),S()).nullish(),content:Og}),Bf=w({_meta:A(m(),S()).nullish(),content:Og,messageId:m().nullish()}),vM=w({_meta:A(m(),S()).nullish(),messageId:m().nullish(),prompt:z(Og),sessionId:ae}),yM=w({anyOf:z(B2)}),l8=X([gM.and(w({type:$("content")})),N5.and(w({type:$("diff")})),eM.and(w({type:$("terminal")}))]),c8=m(),u8=w({_meta:A(m(),S()).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m()}),h8=X([$("pending"),$("in_progress"),$("completed"),$("failed")]),d8=X([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),wM=w({_meta:A(m(),S()).nullish(),content:z(l8).optional(),kind:d8.optional(),locations:z(u8).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:h8.optional(),title:m(),toolCallId:c8}),p8=w({_meta:A(m(),S()).nullish(),content:z(l8).nullish(),kind:d8.nullish(),locations:z(u8).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:h8.nullish(),title:m().nullish(),toolCallId:c8}),f8=w({_meta:A(m(),S()).nullish(),options:z(OD),sessionId:ae,toolCall:p8}),bM=w({_meta:A(m(),S()).nullish(),hint:m()}),SM=bM,_M=w({_meta:A(m(),S()).nullish(),description:m(),input:SM.nullish(),name:m()}),AM=w({_meta:A(m(),S()).nullish(),availableCommands:z(_M)}),EM=w({enum:z(m()),type:q5}),kM=X([EM,yM]),CM=w({default:z(m()).nullish(),description:m().nullish(),items:kM,maxItems:G().nullish(),minItems:G().nullish(),title:m().nullish()}),TM=X([KL.and(w({type:$("string")})),LD.and(w({type:$("number")})),K5.and(w({type:$("integer")})),P5.and(w({type:$("boolean")})),CM.and(w({type:$("array")}))]),$M=w({description:m().nullish(),properties:A(m(),TM).optional().default({}),required:z(m()).nullish(),title:m().nullish(),type:B5.optional().default("object")}),RM=w({requestedSchema:$M}),IM=Fp(X([RM.and(w({mode:$("form")})),G5.and(w({mode:$("url")}))]),w({_meta:A(m(),S()).nullish(),message:m(),sessionId:ae})),xM=w({cachedReadTokens:G().nullish(),cachedWriteTokens:G().nullish(),inputTokens:G(),outputTokens:G(),thoughtTokens:G().nullish(),totalTokens:G()}),PM=w({_meta:A(m(),S()).nullish(),stopReason:YL,usage:xM.nullish(),userMessageId:m().nullish()});X([w({id:ho,result:X([dM,I5,rD,zL,NL,xL,OL,UL,L5,qL,VL,PM,jL,GL,QL,D5,Y2])}),w({error:W2,id:ho})]);const DM=w({_meta:A(m(),S()).nullish(),cost:M5.nullish(),size:G(),used:G()}),LM=X([Bf.and(w({sessionUpdate:$("user_message_chunk")})),Bf.and(w({sessionUpdate:$("agent_message_chunk")})),Bf.and(w({sessionUpdate:$("agent_thought_chunk")})),wM.and(w({sessionUpdate:$("tool_call")})),p8.and(w({sessionUpdate:$("tool_call_update")})),ZD.and(w({sessionUpdate:$("plan")})),AM.and(w({sessionUpdate:$("available_commands_update")})),LL.and(w({sessionUpdate:$("current_mode_update")})),gL.and(w({sessionUpdate:$("config_option_update")})),PL.and(w({sessionUpdate:$("session_info_update")})),DM.and(w({sessionUpdate:$("usage_update")}))]),m8=w({_meta:A(m(),S()).nullish(),sessionId:ae,update:LM});w({method:m(),params:X([m8,H5,j2]).nullish()});const g8=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),MM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),OM=w({name:m(),uri:m()}),NM=w({_meta:A(m(),S()).nullish(),repository:CD.nullish(),workspaceFolders:z(OM).nullish(),workspaceUri:m().nullish()});w({id:ho,method:m(),params:X([WD,R5,nD,DD,TL,Q5,CL,RL,SL,BL,HL,vM,WL,NM,XL,bL,G2]).nullish()});const v8=w({_meta:A(m(),S()).nullish(),content:m(),path:m(),sessionId:ae});w({id:ho,method:m(),params:X([v8,s8,f8,r8,a8,o8,g8,i8,IM,G2]).nullish()});const zM=w({_meta:A(m(),S()).nullish()});X([w({id:ho,result:X([zM,QD,aL,O5,nM,eL,MM,X5,V5,Y2])}),w({error:W2,id:ho})]);var oe;class UM{constructor(e,t){p(this,oe);const r=e(this),i=async(a,l)=>{var c,d,f,g,y,v,_;switch(a){case ur.fs_write_text_file:{const E=v8.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,E)}case ur.fs_read_text_file:{const E=s8.parse(l);return(d=r.readTextFile)==null?void 0:d.call(r,E)}case ur.session_request_permission:{const E=f8.parse(l);return r.requestPermission(E)}case ur.terminal_create:{const E=r8.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,E)}case ur.terminal_output:{const E=a8.parse(l);return(g=r.terminalOutput)==null?void 0:g.call(r,E)}case ur.terminal_release:{const E=o8.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,E))??{}}case ur.terminal_wait_for_exit:{const E=g8.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,E)}case ur.terminal_kill:{const E=i8.parse(l);return await((_=r.killTerminal)==null?void 0:_.call(r,E))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw Oe.methodNotFound(a)}},o=async(a,l)=>{switch(a){case ur.session_update:{const c=m8.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Oe.methodNotFound(a)}};h(this,oe,new ZM(i,o,t))}async initialize(e){return await s(this,oe).sendRequest(we.initialize,e)}async newSession(e){return await s(this,oe).sendRequest(we.session_new,e)}async loadSession(e){return await s(this,oe).sendRequest(we.session_load,e)??{}}async unstable_forkSession(e){return await s(this,oe).sendRequest(we.session_fork,e)}async listSessions(e){return await s(this,oe).sendRequest(we.session_list,e)}async unstable_resumeSession(e){return await s(this,oe).sendRequest(we.session_resume,e)}async unstable_closeSession(e){return await s(this,oe).sendRequest(we.session_close,e)}async setSessionMode(e){return await s(this,oe).sendRequest(we.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await s(this,oe).sendRequest(we.session_set_model,e)??{}}async setSessionConfigOption(e){return await s(this,oe).sendRequest(we.session_set_config_option,e)}async authenticate(e){return await s(this,oe).sendRequest(we.authenticate,e)??{}}async unstable_logout(e){return await s(this,oe).sendRequest(we.logout,e)??{}}async prompt(e){return await s(this,oe).sendRequest(we.session_prompt,e)}async cancel(e){return await s(this,oe).sendNotification(we.session_cancel,e)}async unstable_startNes(e){return await s(this,oe).sendRequest(we.nes_start,e)}async unstable_suggestNes(e){return await s(this,oe).sendRequest(we.nes_suggest,e)}async unstable_closeNes(e){return await s(this,oe).sendRequest(we.nes_close,e)??{}}async unstable_didOpenDocument(e){return await s(this,oe).sendNotification(we.document_did_open,e)}async unstable_didChangeDocument(e){return await s(this,oe).sendNotification(we.document_did_change,e)}async unstable_didCloseDocument(e){return await s(this,oe).sendNotification(we.document_did_close,e)}async unstable_didSaveDocument(e){return await s(this,oe).sendNotification(we.document_did_save,e)}async unstable_didFocusDocument(e){return await s(this,oe).sendNotification(we.document_did_focus,e)}async unstable_acceptNes(e){return await s(this,oe).sendNotification(we.nes_accept,e)}async unstable_rejectNes(e){return await s(this,oe).sendNotification(we.nes_reject,e)}async extMethod(e,t){return await s(this,oe).sendRequest(e,t)}async extNotification(e,t){return await s(this,oe).sendNotification(e,t)}get signal(){return s(this,oe).signal}get closed(){return s(this,oe).closed}}oe=new WeakMap;var li,Nd,Tc,$c,ta,na,xn,Rc,Ae,y8,C0,w8,b8,S8,_8,T0,Vl;class ZM{constructor(e,t,r){p(this,Ae);p(this,li,new Map);p(this,Nd,0);p(this,Tc);p(this,$c);p(this,ta);p(this,na,Promise.resolve());p(this,xn,new AbortController);p(this,Rc);h(this,Tc,e),h(this,$c,t),h(this,ta,r),h(this,Rc,new Promise(i=>{s(this,xn).signal.addEventListener("abort",()=>i())})),u(this,Ae,y8).call(this)}get signal(){return s(this,xn).signal}get closed(){return s(this,Rc)}async sendRequest(e,t){u(this,Ae,T0).call(this);const r=nh(this,Nd)._++,i=new Promise((o,a)=>{s(this,li).set(r,{resolve:o,reject:a})});return await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:r,method:e,params:t}),i}async sendNotification(e,t){u(this,Ae,T0).call(this),await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",method:e,params:t})}}li=new WeakMap,Nd=new WeakMap,Tc=new WeakMap,$c=new WeakMap,ta=new WeakMap,na=new WeakMap,xn=new WeakMap,Rc=new WeakMap,Ae=new WeakSet,y8=async function(){let e;try{const t=s(this,ta).readable.getReader();try{for(;!s(this,xn).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{u(this,Ae,w8).call(this,r)}catch(o){console.error("Unexpected error during message processing:",r,o),"id"in r&&r.id!==void 0&&u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{t.releaseLock()}}catch(t){e=t}finally{u(this,Ae,C0).call(this,e)}},C0=function(e){if(s(this,xn).signal.aborted)return;const t=e??new Error("ACP connection closed");for(const r of s(this,li).values())r.reject(t);s(this,li).clear(),s(this,xn).abort(t)},w8=async function(e){if("method"in e&&"id"in e){const t=await u(this,Ae,b8).call(this,e.method,e.params);"error"in t&&console.error("Error handling request",e,t.error),await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:e.id,...t})}else if("method"in e){const t=await u(this,Ae,S8).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?u(this,Ae,_8).call(this,e):console.error("Invalid message",{message:e})},b8=async function(e,t){try{return{result:await s(this,Tc).call(this,e,t)??null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof Ay)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},S8=async function(e,t){try{return await s(this,$c).call(this,e,t),{result:null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof Ay)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},_8=function(e){const t=s(this,li).get(e.id);if(t){if("result"in e)t.resolve(e.result);else if("error"in e){const{code:r,message:i,data:o}=e.error;t.reject(new Oe(r,i,o))}s(this,li).delete(e.id)}else console.error("Got response to unknown request",e.id)},T0=function(){if(s(this,xn).signal.aborted)throw s(this,xn).signal.reason??new Error("ACP connection closed")},Vl=async function(e){return h(this,na,s(this,na).then(async()=>{const t=s(this,ta).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{u(this,Ae,C0).call(this,t)})),s(this,na)};class Oe extends Error{constructor(t,r,i){super(r);C(this,"code");C(this,"data");this.code=t,this.name="RequestError",this.data=i}static parseError(t,r){return new Oe(-32700,`Parse error${r?`: ${r}`:""}`,t)}static invalidRequest(t,r){return new Oe(-32600,`Invalid request${r?`: ${r}`:""}`,t)}static methodNotFound(t){return new Oe(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,r){return new Oe(-32602,`Invalid params${r?`: ${r}`:""}`,t)}static internalError(t,r){return new Oe(-32603,`Internal error${r?`: ${r}`:""}`,t)}static authRequired(t,r){return new Oe(-32e3,`Authentication required${r?`: ${r}`:""}`,t)}static resourceNotFound(t){return new Oe(-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 FM(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function A8(n){var t;class e extends n{constructor(...o){super(...o);p(this,t,!1);FM(this,()=>s(this,t),()=>{h(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,t)}}return t=new WeakMap,e}const HM=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,VM=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,BM=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,qM=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,WM=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,jM="single_session",GM={name:"television-acp-client",version:"0.0.0"},E8="agent:main:television",YM=A8(Kr);var ra,Pn,Rt,Dn,ci,ln,br,Ln,Mn,ui,cn,ia,sa,On,tt,Sr,oa,_s,_r,hi,Ic,un,Nn,zd,zn,R,$0,k8,C8,T8,Lh,$8,R8,I8,x8,P8,D8,L8,rs,Do,Lo,dr,M8,Mo,R0,I0,Mh,O8,Oh,x0,P0,xc,Pc,Nh,Oo,D0,N8;class JM extends YM{constructor(t){super();p(this,R);p(this,ra,"disconnected");p(this,Pn,null);p(this,Rt,new Map);p(this,Dn,null);p(this,ci,null);p(this,ln,null);p(this,br,null);p(this,Ln,null);p(this,Mn,null);p(this,ui);p(this,cn,null);p(this,ia,0);p(this,sa,1);p(this,On,null);p(this,tt,null);p(this,Sr,!1);p(this,oa,!1);p(this,_s,!1);p(this,_r,null);p(this,hi,new Set);p(this,Ic);p(this,un);p(this,Nn);p(this,zd,t=>{u(this,R,C8).call(this,t)});p(this,zn,null);p(this,xc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket closed")});p(this,Pc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket error")});h(this,un,t),h(this,Nn,t.sessionMode??jM),h(this,ui,t.mappedSessionStore??KM()),h(this,Ic,t.createSocket??(r=>new WebSocket(r)))}get status(){return s(this,ra)}get messages(){return[...s(this,Rt).values()]}get enabled(){return s(this,un).enabled??!1}setToken(t){s(this,un).token=t??""}setEnabled(t){s(this,un).enabled=t,t||(u(this,R,Nh).call(this),h(this,Pn,null),u(this,R,dr).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){s(this,ci)===null&&(h(this,Pn,null),h(this,ci,u(this,R,k8).call(this)));try{await s(this,ci),await u(this,R,Lh).call(this)}catch(t){throw u(this,R,Oo).call(this,qf(t)),t}}}dispose(){u(this,R,Nh).call(this),h(this,Pn,null),u(this,R,dr).call(this,"disposed")}async sendMessage(t){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,$0).call(this,"ready")),(s(this,Ln)===null||s(this,cn)!==u(this,R,Oh).call(this))&&await u(this,R,Lh).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");u(this,R,Do).call(this,{id:u(this,R,Mo).call(this,"user"),kind:"user",text:r,status:"final"}),u(this,R,dr).call(this,"running");try{const i=await u(this,R,Mh).call(this).prompt({sessionId:u(this,R,I0).call(this),prompt:[{type:"text",text:u(this,R,M8).call(this,r)}]});u(this,R,rs).call(this,i.stopReason==="cancelled"?"cancelled":"final"),u(this,R,dr).call(this,"ready")}catch(i){throw u(this,R,N8).call(this)||(u(this,R,rs).call(this,"error"),u(this,R,dr).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,$0).call(this,"ready"));const t=u(this,R,Oh).call(this);((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="mapped"?s(this,ui).clearActualSessionId(t):h(this,ia,s(this,ia)+1),h(this,ln,null),h(this,br,null),h(this,Ln,null),h(this,cn,null),u(this,R,D0).call(this)}async cancel(){this.status==="running"&&(u(this,R,dr).call(this,"cancelling"),await u(this,R,Mh).call(this).cancel({sessionId:u(this,R,I0).call(this)}))}setChannelContext(t){var o,a,l;if(t===null){if(s(this,tt)===null)return;h(this,tt,null),h(this,Sr,!1);return}const r={channelID:t.channelID,channelName:t.channelName};if(((o=s(this,tt))==null?void 0:o.channelID)===r.channelID&&((a=s(this,tt))==null?void 0:a.channelName)===r.channelName)return;const i=((l=s(this,tt))==null?void 0:l.channelID)??null;if(h(this,tt,r),s(this,Nn)==="single_session"){(!s(this,cn)||i!==r.channelID)&&h(this,Sr,!0);return}s(this,cn)!==u(this,R,x0).call(this,r.channelID)&&(h(this,ln,null),h(this,br,null),s(this,Dn)&&this.status==="ready"&&u(this,R,Lh).call(this).catch(c=>{u(this,R,Oo).call(this,qf(c))}))}}ra=new WeakMap,Pn=new WeakMap,Rt=new WeakMap,Dn=new WeakMap,ci=new WeakMap,ln=new WeakMap,br=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,ui=new WeakMap,cn=new WeakMap,ia=new WeakMap,sa=new WeakMap,On=new WeakMap,tt=new WeakMap,Sr=new WeakMap,oa=new WeakMap,_s=new WeakMap,_r=new WeakMap,hi=new WeakMap,Ic=new WeakMap,un=new WeakMap,Nn=new WeakMap,zd=new WeakMap,zn=new WeakMap,R=new WeakSet,$0=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(s(this,Pn)??"ACPClient is disconnected");await new Promise((r,i)=>{const o=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===t){o(),r();return}if(this.status==="disposed"){o(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(o(),i(new Error(s(this,Pn)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},k8=async function(){try{const{stream:t,socket:r,metadata:i}=await tO({serverURL:s(this,un).serverURL,token:s(this,un).token,createSocket:s(this,Ic),onDisconnect:s(this,zd)});h(this,Mn,i),h(this,zn,r),r.addEventListener("close",s(this,xc)),r.addEventListener("error",s(this,Pc)),h(this,Dn,new UM(o=>({connection:o,sessionUpdate:async a=>{await u(this,R,R8).call(this,a)},requestPermission:async a=>u(this,R,I8).call(this,a)}),t)),await s(this,Dn).initialize({protocolVersion:_5,clientCapabilities:{},clientInfo:GM})}catch(t){throw t}},C8=function(t){u(this,R,Oo).call(this,qf(t))},T8=function(t){const r=t==null?void 0:t.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(o=>o.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},Lh=async function(){const t=u(this,R,Oh).call(this);if(s(this,ln)&&s(this,br)===t){await s(this,ln);return}h(this,br,t),h(this,ln,u(this,R,$8).call(this,t)),await s(this,ln)},$8=async function(t){var c;const r=u(this,R,Mh).call(this);u(this,R,D0).call(this);let i,o=!1,a=null;const l={cwd:u(this,R,O8).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(h(this,_s,!0),h(this,_r,null),((c=s(this,Mn))==null?void 0:c.sessionIdStrategy)==="mapped"){const d=s(this,ui).getActualSessionId(t);if(d)try{const f=await r.loadSession({...l,sessionId:d});if(XM(f))throw new Error("Mapped ACP session was not found");a=f,i=d,o=!0}catch{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}else{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}}else try{a=await r.loadSession({...l,sessionId:t}),i=t,o=s(this,Rt).size>0}catch{const d=await r.newSession(l);a=d,i=d.sessionId,o=!1}}finally{h(this,_s,!1),h(this,_r,null),u(this,R,rs).call(this,"final")}u(this,R,T8).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),h(this,Ln,i),h(this,cn,t),h(this,oa,!0),o?(s(this,hi).add(t),s(this,Nn)==="single_session"&&h(this,Sr,!1)):(s(this,hi).delete(t),h(this,Sr,s(this,Nn)==="single_session")),h(this,Pn,null),u(this,R,dr).call(this,"ready")},R8=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&u(this,R,L8).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&u(this,R,x8).call(this,r.content.text);return;case"tool_call":u(this,R,P8).call(this,r);return;case"tool_call_update":u(this,R,D8).call(this,r);return;case"agent_thought_chunk":return;default:return}},I8=async function(t){return{outcome:{outcome:"cancelled"}}},x8=function(t){h(this,_r,null);const r=eO(t);if(!r)return;if(!s(this,On)){const o={id:u(this,R,Mo).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};h(this,On,o.id),u(this,R,Do).call(this,o);return}const i=s(this,Rt).get(s(this,On));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");u(this,R,Lo).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},P8=function(t){u(this,R,rs).call(this,"final");const r=u(this,R,R0).call(this,t.toolCallId),i=My("content"in t?t.content:void 0),o={id:(r==null?void 0:r.id)??u(this,R,Mo).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){u(this,R,Lo).call(this,o);return}u(this,R,Do).call(this,o)},D8=function(t){const r=u(this,R,R0).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",o=My(t.content),a=o?`${i}${o}`:i,l={id:(r==null?void 0:r.id)??u(this,R,Mo).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:a,locations:t.locations??(r==null?void 0:r.locations)};if(r){u(this,R,Lo).call(this,l);return}u(this,R,Do).call(this,l)},L8=function(t){if(u(this,R,rs).call(this,"final"),!t)return;const r=s(this,_s)?s(this,_r):null;if(!r){const o=Ly(t);if(!o)return;const a={id:u(this,R,Mo).call(this,"user"),kind:"user",text:o,status:"final"};u(this,R,Do).call(this,a),s(this,_s)&&h(this,_r,a.id);return}const i=s(this,Rt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");u(this,R,Lo).call(this,{...i,text:Ly(`${i.text}${t}`)})},rs=function(t){if(!s(this,On))return;const r=s(this,Rt).get(s(this,On));(r==null?void 0:r.kind)==="assistant"&&u(this,R,Lo).call(this,{...r,status:t}),h(this,On,null)},Do=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Ff("messages-changed"))},Lo=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Ff("messages-changed"))},dr=function(t){s(this,ra)!==t&&(h(this,ra,t),this.dispatchEvent(new sR("status-changed")))},M8=function(t){const r=s(this,cn);if(!r)return t;const i=s(this,tt)?s(this,Nn)==="single_session"?s(this,Sr)||!s(this,hi).has(r):!s(this,hi).has(r):!1,o=s(this,oa)&&(s(this,tt)!==null||qM.test(t));if(!(o||i))return t;o&&h(this,oa,!1),i&&(h(this,Sr,!1),s(this,hi).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 s(this,tt)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${s(this,tt).channelID}`),l.push(`channel_name: ${s(this,tt).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
- `)},Mo=function(t){const r=`${t}-${s(this,sa)}`;return h(this,sa,s(this,sa)+1),r},R0=function(t){for(const r of s(this,Rt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===t)return r;return null},I0=function(){if(!s(this,Ln))throw new Error("ACP session is not ready");return s(this,Ln)},Mh=function(){if(!s(this,Dn))throw new Error("ACP connection is not ready");return s(this,Dn)},O8=function(){var r;const t=(r=s(this,Mn))==null?void 0:r.sessionCwd;if(!t)throw new Error("ACP bridge session cwd is not ready");return t},Oh=function(){var r;if(s(this,Nn)==="single_session")return u(this,R,P0).call(this,`${E8}-${(s(this,un).clientGUID??"default-client").toLowerCase()}`);const t=(r=s(this,tt))==null?void 0:r.channelID;if(!t)throw new Error("Channel context is required for per-channel session mode");return u(this,R,x0).call(this,t)},x0=function(t){return u(this,R,P0).call(this,QM(s(this,Nn),t,s(this,un).clientGUID??"default-client"))},P0=function(t){var r;return((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&s(this,ia)>0?`${t}:epoch-${s(this,ia)}`:t},xc=new WeakMap,Pc=new WeakMap,Nh=function(){h(this,Dn,null),h(this,ci,null),h(this,ln,null),h(this,br,null),h(this,Ln,null),h(this,cn,null),h(this,Mn,null),s(this,zn)&&(s(this,zn).removeEventListener("close",s(this,xc)),s(this,zn).removeEventListener("error",s(this,Pc)),s(this,zn).close(),h(this,zn,null))},Oo=function(t){const r=s(this,Dn)!==null||s(this,ci)!==null||s(this,ln)!==null||s(this,br)!==null||s(this,Ln)!==null||s(this,cn)!==null||s(this,Mn)!==null||s(this,zn)!==null;this.disposed||this.status==="disconnected"&&!r||(u(this,R,rs).call(this,"error"),u(this,R,Nh).call(this),h(this,Pn,t??null),u(this,R,dr).call(this,"disconnected"))},D0=function(){const t=s(this,Rt).size>0;h(this,On,null),h(this,_r,null),h(this,sa,1),s(this,Rt).clear(),t&&this.dispatchEvent(new Ff("messages-changed"))},N8=function(){return this.status==="disconnected"};function KM(){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 XM(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function QM(n,e,t){return n==="single_session"?`${E8}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function z8(n){return n.replace(/^(?:\s*\n)+/,"")}function Ly(n){let e=n;return e=e.replace(HM,""),e=e.replace(VM,""),e=e.replace(BM,""),e=z8(e),e}function eO(n){let e=n;return e=e.replace(WM,""),e=z8(e),e}function My(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function tO(n){const e=n.createSocket(iO(n.serverURL,n.token));let t=!1,r,i;const o=new Promise((d,f)=>{r=d,i=f}),a=new ReadableStream({start(d){let f=!1;const g=()=>{e.send(JSON.stringify({type:"acp-bridge-connect"}))},y=E=>{const x=rO(E);if(!x)return;let B;try{B=JSON.parse(x)}catch(P){const J=P instanceof Error?P:new Error(String(P));i(J),d.error(J);return}switch(B.type){case"acp-bridge-status":if(B.status==="ready"){let P;try{P=nO(B)}catch(J){const O=J instanceof Error?J:new Error(String(J));t||i(O),d.error(O);return}t||(t=!0,r(P));return}if(B.status==="error"||B.status==="exited"){const P=new Error(B.error??`ACP bridge ${B.status}`);t||i(P),d.error(P)}return;case"acp-bridge-message":d.enqueue(B.message);return}},v=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket closed");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.close()},_=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket error");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.error(E)};e.addEventListener("open",g),e.addEventListener("message",y),e.addEventListener("close",v),e.addEventListener("error",_)}}),l=new WritableStream({async write(d){await o,e.send(JSON.stringify({type:"acp-bridge-message",message:d}))},close(){e.close()},abort(){e.close()}}),c=await o;return{stream:{readable:a,writable:l},socket:e,metadata:c}}function nO(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 rO(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 iO(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 qf(n){return n instanceof Error?n.message:String(n)}const Oy="television.acpClientGUID",Ny="television.acpMappedSessions",zy=1;var aa;class sO{constructor(){p(this,aa,new Map)}getActualSessionId(e){return s(this,aa).get(e)??null}setActualSessionId(e,t){s(this,aa).set(e,t)}clearActualSessionId(e){s(this,aa).delete(e)}}aa=new WeakMap;var la,Dc,Mt,zh,Uh,L0;class oO{constructor(e,t){p(this,Mt);p(this,la);p(this,Dc);h(this,la,e),h(this,Dc,t)}getActualSessionId(e){const t=u(this,Mt,Uh).call(this)[u(this,Mt,zh).call(this,e)];return typeof t=="string"&&t.length>0?t:null}setActualSessionId(e,t){const r=u(this,Mt,Uh).call(this);r[u(this,Mt,zh).call(this,e)]=t,u(this,Mt,L0).call(this,r)}clearActualSessionId(e){const t=u(this,Mt,Uh).call(this);delete t[u(this,Mt,zh).call(this,e)],u(this,Mt,L0).call(this,t)}}la=new WeakMap,Dc=new WeakMap,Mt=new WeakSet,zh=function(e){return JSON.stringify([s(this,Dc),e])},Uh=function(){const e=s(this,la).getItem(Ny);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!==zy?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},L0=function(e){const t={version:zy,entries:e};s(this,la).setItem(Ny,JSON.stringify(t))};function U8(){return typeof window>"u"?null:window.localStorage}function aO(n){const e=n.getItem(Oy);if(e)return e;const t=Tg().toLowerCase();return n.setItem(Oy,t),t}const Uy=4401,lO=401,fh=1e3,cO=3e4;class Zh extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class uO extends Kr{constructor(t){var a,l;super();C(this,"url");C(this,"name");C(this,"telemetryMeta");C(this,"status","unauthorized");C(this,"channels",new Map);C(this,"client");C(this,"acpClient");C(this,"_token");C(this,"attempting",!1);C(this,"nextRetryAt",null);C(this,"hasEverConnected",!1);C(this,"browserDemoMode",!1);C(this,"hasAuthRejected",!1);C(this,"hasAuthTokenRejected",!1);C(this,"bootState","pending");C(this,"serverVersion",null);C(this,"updateState",null);C(this,"decideBoot");C(this,"navigationPending");C(this,"createSocket");C(this,"createClient");C(this,"socket",null);C(this,"connectAttempt",0);C(this,"autoReconnect",!1);C(this,"retryTimer",null);C(this,"retryDelay",fh);C(this,"visibilityEventTarget");C(this,"networkEventTarget");C(this,"onVisibilityChange");C(this,"onNetworkOnline");C(this,"telemetryActivityAgent");this.url=Vi(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,d,f)=>new P$(c,{token:d??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 oO(t.acpStorage,this.url):new sO);this.acpClient=new JM({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()},(a=this.visibilityEventTarget)==null||a.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,o=t.telemetryWindowTarget!==void 0?t.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&o?w5({meta:this.telemetryMeta,documentTarget:i,windowTarget:o,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=fh,this.autoReconnect=!0,await this.attempt()}dispose(){var t,r,i,o;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),(o=this.telemetryActivityAgent)==null||o.stop(),this.acpClient.dispose()}getViewURL(t){const r=Ad(t,this.renderOptions());return Br()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}async readDemoMode(){try{return await this.client.demoMode()}catch{return null}}renderOptions(){return{electron:Br(),browserDemo:this.browserDemoMode}}getContentURL(t){const r=Ad(t,this.renderOptions()).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 Fl("channels-changed"));break;case"channel-updated":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Fl("channels-changed"));break;case"channel-removed":this.channels.delete(t.channelID),this.dispatchEvent(new Fl("channels-changed"));break;case"artifact-created":{const r=this.channels.get(t.channelID);r&&!m$(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...Hb},size:{...Vb}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=m0(r.layout,t.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return hO(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 At("change"));const r=this.createSocket(dO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((o,a)=>{let l=!1;const c=()=>{var g;l||this.connectAttempt!==t||(l=!0,this.retryDelay=fh,this.hasEverConnected=!0,this.setStatus("connected"),(g=this.telemetryActivityAgent)==null||g.start(),o())},d=g=>{l||this.connectAttempt!==t||(l=!0,a(g))},f=async()=>{const g=this.hasEverConnected;try{const[{channels:y},v,_]=await Promise.all([this.client.channels.list(),this.client.display.get(),g?null:this.readDemoMode()]);g||(this.browserDemoMode=(_==null?void 0:_.browserExternalPages)===!0),this.channels=new Map(y.map(E=>[E.id,structuredClone(E)])),this.acpClient.setEnabled(v.acpEnabled),this.dispatchEvent(new At("change")),g&&this.dispatchEvent(new Fl("channels-changed")),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:v.focusedChannelId}})),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...v.pinnedChannelIds]}})),c(),g&&this.connectAttempt===t&&this.dispatchEvent(new e2("server-reconnected",{serverURL:this.url}))}catch(y){if(yO(y)){d(new Zh);return}d(y instanceof Error?y:new Error(String(y)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",g=>{const y=vO(g);if(!y)return;if(y.type==="server-status"){const _=y;this.serverVersion=_.version,this.updateState=_.update??null;let E=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===t&&(this.decideBoot(_)==="boot"?(this.bootState="booted",E=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new t2("server-status",{serverURL:this.url,message:_})),E?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new At("change"));return}if(!gO(y.type))return;const v=y;this.applyServerEvent(v),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:v}))}),r.addEventListener("close",g=>{if(this.connectAttempt!==t)return;this.socket=null;const y=pO(g);if(!l){d(y===Uy?new Zh:new Error("Connection closed before initialization"));return}if(y===Uy){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}d(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},o=>{throw this.attempting=!1,this.handleAttemptFailure(o),o})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(t){if(t instanceof Zh){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,cO),this.nextRetryAt=Date.now()+t,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},t),this.dispatchEvent(new At("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new At("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=fh,this.attempt().catch(()=>{})))}sendTelemetryActivity(t){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(t)))}sendTelemetrySignal(t,r){var o;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:f$,clientId:this.telemetryMeta.clientId,event:t,properties:r};(o=this.socket)==null||o.send(JSON.stringify(i))}setStatus(t){this.status!==t&&(this.status=t,this.dispatchEvent(new At("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function hO(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function dO(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,o]of y5(t))r.searchParams.set(i,o);return r.hash="",r.toString()}function pO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const fO={"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,"appearance-changed":!0,"artifact-focus":!0},mO=new Set(Object.keys(fO));function gO(n){return mO.has(n)}function vO(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 yO(n){return n instanceof pl&&n.status===lO}const wO="Local";var Ht,hn,rr,M0,O0,Z8,Lc,Mc,Oc,Nc,zc;class bO extends Kr{constructor(t){super();p(this,rr);C(this,"connection");C(this,"clientGUID");C(this,"acpStorage");C(this,"connectError",null);p(this,Ht);p(this,hn,!1);p(this,Lc,()=>{s(this,hn)||(u(this,rr,Z8).call(this),this.dispatchEvent(new At("change")))});p(this,Mc,t=>{s(this,hn)||this.dispatchEvent(new Ph("server-event",{serverURL:t.serverURL,event:t.event}))});p(this,Oc,()=>{s(this,hn)||this.dispatchEvent(new Fl("channels-changed"))});p(this,Nc,t=>{s(this,hn)||this.dispatchEvent(new e2("server-reconnected",{serverURL:t.serverURL}))});p(this,zc,t=>{s(this,hn)||this.dispatchEvent(new t2("server-status",{serverURL:t.serverURL,message:t.message}))});h(this,Ht,t.localStore),this.acpStorage=t.acpStorage===void 0?U8():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?aO(this.acpStorage):Tg().toLowerCase());const r=Vi(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&s(this,Ht).set(oy(s(this,Ht).get(),r,t.launchToken));const i=t.launchToken??sy(s(this,Ht).get(),r),o=t.createSocket??(l=>new WebSocket(l)),a=t.createConnection??(l=>new uO(l));this.connection=a({url:r,name:t.connectionName??wO,token:i,createSocket:o,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:t.telemetryMeta??null,decideBoot:t.decideBoot,navigationPending:t.navigationPending}),this.connection.addEventListener("change",s(this,Lc)),this.connection.addEventListener("server-event",s(this,Mc)),this.connection.addEventListener("channels-changed",s(this,Oc)),this.connection.addEventListener("server-reconnected",s(this,Nc)),this.connection.addEventListener("server-status",s(this,zc))}get storedAuthToken(){return sy(s(this,Ht).get(),this.connection.url)}async connect(){await u(this,rr,M0).call(this,this.connection.token)}async authenticate(t){s(this,Ht).set(oy(s(this,Ht).get(),this.connection.url,t)),await u(this,rr,M0).call(this,t)}dispose(){s(this,hn)||(h(this,hn,!0),this.connection.removeEventListener("change",s(this,Lc)),this.connection.removeEventListener("server-event",s(this,Mc)),this.connection.removeEventListener("channels-changed",s(this,Oc)),this.connection.removeEventListener("server-reconnected",s(this,Nc)),this.connection.removeEventListener("server-status",s(this,zc)),this.connection.dispose())}}Ht=new WeakMap,hn=new WeakMap,rr=new WeakSet,M0=async function(t){if(!s(this,hn)){u(this,rr,O0).call(this,null);try{await this.connection.connect(t)}catch(r){u(this,rr,O0).call(this,r instanceof Zh?null:r instanceof Error?r.message:String(r))}}},O0=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new At("change")))},Z8=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=s(this,Ht).get(),r=cR(t,this.connection.url);r!==t&&s(this,Ht).set(r),this.connection.token!==null&&this.connection.clearToken()},Lc=new WeakMap,Mc=new WeakMap,Oc=new WeakMap,Nc=new WeakMap,zc=new WeakMap;const N0="tv-nav:",nl="tv-reload",Zy=100,SO=1e3,_O=60,AO=60,EO=24,kO=30,CO=kO*EO*AO*_O*SO;function qr(n){try{const e=new URL(n,window.location.href),t=e.searchParams.has(nl);return e.searchParams.delete(nl),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:t?e.toString():n}catch{return n}}var Uc,ca,ge,pe,As,Pe,F8,Qr,H8,z0,U0;class TO extends Kr{constructor(t,r){super();p(this,Pe);p(this,Uc);p(this,ca);p(this,ge,[]);p(this,pe,-1);p(this,As,0);h(this,Uc,t),h(this,ca,qr(r)),u(this,Pe,F8).call(this)}get currentURL(){var t;return s(this,pe)===-1?null:((t=s(this,ge)[s(this,pe)])==null?void 0:t.url)??null}get canGoBack(){return s(this,pe)>-1}get canGoForward(){return s(this,pe)<s(this,ge).length-1}get entries(){return s(this,ge).map(t=>({...t}))}get cursor(){return s(this,pe)}navigate(t){const r=qr(t);if(r===s(this,ca)){if(s(this,pe)===-1)return;h(this,pe,-1),u(this,Pe,Qr).call(this);return}s(this,pe)<s(this,ge).length-1&&h(this,ge,s(this,ge).slice(0,s(this,pe)+1)),s(this,ge).push({url:r}),h(this,pe,s(this,ge).length-1),u(this,Pe,z0).call(this),u(this,Pe,Qr).call(this)}replace(t){var i;if(s(this,pe)===-1){this.navigate(t);return}const r=qr(t);if(r===s(this,ca)){h(this,ge,s(this,ge).filter((o,a)=>a!==s(this,pe))),h(this,pe,-1),u(this,Pe,Qr).call(this);return}((i=s(this,ge)[s(this,pe)])==null?void 0:i.url)!==r&&(h(this,ge,s(this,ge).map((o,a)=>a===s(this,pe)?{url:r}:o)),u(this,Pe,Qr).call(this))}back(){s(this,pe)!==-1&&(h(this,pe,s(this,pe)-1),u(this,Pe,Qr).call(this))}forward(){this.canGoForward&&(h(this,pe,s(this,pe)+1),u(this,Pe,Qr).call(this))}reset(){s(this,pe)===-1&&s(this,ge).length===0||(h(this,ge,[]),h(this,pe,-1),u(this,Pe,Qr).call(this))}}Uc=new WeakMap,ca=new WeakMap,ge=new WeakMap,pe=new WeakMap,As=new WeakMap,Pe=new WeakSet,F8=function(){const t=localStorage.getItem(s(this,Pe,U0));if(t!==null)try{const r=JSON.parse(t);if(!V8(r))return;h(this,ge,r.entries.map(i=>({url:i.url}))),h(this,pe,r.cursor),h(this,As,r.lastWritten),u(this,Pe,z0).call(this)}catch{h(this,ge,[]),h(this,pe,-1),h(this,As,0)}},Qr=function(){h(this,As,Date.now());try{localStorage.setItem(s(this,Pe,U0),JSON.stringify(u(this,Pe,H8).call(this)))}catch(t){if(!IO(t))throw t}this.dispatchEvent(new At("change"))},H8=function(){return{v:1,entries:s(this,ge).map(t=>({...t})),cursor:s(this,pe),lastWritten:s(this,As)}},z0=function(){if(s(this,ge).length<=Zy)return;const t=s(this,ge).length-Zy;h(this,ge,s(this,ge).slice(t)),h(this,pe,Math.max(-1,s(this,pe)-t))},U0=function(){return $O(s(this,Uc))};function $O(n){return`${N0}${n}`}function RO(n){const e=Date.now()-CO,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(N0)))continue;const o=i.slice(N0.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{t.push(i);continue}if(!V8(l)){t.push(i);continue}!n.has(o)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function IO(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function V8(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 Wf="tv-channel-sidebar-collapsed";var Es;class xO{constructor(e){p(this,Es);h(this,Es,e)}read(){return s(this,Es).getItem(Wf)==="true"}setCollapsed(e){try{e?s(this,Es).setItem(Wf,"true"):s(this,Es).removeItem(Wf)}catch{}}}Es=new WeakMap;const jf="tv-channel-sidebar-width",Z0=160,F0=350,mh=260,PO=/^-?\d+$/;var ks;class DO{constructor(e){p(this,ks);h(this,ks,e)}read(){const e=s(this,ks).getItem(jf);if(e===null||!PO.test(e))return null;const t=BigInt(e);return t<BigInt(Z0)?Z0:t>BigInt(F0)?F0:Number(t)}commit(e){const t=B8(Math.round(e));try{s(this,ks).setItem(jf,String(t))}catch{}return t}clear(){try{s(this,ks).removeItem(jf)}catch{}}}ks=new WeakMap;function B8(n){return Math.min(Math.max(n,Z0),F0)}const LO="1.4.4";function Ng(n=LO){return n!==void 0&&n.length>0?n:"0.0.0"}function zg(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const H0="tv-reload-attempted";function MO(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:M$(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 OO(n){const e=n.getItem(H0);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 NO(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??zg(),i=n.bundleVersion??Ng();if(e===null)return{dispose(){}};let o=null;const a=()=>{if(o===null)return;const d=n.owner.connection;if(d.url!==n.primaryServerURL||d.status!=="connected")return;const f=o;o=null,d.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=d=>{if(r.pending)return;const f=MO({bundleVersion:i,serverVersion:d.message.version,originMatch:d.serverURL===n.primaryServerURL,marker:OO(e)});switch(f.action){case"reload":e.setItem(H0,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(H0),o={fromVersion:f.fromVersion,toVersion:f.toVersion},a();return;case"none":return}},c=()=>{a()};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 zO(n){const e=Br(n.search),t=F2(n.search),r=t!==null&&Op(t)?t:null;return{electron:e,shellVersion:r}}function UO(n){return!n.electron||n.requiredDesktopVersion===null||!Op(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===vd?!1:Cg(n.requiredDesktopVersion,n.shellVersion)}const ZO=`# Desktop app update required
42
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const g=f[1];if(e===f[0]){o(f);continue}if(n.external){const v=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){o(f);continue}}if((d=n.metadataRegistry.get(f[0]))==null?void 0:d.id){o(f);continue}if(g.cycle){o(f);continue}if(g.count>1&&n.reused==="ref"){o(f);continue}}}function T8(n,e){var a,l,c;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const f=n.seen.get(d);if(f.ref===null)return;const g=f.def??f.schema,y={...g},v=f.ref;if(f.ref=null,v){r(v);const E=n.seen.get(v),x=E.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(x)):Object.assign(g,x),Object.assign(g,y),d._zod.parent===v)for(const P in g)P==="$ref"||P==="allOf"||P in y||delete g[P];if(x.$ref&&E.def)for(const P in g)P==="$ref"||P==="allOf"||P in E.def&&JSON.stringify(g[P])===JSON.stringify(E.def[P])&&delete g[P]}const _=d._zod.parent;if(_&&_!==v){r(_);const E=n.seen.get(_);if(E!=null&&E.schema.$ref&&(g.$ref=E.schema.$ref,E.def))for(const x in g)x==="$ref"||x==="allOf"||x in E.def&&JSON.stringify(g[x])===JSON.stringify(E.def[x])&&delete g[x]}n.override({zodSchema:d,jsonSchema:g,path:f.path??[]})};for(const d of[...n.seen.entries()].reverse())r(d[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,(a=n.external)!=null&&a.uri){const d=(l=n.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(d)}Object.assign(i,t.def??t.schema);const o=((c=n.external)==null?void 0:c.defs)??{};for(const d of n.seen.entries()){const f=d[1];f.def&&f.defId&&(o[f.defId]=f.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:_d(e,"input",n.processors),output:_d(e,"output",n.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function et(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 et(r.element,t);if(r.type==="set")return et(r.valueType,t);if(r.type==="lazy")return et(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 et(r.innerType,t);if(r.type==="intersection")return et(r.left,t)||et(r.right,t);if(r.type==="record"||r.type==="map")return et(r.keyType,t)||et(r.valueType,t);if(r.type==="pipe")return et(r.in,t)||et(r.out,t);if(r.type==="object"){for(const i in r.shape)if(et(r.shape[i],t))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(et(i,t))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(et(i,t))return!0;return!!(r.rest&&et(r.rest,t))}return!1}const ux=(n,e={})=>t=>{const r=k8({...t,processors:e});return Le(n,r),C8(r,n),T8(r,n)},_d=(n,e,t={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=k8({...i??{},target:o,io:e,processors:t});return Le(n,a),C8(a,n),T8(a,n)},hx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dx=(n,e,t,r)=>{const i=t;i.type="string";const{minimum:o,maximum:a,format:l,patterns:c,contentEncoding:d}=n._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=hx[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),d&&(i.contentEncoding=d),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(g=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},px=(n,e,t,r)=>{const i=t,{minimum:o,maximum:a,format:l,multipleOf:c,exclusiveMaximum:d,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 o=="number"&&(i.minimum=o,typeof f=="number"&&e.target!=="draft-04"&&(f>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d),typeof a=="number"&&(i.maximum=a,typeof d=="number"&&e.target!=="draft-04"&&(d<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},fx=(n,e,t,r)=>{t.type="boolean"},mx=(n,e,t,r)=>{t.not={}},gx=(n,e,t,r)=>{},vx=(n,e,t,r)=>{const i=n._zod.def,o=i8(i.entries);o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),t.enum=o},yx=(n,e,t,r)=>{const i=n._zod.def,o=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];t.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[a]:t.const=a}else o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),o.every(a=>typeof a=="boolean")&&(t.type="boolean"),o.every(a=>a===null)&&(t.type="null"),t.enum=o},wx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Sx=(n,e,t,r)=>{const i=t,o=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Le(o.element,e,{...r,path:[...r.path,"items"]})},_x=(n,e,t,r)=>{var d;const i=t,o=n._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=Le(a[f],e,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(f=>{const g=o.shape[f]._zod;return e.io==="input"?g.optin===void 0:g.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((d=o.catchall)==null?void 0:d._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Le(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Ax=(n,e,t,r)=>{const i=n._zod.def,o=i.inclusive===!1,a=i.options.map((l,c)=>Le(l,e,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?t.oneOf=a:t.anyOf=a},Ex=(n,e,t,r)=>{const i=n._zod.def,o=Le(i.left,e,{...r,path:[...r.path,"allOf",0]}),a=Le(i.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];t.allOf=c},kx=(n,e,t,r)=>{const i=t,o=n._zod.def;i.type="object";const a=o.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(o.mode==="loose"&&c&&c.size>0){const f=Le(o.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of c)i.patternProperties[g.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Le(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Le(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const d=a._zod.values;if(d){const f=[...d].filter(g=>typeof g=="string"||typeof g=="number");f.length>0&&(i.required=f)}},Cx=(n,e,t,r)=>{const i=n._zod.def,o=Le(i.innerType,e,r),a=e.seen.get(n);e.target==="openapi-3.0"?(a.ref=i.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},Tx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},$x=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},Rx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ix=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=a},xx=(n,e,t,r)=>{const i=n._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Le(o,e,r);const a=e.seen.get(n);a.ref=o},Px=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.readOnly=!0},$8=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Lx=k("ZodISODateTime",(n,e)=>{DR.init(n,e),Ce.init(n,e)});function Dx(n){return HI(Lx,n)}const Mx=k("ZodISODate",(n,e)=>{MR.init(n,e),Ce.init(n,e)});function Ox(n){return UI(Mx,n)}const Nx=k("ZodISOTime",(n,e)=>{OR.init(n,e),Ce.init(n,e)});function zx(n){return VI(Nx,n)}const Zx=k("ZodISODuration",(n,e)=>{NR.init(n,e),Ce.init(n,e)});function Hx(n){return FI(Zx,n)}const R8=(n,e)=>{l8.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>T$(n,t)},flatten:{value:t=>C$(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,S0,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,S0,2)}},isEmpty:{get(){return n.issues.length===0}}})},Sy=k("ZodError",R8),on=k("ZodError",R8,{Parent:Error}),Ux=Ig(on),Vx=xg(on),Fx=zp(on),Bx=Zp(on),qx=I$(on),Wx=x$(on),jx=P$(on),Gx=L$(on),Yx=D$(on),Jx=M$(on),Kx=O$(on),Xx=N$(on),ke=k("ZodType",(n,e)=>(Ee.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:_d(n,"input"),output:_d(n,"output")}}),n.toJSONSchema=ux(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...t)=>n.clone(Ji(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)=>Ki(n,t,r),n.brand=()=>n,n.register=(t,r)=>(t.add(n,r),n),n.parse=(t,r)=>Ux(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>Fx(n,t,r),n.parseAsync=async(t,r)=>Vx(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>Bx(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>qx(n,t,r),n.decode=(t,r)=>Wx(n,t,r),n.encodeAsync=async(t,r)=>jx(n,t,r),n.decodeAsync=async(t,r)=>Gx(n,t,r),n.safeEncode=(t,r)=>Yx(n,t,r),n.safeDecode=(t,r)=>Jx(n,t,r),n.safeEncodeAsync=async(t,r)=>Kx(n,t,r),n.safeDecodeAsync=async(t,r)=>Xx(n,t,r),n.refine=(t,r)=>n.check(B5(t,r)),n.superRefine=t=>n.check(q5(t)),n.overwrite=t=>n.check(fl(t)),n.optional=()=>Ey(n),n.exactOptional=()=>x5(n),n.nullable=()=>ky(n),n.nullish=()=>Ey(ky(n)),n.nonoptional=t=>N5(n,t),n.array=()=>z(n),n.or=t=>X([n,t]),n.and=t=>Up(n,t),n.transform=t=>Cy(n,R5(t)),n.default=t=>D5(n,t),n.prefault=t=>O5(n,t),n.catch=t=>Z5(n,t),n.pipe=t=>Cy(n,t),n.readonly=()=>V5(n),n.describe=t=>{const r=n.clone();return Vl.add(r,{description:t}),r},Object.defineProperty(n,"description",{get(){var t;return(t=Vl.get(n))==null?void 0:t.description},configurable:!0}),n.meta=(...t)=>{if(t.length===0)return Vl.get(n);const r=n.clone();return Vl.add(r,t[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=t=>t(n),n)),I8=k("_ZodString",(n,e)=>{Pg.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>dx(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(YI(...r)),n.includes=(...r)=>n.check(XI(...r)),n.startsWith=(...r)=>n.check(QI(...r)),n.endsWith=(...r)=>n.check(ex(...r)),n.min=(...r)=>n.check(Sd(...r)),n.max=(...r)=>n.check(A8(...r)),n.length=(...r)=>n.check(E8(...r)),n.nonempty=(...r)=>n.check(Sd(1,...r)),n.lowercase=r=>n.check(JI(r)),n.uppercase=r=>n.check(KI(r)),n.trim=()=>n.check(nx()),n.normalize=(...r)=>n.check(tx(...r)),n.toLowerCase=()=>n.check(rx()),n.toUpperCase=()=>n.check(ix()),n.slugify=()=>n.check(sx())}),Qx=k("ZodString",(n,e)=>{Pg.init(n,e),I8.init(n,e),n.email=t=>n.check(wI(e5,t)),n.url=t=>n.check(EI(t5,t)),n.jwt=t=>n.check(ZI(g5,t)),n.emoji=t=>n.check(kI(n5,t)),n.guid=t=>n.check(vy(_y,t)),n.uuid=t=>n.check(bI(ph,t)),n.uuidv4=t=>n.check(SI(ph,t)),n.uuidv6=t=>n.check(_I(ph,t)),n.uuidv7=t=>n.check(AI(ph,t)),n.nanoid=t=>n.check(CI(r5,t)),n.guid=t=>n.check(vy(_y,t)),n.cuid=t=>n.check(TI(i5,t)),n.cuid2=t=>n.check($I(s5,t)),n.ulid=t=>n.check(RI(o5,t)),n.base64=t=>n.check(OI(p5,t)),n.base64url=t=>n.check(NI(f5,t)),n.xid=t=>n.check(II(a5,t)),n.ksuid=t=>n.check(xI(l5,t)),n.ipv4=t=>n.check(PI(c5,t)),n.ipv6=t=>n.check(LI(u5,t)),n.cidrv4=t=>n.check(DI(h5,t)),n.cidrv6=t=>n.check(MI(d5,t)),n.e164=t=>n.check(zI(m5,t)),n.datetime=t=>n.check(Dx(t)),n.date=t=>n.check(Ox(t)),n.time=t=>n.check(zx(t)),n.duration=t=>n.check(Hx(t))});function m(n){return yI(Qx,n)}const Ce=k("ZodStringFormat",(n,e)=>{_e.init(n,e),I8.init(n,e)}),e5=k("ZodEmail",(n,e)=>{kR.init(n,e),Ce.init(n,e)}),_y=k("ZodGUID",(n,e)=>{AR.init(n,e),Ce.init(n,e)}),ph=k("ZodUUID",(n,e)=>{ER.init(n,e),Ce.init(n,e)}),t5=k("ZodURL",(n,e)=>{CR.init(n,e),Ce.init(n,e)}),n5=k("ZodEmoji",(n,e)=>{TR.init(n,e),Ce.init(n,e)}),r5=k("ZodNanoID",(n,e)=>{$R.init(n,e),Ce.init(n,e)}),i5=k("ZodCUID",(n,e)=>{RR.init(n,e),Ce.init(n,e)}),s5=k("ZodCUID2",(n,e)=>{IR.init(n,e),Ce.init(n,e)}),o5=k("ZodULID",(n,e)=>{xR.init(n,e),Ce.init(n,e)}),a5=k("ZodXID",(n,e)=>{PR.init(n,e),Ce.init(n,e)}),l5=k("ZodKSUID",(n,e)=>{LR.init(n,e),Ce.init(n,e)}),c5=k("ZodIPv4",(n,e)=>{zR.init(n,e),Ce.init(n,e)}),u5=k("ZodIPv6",(n,e)=>{ZR.init(n,e),Ce.init(n,e)}),h5=k("ZodCIDRv4",(n,e)=>{HR.init(n,e),Ce.init(n,e)}),d5=k("ZodCIDRv6",(n,e)=>{UR.init(n,e),Ce.init(n,e)}),p5=k("ZodBase64",(n,e)=>{VR.init(n,e),Ce.init(n,e)}),f5=k("ZodBase64URL",(n,e)=>{BR.init(n,e),Ce.init(n,e)}),m5=k("ZodE164",(n,e)=>{qR.init(n,e),Ce.init(n,e)}),g5=k("ZodJWT",(n,e)=>{jR.init(n,e),Ce.init(n,e)}),x8=k("ZodNumber",(n,e)=>{y8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>px(n,r,i),n.gt=(r,i)=>n.check(wy(r,i)),n.gte=(r,i)=>n.check(Vf(r,i)),n.min=(r,i)=>n.check(Vf(r,i)),n.lt=(r,i)=>n.check(yy(r,i)),n.lte=(r,i)=>n.check(Uf(r,i)),n.max=(r,i)=>n.check(Uf(r,i)),n.int=r=>n.check(Ay(r)),n.safe=r=>n.check(Ay(r)),n.positive=r=>n.check(wy(0,r)),n.nonnegative=r=>n.check(Vf(0,r)),n.negative=r=>n.check(yy(0,r)),n.nonpositive=r=>n.check(Uf(0,r)),n.multipleOf=(r,i)=>n.check(by(r,i)),n.step=(r,i)=>n.check(by(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 G(n){return BI(x8,n)}const v5=k("ZodNumberFormat",(n,e)=>{GR.init(n,e),x8.init(n,e)});function Ay(n){return qI(v5,n)}const y5=k("ZodBoolean",(n,e)=>{YR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>fx(n,t,r)});function Ve(n){return WI(y5,n)}const w5=k("ZodUnknown",(n,e)=>{JR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>gx()});function S(){return jI(w5)}const b5=k("ZodNever",(n,e)=>{KR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mx(n,t,r)});function S5(n){return GI(b5,n)}const _5=k("ZodArray",(n,e)=>{XR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Sx(n,t,r,i),n.element=e.element,n.min=(t,r)=>n.check(Sd(t,r)),n.nonempty=t=>n.check(Sd(1,t)),n.max=(t,r)=>n.check(A8(t,r)),n.length=(t,r)=>n.check(E8(t,r)),n.unwrap=()=>n.element});function z(n,e){return ox(_5,n,e)}const P8=k("ZodObject",(n,e)=>{eI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>_x(n,t,r,i),ue(n,"shape",()=>e.shape),n.keyof=()=>M8(Object.keys(n._zod.def.shape)),n.catchall=t=>n.clone({...n._zod.def,catchall:t}),n.passthrough=()=>n.clone({...n._zod.def,catchall:S()}),n.loose=()=>n.clone({...n._zod.def,catchall:S()}),n.strict=()=>n.clone({...n._zod.def,catchall:S5()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>S$(n,t),n.safeExtend=t=>_$(n,t),n.merge=t=>A$(n,t),n.pick=t=>w$(n,t),n.omit=t=>b$(n,t),n.partial=(...t)=>E$(O8,n,t[0]),n.required=(...t)=>k$(N8,n,t[0])});function L8(n,e){const t={type:"object",shape:n??{},...H(e)};return new P8(t)}function w(n,e){return new P8({type:"object",shape:n,catchall:S(),...H(e)})}const D8=k("ZodUnion",(n,e)=>{S8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ax(n,t,r,i),n.options=e.options});function X(n,e){return new D8({type:"union",options:n,...H(e)})}const A5=k("ZodDiscriminatedUnion",(n,e)=>{D8.init(n,e),tI.init(n,e)});function E5(n,e,t){return new A5({type:"union",options:e,discriminator:n,...H(t)})}const k5=k("ZodIntersection",(n,e)=>{nI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ex(n,t,r,i)});function Up(n,e){return new k5({type:"intersection",left:n,right:e})}const C5=k("ZodRecord",(n,e)=>{rI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>kx(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function A(n,e,t){return new C5({type:"record",keyType:n,valueType:e,...H(t)})}const A0=k("ZodEnum",(n,e)=>{iI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>vx(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 o={};for(const a of r)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new A0({...e,checks:[],...H(i),entries:o})},n.exclude=(r,i)=>{const o={...e.entries};for(const a of r)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new A0({...e,checks:[],...H(i),entries:o})}});function M8(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new A0({type:"enum",entries:t,...H(e)})}const T5=k("ZodLiteral",(n,e)=>{sI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>yx(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 $(n,e){return new T5({type:"literal",values:Array.isArray(n)?n:[n],...H(e)})}const $5=k("ZodTransform",(n,e)=>{oI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>bx(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new n8(n.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(mc(o,t.value,e));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=n),t.issues.push(mc(a))}};const i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>(t.value=o,t)):(t.value=i,t)}});function R5(n){return new $5({type:"transform",transform:n})}const O8=k("ZodOptional",(n,e)=>{_8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Ey(n){return new O8({type:"optional",innerType:n})}const I5=k("ZodExactOptional",(n,e)=>{aI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function x5(n){return new I5({type:"optional",innerType:n})}const P5=k("ZodNullable",(n,e)=>{lI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Cx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function ky(n){return new P5({type:"nullable",innerType:n})}const L5=k("ZodDefault",(n,e)=>{cI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$x(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function D5(n,e){return new L5({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():o8(e)}})}const M5=k("ZodPrefault",(n,e)=>{uI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Rx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function O5(n,e){return new M5({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():o8(e)}})}const N8=k("ZodNonOptional",(n,e)=>{hI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Tx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function N5(n,e){return new N8({type:"nonoptional",innerType:n,...H(e)})}const z5=k("ZodCatch",(n,e)=>{dI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ix(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Z5(n,e){return new z5({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const H5=k("ZodPipe",(n,e)=>{pI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>xx(n,t,r,i),n.in=e.in,n.out=e.out});function Cy(n,e){return new H5({type:"pipe",in:n,out:e})}const U5=k("ZodReadonly",(n,e)=>{fI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Px(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function V5(n){return new U5({type:"readonly",innerType:n})}const F5=k("ZodCustom",(n,e)=>{mI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>wx(n,t)});function B5(n,e={}){return ax(F5,n,e)}function q5(n){return lx(n)}const W5=[".md",".markdown"];function z8(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function Z8(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function j5(n){return Z8(n).toLowerCase()}function G5(n,e){const t=j5(n);return e.some(r=>t.endsWith(r))}function E0(n){return!z8(n)&&G5(n,W5)}function Y5(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function fr(n){try{const{pathname:e}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e)}catch{return!1}}const J5=L8({id:m().min(1),kind:$("path"),title:m(),path:m()}).strict(),K5=L8({id:m().min(1),kind:$("url"),title:m(),url:m().refine(Y5,{message:"url must be an http(s) URL"})}).strict();E5("kind",[J5,K5]);const X5=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function Q5(n,e){try{const t=new URL(e),r=new URL(n,t);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:X5.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Ty(n,e){return Q5(n,e).kind==="web"}const eP="/views/markdown/",tP="/views/url-unsupported/";function nP(n){try{const{protocol:e}=new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function H8(n){return`/artifact/${encodeURIComponent(n)}`}function rP(n,e){return`${H8(n)}/${encodeURIComponent(e)}`}function iP(n){return`/markdown/${encodeURIComponent(n)}`}function Ad(n,e={electron:!1}){if(n.kind==="url")return e.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:fr(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:e.browserDemo&&nP(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:tP,contentURL:null};if(E0(n.path)){const r={viewURL:eP,contentURL:iP(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=z8(n.path)?`${H8(n.id)}/`:rP(n.id,Z8(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const sP="serverURL",oP="token",aP="mode",lP="desktopAppVersion",cP="electron";function uP(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(sP);return r?new URL(r).origin:new URL(e).origin}function hP(n=window.location.search){return new URLSearchParams(n).get(oP)}function Br(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(aP)===cP}function U8(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(lP)}const $y="tv.telemetry.clientId",dP=5,pP=60,fP=1e3,mP=dP*pP*fP,Ry=["pointerdown","scroll","keydown"],Iy=["focus"],xy=["visibilitychange"],gP="hidden";function vP(n,e=_P){const t=n.getItem($y);if(t)return t;const r=e();return n.setItem($y,r),r}function yP(n){return{clientId:vP(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function wP(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 bP(n){return new SP(n)}var Ac,wr,ai,Ec,kc,Ut,Ss,Cc,Od,V8;class SP{constructor(e){p(this,Od);p(this,Ac);p(this,wr);p(this,ai);p(this,Ec);p(this,kc);p(this,Ut);p(this,Ss,!1);p(this,Cc,Number.NEGATIVE_INFINITY);h(this,Ac,e.meta),h(this,wr,e.documentTarget),h(this,ai,e.windowTarget),h(this,Ec,e.send),h(this,kc,e.nowMs??Date.now),h(this,Ut,()=>u(this,Od,V8).call(this))}start(){if(!s(this,Ss)){h(this,Ss,!0);for(const e of Ry)s(this,ai).addEventListener(e,s(this,Ut)),s(this,wr).addEventListener(e,s(this,Ut));for(const e of Iy)s(this,ai).addEventListener(e,s(this,Ut));for(const e of xy)s(this,wr).addEventListener(e,s(this,Ut))}}stop(){if(s(this,Ss)){h(this,Ss,!1);for(const e of Ry)s(this,ai).removeEventListener(e,s(this,Ut)),s(this,wr).removeEventListener(e,s(this,Ut));for(const e of Iy)s(this,ai).removeEventListener(e,s(this,Ut));for(const e of xy)s(this,wr).removeEventListener(e,s(this,Ut))}}}Ac=new WeakMap,wr=new WeakMap,ai=new WeakMap,Ec=new WeakMap,kc=new WeakMap,Ut=new WeakMap,Ss=new WeakMap,Cc=new WeakMap,Od=new WeakSet,V8=function(){if(s(this,wr).visibilityState===gP)return;const e=s(this,kc).call(this);e-s(this,Cc)<mP||(h(this,Cc,e),s(this,Ec).call(this,{type:fT,clientId:s(this,Ac).clientId}))};function _P(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Cg().toLowerCase()}const we={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"},ur={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"},AP=1,EP=w({_meta:A(m(),S()).nullish(),terminal:Ve().optional().default(!1)}),kP=w({_meta:A(m(),S()).nullish(),label:m().nullish(),name:m(),optional:Ve().optional().default(!1),secret:Ve().optional().default(!0)}),CP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),name:m()}),TP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),link:m().nullish(),name:m(),vars:z(kP)}),$P=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),description:m().nullish(),env:A(m(),m()).optional(),id:m(),name:m()}),RP=X([TP.and(w({type:$("env_var")})),$P.and(w({type:$("terminal")})),CP]),IP=w({_meta:A(m(),S()).nullish(),methodId:m()}),xP=w({_meta:A(m(),S()).nullish()}),PP=w({_meta:A(m(),S()).nullish(),blob:m(),mimeType:m().nullish(),uri:m()}),LP=w({default:Ve().nullish(),description:m().nullish(),title:m().nullish()}),DP=w({_meta:A(m(),S()).nullish()}),MP=w({_meta:A(m(),S()).nullish()}),OP=w({amount:G(),currency:m()}),NP=w({_meta:A(m(),S()).nullish(),terminalId:m()}),zP=w({_meta:A(m(),S()).nullish(),newText:m(),oldText:m().nullish(),path:m()}),ZP=X([m(),G(),G(),Ve(),z(m())]),HP=w({content:A(m(),ZP).nullish()}),UP=X([HP.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),VP=w({_meta:A(m(),S()).nullish()}),F8=m(),FP=w({_meta:A(m(),S()).nullish(),elicitationId:F8}),BP=w({_meta:A(m(),S()).nullish(),action:UP}),qP=$("object"),WP=$("string"),jP=w({_meta:A(m(),S()).nullish()}),GP=w({_meta:A(m(),S()).nullish(),form:VP.nullish(),url:jP.nullish()}),YP=w({elicitationId:F8,url:m().url()}),B8=w({const:m(),title:m()}),q8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),JP=X([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),G().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),W8=w({code:JP,data:S().optional(),message:m()}),j8=S(),G8=S(),Y8=S(),KP=w({_meta:A(m(),S()).nullish(),readTextFile:Ve().optional().default(!1),writeTextFile:Ve().optional().default(!1)}),J8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),K8=w({_meta:A(m(),S()).nullish(),name:m(),title:m().nullish(),version:m()}),XP=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),QP=w({_meta:A(m(),S()).nullish()}),eL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cursor:m().nullish(),cwd:m().nullish()}),tL=w({_meta:A(m(),S()).nullish()}),nL=w({_meta:A(m(),S()).nullish(),logout:tL.nullish()}),rL=w({_meta:A(m(),S()).nullish()}),iL=w({_meta:A(m(),S()).nullish()}),sL=w({_meta:A(m(),S()).nullish(),http:Ve().optional().default(!1),sse:Ve().optional().default(!1)}),oL=w({_meta:A(m(),S()).nullish(),headers:z(J8),name:m(),url:m()}),aL=w({_meta:A(m(),S()).nullish(),headers:z(J8),name:m(),url:m()}),lL=w({_meta:A(m(),S()).nullish(),args:z(m()),command:m(),env:z(q8),name:m()}),Vp=X([oL.and(w({type:$("http")})),aL.and(w({type:$("sse")})),lL]),Lg=m(),cL=w({_meta:A(m(),S()).nullish(),description:m().nullish(),modelId:Lg,name:m()}),uL=X([$("error"),$("warning"),$("information"),$("hint")]),hL=w({_meta:A(m(),S()).nullish()}),dL=w({_meta:A(m(),S()).nullish()}),pL=w({_meta:A(m(),S()).nullish()}),fL=w({_meta:A(m(),S()).nullish()}),mL=w({_meta:A(m(),S()).nullish()}),gL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),vL=w({diff:m(),uri:m()}),yL=w({endLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:m()}),wL=w({_meta:A(m(),S()).nullish()}),bL=w({_meta:A(m(),S()).nullish()}),SL=w({languageId:m(),text:m(),uri:m()}),_L=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),AL=X([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),EL=w({excerpts:z(yL),uri:m()}),kL=w({_meta:A(m(),S()).nullish()}),CL=w({_meta:A(m(),S()).nullish()}),TL=w({name:m(),owner:m(),remoteUrl:m()}),$L=w({_meta:A(m(),S()).nullish()}),RL=w({_meta:A(m(),S()).nullish(),jump:wL.nullish(),rename:CL.nullish(),searchAndReplace:$L.nullish()}),IL=w({id:m(),isRegex:Ve().nullish(),replace:m(),search:m(),uri:m()}),xL=X([$("automatic"),$("diagnostic"),$("manual")]),PL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),LL=w({_meta:A(m(),S()).nullish(),diagnostics:hL.nullish(),editHistory:gL.nullish(),openFiles:bL.nullish(),recentFiles:_L.nullish(),relatedSnippets:kL.nullish(),userActions:PL.nullish()}),DL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp)}),ML=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),X8=m(),OL=X([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),NL=w({_meta:A(m(),S()).nullish(),kind:OL,name:m(),optionId:X8}),zL=X([$("high"),$("medium"),$("low")]),ZL=X([$("pending"),$("in_progress"),$("completed")]),HL=w({_meta:A(m(),S()).nullish(),content:m(),priority:zL,status:ZL}),UL=w({_meta:A(m(),S()).nullish(),entries:z(HL)}),Wi=w({character:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),VL=w({id:m(),position:Wi,uri:m()}),FL=w({id:m(),newName:m(),position:Wi,uri:m()}),BL=w({action:m(),position:Wi,timestampMs:G(),uri:m()}),Q8=X([$("utf-16"),$("utf-32"),$("utf-8")]),qL=w({_meta:A(m(),S()).nullish(),auth:EP.optional().default({terminal:!1}),elicitation:GP.nullish(),fs:KP.optional().default({readTextFile:!1,writeTextFile:!1}),nes:RL.nullish(),positionEncodings:z(Q8).optional(),terminal:Ve().optional().default(!1)}),WL=w({_meta:A(m(),S()).nullish(),audio:Ve().optional().default(!1),embeddedContext:Ve().optional().default(!1),image:Ve().optional().default(!1)}),eb=G().int().gte(0).lte(65535),jL=w({_meta:A(m(),S()).nullish(),clientCapabilities:qL.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:K8.nullish(),protocolVersion:eb}),ml=w({end:Wi,start:Wi}),GL=w({message:m(),range:ml,severity:uL,uri:m()}),YL=w({languageId:m(),lastFocusedMs:G().nullish(),uri:m(),visibleRange:ml.nullish()}),JL=w({_meta:A(m(),S()).nullish(),diagnostics:z(GL).nullish(),editHistory:z(vL).nullish(),openFiles:z(YL).nullish(),recentFiles:z(SL).nullish(),relatedSnippets:z(EL).nullish(),userActions:z(BL).nullish()}),KL=w({newText:m(),range:ml}),XL=w({cursorPosition:Wi.nullish(),edits:z(KL),id:m(),uri:m()}),QL=X([XL.and(w({kind:$("edit")})),VL.and(w({kind:$("jump")})),FL.and(w({kind:$("rename")})),IL.and(w({kind:$("searchAndReplace")}))]),eD=w({_meta:A(m(),S()).nullish(),content:m()}),tD=w({_meta:A(m(),S()).nullish()}),ho=X([G(),m()]).nullable();w({_meta:A(m(),S()).nullish(),requestId:ho});const nD=M8(["assistant","user"]),Fu=w({_meta:A(m(),S()).nullish(),audience:z(nD).nullish(),lastModified:m().nullish(),priority:G().nullish()}),rD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m()}),iD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m(),uri:m().nullish()}),sD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),description:m().nullish(),mimeType:m().nullish(),name:m(),size:G().nullish(),title:m().nullish(),uri:m()}),oD=w({_meta:A(m(),S()).nullish(),optionId:X8}),aD=X([w({outcome:$("cancelled")}),oD.and(w({outcome:$("selected")}))]),lD=w({_meta:A(m(),S()).nullish(),outcome:aD}),cD=w({_meta:A(m(),S()).nullish()}),uD=w({_meta:A(m(),S()).nullish()}),hD=w({currentValue:Ve()}),dD=m(),tb=m(),pD=X([$("mode"),$("model"),$("thought_level"),m()]),Dg=m(),nb=w({_meta:A(m(),S()).nullish(),description:m().nullish(),name:m(),value:Dg}),fD=w({_meta:A(m(),S()).nullish(),group:dD,name:m(),options:z(nb)}),mD=X([z(nb),z(fD)]),gD=w({currentValue:Dg,options:mD}),gl=Up(X([gD.and(w({type:$("select")})),hD.and(w({type:$("boolean")}))]),w({_meta:A(m(),S()).nullish(),category:pD.nullish(),description:m().nullish(),id:tb,name:m()})),vD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),yD=w({_meta:A(m(),S()).nullish()}),ae=m(),wD=w({_meta:A(m(),S()).nullish(),id:m(),sessionId:ae}),bD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),SD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),_D=w({_meta:A(m(),S()).nullish(),sessionId:ae}),rb=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),command:m(),cwd:m().nullish(),env:z(q8).optional(),outputByteLimit:G().nullish(),sessionId:ae}),AD=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),ED=w({_meta:A(m(),S()).nullish(),position:Wi,sessionId:ae,uri:m(),version:G(),visibleRange:ml}),kD=w({_meta:A(m(),S()).nullish(),languageId:m(),sessionId:ae,text:m(),uri:m(),version:G()}),CD=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),TD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp).optional(),sessionId:ae}),ib=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),$D=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp),sessionId:ae}),sb=w({_meta:A(m(),S()).nullish(),limit:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m(),sessionId:ae}),RD=w({_meta:A(m(),S()).nullish(),id:m(),reason:AL.nullish(),sessionId:ae}),ob=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),ID=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp).optional(),sessionId:ae}),xD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),sessionId:ae,title:m().nullish(),updatedAt:m().nullish()}),PD=w({_meta:A(m(),S()).nullish(),nextCursor:m().nullish(),sessions:z(xD)}),LD=w({_meta:A(m(),S()).nullish(),title:m().nullish(),updatedAt:m().nullish()}),DD=w({_meta:A(m(),S()).nullish()}),Fp=m(),MD=w({_meta:A(m(),S()).nullish(),currentModeId:Fp}),OD=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:Fp,name:m()}),Bp=w({_meta:A(m(),S()).nullish(),availableModes:z(OD),currentModeId:Fp}),qp=w({_meta:A(m(),S()).nullish(),availableModels:z(cL),currentModelId:Lg}),ND=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),zD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),ZD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),HD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),UD=w({_meta:A(m(),S()).nullish()}),VD=w({_meta:A(m(),S()).nullish(),additionalDirectories:cD.nullish(),close:uD.nullish(),fork:yD.nullish(),list:DD.nullish(),resume:UD.nullish()}),FD=Up(X([w({type:$("boolean"),value:Ve()}),w({value:Dg})]),w({_meta:A(m(),S()).nullish(),configId:tb,sessionId:ae})),BD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),qD=w({_meta:A(m(),S()).nullish(),modeId:Fp,sessionId:ae}),WD=w({_meta:A(m(),S()).nullish()}),jD=w({_meta:A(m(),S()).nullish(),modelId:Lg,sessionId:ae}),GD=w({_meta:A(m(),S()).nullish()}),YD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),JD=X([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),KD=X([$("email"),$("uri"),$("date"),$("date-time")]),XD=w({default:m().nullish(),description:m().nullish(),enum:z(m()).nullish(),format:KD.nullish(),maxLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(B8).nullish(),pattern:m().nullish(),title:m().nullish()}),QD=w({_meta:A(m(),S()).nullish(),context:JL.nullish(),position:Wi,selection:ml.nullish(),sessionId:ae,triggerKind:xL,uri:m(),version:G()}),eM=w({_meta:A(m(),S()).nullish(),suggestions:z(QL)}),tM=w({_meta:A(m(),S()).nullish(),terminalId:m()}),nM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),ab=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),rM=w({_meta:A(m(),S()).nullish(),exitStatus:nM.nullish(),output:m(),truncated:Ve()}),iM=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),text:m()}),sM=w({range:ml.nullish(),text:m()}),oM=w({_meta:A(m(),S()).nullish(),contentChanges:z(sM),sessionId:ae,uri:m(),version:G()});w({method:m(),params:X([bD,kD,oM,AD,CD,ED,wD,RD,j8]).nullish()});const aM=X([$("full"),$("incremental")]),lM=w({_meta:A(m(),S()).nullish(),syncKind:aM}),cM=w({_meta:A(m(),S()).nullish(),didChange:lM.nullish(),didClose:dL.nullish(),didFocus:pL.nullish(),didOpen:fL.nullish(),didSave:mL.nullish()}),uM=w({_meta:A(m(),S()).nullish(),document:cM.nullish()}),hM=w({_meta:A(m(),S()).nullish(),context:LL.nullish(),events:uM.nullish()}),dM=w({_meta:A(m(),S()).nullish(),auth:nL.optional().default({}),loadSession:Ve().optional().default(!1),mcpCapabilities:sL.optional().default({http:!1,sse:!1}),nes:hM.nullish(),positionEncoding:Q8.nullish(),promptCapabilities:WL.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:VD.optional().default({})}),pM=w({_meta:A(m(),S()).nullish(),agentCapabilities:dM.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:K8.nullish(),authMethods:z(RP).optional().default([]),protocolVersion:eb}),fM=w({_meta:A(m(),S()).nullish(),mimeType:m().nullish(),text:m(),uri:m()}),mM=X([fM,PP]),gM=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),resource:mM}),Mg=X([iM.and(w({type:$("text")})),iD.and(w({type:$("image")})),rD.and(w({type:$("audio")})),sD.and(w({type:$("resource_link")})),gM.and(w({type:$("resource")}))]),vM=w({_meta:A(m(),S()).nullish(),content:Mg}),Ff=w({_meta:A(m(),S()).nullish(),content:Mg,messageId:m().nullish()}),yM=w({_meta:A(m(),S()).nullish(),messageId:m().nullish(),prompt:z(Mg),sessionId:ae}),wM=w({anyOf:z(B8)}),lb=X([vM.and(w({type:$("content")})),zP.and(w({type:$("diff")})),tM.and(w({type:$("terminal")}))]),cb=m(),ub=w({_meta:A(m(),S()).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m()}),hb=X([$("pending"),$("in_progress"),$("completed"),$("failed")]),db=X([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),bM=w({_meta:A(m(),S()).nullish(),content:z(lb).optional(),kind:db.optional(),locations:z(ub).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:hb.optional(),title:m(),toolCallId:cb}),pb=w({_meta:A(m(),S()).nullish(),content:z(lb).nullish(),kind:db.nullish(),locations:z(ub).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:hb.nullish(),title:m().nullish(),toolCallId:cb}),fb=w({_meta:A(m(),S()).nullish(),options:z(NL),sessionId:ae,toolCall:pb}),SM=w({_meta:A(m(),S()).nullish(),hint:m()}),_M=SM,AM=w({_meta:A(m(),S()).nullish(),description:m(),input:_M.nullish(),name:m()}),EM=w({_meta:A(m(),S()).nullish(),availableCommands:z(AM)}),kM=w({enum:z(m()),type:WP}),CM=X([kM,wM]),TM=w({default:z(m()).nullish(),description:m().nullish(),items:CM,maxItems:G().nullish(),minItems:G().nullish(),title:m().nullish()}),$M=X([XD.and(w({type:$("string")})),ML.and(w({type:$("number")})),XP.and(w({type:$("integer")})),LP.and(w({type:$("boolean")})),TM.and(w({type:$("array")}))]),RM=w({description:m().nullish(),properties:A(m(),$M).optional().default({}),required:z(m()).nullish(),title:m().nullish(),type:qP.optional().default("object")}),IM=w({requestedSchema:RM}),xM=Up(X([IM.and(w({mode:$("form")})),YP.and(w({mode:$("url")}))]),w({_meta:A(m(),S()).nullish(),message:m(),sessionId:ae})),PM=w({cachedReadTokens:G().nullish(),cachedWriteTokens:G().nullish(),inputTokens:G(),outputTokens:G(),thoughtTokens:G().nullish(),totalTokens:G()}),LM=w({_meta:A(m(),S()).nullish(),stopReason:JD,usage:PM.nullish(),userMessageId:m().nullish()});X([w({id:ho,result:X([pM,xP,iL,ZD,zD,PD,ND,HD,MP,WD,BD,LM,GD,YD,eM,DP,Y8])}),w({error:W8,id:ho})]);const DM=w({_meta:A(m(),S()).nullish(),cost:OP.nullish(),size:G(),used:G()}),MM=X([Ff.and(w({sessionUpdate:$("user_message_chunk")})),Ff.and(w({sessionUpdate:$("agent_message_chunk")})),Ff.and(w({sessionUpdate:$("agent_thought_chunk")})),bM.and(w({sessionUpdate:$("tool_call")})),pb.and(w({sessionUpdate:$("tool_call_update")})),UL.and(w({sessionUpdate:$("plan")})),EM.and(w({sessionUpdate:$("available_commands_update")})),MD.and(w({sessionUpdate:$("current_mode_update")})),vD.and(w({sessionUpdate:$("config_option_update")})),LD.and(w({sessionUpdate:$("session_info_update")})),DM.and(w({sessionUpdate:$("usage_update")}))]),mb=w({_meta:A(m(),S()).nullish(),sessionId:ae,update:MM});w({method:m(),params:X([mb,FP,j8]).nullish()});const gb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),OM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),NM=w({name:m(),uri:m()}),zM=w({_meta:A(m(),S()).nullish(),repository:TL.nullish(),workspaceFolders:z(NM).nullish(),workspaceUri:m().nullish()});w({id:ho,method:m(),params:X([jL,IP,rL,DL,$D,eL,TD,ID,_D,qD,FD,yM,jD,zM,QD,SD,G8]).nullish()});const vb=w({_meta:A(m(),S()).nullish(),content:m(),path:m(),sessionId:ae});w({id:ho,method:m(),params:X([vb,sb,fb,rb,ab,ob,gb,ib,xM,G8]).nullish()});const ZM=w({_meta:A(m(),S()).nullish()});X([w({id:ho,result:X([ZM,eD,lD,NP,rM,tD,OM,QP,BP,Y8])}),w({error:W8,id:ho})]);var oe;class HM{constructor(e,t){p(this,oe);const r=e(this),i=async(a,l)=>{var c,d,f,g,y,v,_;switch(a){case ur.fs_write_text_file:{const E=vb.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,E)}case ur.fs_read_text_file:{const E=sb.parse(l);return(d=r.readTextFile)==null?void 0:d.call(r,E)}case ur.session_request_permission:{const E=fb.parse(l);return r.requestPermission(E)}case ur.terminal_create:{const E=rb.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,E)}case ur.terminal_output:{const E=ab.parse(l);return(g=r.terminalOutput)==null?void 0:g.call(r,E)}case ur.terminal_release:{const E=ob.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,E))??{}}case ur.terminal_wait_for_exit:{const E=gb.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,E)}case ur.terminal_kill:{const E=ib.parse(l);return await((_=r.killTerminal)==null?void 0:_.call(r,E))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw Oe.methodNotFound(a)}},o=async(a,l)=>{switch(a){case ur.session_update:{const c=mb.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Oe.methodNotFound(a)}};h(this,oe,new UM(i,o,t))}async initialize(e){return await s(this,oe).sendRequest(we.initialize,e)}async newSession(e){return await s(this,oe).sendRequest(we.session_new,e)}async loadSession(e){return await s(this,oe).sendRequest(we.session_load,e)??{}}async unstable_forkSession(e){return await s(this,oe).sendRequest(we.session_fork,e)}async listSessions(e){return await s(this,oe).sendRequest(we.session_list,e)}async unstable_resumeSession(e){return await s(this,oe).sendRequest(we.session_resume,e)}async unstable_closeSession(e){return await s(this,oe).sendRequest(we.session_close,e)}async setSessionMode(e){return await s(this,oe).sendRequest(we.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await s(this,oe).sendRequest(we.session_set_model,e)??{}}async setSessionConfigOption(e){return await s(this,oe).sendRequest(we.session_set_config_option,e)}async authenticate(e){return await s(this,oe).sendRequest(we.authenticate,e)??{}}async unstable_logout(e){return await s(this,oe).sendRequest(we.logout,e)??{}}async prompt(e){return await s(this,oe).sendRequest(we.session_prompt,e)}async cancel(e){return await s(this,oe).sendNotification(we.session_cancel,e)}async unstable_startNes(e){return await s(this,oe).sendRequest(we.nes_start,e)}async unstable_suggestNes(e){return await s(this,oe).sendRequest(we.nes_suggest,e)}async unstable_closeNes(e){return await s(this,oe).sendRequest(we.nes_close,e)??{}}async unstable_didOpenDocument(e){return await s(this,oe).sendNotification(we.document_did_open,e)}async unstable_didChangeDocument(e){return await s(this,oe).sendNotification(we.document_did_change,e)}async unstable_didCloseDocument(e){return await s(this,oe).sendNotification(we.document_did_close,e)}async unstable_didSaveDocument(e){return await s(this,oe).sendNotification(we.document_did_save,e)}async unstable_didFocusDocument(e){return await s(this,oe).sendNotification(we.document_did_focus,e)}async unstable_acceptNes(e){return await s(this,oe).sendNotification(we.nes_accept,e)}async unstable_rejectNes(e){return await s(this,oe).sendNotification(we.nes_reject,e)}async extMethod(e,t){return await s(this,oe).sendRequest(e,t)}async extNotification(e,t){return await s(this,oe).sendNotification(e,t)}get signal(){return s(this,oe).signal}get closed(){return s(this,oe).closed}}oe=new WeakMap;var li,Nd,Tc,$c,ta,na,xn,Rc,Ae,yb,k0,wb,bb,Sb,_b,C0,Fl;class UM{constructor(e,t,r){p(this,Ae);p(this,li,new Map);p(this,Nd,0);p(this,Tc);p(this,$c);p(this,ta);p(this,na,Promise.resolve());p(this,xn,new AbortController);p(this,Rc);h(this,Tc,e),h(this,$c,t),h(this,ta,r),h(this,Rc,new Promise(i=>{s(this,xn).signal.addEventListener("abort",()=>i())})),u(this,Ae,yb).call(this)}get signal(){return s(this,xn).signal}get closed(){return s(this,Rc)}async sendRequest(e,t){u(this,Ae,C0).call(this);const r=nh(this,Nd)._++,i=new Promise((o,a)=>{s(this,li).set(r,{resolve:o,reject:a})});return await u(this,Ae,Fl).call(this,{jsonrpc:"2.0",id:r,method:e,params:t}),i}async sendNotification(e,t){u(this,Ae,C0).call(this),await u(this,Ae,Fl).call(this,{jsonrpc:"2.0",method:e,params:t})}}li=new WeakMap,Nd=new WeakMap,Tc=new WeakMap,$c=new WeakMap,ta=new WeakMap,na=new WeakMap,xn=new WeakMap,Rc=new WeakMap,Ae=new WeakSet,yb=async function(){let e;try{const t=s(this,ta).readable.getReader();try{for(;!s(this,xn).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{u(this,Ae,wb).call(this,r)}catch(o){console.error("Unexpected error during message processing:",r,o),"id"in r&&r.id!==void 0&&u(this,Ae,Fl).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{t.releaseLock()}}catch(t){e=t}finally{u(this,Ae,k0).call(this,e)}},k0=function(e){if(s(this,xn).signal.aborted)return;const t=e??new Error("ACP connection closed");for(const r of s(this,li).values())r.reject(t);s(this,li).clear(),s(this,xn).abort(t)},wb=async function(e){if("method"in e&&"id"in e){const t=await u(this,Ae,bb).call(this,e.method,e.params);"error"in t&&console.error("Error handling request",e,t.error),await u(this,Ae,Fl).call(this,{jsonrpc:"2.0",id:e.id,...t})}else if("method"in e){const t=await u(this,Ae,Sb).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?u(this,Ae,_b).call(this,e):console.error("Invalid message",{message:e})},bb=async function(e,t){try{return{result:await s(this,Tc).call(this,e,t)??null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof Sy)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},Sb=async function(e,t){try{return await s(this,$c).call(this,e,t),{result:null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof Sy)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},_b=function(e){const t=s(this,li).get(e.id);if(t){if("result"in e)t.resolve(e.result);else if("error"in e){const{code:r,message:i,data:o}=e.error;t.reject(new Oe(r,i,o))}s(this,li).delete(e.id)}else console.error("Got response to unknown request",e.id)},C0=function(){if(s(this,xn).signal.aborted)throw s(this,xn).signal.reason??new Error("ACP connection closed")},Fl=async function(e){return h(this,na,s(this,na).then(async()=>{const t=s(this,ta).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{u(this,Ae,k0).call(this,t)})),s(this,na)};class Oe extends Error{constructor(t,r,i){super(r);C(this,"code");C(this,"data");this.code=t,this.name="RequestError",this.data=i}static parseError(t,r){return new Oe(-32700,`Parse error${r?`: ${r}`:""}`,t)}static invalidRequest(t,r){return new Oe(-32600,`Invalid request${r?`: ${r}`:""}`,t)}static methodNotFound(t){return new Oe(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,r){return new Oe(-32602,`Invalid params${r?`: ${r}`:""}`,t)}static internalError(t,r){return new Oe(-32603,`Internal error${r?`: ${r}`:""}`,t)}static authRequired(t,r){return new Oe(-32e3,`Authentication required${r?`: ${r}`:""}`,t)}static resourceNotFound(t){return new Oe(-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 VM(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function Ab(n){var t;class e extends n{constructor(...o){super(...o);p(this,t,!1);VM(this,()=>s(this,t),()=>{h(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,t)}}return t=new WeakMap,e}const FM=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,BM=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,qM=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,WM=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,jM=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,GM="single_session",YM={name:"television-acp-client",version:"0.0.0"},Eb="agent:main:television",JM=Ab(Kr);var ra,Pn,Rt,Ln,ci,ln,br,Dn,Mn,ui,cn,ia,sa,On,tt,Sr,oa,_s,_r,hi,Ic,un,Nn,zd,zn,R,T0,kb,Cb,Tb,Dh,$b,Rb,Ib,xb,Pb,Lb,Db,rs,Lo,Do,dr,Mb,Mo,$0,R0,Mh,Ob,Oh,I0,x0,xc,Pc,Nh,Oo,P0,Nb;class KM extends JM{constructor(t){super();p(this,R);p(this,ra,"disconnected");p(this,Pn,null);p(this,Rt,new Map);p(this,Ln,null);p(this,ci,null);p(this,ln,null);p(this,br,null);p(this,Dn,null);p(this,Mn,null);p(this,ui);p(this,cn,null);p(this,ia,0);p(this,sa,1);p(this,On,null);p(this,tt,null);p(this,Sr,!1);p(this,oa,!1);p(this,_s,!1);p(this,_r,null);p(this,hi,new Set);p(this,Ic);p(this,un);p(this,Nn);p(this,zd,t=>{u(this,R,Cb).call(this,t)});p(this,zn,null);p(this,xc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket closed")});p(this,Pc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket error")});h(this,un,t),h(this,Nn,t.sessionMode??GM),h(this,ui,t.mappedSessionStore??XM()),h(this,Ic,t.createSocket??(r=>new WebSocket(r)))}get status(){return s(this,ra)}get messages(){return[...s(this,Rt).values()]}get enabled(){return s(this,un).enabled??!1}setToken(t){s(this,un).token=t??""}setEnabled(t){s(this,un).enabled=t,t||(u(this,R,Nh).call(this),h(this,Pn,null),u(this,R,dr).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){s(this,ci)===null&&(h(this,Pn,null),h(this,ci,u(this,R,kb).call(this)));try{await s(this,ci),await u(this,R,Dh).call(this)}catch(t){throw u(this,R,Oo).call(this,Bf(t)),t}}}dispose(){u(this,R,Nh).call(this),h(this,Pn,null),u(this,R,dr).call(this,"disposed")}async sendMessage(t){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,T0).call(this,"ready")),(s(this,Dn)===null||s(this,cn)!==u(this,R,Oh).call(this))&&await u(this,R,Dh).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");u(this,R,Lo).call(this,{id:u(this,R,Mo).call(this,"user"),kind:"user",text:r,status:"final"}),u(this,R,dr).call(this,"running");try{const i=await u(this,R,Mh).call(this).prompt({sessionId:u(this,R,R0).call(this),prompt:[{type:"text",text:u(this,R,Mb).call(this,r)}]});u(this,R,rs).call(this,i.stopReason==="cancelled"?"cancelled":"final"),u(this,R,dr).call(this,"ready")}catch(i){throw u(this,R,Nb).call(this)||(u(this,R,rs).call(this,"error"),u(this,R,dr).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,T0).call(this,"ready"));const t=u(this,R,Oh).call(this);((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="mapped"?s(this,ui).clearActualSessionId(t):h(this,ia,s(this,ia)+1),h(this,ln,null),h(this,br,null),h(this,Dn,null),h(this,cn,null),u(this,R,P0).call(this)}async cancel(){this.status==="running"&&(u(this,R,dr).call(this,"cancelling"),await u(this,R,Mh).call(this).cancel({sessionId:u(this,R,R0).call(this)}))}setChannelContext(t){var o,a,l;if(t===null){if(s(this,tt)===null)return;h(this,tt,null),h(this,Sr,!1);return}const r={channelID:t.channelID,channelName:t.channelName};if(((o=s(this,tt))==null?void 0:o.channelID)===r.channelID&&((a=s(this,tt))==null?void 0:a.channelName)===r.channelName)return;const i=((l=s(this,tt))==null?void 0:l.channelID)??null;if(h(this,tt,r),s(this,Nn)==="single_session"){(!s(this,cn)||i!==r.channelID)&&h(this,Sr,!0);return}s(this,cn)!==u(this,R,I0).call(this,r.channelID)&&(h(this,ln,null),h(this,br,null),s(this,Ln)&&this.status==="ready"&&u(this,R,Dh).call(this).catch(c=>{u(this,R,Oo).call(this,Bf(c))}))}}ra=new WeakMap,Pn=new WeakMap,Rt=new WeakMap,Ln=new WeakMap,ci=new WeakMap,ln=new WeakMap,br=new WeakMap,Dn=new WeakMap,Mn=new WeakMap,ui=new WeakMap,cn=new WeakMap,ia=new WeakMap,sa=new WeakMap,On=new WeakMap,tt=new WeakMap,Sr=new WeakMap,oa=new WeakMap,_s=new WeakMap,_r=new WeakMap,hi=new WeakMap,Ic=new WeakMap,un=new WeakMap,Nn=new WeakMap,zd=new WeakMap,zn=new WeakMap,R=new WeakSet,T0=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(s(this,Pn)??"ACPClient is disconnected");await new Promise((r,i)=>{const o=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===t){o(),r();return}if(this.status==="disposed"){o(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(o(),i(new Error(s(this,Pn)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},kb=async function(){try{const{stream:t,socket:r,metadata:i}=await nO({serverURL:s(this,un).serverURL,token:s(this,un).token,createSocket:s(this,Ic),onDisconnect:s(this,zd)});h(this,Mn,i),h(this,zn,r),r.addEventListener("close",s(this,xc)),r.addEventListener("error",s(this,Pc)),h(this,Ln,new HM(o=>({connection:o,sessionUpdate:async a=>{await u(this,R,Rb).call(this,a)},requestPermission:async a=>u(this,R,Ib).call(this,a)}),t)),await s(this,Ln).initialize({protocolVersion:AP,clientCapabilities:{},clientInfo:YM})}catch(t){throw t}},Cb=function(t){u(this,R,Oo).call(this,Bf(t))},Tb=function(t){const r=t==null?void 0:t.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(o=>o.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},Dh=async function(){const t=u(this,R,Oh).call(this);if(s(this,ln)&&s(this,br)===t){await s(this,ln);return}h(this,br,t),h(this,ln,u(this,R,$b).call(this,t)),await s(this,ln)},$b=async function(t){var c;const r=u(this,R,Mh).call(this);u(this,R,P0).call(this);let i,o=!1,a=null;const l={cwd:u(this,R,Ob).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(h(this,_s,!0),h(this,_r,null),((c=s(this,Mn))==null?void 0:c.sessionIdStrategy)==="mapped"){const d=s(this,ui).getActualSessionId(t);if(d)try{const f=await r.loadSession({...l,sessionId:d});if(QM(f))throw new Error("Mapped ACP session was not found");a=f,i=d,o=!0}catch{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}else{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}}else try{a=await r.loadSession({...l,sessionId:t}),i=t,o=s(this,Rt).size>0}catch{const d=await r.newSession(l);a=d,i=d.sessionId,o=!1}}finally{h(this,_s,!1),h(this,_r,null),u(this,R,rs).call(this,"final")}u(this,R,Tb).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),h(this,Dn,i),h(this,cn,t),h(this,oa,!0),o?(s(this,hi).add(t),s(this,Nn)==="single_session"&&h(this,Sr,!1)):(s(this,hi).delete(t),h(this,Sr,s(this,Nn)==="single_session")),h(this,Pn,null),u(this,R,dr).call(this,"ready")},Rb=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&u(this,R,Db).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&u(this,R,xb).call(this,r.content.text);return;case"tool_call":u(this,R,Pb).call(this,r);return;case"tool_call_update":u(this,R,Lb).call(this,r);return;case"agent_thought_chunk":return;default:return}},Ib=async function(t){return{outcome:{outcome:"cancelled"}}},xb=function(t){h(this,_r,null);const r=tO(t);if(!r)return;if(!s(this,On)){const o={id:u(this,R,Mo).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};h(this,On,o.id),u(this,R,Lo).call(this,o);return}const i=s(this,Rt).get(s(this,On));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");u(this,R,Do).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Pb=function(t){u(this,R,rs).call(this,"final");const r=u(this,R,$0).call(this,t.toolCallId),i=Ly("content"in t?t.content:void 0),o={id:(r==null?void 0:r.id)??u(this,R,Mo).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){u(this,R,Do).call(this,o);return}u(this,R,Lo).call(this,o)},Lb=function(t){const r=u(this,R,$0).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",o=Ly(t.content),a=o?`${i}${o}`:i,l={id:(r==null?void 0:r.id)??u(this,R,Mo).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:a,locations:t.locations??(r==null?void 0:r.locations)};if(r){u(this,R,Do).call(this,l);return}u(this,R,Lo).call(this,l)},Db=function(t){if(u(this,R,rs).call(this,"final"),!t)return;const r=s(this,_s)?s(this,_r):null;if(!r){const o=Py(t);if(!o)return;const a={id:u(this,R,Mo).call(this,"user"),kind:"user",text:o,status:"final"};u(this,R,Lo).call(this,a),s(this,_s)&&h(this,_r,a.id);return}const i=s(this,Rt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");u(this,R,Do).call(this,{...i,text:Py(`${i.text}${t}`)})},rs=function(t){if(!s(this,On))return;const r=s(this,Rt).get(s(this,On));(r==null?void 0:r.kind)==="assistant"&&u(this,R,Do).call(this,{...r,status:t}),h(this,On,null)},Lo=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Hf("messages-changed"))},Do=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Hf("messages-changed"))},dr=function(t){s(this,ra)!==t&&(h(this,ra,t),this.dispatchEvent(new o$("status-changed")))},Mb=function(t){const r=s(this,cn);if(!r)return t;const i=s(this,tt)?s(this,Nn)==="single_session"?s(this,Sr)||!s(this,hi).has(r):!s(this,hi).has(r):!1,o=s(this,oa)&&(s(this,tt)!==null||WM.test(t));if(!(o||i))return t;o&&h(this,oa,!1),i&&(h(this,Sr,!1),s(this,hi).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 s(this,tt)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${s(this,tt).channelID}`),l.push(`channel_name: ${s(this,tt).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
+ `)},Mo=function(t){const r=`${t}-${s(this,sa)}`;return h(this,sa,s(this,sa)+1),r},$0=function(t){for(const r of s(this,Rt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===t)return r;return null},R0=function(){if(!s(this,Dn))throw new Error("ACP session is not ready");return s(this,Dn)},Mh=function(){if(!s(this,Ln))throw new Error("ACP connection is not ready");return s(this,Ln)},Ob=function(){var r;const t=(r=s(this,Mn))==null?void 0:r.sessionCwd;if(!t)throw new Error("ACP bridge session cwd is not ready");return t},Oh=function(){var r;if(s(this,Nn)==="single_session")return u(this,R,x0).call(this,`${Eb}-${(s(this,un).clientGUID??"default-client").toLowerCase()}`);const t=(r=s(this,tt))==null?void 0:r.channelID;if(!t)throw new Error("Channel context is required for per-channel session mode");return u(this,R,I0).call(this,t)},I0=function(t){return u(this,R,x0).call(this,eO(s(this,Nn),t,s(this,un).clientGUID??"default-client"))},x0=function(t){var r;return((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&s(this,ia)>0?`${t}:epoch-${s(this,ia)}`:t},xc=new WeakMap,Pc=new WeakMap,Nh=function(){h(this,Ln,null),h(this,ci,null),h(this,ln,null),h(this,br,null),h(this,Dn,null),h(this,cn,null),h(this,Mn,null),s(this,zn)&&(s(this,zn).removeEventListener("close",s(this,xc)),s(this,zn).removeEventListener("error",s(this,Pc)),s(this,zn).close(),h(this,zn,null))},Oo=function(t){const r=s(this,Ln)!==null||s(this,ci)!==null||s(this,ln)!==null||s(this,br)!==null||s(this,Dn)!==null||s(this,cn)!==null||s(this,Mn)!==null||s(this,zn)!==null;this.disposed||this.status==="disconnected"&&!r||(u(this,R,rs).call(this,"error"),u(this,R,Nh).call(this),h(this,Pn,t??null),u(this,R,dr).call(this,"disconnected"))},P0=function(){const t=s(this,Rt).size>0;h(this,On,null),h(this,_r,null),h(this,sa,1),s(this,Rt).clear(),t&&this.dispatchEvent(new Hf("messages-changed"))},Nb=function(){return this.status==="disconnected"};function XM(){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 QM(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function eO(n,e,t){return n==="single_session"?`${Eb}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function zb(n){return n.replace(/^(?:\s*\n)+/,"")}function Py(n){let e=n;return e=e.replace(FM,""),e=e.replace(BM,""),e=e.replace(qM,""),e=zb(e),e}function tO(n){let e=n;return e=e.replace(jM,""),e=zb(e),e}function Ly(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function nO(n){const e=n.createSocket(sO(n.serverURL,n.token));let t=!1,r,i;const o=new Promise((d,f)=>{r=d,i=f}),a=new ReadableStream({start(d){let f=!1;const g=()=>{e.send(JSON.stringify({type:"acp-bridge-connect"}))},y=E=>{const x=iO(E);if(!x)return;let B;try{B=JSON.parse(x)}catch(P){const J=P instanceof Error?P:new Error(String(P));i(J),d.error(J);return}switch(B.type){case"acp-bridge-status":if(B.status==="ready"){let P;try{P=rO(B)}catch(J){const O=J instanceof Error?J:new Error(String(J));t||i(O),d.error(O);return}t||(t=!0,r(P));return}if(B.status==="error"||B.status==="exited"){const P=new Error(B.error??`ACP bridge ${B.status}`);t||i(P),d.error(P)}return;case"acp-bridge-message":d.enqueue(B.message);return}},v=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket closed");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.close()},_=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket error");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.error(E)};e.addEventListener("open",g),e.addEventListener("message",y),e.addEventListener("close",v),e.addEventListener("error",_)}}),l=new WritableStream({async write(d){await o,e.send(JSON.stringify({type:"acp-bridge-message",message:d}))},close(){e.close()},abort(){e.close()}}),c=await o;return{stream:{readable:a,writable:l},socket:e,metadata:c}}function rO(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 iO(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 sO(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 Bf(n){return n instanceof Error?n.message:String(n)}const Dy="television.acpClientGUID",My="television.acpMappedSessions",Oy=1;var aa;class oO{constructor(){p(this,aa,new Map)}getActualSessionId(e){return s(this,aa).get(e)??null}setActualSessionId(e,t){s(this,aa).set(e,t)}clearActualSessionId(e){s(this,aa).delete(e)}}aa=new WeakMap;var la,Lc,Mt,zh,Zh,L0;class aO{constructor(e,t){p(this,Mt);p(this,la);p(this,Lc);h(this,la,e),h(this,Lc,t)}getActualSessionId(e){const t=u(this,Mt,Zh).call(this)[u(this,Mt,zh).call(this,e)];return typeof t=="string"&&t.length>0?t:null}setActualSessionId(e,t){const r=u(this,Mt,Zh).call(this);r[u(this,Mt,zh).call(this,e)]=t,u(this,Mt,L0).call(this,r)}clearActualSessionId(e){const t=u(this,Mt,Zh).call(this);delete t[u(this,Mt,zh).call(this,e)],u(this,Mt,L0).call(this,t)}}la=new WeakMap,Lc=new WeakMap,Mt=new WeakSet,zh=function(e){return JSON.stringify([s(this,Lc),e])},Zh=function(){const e=s(this,la).getItem(My);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!==Oy?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},L0=function(e){const t={version:Oy,entries:e};s(this,la).setItem(My,JSON.stringify(t))};function Zb(){return typeof window>"u"?null:window.localStorage}function lO(n){const e=n.getItem(Dy);if(e)return e;const t=Cg().toLowerCase();return n.setItem(Dy,t),t}const Ny=4401,cO=401,fh=1e3,uO=3e4;class Hh extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class hO extends Kr{constructor(t){var a,l;super();C(this,"url");C(this,"name");C(this,"telemetryMeta");C(this,"status","unauthorized");C(this,"channels",new Map);C(this,"client");C(this,"acpClient");C(this,"_token");C(this,"attempting",!1);C(this,"nextRetryAt",null);C(this,"hasEverConnected",!1);C(this,"browserDemoMode",!1);C(this,"hasAuthRejected",!1);C(this,"hasAuthTokenRejected",!1);C(this,"bootState","pending");C(this,"serverVersion",null);C(this,"updateState",null);C(this,"decideBoot");C(this,"navigationPending");C(this,"createSocket");C(this,"createClient");C(this,"socket",null);C(this,"connectAttempt",0);C(this,"autoReconnect",!1);C(this,"retryTimer",null);C(this,"retryDelay",fh);C(this,"visibilityEventTarget");C(this,"networkEventTarget");C(this,"onVisibilityChange");C(this,"onNetworkOnline");C(this,"telemetryActivityAgent");this.url=Fi(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,d,f)=>new LT(c,{token:d??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 aO(t.acpStorage,this.url):new oO);this.acpClient=new KM({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()},(a=this.visibilityEventTarget)==null||a.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,o=t.telemetryWindowTarget!==void 0?t.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&o?bP({meta:this.telemetryMeta,documentTarget:i,windowTarget:o,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=fh,this.autoReconnect=!0,await this.attempt()}dispose(){var t,r,i,o;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),(o=this.telemetryActivityAgent)==null||o.stop(),this.acpClient.dispose()}getViewURL(t){const r=Ad(t,this.renderOptions());return Br()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}async readDemoMode(){try{return await this.client.demoMode()}catch{return null}}renderOptions(){return{electron:Br(),browserDemo:this.browserDemoMode}}getContentURL(t){const r=Ad(t,this.renderOptions()).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 Ul("channels-changed"));break;case"channel-updated":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Ul("channels-changed"));break;case"channel-removed":this.channels.delete(t.channelID),this.dispatchEvent(new Ul("channels-changed"));break;case"artifact-created":{const r=this.channels.get(t.channelID);r&&!gT(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...V2},size:{...F2}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=f0(r.layout,t.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return dO(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 At("change"));const r=this.createSocket(pO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((o,a)=>{let l=!1;const c=()=>{var g;l||this.connectAttempt!==t||(l=!0,this.retryDelay=fh,this.hasEverConnected=!0,this.setStatus("connected"),(g=this.telemetryActivityAgent)==null||g.start(),o())},d=g=>{l||this.connectAttempt!==t||(l=!0,a(g))},f=async()=>{const g=this.hasEverConnected;try{const[{channels:y},v,_]=await Promise.all([this.client.channels.list(),this.client.display.get(),g?null:this.readDemoMode()]);g||(this.browserDemoMode=(_==null?void 0:_.browserExternalPages)===!0),this.channels=new Map(y.map(E=>[E.id,structuredClone(E)])),this.acpClient.setEnabled(v.acpEnabled),this.dispatchEvent(new At("change")),g&&this.dispatchEvent(new Ul("channels-changed")),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:v.focusedChannelId}})),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...v.pinnedChannelIds]}})),c(),g&&this.connectAttempt===t&&this.dispatchEvent(new e8("server-reconnected",{serverURL:this.url}))}catch(y){if(wO(y)){d(new Hh);return}d(y instanceof Error?y:new Error(String(y)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",g=>{const y=yO(g);if(!y)return;if(y.type==="server-status"){const _=y;this.serverVersion=_.version,this.updateState=_.update??null;let E=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===t&&(this.decideBoot(_)==="boot"?(this.bootState="booted",E=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new t8("server-status",{serverURL:this.url,message:_})),E?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new At("change"));return}if(!vO(y.type))return;const v=y;this.applyServerEvent(v),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:v}))}),r.addEventListener("close",g=>{if(this.connectAttempt!==t)return;this.socket=null;const y=fO(g);if(!l){d(y===Ny?new Hh:new Error("Connection closed before initialization"));return}if(y===Ny){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}d(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},o=>{throw this.attempting=!1,this.handleAttemptFailure(o),o})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(t){if(t instanceof Hh){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,uO),this.nextRetryAt=Date.now()+t,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},t),this.dispatchEvent(new At("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new At("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=fh,this.attempt().catch(()=>{})))}sendTelemetryActivity(t){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(t)))}sendTelemetrySignal(t,r){var o;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:mT,clientId:this.telemetryMeta.clientId,event:t,properties:r};(o=this.socket)==null||o.send(JSON.stringify(i))}setStatus(t){this.status!==t&&(this.status=t,this.dispatchEvent(new At("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function dO(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function pO(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,o]of wP(t))r.searchParams.set(i,o);return r.hash="",r.toString()}function fO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const mO={"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,"appearance-changed":!0,"artifact-focus":!0},gO=new Set(Object.keys(mO));function vO(n){return gO.has(n)}function yO(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 wO(n){return n instanceof pl&&n.status===cO}const bO="Local";var Vt,hn,rr,D0,M0,Hb,Dc,Mc,Oc,Nc,zc;class SO extends Kr{constructor(t){super();p(this,rr);C(this,"connection");C(this,"clientGUID");C(this,"acpStorage");C(this,"connectError",null);p(this,Vt);p(this,hn,!1);p(this,Dc,()=>{s(this,hn)||(u(this,rr,Hb).call(this),this.dispatchEvent(new At("change")))});p(this,Mc,t=>{s(this,hn)||this.dispatchEvent(new Ph("server-event",{serverURL:t.serverURL,event:t.event}))});p(this,Oc,()=>{s(this,hn)||this.dispatchEvent(new Ul("channels-changed"))});p(this,Nc,t=>{s(this,hn)||this.dispatchEvent(new e8("server-reconnected",{serverURL:t.serverURL}))});p(this,zc,t=>{s(this,hn)||this.dispatchEvent(new t8("server-status",{serverURL:t.serverURL,message:t.message}))});h(this,Vt,t.localStore),this.acpStorage=t.acpStorage===void 0?Zb():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?lO(this.acpStorage):Cg().toLowerCase());const r=Fi(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&s(this,Vt).set(iy(s(this,Vt).get(),r,t.launchToken));const i=t.launchToken??ry(s(this,Vt).get(),r),o=t.createSocket??(l=>new WebSocket(l)),a=t.createConnection??(l=>new hO(l));this.connection=a({url:r,name:t.connectionName??bO,token:i,createSocket:o,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:t.telemetryMeta??null,decideBoot:t.decideBoot,navigationPending:t.navigationPending}),this.connection.addEventListener("change",s(this,Dc)),this.connection.addEventListener("server-event",s(this,Mc)),this.connection.addEventListener("channels-changed",s(this,Oc)),this.connection.addEventListener("server-reconnected",s(this,Nc)),this.connection.addEventListener("server-status",s(this,zc))}get storedAuthToken(){return ry(s(this,Vt).get(),this.connection.url)}async connect(){await u(this,rr,D0).call(this,this.connection.token)}async authenticate(t){s(this,Vt).set(iy(s(this,Vt).get(),this.connection.url,t)),await u(this,rr,D0).call(this,t)}dispose(){s(this,hn)||(h(this,hn,!0),this.connection.removeEventListener("change",s(this,Dc)),this.connection.removeEventListener("server-event",s(this,Mc)),this.connection.removeEventListener("channels-changed",s(this,Oc)),this.connection.removeEventListener("server-reconnected",s(this,Nc)),this.connection.removeEventListener("server-status",s(this,zc)),this.connection.dispose())}}Vt=new WeakMap,hn=new WeakMap,rr=new WeakSet,D0=async function(t){if(!s(this,hn)){u(this,rr,M0).call(this,null);try{await this.connection.connect(t)}catch(r){u(this,rr,M0).call(this,r instanceof Hh?null:r instanceof Error?r.message:String(r))}}},M0=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new At("change")))},Hb=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=s(this,Vt).get(),r=u$(t,this.connection.url);r!==t&&s(this,Vt).set(r),this.connection.token!==null&&this.connection.clearToken()},Dc=new WeakMap,Mc=new WeakMap,Oc=new WeakMap,Nc=new WeakMap,zc=new WeakMap;const O0="tv-nav:",nl="tv-reload",zy=100,_O=1e3,AO=60,EO=60,kO=24,CO=30,TO=CO*kO*EO*AO*_O;function qr(n){try{const e=new URL(n,window.location.href),t=e.searchParams.has(nl);return e.searchParams.delete(nl),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:t?e.toString():n}catch{return n}}var Zc,ca,ge,pe,As,Pe,Ub,Qr,Vb,N0,z0;class $O extends Kr{constructor(t,r){super();p(this,Pe);p(this,Zc);p(this,ca);p(this,ge,[]);p(this,pe,-1);p(this,As,0);h(this,Zc,t),h(this,ca,qr(r)),u(this,Pe,Ub).call(this)}get currentURL(){var t;return s(this,pe)===-1?null:((t=s(this,ge)[s(this,pe)])==null?void 0:t.url)??null}get canGoBack(){return s(this,pe)>-1}get canGoForward(){return s(this,pe)<s(this,ge).length-1}get entries(){return s(this,ge).map(t=>({...t}))}get cursor(){return s(this,pe)}navigate(t){const r=qr(t);if(r===s(this,ca)){if(s(this,pe)===-1)return;h(this,pe,-1),u(this,Pe,Qr).call(this);return}s(this,pe)<s(this,ge).length-1&&h(this,ge,s(this,ge).slice(0,s(this,pe)+1)),s(this,ge).push({url:r}),h(this,pe,s(this,ge).length-1),u(this,Pe,N0).call(this),u(this,Pe,Qr).call(this)}replace(t){var i;if(s(this,pe)===-1){this.navigate(t);return}const r=qr(t);if(r===s(this,ca)){h(this,ge,s(this,ge).filter((o,a)=>a!==s(this,pe))),h(this,pe,-1),u(this,Pe,Qr).call(this);return}((i=s(this,ge)[s(this,pe)])==null?void 0:i.url)!==r&&(h(this,ge,s(this,ge).map((o,a)=>a===s(this,pe)?{url:r}:o)),u(this,Pe,Qr).call(this))}back(){s(this,pe)!==-1&&(h(this,pe,s(this,pe)-1),u(this,Pe,Qr).call(this))}forward(){this.canGoForward&&(h(this,pe,s(this,pe)+1),u(this,Pe,Qr).call(this))}reset(){s(this,pe)===-1&&s(this,ge).length===0||(h(this,ge,[]),h(this,pe,-1),u(this,Pe,Qr).call(this))}}Zc=new WeakMap,ca=new WeakMap,ge=new WeakMap,pe=new WeakMap,As=new WeakMap,Pe=new WeakSet,Ub=function(){const t=localStorage.getItem(s(this,Pe,z0));if(t!==null)try{const r=JSON.parse(t);if(!Fb(r))return;h(this,ge,r.entries.map(i=>({url:i.url}))),h(this,pe,r.cursor),h(this,As,r.lastWritten),u(this,Pe,N0).call(this)}catch{h(this,ge,[]),h(this,pe,-1),h(this,As,0)}},Qr=function(){h(this,As,Date.now());try{localStorage.setItem(s(this,Pe,z0),JSON.stringify(u(this,Pe,Vb).call(this)))}catch(t){if(!xO(t))throw t}this.dispatchEvent(new At("change"))},Vb=function(){return{v:1,entries:s(this,ge).map(t=>({...t})),cursor:s(this,pe),lastWritten:s(this,As)}},N0=function(){if(s(this,ge).length<=zy)return;const t=s(this,ge).length-zy;h(this,ge,s(this,ge).slice(t)),h(this,pe,Math.max(-1,s(this,pe)-t))},z0=function(){return RO(s(this,Zc))};function RO(n){return`${O0}${n}`}function IO(n){const e=Date.now()-TO,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(O0)))continue;const o=i.slice(O0.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{t.push(i);continue}if(!Fb(l)){t.push(i);continue}!n.has(o)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function xO(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function Fb(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 qf="tv-channel-sidebar-collapsed";var Es;class PO{constructor(e){p(this,Es);h(this,Es,e)}read(){return s(this,Es).getItem(qf)==="true"}setCollapsed(e){try{e?s(this,Es).setItem(qf,"true"):s(this,Es).removeItem(qf)}catch{}}}Es=new WeakMap;const Wf="tv-channel-sidebar-width",Z0=160,H0=350,mh=260,LO=/^-?\d+$/;var ks;class DO{constructor(e){p(this,ks);h(this,ks,e)}read(){const e=s(this,ks).getItem(Wf);if(e===null||!LO.test(e))return null;const t=BigInt(e);return t<BigInt(Z0)?Z0:t>BigInt(H0)?H0:Number(t)}commit(e){const t=Bb(Math.round(e));try{s(this,ks).setItem(Wf,String(t))}catch{}return t}clear(){try{s(this,ks).removeItem(Wf)}catch{}}}ks=new WeakMap;function Bb(n){return Math.min(Math.max(n,Z0),H0)}const MO="1.4.6";function Og(n=MO){return n!==void 0&&n.length>0?n:"0.0.0"}function Ng(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const U0="tv-reload-attempted";function OO(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:OT(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 NO(n){const e=n.getItem(U0);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 zO(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??Ng(),i=n.bundleVersion??Og();if(e===null)return{dispose(){}};let o=null;const a=()=>{if(o===null)return;const d=n.owner.connection;if(d.url!==n.primaryServerURL||d.status!=="connected")return;const f=o;o=null,d.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=d=>{if(r.pending)return;const f=OO({bundleVersion:i,serverVersion:d.message.version,originMatch:d.serverURL===n.primaryServerURL,marker:NO(e)});switch(f.action){case"reload":e.setItem(U0,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(U0),o={fromVersion:f.fromVersion,toVersion:f.toVersion},a();return;case"none":return}},c=()=>{a()};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 ZO(n){const e=Br(n.search),t=U8(n.search),r=t!==null&&Op(t)?t:null;return{electron:e,shellVersion:r}}function HO(n){return!n.electron||n.requiredDesktopVersion===null||!Op(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===vd?!1:kg(n.requiredDesktopVersion,n.shellVersion)}const UO=`# Desktop app update required
44
44
 
45
- This version of the Television desktop app does not work with this server and needs to be updated. The new version has already downloaded and installs when you restart the app.`,FO=`# Desktop app update required
45
+ This version of the Television desktop app does not work with this server and needs to be updated. The new version has already downloaded and installs when you restart the app.`,VO=`# Desktop app update required
46
46
 
47
- This version of the Television desktop app does not work with this server and needs to be updated. [Download the latest version for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64) and install it.`;function q8(n,e=!1){return e?ZO:n===null?FO:n.upgradeMarkdown}function HO(n){const e=UO(n);return{gated:e,instructionsMarkdown:e?q8(n.desktop):null,suppressUpdateToast:e}}function VO(n){const e=n.reload??(()=>location.reload()),t=n.navigationLatch??zg();let r=null,i=!1;const o=new Set,a=f=>{var g;return HO({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((g=f.update)==null?void 0:g.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const g=f.requiredDesktopVersion;if(g===null||o.has(g))return;o.add(g);const y=r==null?void 0:r.connection;(y==null?void 0:y.url)===n.primaryServerURL&&y.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:g})}const d=f=>{t.pending||f.serverURL===n.primaryServerURL&&(a(f.message).gated?(i=!0,l(),c(f.message)):i&&t.begin(e))};return{get gated(){return i},decideBoot(f){return a(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",d)},dispose(){r==null||r.removeEventListener("server-status",d),r=null}}}var ua;class BO extends Kr{constructor(){super(...arguments);p(this,ua,!1)}get toastsSuppressed(){return s(this,ua)}suppressToasts(){s(this,ua)||(h(this,ua,!0),this.dispatchEvent(new At("change")))}}ua=new WeakMap;const qO=`### Desktop app update ready
47
+ This version of the Television desktop app does not work with this server and needs to be updated. [Download the latest version for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64) and install it.`;function qb(n,e=!1){return e?UO:n===null?VO:n.upgradeMarkdown}function FO(n){const e=HO(n);return{gated:e,instructionsMarkdown:e?qb(n.desktop):null,suppressUpdateToast:e}}function BO(n){const e=n.reload??(()=>location.reload()),t=n.navigationLatch??Ng();let r=null,i=!1;const o=new Set,a=f=>{var g;return FO({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((g=f.update)==null?void 0:g.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const g=f.requiredDesktopVersion;if(g===null||o.has(g))return;o.add(g);const y=r==null?void 0:r.connection;(y==null?void 0:y.url)===n.primaryServerURL&&y.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:g})}const d=f=>{t.pending||f.serverURL===n.primaryServerURL&&(a(f.message).gated?(i=!0,l(),c(f.message)):i&&t.begin(e))};return{get gated(){return i},decideBoot(f){return a(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",d)},dispose(){r==null||r.removeEventListener("server-status",d),r=null}}}var ua;class qO extends Kr{constructor(){super(...arguments);p(this,ua,!1)}get toastsSuppressed(){return s(this,ua)}suppressToasts(){s(this,ua)||(h(this,ua,!0),this.dispatchEvent(new At("change")))}}ua=new WeakMap;const WO=`### Desktop app update ready
48
48
 
49
- Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,WO="tv-desktop-self-update-dismissed";function jO(n){return qO.replace("{version}",n)}var Zc,ha,Fc,Cs,da;class GO extends Kr{constructor({electron:t,bridge:r}){super();p(this,Zc);p(this,ha);p(this,Fc,!1);p(this,Cs,null);p(this,da,!1);h(this,Zc,t),h(this,ha,r??null)}get version(){return s(this,Cs)}get restarting(){return s(this,da)}subscribe(){if(s(this,Fc))return;h(this,Fc,!0);const t=s(this,ha);!s(this,Zc)||typeof(t==null?void 0:t.onDesktopUpdateDownloaded)!="function"||t.onDesktopUpdateDownloaded(r=>{typeof r!="string"||r.length===0||r===s(this,Cs)||(h(this,Cs,r),this.dispatchEvent(new At("change")))})}restart(){var t,r;s(this,Cs)===null||s(this,da)||(h(this,da,!0),(r=(t=s(this,ha))==null?void 0:t.restartToInstallUpdate)==null||r.call(t),this.dispatchEvent(new At("change")))}}Zc=new WeakMap,ha=new WeakMap,Fc=new WeakMap,Cs=new WeakMap,da=new WeakMap;function YO(n,e=window){const t=e.__televisionAppearanceResolver;if(t!==void 0)return t;const r=e.matchMedia("(prefers-color-scheme: dark)");let i=n;const o=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;e.document.documentElement.dataset.theme=c},l={setPreference(c){o(c)&&(i=c,a())}};return e.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function W8(n){return typeof n=="object"&&n!==null}function j8(n){return!W8(n)||n.type!=="ready"?!1:!("id"in n)}function G8(n){return!(!W8(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const Y8=sn(),J8="No handler registered for update-content",K8="handleUpdateContent: handler already registered",Fy="television-artifact-bridge";function X8(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const Q8=A8(Kr);var pa,fa,ma,Ts,$s,ga,Ne,V0,e6,t6,No,Fh,Hw;let JO=(Hw=class extends Q8{constructor(t){super();p(this,Ne);p(this,pa);p(this,fa);p(this,ma);p(this,Ts,null);p(this,$s,null);p(this,ga,!1);h(this,pa,t);const r=t.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");h(this,fa,r),h(this,ma,i=>u(this,Ne,e6).call(this,i)),s(this,fa).addEventListener("message",s(this,ma))}get content(){return s(this,$s)}set content(t){u(this,Ne,Fh).call(this),h(this,$s,t),s(this,ga)&&u(this,Ne,V0).call(this,t)}handleUpdateContent(t){if(u(this,Ne,Fh).call(this),s(this,Ts)!==null)throw new Error(K8);h(this,Ts,t)}notifyStylesChanged(){if(u(this,Ne,Fh).call(this),!s(this,ga))return;const t={type:"styles-changed"};u(this,Ne,No).call(this,t)}dispose(){s(this,fa).removeEventListener("message",s(this,ma)),h(this,Ts,null)}},pa=new WeakMap,fa=new WeakMap,ma=new WeakMap,Ts=new WeakMap,$s=new WeakMap,ga=new WeakMap,Ne=new WeakSet,V0=function(t){const r={type:"content-updated",content:t};u(this,Ne,No).call(this,r)},e6=function(t){if(this.disposed||t.source!==s(this,pa).contentWindow)return;const r=t.data;if(j8(r)){h(this,ga,!0),this.dispatchEvent(new Y8("ready")),s(this,$s)!==null&&u(this,Ne,V0).call(this,s(this,$s));return}if(G8(r)){u(this,Ne,t6).call(this,r);return}},t6=async function(t){const r=s(this,Ts);if(r===null){u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:J8}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:X8(i)}});return}this.disposed||u(this,Ne,No).call(this,{type:"response",id:t.id,result:{}})},No=function(t){const r=s(this,pa).contentWindow;r&&r.postMessage(t,"*")},Fh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},Hw);var Rs,va,Is,xs,ya,ze,B0,n6,r6,zo,Hh;class KO extends Q8{constructor(t){super();p(this,ze);p(this,Rs);p(this,va);p(this,Is,null);p(this,xs,null);p(this,ya,!1);h(this,Rs,t),h(this,va,r=>u(this,ze,n6).call(this,r)),s(this,Rs).addEventListener("ipc-message",s(this,va))}get content(){return s(this,xs)}set content(t){u(this,ze,Hh).call(this),h(this,xs,t),s(this,ya)&&u(this,ze,B0).call(this,t)}handleUpdateContent(t){if(u(this,ze,Hh).call(this),s(this,Is)!==null)throw new Error(K8);h(this,Is,t)}notifyStylesChanged(){if(u(this,ze,Hh).call(this),!s(this,ya))return;const t={type:"styles-changed"};u(this,ze,zo).call(this,t)}dispose(){s(this,Rs).removeEventListener("ipc-message",s(this,va)),h(this,Is,null)}}Rs=new WeakMap,va=new WeakMap,Is=new WeakMap,xs=new WeakMap,ya=new WeakMap,ze=new WeakSet,B0=function(t){const r={type:"content-updated",content:t};u(this,ze,zo).call(this,r)},n6=function(t){var o;if(this.disposed)return;const r=t.detail??t;if(!r||r.channel!==Fy)return;const i=(o=r.args)==null?void 0:o[0];if(j8(i)){h(this,ya,!0),this.dispatchEvent(new Y8("ready")),s(this,xs)!==null&&u(this,ze,B0).call(this,s(this,xs));return}if(G8(i)){u(this,ze,r6).call(this,i);return}},r6=async function(t){const r=s(this,Is);if(r===null){u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:J8}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:X8(i)}});return}this.disposed||u(this,ze,zo).call(this,{type:"response",id:t.id,result:{}})},zo=function(t){var r,i;(i=(r=s(this,Rs)).send)==null||i.call(r,Fy,t)},Hh=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
49
+ Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,jO="tv-desktop-self-update-dismissed";function GO(n){return WO.replace("{version}",n)}var Hc,ha,Uc,Cs,da;class YO extends Kr{constructor({electron:t,bridge:r}){super();p(this,Hc);p(this,ha);p(this,Uc,!1);p(this,Cs,null);p(this,da,!1);h(this,Hc,t),h(this,ha,r??null)}get version(){return s(this,Cs)}get restarting(){return s(this,da)}subscribe(){if(s(this,Uc))return;h(this,Uc,!0);const t=s(this,ha);!s(this,Hc)||typeof(t==null?void 0:t.onDesktopUpdateDownloaded)!="function"||t.onDesktopUpdateDownloaded(r=>{typeof r!="string"||r.length===0||r===s(this,Cs)||(h(this,Cs,r),this.dispatchEvent(new At("change")))})}restart(){var t,r;s(this,Cs)===null||s(this,da)||(h(this,da,!0),(r=(t=s(this,ha))==null?void 0:t.restartToInstallUpdate)==null||r.call(t),this.dispatchEvent(new At("change")))}}Hc=new WeakMap,ha=new WeakMap,Uc=new WeakMap,Cs=new WeakMap,da=new WeakMap;function JO(n,e=window){const t=e.__televisionAppearanceResolver;if(t!==void 0)return t;const r=e.matchMedia("(prefers-color-scheme: dark)");let i=n;const o=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;e.document.documentElement.dataset.theme=c},l={setPreference(c){o(c)&&(i=c,a())}};return e.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function Wb(n){return typeof n=="object"&&n!==null}function jb(n){return!Wb(n)||n.type!=="ready"?!1:!("id"in n)}function Gb(n){return!(!Wb(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const Yb=sn(),Jb="No handler registered for update-content",Kb="handleUpdateContent: handler already registered",Zy="television-artifact-bridge";function Xb(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const Qb=Ab(Kr);var pa,fa,ma,Ts,$s,ga,Ne,V0,e6,t6,No,Uh,Hw;let KO=(Hw=class extends Qb{constructor(t){super();p(this,Ne);p(this,pa);p(this,fa);p(this,ma);p(this,Ts,null);p(this,$s,null);p(this,ga,!1);h(this,pa,t);const r=t.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");h(this,fa,r),h(this,ma,i=>u(this,Ne,e6).call(this,i)),s(this,fa).addEventListener("message",s(this,ma))}get content(){return s(this,$s)}set content(t){u(this,Ne,Uh).call(this),h(this,$s,t),s(this,ga)&&u(this,Ne,V0).call(this,t)}handleUpdateContent(t){if(u(this,Ne,Uh).call(this),s(this,Ts)!==null)throw new Error(Kb);h(this,Ts,t)}notifyStylesChanged(){if(u(this,Ne,Uh).call(this),!s(this,ga))return;const t={type:"styles-changed"};u(this,Ne,No).call(this,t)}dispose(){s(this,fa).removeEventListener("message",s(this,ma)),h(this,Ts,null)}},pa=new WeakMap,fa=new WeakMap,ma=new WeakMap,Ts=new WeakMap,$s=new WeakMap,ga=new WeakMap,Ne=new WeakSet,V0=function(t){const r={type:"content-updated",content:t};u(this,Ne,No).call(this,r)},e6=function(t){if(this.disposed||t.source!==s(this,pa).contentWindow)return;const r=t.data;if(jb(r)){h(this,ga,!0),this.dispatchEvent(new Yb("ready")),s(this,$s)!==null&&u(this,Ne,V0).call(this,s(this,$s));return}if(Gb(r)){u(this,Ne,t6).call(this,r);return}},t6=async function(t){const r=s(this,Ts);if(r===null){u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:Jb}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:Xb(i)}});return}this.disposed||u(this,Ne,No).call(this,{type:"response",id:t.id,result:{}})},No=function(t){const r=s(this,pa).contentWindow;r&&r.postMessage(t,"*")},Uh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},Hw);var Rs,va,Is,xs,ya,ze,F0,n6,r6,zo,Vh;class XO extends Qb{constructor(t){super();p(this,ze);p(this,Rs);p(this,va);p(this,Is,null);p(this,xs,null);p(this,ya,!1);h(this,Rs,t),h(this,va,r=>u(this,ze,n6).call(this,r)),s(this,Rs).addEventListener("ipc-message",s(this,va))}get content(){return s(this,xs)}set content(t){u(this,ze,Vh).call(this),h(this,xs,t),s(this,ya)&&u(this,ze,F0).call(this,t)}handleUpdateContent(t){if(u(this,ze,Vh).call(this),s(this,Is)!==null)throw new Error(Kb);h(this,Is,t)}notifyStylesChanged(){if(u(this,ze,Vh).call(this),!s(this,ya))return;const t={type:"styles-changed"};u(this,ze,zo).call(this,t)}dispose(){s(this,Rs).removeEventListener("ipc-message",s(this,va)),h(this,Is,null)}}Rs=new WeakMap,va=new WeakMap,Is=new WeakMap,xs=new WeakMap,ya=new WeakMap,ze=new WeakSet,F0=function(t){const r={type:"content-updated",content:t};u(this,ze,zo).call(this,r)},n6=function(t){var o;if(this.disposed)return;const r=t.detail??t;if(!r||r.channel!==Zy)return;const i=(o=r.args)==null?void 0:o[0];if(jb(i)){h(this,ya,!0),this.dispatchEvent(new Yb("ready")),s(this,xs)!==null&&u(this,ze,F0).call(this,s(this,xs));return}if(Gb(i)){u(this,ze,r6).call(this,i);return}},r6=async function(t){const r=s(this,Is);if(r===null){u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:Jb}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:Xb(i)}});return}this.disposed||u(this,ze,zo).call(this,{type:"response",id:t.id,result:{}})},zo=function(t){var r,i;(i=(r=s(this,Rs)).send)==null||i.call(r,Zy,t)},Vh=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
50
50
  * @license
51
51
  * Copyright 2017 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
- */const cc=globalThis,Hy=n=>n,Ed=cc.trustedTypes,Vy=Ed?Ed.createPolicy("lit-html",{createHTML:n=>n}):void 0,i6="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,s6="?"+ii,XO=`<${s6}>`,po=document,gc=()=>po.createComment(""),vc=n=>n===null||typeof n!="object"&&typeof n!="function",Ug=Array.isArray,QO=n=>Ug(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Gf=`[
54
- \f\r]`,Tl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,By=/-->/g,qy=/>/g,es=RegExp(`>|${Gf}(?:([^\\s"'>=/]+)(${Gf}*=${Gf}*(?:[^
55
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Wy=/'/g,jy=/"/g,o6=/^(?:script|style|textarea|title)$/i,eN=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),M=eN(1),at=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),Gy=new WeakMap,ds=po.createTreeWalker(po,129);function a6(n,e){if(!Ug(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vy!==void 0?Vy.createHTML(e):e}const tN=(n,e)=>{const t=n.length-1,r=[];let i,o=e===2?"<svg>":e===3?"<math>":"",a=Tl;for(let l=0;l<t;l++){const c=n[l];let d,f,g=-1,y=0;for(;y<c.length&&(a.lastIndex=y,f=a.exec(c),f!==null);)y=a.lastIndex,a===Tl?f[1]==="!--"?a=By:f[1]!==void 0?a=qy:f[2]!==void 0?(o6.test(f[2])&&(i=RegExp("</"+f[2],"g")),a=es):f[3]!==void 0&&(a=es):a===es?f[0]===">"?(a=i??Tl,g=-1):f[1]===void 0?g=-2:(g=a.lastIndex-f[2].length,d=f[1],a=f[3]===void 0?es:f[3]==='"'?jy:Wy):a===jy||a===Wy?a=es:a===By||a===qy?a=Tl:(a=es,i=void 0);const v=a===es&&n[l+1].startsWith("/>")?" ":"";o+=a===Tl?c+XO:g>=0?(r.push(d),c.slice(0,g)+i6+c.slice(g)+ii+v):c+ii+(g===-2?l:v)}return[a6(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class yc{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,a=0;const l=e.length-1,c=this.parts,[d,f]=tN(e,t);if(this.el=yc.createElement(d,r),ds.currentNode=this.el.content,t===2||t===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(i=ds.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const g of i.getAttributeNames())if(g.endsWith(i6)){const y=f[a++],v=i.getAttribute(g).split(ii),_=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:_[2],strings:v,ctor:_[1]==="."?rN:_[1]==="?"?iN:_[1]==="@"?sN:jp}),i.removeAttribute(g)}else g.startsWith(ii)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(o6.test(i.tagName)){const g=i.textContent.split(ii),y=g.length-1;if(y>0){i.textContent=Ed?Ed.emptyScript:"";for(let v=0;v<y;v++)i.append(g[v],gc()),ds.nextNode(),c.push({type:2,index:++o});i.append(g[y],gc())}}}else if(i.nodeType===8)if(i.data===s6)c.push({type:2,index:o});else{let g=-1;for(;(g=i.data.indexOf(ii,g+1))!==-1;)c.push({type:7,index:o}),g+=ii.length-1}o++}}static createElement(e,t){const r=po.createElement("template");return r.innerHTML=e,r}}function rl(n,e,t=n,r){var a,l;if(e===at)return e;let i=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl;const o=vc(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=rl(n,i._$AS(n,e.values),i,r)),e}class nN{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)??po).importNode(t,!0);ds.currentNode=i;let o=ds.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new Wp(o,o.nextSibling,this,e):c.type===1?d=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(d=new oN(o,this,e)),this._$AV.push(d),c=r[++l]}a!==(c==null?void 0:c.index)&&(o=ds.nextNode(),a++)}return ds.currentNode=po,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 Wp=class l6{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=te,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=rl(this,e,t),vc(e)?e===te||e==null||e===""?(this._$AH!==te&&this._$AR(),this._$AH=te):e!==this._$AH&&e!==at&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):QO(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!==te&&vc(this._$AH)?this._$AA.nextSibling.data=e:this.T(po.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=yc.createElement(a6(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(t);else{const a=new nN(i,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Gy.get(e.strings);return t===void 0&&Gy.set(e.strings,t=new yc(e)),t}k(e){Ug(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const o of e)i===t.length?t.push(r=new l6(this.O(gc()),this.O(gc()),this,this.options)):r=t[i],r._$AI(o),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=Hy(e).nextSibling;Hy(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},jp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=te,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=te}_$AI(e,t=this,r,i){const o=this.strings;let a=!1;if(o===void 0)e=rl(this,e,t,0),a=!vc(e)||e!==this._$AH&&e!==at,a&&(this._$AH=e);else{const l=e;let c,d;for(e=o[0],c=0;c<o.length-1;c++)d=rl(this,l[r+c],t,c),d===at&&(d=this._$AH[c]),a||(a=!vc(d)||d!==this._$AH[c]),d===te?e=te:e!==te&&(e+=(d??"")+o[c+1]),this._$AH[c]=d}a&&!i&&this.j(e)}j(e){e===te?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},rN=class extends jp{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===te?void 0:e}},iN=class extends jp{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==te)}},sN=class extends jp{constructor(e,t,r,i,o){super(e,t,r,i,o),this.type=5}_$AI(e,t=this){if((e=rl(this,e,t,0)??te)===at)return;const r=this._$AH,i=e===te&&r!==te||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==te&&(r===te||i);i&&this.element.removeEventListener(this.name,this,r),o&&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 oN{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){rl(this,e)}}const aN={I:Wp},Yf=cc.litHtmlPolyfillSupport;Yf==null||Yf(yc,Wp),(cc.litHtmlVersions??(cc.litHtmlVersions=[])).push("3.3.2");const Vh=(n,e,t)=>{const r=e;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Wp(e.insertBefore(gc(),null),null,void 0,{})),i._$AI(n),i};/**
53
+ */const cc=globalThis,Hy=n=>n,Ed=cc.trustedTypes,Uy=Ed?Ed.createPolicy("lit-html",{createHTML:n=>n}):void 0,i6="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,s6="?"+ii,QO=`<${s6}>`,po=document,gc=()=>po.createComment(""),vc=n=>n===null||typeof n!="object"&&typeof n!="function",zg=Array.isArray,e9=n=>zg(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",jf=`[
54
+ \f\r]`,Tl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vy=/-->/g,Fy=/>/g,es=RegExp(`>|${jf}(?:([^\\s"'>=/]+)(${jf}*=${jf}*(?:[^
55
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),By=/'/g,qy=/"/g,o6=/^(?:script|style|textarea|title)$/i,t9=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),M=t9(1),at=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),Wy=new WeakMap,ds=po.createTreeWalker(po,129);function a6(n,e){if(!zg(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Uy!==void 0?Uy.createHTML(e):e}const n9=(n,e)=>{const t=n.length-1,r=[];let i,o=e===2?"<svg>":e===3?"<math>":"",a=Tl;for(let l=0;l<t;l++){const c=n[l];let d,f,g=-1,y=0;for(;y<c.length&&(a.lastIndex=y,f=a.exec(c),f!==null);)y=a.lastIndex,a===Tl?f[1]==="!--"?a=Vy:f[1]!==void 0?a=Fy:f[2]!==void 0?(o6.test(f[2])&&(i=RegExp("</"+f[2],"g")),a=es):f[3]!==void 0&&(a=es):a===es?f[0]===">"?(a=i??Tl,g=-1):f[1]===void 0?g=-2:(g=a.lastIndex-f[2].length,d=f[1],a=f[3]===void 0?es:f[3]==='"'?qy:By):a===qy||a===By?a=es:a===Vy||a===Fy?a=Tl:(a=es,i=void 0);const v=a===es&&n[l+1].startsWith("/>")?" ":"";o+=a===Tl?c+QO:g>=0?(r.push(d),c.slice(0,g)+i6+c.slice(g)+ii+v):c+ii+(g===-2?l:v)}return[a6(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class yc{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,a=0;const l=e.length-1,c=this.parts,[d,f]=n9(e,t);if(this.el=yc.createElement(d,r),ds.currentNode=this.el.content,t===2||t===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(i=ds.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const g of i.getAttributeNames())if(g.endsWith(i6)){const y=f[a++],v=i.getAttribute(g).split(ii),_=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:_[2],strings:v,ctor:_[1]==="."?i9:_[1]==="?"?s9:_[1]==="@"?o9:jp}),i.removeAttribute(g)}else g.startsWith(ii)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(o6.test(i.tagName)){const g=i.textContent.split(ii),y=g.length-1;if(y>0){i.textContent=Ed?Ed.emptyScript:"";for(let v=0;v<y;v++)i.append(g[v],gc()),ds.nextNode(),c.push({type:2,index:++o});i.append(g[y],gc())}}}else if(i.nodeType===8)if(i.data===s6)c.push({type:2,index:o});else{let g=-1;for(;(g=i.data.indexOf(ii,g+1))!==-1;)c.push({type:7,index:o}),g+=ii.length-1}o++}}static createElement(e,t){const r=po.createElement("template");return r.innerHTML=e,r}}function rl(n,e,t=n,r){var a,l;if(e===at)return e;let i=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl;const o=vc(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=rl(n,i._$AS(n,e.values),i,r)),e}class r9{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)??po).importNode(t,!0);ds.currentNode=i;let o=ds.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new Wp(o,o.nextSibling,this,e):c.type===1?d=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(d=new a9(o,this,e)),this._$AV.push(d),c=r[++l]}a!==(c==null?void 0:c.index)&&(o=ds.nextNode(),a++)}return ds.currentNode=po,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 Wp=class l6{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=te,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=rl(this,e,t),vc(e)?e===te||e==null||e===""?(this._$AH!==te&&this._$AR(),this._$AH=te):e!==this._$AH&&e!==at&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):e9(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!==te&&vc(this._$AH)?this._$AA.nextSibling.data=e:this.T(po.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=yc.createElement(a6(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(t);else{const a=new r9(i,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Wy.get(e.strings);return t===void 0&&Wy.set(e.strings,t=new yc(e)),t}k(e){zg(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const o of e)i===t.length?t.push(r=new l6(this.O(gc()),this.O(gc()),this,this.options)):r=t[i],r._$AI(o),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=Hy(e).nextSibling;Hy(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},jp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=te,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=te}_$AI(e,t=this,r,i){const o=this.strings;let a=!1;if(o===void 0)e=rl(this,e,t,0),a=!vc(e)||e!==this._$AH&&e!==at,a&&(this._$AH=e);else{const l=e;let c,d;for(e=o[0],c=0;c<o.length-1;c++)d=rl(this,l[r+c],t,c),d===at&&(d=this._$AH[c]),a||(a=!vc(d)||d!==this._$AH[c]),d===te?e=te:e!==te&&(e+=(d??"")+o[c+1]),this._$AH[c]=d}a&&!i&&this.j(e)}j(e){e===te?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},i9=class extends jp{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===te?void 0:e}},s9=class extends jp{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==te)}},o9=class extends jp{constructor(e,t,r,i,o){super(e,t,r,i,o),this.type=5}_$AI(e,t=this){if((e=rl(this,e,t,0)??te)===at)return;const r=this._$AH,i=e===te&&r!==te||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==te&&(r===te||i);i&&this.element.removeEventListener(this.name,this,r),o&&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 a9{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){rl(this,e)}}const l9={I:Wp},Gf=cc.litHtmlPolyfillSupport;Gf==null||Gf(yc,Wp),(cc.litHtmlVersions??(cc.litHtmlVersions=[])).push("3.3.2");const Fh=(n,e,t)=>{const r=e;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Wp(e.insertBefore(gc(),null),null,void 0,{})),i._$AI(n),i};/**
56
56
  * @license
57
57
  * Copyright 2020 Google LLC
58
58
  * SPDX-License-Identifier: BSD-3-Clause
59
- */const{I:lN}=aN,Yy=n=>n,c6=n=>n.strings===void 0,Jy=()=>document.createComment(""),$l=(n,e,t)=>{var o;const r=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const a=r.insertBefore(Jy(),i),l=r.insertBefore(Jy(),i);t=new lN(a,l,n,n.options)}else{const a=t._$AB.nextSibling,l=t._$AM,c=l!==n;if(c){let d;(o=t._$AQ)==null||o.call(t,n),t._$AM=n,t._$AP!==void 0&&(d=n._$AU)!==l._$AU&&t._$AP(d)}if(a!==i||c){let d=t._$AA;for(;d!==a;){const f=Yy(d).nextSibling;Yy(r).insertBefore(d,i),d=f}}}return t},ts=(n,e,t=n)=>(n._$AI(e,t),n),cN={},u6=(n,e=cN)=>n._$AH=e,uN=n=>n._$AH,Jf=n=>{n._$AR(),n._$AA.remove()};/**
59
+ */const{I:c9}=l9,jy=n=>n,c6=n=>n.strings===void 0,Gy=()=>document.createComment(""),$l=(n,e,t)=>{var o;const r=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const a=r.insertBefore(Gy(),i),l=r.insertBefore(Gy(),i);t=new c9(a,l,n,n.options)}else{const a=t._$AB.nextSibling,l=t._$AM,c=l!==n;if(c){let d;(o=t._$AQ)==null||o.call(t,n),t._$AM=n,t._$AP!==void 0&&(d=n._$AU)!==l._$AU&&t._$AP(d)}if(a!==i||c){let d=t._$AA;for(;d!==a;){const f=jy(d).nextSibling;jy(r).insertBefore(d,i),d=f}}}return t},ts=(n,e,t=n)=>(n._$AI(e,t),n),u9={},u6=(n,e=u9)=>n._$AH=e,h9=n=>n._$AH,Yf=n=>{n._$AR(),n._$AA.remove()};/**
60
60
  * @license
61
61
  * Copyright 2017 Google LLC
62
62
  * SPDX-License-Identifier: BSD-3-Clause
@@ -64,31 +64,31 @@ Television updates its desktop app automatically. Version {version} has download
64
64
  * @license
65
65
  * Copyright 2017 Google LLC
66
66
  * SPDX-License-Identifier: BSD-3-Clause
67
- */const uc=(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),uc(i,e);return!0},kd=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)},h6=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),pN(e)}};function hN(n){this._$AN!==void 0?(kd(this),this._$AM=n,h6(this)):this._$AM=n}function dN(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 o=t;o<r.length;o++)uc(r[o],!1),kd(r[o]);else r!=null&&(uc(r,!1),kd(r));else uc(this,n)}const pN=n=>{n.type==nr.CHILD&&(n._$AP??(n._$AP=dN),n._$AQ??(n._$AQ=hN))};class d6 extends Bu{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),h6(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&&(uc(this,e),kd(this))}setValue(e){if(c6(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 Hc,Vc,di,Ps;class Nt extends d6{constructor(){super(...arguments);p(this,Hc,[]);p(this,Vc,!1);p(this,di,!1);p(this,Ps,!1)}connected(){}template(...t){return at}render(...t){return!this.isConnected||s(this,di)||this.setValue(t.length?t[0]:this.template(...s(this,Hc))),at}update(t,r){h(this,Hc,r),h(this,Ps,!1),h(this,di,!0);try{return s(this,Vc)||(h(this,Vc,!0),this.connected()),this.template(...r)}finally{h(this,di,!1)}}reconnected(){h(this,di,!0);try{this.connected()}finally{h(this,di,!1)}h(this,Ps,!0),queueMicrotask(()=>{s(this,Ps)&&(h(this,Ps,!1),this.render())})}}Hc=new WeakMap,Vc=new WeakMap,di=new WeakMap,Ps=new WeakMap;function zt(n){return vl(n)}function fN(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"}}const mN='<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>',gN='<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>',vN='<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>',yN='<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>',wN='<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>',bN='<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>',SN='<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>',_N='<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>',AN='<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>',EN='<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>',kN='<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>',CN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',TN='<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>',$N='<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>',RN='<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>',IN='<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>',xN='<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>',PN='<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>',DN='<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>',LN='<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>',MN='<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>',ON='<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>',NN='<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>',zN='<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>',UN='<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>',ZN='<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>',FN='<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>',HN='<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>',VN='<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>',BN='<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>',qN='<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>',WN='<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>',jN='<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>',GN='<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>',YN='<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>',JN='<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>',KN='<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>',XN='<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>',QN='<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>',ez='<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>',tz='<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>',nz='<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>',rz='<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>',iz='<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>',sz='<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>',oz='<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>',az='<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>',lz='<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>',cz='<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>',uz='<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>',hz='<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>',dz='<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>',pz='<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>',fz='<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>',mz='<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>',gz='<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>',vz='<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>',yz='<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>',wz='<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>',bz='<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>',Sz='<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>',_z='<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>',Az='<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>',Ez='<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>',kz='<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>',Cz='<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>',Tz='<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>',$z='<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>',Rz='<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>',Iz='<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>',xz='<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>',Pz='<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>',Dz='<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>',Lz='<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>',Mz='<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>',Oz='<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>',Nz='<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>',zz='<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>',Uz='<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,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"/></svg>',Zz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.58,128.84,160,91.06V48a32,32,0,0,0-64,0V91.06L20.42,128.84A8,8,0,0,0,16,136v32a8,8,0,0,0,9.57,7.84L96,161.76v18.93L82.34,194.34A8,8,0,0,0,80,200v32a8,8,0,0,0,11,7.43l37-14.81,37,14.81A8,8,0,0,0,176,232V200a8,8,0,0,0-2.34-5.66L160,180.69V161.76l70.43,14.08A8,8,0,0,0,240,168V136A8,8,0,0,0,235.58,128.84ZM224,158.24l-70.43-14.08A8,8,0,0,0,144,152v32a8,8,0,0,0,2.34,5.66L160,203.31v16.87l-29-11.61a8,8,0,0,0-5.94,0L96,220.18V203.31l13.66-13.65A8,8,0,0,0,112,184V152a8,8,0,0,0-9.57-7.84L32,158.24v-17.3l75.58-37.78A8,8,0,0,0,112,96V48a16,16,0,0,1,32,0V96a8,8,0,0,0,4.42,7.16L224,140.94Z"/></svg>',Fz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,104H229.2L201.42,41.5A16,16,0,0,0,186.8,32H69.2a16,16,0,0,0-14.62,9.5L26.8,104H16a8,8,0,0,0,0,16h8v80a16,16,0,0,0,16,16H64a16,16,0,0,0,16-16V184h96v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V120h8a8,8,0,0,0,0-16ZM69.2,48H186.8l24.89,56H44.31ZM64,200H40V184H64Zm128,0V184h24v16Zm24-32H40V120H216ZM56,144a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16H64A8,8,0,0,1,56,144Zm112,0a8,8,0,0,1,8-8h16a8,8,0,0,1,0,16H176A8,8,0,0,1,168,144Z"/></svg>',Hz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A32,32,0,0,0,40,64V208a16,16,0,0,0,16,16H80a16,16,0,0,0,16-16V192h64v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V64A32,32,0,0,0,184,32ZM56,176V120H200v56Zm0-96H200v24H56ZM72,48H184a16,16,0,0,1,16,16H56A16,16,0,0,1,72,48Zm8,160H56V192H80Zm96,0V192h24v16Zm-72-60a12,12,0,1,1-12-12A12,12,0,0,1,104,148Zm72,0a12,12,0,1,1-12-12A12,12,0,0,1,176,148Zm72-68v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0ZM24,80v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0Z"/></svg>',Vz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H32V48a8,8,0,0,0-16,0V208a8,8,0,0,0,16,0V176H240v32a8,8,0,0,0,16,0V112A40,40,0,0,0,216,72ZM32,88h72v72H32Zm88,72V88h96a24,24,0,0,1,24,24v48Z"/></svg>',Bz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M72,88V40a8,8,0,0,1,16,0V88a8,8,0,0,1-16,0ZM216,40V224a8,8,0,0,1-16,0V176H152a8,8,0,0,1-8-8,268.75,268.75,0,0,1,7.22-56.88c9.78-40.49,28.32-67.63,53.63-78.47A8,8,0,0,1,216,40ZM200,53.9c-32.17,24.57-38.47,84.42-39.7,106.1H200ZM119.89,38.69a8,8,0,1,0-15.78,2.63L112,88.63a32,32,0,0,1-64,0l7.88-47.31a8,8,0,1,0-15.78-2.63l-8,48A8.17,8.17,0,0,0,32,88a48.07,48.07,0,0,0,40,47.32V224a8,8,0,0,0,16,0V135.32A48.07,48.07,0,0,0,128,88a8.17,8.17,0,0,0-.11-1.31Z"/></svg>',qz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,112a24,24,0,0,0-24-24H136V79a32.06,32.06,0,0,0,24-31c0-28-26.44-45.91-27.56-46.66a8,8,0,0,0-8.88,0C122.44,2.09,96,20,96,48a32.06,32.06,0,0,0,24,31v9H48a24,24,0,0,0-24,24v23.33a40.84,40.84,0,0,0,8,24.24V200a24,24,0,0,0,24,24H200a24,24,0,0,0,24-24V159.57a40.84,40.84,0,0,0,8-24.24ZM112,48c0-13.57,10-24.46,16-29.79,6,5.33,16,16.22,16,29.79a16,16,0,0,1-32,0ZM40,112a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8v23.33c0,13.25-10.46,24.31-23.32,24.66A24,24,0,0,1,168,136a8,8,0,0,0-16,0,24,24,0,0,1-48,0,8,8,0,0,0-16,0,24,24,0,0,1-24.68,24C50.46,159.64,40,148.58,40,135.33Zm160,96H56a8,8,0,0,1-8-8V172.56A38.77,38.77,0,0,0,62.88,176a39.69,39.69,0,0,0,29-11.31A40.36,40.36,0,0,0,96,160a40,40,0,0,0,64,0,40.36,40.36,0,0,0,4.13,4.67A39.67,39.67,0,0,0,192,176c.38,0,.76,0,1.14,0A38.77,38.77,0,0,0,208,172.56V200A8,8,0,0,1,200,208Z"/></svg>',Wz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M255.31,188.75l-64-144A8,8,0,0,0,184,40H72a8,8,0,0,0-7.27,4.69.21.21,0,0,0,0,.06l0,.12,0,0L.69,188.75A8,8,0,0,0,8,200H248a8,8,0,0,0,7.31-11.25ZM64,184H20.31L64,85.7Zm16,0V85.7L123.69,184Zm61.2,0L84.31,56H178.8l56.89,128Z"/></svg>',jz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"/></svg>',Gz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm64,24V200H96V72ZM40,72H80V200H40ZM216,200H176V72h40V200Z"/></svg>',Yz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"/></svg>',Jz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',Kz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',Xz=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),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}}',p6=new CSSStyleSheet;p6.replaceSync(Xz);const f6={check:mN,close:gN,copy:vN,pin:yN,search:wN,add:bN,more:SN,settings:_N,expand:AN,collapse:EN,"collapse-up":kN,select:CN,skills:TN,notification:$N,artifact:RN,spinner:IN,locked:xN,unpin:PN,back:DN,forward:LN,television:MN,calendar:ON,grid:NN,hash:zN,delete:UN,edit:ZN,link:FN,external:HN,download:VN,reload:BN,warning:qN,info:WN,file:jN,folder:GN,clock:YN,user:JN,upload:KN,star:XN,home:QN,send:ez,filter:tz,sort:nz,help:rz,chart:iz,image:sz,chat:oz,location:az,play:lz,pause:cz,stop:uz,video:hz,music:dz,error:pz,email:fz,phone:mz,web:gz,tag:vz,bookmark:yz,table:wz,code:bz,group:Sz,up:_z,down:Az,money:Ez,bank:kz,card:Cz,wallet:Tz,gauge:$z,activity:Rz,"trend-up":Iz,"trend-down":xz,database:Pz,server:Dz,deploy:Lz,list:Mz,terminal:Oz,branch:Nz,shield:zz,sidebar:Uz,plane:Zz,car:Fz,bus:Hz,bed:Vz,food:Bz,cake:qz,tent:Wz,microphone:jz,luggage:Gz,key:Yz,sun:Jz,moon:Kz};function Qz(n){return n!==null&&Object.hasOwn(f6,n)}var Bc,q0;class m6 extends HTMLElement{constructor(){super(...arguments);p(this,Bc)}connectedCallback(){u(this,Bc,q0).call(this)}attributeChangedCallback(){this.isConnected&&u(this,Bc,q0).call(this)}}Bc=new WeakSet,q0=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[p6],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=Qz(r)?f6[r]:""},C(m6,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",m6);function Gp(n){return M`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function Yp(n,e){let t=!1;const r=o=>{o.preventDefault(),e("escape")},i=o=>{if(o.target!==n)return;const a=n.getBoundingClientRect();o.clientX>=a.left&&o.clientX<=a.right&&o.clientY>=a.top&&o.clientY<=a.bottom||e("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const o of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))o.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){t||(t=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}function wc(n){n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:"nearest"})}function g6(n,e){if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||e.length===0)return!1;const t=e.indexOf(e[0].ownerDocument.activeElement),r=n.key==="ArrowDown",i=t<0?r?0:e.length-1:Math.max(0,Math.min(e.length-1,t+(r?1:-1)));return n.preventDefault(),n.stopImmediatePropagation(),wc(e[i]),!0}const W0=new WeakMap;function Uo(n,e,t){t===null?n.hasAttribute(e)&&n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}var Ar,qc,Wc,wa,pi,ji,j0,Ud,Zd,Fd,Hd,Vd,G0;class e9{constructor(e){p(this,ji);C(this,"document");C(this,"panels",new Set);p(this,Ar,new Map);p(this,qc,new WeakMap);p(this,Wc,new AbortController);p(this,wa);p(this,pi,0);p(this,Ud,e=>{if(!(e.target instanceof Element))return;const t=e.target;s(this,qc).set(e,{inside:new Set([...this.panels].filter(r=>{var i;return this.contains(r,t)||((i=r.trigger)==null?void 0:i.contains(t))})),open:[...this.panels].filter(r=>r.open)})});p(this,Zd,e=>{var o,a,l;if(!(e.target instanceof Element))return;const t=e.target,r=s(this,qc).get(e),i=[...this.panels].find(c=>{var d;return(d=c.trigger)==null?void 0:d.contains(t)});for(const c of(r==null?void 0:r.open)??[])c.open&&!c.manual&&c!==i&&!(r!=null&&r.inside.has(c))&&c.close();if(i&&!((o=i.trigger)!=null&&o.disabled))i.toggle(e.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(t)&&((l=(a=c.behavior).click)==null||l.call(a,t))});p(this,Fd,e=>{var t,r;if(e.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(e.target)&&((r=(t=i.behavior).pointermove)==null||r.call(t,e.target))});p(this,Hd,e=>{var o,a,l,c;const t=u(this,ji,j0).call(this),r=t.find(d=>d.behavior.select),i=r??t.find(d=>d.behavior.keydown);if(!((a=i==null?void 0:(o=i.behavior).keydown)!=null&&a.call(o,e))){if(e.key==="Escape"&&r){u(this,ji,G0).call(this,e,t,r);return}for(const d of this.panels)if(!d.open&&d.trigger===this.document.activeElement&&((c=(l=d.behavior).keydown)!=null&&c.call(l,e)))return}});p(this,Vd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;const t=u(this,ji,j0).call(this);u(this,ji,G0).call(this,e,t)});this.document=e;const t={signal:s(this,Wc).signal};e.addEventListener("click",s(this,Ud),{...t,capture:!0}),e.addEventListener("click",s(this,Zd),t),e.addEventListener("keydown",s(this,Hd),{...t,capture:!0}),e.addEventListener("keydown",s(this,Vd),t),e.addEventListener("pointermove",s(this,Fd),t),h(this,wa,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),s(this,wa).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(s(this,pi))return;const e=()=>{h(this,pi,0);for(const t of this.panels)t.open&&t.place();[...this.panels].some(t=>t.open)&&h(this,pi,this.document.defaultView.requestAnimationFrame(e))};h(this,pi,this.document.defaultView.requestAnimationFrame(e))}remove(e){this.closed(e),this.panels.delete(e),!this.panels.size&&(s(this,Wc).abort(),s(this,wa).disconnect(),this.document.defaultView.cancelAnimationFrame(s(this,pi)),W0.delete(this.document))}prepareOpen(e){let t=null;for(const r of this.panels)r===e||!r.open||!e.trigger||!r.host.contains(e.trigger)||(t===null||t.host.contains(r.host))&&(t=r);if(s(this,Ar).set(e,t),!(e.manual||e.behavior.select))for(const r of this.panels)r.open&&r!==e&&!r.manual&&!r.behavior.select&&!this.isDescendant(e,r)&&r.close()}isDescendant(e,t){for(let r=s(this,Ar).get(e);r;r=s(this,Ar).get(r))if(r===t)return!0;return!1}contains(e,t){return t?e.host.contains(t)||[...this.panels].some(r=>this.isDescendant(r,e)&&r.host.contains(t)):!1}closeDescendants(e){for(const t of[...this.panels])this.isDescendant(t,e)&&t.close(!1)}closed(e){s(this,Ar).delete(e)}}Ar=new WeakMap,qc=new WeakMap,Wc=new WeakMap,wa=new WeakMap,pi=new WeakMap,ji=new WeakSet,j0=function(){const e=t=>{let r=0;for(let i=s(this,Ar).get(t);i;i=s(this,Ar).get(i))r++;return r};return[...this.panels].filter(t=>t.open).reverse().sort((t,r)=>e(r)-e(t))},Ud=new WeakMap,Zd=new WeakMap,Fd=new WeakMap,Hd=new WeakMap,Vd=new WeakMap,G0=function(e,t,r){if(!r&&t.some(o=>o.manual&&e.composedPath().includes(o.host)))return;const i=r??t.find(o=>!o.manual);i&&!i.manual&&(e.preventDefault(),e.stopImmediatePropagation(),i.close())};var $e,fi,Ds,ba,mi,gi,ht,Y0,v6,J0,jc,y6,K0;class Zg{constructor(e,t={}){p(this,ht);C(this,"host");C(this,"behavior");C(this,"trigger",null);p(this,$e);p(this,fi,!1);p(this,Ds,!1);p(this,ba,!0);p(this,mi,new Map);p(this,gi,new Set);p(this,jc,e=>{const t=e.target;t instanceof HTMLElement&&t!==this.host&&this.host.contains(t)&&s(this,gi).add(t)});this.host=e,this.behavior=t}get open(){return this.host.hasAttribute("open")&&s(this,fi)}get manual(){return this.host.hasAttribute("manual")}connect(){if(s(this,$e))return;const e=this.host.ownerDocument;h(this,$e,W0.get(e)),s(this,$e)||(h(this,$e,new e9(e)),W0.set(e,s(this,$e))),s(this,$e).panels.add(this),this.refresh()}disconnect(){var t,r,i,o;if(!s(this,$e))return;const e=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),this.host.removeAttribute("open"),(r=(t=this.behavior).closed)==null||r.call(t),u(this,ht,J0).call(this),u(this,ht,K0).call(this),e&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),u(this,ht,Y0).call(this),(o=s(this,$e))==null||o.remove(this),h(this,$e,void 0)}refresh(){var r,i,o,a,l,c,d;if(!s(this,$e))return;const e=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),t=e instanceof HTMLButtonElement?e:null;if(t!==this.trigger&&(u(this,ht,Y0).call(this),this.trigger=t),this.trigger&&Uo(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==s(this,fi))if(this.host.hasAttribute("open"))s(this,$e).prepareOpen(this),h(this,fi,!0),u(this,ht,v6).call(this),u(this,ht,y6).call(this),this.place(),(a=(o=this.behavior).opened)==null||a.call(o,s(this,Ds)),h(this,Ds,!1),s(this,$e).animate();else{const f=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),(c=(l=this.behavior).closed)==null||c.call(l),u(this,ht,J0).call(this),u(this,ht,K0).call(this),f&&s(this,ba)&&((d=this.trigger)!=null&&d.isConnected)&&this.trigger.focus({preventScroll:!0})}}toggle(e=!1){h(this,Ds,e),this.host.toggleAttribute("open")}show(e=!1){h(this,Ds,e),this.host.setAttribute("open","")}close(e=!0){h(this,ba,e),this.host.removeAttribute("open"),this.refresh(),h(this,ba,!0)}place(){var ve,Xe,Ue;if(!this.open||!this.trigger)return;const e=this.host,t=e.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(t.getComputedStyle(e).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const o=e.scrollTop,a=e.scrollLeft,l=[];for(const le of s(this,gi)){if(!le.isConnected||!e.contains(le)){s(this,gi).delete(le);continue}l.push({element:le,scrollTop:le.scrollTop,scrollLeft:le.scrollLeft})}e.style.maxWidth="none";const c=s(this,mi).get("max-height");c!=null&&c.value?e.style.setProperty("max-height",c.value,c.priority):e.style.removeProperty("max-height");const d=t.getComputedStyle(e).maxHeight;e.style.minWidth=this.behavior.select?`${Math.min(r.width,t.innerWidth-2*i)}px`:((ve=s(this,mi).get("min-width"))==null?void 0:ve.value)??"";const f=e.getBoundingClientRect(),g=Math.max(0,t.innerWidth-i-r.left),y=Math.max(0,r.right-i),v=f.width>g&&y>g,_=Math.min(t.innerWidth-2*i,v?y:g),E=Number.parseFloat(t.getComputedStyle(e).minWidth)||0;e.style.minWidth=`${Math.max(0,Math.min(E,_))}px`,e.style.maxWidth=`${Math.max(0,_)}px`;const x=e.getBoundingClientRect(),B=x.width,P=x.height,J=Math.max(i,Math.min(v?r.right-B:r.left,t.innerWidth-i-B));let O,Y;if(this.behavior.select){const le=(Ue=(Xe=this.behavior).selectedRow)==null?void 0:Ue.call(Xe),sr=le?le.getBoundingClientRect().top+le.offsetHeight/2-x.top:0,Ut=r.top+r.height/2-sr;if(Ut>=i&&Ut+P<=t.innerHeight-i)O=Ut,Y=t.innerHeight-i-Ut;else{const wl=t.innerHeight-i-r.top,bl=r.bottom-i,ju=P>wl&&bl>wl;Y=ju?bl:wl,O=ju?r.bottom-Math.min(P,Y):r.top}}else{const le=Math.max(0,t.innerHeight-i-r.bottom-i),sr=Math.max(0,r.top-2*i),Ut=P>le&&sr>le;Y=Ut?sr:le,O=Ut?r.top-i-Math.min(P,sr):r.bottom+i}const F=`${Math.max(0,Y)}px`;e.style.maxHeight=d==="none"?F:`min(${d}, ${F})`,e.style.left=`${J}px`,e.style.top=`${Math.max(i,Math.min(O,t.innerHeight-i-Math.min(P,Y)))}px`;const j=t.getComputedStyle(e),fe=j.boxSizing==="border-box",de=parseFloat(j.width)+(fe?0:parseFloat(j.paddingLeft)+parseFloat(j.paddingRight)+parseFloat(j.borderLeftWidth)+parseFloat(j.borderRightWidth)),Ve=parseFloat(j.height)+(fe?0:parseFloat(j.paddingTop)+parseFloat(j.paddingBottom)+parseFloat(j.borderTopWidth)+parseFloat(j.borderBottomWidth));e.style.setProperty("--_panel-edge-inset",`${e.style.top} auto auto ${e.style.left}`),e.style.setProperty("--_panel-edge-width",`${de}px`),e.style.setProperty("--_panel-edge-height",`${Ve}px`),e.scrollTop=o,e.scrollLeft=a;for(const le of l)le.element.scrollTop=le.scrollTop,le.element.scrollLeft=le.scrollLeft}}$e=new WeakMap,fi=new WeakMap,Ds=new WeakMap,ba=new WeakMap,mi=new WeakMap,gi=new WeakMap,ht=new WeakSet,Y0=function(){var e,t;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(t=(e=this.behavior).unpair)==null||t.call(e,this.trigger),this.trigger=null)},v6=function(){s(this,gi).clear(),this.host.addEventListener("scroll",s(this,jc),!0)},J0=function(){this.host.removeEventListener("scroll",s(this,jc),!0),s(this,gi).clear()},jc=new WeakMap,y6=function(){const e=this.host;for(const t of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])s(this,mi).set(t,{value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)});e.style.position="fixed",e.style.zIndex="var(--layer-panel)",e.style.margin="0",e.style.overflow="auto",e.style.setProperty("--_panel-edge-position","fixed")},K0=function(){for(const[e,{value:t,priority:r}]of s(this,mi))t?this.host.style.setProperty(e,t,r):this.host.style.removeProperty(e);s(this,mi).clear()};class t9 extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var vi,ir,X0,Q0,b6;class w6 extends HTMLElement{constructor(){super();p(this,ir);p(this,vi,new Zg(this,{opened:t=>{t&&wc(u(this,ir,X0).call(this)[0])},keydown:t=>u(this,ir,b6).call(this,t),pointermove:t=>wc(u(this,ir,Q0).call(this,t)??void 0),click:t=>{u(this,ir,Q0).call(this,t)&&s(this,vi).close()}}));this.attachInternals().role="menu"}connectedCallback(){s(this,vi).connect()}disconnectedCallback(){s(this,vi).disconnect()}attributeChangedCallback(){s(this,vi).refresh()}}vi=new WeakMap,ir=new WeakSet,X0=function(){return[...this.querySelectorAll("tv-menu-item")]},Q0=function(t){const r=t.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},b6=function(t){if(!s(this,vi).open)return!1;const r=u(this,ir,X0).call(this),i=r.indexOf(this.ownerDocument.activeElement);return g6(t,r)?!0:t.key==="Enter"&&i>=0?(t.preventDefault(),t.stopImmediatePropagation(),r[i].click(),!0):!1},C(w6,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",t9);customElements.get("tv-menu")||customElements.define("tv-menu",w6);let n9=0;var Gc;class r9 extends Nt{constructor(){super(...arguments);p(this,Gc,`menu-trigger-${++n9}`)}template(t,{trigger:r}){return M`${r(s(this,Gc))}<tv-menu trigger=${s(this,Gc)}>
67
+ */const uc=(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),uc(i,e);return!0},kd=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)},h6=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),f9(e)}};function d9(n){this._$AN!==void 0?(kd(this),this._$AM=n,h6(this)):this._$AM=n}function p9(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 o=t;o<r.length;o++)uc(r[o],!1),kd(r[o]);else r!=null&&(uc(r,!1),kd(r));else uc(this,n)}const f9=n=>{n.type==nr.CHILD&&(n._$AP??(n._$AP=p9),n._$AQ??(n._$AQ=d9))};class d6 extends Bu{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),h6(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&&(uc(this,e),kd(this))}setValue(e){if(c6(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 Vc,Fc,di,Ps;class Nt extends d6{constructor(){super(...arguments);p(this,Vc,[]);p(this,Fc,!1);p(this,di,!1);p(this,Ps,!1)}connected(){}template(...t){return at}render(...t){return!this.isConnected||s(this,di)||this.setValue(t.length?t[0]:this.template(...s(this,Vc))),at}update(t,r){h(this,Vc,r),h(this,Ps,!1),h(this,di,!0);try{return s(this,Fc)||(h(this,Fc,!0),this.connected()),this.template(...r)}finally{h(this,di,!1)}}reconnected(){h(this,di,!0);try{this.connected()}finally{h(this,di,!1)}h(this,Ps,!0),queueMicrotask(()=>{s(this,Ps)&&(h(this,Ps,!1),this.render())})}}Vc=new WeakMap,Fc=new WeakMap,di=new WeakMap,Ps=new WeakMap;function zt(n){return vl(n)}function m9(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"}}const g9='<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>',v9='<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>',y9='<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>',w9='<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>',b9='<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>',S9='<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>',_9='<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>',A9='<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>',E9='<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>',k9='<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>',C9='<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>',T9='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',$9='<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>',R9='<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>',I9='<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>',x9='<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>',P9='<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>',L9='<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>',D9='<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>',M9='<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>',O9='<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>',N9='<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>',z9='<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>',Z9='<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>',H9='<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>',U9='<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>',V9='<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>',F9='<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>',B9='<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>',q9='<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>',W9='<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>',j9='<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>',G9='<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>',Y9='<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>',J9='<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>',K9='<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>',X9='<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>',Q9='<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>',eN='<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>',tN='<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>',nN='<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>',rN='<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>',iN='<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>',sN='<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>',oN='<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>',aN='<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>',lN='<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>',cN='<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>',uN='<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>',hN='<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>',dN='<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>',pN='<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>',fN='<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>',mN='<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>',gN='<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>',vN='<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>',yN='<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>',wN='<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>',bN='<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>',SN='<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>',_N='<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>',AN='<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>',EN='<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>',kN='<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>',CN='<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>',TN='<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>',$N='<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>',RN='<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>',IN='<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>',xN='<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>',PN='<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>',LN='<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>',DN='<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>',MN='<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>',ON='<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>',NN='<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>',zN='<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>',ZN='<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>',HN='<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,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"/></svg>',UN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.58,128.84,160,91.06V48a32,32,0,0,0-64,0V91.06L20.42,128.84A8,8,0,0,0,16,136v32a8,8,0,0,0,9.57,7.84L96,161.76v18.93L82.34,194.34A8,8,0,0,0,80,200v32a8,8,0,0,0,11,7.43l37-14.81,37,14.81A8,8,0,0,0,176,232V200a8,8,0,0,0-2.34-5.66L160,180.69V161.76l70.43,14.08A8,8,0,0,0,240,168V136A8,8,0,0,0,235.58,128.84ZM224,158.24l-70.43-14.08A8,8,0,0,0,144,152v32a8,8,0,0,0,2.34,5.66L160,203.31v16.87l-29-11.61a8,8,0,0,0-5.94,0L96,220.18V203.31l13.66-13.65A8,8,0,0,0,112,184V152a8,8,0,0,0-9.57-7.84L32,158.24v-17.3l75.58-37.78A8,8,0,0,0,112,96V48a16,16,0,0,1,32,0V96a8,8,0,0,0,4.42,7.16L224,140.94Z"/></svg>',VN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,104H229.2L201.42,41.5A16,16,0,0,0,186.8,32H69.2a16,16,0,0,0-14.62,9.5L26.8,104H16a8,8,0,0,0,0,16h8v80a16,16,0,0,0,16,16H64a16,16,0,0,0,16-16V184h96v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V120h8a8,8,0,0,0,0-16ZM69.2,48H186.8l24.89,56H44.31ZM64,200H40V184H64Zm128,0V184h24v16Zm24-32H40V120H216ZM56,144a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16H64A8,8,0,0,1,56,144Zm112,0a8,8,0,0,1,8-8h16a8,8,0,0,1,0,16H176A8,8,0,0,1,168,144Z"/></svg>',FN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A32,32,0,0,0,40,64V208a16,16,0,0,0,16,16H80a16,16,0,0,0,16-16V192h64v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V64A32,32,0,0,0,184,32ZM56,176V120H200v56Zm0-96H200v24H56ZM72,48H184a16,16,0,0,1,16,16H56A16,16,0,0,1,72,48Zm8,160H56V192H80Zm96,0V192h24v16Zm-72-60a12,12,0,1,1-12-12A12,12,0,0,1,104,148Zm72,0a12,12,0,1,1-12-12A12,12,0,0,1,176,148Zm72-68v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0ZM24,80v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0Z"/></svg>',BN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H32V48a8,8,0,0,0-16,0V208a8,8,0,0,0,16,0V176H240v32a8,8,0,0,0,16,0V112A40,40,0,0,0,216,72ZM32,88h72v72H32Zm88,72V88h96a24,24,0,0,1,24,24v48Z"/></svg>',qN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M72,88V40a8,8,0,0,1,16,0V88a8,8,0,0,1-16,0ZM216,40V224a8,8,0,0,1-16,0V176H152a8,8,0,0,1-8-8,268.75,268.75,0,0,1,7.22-56.88c9.78-40.49,28.32-67.63,53.63-78.47A8,8,0,0,1,216,40ZM200,53.9c-32.17,24.57-38.47,84.42-39.7,106.1H200ZM119.89,38.69a8,8,0,1,0-15.78,2.63L112,88.63a32,32,0,0,1-64,0l7.88-47.31a8,8,0,1,0-15.78-2.63l-8,48A8.17,8.17,0,0,0,32,88a48.07,48.07,0,0,0,40,47.32V224a8,8,0,0,0,16,0V135.32A48.07,48.07,0,0,0,128,88a8.17,8.17,0,0,0-.11-1.31Z"/></svg>',WN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,112a24,24,0,0,0-24-24H136V79a32.06,32.06,0,0,0,24-31c0-28-26.44-45.91-27.56-46.66a8,8,0,0,0-8.88,0C122.44,2.09,96,20,96,48a32.06,32.06,0,0,0,24,31v9H48a24,24,0,0,0-24,24v23.33a40.84,40.84,0,0,0,8,24.24V200a24,24,0,0,0,24,24H200a24,24,0,0,0,24-24V159.57a40.84,40.84,0,0,0,8-24.24ZM112,48c0-13.57,10-24.46,16-29.79,6,5.33,16,16.22,16,29.79a16,16,0,0,1-32,0ZM40,112a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8v23.33c0,13.25-10.46,24.31-23.32,24.66A24,24,0,0,1,168,136a8,8,0,0,0-16,0,24,24,0,0,1-48,0,8,8,0,0,0-16,0,24,24,0,0,1-24.68,24C50.46,159.64,40,148.58,40,135.33Zm160,96H56a8,8,0,0,1-8-8V172.56A38.77,38.77,0,0,0,62.88,176a39.69,39.69,0,0,0,29-11.31A40.36,40.36,0,0,0,96,160a40,40,0,0,0,64,0,40.36,40.36,0,0,0,4.13,4.67A39.67,39.67,0,0,0,192,176c.38,0,.76,0,1.14,0A38.77,38.77,0,0,0,208,172.56V200A8,8,0,0,1,200,208Z"/></svg>',jN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M255.31,188.75l-64-144A8,8,0,0,0,184,40H72a8,8,0,0,0-7.27,4.69.21.21,0,0,0,0,.06l0,.12,0,0L.69,188.75A8,8,0,0,0,8,200H248a8,8,0,0,0,7.31-11.25ZM64,184H20.31L64,85.7Zm16,0V85.7L123.69,184Zm61.2,0L84.31,56H178.8l56.89,128Z"/></svg>',GN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"/></svg>',YN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm64,24V200H96V72ZM40,72H80V200H40ZM216,200H176V72h40V200Z"/></svg>',JN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"/></svg>',KN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',XN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',QN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24a104,104,0,0,0,0,208c21.51,0,44.1-6.48,60.43-17.33a8,8,0,0,0-8.86-13.33C166,210.38,146.21,216,128,216a88,88,0,1,1,88-88c0,26.45-10.88,32-20,32s-20-5.55-20-32V88a8,8,0,0,0-16,0v4.26a48,48,0,1,0,5.93,65.1c6,12,16.35,18.64,30.07,18.64,22.54,0,36-17.94,36-48A104.11,104.11,0,0,0,128,24Zm0,136a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"/></svg>',ez='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96ZM216,72v41.61A184,184,0,0,1,128,136a184.07,184.07,0,0,1-88-22.38V72Zm0,128H40V131.64A200.19,200.19,0,0,0,128,152a200.25,200.25,0,0,0,88-20.37V200ZM104,112a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,112Z"/></svg>',tz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,112a47.81,47.81,0,0,0-16.93,3.09L165.93,72H192a8,8,0,0,1,8,8,8,8,0,0,0,16,0,24,24,0,0,0-24-24H152a8,8,0,0,0-6.91,12l11.65,20H99.26L82.91,60A8,8,0,0,0,76,56H48a8,8,0,0,0,0,16H71.41L85.12,95.51,69.41,117.06a48.13,48.13,0,1,0,12.92,9.44l11.59-15.9L125.09,164A8,8,0,1,0,138.91,156l-30.32-52h57.48l11.19,19.17A48,48,0,1,0,208,112ZM80,160a32,32,0,1,1-20.21-29.74l-18.25,25a8,8,0,1,0,12.92,9.42l18.25-25A31.88,31.88,0,0,1,80,160Zm128,32a32,32,0,0,1-22.51-54.72L201.09,164A8,8,0,1,0,214.91,156L199.3,129.21A32,32,0,1,1,208,192Z"/></svg>',nz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,24H72A32,32,0,0,0,40,56V184a32,32,0,0,0,32,32h8L65.6,235.2a8,8,0,1,0,12.8,9.6L100,216h56l21.6,28.8a8,8,0,1,0,12.8-9.6L176,216h8a32,32,0,0,0,32-32V56A32,32,0,0,0,184,24ZM56,120V80h64v40Zm80-40h64v40H136ZM72,40H184a16,16,0,0,1,16,16v8H56V56A16,16,0,0,1,72,40ZM184,200H72a16,16,0,0,1-16-16V136H200v48A16,16,0,0,1,184,200ZM96,172a12,12,0,1,1-12-12A12,12,0,0,1,96,172Zm88,0a12,12,0,1,1-12-12A12,12,0,0,1,184,172Z"/></svg>',rz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"/></svg>',iz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"/></svg>',sz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"/></svg>',oz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z"/></svg>',az='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,75.64V40a16,16,0,0,0-16-16H72A16,16,0,0,0,56,40V76a16.07,16.07,0,0,0,6.4,12.8L114.67,128,62.4,167.2A16.07,16.07,0,0,0,56,180v36a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V180.36a16.09,16.09,0,0,0-6.35-12.77L141.27,128l52.38-39.6A16.05,16.05,0,0,0,200,75.64ZM184,216H72V180l56-42,56,42.35Zm0-140.36L128,118,72,76V40H184Z"/></svg>',lz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M214.67,72H200V40a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8V72H41.33C27.36,72,16,82.77,16,96v80a8,8,0,0,0,8,8H56v32a8,8,0,0,0,8,8H192a8,8,0,0,0,8-8V184h32a8,8,0,0,0,8-8V96C240,82.77,228.64,72,214.67,72ZM72,48H184V72H72ZM184,208H72V160H184Zm40-40H200V152a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8v16H32V96c0-4.41,4.19-8,9.33-8H214.67c5.14,0,9.33,3.59,9.33,8Zm-24-52a12,12,0,1,1-12-12A12,12,0,0,1,200,116Z"/></svg>',cz=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),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}}',p6=new CSSStyleSheet;p6.replaceSync(cz);const f6={check:g9,close:v9,copy:y9,pin:w9,search:b9,add:S9,more:_9,settings:A9,expand:E9,collapse:k9,"collapse-up":C9,select:T9,skills:$9,notification:R9,artifact:I9,spinner:x9,locked:P9,unpin:L9,back:D9,forward:M9,television:O9,calendar:N9,grid:z9,hash:Z9,delete:H9,edit:U9,link:V9,external:F9,download:B9,reload:q9,warning:W9,info:j9,file:G9,folder:Y9,clock:J9,user:K9,upload:X9,star:Q9,home:eN,send:tN,filter:nN,sort:rN,help:iN,chart:sN,image:oN,chat:aN,location:lN,play:cN,pause:uN,stop:hN,video:dN,music:pN,error:fN,email:mN,phone:gN,web:vN,tag:yN,bookmark:wN,table:bN,code:SN,group:_N,up:AN,down:EN,money:kN,bank:CN,card:TN,wallet:$N,gauge:RN,activity:IN,"trend-up":xN,"trend-down":PN,database:LN,server:DN,deploy:MN,list:ON,terminal:NN,branch:zN,shield:ZN,sidebar:HN,plane:UN,car:VN,bus:FN,bed:BN,food:qN,cake:WN,tent:jN,microphone:GN,luggage:YN,key:JN,sun:KN,moon:XN,at:QN,briefcase:ez,bicycle:tz,train:nz,gift:rz,book:iz,camera:sz,inbox:oz,hourglass:az,printer:lz};function uz(n){return n!==null&&Object.hasOwn(f6,n)}var Bc,B0;class m6 extends HTMLElement{constructor(){super(...arguments);p(this,Bc)}connectedCallback(){u(this,Bc,B0).call(this)}attributeChangedCallback(){this.isConnected&&u(this,Bc,B0).call(this)}}Bc=new WeakSet,B0=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[p6],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=uz(r)?f6[r]:""},C(m6,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",m6);function Gp(n){return M`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function Yp(n,e){let t=!1;const r=o=>{o.preventDefault(),e("escape")},i=o=>{if(o.target!==n)return;const a=n.getBoundingClientRect();o.clientX>=a.left&&o.clientX<=a.right&&o.clientY>=a.top&&o.clientY<=a.bottom||e("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const o of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))o.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){t||(t=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}function wc(n){n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:"nearest"})}function g6(n,e){if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||e.length===0)return!1;const t=e.indexOf(e[0].ownerDocument.activeElement),r=n.key==="ArrowDown",i=t<0?r?0:e.length-1:Math.max(0,Math.min(e.length-1,t+(r?1:-1)));return n.preventDefault(),n.stopImmediatePropagation(),wc(e[i]),!0}const q0=new WeakMap;function Zo(n,e,t){t===null?n.hasAttribute(e)&&n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}var Ar,qc,Wc,wa,pi,ji,W0,Zd,Hd,Ud,Vd,Fd,j0;class hz{constructor(e){p(this,ji);C(this,"document");C(this,"panels",new Set);p(this,Ar,new Map);p(this,qc,new WeakMap);p(this,Wc,new AbortController);p(this,wa);p(this,pi,0);p(this,Zd,e=>{if(!(e.target instanceof Element))return;const t=e.target;s(this,qc).set(e,{inside:new Set([...this.panels].filter(r=>{var i;return this.contains(r,t)||((i=r.trigger)==null?void 0:i.contains(t))})),open:[...this.panels].filter(r=>r.open)})});p(this,Hd,e=>{var o,a,l;if(!(e.target instanceof Element))return;const t=e.target,r=s(this,qc).get(e),i=[...this.panels].find(c=>{var d;return(d=c.trigger)==null?void 0:d.contains(t)});for(const c of(r==null?void 0:r.open)??[])c.open&&!c.manual&&c!==i&&!(r!=null&&r.inside.has(c))&&c.close();if(i&&!((o=i.trigger)!=null&&o.disabled))i.toggle(e.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(t)&&((l=(a=c.behavior).click)==null||l.call(a,t))});p(this,Ud,e=>{var t,r;if(e.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(e.target)&&((r=(t=i.behavior).pointermove)==null||r.call(t,e.target))});p(this,Vd,e=>{var o,a,l,c;const t=u(this,ji,W0).call(this),r=t.find(d=>d.behavior.select),i=r??t.find(d=>d.behavior.keydown);if(!((a=i==null?void 0:(o=i.behavior).keydown)!=null&&a.call(o,e))){if(e.key==="Escape"&&r){u(this,ji,j0).call(this,e,t,r);return}for(const d of this.panels)if(!d.open&&d.trigger===this.document.activeElement&&((c=(l=d.behavior).keydown)!=null&&c.call(l,e)))return}});p(this,Fd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;const t=u(this,ji,W0).call(this);u(this,ji,j0).call(this,e,t)});this.document=e;const t={signal:s(this,Wc).signal};e.addEventListener("click",s(this,Zd),{...t,capture:!0}),e.addEventListener("click",s(this,Hd),t),e.addEventListener("keydown",s(this,Vd),{...t,capture:!0}),e.addEventListener("keydown",s(this,Fd),t),e.addEventListener("pointermove",s(this,Ud),t),h(this,wa,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),s(this,wa).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(s(this,pi))return;const e=()=>{h(this,pi,0);for(const t of this.panels)t.open&&t.place();[...this.panels].some(t=>t.open)&&h(this,pi,this.document.defaultView.requestAnimationFrame(e))};h(this,pi,this.document.defaultView.requestAnimationFrame(e))}remove(e){this.closed(e),this.panels.delete(e),!this.panels.size&&(s(this,Wc).abort(),s(this,wa).disconnect(),this.document.defaultView.cancelAnimationFrame(s(this,pi)),q0.delete(this.document))}prepareOpen(e){let t=null;for(const r of this.panels)r===e||!r.open||!e.trigger||!r.host.contains(e.trigger)||(t===null||t.host.contains(r.host))&&(t=r);if(s(this,Ar).set(e,t),!(e.manual||e.behavior.select))for(const r of this.panels)r.open&&r!==e&&!r.manual&&!r.behavior.select&&!this.isDescendant(e,r)&&r.close()}isDescendant(e,t){for(let r=s(this,Ar).get(e);r;r=s(this,Ar).get(r))if(r===t)return!0;return!1}contains(e,t){return t?e.host.contains(t)||[...this.panels].some(r=>this.isDescendant(r,e)&&r.host.contains(t)):!1}closeDescendants(e){for(const t of[...this.panels])this.isDescendant(t,e)&&t.close(!1)}closed(e){s(this,Ar).delete(e)}}Ar=new WeakMap,qc=new WeakMap,Wc=new WeakMap,wa=new WeakMap,pi=new WeakMap,ji=new WeakSet,W0=function(){const e=t=>{let r=0;for(let i=s(this,Ar).get(t);i;i=s(this,Ar).get(i))r++;return r};return[...this.panels].filter(t=>t.open).reverse().sort((t,r)=>e(r)-e(t))},Zd=new WeakMap,Hd=new WeakMap,Ud=new WeakMap,Vd=new WeakMap,Fd=new WeakMap,j0=function(e,t,r){if(!r&&t.some(o=>o.manual&&e.composedPath().includes(o.host)))return;const i=r??t.find(o=>!o.manual);i&&!i.manual&&(e.preventDefault(),e.stopImmediatePropagation(),i.close())};var $e,fi,Ls,ba,mi,gi,ht,G0,v6,Y0,jc,y6,J0;class Zg{constructor(e,t={}){p(this,ht);C(this,"host");C(this,"behavior");C(this,"trigger",null);p(this,$e);p(this,fi,!1);p(this,Ls,!1);p(this,ba,!0);p(this,mi,new Map);p(this,gi,new Set);p(this,jc,e=>{const t=e.target;t instanceof HTMLElement&&t!==this.host&&this.host.contains(t)&&s(this,gi).add(t)});this.host=e,this.behavior=t}get open(){return this.host.hasAttribute("open")&&s(this,fi)}get manual(){return this.host.hasAttribute("manual")}connect(){if(s(this,$e))return;const e=this.host.ownerDocument;h(this,$e,q0.get(e)),s(this,$e)||(h(this,$e,new hz(e)),q0.set(e,s(this,$e))),s(this,$e).panels.add(this),this.refresh()}disconnect(){var t,r,i,o;if(!s(this,$e))return;const e=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),this.host.removeAttribute("open"),(r=(t=this.behavior).closed)==null||r.call(t),u(this,ht,Y0).call(this),u(this,ht,J0).call(this),e&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),u(this,ht,G0).call(this),(o=s(this,$e))==null||o.remove(this),h(this,$e,void 0)}refresh(){var r,i,o,a,l,c,d;if(!s(this,$e))return;const e=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),t=e instanceof HTMLButtonElement?e:null;if(t!==this.trigger&&(u(this,ht,G0).call(this),this.trigger=t),this.trigger&&Zo(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==s(this,fi))if(this.host.hasAttribute("open"))s(this,$e).prepareOpen(this),h(this,fi,!0),u(this,ht,v6).call(this),u(this,ht,y6).call(this),this.place(),(a=(o=this.behavior).opened)==null||a.call(o,s(this,Ls)),h(this,Ls,!1),s(this,$e).animate();else{const f=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),(c=(l=this.behavior).closed)==null||c.call(l),u(this,ht,Y0).call(this),u(this,ht,J0).call(this),f&&s(this,ba)&&((d=this.trigger)!=null&&d.isConnected)&&this.trigger.focus({preventScroll:!0})}}toggle(e=!1){h(this,Ls,e),this.host.toggleAttribute("open")}show(e=!1){h(this,Ls,e),this.host.setAttribute("open","")}close(e=!0){h(this,ba,e),this.host.removeAttribute("open"),this.refresh(),h(this,ba,!0)}place(){var ve,Xe,Ze;if(!this.open||!this.trigger)return;const e=this.host,t=e.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(t.getComputedStyle(e).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const o=e.scrollTop,a=e.scrollLeft,l=[];for(const le of s(this,gi)){if(!le.isConnected||!e.contains(le)){s(this,gi).delete(le);continue}l.push({element:le,scrollTop:le.scrollTop,scrollLeft:le.scrollLeft})}e.style.maxWidth="none";const c=s(this,mi).get("max-height");c!=null&&c.value?e.style.setProperty("max-height",c.value,c.priority):e.style.removeProperty("max-height");const d=t.getComputedStyle(e).maxHeight;e.style.minWidth=this.behavior.select?`${Math.min(r.width,t.innerWidth-2*i)}px`:((ve=s(this,mi).get("min-width"))==null?void 0:ve.value)??"";const f=e.getBoundingClientRect(),g=Math.max(0,t.innerWidth-i-r.left),y=Math.max(0,r.right-i),v=f.width>g&&y>g,_=Math.min(t.innerWidth-2*i,v?y:g),E=Number.parseFloat(t.getComputedStyle(e).minWidth)||0;e.style.minWidth=`${Math.max(0,Math.min(E,_))}px`,e.style.maxWidth=`${Math.max(0,_)}px`;const x=e.getBoundingClientRect(),B=x.width,P=x.height,J=Math.max(i,Math.min(v?r.right-B:r.left,t.innerWidth-i-B));let O,Y;if(this.behavior.select){const le=(Ze=(Xe=this.behavior).selectedRow)==null?void 0:Ze.call(Xe),sr=le?le.getBoundingClientRect().top+le.offsetHeight/2-x.top:0,Zt=r.top+r.height/2-sr;if(Zt>=i&&Zt+P<=t.innerHeight-i)O=Zt,Y=t.innerHeight-i-Zt;else{const wl=t.innerHeight-i-r.top,bl=r.bottom-i,ju=P>wl&&bl>wl;Y=ju?bl:wl,O=ju?r.bottom-Math.min(P,Y):r.top}}else{const le=Math.max(0,t.innerHeight-i-r.bottom-i),sr=Math.max(0,r.top-2*i),Zt=P>le&&sr>le;Y=Zt?sr:le,O=Zt?r.top-i-Math.min(P,sr):r.bottom+i}const U=`${Math.max(0,Y)}px`;e.style.maxHeight=d==="none"?U:`min(${d}, ${U})`,e.style.left=`${J}px`,e.style.top=`${Math.max(i,Math.min(O,t.innerHeight-i-Math.min(P,Y)))}px`;const j=t.getComputedStyle(e),fe=j.boxSizing==="border-box",de=parseFloat(j.width)+(fe?0:parseFloat(j.paddingLeft)+parseFloat(j.paddingRight)+parseFloat(j.borderLeftWidth)+parseFloat(j.borderRightWidth)),Fe=parseFloat(j.height)+(fe?0:parseFloat(j.paddingTop)+parseFloat(j.paddingBottom)+parseFloat(j.borderTopWidth)+parseFloat(j.borderBottomWidth));e.style.setProperty("--_panel-edge-inset",`${e.style.top} auto auto ${e.style.left}`),e.style.setProperty("--_panel-edge-width",`${de}px`),e.style.setProperty("--_panel-edge-height",`${Fe}px`),e.scrollTop=o,e.scrollLeft=a;for(const le of l)le.element.scrollTop=le.scrollTop,le.element.scrollLeft=le.scrollLeft}}$e=new WeakMap,fi=new WeakMap,Ls=new WeakMap,ba=new WeakMap,mi=new WeakMap,gi=new WeakMap,ht=new WeakSet,G0=function(){var e,t;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(t=(e=this.behavior).unpair)==null||t.call(e,this.trigger),this.trigger=null)},v6=function(){s(this,gi).clear(),this.host.addEventListener("scroll",s(this,jc),!0)},Y0=function(){this.host.removeEventListener("scroll",s(this,jc),!0),s(this,gi).clear()},jc=new WeakMap,y6=function(){const e=this.host;for(const t of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])s(this,mi).set(t,{value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)});e.style.position="fixed",e.style.zIndex="var(--layer-panel)",e.style.margin="0",e.style.overflow="auto",e.style.setProperty("--_panel-edge-position","fixed")},J0=function(){for(const[e,{value:t,priority:r}]of s(this,mi))t?this.host.style.setProperty(e,t,r):this.host.style.removeProperty(e);s(this,mi).clear()};class dz extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var vi,ir,K0,X0,b6;class w6 extends HTMLElement{constructor(){super();p(this,ir);p(this,vi,new Zg(this,{opened:t=>{t&&wc(u(this,ir,K0).call(this)[0])},keydown:t=>u(this,ir,b6).call(this,t),pointermove:t=>wc(u(this,ir,X0).call(this,t)??void 0),click:t=>{u(this,ir,X0).call(this,t)&&s(this,vi).close()}}));this.attachInternals().role="menu"}connectedCallback(){s(this,vi).connect()}disconnectedCallback(){s(this,vi).disconnect()}attributeChangedCallback(){s(this,vi).refresh()}}vi=new WeakMap,ir=new WeakSet,K0=function(){return[...this.querySelectorAll("tv-menu-item")]},X0=function(t){const r=t.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},b6=function(t){if(!s(this,vi).open)return!1;const r=u(this,ir,K0).call(this),i=r.indexOf(this.ownerDocument.activeElement);return g6(t,r)?!0:t.key==="Enter"&&i>=0?(t.preventDefault(),t.stopImmediatePropagation(),r[i].click(),!0):!1},C(w6,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",dz);customElements.get("tv-menu")||customElements.define("tv-menu",w6);let pz=0;var Gc;class fz extends Nt{constructor(){super(...arguments);p(this,Gc,`menu-trigger-${++pz}`)}template(t,{trigger:r}){return M`${r(s(this,Gc))}<tv-menu trigger=${s(this,Gc)}>
68
68
  ${t.map(i=>"separator"in i?M`<hr>`:M`<tv-menu-item intent=${i.destructive?"danger":te} @click=${i.action}>${i.label}</tv-menu-item>`)}
69
- </tv-menu>`}}Gc=new WeakMap;const S6=zt(r9);/**
69
+ </tv-menu>`}}Gc=new WeakMap;const S6=zt(fz);/**
70
70
  * @license
71
71
  * Copyright 2020 Google LLC
72
72
  * SPDX-License-Identifier: BSD-3-Clause
73
- */const wn=()=>new i9;class i9{}const Kf=new WeakMap,Je=vl(class extends d6{render(n){return te}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)),te}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Kf.get(e);t===void 0&&(t=new WeakMap,Kf.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=Kf.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)}});/**
73
+ */const wn=()=>new mz;class mz{}const Jf=new WeakMap,Je=vl(class extends d6{render(n){return te}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)),te}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Jf.get(e);t===void 0&&(t=new WeakMap,Jf.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=Jf.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)}});/**
74
74
  * @license
75
75
  * Copyright 2017 Google LLC
76
76
  * SPDX-License-Identifier: BSD-3-Clause
77
- */const Ky=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},Cd=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.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=[],o=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,o[a]=t(l,a),a++;return{values:o,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=uN(n),{values:o,keys:a}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=a,o;const l=this.ut??(this.ut=[]),c=[];let d,f,g=0,y=i.length-1,v=0,_=o.length-1;for(;g<=y&&v<=_;)if(i[g]===null)g++;else if(i[y]===null)y--;else if(l[g]===a[v])c[v]=ts(i[g],o[v]),g++,v++;else if(l[y]===a[_])c[_]=ts(i[y],o[_]),y--,_--;else if(l[g]===a[_])c[_]=ts(i[g],o[_]),$l(n,c[_+1],i[g]),g++,_--;else if(l[y]===a[v])c[v]=ts(i[y],o[v]),$l(n,i[g],i[y]),y--,v++;else if(d===void 0&&(d=Ky(a,v,_),f=Ky(l,g,y)),d.has(l[g]))if(d.has(l[y])){const E=f.get(a[v]),x=E!==void 0?i[E]:null;if(x===null){const B=$l(n,i[g]);ts(B,o[v]),c[v]=B}else c[v]=ts(x,o[v]),$l(n,i[g],x),i[E]=null;v++}else Jf(i[y]),y--;else Jf(i[g]),g++;for(;v<=_;){const E=$l(n,c[_+1]);ts(E,o[v]),c[v++]=E}for(;g<=y;){const E=i[g++];E!==null&&Jf(E)}return this.ut=a,u6(n,c),at}});/**
77
+ */const Yy=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},Cd=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.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=[],o=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,o[a]=t(l,a),a++;return{values:o,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=h9(n),{values:o,keys:a}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=a,o;const l=this.ut??(this.ut=[]),c=[];let d,f,g=0,y=i.length-1,v=0,_=o.length-1;for(;g<=y&&v<=_;)if(i[g]===null)g++;else if(i[y]===null)y--;else if(l[g]===a[v])c[v]=ts(i[g],o[v]),g++,v++;else if(l[y]===a[_])c[_]=ts(i[y],o[_]),y--,_--;else if(l[g]===a[_])c[_]=ts(i[g],o[_]),$l(n,c[_+1],i[g]),g++,_--;else if(l[y]===a[v])c[v]=ts(i[y],o[v]),$l(n,i[g],i[y]),y--,v++;else if(d===void 0&&(d=Yy(a,v,_),f=Yy(l,g,y)),d.has(l[g]))if(d.has(l[y])){const E=f.get(a[v]),x=E!==void 0?i[E]:null;if(x===null){const B=$l(n,i[g]);ts(B,o[v]),c[v]=B}else c[v]=ts(x,o[v]),$l(n,i[g],x),i[E]=null;v++}else Yf(i[y]),y--;else Yf(i[g]),g++;for(;v<=_;){const E=$l(n,c[_+1]);ts(E,o[v]),c[v++]=E}for(;g<=y;){const E=i[g++];E!==null&&Yf(E)}return this.ut=a,u6(n,c),at}});/**
78
78
  * @license
79
79
  * Copyright 2018 Google LLC
80
80
  * SPDX-License-Identifier: BSD-3-Clause
81
- */const _6="important",s9=" !"+_6,Td=vl(class extends Bu{constructor(n){var e;if(super(n),n.type!==nr.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 o=typeof i=="string"&&i.endsWith(s9);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?_6:""):t[r]=i}}return at}}),o9=24;function a9(n){return!Xy(n.source)||!Xy(n.current)||!f9(n.source,n.current)||!m9(n)||!p9(n.geometry)?{kind:"invalidated"}:u9(n.pointer,n.geometry)==="pinned"?l9(n):c9(n)}function l9(n){var c;const{source:e,current:t,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??h9(r.y,i.pinnedRows),l=t.pinnedChannelIds.filter(d=>d!==e.channelId);return l.splice(a,0,e.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function c9(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?d9(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(o=>o!==e.channelId):null}}function u9(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+o9);return n.y<i?"pinned":"unpinned"}function h9(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function d9(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function p9(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function Xy(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function f9(n,e){return em(n.pinnedChannelIds,e.pinnedChannelIds)&&em(n.unpinnedChannelIds,e.unpinnedChannelIds)}function m9(n){const e=n.current.pinnedChannelIds.filter(o=>o!==n.source.channelId),t=n.geometry.pinnedRows.map(({channelId:o})=>o),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)&&em(e,t)&&i}function em(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const A6=4,Go=200,Qt=28,$d=800,gh="ease",Qy=.5,Rl=.5,g9="New channel",ns=".channel-group:not(.channel-group-withdrawal) .channel-row",v9=24;var pt,It,nt,Ge,xt,ft,Un,Ls,be,se,Vt,Bt,qt,mt,gt,vt,Wt,yt,Zn,Er,Sa,_a,yi,T,tm,k6,C6,T6,$6,Bh,R6,I6,x6,P6,Bl,Zo,D6,L6,nm,ql,Bd,qd,Wd,jd,M6,rm,im,O6,Yc,Jc,N6,Gd,Kc,z6,U6,Wl,sm,Z6,F6,jl,om,am,lm,H6,qh,Xc,Qc,eu,tu,V6,cm,Wh,jh,Gl,um,hm;class E6{constructor(e){p(this,T);p(this,pt);p(this,It,null);p(this,nt,null);p(this,Ge,{management:!0});p(this,xt,!1);p(this,ft,null);p(this,Un,"");p(this,Ls,!1);p(this,be,null);p(this,se,null);p(this,Vt,!1);p(this,Bt,null);p(this,qt,null);p(this,mt,null);p(this,gt,null);p(this,vt,null);p(this,Wt,null);p(this,yt,null);p(this,Zn,null);p(this,Er,wn());p(this,Sa,wn());p(this,_a,wn());p(this,yi,null);C(this,"create",()=>{const e=s(this,It),t=s(this,nt);if(e===null||t===null||s(this,Bt)!==null)return;const r={resultChannelId:null};h(this,Bt,r),s(this,pt).call(this),e.createChannel(g9).then(i=>{r.resultChannelId=i.id,e.focusChannel(i.id).catch(()=>{}),s(this,Bt)===r&&s(this,pt).call(this)},()=>{s(this,Bt)!==r||s(this,qt)!==null||(h(this,Bt,null),s(this,pt).call(this))})});p(this,Bd,e=>{h(this,Un,e.currentTarget.value)});p(this,qd,e=>{e.key==="Enter"?(e.preventDefault(),u(this,T,ql).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),u(this,T,ql).call(this,!1))});p(this,Wd,()=>{u(this,T,ql).call(this,!0)});p(this,jd,e=>{e.preventDefault(),u(this,T,ql).call(this,!0)});p(this,Yc,()=>{h(this,Vt,!1)});p(this,Jc,e=>{!s(this,Vt)||e.detail===0||(h(this,Vt,!1),e.preventDefault(),e.stopImmediatePropagation())});p(this,Gd,e=>{var t;!s(this,Ge).highlightOnPointerMove||s(this,se)!==null||s(this,ft)!==null||(t=s(this,Er).value)!=null&&t.querySelector("tv-menu[open]")||wc(e.currentTarget)});p(this,Kc,e=>{if(s(this,xt)){h(this,be,null);return}const t=s(this,se);if(t!==null){if(t.pointerId!==e.pointerId)return;e.preventDefault(),u(this,T,Wl).call(this,t,e);return}const r=s(this,be);if(!(r===null||r.pointerId!==e.pointerId)){if(e.buttons===0){h(this,be,null);return}Math.hypot(e.clientX-r.x,e.clientY-r.y)<=A6||u(this,T,z6).call(this,r,e)}});p(this,Xc,e=>{var r;const t=s(this,se);if(t!==null&&t.pointerId===e.pointerId){if(t.completed)return;const i=t.captureTarget.hasPointerCapture(e.pointerId);u(this,T,Wl).call(this,t,e);const o=i&&t.placement.kind==="placement"?t.placement.operation:null,a=s(this,It);if(o===null||a===null){u(this,T,Gl).call(this,t,!1);return}t.completed=!0,u(this,T,jl).call(this,t),t.operation=[...o],a.setPinnedChannelIds([...o]).then(()=>{s(this,se)===t&&(t.operationResolved=!0,u(this,T,cm).call(this,s(this,nt)))},()=>{s(this,se)===t&&(t.operationResolved=!0,t.operationRejected=!0,u(this,T,Wh).call(this,t))});return}((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,Qc,e=>{var t,r;((t=s(this,se))==null?void 0:t.pointerId)===e.pointerId&&!s(this,se).completed?u(this,T,jh).call(this):((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,eu,e=>{const t=s(this,se);t===null||t.pointerId!==e.pointerId||t.completed||u(this,T,Gl).call(this,t,!1)});p(this,tu,e=>{e.key!=="Escape"||s(this,se)===null||s(this,se).completed||(e.preventDefault(),e.stopImmediatePropagation(),u(this,T,jh).call(this))});h(this,pt,e)}get creating(){return s(this,Bt)!==null}get dragging(){return s(this,se)!==null}connect(){window.addEventListener("pointermove",s(this,Kc)),window.addEventListener("pointerup",s(this,Xc)),window.addEventListener("pointercancel",s(this,Qc)),window.addEventListener("lostpointercapture",s(this,eu)),window.addEventListener("keydown",s(this,tu),!0),window.addEventListener("click",s(this,Jc),!0),window.addEventListener("pointerdown",s(this,Yc),!0)}update(e,t,r){const i=s(this,nt),o=s(this,xt);h(this,It,e),h(this,nt,t),h(this,Ge,r),h(this,xt,r.motionSuppressed??!1),!o&&s(this,xt)&&u(this,T,D6).call(this),u(this,T,V6).call(this,t),u(this,T,T6).call(this,t),u(this,T,x6).call(this,i,t),s(this,ft)!==null&&!t.channels.some(({id:l})=>l===s(this,ft))&&(h(this,ft,null),h(this,Un,"")),u(this,T,cm).call(this,t);const a=s(this,yi);a!==null&&t.display.pinnedChannelIds.includes(a.channelId)===a.pinned&&(h(this,yi,null),queueMicrotask(()=>{const l=u(this,T,rm).call(this,a.channelId);l==null||l.scrollIntoView({block:"nearest"}),a.focus&&(l==null||l.focus({preventScroll:!0}))})),o&&!s(this,xt)&&u(this,T,L6).call(this)}template(){var r;const e=s(this,nt);if(e===null)return te;const t=u(this,T,P6).call(this,ew(e,(r=s(this,se))==null?void 0:r.source));return M`
81
+ */const _6="important",gz=" !"+_6,Td=vl(class extends Bu{constructor(n){var e;if(super(n),n.type!==nr.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 o=typeof i=="string"&&i.endsWith(gz);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?_6:""):t[r]=i}}return at}}),vz=24;function yz(n){return!Jy(n.source)||!Jy(n.current)||!kz(n.source,n.current)||!Cz(n)||!Ez(n.geometry)?{kind:"invalidated"}:Sz(n.pointer,n.geometry)==="pinned"?wz(n):bz(n)}function wz(n){var c;const{source:e,current:t,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??_z(r.y,i.pinnedRows),l=t.pinnedChannelIds.filter(d=>d!==e.channelId);return l.splice(a,0,e.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function bz(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?Az(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(o=>o!==e.channelId):null}}function Sz(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+vz);return n.y<i?"pinned":"unpinned"}function _z(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function Az(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function Ez(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function Jy(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function kz(n,e){return Q0(n.pinnedChannelIds,e.pinnedChannelIds)&&Q0(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Cz(n){const e=n.current.pinnedChannelIds.filter(o=>o!==n.source.channelId),t=n.geometry.pinnedRows.map(({channelId:o})=>o),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)&&Q0(e,t)&&i}function Q0(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const A6=4,Go=200,Qt=28,$d=800,gh="ease",Ky=.5,Rl=.5,Tz="New channel",ns=".channel-group:not(.channel-group-withdrawal) .channel-row",$z=24;var pt,It,nt,Ge,xt,ft,Zn,Ds,be,se,Ft,Bt,qt,mt,gt,vt,Wt,yt,Hn,Er,Sa,_a,yi,T,em,k6,C6,T6,$6,Bh,R6,I6,x6,P6,Bl,Ho,L6,D6,tm,ql,Bd,qd,Wd,jd,M6,nm,rm,O6,Yc,Jc,N6,Gd,Kc,z6,Z6,Wl,im,H6,U6,jl,sm,om,am,V6,qh,Xc,Qc,eu,tu,F6,lm,Wh,jh,Gl,cm,um;class E6{constructor(e){p(this,T);p(this,pt);p(this,It,null);p(this,nt,null);p(this,Ge,{management:!0});p(this,xt,!1);p(this,ft,null);p(this,Zn,"");p(this,Ds,!1);p(this,be,null);p(this,se,null);p(this,Ft,!1);p(this,Bt,null);p(this,qt,null);p(this,mt,null);p(this,gt,null);p(this,vt,null);p(this,Wt,null);p(this,yt,null);p(this,Hn,null);p(this,Er,wn());p(this,Sa,wn());p(this,_a,wn());p(this,yi,null);C(this,"create",()=>{const e=s(this,It),t=s(this,nt);if(e===null||t===null||s(this,Bt)!==null)return;const r={resultChannelId:null};h(this,Bt,r),s(this,pt).call(this),e.createChannel(Tz).then(i=>{r.resultChannelId=i.id,e.focusChannel(i.id).catch(()=>{}),s(this,Bt)===r&&s(this,pt).call(this)},()=>{s(this,Bt)!==r||s(this,qt)!==null||(h(this,Bt,null),s(this,pt).call(this))})});p(this,Bd,e=>{h(this,Zn,e.currentTarget.value)});p(this,qd,e=>{e.key==="Enter"?(e.preventDefault(),u(this,T,ql).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),u(this,T,ql).call(this,!1))});p(this,Wd,()=>{u(this,T,ql).call(this,!0)});p(this,jd,e=>{e.preventDefault(),u(this,T,ql).call(this,!0)});p(this,Yc,()=>{h(this,Ft,!1)});p(this,Jc,e=>{!s(this,Ft)||e.detail===0||(h(this,Ft,!1),e.preventDefault(),e.stopImmediatePropagation())});p(this,Gd,e=>{var t;!s(this,Ge).highlightOnPointerMove||s(this,se)!==null||s(this,ft)!==null||(t=s(this,Er).value)!=null&&t.querySelector("tv-menu[open]")||wc(e.currentTarget)});p(this,Kc,e=>{if(s(this,xt)){h(this,be,null);return}const t=s(this,se);if(t!==null){if(t.pointerId!==e.pointerId)return;e.preventDefault(),u(this,T,Wl).call(this,t,e);return}const r=s(this,be);if(!(r===null||r.pointerId!==e.pointerId)){if(e.buttons===0){h(this,be,null);return}Math.hypot(e.clientX-r.x,e.clientY-r.y)<=A6||u(this,T,z6).call(this,r,e)}});p(this,Xc,e=>{var r;const t=s(this,se);if(t!==null&&t.pointerId===e.pointerId){if(t.completed)return;const i=t.captureTarget.hasPointerCapture(e.pointerId);u(this,T,Wl).call(this,t,e);const o=i&&t.placement.kind==="placement"?t.placement.operation:null,a=s(this,It);if(o===null||a===null){u(this,T,Gl).call(this,t,!1);return}t.completed=!0,u(this,T,jl).call(this,t),t.operation=[...o],a.setPinnedChannelIds([...o]).then(()=>{s(this,se)===t&&(t.operationResolved=!0,u(this,T,lm).call(this,s(this,nt)))},()=>{s(this,se)===t&&(t.operationResolved=!0,t.operationRejected=!0,u(this,T,Wh).call(this,t))});return}((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,Qc,e=>{var t,r;((t=s(this,se))==null?void 0:t.pointerId)===e.pointerId&&!s(this,se).completed?u(this,T,jh).call(this):((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,eu,e=>{const t=s(this,se);t===null||t.pointerId!==e.pointerId||t.completed||u(this,T,Gl).call(this,t,!1)});p(this,tu,e=>{e.key!=="Escape"||s(this,se)===null||s(this,se).completed||(e.preventDefault(),e.stopImmediatePropagation(),u(this,T,jh).call(this))});h(this,pt,e)}get creating(){return s(this,Bt)!==null}get dragging(){return s(this,se)!==null}connect(){window.addEventListener("pointermove",s(this,Kc)),window.addEventListener("pointerup",s(this,Xc)),window.addEventListener("pointercancel",s(this,Qc)),window.addEventListener("lostpointercapture",s(this,eu)),window.addEventListener("keydown",s(this,tu),!0),window.addEventListener("click",s(this,Jc),!0),window.addEventListener("pointerdown",s(this,Yc),!0)}update(e,t,r){const i=s(this,nt),o=s(this,xt);h(this,It,e),h(this,nt,t),h(this,Ge,r),h(this,xt,r.motionSuppressed??!1),!o&&s(this,xt)&&u(this,T,L6).call(this),u(this,T,F6).call(this,t),u(this,T,T6).call(this,t),u(this,T,x6).call(this,i,t),s(this,ft)!==null&&!t.channels.some(({id:l})=>l===s(this,ft))&&(h(this,ft,null),h(this,Zn,"")),u(this,T,lm).call(this,t);const a=s(this,yi);a!==null&&t.display.pinnedChannelIds.includes(a.channelId)===a.pinned&&(h(this,yi,null),queueMicrotask(()=>{const l=u(this,T,nm).call(this,a.channelId);l==null||l.scrollIntoView({block:"nearest"}),a.focus&&(l==null||l.focus({preventScroll:!0}))})),o&&!s(this,xt)&&u(this,T,D6).call(this)}template(){var r;const e=s(this,nt);if(e===null)return te;const t=u(this,T,P6).call(this,Xy(e,(r=s(this,se))==null?void 0:r.source));return M`
82
82
  <div
83
83
  class="channel-list"
84
84
  role="listbox"
85
85
  aria-label="Channels"
86
86
  ${Je(s(this,Er))}
87
87
  >
88
- ${u(this,T,tm).call(this,"Pinned",t.pinned)}
89
- ${u(this,T,tm).call(this,"Recent",t.unpinned)}
88
+ ${u(this,T,em).call(this,"Pinned",t.pinned)}
89
+ ${u(this,T,em).call(this,"Recent",t.unpinned)}
90
90
  </div>
91
- `}overlayTemplate(){return s(this,Ge).management?u(this,T,I6).call(this):te}disconnect(){var e,t,r;window.removeEventListener("pointermove",s(this,Kc)),window.removeEventListener("pointerup",s(this,Xc)),window.removeEventListener("pointercancel",s(this,Qc)),window.removeEventListener("lostpointercapture",s(this,eu)),window.removeEventListener("keydown",s(this,tu),!0),window.removeEventListener("click",s(this,Jc),!0),window.removeEventListener("pointerdown",s(this,Yc),!0),u(this,T,um).call(this),(e=s(this,Zn))==null||e.withdraw(),h(this,Zn,null),(t=s(this,Wt))==null||t.cancel(),h(this,Wt,null),(r=s(this,yt))==null||r.cancel(),h(this,yt,null),h(this,It,null),h(this,nt,null),h(this,ft,null),h(this,Un,""),h(this,Ls,!1),h(this,be,null),h(this,Vt,!1),h(this,Bt,null),h(this,qt,null),h(this,mt,null),h(this,gt,null),h(this,vt,null),h(this,yi,null)}}pt=new WeakMap,It=new WeakMap,nt=new WeakMap,Ge=new WeakMap,xt=new WeakMap,ft=new WeakMap,Un=new WeakMap,Ls=new WeakMap,be=new WeakMap,se=new WeakMap,Vt=new WeakMap,Bt=new WeakMap,qt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,yt=new WeakMap,Zn=new WeakMap,Er=new WeakMap,Sa=new WeakMap,_a=new WeakMap,yi=new WeakMap,T=new WeakSet,tm=function(e,t){var f;const r=e==="Pinned"?"pinned":"unpinned",i=s(this,se);if(i===null&&t.length===0)return null;const o=i===null?void 0:t.find(({channel:g})=>g.id===i.channelId),a=i===null?t:t.filter(({channel:g})=>g.id!==i.channelId),l=(i==null?void 0:i.placement.kind)==="placement"&&((f=i.placement.placeholder)==null?void 0:f.side)===r?i.placement.placeholder:null,c=a.map(g=>({kind:"row",row:g}));l!==null&&c.splice(l.index,0,{kind:"placeholder",key:`channel-placeholder-${r}`}),o!==void 0&&c.push({kind:"row",row:o});const d=i!==null&&a.length===0&&l===null;return M`
91
+ `}overlayTemplate(){return s(this,Ge).management?u(this,T,I6).call(this):te}disconnect(){var e,t,r;window.removeEventListener("pointermove",s(this,Kc)),window.removeEventListener("pointerup",s(this,Xc)),window.removeEventListener("pointercancel",s(this,Qc)),window.removeEventListener("lostpointercapture",s(this,eu)),window.removeEventListener("keydown",s(this,tu),!0),window.removeEventListener("click",s(this,Jc),!0),window.removeEventListener("pointerdown",s(this,Yc),!0),u(this,T,cm).call(this),(e=s(this,Hn))==null||e.withdraw(),h(this,Hn,null),(t=s(this,Wt))==null||t.cancel(),h(this,Wt,null),(r=s(this,yt))==null||r.cancel(),h(this,yt,null),h(this,It,null),h(this,nt,null),h(this,ft,null),h(this,Zn,""),h(this,Ds,!1),h(this,be,null),h(this,Ft,!1),h(this,Bt,null),h(this,qt,null),h(this,mt,null),h(this,gt,null),h(this,vt,null),h(this,yi,null)}}pt=new WeakMap,It=new WeakMap,nt=new WeakMap,Ge=new WeakMap,xt=new WeakMap,ft=new WeakMap,Zn=new WeakMap,Ds=new WeakMap,be=new WeakMap,se=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,qt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,yt=new WeakMap,Hn=new WeakMap,Er=new WeakMap,Sa=new WeakMap,_a=new WeakMap,yi=new WeakMap,T=new WeakSet,em=function(e,t){var f;const r=e==="Pinned"?"pinned":"unpinned",i=s(this,se);if(i===null&&t.length===0)return null;const o=i===null?void 0:t.find(({channel:g})=>g.id===i.channelId),a=i===null?t:t.filter(({channel:g})=>g.id!==i.channelId),l=(i==null?void 0:i.placement.kind)==="placement"&&((f=i.placement.placeholder)==null?void 0:f.side)===r?i.placement.placeholder:null,c=a.map(g=>({kind:"row",row:g}));l!==null&&c.splice(l.index,0,{kind:"placeholder",key:`channel-placeholder-${r}`}),o!==void 0&&c.push({kind:"row",row:o});const d=i!==null&&a.length===0&&l===null;return M`
92
92
  <div
93
93
  class="channel-group"
94
94
  role="group"
@@ -123,7 +123,7 @@ Television updates its desktop app automatically. Version {version} has download
123
123
  <input
124
124
  class="channel-rename"
125
125
  aria-label="Channel name"
126
- .value=${s(this,Un)}
126
+ .value=${s(this,Zn)}
127
127
  @input=${s(this,Bd)}
128
128
  @keydown=${s(this,qd)}
129
129
  @blur=${s(this,Wd)}
@@ -171,7 +171,7 @@ Television updates its desktop app automatically. Version {version} has download
171
171
  `}):te}
172
172
  `}
173
173
  </div>
174
- `},C6=function(e){const{channel:t,pinned:r}=e;return[{label:"Rename",action:()=>u(this,T,nm).call(this,t.id)},{label:r?"Unpin":"Pin",action:()=>u(this,T,M6).call(this,t.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>u(this,T,$6).call(this,t.id,t.name)}]},T6=function(e){const t=s(this,Bt);if(t===null||s(this,qt)!==null||t.resultChannelId===null)return;const r=e.channels.find(({id:i})=>i===t.resultChannelId);r!==void 0&&(h(this,qt,r.id),queueMicrotask(()=>u(this,T,Bl).call(this,"create",r.id)))},$6=function(e,t){var i,o,a,l,c;if(s(this,mt)!==null||s(this,gt)!==null)return;u(this,T,im).call(this,e),h(this,mt,{channelId:e,name:t}),(o=(i=s(this,Ge)).onDeleteStart)==null||o.call(i,e),s(this,pt).call(this);const r=(a=s(this,_a).value)==null?void 0:a.closest("dialog");r instanceof HTMLDialogElement&&(h(this,Zn,Yp(r,()=>{u(this,T,Bh).call(this)})),(c=(l=s(this,_a).value)==null?void 0:l.querySelector(".dialog-actions button"))==null||c.focus())},Bh=function(e=!1){var i,o;const t=s(this,mt),r=s(this,Zn);h(this,Zn,null),h(this,mt,null),r==null||r.withdraw(),s(this,pt).call(this),!e&&t!==null&&((o=(i=s(this,Ge)).onDeleteEnd)==null||o.call(i,t.channelId,!1))},R6=function(){const e=s(this,It),t=s(this,mt);if(e===null||t===null||s(this,gt)!==null)return;h(this,gt,t.channelId),u(this,T,Bh).call(this,!0);const r=s(this,Ge).onDeleteEnd;e.deleteChannel(t.channelId).then(()=>{r==null||r(t.channelId,!0)}).catch(()=>{s(this,gt)===t.channelId&&s(this,vt)===null&&(h(this,gt,null),s(this,pt).call(this)),r==null||r(t.channelId,!1)})},I6=function(){const e=s(this,mt);return e===null?null:Gp(M`
174
+ `},C6=function(e){const{channel:t,pinned:r}=e;return[{label:"Rename",action:()=>u(this,T,tm).call(this,t.id)},{label:r?"Unpin":"Pin",action:()=>u(this,T,M6).call(this,t.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>u(this,T,$6).call(this,t.id,t.name)}]},T6=function(e){const t=s(this,Bt);if(t===null||s(this,qt)!==null||t.resultChannelId===null)return;const r=e.channels.find(({id:i})=>i===t.resultChannelId);r!==void 0&&(h(this,qt,r.id),queueMicrotask(()=>u(this,T,Bl).call(this,"create",r.id)))},$6=function(e,t){var i,o,a,l,c;if(s(this,mt)!==null||s(this,gt)!==null)return;u(this,T,rm).call(this,e),h(this,mt,{channelId:e,name:t}),(o=(i=s(this,Ge)).onDeleteStart)==null||o.call(i,e),s(this,pt).call(this);const r=(a=s(this,_a).value)==null?void 0:a.closest("dialog");r instanceof HTMLDialogElement&&(h(this,Hn,Yp(r,()=>{u(this,T,Bh).call(this)})),(c=(l=s(this,_a).value)==null?void 0:l.querySelector(".dialog-actions button"))==null||c.focus())},Bh=function(e=!1){var i,o;const t=s(this,mt),r=s(this,Hn);h(this,Hn,null),h(this,mt,null),r==null||r.withdraw(),s(this,pt).call(this),!e&&t!==null&&((o=(i=s(this,Ge)).onDeleteEnd)==null||o.call(i,t.channelId,!1))},R6=function(){const e=s(this,It),t=s(this,mt);if(e===null||t===null||s(this,gt)!==null)return;h(this,gt,t.channelId),u(this,T,Bh).call(this,!0);const r=s(this,Ge).onDeleteEnd;e.deleteChannel(t.channelId).then(()=>{r==null||r(t.channelId,!0)}).catch(()=>{s(this,gt)===t.channelId&&s(this,vt)===null&&(h(this,gt,null),s(this,pt).call(this)),r==null||r(t.channelId,!1)})},I6=function(){const e=s(this,mt);return e===null?null:Gp(M`
175
175
  <div
176
176
  class="dialog-alert channel-delete-alert"
177
177
  role="alertdialog"
@@ -192,7 +192,7 @@ Television updates its desktop app automatically. Version {version} has download
192
192
  </button>
193
193
  </div>
194
194
  </div>
195
- `)},x6=function(e,t){var d,f;if(s(this,mt)!==null&&!t.channels.some(({id:g})=>{var y;return g===((y=s(this,mt))==null?void 0:y.channelId)})){const g=s(this,mt);(d=s(this,Zn))==null||d.withdraw(),h(this,Zn,null),h(this,mt,null),queueMicrotask(()=>{var y,v;return(v=(y=s(this,Ge)).onDeleteEnd)==null?void 0:v.call(y,g.channelId,!0)})}const r=s(this,vt);if(r!==null&&t.channels.some(({id:g})=>g===r.row.channel.id)){(f=s(this,yt))==null||f.cancel(),h(this,yt,null),h(this,vt,null),h(this,gt,null);return}const i=s(this,gt);if(i===null||r!==null||t.channels.some(({id:g})=>g===i))return;if(e===null){h(this,gt,null);return}const o=ew(e),a=o.pinned.findIndex(({channel:g})=>g.id===i),l=o.unpinned.findIndex(({channel:g})=>g.id===i),c=a>=0?o.pinned[a]:o.unpinned[l];if(c===void 0){h(this,gt,null);return}h(this,vt,{row:{...c,selected:!1},side:a>=0?"pinned":"unpinned",index:a>=0?a:l}),queueMicrotask(()=>u(this,T,Bl).call(this,"delete",i))},P6=function(e){const t=s(this,vt);if(t===null)return e;const r=[...e[t.side]];return r.some(({channel:i})=>i.id===t.row.channel.id)||r.splice(t.index,0,t.row),{...e,[t.side]:r}},Bl=function(e,t){var l,c;if(e==="create"&&s(this,qt)!==t||e==="delete"&&((l=s(this,vt))==null?void 0:l.row.channel.id)!==t||s(this,xt))return;const r=[...((c=s(this,Er).value)==null?void 0:c.querySelectorAll(ns))??[]].find(d=>d.dataset.channelId===t);if(r===void 0){e==="delete"&&u(this,T,Zo).call(this,e,t);return}if(typeof r.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,T,Zo).call(this,e,t);return}const i=r.getBoundingClientRect().height,o=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${i}px`,opacity:1}]:[{maxHeight:`${i}px`,opacity:1},{maxHeight:"0px",opacity:0}],a=r.animate(o,{duration:Go,easing:gh});e==="create"?h(this,Wt,a):h(this,yt,a),a.finished.then(()=>{e==="create"&&s(this,Wt)!==a||e==="delete"&&s(this,yt)!==a||(e==="create"?h(this,Wt,null):h(this,yt,null),u(this,T,Zo).call(this,e,t))},()=>{})},Zo=function(e,t){var r;if(e==="create"){if(s(this,qt)!==t)return;h(this,qt,null),h(this,Bt,null),u(this,T,nm).call(this,t);return}((r=s(this,vt))==null?void 0:r.row.channel.id)===t&&(h(this,vt,null),h(this,gt,null),s(this,pt).call(this))},D6=function(){var r;h(this,be,null),u(this,T,um).call(this);const e=s(this,qt);s(this,Wt)!==null&&(s(this,Wt).cancel(),h(this,Wt,null),e!==null&&queueMicrotask(()=>u(this,T,Zo).call(this,"create",e)));const t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;s(this,yt)!==null&&(s(this,yt).cancel(),h(this,yt,null),t!==null&&queueMicrotask(()=>u(this,T,Zo).call(this,"delete",t)))},L6=function(){var r;const e=s(this,qt),t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;e!==null&&s(this,Wt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"create",e)),t!==null&&s(this,yt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"delete",t))},nm=function(e){var r;const t=(r=s(this,nt))==null?void 0:r.channels.find(({id:i})=>i===e);t!==void 0&&(h(this,ft,e),h(this,Un,t.name),h(this,be,null),s(this,pt).call(this),queueMicrotask(()=>{var i,o;s(this,ft)===e&&((i=s(this,Sa).value)==null||i.focus(),(o=s(this,Sa).value)==null||o.select())}))},ql=function(e){if(s(this,ft)===null||s(this,Ls)||s(this,It)===null)return;h(this,Ls,!0);const t=s(this,ft),r=s(this,Un).trim();h(this,ft,null),h(this,Un,""),s(this,pt).call(this),h(this,Ls,!1),e&&r.length>0&&s(this,It).renameChannel(t,r).catch(()=>{})},Bd=new WeakMap,qd=new WeakMap,Wd=new WeakMap,jd=new WeakMap,M6=function(e,t){var o;if(s(this,It)===null||s(this,nt)===null)return;if(u(this,T,im).call(this,e),s(this,Ge).revealMovedRow){const a=u(this,T,rm).call(this,e);h(this,yi,{channelId:e,pinned:t,focus:((o=a==null?void 0:a.parentElement)==null?void 0:o.contains(document.activeElement))??!1})}const r=s(this,nt).display.pinnedChannelIds,i=t?[...r.filter(a=>a!==e),e]:r.filter(a=>a!==e);s(this,It).setPinnedChannelIds(i).catch(()=>{h(this,yi,null)})},rm=function(e){var t,r;return((r=[...((t=s(this,Er).value)==null?void 0:t.querySelectorAll(ns))??[]].find(i=>i.dataset.channelId===e))==null?void 0:r.querySelector(".channel"))??void 0},im=function(e){var i,o,a;const t=[...((i=s(this,Er).value)==null?void 0:i.querySelectorAll(ns))??[]].find(l=>l.dataset.channelId===e),r=t==null?void 0:t.querySelector(".channel-menu-trigger");r&&((a=(o=s(this,Er).value)==null?void 0:o.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||a.removeAttribute("open"))},O6=function(e,t){if(t.button!==0||s(this,be)!==null||s(this,se)!==null||s(this,nt)===null)return;h(this,Vt,!1);const i=t.currentTarget.closest(".sidebar, .channel-switcher-pop");if(i===null)return;const o=Yl(s(this,nt));!o.pinnedChannelIds.includes(e)&&!o.unpinnedChannelIds.includes(e)||h(this,be,{channelId:e,pointerId:t.pointerId,x:t.clientX,y:t.clientY,source:{channelId:e,...o},captureTarget:i})},Yc=new WeakMap,Jc=new WeakMap,N6=function(e,t){var r;if(t.detail!==0&&s(this,Vt)){h(this,Vt,!1);return}h(this,Vt,!1),s(this,se)===null&&(s(this,Ge).selectChannel?s(this,Ge).selectChannel(e):(r=s(this,It))==null||r.focusChannel(e).catch(()=>{}))},Gd=new WeakMap,Kc=new WeakMap,z6=function(e,t){if(s(this,xt)){h(this,be,null);return}const r=[...e.captureTarget.querySelectorAll(ns)].find(f=>f.dataset.channelId===e.channelId);if(r===void 0){h(this,be,null);return}const i=r.getBoundingClientRect(),o=u(this,T,U6).call(this,r),a=y9({wideRow:i,compactPreviewWidth:o,pointer:{x:e.x,y:e.y}}),l=e.captureTarget.querySelector('[data-channel-side="pinned"]'),c=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{h(this,be,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${a.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${a.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${a.correctionX}px`),h(this,Vt,!0);const d={...e,placement:{kind:"invalidated"},currentX:t.clientX,currentY:t.clientY,grip:a,rowWidth:o,rowHeight:i.height,originPinnedContentBottom:(l==null?void 0:l.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(c==null?void 0:c.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};h(this,be,null),h(this,se,d),u(this,T,Wl).call(this,d,t)},U6=function(e){const t=e.cloneNode(!0);for(const i of[t,...t.querySelectorAll("[id], [trigger]")])i.removeAttribute("id"),i.removeAttribute("trigger");t.classList.add("dragged"),t.style.position="fixed",t.style.left="-10000px",t.style.top="-10000px",t.style.visibility="hidden",t.style.pointerEvents="none",document.body.append(t);const r=t.getBoundingClientRect().width;return t.remove(),r},Wl=function(e,t,r=!0){if(e.completed)return;const i=s(this,nt);if(i===null){e.placement={kind:"invalidated"};return}e.currentX=t.clientX,e.currentY=t.clientY;const o=Yl(i),a=new Map([...e.captureTarget.querySelectorAll(ns)].map(P=>[P.dataset.channelId,P])),l=o.pinnedChannelIds.filter(P=>P!==e.channelId).flatMap(P=>{const J=a.get(P);if(J===void 0)return[];const O=J.getBoundingClientRect();return[{channelId:P,top:O.top,bottom:O.bottom}]}),c=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),d=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),g=f==null?void 0:f.getBoundingClientRect(),y=f==null?void 0:f.dataset.channelSide,v=Number(f==null?void 0:f.dataset.channelIndex),_=e.captureTarget.getBoundingClientRect(),E=a9({source:e.source,current:o,pointer:{x:t.clientX,y:t.clientY},geometry:{sidebar:{left:_.left,right:_.right,top:_.top,bottom:_.bottom},pinnedRows:l,unpinnedGroupTop:(d==null?void 0:d.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:g!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(v)?{side:y,index:v,top:g.top,bottom:g.bottom}:null}}),x=!w9(e.placement,E),B=x?u(this,T,am).call(this,e):null;e.placement=E,(x||r)&&u(this,T,lm).call(this,e,B,!1),u(this,T,sm).call(this,e)},sm=function(e){const t=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=t?u(this,T,om).call(this,t,e.currentY):0,i=t?Math.max(0,t.scrollHeight-t.clientHeight):0,o=r<0?((t==null?void 0:t.scrollTop)??0)<=Qy:((t==null?void 0:t.scrollTop)??0)>=i-Qy;if(s(this,xt)||e.completed||r===0||i===0||o||typeof requestAnimationFrame!="function"){u(this,T,jl).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(a=>{u(this,T,Z6).call(this,e,a)}))},Z6=function(e,t){if(e.edgeScrollFrame=0,s(this,xt)||s(this,se)!==e||e.completed){e.edgeScrollTimestamp=null;return}const r=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");if(r===null){e.edgeScrollTimestamp=null;return}const i=u(this,T,om).call(this,r,e.currentY),o=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=t,i!==0&&o!==null){const a=Math.max(0,t-o)/1e3,l=Math.max(0,r.scrollHeight-r.clientHeight),c=r.scrollTop,d=i*a+e.edgeScrollRemainder,f=Math.max(0,Math.min(l,c+d));r.scrollTop=f;const g=r.scrollTop-c;if(e.edgeScrollRemainder=f===0||f===l?0:d-g,g!==0){r.toggleAttribute("continues-start",r.scrollTop>0),u(this,T,F6).call(this,e);return}}u(this,T,sm).call(this,e)},F6=function(e){u(this,T,Wl).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},jl=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},om=function(e,t){const r=e.getBoundingClientRect();return t>=r.top&&t<r.top+Qt?-$d*(r.top+Qt-t)/Qt:t>r.bottom-Qt&&t<=r.bottom?$d*(t-(r.bottom-Qt))/Qt:0},am=function(e){var i;for(const o of e.displacementAnimations)o.cancel();e.displacementAnimations.clear();const t=new Map;for(const o of e.captureTarget.querySelectorAll(ns)){const a=o.dataset.channelId;if(a===void 0)continue;const l=o.getBoundingClientRect();t.set(a,{left:l.left,top:l.top})}const r=new Map;for(const o of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=o.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=o.getBoundingClientRect(),c=o.cloneNode(!0);for(const d of[c,...c.querySelectorAll("[id], [trigger]")])d.removeAttribute("id"),d.removeAttribute("trigger");(i=c.querySelector(".channel-row.dragged"))==null||i.remove(),c.classList.add("channel-group-withdrawal"),c.setAttribute("aria-hidden","true"),c.removeAttribute("drag-collapsed"),r.set(a,{left:l.left,top:l.top,width:l.width,height:o.hasAttribute("drag-collapsed")?0:l.height,withdrawal:c})}return{rows:t,groups:r}},lm=function(e,t,r){const i=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),o=(i==null?void 0:i.scrollTop)??0;s(this,pt).call(this),queueMicrotask(()=>{const a=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");a!==null&&(a.scrollTop=o),t!==null&&u(this,T,H6).call(this,e,t,r)})},H6=function(e,t,r){if(!(s(this,xt)||typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of e.captureTarget.querySelectorAll(ns)){const o=i.dataset.channelId;if(o===void 0||!r&&o===e.channelId)continue;const a=t.rows.get(o);if(a===void 0)continue;const l=i.getBoundingClientRect(),c=a.left-l.left,d=a.top-l.top;Math.hypot(c,d)<=Rl||u(this,T,qh).call(this,e,i.animate({translate:[`${c}px ${d}px`,"0px 0px"]},{duration:Go,easing:gh}))}for(const i of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=i.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const a=t.groups.get(o),l=i.getBoundingClientRect(),c=i.hasAttribute("drag-collapsed")?0:l.height;if(a!==void 0){if(a.height<=Rl&&c>Rl)u(this,T,qh).call(this,e,i.animate([{opacity:0,translate:`0px -${c}px`},{opacity:1,translate:"0px 0px"}],{duration:Go,easing:gh}));else if(a.height>Rl&&c<=Rl&&a.withdrawal.childElementCount>0){const d=a.withdrawal;d.style.left=`${a.left}px`,d.style.top=`${a.top}px`,d.style.width=`${a.width}px`,d.style.height=`${a.height}px`,e.captureTarget.append(d);const f=d.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${a.height}px`}],{duration:Go,easing:gh});u(this,T,qh).call(this,e,f),f.finished.finally(()=>d.remove()).catch(()=>{})}}}}},qh=function(e,t){e.displacementAnimations.add(t),t.finished.finally(()=>{e.displacementAnimations.delete(t)}).catch(()=>{})},Xc=new WeakMap,Qc=new WeakMap,eu=new WeakMap,tu=new WeakMap,V6=function(e){const t=Yl(e);s(this,se)!==null&&!s(this,se).completed&&!tw(s(this,se).source,t)&&u(this,T,jh).call(this),s(this,be)!==null&&!tw(s(this,be).source,t)&&h(this,be,null)},cm=function(e){const t=s(this,se);if(e===null||t===null||!t.completed||!t.operationResolved||t.restorationQueued)return;if(t.operationRejected){u(this,T,Wh).call(this,t);return}const r=t.operation;r!==null&&Rd(Yl(e).pinnedChannelIds,r)&&u(this,T,Wh).call(this,t)},Wh=function(e){s(this,se)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{s(this,se)===e&&u(this,T,Gl).call(this,e,!1)}))},jh=function(){h(this,be,null);const e=s(this,se);e!==null&&u(this,T,Gl).call(this,e,!0)},Gl=function(e,t){if(s(this,se)!==e)return;u(this,T,jl).call(this,e);const r=u(this,T,am).call(this,e);h(this,se,null),u(this,T,hm).call(this,e),t&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),u(this,T,lm).call(this,e,r,!0)},um=function(){h(this,be,null);const e=s(this,se);if(h(this,se,null),e!==null){u(this,T,jl).call(this,e);for(const t of e.displacementAnimations)t.cancel();e.displacementAnimations.clear(),u(this,T,hm).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},hm=function(e){e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")};function y9(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=nw(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-v9));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:nw(n.pointer.y-n.wideRow.top,0,t)}}function ew(n,e=Yl(n)){var l,c;const t=new Map(n.channels.map(d=>[d.id,d])),r=e.pinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),i=e.unpinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),o=n.display.focusedChannelId,a=o!==null&&t.has(o)?o:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(d=>({channel:d,pinned:!0,selected:d.id===a})),unpinned:i.map(d=>({channel:d,pinned:!1,selected:d.id===a}))}}function Yl(n){const e=new Set(n.channels.map(({id:o})=>o)),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return{pinnedChannelIds:t,unpinnedChannelIds:i}}function tw(n,e){return Rd(n.pinnedChannelIds,e.pinnedChannelIds)&&Rd(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Rd(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function w9(n,e){var t,r,i,o;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)===((o=e.placeholder)==null?void 0:o.index)&&n.operation===null==(e.operation===null)&&(n.operation===null||e.operation===null||Rd(n.operation,e.operation))}function nw(n,e,t){return Math.max(e,Math.min(t,n))}var dn,Yd;class b9 extends Nt{constructor(){super(...arguments);p(this,dn,new E6(()=>this.render()));p(this,Yd,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,dn).connect()}template(t,r,i,o,a,l=!1){return s(this,dn).update(t,r,{management:!0,motionSuppressed:l}),M`
195
+ `)},x6=function(e,t){var d,f;if(s(this,mt)!==null&&!t.channels.some(({id:g})=>{var y;return g===((y=s(this,mt))==null?void 0:y.channelId)})){const g=s(this,mt);(d=s(this,Hn))==null||d.withdraw(),h(this,Hn,null),h(this,mt,null),queueMicrotask(()=>{var y,v;return(v=(y=s(this,Ge)).onDeleteEnd)==null?void 0:v.call(y,g.channelId,!0)})}const r=s(this,vt);if(r!==null&&t.channels.some(({id:g})=>g===r.row.channel.id)){(f=s(this,yt))==null||f.cancel(),h(this,yt,null),h(this,vt,null),h(this,gt,null);return}const i=s(this,gt);if(i===null||r!==null||t.channels.some(({id:g})=>g===i))return;if(e===null){h(this,gt,null);return}const o=Xy(e),a=o.pinned.findIndex(({channel:g})=>g.id===i),l=o.unpinned.findIndex(({channel:g})=>g.id===i),c=a>=0?o.pinned[a]:o.unpinned[l];if(c===void 0){h(this,gt,null);return}h(this,vt,{row:{...c,selected:!1},side:a>=0?"pinned":"unpinned",index:a>=0?a:l}),queueMicrotask(()=>u(this,T,Bl).call(this,"delete",i))},P6=function(e){const t=s(this,vt);if(t===null)return e;const r=[...e[t.side]];return r.some(({channel:i})=>i.id===t.row.channel.id)||r.splice(t.index,0,t.row),{...e,[t.side]:r}},Bl=function(e,t){var l,c;if(e==="create"&&s(this,qt)!==t||e==="delete"&&((l=s(this,vt))==null?void 0:l.row.channel.id)!==t||s(this,xt))return;const r=[...((c=s(this,Er).value)==null?void 0:c.querySelectorAll(ns))??[]].find(d=>d.dataset.channelId===t);if(r===void 0){e==="delete"&&u(this,T,Ho).call(this,e,t);return}if(typeof r.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,T,Ho).call(this,e,t);return}const i=r.getBoundingClientRect().height,o=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${i}px`,opacity:1}]:[{maxHeight:`${i}px`,opacity:1},{maxHeight:"0px",opacity:0}],a=r.animate(o,{duration:Go,easing:gh});e==="create"?h(this,Wt,a):h(this,yt,a),a.finished.then(()=>{e==="create"&&s(this,Wt)!==a||e==="delete"&&s(this,yt)!==a||(e==="create"?h(this,Wt,null):h(this,yt,null),u(this,T,Ho).call(this,e,t))},()=>{})},Ho=function(e,t){var r;if(e==="create"){if(s(this,qt)!==t)return;h(this,qt,null),h(this,Bt,null),u(this,T,tm).call(this,t);return}((r=s(this,vt))==null?void 0:r.row.channel.id)===t&&(h(this,vt,null),h(this,gt,null),s(this,pt).call(this))},L6=function(){var r;h(this,be,null),u(this,T,cm).call(this);const e=s(this,qt);s(this,Wt)!==null&&(s(this,Wt).cancel(),h(this,Wt,null),e!==null&&queueMicrotask(()=>u(this,T,Ho).call(this,"create",e)));const t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;s(this,yt)!==null&&(s(this,yt).cancel(),h(this,yt,null),t!==null&&queueMicrotask(()=>u(this,T,Ho).call(this,"delete",t)))},D6=function(){var r;const e=s(this,qt),t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;e!==null&&s(this,Wt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"create",e)),t!==null&&s(this,yt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"delete",t))},tm=function(e){var r;const t=(r=s(this,nt))==null?void 0:r.channels.find(({id:i})=>i===e);t!==void 0&&(h(this,ft,e),h(this,Zn,t.name),h(this,be,null),s(this,pt).call(this),queueMicrotask(()=>{var i,o;s(this,ft)===e&&((i=s(this,Sa).value)==null||i.focus(),(o=s(this,Sa).value)==null||o.select())}))},ql=function(e){if(s(this,ft)===null||s(this,Ds)||s(this,It)===null)return;h(this,Ds,!0);const t=s(this,ft),r=s(this,Zn).trim();h(this,ft,null),h(this,Zn,""),s(this,pt).call(this),h(this,Ds,!1),e&&r.length>0&&s(this,It).renameChannel(t,r).catch(()=>{})},Bd=new WeakMap,qd=new WeakMap,Wd=new WeakMap,jd=new WeakMap,M6=function(e,t){var o;if(s(this,It)===null||s(this,nt)===null)return;if(u(this,T,rm).call(this,e),s(this,Ge).revealMovedRow){const a=u(this,T,nm).call(this,e);h(this,yi,{channelId:e,pinned:t,focus:((o=a==null?void 0:a.parentElement)==null?void 0:o.contains(document.activeElement))??!1})}const r=s(this,nt).display.pinnedChannelIds,i=t?[...r.filter(a=>a!==e),e]:r.filter(a=>a!==e);s(this,It).setPinnedChannelIds(i).catch(()=>{h(this,yi,null)})},nm=function(e){var t,r;return((r=[...((t=s(this,Er).value)==null?void 0:t.querySelectorAll(ns))??[]].find(i=>i.dataset.channelId===e))==null?void 0:r.querySelector(".channel"))??void 0},rm=function(e){var i,o,a;const t=[...((i=s(this,Er).value)==null?void 0:i.querySelectorAll(ns))??[]].find(l=>l.dataset.channelId===e),r=t==null?void 0:t.querySelector(".channel-menu-trigger");r&&((a=(o=s(this,Er).value)==null?void 0:o.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||a.removeAttribute("open"))},O6=function(e,t){if(t.button!==0||s(this,be)!==null||s(this,se)!==null||s(this,nt)===null)return;h(this,Ft,!1);const i=t.currentTarget.closest(".sidebar, .channel-switcher-pop");if(i===null)return;const o=Yl(s(this,nt));!o.pinnedChannelIds.includes(e)&&!o.unpinnedChannelIds.includes(e)||h(this,be,{channelId:e,pointerId:t.pointerId,x:t.clientX,y:t.clientY,source:{channelId:e,...o},captureTarget:i})},Yc=new WeakMap,Jc=new WeakMap,N6=function(e,t){var r;if(t.detail!==0&&s(this,Ft)){h(this,Ft,!1);return}h(this,Ft,!1),s(this,se)===null&&(s(this,Ge).selectChannel?s(this,Ge).selectChannel(e):(r=s(this,It))==null||r.focusChannel(e).catch(()=>{}))},Gd=new WeakMap,Kc=new WeakMap,z6=function(e,t){if(s(this,xt)){h(this,be,null);return}const r=[...e.captureTarget.querySelectorAll(ns)].find(f=>f.dataset.channelId===e.channelId);if(r===void 0){h(this,be,null);return}const i=r.getBoundingClientRect(),o=u(this,T,Z6).call(this,r),a=Rz({wideRow:i,compactPreviewWidth:o,pointer:{x:e.x,y:e.y}}),l=e.captureTarget.querySelector('[data-channel-side="pinned"]'),c=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{h(this,be,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${a.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${a.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${a.correctionX}px`),h(this,Ft,!0);const d={...e,placement:{kind:"invalidated"},currentX:t.clientX,currentY:t.clientY,grip:a,rowWidth:o,rowHeight:i.height,originPinnedContentBottom:(l==null?void 0:l.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(c==null?void 0:c.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};h(this,be,null),h(this,se,d),u(this,T,Wl).call(this,d,t)},Z6=function(e){const t=e.cloneNode(!0);for(const i of[t,...t.querySelectorAll("[id], [trigger]")])i.removeAttribute("id"),i.removeAttribute("trigger");t.classList.add("dragged"),t.style.position="fixed",t.style.left="-10000px",t.style.top="-10000px",t.style.visibility="hidden",t.style.pointerEvents="none",document.body.append(t);const r=t.getBoundingClientRect().width;return t.remove(),r},Wl=function(e,t,r=!0){if(e.completed)return;const i=s(this,nt);if(i===null){e.placement={kind:"invalidated"};return}e.currentX=t.clientX,e.currentY=t.clientY;const o=Yl(i),a=new Map([...e.captureTarget.querySelectorAll(ns)].map(P=>[P.dataset.channelId,P])),l=o.pinnedChannelIds.filter(P=>P!==e.channelId).flatMap(P=>{const J=a.get(P);if(J===void 0)return[];const O=J.getBoundingClientRect();return[{channelId:P,top:O.top,bottom:O.bottom}]}),c=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),d=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),g=f==null?void 0:f.getBoundingClientRect(),y=f==null?void 0:f.dataset.channelSide,v=Number(f==null?void 0:f.dataset.channelIndex),_=e.captureTarget.getBoundingClientRect(),E=yz({source:e.source,current:o,pointer:{x:t.clientX,y:t.clientY},geometry:{sidebar:{left:_.left,right:_.right,top:_.top,bottom:_.bottom},pinnedRows:l,unpinnedGroupTop:(d==null?void 0:d.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:g!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(v)?{side:y,index:v,top:g.top,bottom:g.bottom}:null}}),x=!Iz(e.placement,E),B=x?u(this,T,om).call(this,e):null;e.placement=E,(x||r)&&u(this,T,am).call(this,e,B,!1),u(this,T,im).call(this,e)},im=function(e){const t=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=t?u(this,T,sm).call(this,t,e.currentY):0,i=t?Math.max(0,t.scrollHeight-t.clientHeight):0,o=r<0?((t==null?void 0:t.scrollTop)??0)<=Ky:((t==null?void 0:t.scrollTop)??0)>=i-Ky;if(s(this,xt)||e.completed||r===0||i===0||o||typeof requestAnimationFrame!="function"){u(this,T,jl).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(a=>{u(this,T,H6).call(this,e,a)}))},H6=function(e,t){if(e.edgeScrollFrame=0,s(this,xt)||s(this,se)!==e||e.completed){e.edgeScrollTimestamp=null;return}const r=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");if(r===null){e.edgeScrollTimestamp=null;return}const i=u(this,T,sm).call(this,r,e.currentY),o=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=t,i!==0&&o!==null){const a=Math.max(0,t-o)/1e3,l=Math.max(0,r.scrollHeight-r.clientHeight),c=r.scrollTop,d=i*a+e.edgeScrollRemainder,f=Math.max(0,Math.min(l,c+d));r.scrollTop=f;const g=r.scrollTop-c;if(e.edgeScrollRemainder=f===0||f===l?0:d-g,g!==0){r.toggleAttribute("continues-start",r.scrollTop>0),u(this,T,U6).call(this,e);return}}u(this,T,im).call(this,e)},U6=function(e){u(this,T,Wl).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},jl=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},sm=function(e,t){const r=e.getBoundingClientRect();return t>=r.top&&t<r.top+Qt?-$d*(r.top+Qt-t)/Qt:t>r.bottom-Qt&&t<=r.bottom?$d*(t-(r.bottom-Qt))/Qt:0},om=function(e){var i;for(const o of e.displacementAnimations)o.cancel();e.displacementAnimations.clear();const t=new Map;for(const o of e.captureTarget.querySelectorAll(ns)){const a=o.dataset.channelId;if(a===void 0)continue;const l=o.getBoundingClientRect();t.set(a,{left:l.left,top:l.top})}const r=new Map;for(const o of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=o.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=o.getBoundingClientRect(),c=o.cloneNode(!0);for(const d of[c,...c.querySelectorAll("[id], [trigger]")])d.removeAttribute("id"),d.removeAttribute("trigger");(i=c.querySelector(".channel-row.dragged"))==null||i.remove(),c.classList.add("channel-group-withdrawal"),c.setAttribute("aria-hidden","true"),c.removeAttribute("drag-collapsed"),r.set(a,{left:l.left,top:l.top,width:l.width,height:o.hasAttribute("drag-collapsed")?0:l.height,withdrawal:c})}return{rows:t,groups:r}},am=function(e,t,r){const i=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),o=(i==null?void 0:i.scrollTop)??0;s(this,pt).call(this),queueMicrotask(()=>{const a=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");a!==null&&(a.scrollTop=o),t!==null&&u(this,T,V6).call(this,e,t,r)})},V6=function(e,t,r){if(!(s(this,xt)||typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of e.captureTarget.querySelectorAll(ns)){const o=i.dataset.channelId;if(o===void 0||!r&&o===e.channelId)continue;const a=t.rows.get(o);if(a===void 0)continue;const l=i.getBoundingClientRect(),c=a.left-l.left,d=a.top-l.top;Math.hypot(c,d)<=Rl||u(this,T,qh).call(this,e,i.animate({translate:[`${c}px ${d}px`,"0px 0px"]},{duration:Go,easing:gh}))}for(const i of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=i.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const a=t.groups.get(o),l=i.getBoundingClientRect(),c=i.hasAttribute("drag-collapsed")?0:l.height;if(a!==void 0){if(a.height<=Rl&&c>Rl)u(this,T,qh).call(this,e,i.animate([{opacity:0,translate:`0px -${c}px`},{opacity:1,translate:"0px 0px"}],{duration:Go,easing:gh}));else if(a.height>Rl&&c<=Rl&&a.withdrawal.childElementCount>0){const d=a.withdrawal;d.style.left=`${a.left}px`,d.style.top=`${a.top}px`,d.style.width=`${a.width}px`,d.style.height=`${a.height}px`,e.captureTarget.append(d);const f=d.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${a.height}px`}],{duration:Go,easing:gh});u(this,T,qh).call(this,e,f),f.finished.finally(()=>d.remove()).catch(()=>{})}}}}},qh=function(e,t){e.displacementAnimations.add(t),t.finished.finally(()=>{e.displacementAnimations.delete(t)}).catch(()=>{})},Xc=new WeakMap,Qc=new WeakMap,eu=new WeakMap,tu=new WeakMap,F6=function(e){const t=Yl(e);s(this,se)!==null&&!s(this,se).completed&&!Qy(s(this,se).source,t)&&u(this,T,jh).call(this),s(this,be)!==null&&!Qy(s(this,be).source,t)&&h(this,be,null)},lm=function(e){const t=s(this,se);if(e===null||t===null||!t.completed||!t.operationResolved||t.restorationQueued)return;if(t.operationRejected){u(this,T,Wh).call(this,t);return}const r=t.operation;r!==null&&Rd(Yl(e).pinnedChannelIds,r)&&u(this,T,Wh).call(this,t)},Wh=function(e){s(this,se)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{s(this,se)===e&&u(this,T,Gl).call(this,e,!1)}))},jh=function(){h(this,be,null);const e=s(this,se);e!==null&&u(this,T,Gl).call(this,e,!0)},Gl=function(e,t){if(s(this,se)!==e)return;u(this,T,jl).call(this,e);const r=u(this,T,om).call(this,e);h(this,se,null),u(this,T,um).call(this,e),t&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),u(this,T,am).call(this,e,r,!0)},cm=function(){h(this,be,null);const e=s(this,se);if(h(this,se,null),e!==null){u(this,T,jl).call(this,e);for(const t of e.displacementAnimations)t.cancel();e.displacementAnimations.clear(),u(this,T,um).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},um=function(e){e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")};function Rz(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=ew(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-$z));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:ew(n.pointer.y-n.wideRow.top,0,t)}}function Xy(n,e=Yl(n)){var l,c;const t=new Map(n.channels.map(d=>[d.id,d])),r=e.pinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),i=e.unpinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),o=n.display.focusedChannelId,a=o!==null&&t.has(o)?o:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(d=>({channel:d,pinned:!0,selected:d.id===a})),unpinned:i.map(d=>({channel:d,pinned:!1,selected:d.id===a}))}}function Yl(n){const e=new Set(n.channels.map(({id:o})=>o)),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return{pinnedChannelIds:t,unpinnedChannelIds:i}}function Qy(n,e){return Rd(n.pinnedChannelIds,e.pinnedChannelIds)&&Rd(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Rd(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function Iz(n,e){var t,r,i,o;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)===((o=e.placeholder)==null?void 0:o.index)&&n.operation===null==(e.operation===null)&&(n.operation===null||e.operation===null||Rd(n.operation,e.operation))}function ew(n,e,t){return Math.max(e,Math.min(t,n))}var dn,Yd;class xz extends Nt{constructor(){super(...arguments);p(this,dn,new E6(()=>this.render()));p(this,Yd,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,dn).connect()}template(t,r,i,o,a,l=!1){return s(this,dn).update(t,r,{management:!0,motionSuppressed:l}),M`
196
196
  <nav class="sidebar" ?dragging=${s(this,dn).dragging}>
197
197
  <header
198
198
  class="sidebar-titlebar"
@@ -237,7 +237,7 @@ Television updates its desktop app automatically. Version {version} has download
237
237
  </div>
238
238
  </nav>
239
239
  ${s(this,dn).overlayTemplate()}
240
- `}disconnected(){s(this,dn).disconnect()}}dn=new WeakMap,Yd=new WeakMap;const S9=zt(b9),_9=1280,A9=800,rw=.4,iw=.4,B6=280,sw=180,E9=14,k9=45,C9=16,ow=64,T9=90,$9=1,R9=24,I9=230,x9=230;function P9(n,e){const{expandedSidebarWidth:t,expandedToggleLeft:r,collapsedToggleLeft:i,toggleWidth:o,toggleSwitcherGap:a,collapsedLeadReservation:l,hasSwitcher:c}=e,d=t*(1-n),f=t-r,g=Math.max(d-f,i),y=i+f,v=Math.max(0,Math.min(o,d-g)),_=dm((d-y)/(t-y)),E=o+a,x=i+E,B=c?dm((x-d)/E):0;let P=n*l;if(l>t){const J=1-x/t,O=Math.min(1,n/J);P=n*t+O*(l-t)}return{sidebarBoundary:d,toggleLeft:g,toggleWipe:v,titlebarOpacity:_,switcherOpacity:B,leadReservation:P}}function D9(n,e,t,r){const i=r*Math.abs(e-n);if(i===0)return e;const a=1-(1-dm(t/i))**2;return n+(e-n)*a}function dm(n){return Math.max(0,Math.min(1,n))}var kr,wi,Cr,Aa,Ea,Ms,jr,Gh,pm;class L9{constructor(e){p(this,jr);p(this,kr,null);p(this,wi,0);p(this,Cr);p(this,Aa);p(this,Ea);p(this,Ms,1);h(this,Cr,e),h(this,Aa,e),h(this,Ea,e)}get boundary(){return u(this,jr,Gh).call(this),s(this,Cr)}move(e){const t=this.boundary;if(u(this,jr,pm).call(this),h(this,Aa,t),h(this,Ea,e.target),h(this,Ms,e.width),e.onFrame(t),matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(e.target-t)<Number.EPSILON){h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}const r=Math.abs(e.target-t)/e.width,i=e.root.animate([{},{}],{duration:sw*r,easing:"linear"});i.id="sidebar-collapse-boundary",h(this,kr,i);const o=()=>{if(s(this,kr)===i){if(u(this,jr,Gh).call(this),e.onFrame(s(this,Cr)),i.playState==="finished"){h(this,kr,null),h(this,wi,0),h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}h(this,wi,requestAnimationFrame(o))}};h(this,wi,requestAnimationFrame(o))}cancel(){u(this,jr,Gh).call(this),u(this,jr,pm).call(this)}}kr=new WeakMap,wi=new WeakMap,Cr=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,Ms=new WeakMap,jr=new WeakSet,Gh=function(){const e=s(this,kr);if(e===null)return;const t=D9(1-s(this,Aa)/s(this,Ms),1-s(this,Ea)/s(this,Ms),Number(e.currentTime??0),sw);h(this,Cr,s(this,Ms)*(1-t))},pm=function(){var e;cancelAnimationFrame(s(this,wi)),h(this,wi,0),(e=s(this,kr))==null||e.cancel(),h(this,kr,null)};const q6="television-active-theme",Fg="tv-theme";let si=null,Wr=null,Zi=null,Fi=null,ei=null,aw=0,Id=0;function M9(n){const e=document.createElement("link"),t=new URL("/theme/theme.css",n);t.searchParams.set(Fg,Hg()),e.rel="stylesheet",e.href=t.toString(),e.dataset.televisionStyle=q6;const r=()=>{si===e&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),si==null||si.remove(),document.head.append(e),si=e,e}function O9(){si&&(si.remove(),si=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function lw(n){const e=document.createElement("script"),t=new URL("/theme/main.js",n);return t.searchParams.set(Fg,Hg()),e.src=t.toString(),e.dataset.televisionScript=q6,Wr==null||Wr.remove(),document.head.append(e),Wr=e,e}function N9(){Wr==null||Wr.remove(),Wr=null}function z9(){return Wr}async function U9(n,e,t){const r=W6();if(e===null)return;let i;try{i=await t()}catch{return}if(r!==Id)return;const o=i.themes.find(f=>f.id===e);if(o===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=o.enableIframeBackgroundJS===!0?cw(n,"background"):null,d=o.enableIframeOverlayJS===!0?cw(n,"overlay"):null;r===Id&&(c!==null&&(a.before(c),Zi=c),d!==null&&(l.after(d),Fi=d))}function Z9(){W6()}function W6(){return Id+=1,Zi==null||Zi.remove(),Fi==null||Fi.remove(),Zi=null,Fi=null,Id}function cw(n,e){const t=e==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);t.searchParams.set(Fg,Hg());const r=document.createElement("iframe");return r.id=e==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=H9(t.toString(),F9()),r}function F9(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function H9(n,e){return`<!doctype html>
240
+ `}disconnected(){s(this,dn).disconnect()}}dn=new WeakMap,Yd=new WeakMap;const Pz=zt(xz),Lz=1280,Dz=800,tw=.4,nw=.4,B6=280,rw=180,Mz=14,Oz=45,Nz=16,iw=64,zz=90,Zz=1,Hz=24,Uz=230,Vz=230;function Fz(n,e){const{expandedSidebarWidth:t,expandedToggleLeft:r,collapsedToggleLeft:i,toggleWidth:o,toggleSwitcherGap:a,collapsedLeadReservation:l,hasSwitcher:c}=e,d=t*(1-n),f=t-r,g=Math.max(d-f,i),y=i+f,v=Math.max(0,Math.min(o,d-g)),_=hm((d-y)/(t-y)),E=o+a,x=i+E,B=c?hm((x-d)/E):0;let P=n*l;if(l>t){const J=1-x/t,O=Math.min(1,n/J);P=n*t+O*(l-t)}return{sidebarBoundary:d,toggleLeft:g,toggleWipe:v,titlebarOpacity:_,switcherOpacity:B,leadReservation:P}}function Bz(n,e,t,r){const i=r*Math.abs(e-n);if(i===0)return e;const a=1-(1-hm(t/i))**2;return n+(e-n)*a}function hm(n){return Math.max(0,Math.min(1,n))}var kr,wi,Cr,Aa,Ea,Ms,jr,Gh,dm;class qz{constructor(e){p(this,jr);p(this,kr,null);p(this,wi,0);p(this,Cr);p(this,Aa);p(this,Ea);p(this,Ms,1);h(this,Cr,e),h(this,Aa,e),h(this,Ea,e)}get boundary(){return u(this,jr,Gh).call(this),s(this,Cr)}move(e){const t=this.boundary;if(u(this,jr,dm).call(this),h(this,Aa,t),h(this,Ea,e.target),h(this,Ms,e.width),e.onFrame(t),matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(e.target-t)<Number.EPSILON){h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}const r=Math.abs(e.target-t)/e.width,i=e.root.animate([{},{}],{duration:rw*r,easing:"linear"});i.id="sidebar-collapse-boundary",h(this,kr,i);const o=()=>{if(s(this,kr)===i){if(u(this,jr,Gh).call(this),e.onFrame(s(this,Cr)),i.playState==="finished"){h(this,kr,null),h(this,wi,0),h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}h(this,wi,requestAnimationFrame(o))}};h(this,wi,requestAnimationFrame(o))}cancel(){u(this,jr,Gh).call(this),u(this,jr,dm).call(this)}}kr=new WeakMap,wi=new WeakMap,Cr=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,Ms=new WeakMap,jr=new WeakSet,Gh=function(){const e=s(this,kr);if(e===null)return;const t=Bz(1-s(this,Aa)/s(this,Ms),1-s(this,Ea)/s(this,Ms),Number(e.currentTime??0),rw);h(this,Cr,s(this,Ms)*(1-t))},dm=function(){var e;cancelAnimationFrame(s(this,wi)),h(this,wi,0),(e=s(this,kr))==null||e.cancel(),h(this,kr,null)};const q6="television-active-theme",Hg="tv-theme";let si=null,Wr=null,Hi=null,Ui=null,ei=null,sw=0,Id=0;function Wz(n){const e=document.createElement("link"),t=new URL("/theme/theme.css",n);t.searchParams.set(Hg,Ug()),e.rel="stylesheet",e.href=t.toString(),e.dataset.televisionStyle=q6;const r=()=>{si===e&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),si==null||si.remove(),document.head.append(e),si=e,e}function jz(){si&&(si.remove(),si=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function ow(n){const e=document.createElement("script"),t=new URL("/theme/main.js",n);return t.searchParams.set(Hg,Ug()),e.src=t.toString(),e.dataset.televisionScript=q6,Wr==null||Wr.remove(),document.head.append(e),Wr=e,e}function Gz(){Wr==null||Wr.remove(),Wr=null}function Yz(){return Wr}async function Jz(n,e,t){const r=W6();if(e===null)return;let i;try{i=await t()}catch{return}if(r!==Id)return;const o=i.themes.find(f=>f.id===e);if(o===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=o.enableIframeBackgroundJS===!0?aw(n,"background"):null,d=o.enableIframeOverlayJS===!0?aw(n,"overlay"):null;r===Id&&(c!==null&&(a.before(c),Hi=c),d!==null&&(l.after(d),Ui=d))}function Kz(){W6()}function W6(){return Id+=1,Hi==null||Hi.remove(),Ui==null||Ui.remove(),Hi=null,Ui=null,Id}function aw(n,e){const t=e==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);t.searchParams.set(Hg,Ug());const r=document.createElement("iframe");return r.id=e==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=Qz(t.toString(),Xz()),r}function Xz(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function Qz(n,e){return`<!doctype html>
241
241
  <html data-theme="${e}">
242
242
  <head>
243
243
  <meta charset="utf-8">
@@ -255,7 +255,7 @@ html, body {
255
255
  <body>
256
256
  <script src="${n}"><\/script>
257
257
  </body>
258
- </html>`}function j6(n){var o;let e,t=n.button,r=n.buttons;switch(n.eventType){case"pointermove":e="television-theme-pointer-move",t=-1;break;case"pointerdown":e="television-theme-pointer-down";break;case"pointerup":e="television-theme-pointer-up";break;case"pointercancel":e="television-theme-pointer-cancel",t=-1,r=0;break;case"click":e="television-theme-pointer-click",r=0;break}const i={type:e,clientX:n.clientX,clientY:n.clientY,button:t,buttons:r};for(const a of[Zi,Fi])(a==null?void 0:a.isConnected)===!0&&((o=a.contentWindow)==null||o.postMessage(i,"*"))}function qu(n){n.isTrusted&&j6({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",qu,{capture:!0});document.addEventListener("pointerdown",qu,{capture:!0});document.addEventListener("pointerup",qu,{capture:!0});document.addEventListener("pointercancel",qu,{capture:!0});document.addEventListener("click",qu,{capture:!0});function G6(n){if(n!==Zi&&n!==Fi)return!1;const t=((ei==null?void 0:ei.isConnected)===!0&&ei!==Zi&&ei!==Fi&&ei.closest("#foreground-overlay")===null?ei:null)??document.querySelector("#app");return t==null||t.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const e=n.target;e instanceof HTMLElement&&(G6(e)||e.isConnected&&e.closest("#foreground-overlay")===null&&(ei=e))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>G6(document.activeElement))},{capture:!0});function Hg(){return aw+=1,`${Date.now()}-${aw}`}const V9=404,B9="/views/url-unsupported/";function Yh(n){const e=Ad(n.artifact,{electron:n.electron,browserDemo:n.browserDemo??!1});let t;if(e.renderer==="url-direct")t=e;else 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 uw(n.currentURL)&&!n.electron?t=fr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:B9,contentURL:null}:uw(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:j9(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var We,jt,ka,Os,Ns,pn,zs,Ca,wt,Ta,$a,Fn,bi,Si,Us,K,Jh,Y6,J6,fm,K6,Hn,Kh,Jl,mm,X6,gm,vm,is;class q9 extends Nt{constructor(){super(...arguments);p(this,K);p(this,We,null);p(this,jt,null);p(this,ka,"");p(this,Os,()=>{});p(this,Ns,()=>{});p(this,pn,null);p(this,zs,null);p(this,Ca,null);p(this,wt,null);p(this,Ta,null);p(this,$a,null);p(this,Fn,null);p(this,bi,null);p(this,Si,null);p(this,Us,null);p(this,Hn,()=>{!s(this,jt)||s(this,jt)!==s(this,pn)||s(this,Os).call(this,!0)})}get currentFrame(){return s(this,jt)}connected(){u(this,K,Kh).call(this),u(this,K,mm).call(this)}disconnected(){u(this,K,Jl).call(this),u(this,K,is).call(this)}template(t,r,i=()=>{}){return h(this,Os,r),h(this,Ns,i),t(this),s(this,ka)}assignSource(t){const r=s(this,We),i=r?!G9(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)&&h(this,Us,null),i&&(h(this,Fn,null),s(this,wt)&&(s(this,wt).content=""),h(this,bi,null),h(this,Si,null)),h(this,We,t),u(this,K,Jh).call(this)}handleArtifactContentChanged(t){const r=s(this,We);return t!==(r==null?void 0:r.artifact.id)||!s(this,wt)&&!u(this,K,vm).call(this)?!1:(u(this,K,gm).call(this),!0)}handleThemeChanged(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return(t==null?void 0:t.kind)!=="path"||!k0(t.path)||s(this,wt)===null?!1:(s(this,wt).notifyStylesChanged(),!0)}refreshFrameLoadState(){u(this,K,Kh).call(this)}}We=new WeakMap,jt=new WeakMap,ka=new WeakMap,Os=new WeakMap,Ns=new WeakMap,pn=new WeakMap,zs=new WeakMap,Ca=new WeakMap,wt=new WeakMap,Ta=new WeakMap,$a=new WeakMap,Fn=new WeakMap,bi=new WeakMap,Si=new WeakMap,Us=new WeakMap,K=new WeakSet,Jh=function(){const t=s(this,We);if(!t)return;if(t.artifact.kind==="path"&&u(this,K,vm).call(this)){u(this,K,K6).call(this,t.artifact);return}const r=Yh(t),i=u(this,K,Y6).call(this,r.renderer);u(this,K,J6).call(this,i,r),u(this,K,fm).call(this,i),u(this,K,Kh).call(this),u(this,K,mm).call(this)},Y6=function(t){var o;const r=t==="url-webview"?"webview":"iframe";if(((o=s(this,jt))==null?void 0:o.tagName.toLowerCase())===r)return s(this,jt);u(this,K,Jl).call(this),u(this,K,is).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),h(this,jt,i),i},J6=function(t,r){t.getAttribute("src")!==r.viewURL&&(s(this,Ns).call(this,null),s(this,Ns).call(this,t),t.setAttribute("src",r.viewURL)),r.contentURL===null?delete t.dataset.contentUrl:t.dataset.contentUrl=r.contentURL},fm=function(t){s(this,ka)!==t&&(h(this,ka,t),this.render(t))},K6=function(t){s(this,Ns).call(this,null),u(this,K,Jl).call(this),u(this,K,is).call(this),h(this,jt,null),s(this,Os).call(this,!1),u(this,K,fm).call(this,M`
258
+ </html>`}function j6(n){var o;let e,t=n.button,r=n.buttons;switch(n.eventType){case"pointermove":e="television-theme-pointer-move",t=-1;break;case"pointerdown":e="television-theme-pointer-down";break;case"pointerup":e="television-theme-pointer-up";break;case"pointercancel":e="television-theme-pointer-cancel",t=-1,r=0;break;case"click":e="television-theme-pointer-click",r=0;break}const i={type:e,clientX:n.clientX,clientY:n.clientY,button:t,buttons:r};for(const a of[Hi,Ui])(a==null?void 0:a.isConnected)===!0&&((o=a.contentWindow)==null||o.postMessage(i,"*"))}function qu(n){n.isTrusted&&j6({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",qu,{capture:!0});document.addEventListener("pointerdown",qu,{capture:!0});document.addEventListener("pointerup",qu,{capture:!0});document.addEventListener("pointercancel",qu,{capture:!0});document.addEventListener("click",qu,{capture:!0});function G6(n){if(n!==Hi&&n!==Ui)return!1;const t=((ei==null?void 0:ei.isConnected)===!0&&ei!==Hi&&ei!==Ui&&ei.closest("#foreground-overlay")===null?ei:null)??document.querySelector("#app");return t==null||t.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const e=n.target;e instanceof HTMLElement&&(G6(e)||e.isConnected&&e.closest("#foreground-overlay")===null&&(ei=e))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>G6(document.activeElement))},{capture:!0});function Ug(){return sw+=1,`${Date.now()}-${sw}`}const e7=404,t7="/views/url-unsupported/";function Yh(n){const e=Ad(n.artifact,{electron:n.electron,browserDemo:n.browserDemo??!1});let t;if(e.renderer==="url-direct")t=e;else 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 lw(n.currentURL)&&!n.electron?t=fr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:t7,contentURL:null}:lw(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:i7(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var We,jt,ka,Os,Ns,pn,zs,Ca,wt,Ta,$a,Un,bi,Si,Zs,K,Jh,Y6,J6,pm,K6,Vn,Kh,Jl,fm,X6,mm,gm,is;class n7 extends Nt{constructor(){super(...arguments);p(this,K);p(this,We,null);p(this,jt,null);p(this,ka,"");p(this,Os,()=>{});p(this,Ns,()=>{});p(this,pn,null);p(this,zs,null);p(this,Ca,null);p(this,wt,null);p(this,Ta,null);p(this,$a,null);p(this,Un,null);p(this,bi,null);p(this,Si,null);p(this,Zs,null);p(this,Vn,()=>{!s(this,jt)||s(this,jt)!==s(this,pn)||s(this,Os).call(this,!0)})}get currentFrame(){return s(this,jt)}connected(){u(this,K,Kh).call(this),u(this,K,fm).call(this)}disconnected(){u(this,K,Jl).call(this),u(this,K,is).call(this)}template(t,r,i=()=>{}){return h(this,Os,r),h(this,Ns,i),t(this),s(this,ka)}assignSource(t){const r=s(this,We),i=r?!s7(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)&&h(this,Zs,null),i&&(h(this,Un,null),s(this,wt)&&(s(this,wt).content=""),h(this,bi,null),h(this,Si,null)),h(this,We,t),u(this,K,Jh).call(this)}handleArtifactContentChanged(t){const r=s(this,We);return t!==(r==null?void 0:r.artifact.id)||!s(this,wt)&&!u(this,K,gm).call(this)?!1:(u(this,K,mm).call(this),!0)}handleThemeChanged(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return(t==null?void 0:t.kind)!=="path"||!E0(t.path)||s(this,wt)===null?!1:(s(this,wt).notifyStylesChanged(),!0)}refreshFrameLoadState(){u(this,K,Kh).call(this)}}We=new WeakMap,jt=new WeakMap,ka=new WeakMap,Os=new WeakMap,Ns=new WeakMap,pn=new WeakMap,zs=new WeakMap,Ca=new WeakMap,wt=new WeakMap,Ta=new WeakMap,$a=new WeakMap,Un=new WeakMap,bi=new WeakMap,Si=new WeakMap,Zs=new WeakMap,K=new WeakSet,Jh=function(){const t=s(this,We);if(!t)return;if(t.artifact.kind==="path"&&u(this,K,gm).call(this)){u(this,K,K6).call(this,t.artifact);return}const r=Yh(t),i=u(this,K,Y6).call(this,r.renderer);u(this,K,J6).call(this,i,r),u(this,K,pm).call(this,i),u(this,K,Kh).call(this),u(this,K,fm).call(this)},Y6=function(t){var o;const r=t==="url-webview"?"webview":"iframe";if(((o=s(this,jt))==null?void 0:o.tagName.toLowerCase())===r)return s(this,jt);u(this,K,Jl).call(this),u(this,K,is).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),h(this,jt,i),i},J6=function(t,r){t.getAttribute("src")!==r.viewURL&&(s(this,Ns).call(this,null),s(this,Ns).call(this,t),t.setAttribute("src",r.viewURL)),r.contentURL===null?delete t.dataset.contentUrl:t.dataset.contentUrl=r.contentURL},pm=function(t){s(this,ka)!==t&&(h(this,ka,t),this.render(t))},K6=function(t){s(this,Ns).call(this,null),u(this,K,Jl).call(this),u(this,K,is).call(this),h(this,jt,null),s(this,Os).call(this,!1),u(this,K,pm).call(this,M`
259
259
  <section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
260
260
  <div class="artifact-missing-wrapper">
261
261
  <h1>${M_()}</h1>
@@ -267,7 +267,7 @@ html, body {
267
267
  <p>${N_()}</p>
268
268
  </div>
269
269
  </section>
270
- `)},Hn=new WeakMap,Kh=function(){var o;const t=s(this,jt),r=t?`${t.tagName.toLowerCase()}:${t.getAttribute("src")??""}:${t.dataset.contentUrl??""}`:null;if(t&&t===s(this,pn)&&r===s(this,zs)||(u(this,K,Jl).call(this),s(this,Os).call(this,!1),!t||!r||!this.isConnected))return;if(h(this,pn,t),h(this,zs,r),t.tagName.toLowerCase()==="webview"){t.addEventListener("did-finish-load",s(this,Hn)),t.addEventListener("did-fail-load",s(this,Hn));return}t.addEventListener("load",s(this,Hn));const i=t;try{i.isConnected&&((o=i.contentDocument)==null?void 0:o.readyState)==="complete"&&s(this,Hn).call(this)}catch{}},Jl=function(){if(!s(this,pn)){h(this,zs,null);return}s(this,pn).removeEventListener("load",s(this,Hn)),s(this,pn).removeEventListener("did-finish-load",s(this,Hn)),s(this,pn).removeEventListener("did-fail-load",s(this,Hn)),h(this,pn,null),h(this,zs,null)},mm=function(){const t=s(this,We),r=s(this,jt),i=(r==null?void 0:r.dataset.contentUrl)??null,o=(t==null?void 0:t.artifact.id)??null;if(!t||!r||!i||!o){u(this,K,is).call(this,{clearContent:!0});return}if(r!==s(this,Ca)||o!==s(this,$a)){u(this,K,is).call(this),h(this,Ca,r),h(this,Ta,i),h(this,$a,o);const a=r.tagName.toLowerCase()==="webview"?new KO(r):new JO(r);h(this,wt,a),a.handleUpdateContent(async l=>{const c=s(this,We),d=c==null?void 0:c.application;if(!c||!d)throw new Error("No markdown artifact selected");await d.writeMarkdown(c.artifact.id,l),h(this,Fn,l),s(this,wt)===a&&(a.content=l)}),s(this,Fn)!==null&&(a.content=s(this,Fn))}else h(this,Ta,i);u(this,K,X6).call(this)},X6=function(){const t=s(this,We),r=t==null?void 0:t.application;!t||!r||!s(this,wt)||s(this,bi)===t.artifact.id&&s(this,Si)===r||(h(this,bi,t.artifact.id),h(this,Si,r),u(this,K,gm).call(this))},gm=async function(){var o,a;const t=s(this,We),r=t==null?void 0:t.application;if(!t||!r)return;const i=t.artifact.id;try{const l=await r.readMarkdown(i);if(((o=s(this,We))==null?void 0:o.artifact.id)!==i||s(this,We).application!==r)return;h(this,Us,null),h(this,Fn,l);const c=s(this,wt);if(!c){u(this,K,Jh).call(this);return}c.content=l}catch(l){if(((a=s(this,We))==null?void 0:a.artifact.id)!==i||s(this,We).application!==r)return;if(l instanceof pl&&l.status===V9){h(this,Us,i),h(this,Fn,null),u(this,K,is).call(this),u(this,K,Jh).call(this);return}h(this,bi,null),h(this,Si,null)}},vm=function(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return s(this,Us)===(t==null?void 0:t.id)&&t.kind==="path"&&k0(t.path)},is=function(t={}){var r;(r=s(this,wt))==null||r.dispose(),h(this,wt,null),h(this,Ca,null),h(this,Ta,null),h(this,$a,null),h(this,bi,null),h(this,Si,null),t.clearContent&&h(this,Fn,null)};const W9=zt(q9);function uw(n){return n.startsWith("http://")||n.startsWith("https://")}function j9(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function G9(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 nu,Ra,Vn,Tr,_i,Ai,Ei,ru,iu,su,ou,Ot,ym,Xh,Qh;class Y9{constructor(e,t=()=>{}){p(this,Ot);p(this,nu);p(this,Ra);p(this,Vn,null);p(this,Tr,null);p(this,_i,null);p(this,Ai,null);p(this,Ei,!1);p(this,ru,e=>{const t=dw(e.data);if(!t)return;const r=s(this,_i);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,o=i.contentWindow;if(o===null)return;const a=t.type==="leaving",l=t.type==="navigation-request"&&t.native===!0&&t.sameDocument!==!0,c=o===e.source,d=(a||l)&&s(this,Tr)!==null&&s(this,Tr)===e.source,f=a&&K9(i)===e.origin;!c&&!d&&!f||u(this,Ot,ym).call(this,t,i,{send:g=>{var y;return(y=i.contentWindow)==null?void 0:y.postMessage(g,"*")}})});p(this,iu,e=>{var o;const t=e.detail??e;if(!t||t.channel!==hw)return;const r=dw((o=t.args)==null?void 0:o[0]),i=s(this,Ai);!r||!i||u(this,Ot,ym).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,hw,a)}})});p(this,su,e=>{const t=pw(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});p(this,ou,e=>{pw(e).isMainFrame!==!1&&this.reset()});h(this,nu,e),h(this,Ra,t)}get currentGuid(){return s(this,Vn)}get lifecycleWindow(){return s(this,Tr)}get trustState(){return{currentGuid:s(this,Vn),lifecycleWindow:s(this,Tr)}}connect(){s(this,Ei)||(h(this,Ei,!0),window.addEventListener("message",s(this,ru)),u(this,Ot,Xh).call(this))}disconnect(){s(this,Ei)&&(window.removeEventListener("message",s(this,ru)),h(this,Ei,!1),u(this,Ot,Qh).call(this))}reset(){h(this,Vn,null),h(this,Tr,null),s(this,Ra).call(this)}setCurrentFrame(e){if(e===s(this,_i)){u(this,Ot,Xh).call(this);return}u(this,Ot,Qh).call(this),s(this,_i)!==null&&this.reset(),h(this,_i,J9(e)?e:null),u(this,Ot,Xh).call(this)}}nu=new WeakMap,Ra=new WeakMap,Vn=new WeakMap,Tr=new WeakMap,_i=new WeakMap,Ai=new WeakMap,Ei=new WeakMap,ru=new WeakMap,iu=new WeakMap,su=new WeakMap,ou=new WeakMap,Ot=new WeakSet,ym=function(e,t,r){e.type==="bridge-ready"&&e.guid!==s(this,Vn)?(s(this,Vn)!==null&&s(this,Ra).call(this),h(this,Vn,e.guid),h(this,Tr,t.tagName.toLowerCase()==="iframe"?t.contentWindow:null)):e.type==="leaving"&&e.guid===s(this,Vn)&&this.reset(),s(this,nu).call(this,e,r)},Xh=function(){if(!s(this,Ei))return;const e=s(this,_i),t=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;t!==s(this,Ai)&&(u(this,Ot,Qh).call(this),t&&(t.addEventListener("ipc-message",s(this,iu)),t.addEventListener("did-start-navigation",s(this,su)),t.addEventListener("did-fail-load",s(this,ou)),h(this,Ai,t)))},Qh=function(){const e=s(this,Ai);e&&(e.removeEventListener("ipc-message",s(this,iu)),e.removeEventListener("did-start-navigation",s(this,su)),e.removeEventListener("did-fail-load",s(this,ou)),h(this,Ai,null))};const hw="television-artifact-bridge";function dw(n){return E_(n)||k_(n)||C_(n)||T_(n)||$_(n)||R_(n)||I_(n)||x_(n)?n:null}function J9(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function K9(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function pw(n){return n.detail??n}const X9="/views/url-unsupported/";class Q9 extends Nt{constructor(){super(...arguments);C(this,"_artifact",null);C(this,"_viewURL",null);C(this,"_contentURL",null);C(this,"_application",null);C(this,"_fullScreen",!1);C(this,"_inert",!1);C(this,"_onFullScreenChange",()=>{});C(this,"_connected",!1);C(this,"_deleteConfirmationOpen",!1);C(this,"_dialogPresentation",null);C(this,"_subscribedWebview",null);C(this,"_documentHost",null);C(this,"_pendingDocumentSource",null);C(this,"_rootRef",wn());C(this,"_trustedChannel",new Y9((t,r)=>{this.handleTrustedFrameMessage(t,r)},()=>{this._missingArtifactReplyTransport=null}));C(this,"_activeReloadFrameSrc",null);C(this,"_applicationSubscriptionsAttached",!1);C(this,"_proxyReloadVersion",0);C(this,"_navigationState",null);C(this,"_navigationArtifactId",null);C(this,"_navigationCanonicalURL",null);C(this,"_preserveFrameSrcOnNavigationRender",!1);C(this,"_missingArtifactReplyTransport",null);C(this,"handleNavigationChange",()=>{const t=this._preserveFrameSrcOnNavigationRender,r=!t;r&&!Br()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:t,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});C(this,"handleArtifactContentChanged",t=>{var o;const r=t.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((o=this._documentHost)!=null&&o.handleArtifactContentChanged(r))||this.reloadProxyFrame()});C(this,"handleThemeChanged",()=>{var t,r;((t=this._artifact)==null?void 0:t.kind)==="url"&&fr(this._artifact.url)||this.isDemoPage()||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});C(this,"handleWebviewDidNavigate",t=>{this.handleWebviewNavigationEvent(t)});C(this,"handleWebviewDidNavigateInPage",t=>{if(t.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(t)||(this._preserveFrameSrcOnNavigationRender=!1)});C(this,"captureDocumentHost",t=>{this._documentHost=t,this._pendingDocumentSource&&(t.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});C(this,"handleEmbedLoadChange",t=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",t)});C(this,"handleDocumentFrameChange",t=>{t===null&&this.resetTrustedFrame(),this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(this.bridgeFrame(t)),this.syncWebviewSubscription(t)});C(this,"handleTitleBarDoubleClick",t=>{const r=t.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(t,r){var d;const[i,o,a]=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!==o){const f=c?!n7(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&r7(c,o)){const g=this.currentMissingArtifactMessage();g&&((d=this._missingArtifactReplyTransport)==null||d.send(g))}}else f&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.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:P_,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const o=this.currentMissingArtifactMessage();o&&(this._missingArtifactReplyTransport=r,r.send(o));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"artifact-pointer":this.handleArtifactPointer(t);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(t){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();j6({eventType:t.eventType,clientX:i.left+t.clientX*i.width/r.clientWidth,clientY:i.top+t.clientY*i.height/r.clientHeight,button:t.button,buttons:t.buttons})}currentExternalTargetURL(){var r,i;const t=((r=this._navigationState)==null?void 0:r.currentURL)??null;return t&&t7(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:D_,title:t.title,path:t.path}}handleProxyContentChanged(){var t;((t=this._artifact)==null?void 0:t.kind)!=="url"||!fr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(t){if(!Ry(t.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===X9||i===r.currentURL)return;const o=t.native===!0;(t.sameDocument||o)&&(this._preserveFrameSrcOnNavigationRender=!0),t.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact||this.isDemoPage()){this.disposeNavigationState();return}const t=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===t||(this.disposeNavigationState(),this._navigationState=new TO(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=Yh({artifact:t,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return t.kind==="url"&&fr(t.url)||r.renderer==="url-webview"?qr(i):fw(i,i)}convertIframeNavigationURL(t){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&fr(this._artifact.url)&&fr(t)?qr(t):fw(t,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string"||!Ry(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const o=qr(r);return o===i.currentURL?!1:(i.navigate(o),!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(this.bridgeFrame(t)),this.syncWebviewSubscription(t)}bridgeFrame(t){return this.isDemoPage()?null:t}get browserDemo(){var t;return((t=this._application)==null?void 0:t.browserDemoMode)===!0}isDemoPage(){const t=this._artifact;return t?Ad(t,{electron:Br(),browserDemo:this.browserDemo}).renderer==="url-direct":!1}returnToOriginalPage(){var i,o;const t=this._artifact,r=this.currentFrame;(t==null?void 0:t.kind)!=="url"||(r==null?void 0:r.tagName.toLowerCase())!=="iframe"||((i=this._rootRef.value)==null||i.removeAttribute("data-embed-loaded"),r.setAttribute("src",t.url),(o=this._documentHost)==null||o.refreshFrameLoadState())}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,g,y;const r=this._artifact;if(!r)return;t.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},o=Yh(i),a=(g=this.currentFrame)==null?void 0:g.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(Q6(this._activeReloadFrameSrc,o.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=t.frameSrcOverride??l??(t.preserveFrameSrc&&a?a:o.viewURL),d={...i,frameSrcOverride:c};this._pendingDocumentSource=d,(y=this._documentHost)==null||y.assignSource(d),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,d,f;const t=this.currentFrame;if(!t||t.hasAttribute("data-content-url")||t.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&fr(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&fr(this._artifact.url)?((d=this._navigationState)==null?void 0:d.currentURL)??t.getAttribute("src"):t.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(nl,String(++this._proxyReloadVersion));const o=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=o,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:o,resetTrust:!0})}forceCurrentFrameSrc(){var o,a,l;if(!this._artifact)return;const t=Yh({artifact:this._artifact,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((o=this._navigationState)==null?void 0:o.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,(a=this._rootRef.value)==null||a.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 i;const t=this._rootRef.value,r=t==null?void 0:t.querySelector(".artifact-menu-trigger");r&&((i=t==null?void 0:t.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(t){this.closeMenu(),this._onFullScreenChange(t)}showDeleteConfirmation(){var r,i,o;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=Yp(t,()=>this.dismissDeleteConfirmation()),(o=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||o.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(()=>{})}artifactIconTemplate(){return this.isDemoPage()?M`
270
+ `)},Vn=new WeakMap,Kh=function(){var o;const t=s(this,jt),r=t?`${t.tagName.toLowerCase()}:${t.getAttribute("src")??""}:${t.dataset.contentUrl??""}`:null;if(t&&t===s(this,pn)&&r===s(this,zs)||(u(this,K,Jl).call(this),s(this,Os).call(this,!1),!t||!r||!this.isConnected))return;if(h(this,pn,t),h(this,zs,r),t.tagName.toLowerCase()==="webview"){t.addEventListener("did-finish-load",s(this,Vn)),t.addEventListener("did-fail-load",s(this,Vn));return}t.addEventListener("load",s(this,Vn));const i=t;try{i.isConnected&&((o=i.contentDocument)==null?void 0:o.readyState)==="complete"&&s(this,Vn).call(this)}catch{}},Jl=function(){if(!s(this,pn)){h(this,zs,null);return}s(this,pn).removeEventListener("load",s(this,Vn)),s(this,pn).removeEventListener("did-finish-load",s(this,Vn)),s(this,pn).removeEventListener("did-fail-load",s(this,Vn)),h(this,pn,null),h(this,zs,null)},fm=function(){const t=s(this,We),r=s(this,jt),i=(r==null?void 0:r.dataset.contentUrl)??null,o=(t==null?void 0:t.artifact.id)??null;if(!t||!r||!i||!o){u(this,K,is).call(this,{clearContent:!0});return}if(r!==s(this,Ca)||o!==s(this,$a)){u(this,K,is).call(this),h(this,Ca,r),h(this,Ta,i),h(this,$a,o);const a=r.tagName.toLowerCase()==="webview"?new XO(r):new KO(r);h(this,wt,a),a.handleUpdateContent(async l=>{const c=s(this,We),d=c==null?void 0:c.application;if(!c||!d)throw new Error("No markdown artifact selected");await d.writeMarkdown(c.artifact.id,l),h(this,Un,l),s(this,wt)===a&&(a.content=l)}),s(this,Un)!==null&&(a.content=s(this,Un))}else h(this,Ta,i);u(this,K,X6).call(this)},X6=function(){const t=s(this,We),r=t==null?void 0:t.application;!t||!r||!s(this,wt)||s(this,bi)===t.artifact.id&&s(this,Si)===r||(h(this,bi,t.artifact.id),h(this,Si,r),u(this,K,mm).call(this))},mm=async function(){var o,a;const t=s(this,We),r=t==null?void 0:t.application;if(!t||!r)return;const i=t.artifact.id;try{const l=await r.readMarkdown(i);if(((o=s(this,We))==null?void 0:o.artifact.id)!==i||s(this,We).application!==r)return;h(this,Zs,null),h(this,Un,l);const c=s(this,wt);if(!c){u(this,K,Jh).call(this);return}c.content=l}catch(l){if(((a=s(this,We))==null?void 0:a.artifact.id)!==i||s(this,We).application!==r)return;if(l instanceof pl&&l.status===e7){h(this,Zs,i),h(this,Un,null),u(this,K,is).call(this),u(this,K,Jh).call(this);return}h(this,bi,null),h(this,Si,null)}},gm=function(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return s(this,Zs)===(t==null?void 0:t.id)&&t.kind==="path"&&E0(t.path)},is=function(t={}){var r;(r=s(this,wt))==null||r.dispose(),h(this,wt,null),h(this,Ca,null),h(this,Ta,null),h(this,$a,null),h(this,bi,null),h(this,Si,null),t.clearContent&&h(this,Un,null)};const r7=zt(n7);function lw(n){return n.startsWith("http://")||n.startsWith("https://")}function i7(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function s7(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 nu,Ra,Fn,Tr,_i,Ai,Ei,ru,iu,su,ou,Ot,vm,Xh,Qh;class o7{constructor(e,t=()=>{}){p(this,Ot);p(this,nu);p(this,Ra);p(this,Fn,null);p(this,Tr,null);p(this,_i,null);p(this,Ai,null);p(this,Ei,!1);p(this,ru,e=>{const t=uw(e.data);if(!t)return;const r=s(this,_i);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,o=i.contentWindow;if(o===null)return;const a=t.type==="leaving",l=t.type==="navigation-request"&&t.native===!0&&t.sameDocument!==!0,c=o===e.source,d=(a||l)&&s(this,Tr)!==null&&s(this,Tr)===e.source,f=a&&l7(i)===e.origin;!c&&!d&&!f||u(this,Ot,vm).call(this,t,i,{send:g=>{var y;return(y=i.contentWindow)==null?void 0:y.postMessage(g,"*")}})});p(this,iu,e=>{var o;const t=e.detail??e;if(!t||t.channel!==cw)return;const r=uw((o=t.args)==null?void 0:o[0]),i=s(this,Ai);!r||!i||u(this,Ot,vm).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,cw,a)}})});p(this,su,e=>{const t=hw(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});p(this,ou,e=>{hw(e).isMainFrame!==!1&&this.reset()});h(this,nu,e),h(this,Ra,t)}get currentGuid(){return s(this,Fn)}get lifecycleWindow(){return s(this,Tr)}get trustState(){return{currentGuid:s(this,Fn),lifecycleWindow:s(this,Tr)}}connect(){s(this,Ei)||(h(this,Ei,!0),window.addEventListener("message",s(this,ru)),u(this,Ot,Xh).call(this))}disconnect(){s(this,Ei)&&(window.removeEventListener("message",s(this,ru)),h(this,Ei,!1),u(this,Ot,Qh).call(this))}reset(){h(this,Fn,null),h(this,Tr,null),s(this,Ra).call(this)}setCurrentFrame(e){if(e===s(this,_i)){u(this,Ot,Xh).call(this);return}u(this,Ot,Qh).call(this),s(this,_i)!==null&&this.reset(),h(this,_i,a7(e)?e:null),u(this,Ot,Xh).call(this)}}nu=new WeakMap,Ra=new WeakMap,Fn=new WeakMap,Tr=new WeakMap,_i=new WeakMap,Ai=new WeakMap,Ei=new WeakMap,ru=new WeakMap,iu=new WeakMap,su=new WeakMap,ou=new WeakMap,Ot=new WeakSet,vm=function(e,t,r){e.type==="bridge-ready"&&e.guid!==s(this,Fn)?(s(this,Fn)!==null&&s(this,Ra).call(this),h(this,Fn,e.guid),h(this,Tr,t.tagName.toLowerCase()==="iframe"?t.contentWindow:null)):e.type==="leaving"&&e.guid===s(this,Fn)&&this.reset(),s(this,nu).call(this,e,r)},Xh=function(){if(!s(this,Ei))return;const e=s(this,_i),t=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;t!==s(this,Ai)&&(u(this,Ot,Qh).call(this),t&&(t.addEventListener("ipc-message",s(this,iu)),t.addEventListener("did-start-navigation",s(this,su)),t.addEventListener("did-fail-load",s(this,ou)),h(this,Ai,t)))},Qh=function(){const e=s(this,Ai);e&&(e.removeEventListener("ipc-message",s(this,iu)),e.removeEventListener("did-start-navigation",s(this,su)),e.removeEventListener("did-fail-load",s(this,ou)),h(this,Ai,null))};const cw="television-artifact-bridge";function uw(n){return E_(n)||k_(n)||C_(n)||T_(n)||$_(n)||R_(n)||I_(n)||x_(n)?n:null}function a7(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function l7(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function hw(n){return n.detail??n}const c7="/views/url-unsupported/";class u7 extends Nt{constructor(){super(...arguments);C(this,"_artifact",null);C(this,"_viewURL",null);C(this,"_contentURL",null);C(this,"_application",null);C(this,"_fullScreen",!1);C(this,"_inert",!1);C(this,"_onFullScreenChange",()=>{});C(this,"_connected",!1);C(this,"_deleteConfirmationOpen",!1);C(this,"_dialogPresentation",null);C(this,"_subscribedWebview",null);C(this,"_documentHost",null);C(this,"_pendingDocumentSource",null);C(this,"_rootRef",wn());C(this,"_trustedChannel",new o7((t,r)=>{this.handleTrustedFrameMessage(t,r)},()=>{this._missingArtifactReplyTransport=null}));C(this,"_activeReloadFrameSrc",null);C(this,"_applicationSubscriptionsAttached",!1);C(this,"_proxyReloadVersion",0);C(this,"_navigationState",null);C(this,"_navigationArtifactId",null);C(this,"_navigationCanonicalURL",null);C(this,"_preserveFrameSrcOnNavigationRender",!1);C(this,"_missingArtifactReplyTransport",null);C(this,"handleNavigationChange",()=>{const t=this._preserveFrameSrcOnNavigationRender,r=!t;r&&!Br()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:t,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});C(this,"handleArtifactContentChanged",t=>{var o;const r=t.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((o=this._documentHost)!=null&&o.handleArtifactContentChanged(r))||this.reloadProxyFrame()});C(this,"handleThemeChanged",()=>{var t,r;((t=this._artifact)==null?void 0:t.kind)==="url"&&fr(this._artifact.url)||this.isDemoPage()||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});C(this,"handleWebviewDidNavigate",t=>{this.handleWebviewNavigationEvent(t)});C(this,"handleWebviewDidNavigateInPage",t=>{if(t.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(t)||(this._preserveFrameSrcOnNavigationRender=!1)});C(this,"captureDocumentHost",t=>{this._documentHost=t,this._pendingDocumentSource&&(t.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});C(this,"handleEmbedLoadChange",t=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",t)});C(this,"handleDocumentFrameChange",t=>{t===null&&this.resetTrustedFrame(),this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(this.bridgeFrame(t)),this.syncWebviewSubscription(t)});C(this,"handleTitleBarDoubleClick",t=>{const r=t.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(t,r){var d;const[i,o,a]=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!==o){const f=c?!p7(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&f7(c,o)){const g=this.currentMissingArtifactMessage();g&&((d=this._missingArtifactReplyTransport)==null||d.send(g))}}else f&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.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:P_,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const o=this.currentMissingArtifactMessage();o&&(this._missingArtifactReplyTransport=r,r.send(o));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"artifact-pointer":this.handleArtifactPointer(t);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(t){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();j6({eventType:t.eventType,clientX:i.left+t.clientX*i.width/r.clientWidth,clientY:i.top+t.clientY*i.height/r.clientHeight,button:t.button,buttons:t.buttons})}currentExternalTargetURL(){var r,i;const t=((r=this._navigationState)==null?void 0:r.currentURL)??null;return t&&d7(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:L_,title:t.title,path:t.path}}handleProxyContentChanged(){var t;((t=this._artifact)==null?void 0:t.kind)!=="url"||!fr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(t){if(!Ty(t.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===c7||i===r.currentURL)return;const o=t.native===!0;(t.sameDocument||o)&&(this._preserveFrameSrcOnNavigationRender=!0),t.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact||this.isDemoPage()){this.disposeNavigationState();return}const t=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===t||(this.disposeNavigationState(),this._navigationState=new $O(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=Yh({artifact:t,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return t.kind==="url"&&fr(t.url)||r.renderer==="url-webview"?qr(i):dw(i,i)}convertIframeNavigationURL(t){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&fr(this._artifact.url)&&fr(t)?qr(t):dw(t,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string"||!Ty(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const o=qr(r);return o===i.currentURL?!1:(i.navigate(o),!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(this.bridgeFrame(t)),this.syncWebviewSubscription(t)}bridgeFrame(t){return this.isDemoPage()?null:t}get browserDemo(){var t;return((t=this._application)==null?void 0:t.browserDemoMode)===!0}isDemoPage(){const t=this._artifact;return t?Ad(t,{electron:Br(),browserDemo:this.browserDemo}).renderer==="url-direct":!1}returnToOriginalPage(){var i,o;const t=this._artifact,r=this.currentFrame;(t==null?void 0:t.kind)!=="url"||(r==null?void 0:r.tagName.toLowerCase())!=="iframe"||((i=this._rootRef.value)==null||i.removeAttribute("data-embed-loaded"),r.setAttribute("src",t.url),(o=this._documentHost)==null||o.refreshFrameLoadState())}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,g,y;const r=this._artifact;if(!r)return;t.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},o=Yh(i),a=(g=this.currentFrame)==null?void 0:g.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(Q6(this._activeReloadFrameSrc,o.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=t.frameSrcOverride??l??(t.preserveFrameSrc&&a?a:o.viewURL),d={...i,frameSrcOverride:c};this._pendingDocumentSource=d,(y=this._documentHost)==null||y.assignSource(d),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,d,f;const t=this.currentFrame;if(!t||t.hasAttribute("data-content-url")||t.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&fr(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&fr(this._artifact.url)?((d=this._navigationState)==null?void 0:d.currentURL)??t.getAttribute("src"):t.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(nl,String(++this._proxyReloadVersion));const o=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=o,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:o,resetTrust:!0})}forceCurrentFrameSrc(){var o,a,l;if(!this._artifact)return;const t=Yh({artifact:this._artifact,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((o=this._navigationState)==null?void 0:o.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,(a=this._rootRef.value)==null||a.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 i;const t=this._rootRef.value,r=t==null?void 0:t.querySelector(".artifact-menu-trigger");r&&((i=t==null?void 0:t.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(t){this.closeMenu(),this._onFullScreenChange(t)}showDeleteConfirmation(){var r,i,o;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=Yp(t,()=>this.dismissDeleteConfirmation()),(o=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||o.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(()=>{})}artifactIconTemplate(){return this.isDemoPage()?M`
271
271
  <button
272
272
  icon
273
273
  size="sm"
@@ -321,7 +321,7 @@ html, body {
321
321
  ${Je(this._rootRef)}
322
322
  >
323
323
  <div class="artifact-frame-clip">
324
- ${W9(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
324
+ ${r7(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
325
325
  <footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
326
326
  ${this.artifactIconTemplate()}
327
327
  <span class="artifact-title">${o.title}</span>
@@ -342,11 +342,11 @@ html, body {
342
342
  </div>
343
343
  ${this.deleteConfirmationTemplate()}
344
344
  </div>
345
- `}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 e7=zt(Q9);function t7(n){return n.startsWith("http://")||n.startsWith("https://")}function n7(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"?Q6(n.url,e.url):!0}function r7(n,e){return n.kind==="path"&&e.kind==="path"&&n.id===e.id&&(n.title!==e.title||n.path!==e.path)}function Q6(n,e){try{const t=new URL(n,window.location.href),r=new URL(e,window.location.href);return t.searchParams.delete(nl),r.searchParams.delete(nl),t.origin===r.origin&&t.pathname===r.pathname&&t.search===r.search}catch{return!1}}function fw(n,e){try{const t=new URL(n,window.location.href);if(e){const r=new URL(e,window.location.href);if(t.origin!=="null"&&t.origin===r.origin)return t.searchParams.delete(nl),`${t.pathname}${t.search}${t.hash}`}}catch{return qr(n)}return qr(n)}function eS(n,e,t,r,i){const o=e.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===t?i:a.geometry.full_screen},size:a===t?{...r}:{...a.size}}));n.updateChannelPages(e.id,o).catch(()=>{})}function wm(n,e,t,r){eS(n,e,t,t.size,r)}function Vg(n){return{width:1-rw+rw*n.width/_9,height:1-iw+iw*n.height/A9}}function tS(n){return{width:Math.min(I9,n.width),height:Math.min(x9,n.height)}}function mw(n,e){const t=Vg(e),r=tS(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 i7(n,e){const t=Vg(e);return{width:n.width/t.width,height:n.height/t.height}}const gw=.5,vh=2,s7=120,o7=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Zs,Bn,Ia,$r,xa,Fs,ki,Ci,Ti,Rr,Hs,Vs,qn,Pa,Ir,Wn,rt,xr,jn,U,nS,rS,Kl,iS,Xl,bm,ed,sS,au,lu,cu,uu,Bs,hu,Sm,an,_m,Fo,oS,aS,Ql;class a7 extends Nt{constructor(){super(...arguments);p(this,U);p(this,Zs,wn());p(this,Bn,wn());p(this,Ia);p(this,$r);p(this,xa);p(this,Fs);p(this,ki);p(this,Ci,0);p(this,Ti,0);p(this,Rr,null);p(this,Hs,null);p(this,Vs,null);p(this,qn,null);p(this,Pa,[]);p(this,Ir,null);p(this,Wn,null);p(this,rt,null);p(this,xr,new Set);p(this,jn,!1);p(this,au,t=>{const r=s(this,rt);!r||t.pointerId!==r.pointerId||(r.lastPointer={x:t.clientX,y:t.clientY},r.option=t.altKey,u(this,U,Sm).call(this,r))});p(this,lu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,U,an).call(this,!0)});p(this,cu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,U,an).call(this,!1)});p(this,uu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,U,an).call(this,!1)});p(this,Bs,t=>{const r=s(this,rt);if(r){if(t.type==="keydown"&&t.key==="Escape"){t.preventDefault(),u(this,U,an).call(this,!1);return}r.option!==t.altKey&&(r.option=t.altKey,u(this,U,Sm).call(this,r))}});p(this,hu,()=>{const t=s(this,rt);!t||vw(u(this,U,Kl).call(this,t.filmstrip),t.pageBox)||(u(this,U,bm).call(this),u(this,U,an).call(this,!1))})}connected(){h(this,Ia,void 0),h(this,$r,void 0),h(this,xa,void 0),h(this,Fs,void 0),h(this,ki,void 0)}template(t,r,i,o=!1){var fe;const a=!s(this,jn)&&o;if(h(this,jn,o),a){u(this,U,an).call(this,!1),u(this,U,Ql).call(this);for(const de of s(this,xr))de.cancel();s(this,xr).clear()}const l=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,c=c7(r,(l==null?void 0:l.pages)??(r==null?void 0:r.pages)),d=(r==null?void 0:r.selectedPage)??null,f=(r==null?void 0:r.id)??null,g=(d==null?void 0:d.artifactIds[0])??null,y=(d==null?void 0:d.geometry.full_screen)??null,v=s(this,Fs)!==void 0,_=c.map(({key:de,page:Ve})=>`${de}:${Ve.geometry.full_screen}:${Ve.size.width}:${Ve.size.height}`).sort().join("|"),E=l===null?null:c.map(({key:de})=>de).join("|"),x=f!==s(this,Ia),B=g!==s(this,$r),P=y!==s(this,xa),J=_!==s(this,Fs),O=E!==s(this,ki),F=!s(this,jn)&&l!==null&&s(this,ki)!==void 0&&s(this,ki)!==null&&O?u(this,U,oS).call(this):null,j=!s(this,jn)&&B&&!x&&s(this,$r)!==void 0&&s(this,$r)!==null&&g!==null;return s(this,rt)&&(x||B||P)&&u(this,U,an).call(this,!1),h(this,Ia,f),h(this,$r,g),h(this,xa,y),h(this,Fs,_),h(this,ki,E),h(this,Pa,c),J&&v&&u(this,U,ed).call(this),x&&((fe=s(this,qn))==null||fe.disconnect(),h(this,Hs,null),h(this,Vs,null),h(this,Ir,null)),queueMicrotask(()=>u(this,U,Xl).call(this)),x||B||J||a?queueMicrotask(()=>u(this,U,nS).call(this,g,j)):O&&queueMicrotask(()=>{const de=s(this,Bn).value;de&&(u(this,U,Fo).call(this,de,g,!1),F&&u(this,U,aS).call(this,F))}),M`
345
+ `}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 h7=zt(u7);function d7(n){return n.startsWith("http://")||n.startsWith("https://")}function p7(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"?Q6(n.url,e.url):!0}function f7(n,e){return n.kind==="path"&&e.kind==="path"&&n.id===e.id&&(n.title!==e.title||n.path!==e.path)}function Q6(n,e){try{const t=new URL(n,window.location.href),r=new URL(e,window.location.href);return t.searchParams.delete(nl),r.searchParams.delete(nl),t.origin===r.origin&&t.pathname===r.pathname&&t.search===r.search}catch{return!1}}function dw(n,e){try{const t=new URL(n,window.location.href);if(e){const r=new URL(e,window.location.href);if(t.origin!=="null"&&t.origin===r.origin)return t.searchParams.delete(nl),`${t.pathname}${t.search}${t.hash}`}}catch{return qr(n)}return qr(n)}function eS(n,e,t,r,i){const o=e.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===t?i:a.geometry.full_screen},size:a===t?{...r}:{...a.size}}));n.updateChannelPages(e.id,o).catch(()=>{})}function ym(n,e,t,r){eS(n,e,t,t.size,r)}function Vg(n){return{width:1-tw+tw*n.width/Lz,height:1-nw+nw*n.height/Dz}}function tS(n){return{width:Math.min(Uz,n.width),height:Math.min(Vz,n.height)}}function pw(n,e){const t=Vg(e),r=tS(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 m7(n,e){const t=Vg(e);return{width:n.width/t.width,height:n.height/t.height}}const fw=.5,vh=2,g7=120,v7=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Hs,Bn,Ia,$r,xa,Us,ki,Ci,Ti,Rr,Vs,Fs,qn,Pa,Ir,Wn,rt,xr,jn,Z,nS,rS,Kl,iS,Xl,wm,ed,sS,au,lu,cu,uu,Bs,hu,bm,an,Sm,Uo,oS,aS,Ql;class y7 extends Nt{constructor(){super(...arguments);p(this,Z);p(this,Hs,wn());p(this,Bn,wn());p(this,Ia);p(this,$r);p(this,xa);p(this,Us);p(this,ki);p(this,Ci,0);p(this,Ti,0);p(this,Rr,null);p(this,Vs,null);p(this,Fs,null);p(this,qn,null);p(this,Pa,[]);p(this,Ir,null);p(this,Wn,null);p(this,rt,null);p(this,xr,new Set);p(this,jn,!1);p(this,au,t=>{const r=s(this,rt);!r||t.pointerId!==r.pointerId||(r.lastPointer={x:t.clientX,y:t.clientY},r.option=t.altKey,u(this,Z,bm).call(this,r))});p(this,lu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!0)});p(this,cu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!1)});p(this,uu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!1)});p(this,Bs,t=>{const r=s(this,rt);if(r){if(t.type==="keydown"&&t.key==="Escape"){t.preventDefault(),u(this,Z,an).call(this,!1);return}r.option!==t.altKey&&(r.option=t.altKey,u(this,Z,bm).call(this,r))}});p(this,hu,()=>{const t=s(this,rt);!t||mw(u(this,Z,Kl).call(this,t.filmstrip),t.pageBox)||(u(this,Z,wm).call(this),u(this,Z,an).call(this,!1))})}connected(){h(this,Ia,void 0),h(this,$r,void 0),h(this,xa,void 0),h(this,Us,void 0),h(this,ki,void 0)}template(t,r,i,o=!1){var fe;const a=!s(this,jn)&&o;if(h(this,jn,o),a){u(this,Z,an).call(this,!1),u(this,Z,Ql).call(this);for(const de of s(this,xr))de.cancel();s(this,xr).clear()}const l=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,c=b7(r,(l==null?void 0:l.pages)??(r==null?void 0:r.pages)),d=(r==null?void 0:r.selectedPage)??null,f=(r==null?void 0:r.id)??null,g=(d==null?void 0:d.artifactIds[0])??null,y=(d==null?void 0:d.geometry.full_screen)??null,v=s(this,Us)!==void 0,_=c.map(({key:de,page:Fe})=>`${de}:${Fe.geometry.full_screen}:${Fe.size.width}:${Fe.size.height}`).sort().join("|"),E=l===null?null:c.map(({key:de})=>de).join("|"),x=f!==s(this,Ia),B=g!==s(this,$r),P=y!==s(this,xa),J=_!==s(this,Us),O=E!==s(this,ki),U=!s(this,jn)&&l!==null&&s(this,ki)!==void 0&&s(this,ki)!==null&&O?u(this,Z,oS).call(this):null,j=!s(this,jn)&&B&&!x&&s(this,$r)!==void 0&&s(this,$r)!==null&&g!==null;return s(this,rt)&&(x||B||P)&&u(this,Z,an).call(this,!1),h(this,Ia,f),h(this,$r,g),h(this,xa,y),h(this,Us,_),h(this,ki,E),h(this,Pa,c),J&&v&&u(this,Z,ed).call(this),x&&((fe=s(this,qn))==null||fe.disconnect(),h(this,Vs,null),h(this,Fs,null),h(this,Ir,null)),queueMicrotask(()=>u(this,Z,Xl).call(this)),x||B||J||a?queueMicrotask(()=>u(this,Z,nS).call(this,g,j)):O&&queueMicrotask(()=>{const de=s(this,Bn).value;de&&(u(this,Z,Uo).call(this,de,g,!1),U&&u(this,Z,aS).call(this,U))}),M`
346
346
  <section
347
347
  class="stage"
348
- ${Je(s(this,Zs))}
349
- style=${`--handle-band: ${E9}px; --handle-reach: ${k9}px; --handle-thickness: ${C9}px;`}
348
+ ${Je(s(this,Hs))}
349
+ style=${`--handle-band: ${Mz}px; --handle-reach: ${Oz}px; --handle-thickness: ${Nz}px;`}
350
350
  >
351
351
  ${r!==null&&c.length===0?M`
352
352
  <div class="stage-empty">
@@ -357,22 +357,22 @@ html, body {
357
357
  ${Cd([f],de=>de,()=>M`
358
358
  <div class="filmstrip" ${Je(s(this,Bn))}>
359
359
  <div class="filmstrip-inner">
360
- ${Cd(c,({key:de})=>de,({page:de,artifact:Ve,key:ve})=>{if(r===null)return null;const Xe=ve===g;return M`
360
+ ${Cd(c,({key:de})=>de,({page:de,artifact:Fe,key:ve})=>{if(r===null)return null;const Xe=ve===g;return M`
361
361
  <div
362
362
  class="page"
363
363
  data-page-key=${ve}
364
364
  ?selected=${Xe}
365
365
  ?full-screen=${de.geometry.full_screen}
366
- style=${u(this,U,iS).call(this,de)}
367
- @click=${Xe||Ve===null?null:()=>t.selectPage(r.id,Ve.id)}
366
+ style=${u(this,Z,iS).call(this,de)}
367
+ @click=${Xe||Fe===null?null:()=>t.selectPage(r.id,Fe.id)}
368
368
  >
369
- ${Ve?e7(t,Ve,{viewURL:t.getArtifactViewURL(Ve),contentURL:t.getArtifactContentURL(Ve),fullScreen:de.geometry.full_screen,inert:!Xe,onFullScreenChange:Ue=>wm(t,r,de,Ue)}):null}
369
+ ${Fe?h7(t,Fe,{viewURL:t.getArtifactViewURL(Fe),contentURL:t.getArtifactContentURL(Fe),fullScreen:de.geometry.full_screen,inert:!Xe,onFullScreenChange:Ze=>ym(t,r,de,Ze)}):null}
370
370
  ${Xe?M`
371
371
  <div class="page-handles" aria-hidden="true">
372
- ${o7.map(Ue=>M`
372
+ ${v7.map(Ze=>M`
373
373
  <span
374
- class="page-handle ${Ue}"
375
- @pointerdown=${le=>u(this,U,sS).call(this,le,Ue,t,r,de,ve)}
374
+ class="page-handle ${Ze}"
375
+ @pointerdown=${le=>u(this,Z,sS).call(this,le,Ze,t,r,de,ve)}
376
376
  ></span>
377
377
  `)}
378
378
  </div>
@@ -383,16 +383,16 @@ html, body {
383
383
  </div>
384
384
  `)}
385
385
  </section>
386
- `}disconnected(){var t;u(this,U,an).call(this,!1),u(this,U,ed).call(this),u(this,U,Ql).call(this),cancelAnimationFrame(s(this,Ci)),h(this,Ci,0),(t=s(this,qn))==null||t.disconnect(),h(this,qn,null),h(this,Hs,null),h(this,Vs,null),h(this,Ir,null),h(this,Pa,[]);for(const r of s(this,xr))r.cancel();s(this,xr).clear()}}Zs=new WeakMap,Bn=new WeakMap,Ia=new WeakMap,$r=new WeakMap,xa=new WeakMap,Fs=new WeakMap,ki=new WeakMap,Ci=new WeakMap,Ti=new WeakMap,Rr=new WeakMap,Hs=new WeakMap,Vs=new WeakMap,qn=new WeakMap,Pa=new WeakMap,Ir=new WeakMap,Wn=new WeakMap,rt=new WeakMap,xr=new WeakMap,jn=new WeakMap,U=new WeakSet,nS=function(t,r){const i=s(this,Bn).value;i&&(cancelAnimationFrame(s(this,Ci)),h(this,Ci,requestAnimationFrame(()=>{h(this,Ci,0),u(this,U,Fo).call(this,i,t,r)})))},rS=function(t,r){var i;typeof ResizeObserver>"u"||t===s(this,Hs)&&r===s(this,Vs)||((i=s(this,qn))==null||i.disconnect(),h(this,Hs,t),h(this,Vs,r),h(this,qn,new ResizeObserver(()=>{const o=u(this,U,Kl).call(this,t);vw(o,s(this,Ir))||(u(this,U,bm).call(this),s(this,rt)&&u(this,U,an).call(this,!1),u(this,U,Xl).call(this,t)),s(this,Rr)===null&&u(this,U,Fo).call(this,t,s(this,$r)??null,!1)})),s(this,qn).observe(t),s(this,qn).observe(r))},Kl=function(t){const r=Number.parseFloat(getComputedStyle(t).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,t.clientWidth-2*r),height:Math.max(0,t.clientHeight-r)}},iS=function(t){if(t.geometry.full_screen||s(this,Ir)===null)return"";const r=mw(t.size,s(this,Ir));return`width: ${r.width}px; height: ${r.height}px;`},Xl=function(t=s(this,Bn).value){var o;if(!t)return;const r=u(this,U,Kl).call(this,t);h(this,Ir,r);const i=new Map(s(this,Pa).map(a=>[a.key,a.page]));for(const a of t.querySelectorAll(".page")){if(a===((o=s(this,rt))==null?void 0:o.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=mw(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},bm=function(){const t=s(this,Zs).value;t&&(t.setAttribute("window-tracking",""),s(this,Wn)!==null&&clearTimeout(s(this,Wn)),h(this,Wn,setTimeout(()=>{h(this,Wn,null),t.removeAttribute("window-tracking")},s7)))},ed=function(){var t;s(this,Wn)!==null&&(clearTimeout(s(this,Wn)),h(this,Wn,null)),(t=s(this,Zs).value)==null||t.removeAttribute("window-tracking")},sS=function(t,r,i,o,a,l){if(s(this,jn)||t.button!==0||!t.isPrimary)return;const c=t.currentTarget,d=c.closest(".page"),f=s(this,Bn).value,g=s(this,Zs).value;if(!d||!f||!g)return;u(this,U,an).call(this,!1),u(this,U,ed).call(this),t.preventDefault(),t.stopPropagation();const y=d.getBoundingClientRect(),v=u(this,U,Kl).call(this,f),_=Vg(v),E=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),B=r.includes("top")||r.includes("bottom");h(this,rt,{application:i,channel:o,page:a,pageKey:l,pageElement:d,filmstrip:f,stage:g,handle:c,pointerId:t.pointerId,startPointer:{x:t.clientX,y:t.clientY},lastPointer:{x:t.clientX,y:t.clientY},startRendered:{width:y.width,height:y.height},rendered:{width:y.width,height:y.height},baselineSize:E?{width:v.width/_.width,height:v.height/_.height}:{...a.size},pageBox:v,wasFullScreen:E,horizontal:x,vertical:B,leftish:r.includes("left"),topish:r.includes("top"),option:t.altKey,armed:!1,leftFullScreen:!1}),g.setAttribute("resizing",""),c.addEventListener("pointermove",s(this,au)),c.addEventListener("pointerup",s(this,lu)),c.addEventListener("pointercancel",s(this,cu)),c.addEventListener("lostpointercapture",s(this,uu)),window.addEventListener("keydown",s(this,Bs)),window.addEventListener("keyup",s(this,Bs)),window.addEventListener("resize",s(this,hu)),c.setPointerCapture(t.pointerId)},au=new WeakMap,lu=new WeakMap,cu=new WeakMap,uu=new WeakMap,Bs=new WeakMap,hu=new WeakMap,Sm=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=tS(t.pageBox);let o=t.startRendered.width,a=t.startRendered.height;if(t.horizontal){const l=t.leftish?-vh:vh;o=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?-vh:vh;a=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&&o>=t.pageBox.width-ow&&a>=t.pageBox.height-ow,t.rendered=t.armed?{...t.pageBox}:{width:o,height:a},t.pageElement.style.width=`${t.rendered.width}px`,t.pageElement.style.height=`${t.rendered.height}px`,u(this,U,_m).call(this,t.stage,t.armed),u(this,U,Fo).call(this,t.filmstrip,t.pageKey,!1)},an=function(t){const r=s(this,rt);if(r){if(h(this,rt,null),r.handle.removeEventListener("pointermove",s(this,au)),r.handle.removeEventListener("pointerup",s(this,lu)),r.handle.removeEventListener("pointercancel",s(this,cu)),r.handle.removeEventListener("lostpointercapture",s(this,uu)),window.removeEventListener("keydown",s(this,Bs)),window.removeEventListener("keyup",s(this,Bs)),window.removeEventListener("resize",s(this,hu)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),u(this,U,_m).call(this,r.stage,!1),t&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),wm(r.application,r.channel,r.page,!0);else if(t){const i={...r.baselineSize},o=i7(r.rendered,r.pageBox);let a=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=o.width,a=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=o.height,a=!0),a?eS(r.application,r.channel,r.page,i,!1):u(this,U,Xl).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),u(this,U,Xl).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),u(this,U,Fo).call(this,r.filmstrip,r.pageKey,!1)}},_m=function(t,r){const i=t.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const o=document.createElement("div");o.className="snap-outline",o.setAttribute("aria-hidden","true"),t.append(o)},Fo=function(t,r,i){const o=[...t.querySelectorAll(".page")].find(y=>y.dataset.pageKey===r);if(!o){u(this,U,Ql).call(this);return}u(this,U,rS).call(this,t,o);const a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),c=Math.max(0,Math.min(t.scrollLeft+a.left+a.width/2-(l.left+l.width/2),t.scrollWidth-t.clientWidth));if(u(this,U,Ql).call(this),s(this,jn)||!i||Math.abs(c-t.scrollLeft)<gw||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:B6,easing:"ease"});h(this,Rr,f);const g=()=>{var v;if(f!==s(this,Rr))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Rr,null),h(this,Ti,0)):h(this,Ti,requestAnimationFrame(g))};h(this,Ti,requestAnimationFrame(g))},oS=function(){const t=s(this,Bn).value;return t?new Map([...t.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},aS=function(t){if(s(this,jn))return;const r=s(this,Bn).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const o=t.get(i.dataset.pageKey??"");if(o===void 0)continue;const a=o-i.getBoundingClientRect().left;if(Math.abs(a)<=gw)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:Go,easing:"ease"});s(this,xr).add(l),l.finished.finally(()=>{s(this,xr).delete(l)}).catch(()=>{})}},Ql=function(){var t;cancelAnimationFrame(s(this,Ti)),h(this,Ti,0),(t=s(this,Rr))==null||t.cancel(),h(this,Rr,null)};const l7=zt(a7);function c7(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{const o=r.artifactIds[0];return{page:r,artifact:o===void 0?null:t.get(o)??null,key:o??`empty-page-${i}`}})}function vw(n,e){return e!==null&&n.width===e.width&&n.height===e.height}/**
386
+ `}disconnected(){var t;u(this,Z,an).call(this,!1),u(this,Z,ed).call(this),u(this,Z,Ql).call(this),cancelAnimationFrame(s(this,Ci)),h(this,Ci,0),(t=s(this,qn))==null||t.disconnect(),h(this,qn,null),h(this,Vs,null),h(this,Fs,null),h(this,Ir,null),h(this,Pa,[]);for(const r of s(this,xr))r.cancel();s(this,xr).clear()}}Hs=new WeakMap,Bn=new WeakMap,Ia=new WeakMap,$r=new WeakMap,xa=new WeakMap,Us=new WeakMap,ki=new WeakMap,Ci=new WeakMap,Ti=new WeakMap,Rr=new WeakMap,Vs=new WeakMap,Fs=new WeakMap,qn=new WeakMap,Pa=new WeakMap,Ir=new WeakMap,Wn=new WeakMap,rt=new WeakMap,xr=new WeakMap,jn=new WeakMap,Z=new WeakSet,nS=function(t,r){const i=s(this,Bn).value;i&&(cancelAnimationFrame(s(this,Ci)),h(this,Ci,requestAnimationFrame(()=>{h(this,Ci,0),u(this,Z,Uo).call(this,i,t,r)})))},rS=function(t,r){var i;typeof ResizeObserver>"u"||t===s(this,Vs)&&r===s(this,Fs)||((i=s(this,qn))==null||i.disconnect(),h(this,Vs,t),h(this,Fs,r),h(this,qn,new ResizeObserver(()=>{const o=u(this,Z,Kl).call(this,t);mw(o,s(this,Ir))||(u(this,Z,wm).call(this),s(this,rt)&&u(this,Z,an).call(this,!1),u(this,Z,Xl).call(this,t)),s(this,Rr)===null&&u(this,Z,Uo).call(this,t,s(this,$r)??null,!1)})),s(this,qn).observe(t),s(this,qn).observe(r))},Kl=function(t){const r=Number.parseFloat(getComputedStyle(t).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,t.clientWidth-2*r),height:Math.max(0,t.clientHeight-r)}},iS=function(t){if(t.geometry.full_screen||s(this,Ir)===null)return"";const r=pw(t.size,s(this,Ir));return`width: ${r.width}px; height: ${r.height}px;`},Xl=function(t=s(this,Bn).value){var o;if(!t)return;const r=u(this,Z,Kl).call(this,t);h(this,Ir,r);const i=new Map(s(this,Pa).map(a=>[a.key,a.page]));for(const a of t.querySelectorAll(".page")){if(a===((o=s(this,rt))==null?void 0:o.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=pw(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},wm=function(){const t=s(this,Hs).value;t&&(t.setAttribute("window-tracking",""),s(this,Wn)!==null&&clearTimeout(s(this,Wn)),h(this,Wn,setTimeout(()=>{h(this,Wn,null),t.removeAttribute("window-tracking")},g7)))},ed=function(){var t;s(this,Wn)!==null&&(clearTimeout(s(this,Wn)),h(this,Wn,null)),(t=s(this,Hs).value)==null||t.removeAttribute("window-tracking")},sS=function(t,r,i,o,a,l){if(s(this,jn)||t.button!==0||!t.isPrimary)return;const c=t.currentTarget,d=c.closest(".page"),f=s(this,Bn).value,g=s(this,Hs).value;if(!d||!f||!g)return;u(this,Z,an).call(this,!1),u(this,Z,ed).call(this),t.preventDefault(),t.stopPropagation();const y=d.getBoundingClientRect(),v=u(this,Z,Kl).call(this,f),_=Vg(v),E=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),B=r.includes("top")||r.includes("bottom");h(this,rt,{application:i,channel:o,page:a,pageKey:l,pageElement:d,filmstrip:f,stage:g,handle:c,pointerId:t.pointerId,startPointer:{x:t.clientX,y:t.clientY},lastPointer:{x:t.clientX,y:t.clientY},startRendered:{width:y.width,height:y.height},rendered:{width:y.width,height:y.height},baselineSize:E?{width:v.width/_.width,height:v.height/_.height}:{...a.size},pageBox:v,wasFullScreen:E,horizontal:x,vertical:B,leftish:r.includes("left"),topish:r.includes("top"),option:t.altKey,armed:!1,leftFullScreen:!1}),g.setAttribute("resizing",""),c.addEventListener("pointermove",s(this,au)),c.addEventListener("pointerup",s(this,lu)),c.addEventListener("pointercancel",s(this,cu)),c.addEventListener("lostpointercapture",s(this,uu)),window.addEventListener("keydown",s(this,Bs)),window.addEventListener("keyup",s(this,Bs)),window.addEventListener("resize",s(this,hu)),c.setPointerCapture(t.pointerId)},au=new WeakMap,lu=new WeakMap,cu=new WeakMap,uu=new WeakMap,Bs=new WeakMap,hu=new WeakMap,bm=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=tS(t.pageBox);let o=t.startRendered.width,a=t.startRendered.height;if(t.horizontal){const l=t.leftish?-vh:vh;o=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?-vh:vh;a=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&&o>=t.pageBox.width-iw&&a>=t.pageBox.height-iw,t.rendered=t.armed?{...t.pageBox}:{width:o,height:a},t.pageElement.style.width=`${t.rendered.width}px`,t.pageElement.style.height=`${t.rendered.height}px`,u(this,Z,Sm).call(this,t.stage,t.armed),u(this,Z,Uo).call(this,t.filmstrip,t.pageKey,!1)},an=function(t){const r=s(this,rt);if(r){if(h(this,rt,null),r.handle.removeEventListener("pointermove",s(this,au)),r.handle.removeEventListener("pointerup",s(this,lu)),r.handle.removeEventListener("pointercancel",s(this,cu)),r.handle.removeEventListener("lostpointercapture",s(this,uu)),window.removeEventListener("keydown",s(this,Bs)),window.removeEventListener("keyup",s(this,Bs)),window.removeEventListener("resize",s(this,hu)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),u(this,Z,Sm).call(this,r.stage,!1),t&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),ym(r.application,r.channel,r.page,!0);else if(t){const i={...r.baselineSize},o=m7(r.rendered,r.pageBox);let a=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=o.width,a=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=o.height,a=!0),a?eS(r.application,r.channel,r.page,i,!1):u(this,Z,Xl).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),u(this,Z,Xl).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),u(this,Z,Uo).call(this,r.filmstrip,r.pageKey,!1)}},Sm=function(t,r){const i=t.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const o=document.createElement("div");o.className="snap-outline",o.setAttribute("aria-hidden","true"),t.append(o)},Uo=function(t,r,i){const o=[...t.querySelectorAll(".page")].find(y=>y.dataset.pageKey===r);if(!o){u(this,Z,Ql).call(this);return}u(this,Z,rS).call(this,t,o);const a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),c=Math.max(0,Math.min(t.scrollLeft+a.left+a.width/2-(l.left+l.width/2),t.scrollWidth-t.clientWidth));if(u(this,Z,Ql).call(this),s(this,jn)||!i||Math.abs(c-t.scrollLeft)<fw||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:B6,easing:"ease"});h(this,Rr,f);const g=()=>{var v;if(f!==s(this,Rr))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Rr,null),h(this,Ti,0)):h(this,Ti,requestAnimationFrame(g))};h(this,Ti,requestAnimationFrame(g))},oS=function(){const t=s(this,Bn).value;return t?new Map([...t.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},aS=function(t){if(s(this,jn))return;const r=s(this,Bn).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const o=t.get(i.dataset.pageKey??"");if(o===void 0)continue;const a=o-i.getBoundingClientRect().left;if(Math.abs(a)<=fw)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:Go,easing:"ease"});s(this,xr).add(l),l.finished.finally(()=>{s(this,xr).delete(l)}).catch(()=>{})}},Ql=function(){var t;cancelAnimationFrame(s(this,Ti)),h(this,Ti,0),(t=s(this,Rr))==null||t.cancel(),h(this,Rr,null)};const w7=zt(y7);function b7(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{const o=r.artifactIds[0];return{page:r,artifact:o===void 0?null:t.get(o)??null,key:o??`empty-page-${i}`}})}function mw(n,e){return e!==null&&n.width===e.width&&n.height===e.height}/**
387
387
  * @license
388
388
  * Copyright 2017 Google LLC
389
389
  * SPDX-License-Identifier: BSD-3-Clause
390
- */class Am extends Bu{constructor(e){if(super(e),this.it=te,e.type!==nr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===te||e==null)return this._t=void 0,this.it=e;if(e===at)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:[]}}}Am.directiveName="unsafeHTML",Am.resultType=1;const lS=vl(Am);/*! @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:cS,setPrototypeOf:yw,isFrozen:u7,getPrototypeOf:h7,getOwnPropertyDescriptor:d7}=Object;let{freeze:ct,seal:nn,create:td}=Object,{apply:Em,construct:km}=typeof Reflect<"u"&&Reflect;ct||(ct=function(e){return e});nn||(nn=function(e){return e});Em||(Em=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});km||(km=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 yh=ut(Array.prototype.forEach),p7=ut(Array.prototype.lastIndexOf),ww=ut(Array.prototype.pop),Il=ut(Array.prototype.push),f7=ut(Array.prototype.splice),nd=ut(String.prototype.toLowerCase),Xf=ut(String.prototype.toString),Qf=ut(String.prototype.match),xl=ut(String.prototype.replace),m7=ut(String.prototype.indexOf),g7=ut(String.prototype.trim),Tt=ut(Object.prototype.hasOwnProperty),Qe=ut(RegExp.prototype.test),Pl=v7(TypeError);function ut(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 Em(n,e,r)}}function v7(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return km(n,t)}}function Q(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nd;yw&&yw(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(u7(e)||(e[r]=o),i=o)}n[i]=!0}return n}function y7(n){for(let e=0;e<n.length;e++)Tt(n,e)||(n[e]=null);return n}function Rn(n){const e=td(null);for(const[t,r]of cS(n))Tt(n,t)&&(Array.isArray(r)?e[t]=y7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Rn(r):e[t]=r);return e}function Dl(n,e){for(;n!==null;){const r=d7(n,e);if(r){if(r.get)return ut(r.get);if(typeof r.value=="function")return ut(r.value)}n=h7(n)}function t(){return null}return t}const bw=ct(["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"]),e0=ct(["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"]),t0=ct(["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"]),w7=ct(["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"]),n0=ct(["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"]),b7=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Sw=ct(["#text"]),_w=ct(["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"]),r0=ct(["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"]),Aw=ct(["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"]),wh=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),S7=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),_7=nn(/<%[\w\W]*|[\w\W]*%>/gm),A7=nn(/\$\{[\w\W]*/gm),E7=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),k7=nn(/^aria-[\-\w]+$/),uS=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),C7=nn(/^(?:\w+script|data):/i),T7=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hS=nn(/^html$/i),$7=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ew=Object.freeze({__proto__:null,ARIA_ATTR:k7,ATTR_WHITESPACE:T7,CUSTOM_ELEMENT:$7,DATA_ATTR:E7,DOCTYPE_NAME:hS,ERB_EXPR:_7,IS_ALLOWED_URI:uS,IS_SCRIPT_OR_DATA:C7,MUSTACHE_EXPR:S7,TMPLIT_EXPR:A7});const Ll={element:1,text:3,progressingInstruction:7,comment:8,document:9},R7=function(){return typeof window>"u"?null:window},I7=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 o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},kw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function dS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R7();const e=V=>dS(V);if(e.version="3.3.3",e.removed=[],!n||!n.document||n.document.nodeType!==Ll.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:d,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:g,DOMParser:y,trustedTypes:v}=n,_=c.prototype,E=Dl(_,"cloneNode"),x=Dl(_,"remove"),B=Dl(_,"nextSibling"),P=Dl(_,"childNodes"),J=Dl(_,"parentNode");if(typeof a=="function"){const V=t.createElement("template");V.content&&V.content.ownerDocument&&(t=V.content.ownerDocument)}let O,Y="";const{implementation:F,createNodeIterator:j,createDocumentFragment:fe,getElementsByTagName:de}=t,{importNode:Ve}=r;let ve=kw();e.isSupported=typeof cS=="function"&&typeof J=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Xe,ERB_EXPR:Ue,TMPLIT_EXPR:le,DATA_ATTR:sr,ARIA_ATTR:Ut,IS_SCRIPT_OR_DATA:wl,ATTR_WHITESPACE:bl,CUSTOM_ELEMENT:ju}=Ew;let{IS_ALLOWED_URI:i1}=Ew,Ze=null;const s1=Q({},[...bw,...e0,...t0,...n0,...Sw]);let Be=null;const o1=Q({},[..._w,...r0,...Aw,...wh]);let Te=Object.seal(td(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}})),Sl=null,Gu=null;const Xr=Object.seal(td(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let a1=!0,Qp=!0,l1=!1,c1=!0,wo=!1,Yu=!0,Xi=!1,ef=!1,tf=!1,bo=!1,Ju=!1,Ku=!1,u1=!0,h1=!1;const f_="user-content-";let nf=!0,_l=!1,So={},En=null;const rf=Q({},["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 d1=null;const p1=Q({},["audio","video","img","source","image","track"]);let sf=null;const f1=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xu="http://www.w3.org/1998/Math/MathML",Qu="http://www.w3.org/2000/svg",or="http://www.w3.org/1999/xhtml";let _o=or,of=!1,af=null;const m_=Q({},[Xu,Qu,or],Xf);let eh=Q({},["mi","mo","mn","ms","mtext"]),th=Q({},["annotation-xml"]);const g_=Q({},["title","style","font","a","script"]);let Al=null;const v_=["application/xhtml+xml","text/html"],y_="text/html";let Le=null,Ao=null;const w_=t.createElement("form"),m1=function(b){return b instanceof RegExp||b instanceof Function},lf=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ao&&Ao===b)){if((!b||typeof b!="object")&&(b={}),b=Rn(b),Al=v_.indexOf(b.PARSER_MEDIA_TYPE)===-1?y_:b.PARSER_MEDIA_TYPE,Le=Al==="application/xhtml+xml"?Xf:nd,Ze=Tt(b,"ALLOWED_TAGS")?Q({},b.ALLOWED_TAGS,Le):s1,Be=Tt(b,"ALLOWED_ATTR")?Q({},b.ALLOWED_ATTR,Le):o1,af=Tt(b,"ALLOWED_NAMESPACES")?Q({},b.ALLOWED_NAMESPACES,Xf):m_,sf=Tt(b,"ADD_URI_SAFE_ATTR")?Q(Rn(f1),b.ADD_URI_SAFE_ATTR,Le):f1,d1=Tt(b,"ADD_DATA_URI_TAGS")?Q(Rn(p1),b.ADD_DATA_URI_TAGS,Le):p1,En=Tt(b,"FORBID_CONTENTS")?Q({},b.FORBID_CONTENTS,Le):rf,Sl=Tt(b,"FORBID_TAGS")?Q({},b.FORBID_TAGS,Le):Rn({}),Gu=Tt(b,"FORBID_ATTR")?Q({},b.FORBID_ATTR,Le):Rn({}),So=Tt(b,"USE_PROFILES")?b.USE_PROFILES:!1,a1=b.ALLOW_ARIA_ATTR!==!1,Qp=b.ALLOW_DATA_ATTR!==!1,l1=b.ALLOW_UNKNOWN_PROTOCOLS||!1,c1=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wo=b.SAFE_FOR_TEMPLATES||!1,Yu=b.SAFE_FOR_XML!==!1,Xi=b.WHOLE_DOCUMENT||!1,bo=b.RETURN_DOM||!1,Ju=b.RETURN_DOM_FRAGMENT||!1,Ku=b.RETURN_TRUSTED_TYPE||!1,tf=b.FORCE_BODY||!1,u1=b.SANITIZE_DOM!==!1,h1=b.SANITIZE_NAMED_PROPS||!1,nf=b.KEEP_CONTENT!==!1,_l=b.IN_PLACE||!1,i1=b.ALLOWED_URI_REGEXP||uS,_o=b.NAMESPACE||or,eh=b.MATHML_TEXT_INTEGRATION_POINTS||eh,th=b.HTML_INTEGRATION_POINTS||th,Te=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&m1(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&m1(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Te.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),wo&&(Qp=!1),Ju&&(bo=!0),So&&(Ze=Q({},Sw),Be=td(null),So.html===!0&&(Q(Ze,bw),Q(Be,_w)),So.svg===!0&&(Q(Ze,e0),Q(Be,r0),Q(Be,wh)),So.svgFilters===!0&&(Q(Ze,t0),Q(Be,r0),Q(Be,wh)),So.mathMl===!0&&(Q(Ze,n0),Q(Be,Aw),Q(Be,wh))),Tt(b,"ADD_TAGS")||(Xr.tagCheck=null),Tt(b,"ADD_ATTR")||(Xr.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Xr.tagCheck=b.ADD_TAGS:(Ze===s1&&(Ze=Rn(Ze)),Q(Ze,b.ADD_TAGS,Le))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xr.attributeCheck=b.ADD_ATTR:(Be===o1&&(Be=Rn(Be)),Q(Be,b.ADD_ATTR,Le))),b.ADD_URI_SAFE_ATTR&&Q(sf,b.ADD_URI_SAFE_ATTR,Le),b.FORBID_CONTENTS&&(En===rf&&(En=Rn(En)),Q(En,b.FORBID_CONTENTS,Le)),b.ADD_FORBID_CONTENTS&&(En===rf&&(En=Rn(En)),Q(En,b.ADD_FORBID_CONTENTS,Le)),nf&&(Ze["#text"]=!0),Xi&&Q(Ze,["html","head","body"]),Ze.table&&(Q(Ze,["tbody"]),delete Sl.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=b.TRUSTED_TYPES_POLICY,Y=O.createHTML("")}else O===void 0&&(O=I7(v,i)),O!==null&&typeof Y=="string"&&(Y=O.createHTML(""));ct&&ct(b),Ao=b}},g1=Q({},[...e0,...t0,...w7]),v1=Q({},[...n0,...b7]),b_=function(b){let I=J(b);(!I||!I.tagName)&&(I={namespaceURI:_o,tagName:"template"});const N=nd(b.tagName),ye=nd(I.tagName);return af[b.namespaceURI]?b.namespaceURI===Qu?I.namespaceURI===or?N==="svg":I.namespaceURI===Xu?N==="svg"&&(ye==="annotation-xml"||eh[ye]):!!g1[N]:b.namespaceURI===Xu?I.namespaceURI===or?N==="math":I.namespaceURI===Qu?N==="math"&&th[ye]:!!v1[N]:b.namespaceURI===or?I.namespaceURI===Qu&&!th[ye]||I.namespaceURI===Xu&&!eh[ye]?!1:!v1[N]&&(g_[N]||!g1[N]):!!(Al==="application/xhtml+xml"&&af[b.namespaceURI]):!1},kn=function(b){Il(e.removed,{element:b});try{J(b).removeChild(b)}catch{x(b)}},Qi=function(b,I){try{Il(e.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Il(e.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(bo||Ju)try{kn(I)}catch{}else try{I.setAttribute(b,"")}catch{}},y1=function(b){let I=null,N=null;if(tf)b="<remove></remove>"+b;else{const Re=Qf(b,/^[\r\n\t ]+/);N=Re&&Re[0]}Al==="application/xhtml+xml"&&_o===or&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ye=O?O.createHTML(b):b;if(_o===or)try{I=new y().parseFromString(ye,Al)}catch{}if(!I||!I.documentElement){I=F.createDocument(_o,"template",null);try{I.documentElement.innerHTML=of?Y:ye}catch{}}const je=I.body||I.documentElement;return b&&N&&je.insertBefore(t.createTextNode(N),je.childNodes[0]||null),_o===or?de.call(I,Xi?"html":"body")[0]:Xi?I.documentElement:je},w1=function(b){return j.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},cf=function(b){return b instanceof g&&(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")},b1=function(b){return typeof l=="function"&&b instanceof l};function ar(V,b,I){yh(V,N=>{N.call(e,b,I,Ao)})}const S1=function(b){let I=null;if(ar(ve.beforeSanitizeElements,b,null),cf(b))return kn(b),!0;const N=Le(b.nodeName);if(ar(ve.uponSanitizeElement,b,{tagName:N,allowedTags:Ze}),Yu&&b.hasChildNodes()&&!b1(b.firstElementChild)&&Qe(/<[/\w!]/g,b.innerHTML)&&Qe(/<[/\w!]/g,b.textContent)||b.nodeType===Ll.progressingInstruction||Yu&&b.nodeType===Ll.comment&&Qe(/<[/\w]/g,b.data))return kn(b),!0;if(!(Xr.tagCheck instanceof Function&&Xr.tagCheck(N))&&(!Ze[N]||Sl[N])){if(!Sl[N]&&A1(N)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N)))return!1;if(nf&&!En[N]){const ye=J(b)||b.parentNode,je=P(b)||b.childNodes;if(je&&ye){const Re=je.length;for(let dt=Re-1;dt>=0;--dt){const lr=E(je[dt],!0);lr.__removalCount=(b.__removalCount||0)+1,ye.insertBefore(lr,B(b))}}}return kn(b),!0}return b instanceof c&&!b_(b)||(N==="noscript"||N==="noembed"||N==="noframes")&&Qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(kn(b),!0):(wo&&b.nodeType===Ll.text&&(I=b.textContent,yh([Xe,Ue,le],ye=>{I=xl(I,ye," ")}),b.textContent!==I&&(Il(e.removed,{element:b.cloneNode()}),b.textContent=I)),ar(ve.afterSanitizeElements,b,null),!1)},_1=function(b,I,N){if(Gu[I]||u1&&(I==="id"||I==="name")&&(N in t||N in w_))return!1;if(!(Qp&&!Gu[I]&&Qe(sr,I))){if(!(a1&&Qe(Ut,I))){if(!(Xr.attributeCheck instanceof Function&&Xr.attributeCheck(I,b))){if(!Be[I]||Gu[I]){if(!(A1(b)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,b)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(b))&&(Te.attributeNameCheck instanceof RegExp&&Qe(Te.attributeNameCheck,I)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(I,b))||I==="is"&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N))))return!1}else if(!sf[I]){if(!Qe(i1,xl(N,bl,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&m7(N,"data:")===0&&d1[b])){if(!(l1&&!Qe(wl,xl(N,bl,"")))){if(N)return!1}}}}}}}return!0},A1=function(b){return b!=="annotation-xml"&&Qf(b,ju)},E1=function(b){ar(ve.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||cf(b))return;const N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0};let ye=I.length;for(;ye--;){const je=I[ye],{name:Re,namespaceURI:dt,value:lr}=je,Eo=Le(Re),uf=lr;let qe=Re==="value"?uf:g7(uf);if(N.attrName=Eo,N.attrValue=qe,N.keepAttr=!0,N.forceKeepAttr=void 0,ar(ve.uponSanitizeAttribute,b,N),qe=N.attrValue,h1&&(Eo==="id"||Eo==="name")&&(Qi(Re,b),qe=f_+qe),Yu&&Qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qe)){Qi(Re,b);continue}if(Eo==="attributename"&&Qf(qe,"href")){Qi(Re,b);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){Qi(Re,b);continue}if(!c1&&Qe(/\/>/i,qe)){Qi(Re,b);continue}wo&&yh([Xe,Ue,le],C1=>{qe=xl(qe,C1," ")});const k1=Le(b.nodeName);if(!_1(k1,Eo,qe)){Qi(Re,b);continue}if(O&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!dt)switch(v.getAttributeType(k1,Eo)){case"TrustedHTML":{qe=O.createHTML(qe);break}case"TrustedScriptURL":{qe=O.createScriptURL(qe);break}}if(qe!==uf)try{dt?b.setAttributeNS(dt,Re,qe):b.setAttribute(Re,qe),cf(b)?kn(b):ww(e.removed)}catch{Qi(Re,b)}}ar(ve.afterSanitizeAttributes,b,null)},S_=function V(b){let I=null;const N=w1(b);for(ar(ve.beforeSanitizeShadowDOM,b,null);I=N.nextNode();)ar(ve.uponSanitizeShadowNode,I,null),S1(I),E1(I),I.content instanceof o&&V(I.content);ar(ve.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(V){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,N=null,ye=null,je=null;if(of=!V,of&&(V="<!-->"),typeof V!="string"&&!b1(V))if(typeof V.toString=="function"){if(V=V.toString(),typeof V!="string")throw Pl("dirty is not a string, aborting")}else throw Pl("toString is not a function");if(!e.isSupported)return V;if(ef||lf(b),e.removed=[],typeof V=="string"&&(_l=!1),_l){if(V.nodeName){const lr=Le(V.nodeName);if(!Ze[lr]||Sl[lr])throw Pl("root node is forbidden and cannot be sanitized in-place")}}else if(V instanceof l)I=y1("<!---->"),N=I.ownerDocument.importNode(V,!0),N.nodeType===Ll.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?I=N:I.appendChild(N);else{if(!bo&&!wo&&!Xi&&V.indexOf("<")===-1)return O&&Ku?O.createHTML(V):V;if(I=y1(V),!I)return bo?null:Ku?Y:""}I&&tf&&kn(I.firstChild);const Re=w1(_l?V:I);for(;ye=Re.nextNode();)S1(ye),E1(ye),ye.content instanceof o&&S_(ye.content);if(_l)return V;if(bo){if(Ju)for(je=fe.call(I.ownerDocument);I.firstChild;)je.appendChild(I.firstChild);else je=I;return(Be.shadowroot||Be.shadowrootmode)&&(je=Ve.call(r,je,!0)),je}let dt=Xi?I.outerHTML:I.innerHTML;return Xi&&Ze["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Qe(hS,I.ownerDocument.doctype.name)&&(dt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
391
- `+dt),wo&&yh([Xe,Ue,le],lr=>{dt=xl(dt,lr," ")}),O&&Ku?O.createHTML(dt):dt},e.setConfig=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf(V),ef=!0},e.clearConfig=function(){Ao=null,ef=!1},e.isValidAttribute=function(V,b,I){Ao||lf({});const N=Le(V),ye=Le(b);return _1(N,ye,I)},e.addHook=function(V,b){typeof b=="function"&&Il(ve[V],b)},e.removeHook=function(V,b){if(b!==void 0){const I=p7(ve[V],b);return I===-1?void 0:f7(ve[V],I,1)[0]}return ww(ve[V])},e.removeHooks=function(V){ve[V]=[]},e.removeAllHooks=function(){ve=kw()},e}var pS=dS();function Bg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yo=Bg();function fS(n){yo=n}var cs={exec:()=>null};function ie(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(lt.caret,"$1"),t=t.replace(i,a),r},getRegex:()=>new RegExp(t,e)};return r}var x7=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),lt={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)}}>`)},P7=/^(?:[ \t]*(?:\n|$))+/,D7=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,L7=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,M7=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qg=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,mS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gS=ie(mS).replace(/bull/g,qg).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(),O7=ie(mS).replace(/bull/g,qg).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(),Wg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,N7=/^[^\n]+/,jg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,z7=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),U7=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qg).getRegex(),Jp="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",Gg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Z7=ie("^ {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",Gg).replace("tag",Jp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vS=ie(Wg).replace("hr",Wu).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",Jp).getRegex(),F7=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vS).getRegex(),Yg={blockquote:F7,code:D7,def:z7,fences:L7,heading:M7,hr:Wu,html:Z7,lheading:gS,list:U7,newline:P7,paragraph:vS,table:cs,text:N7},Cw=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Wu).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",Jp).getRegex(),H7={...Yg,lheading:O7,table:Cw,paragraph:ie(Wg).replace("hr",Wu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cw).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",Jp).getRegex()},V7={...Yg,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gg).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:cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Wg).replace("hr",Wu).replace("heading",` *#{1,6} *[^
392
- ]`).replace("lheading",gS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},B7=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q7=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yS=/^( {2,}|\\)\n(?!\s*$)/,W7=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yl=/[\p{P}\p{S}]/u,Kp=/[\s\p{P}\p{S}]/u,Jg=/[^\s\p{P}\p{S}]/u,j7=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),wS=/(?!~)[\p{P}\p{S}]/u,G7=/(?!~)[\s\p{P}\p{S}]/u,Y7=/(?:[^\s\p{P}\p{S}]|~)/u,J7=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",x7?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bS=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,K7=ie(bS,"u").replace(/punct/g,yl).getRegex(),X7=ie(bS,"u").replace(/punct/g,wS).getRegex(),SS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Q7=ie(SS,"gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),eU=ie(SS,"gu").replace(/notPunctSpace/g,Y7).replace(/punctSpace/g,G7).replace(/punct/g,wS).getRegex(),tU=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),nU=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yl).getRegex(),rU="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",iU=ie(rU,"gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),sU=ie(/\\(punct)/,"gu").replace(/punct/g,yl).getRegex(),oU=ie(/^<(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(),aU=ie(Gg).replace("(?:-->|$)","-->").getRegex(),lU=ie("^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",aU).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cU=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_S=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",xd).replace("ref",jg).getRegex(),AS=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",jg).getRegex(),uU=ie("reflink|nolink(?!\\()","g").replace("reflink",_S).replace("nolink",AS).getRegex(),Tw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Kg={_backpedal:cs,anyPunctuation:sU,autolink:oU,blockSkip:J7,br:yS,code:q7,del:cs,delLDelim:cs,delRDelim:cs,emStrongLDelim:K7,emStrongRDelimAst:Q7,emStrongRDelimUnd:tU,escape:B7,link:cU,nolink:AS,punctuation:j7,reflink:_S,reflinkSearch:uU,tag:lU,text:W7,url:cs},hU={...Kg,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},Cm={...Kg,emStrongRDelimAst:eU,emStrongLDelim:X7,delLDelim:nU,delRDelim:iU,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Tw).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:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Tw).getRegex()},dU={...Cm,br:ie(yS).replace("{2,}","*").getRegex(),text:ie(Cm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bh={normal:Yg,gfm:H7,pedantic:V7},Ml={normal:Kg,gfm:Cm,breaks:dU,pedantic:hU},pU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$w=n=>pU[n];function In(n,e){if(e){if(lt.escapeTest.test(n))return n.replace(lt.escapeReplace,$w)}else if(lt.escapeTestNoEncode.test(n))return n.replace(lt.escapeReplaceNoEncode,$w);return n}function Rw(n){try{n=encodeURI(n).replace(lt.percentDecode,"%")}catch{return null}return n}function Iw(n,e){var o;let t=n.replace(lt.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=t.split(lt.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.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(lt.slashPipe,"|");return r}function Ol(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 fU(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 mU(n,e=0){let t=e,r="";for(let i of n)if(i===" "){let o=4-t%4;r+=" ".repeat(o),t+=o}else r+=i,t++;return r}function xw(n,e,t,r,i){let o=e.href,a=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:o,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function gU(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
390
+ */class _m extends Bu{constructor(e){if(super(e),this.it=te,e.type!==nr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===te||e==null)return this._t=void 0,this.it=e;if(e===at)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:[]}}}_m.directiveName="unsafeHTML",_m.resultType=1;const lS=vl(_m);/*! @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:cS,setPrototypeOf:gw,isFrozen:S7,getPrototypeOf:_7,getOwnPropertyDescriptor:A7}=Object;let{freeze:ct,seal:nn,create:td}=Object,{apply:Am,construct:Em}=typeof Reflect<"u"&&Reflect;ct||(ct=function(e){return e});nn||(nn=function(e){return e});Am||(Am=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Em||(Em=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 yh=ut(Array.prototype.forEach),E7=ut(Array.prototype.lastIndexOf),vw=ut(Array.prototype.pop),Il=ut(Array.prototype.push),k7=ut(Array.prototype.splice),nd=ut(String.prototype.toLowerCase),Kf=ut(String.prototype.toString),Xf=ut(String.prototype.match),xl=ut(String.prototype.replace),C7=ut(String.prototype.indexOf),T7=ut(String.prototype.trim),Tt=ut(Object.prototype.hasOwnProperty),Qe=ut(RegExp.prototype.test),Pl=$7(TypeError);function ut(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 Am(n,e,r)}}function $7(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Em(n,t)}}function Q(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nd;gw&&gw(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(S7(e)||(e[r]=o),i=o)}n[i]=!0}return n}function R7(n){for(let e=0;e<n.length;e++)Tt(n,e)||(n[e]=null);return n}function Rn(n){const e=td(null);for(const[t,r]of cS(n))Tt(n,t)&&(Array.isArray(r)?e[t]=R7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Rn(r):e[t]=r);return e}function Ll(n,e){for(;n!==null;){const r=A7(n,e);if(r){if(r.get)return ut(r.get);if(typeof r.value=="function")return ut(r.value)}n=_7(n)}function t(){return null}return t}const yw=ct(["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"]),Qf=ct(["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"]),e0=ct(["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"]),I7=ct(["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"]),t0=ct(["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"]),x7=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ww=ct(["#text"]),bw=ct(["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"]),n0=ct(["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"]),Sw=ct(["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"]),wh=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P7=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),L7=nn(/<%[\w\W]*|[\w\W]*%>/gm),D7=nn(/\$\{[\w\W]*/gm),M7=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),O7=nn(/^aria-[\-\w]+$/),uS=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),N7=nn(/^(?:\w+script|data):/i),z7=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hS=nn(/^html$/i),Z7=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var _w=Object.freeze({__proto__:null,ARIA_ATTR:O7,ATTR_WHITESPACE:z7,CUSTOM_ELEMENT:Z7,DATA_ATTR:M7,DOCTYPE_NAME:hS,ERB_EXPR:L7,IS_ALLOWED_URI:uS,IS_SCRIPT_OR_DATA:N7,MUSTACHE_EXPR:P7,TMPLIT_EXPR:D7});const Dl={element:1,text:3,progressingInstruction:7,comment:8,document:9},H7=function(){return typeof window>"u"?null:window},U7=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 o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Aw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function dS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H7();const e=F=>dS(F);if(e.version="3.3.3",e.removed=[],!n||!n.document||n.document.nodeType!==Dl.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:d,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:g,DOMParser:y,trustedTypes:v}=n,_=c.prototype,E=Ll(_,"cloneNode"),x=Ll(_,"remove"),B=Ll(_,"nextSibling"),P=Ll(_,"childNodes"),J=Ll(_,"parentNode");if(typeof a=="function"){const F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let O,Y="";const{implementation:U,createNodeIterator:j,createDocumentFragment:fe,getElementsByTagName:de}=t,{importNode:Fe}=r;let ve=Aw();e.isSupported=typeof cS=="function"&&typeof J=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Xe,ERB_EXPR:Ze,TMPLIT_EXPR:le,DATA_ATTR:sr,ARIA_ATTR:Zt,IS_SCRIPT_OR_DATA:wl,ATTR_WHITESPACE:bl,CUSTOM_ELEMENT:ju}=_w;let{IS_ALLOWED_URI:r1}=_w,He=null;const i1=Q({},[...yw,...Qf,...e0,...t0,...ww]);let Be=null;const s1=Q({},[...bw,...n0,...Sw,...wh]);let Te=Object.seal(td(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}})),Sl=null,Gu=null;const Xr=Object.seal(td(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let o1=!0,Qp=!0,a1=!1,l1=!0,wo=!1,Yu=!0,Xi=!1,ef=!1,tf=!1,bo=!1,Ju=!1,Ku=!1,c1=!0,u1=!1;const f_="user-content-";let nf=!0,_l=!1,So={},En=null;const rf=Q({},["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 h1=null;const d1=Q({},["audio","video","img","source","image","track"]);let sf=null;const p1=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xu="http://www.w3.org/1998/Math/MathML",Qu="http://www.w3.org/2000/svg",or="http://www.w3.org/1999/xhtml";let _o=or,of=!1,af=null;const m_=Q({},[Xu,Qu,or],Kf);let eh=Q({},["mi","mo","mn","ms","mtext"]),th=Q({},["annotation-xml"]);const g_=Q({},["title","style","font","a","script"]);let Al=null;const v_=["application/xhtml+xml","text/html"],y_="text/html";let De=null,Ao=null;const w_=t.createElement("form"),f1=function(b){return b instanceof RegExp||b instanceof Function},lf=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ao&&Ao===b)){if((!b||typeof b!="object")&&(b={}),b=Rn(b),Al=v_.indexOf(b.PARSER_MEDIA_TYPE)===-1?y_:b.PARSER_MEDIA_TYPE,De=Al==="application/xhtml+xml"?Kf:nd,He=Tt(b,"ALLOWED_TAGS")?Q({},b.ALLOWED_TAGS,De):i1,Be=Tt(b,"ALLOWED_ATTR")?Q({},b.ALLOWED_ATTR,De):s1,af=Tt(b,"ALLOWED_NAMESPACES")?Q({},b.ALLOWED_NAMESPACES,Kf):m_,sf=Tt(b,"ADD_URI_SAFE_ATTR")?Q(Rn(p1),b.ADD_URI_SAFE_ATTR,De):p1,h1=Tt(b,"ADD_DATA_URI_TAGS")?Q(Rn(d1),b.ADD_DATA_URI_TAGS,De):d1,En=Tt(b,"FORBID_CONTENTS")?Q({},b.FORBID_CONTENTS,De):rf,Sl=Tt(b,"FORBID_TAGS")?Q({},b.FORBID_TAGS,De):Rn({}),Gu=Tt(b,"FORBID_ATTR")?Q({},b.FORBID_ATTR,De):Rn({}),So=Tt(b,"USE_PROFILES")?b.USE_PROFILES:!1,o1=b.ALLOW_ARIA_ATTR!==!1,Qp=b.ALLOW_DATA_ATTR!==!1,a1=b.ALLOW_UNKNOWN_PROTOCOLS||!1,l1=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wo=b.SAFE_FOR_TEMPLATES||!1,Yu=b.SAFE_FOR_XML!==!1,Xi=b.WHOLE_DOCUMENT||!1,bo=b.RETURN_DOM||!1,Ju=b.RETURN_DOM_FRAGMENT||!1,Ku=b.RETURN_TRUSTED_TYPE||!1,tf=b.FORCE_BODY||!1,c1=b.SANITIZE_DOM!==!1,u1=b.SANITIZE_NAMED_PROPS||!1,nf=b.KEEP_CONTENT!==!1,_l=b.IN_PLACE||!1,r1=b.ALLOWED_URI_REGEXP||uS,_o=b.NAMESPACE||or,eh=b.MATHML_TEXT_INTEGRATION_POINTS||eh,th=b.HTML_INTEGRATION_POINTS||th,Te=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&f1(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&f1(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Te.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),wo&&(Qp=!1),Ju&&(bo=!0),So&&(He=Q({},ww),Be=td(null),So.html===!0&&(Q(He,yw),Q(Be,bw)),So.svg===!0&&(Q(He,Qf),Q(Be,n0),Q(Be,wh)),So.svgFilters===!0&&(Q(He,e0),Q(Be,n0),Q(Be,wh)),So.mathMl===!0&&(Q(He,t0),Q(Be,Sw),Q(Be,wh))),Tt(b,"ADD_TAGS")||(Xr.tagCheck=null),Tt(b,"ADD_ATTR")||(Xr.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Xr.tagCheck=b.ADD_TAGS:(He===i1&&(He=Rn(He)),Q(He,b.ADD_TAGS,De))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xr.attributeCheck=b.ADD_ATTR:(Be===s1&&(Be=Rn(Be)),Q(Be,b.ADD_ATTR,De))),b.ADD_URI_SAFE_ATTR&&Q(sf,b.ADD_URI_SAFE_ATTR,De),b.FORBID_CONTENTS&&(En===rf&&(En=Rn(En)),Q(En,b.FORBID_CONTENTS,De)),b.ADD_FORBID_CONTENTS&&(En===rf&&(En=Rn(En)),Q(En,b.ADD_FORBID_CONTENTS,De)),nf&&(He["#text"]=!0),Xi&&Q(He,["html","head","body"]),He.table&&(Q(He,["tbody"]),delete Sl.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=b.TRUSTED_TYPES_POLICY,Y=O.createHTML("")}else O===void 0&&(O=U7(v,i)),O!==null&&typeof Y=="string"&&(Y=O.createHTML(""));ct&&ct(b),Ao=b}},m1=Q({},[...Qf,...e0,...I7]),g1=Q({},[...t0,...x7]),b_=function(b){let I=J(b);(!I||!I.tagName)&&(I={namespaceURI:_o,tagName:"template"});const N=nd(b.tagName),ye=nd(I.tagName);return af[b.namespaceURI]?b.namespaceURI===Qu?I.namespaceURI===or?N==="svg":I.namespaceURI===Xu?N==="svg"&&(ye==="annotation-xml"||eh[ye]):!!m1[N]:b.namespaceURI===Xu?I.namespaceURI===or?N==="math":I.namespaceURI===Qu?N==="math"&&th[ye]:!!g1[N]:b.namespaceURI===or?I.namespaceURI===Qu&&!th[ye]||I.namespaceURI===Xu&&!eh[ye]?!1:!g1[N]&&(g_[N]||!m1[N]):!!(Al==="application/xhtml+xml"&&af[b.namespaceURI]):!1},kn=function(b){Il(e.removed,{element:b});try{J(b).removeChild(b)}catch{x(b)}},Qi=function(b,I){try{Il(e.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Il(e.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(bo||Ju)try{kn(I)}catch{}else try{I.setAttribute(b,"")}catch{}},v1=function(b){let I=null,N=null;if(tf)b="<remove></remove>"+b;else{const Re=Xf(b,/^[\r\n\t ]+/);N=Re&&Re[0]}Al==="application/xhtml+xml"&&_o===or&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ye=O?O.createHTML(b):b;if(_o===or)try{I=new y().parseFromString(ye,Al)}catch{}if(!I||!I.documentElement){I=U.createDocument(_o,"template",null);try{I.documentElement.innerHTML=of?Y:ye}catch{}}const je=I.body||I.documentElement;return b&&N&&je.insertBefore(t.createTextNode(N),je.childNodes[0]||null),_o===or?de.call(I,Xi?"html":"body")[0]:Xi?I.documentElement:je},y1=function(b){return j.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},cf=function(b){return b instanceof g&&(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")},w1=function(b){return typeof l=="function"&&b instanceof l};function ar(F,b,I){yh(F,N=>{N.call(e,b,I,Ao)})}const b1=function(b){let I=null;if(ar(ve.beforeSanitizeElements,b,null),cf(b))return kn(b),!0;const N=De(b.nodeName);if(ar(ve.uponSanitizeElement,b,{tagName:N,allowedTags:He}),Yu&&b.hasChildNodes()&&!w1(b.firstElementChild)&&Qe(/<[/\w!]/g,b.innerHTML)&&Qe(/<[/\w!]/g,b.textContent)||b.nodeType===Dl.progressingInstruction||Yu&&b.nodeType===Dl.comment&&Qe(/<[/\w]/g,b.data))return kn(b),!0;if(!(Xr.tagCheck instanceof Function&&Xr.tagCheck(N))&&(!He[N]||Sl[N])){if(!Sl[N]&&_1(N)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N)))return!1;if(nf&&!En[N]){const ye=J(b)||b.parentNode,je=P(b)||b.childNodes;if(je&&ye){const Re=je.length;for(let dt=Re-1;dt>=0;--dt){const lr=E(je[dt],!0);lr.__removalCount=(b.__removalCount||0)+1,ye.insertBefore(lr,B(b))}}}return kn(b),!0}return b instanceof c&&!b_(b)||(N==="noscript"||N==="noembed"||N==="noframes")&&Qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(kn(b),!0):(wo&&b.nodeType===Dl.text&&(I=b.textContent,yh([Xe,Ze,le],ye=>{I=xl(I,ye," ")}),b.textContent!==I&&(Il(e.removed,{element:b.cloneNode()}),b.textContent=I)),ar(ve.afterSanitizeElements,b,null),!1)},S1=function(b,I,N){if(Gu[I]||c1&&(I==="id"||I==="name")&&(N in t||N in w_))return!1;if(!(Qp&&!Gu[I]&&Qe(sr,I))){if(!(o1&&Qe(Zt,I))){if(!(Xr.attributeCheck instanceof Function&&Xr.attributeCheck(I,b))){if(!Be[I]||Gu[I]){if(!(_1(b)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,b)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(b))&&(Te.attributeNameCheck instanceof RegExp&&Qe(Te.attributeNameCheck,I)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(I,b))||I==="is"&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N))))return!1}else if(!sf[I]){if(!Qe(r1,xl(N,bl,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&C7(N,"data:")===0&&h1[b])){if(!(a1&&!Qe(wl,xl(N,bl,"")))){if(N)return!1}}}}}}}return!0},_1=function(b){return b!=="annotation-xml"&&Xf(b,ju)},A1=function(b){ar(ve.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||cf(b))return;const N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0};let ye=I.length;for(;ye--;){const je=I[ye],{name:Re,namespaceURI:dt,value:lr}=je,Eo=De(Re),uf=lr;let qe=Re==="value"?uf:T7(uf);if(N.attrName=Eo,N.attrValue=qe,N.keepAttr=!0,N.forceKeepAttr=void 0,ar(ve.uponSanitizeAttribute,b,N),qe=N.attrValue,u1&&(Eo==="id"||Eo==="name")&&(Qi(Re,b),qe=f_+qe),Yu&&Qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qe)){Qi(Re,b);continue}if(Eo==="attributename"&&Xf(qe,"href")){Qi(Re,b);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){Qi(Re,b);continue}if(!l1&&Qe(/\/>/i,qe)){Qi(Re,b);continue}wo&&yh([Xe,Ze,le],k1=>{qe=xl(qe,k1," ")});const E1=De(b.nodeName);if(!S1(E1,Eo,qe)){Qi(Re,b);continue}if(O&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!dt)switch(v.getAttributeType(E1,Eo)){case"TrustedHTML":{qe=O.createHTML(qe);break}case"TrustedScriptURL":{qe=O.createScriptURL(qe);break}}if(qe!==uf)try{dt?b.setAttributeNS(dt,Re,qe):b.setAttribute(Re,qe),cf(b)?kn(b):vw(e.removed)}catch{Qi(Re,b)}}ar(ve.afterSanitizeAttributes,b,null)},S_=function F(b){let I=null;const N=y1(b);for(ar(ve.beforeSanitizeShadowDOM,b,null);I=N.nextNode();)ar(ve.uponSanitizeShadowNode,I,null),b1(I),A1(I),I.content instanceof o&&F(I.content);ar(ve.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(F){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,N=null,ye=null,je=null;if(of=!F,of&&(F="<!-->"),typeof F!="string"&&!w1(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw Pl("dirty is not a string, aborting")}else throw Pl("toString is not a function");if(!e.isSupported)return F;if(ef||lf(b),e.removed=[],typeof F=="string"&&(_l=!1),_l){if(F.nodeName){const lr=De(F.nodeName);if(!He[lr]||Sl[lr])throw Pl("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof l)I=v1("<!---->"),N=I.ownerDocument.importNode(F,!0),N.nodeType===Dl.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?I=N:I.appendChild(N);else{if(!bo&&!wo&&!Xi&&F.indexOf("<")===-1)return O&&Ku?O.createHTML(F):F;if(I=v1(F),!I)return bo?null:Ku?Y:""}I&&tf&&kn(I.firstChild);const Re=y1(_l?F:I);for(;ye=Re.nextNode();)b1(ye),A1(ye),ye.content instanceof o&&S_(ye.content);if(_l)return F;if(bo){if(Ju)for(je=fe.call(I.ownerDocument);I.firstChild;)je.appendChild(I.firstChild);else je=I;return(Be.shadowroot||Be.shadowrootmode)&&(je=Fe.call(r,je,!0)),je}let dt=Xi?I.outerHTML:I.innerHTML;return Xi&&He["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Qe(hS,I.ownerDocument.doctype.name)&&(dt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
391
+ `+dt),wo&&yh([Xe,Ze,le],lr=>{dt=xl(dt,lr," ")}),O&&Ku?O.createHTML(dt):dt},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf(F),ef=!0},e.clearConfig=function(){Ao=null,ef=!1},e.isValidAttribute=function(F,b,I){Ao||lf({});const N=De(F),ye=De(b);return S1(N,ye,I)},e.addHook=function(F,b){typeof b=="function"&&Il(ve[F],b)},e.removeHook=function(F,b){if(b!==void 0){const I=E7(ve[F],b);return I===-1?void 0:k7(ve[F],I,1)[0]}return vw(ve[F])},e.removeHooks=function(F){ve[F]=[]},e.removeAllHooks=function(){ve=Aw()},e}var pS=dS();function Fg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yo=Fg();function fS(n){yo=n}var cs={exec:()=>null};function ie(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(lt.caret,"$1"),t=t.replace(i,a),r},getRegex:()=>new RegExp(t,e)};return r}var V7=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),lt={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)}}>`)},F7=/^(?:[ \t]*(?:\n|$))+/,B7=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,q7=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W7=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bg=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,mS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gS=ie(mS).replace(/bull/g,Bg).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(),j7=ie(mS).replace(/bull/g,Bg).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(),qg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,G7=/^[^\n]+/,Wg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Y7=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),J7=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bg).getRegex(),Jp="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",jg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,K7=ie("^ {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",jg).replace("tag",Jp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vS=ie(qg).replace("hr",Wu).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",Jp).getRegex(),X7=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vS).getRegex(),Gg={blockquote:X7,code:B7,def:Y7,fences:q7,heading:W7,hr:Wu,html:K7,lheading:gS,list:J7,newline:F7,paragraph:vS,table:cs,text:G7},Ew=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Wu).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",Jp).getRegex(),Q7={...Gg,lheading:j7,table:Ew,paragraph:ie(qg).replace("hr",Wu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ew).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",Jp).getRegex()},eZ={...Gg,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jg).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:cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(qg).replace("hr",Wu).replace("heading",` *#{1,6} *[^
392
+ ]`).replace("lheading",gS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yS=/^( {2,}|\\)\n(?!\s*$)/,rZ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yl=/[\p{P}\p{S}]/u,Kp=/[\s\p{P}\p{S}]/u,Yg=/[^\s\p{P}\p{S}]/u,iZ=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),wS=/(?!~)[\p{P}\p{S}]/u,sZ=/(?!~)[\s\p{P}\p{S}]/u,oZ=/(?:[^\s\p{P}\p{S}]|~)/u,aZ=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",V7?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bS=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lZ=ie(bS,"u").replace(/punct/g,yl).getRegex(),cZ=ie(bS,"u").replace(/punct/g,wS).getRegex(),SS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uZ=ie(SS,"gu").replace(/notPunctSpace/g,Yg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),hZ=ie(SS,"gu").replace(/notPunctSpace/g,oZ).replace(/punctSpace/g,sZ).replace(/punct/g,wS).getRegex(),dZ=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),pZ=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yl).getRegex(),fZ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",mZ=ie(fZ,"gu").replace(/notPunctSpace/g,Yg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),gZ=ie(/\\(punct)/,"gu").replace(/punct/g,yl).getRegex(),vZ=ie(/^<(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=ie(jg).replace("(?:-->|$)","-->").getRegex(),wZ=ie("^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(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bZ=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_S=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",xd).replace("ref",Wg).getRegex(),AS=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wg).getRegex(),SZ=ie("reflink|nolink(?!\\()","g").replace("reflink",_S).replace("nolink",AS).getRegex(),kw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Jg={_backpedal:cs,anyPunctuation:gZ,autolink:vZ,blockSkip:aZ,br:yS,code:nZ,del:cs,delLDelim:cs,delRDelim:cs,emStrongLDelim:lZ,emStrongRDelimAst:uZ,emStrongRDelimUnd:dZ,escape:tZ,link:bZ,nolink:AS,punctuation:iZ,reflink:_S,reflinkSearch:SZ,tag:wZ,text:rZ,url:cs},_Z={...Jg,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},km={...Jg,emStrongRDelimAst:hZ,emStrongLDelim:cZ,delLDelim:pZ,delRDelim:mZ,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kw).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:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kw).getRegex()},AZ={...km,br:ie(yS).replace("{2,}","*").getRegex(),text:ie(km.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bh={normal:Gg,gfm:Q7,pedantic:eZ},Ml={normal:Jg,gfm:km,breaks:AZ,pedantic:_Z},EZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cw=n=>EZ[n];function In(n,e){if(e){if(lt.escapeTest.test(n))return n.replace(lt.escapeReplace,Cw)}else if(lt.escapeTestNoEncode.test(n))return n.replace(lt.escapeReplaceNoEncode,Cw);return n}function Tw(n){try{n=encodeURI(n).replace(lt.percentDecode,"%")}catch{return null}return n}function $w(n,e){var o;let t=n.replace(lt.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=t.split(lt.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.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(lt.slashPipe,"|");return r}function Ol(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 kZ(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 CZ(n,e=0){let t=e,r="";for(let i of n)if(i===" "){let o=4-t%4;r+=" ".repeat(o),t+=o}else r+=i,t++;return r}function Rw(n,e,t,r,i){let o=e.href,a=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:o,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function TZ(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
393
393
  `).map(o=>{let a=o.match(t.other.beginningSpace);if(a===null)return o;let[l]=a;return l.length>=i.length?o.slice(i.length):o}).join(`
394
394
  `)}var Pd=class{constructor(n){C(this,"options");C(this,"rules");C(this,"lexer");this.options=n||yo}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:Ol(t,`
395
- `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=gU(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=Ol(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:Ol(e[0],`
395
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=TZ(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=Ol(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:Ol(e[0],`
396
396
  `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Ol(e[0],`
397
397
  `).split(`
398
398
  `),r="",i="",o=[];for(;t.length>0;){let a=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),a=!0;else if(!a)l.push(t[c]);else break;t=t.slice(c);let d=l.join(`
@@ -404,16 +404,16 @@ ${f}`:f;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
404
404
  `),E=this.blockquote(_);o[o.length-1]=E,r=r.substring(0,r.length-v.raw.length)+E.raw,i=i.substring(0,i.length-v.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){let v=y,_=v.raw+`
405
405
  `+t.join(`
406
406
  `),E=this.list(_);o[o.length-1]=E,r=r.substring(0,r.length-y.raw.length)+E.raw,i=i.substring(0,i.length-v.raw.length)+E.raw,t=_.substring(o.at(-1).raw.length).split(`
407
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let i=e[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,g="",y="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;g=e[0],n=n.substring(g.length);let v=mU(e[2].split(`
407
+ `);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let i=e[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,g="",y="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;g=e[0],n=n.substring(g.length);let v=CZ(e[2].split(`
408
408
  `,1)[0],e[1].length),_=n.split(`
409
409
  `,1)[0],E=!v.trim(),x=0;if(this.options.pedantic?(x=2,y=v.trimStart()):E?x=e[1].length+1:(x=v.search(this.rules.other.nonSpaceChar),x=x>4?1:x,y=v.slice(x),x+=e[1].length),E&&this.rules.other.blankLine.test(_)&&(g+=_+`
410
- `,n=n.substring(_.length+1),f=!0),!f){let B=this.rules.other.nextBulletRegex(x),P=this.rules.other.hrRegex(x),J=this.rules.other.fencesBeginRegex(x),O=this.rules.other.headingBeginRegex(x),Y=this.rules.other.htmlBeginRegex(x),F=this.rules.other.blockquoteBeginRegex(x);for(;n;){let j=n.split(`
411
- `,1)[0],fe;if(_=j,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),fe=_):fe=_.replace(this.rules.other.tabCharGlobal," "),J.test(_)||O.test(_)||Y.test(_)||F.test(_)||B.test(_)||P.test(_))break;if(fe.search(this.rules.other.nonSpaceChar)>=x||!_.trim())y+=`
410
+ `,n=n.substring(_.length+1),f=!0),!f){let B=this.rules.other.nextBulletRegex(x),P=this.rules.other.hrRegex(x),J=this.rules.other.fencesBeginRegex(x),O=this.rules.other.headingBeginRegex(x),Y=this.rules.other.htmlBeginRegex(x),U=this.rules.other.blockquoteBeginRegex(x);for(;n;){let j=n.split(`
411
+ `,1)[0],fe;if(_=j,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),fe=_):fe=_.replace(this.rules.other.tabCharGlobal," "),J.test(_)||O.test(_)||Y.test(_)||U.test(_)||B.test(_)||P.test(_))break;if(fe.search(this.rules.other.nonSpaceChar)>=x||!_.trim())y+=`
412
412
  `+fe.slice(x);else{if(E||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(v)||O.test(v)||P.test(v))break;y+=`
413
413
  `+_}E=!_.trim(),g+=j+`
414
- `,n=n.substring(j.length+1),v=fe.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),a.raw+=g}let d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let f of a.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 y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(f.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};f.checked=y.checked,a.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=y.raw+f.tokens[0].raw,f.tokens[0].text=y.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(y)):f.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):f.tokens.unshift(y)}}if(!a.loose){let g=f.tokens.filter(v=>v.type==="space"),y=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=y}}if(a.loose)for(let f of a.items){f.loose=!0;for(let g of f.tokens)g.type==="text"&&(g.type="paragraph")}return a}}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 a;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Iw(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
415
- `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<t.length;l++)o.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(Iw(l,o.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[d]})));return o}}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)===`
416
- `?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 o=Ol(t.slice(0,-1),"\\");if((t.length-o.length)%2===0)return}else{let o=fU(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[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)),xw(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 o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return xw(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,o,a,l=i,c=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(r=d.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let f=[...r[0]][0].length,g=n.slice(0,i+r.index+f+a);if(Math.min(i,a)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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,o,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*n.length+i);(r=c.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(a=[...o].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let d=[...r[0]][0].length,f=n.slice(0,i+r.index+d+a),g=f.slice(i,-i);return{type:"del",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}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 o;do o=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(o!==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}}}},vn=class Tm{constructor(e){C(this,"tokens");C(this,"options");C(this,"state");C(this,"inlineQueue");C(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yo,this.options.tokenizer=this.options.tokenizer||new Pd,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:lt,block:bh.normal,inline:Ml.normal};this.options.pedantic?(t.block=bh.pedantic,t.inline=Ml.pedantic):this.options.gfm&&(t.block=bh.gfm,this.options.breaks?t.inline=Ml.breaks:t.inline=Ml.gfm),this.tokenizer.rules=t}static get rules(){return{block:bh,inline:Ml}}static lex(e,t){return new Tm(t).lex(e)}static lexInline(e,t){return new Tm(t).inlineTokens(e)}lex(e){e=e.replace(lt.carriageReturn,`
414
+ `,n=n.substring(j.length+1),v=fe.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),a.raw+=g}let d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let f of a.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 y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(f.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};f.checked=y.checked,a.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=y.raw+f.tokens[0].raw,f.tokens[0].text=y.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(y)):f.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):f.tokens.unshift(y)}}if(!a.loose){let g=f.tokens.filter(v=>v.type==="space"),y=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=y}}if(a.loose)for(let f of a.items){f.loose=!0;for(let g of f.tokens)g.type==="text"&&(g.type="paragraph")}return a}}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 a;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=$w(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
415
+ `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<t.length;l++)o.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push($w(l,o.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[d]})));return o}}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)===`
416
+ `?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 o=Ol(t.slice(0,-1),"\\");if((t.length-o.length)%2===0)return}else{let o=kZ(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[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)),Rw(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 o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return Rw(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,o,a,l=i,c=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(r=d.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let f=[...r[0]][0].length,g=n.slice(0,i+r.index+f+a);if(Math.min(i,a)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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,o,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*n.length+i);(r=c.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(a=[...o].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let d=[...r[0]][0].length,f=n.slice(0,i+r.index+d+a),g=f.slice(i,-i);return{type:"del",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}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 o;do o=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(o!==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}}}},vn=class Cm{constructor(e){C(this,"tokens");C(this,"options");C(this,"state");C(this,"inlineQueue");C(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yo,this.options.tokenizer=this.options.tokenizer||new Pd,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:lt,block:bh.normal,inline:Ml.normal};this.options.pedantic?(t.block=bh.pedantic,t.inline=Ml.pedantic):this.options.gfm&&(t.block=bh.gfm,this.options.breaks?t.inline=Ml.breaks:t.inline=Ml.gfm),this.tokenizer.rules=t}static get rules(){return{block:bh,inline:Ml}}static lex(e,t){return new Cm(t).lex(e)}static lexInline(e,t){return new Cm(t).inlineTokens(e)}lex(e){e=e.replace(lt.carriageReturn,`
417
417
  `),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,o,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(lt.tabCharGlobal," ").replace(lt.spaceLine,""));e;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(d=>(l=d.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 d=t.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
418
418
  `:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
419
419
  `)?"":`
@@ -427,7 +427,7 @@ ${f}`:f;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
427
427
  `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.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 d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
428
428
  `)?"":`
429
429
  `)+l.raw,d.text+=`
430
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,d,f,g,y;this.tokenizer.lexer=this;let r=e,i=null;if(this.tokens.links){let v=Object.keys(this.tokens.links);if(v.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)v.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 o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((d=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let v;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(E=>(v=E.call({lexer:this},e,t))?(e=e.substring(v.raw.length),t.push(v),!0):!1))continue;if(v=this.tokenizer.escape(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.tag(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.link(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(v.raw.length);let E=t.at(-1);v.type==="text"&&(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(v=this.tokenizer.emStrong(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.codespan(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.br(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.del(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.autolink(e)){e=e.substring(v.raw.length),t.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(e))){e=e.substring(v.raw.length),t.push(v);continue}let _=e;if((y=this.options.extensions)!=null&&y.startInline){let E=1/0,x=e.slice(1),B;this.options.extensions.startInline.forEach(P=>{B=P.call({lexer:this},x),typeof B=="number"&&B>=0&&(E=Math.min(E,B))}),E<1/0&&E>=0&&(_=e.substring(0,E+1))}if(v=this.tokenizer.inlineText(_)){e=e.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(l=v.raw.slice(-1)),a=!0;let E=t.at(-1);(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(e){let E="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(E);break}else throw new Error(E)}}return t}},Dd=class{constructor(n){C(this,"options");C(this,"parser");this.options=n||yo}space(n){return""}code({text:n,lang:e,escaped:t}){var o;let r=(o=(e||"").match(lt.notSpaceStart))==null?void 0:o[0],i=n.replace(lt.endingNewline,"")+`
430
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,d,f,g,y;this.tokenizer.lexer=this;let r=e,i=null;if(this.tokens.links){let v=Object.keys(this.tokens.links);if(v.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)v.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 o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((d=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let v;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(E=>(v=E.call({lexer:this},e,t))?(e=e.substring(v.raw.length),t.push(v),!0):!1))continue;if(v=this.tokenizer.escape(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.tag(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.link(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(v.raw.length);let E=t.at(-1);v.type==="text"&&(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(v=this.tokenizer.emStrong(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.codespan(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.br(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.del(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.autolink(e)){e=e.substring(v.raw.length),t.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(e))){e=e.substring(v.raw.length),t.push(v);continue}let _=e;if((y=this.options.extensions)!=null&&y.startInline){let E=1/0,x=e.slice(1),B;this.options.extensions.startInline.forEach(P=>{B=P.call({lexer:this},x),typeof B=="number"&&B>=0&&(E=Math.min(E,B))}),E<1/0&&E>=0&&(_=e.substring(0,E+1))}if(v=this.tokenizer.inlineText(_)){e=e.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(l=v.raw.slice(-1)),a=!0;let E=t.at(-1);(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(e){let E="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(E);break}else throw new Error(E)}}return t}},Ld=class{constructor(n){C(this,"options");C(this,"parser");this.options=n||yo}space(n){return""}code({text:n,lang:e,escaped:t}){var o;let r=(o=(e||"").match(lt.notSpaceStart))==null?void 0:o[0],i=n.replace(lt.endingNewline,"")+`
431
431
  `;return r?'<pre><code class="language-'+In(r)+'">'+(t?i:In(i,!0))+`</code></pre>
432
432
  `:"<pre><code>"+(t?i:In(i,!0))+`</code></pre>
433
433
  `}blockquote({tokens:n}){return`<blockquote>
@@ -445,17 +445,17 @@ ${this.parser.parse(n)}</blockquote>
445
445
  `}tablerow({text:n}){return`<tr>
446
446
  ${n}</tr>
447
447
  `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
448
- `}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>${In(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=Rw(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return e&&(o+=' title="'+In(e)+'"'),o+=">"+r+"</a>",o}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let i=Rw(n);if(i===null)return In(t);n=i;let o=`<img src="${n}" alt="${In(t)}"`;return e&&(o+=` title="${In(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:In(n.text)}},Xg=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}},yn=class $m{constructor(e){C(this,"options");C(this,"renderer");C(this,"textRenderer");this.options=e||yo,this.options.renderer=this.options.renderer||new Dd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xg}static parse(e,t){return new $m(t).parse(e)}static parseInline(e,t){return new $m(t).parseInline(e)}parse(e){var r,i;this.renderer.parser=this;let t="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=d||"";continue}}let l=a;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,o;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let l=e[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=d||"";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 d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},Eh,ec=(Eh=class{constructor(n){C(this,"options");C(this,"block");this.options=n||yo}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?vn.lex:vn.lexInline}provideParser(){return this.block?yn.parse:yn.parseInline}},C(Eh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(Eh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Eh),vU=class{constructor(...n){C(this,"defaults",Bg());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",yn);C(this,"Renderer",Dd);C(this,"TextRenderer",Xg);C(this,"Lexer",vn);C(this,"Tokenizer",Pd);C(this,"Hooks",ec);this.use(...n)}walkTokens(n,e){var r,i;let t=[];for(let o of n)switch(t=t.concat(e.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let c of l)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let a=o;t=t.concat(this.walkTokens(a.items,e));break}default:{let a=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);t=t.concat(this.walkTokens(c,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.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 o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),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 o=e[i.level];o?o.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 Dd(this.defaults);for(let o in t.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=t.renderer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f||""}}r.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Pd(this.defaults);for(let o in t.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=t.tokenizer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new ec;for(let o in t.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=t.hooks[a],c=i[a];ec.passThroughHooks.has(o)?i[a]=d=>{if(this.defaults.async&&ec.passThroughHooksRespectAsync.has(o))return(async()=>{let g=await l.call(i,d);return c.call(i,g)})();let f=l.call(i,d);return c.call(i,f)}:i[a]=(...d)=>{if(this.defaults.async)return(async()=>{let g=await l.apply(i,d);return g===!1&&(g=await c.apply(i,d)),g})();let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,o=t.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return vn.lex(n,e??this.defaults)}parser(n,e){return yn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(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 a=i.hooks?await i.hooks.preprocess(e):e,l=await(i.hooks?await i.hooks.provideLexer():n?vn.lex:vn.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser():n?yn.parse:yn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer():n?vn.lex:vn.lexInline)(e,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?yn.parse:yn.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(n,e){return t=>{if(t.message+=`
449
- Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+In(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},fo=new vU;function he(n,e){return fo.parse(n,e)}he.options=he.setOptions=function(n){return fo.setOptions(n),he.defaults=fo.defaults,fS(he.defaults),he};he.getDefaults=Bg;he.defaults=yo;he.use=function(...n){return fo.use(...n),he.defaults=fo.defaults,fS(he.defaults),he};he.walkTokens=function(n,e){return fo.walkTokens(n,e)};he.parseInline=fo.parseInline;he.Parser=yn;he.parser=yn.parse;he.Renderer=Dd;he.TextRenderer=Xg;he.Lexer=vn;he.lexer=vn.lex;he.Tokenizer=Pd;he.Hooks=ec;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;yn.parse;vn.lex;pS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function ES(n){const e=he.parse(n,{async:!1});return pS.sanitize(e,{USE_PROFILES:{html:!0}})}const Pw={restart_to_update:"Restart to update",restarting:"Restarting…"};var qs,du,fn,Jd,kS,Da,Kd;class yU extends Nt{constructor(){super(...arguments);p(this,Jd);p(this,qs,null);p(this,du,wn());p(this,fn,null);p(this,Da,()=>{this.render()});p(this,Kd,()=>{var t;(t=s(this,fn))==null||t.restart()})}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||s(this,qs)!==null)return;const t=((r=s(this,du).value)==null?void 0:r.querySelector("dialog"))??null;if(t===null)throw new Error("Desktop upgrade gate requires its composed dialog");h(this,qs,Yp(t,()=>{}))})}disconnected(){var t,r;(t=s(this,qs))==null||t.withdraw(),h(this,qs,null),(r=s(this,fn))==null||r.removeEventListener("change",s(this,Da)),h(this,fn,null)}template(t,r){var a,l;u(this,Jd,kS).call(this,r??null);const i=((a=s(this,fn))==null?void 0:a.version)??null,o=((l=s(this,fn))==null?void 0:l.restarting)??!1;return M`
448
+ `}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>${In(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=Tw(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return e&&(o+=' title="'+In(e)+'"'),o+=">"+r+"</a>",o}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let i=Tw(n);if(i===null)return In(t);n=i;let o=`<img src="${n}" alt="${In(t)}"`;return e&&(o+=` title="${In(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:In(n.text)}},Kg=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}},yn=class Tm{constructor(e){C(this,"options");C(this,"renderer");C(this,"textRenderer");this.options=e||yo,this.options.renderer=this.options.renderer||new Ld,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kg}static parse(e,t){return new Tm(t).parse(e)}static parseInline(e,t){return new Tm(t).parseInline(e)}parse(e){var r,i;this.renderer.parser=this;let t="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=d||"";continue}}let l=a;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,o;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let l=e[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=d||"";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 d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},Eh,ec=(Eh=class{constructor(n){C(this,"options");C(this,"block");this.options=n||yo}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?vn.lex:vn.lexInline}provideParser(){return this.block?yn.parse:yn.parseInline}},C(Eh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(Eh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Eh),$Z=class{constructor(...n){C(this,"defaults",Fg());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",yn);C(this,"Renderer",Ld);C(this,"TextRenderer",Kg);C(this,"Lexer",vn);C(this,"Tokenizer",Pd);C(this,"Hooks",ec);this.use(...n)}walkTokens(n,e){var r,i;let t=[];for(let o of n)switch(t=t.concat(e.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let c of l)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let a=o;t=t.concat(this.walkTokens(a.items,e));break}default:{let a=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);t=t.concat(this.walkTokens(c,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.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 o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),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 o=e[i.level];o?o.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 Ld(this.defaults);for(let o in t.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=t.renderer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f||""}}r.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Pd(this.defaults);for(let o in t.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=t.tokenizer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new ec;for(let o in t.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=t.hooks[a],c=i[a];ec.passThroughHooks.has(o)?i[a]=d=>{if(this.defaults.async&&ec.passThroughHooksRespectAsync.has(o))return(async()=>{let g=await l.call(i,d);return c.call(i,g)})();let f=l.call(i,d);return c.call(i,f)}:i[a]=(...d)=>{if(this.defaults.async)return(async()=>{let g=await l.apply(i,d);return g===!1&&(g=await c.apply(i,d)),g})();let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,o=t.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return vn.lex(n,e??this.defaults)}parser(n,e){return yn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(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 a=i.hooks?await i.hooks.preprocess(e):e,l=await(i.hooks?await i.hooks.provideLexer():n?vn.lex:vn.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser():n?yn.parse:yn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer():n?vn.lex:vn.lexInline)(e,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?yn.parse:yn.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(n,e){return t=>{if(t.message+=`
449
+ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+In(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},fo=new $Z;function he(n,e){return fo.parse(n,e)}he.options=he.setOptions=function(n){return fo.setOptions(n),he.defaults=fo.defaults,fS(he.defaults),he};he.getDefaults=Fg;he.defaults=yo;he.use=function(...n){return fo.use(...n),he.defaults=fo.defaults,fS(he.defaults),he};he.walkTokens=function(n,e){return fo.walkTokens(n,e)};he.parseInline=fo.parseInline;he.Parser=yn;he.parser=yn.parse;he.Renderer=Ld;he.TextRenderer=Kg;he.Lexer=vn;he.lexer=vn.lex;he.Tokenizer=Pd;he.Hooks=ec;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;yn.parse;vn.lex;pS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function ES(n){const e=he.parse(n,{async:!1});return pS.sanitize(e,{USE_PROFILES:{html:!0}})}const Iw={restart_to_update:"Restart to update",restarting:"Restarting…"};var qs,du,fn,Jd,kS,La,Kd;class RZ extends Nt{constructor(){super(...arguments);p(this,Jd);p(this,qs,null);p(this,du,wn());p(this,fn,null);p(this,La,()=>{this.render()});p(this,Kd,()=>{var t;(t=s(this,fn))==null||t.restart()})}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||s(this,qs)!==null)return;const t=((r=s(this,du).value)==null?void 0:r.querySelector("dialog"))??null;if(t===null)throw new Error("Desktop upgrade gate requires its composed dialog");h(this,qs,Yp(t,()=>{}))})}disconnected(){var t,r;(t=s(this,qs))==null||t.withdraw(),h(this,qs,null),(r=s(this,fn))==null||r.removeEventListener("change",s(this,La)),h(this,fn,null)}template(t,r){var a,l;u(this,Jd,kS).call(this,r??null);const i=((a=s(this,fn))==null?void 0:a.version)??null,o=((l=s(this,fn))==null?void 0:l.restarting)??!1;return M`
450
450
  <div class="desktop-upgrade-gate" ${Je(s(this,du))}>
451
- ${Gp(M`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${lS(ES(q8(t,i!==null)))}</div>${i===null?te:M`<div class="upgrade-gate-actions"><button
451
+ ${Gp(M`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${lS(ES(qb(t,i!==null)))}</div>${i===null?te:M`<div class="upgrade-gate-actions"><button
452
452
  intent="primary"
453
453
  class="upgrade-gate-restart"
454
454
  ?disabled=${o}
455
455
  @click=${s(this,Kd)}
456
- >${o?Pw.restarting:Pw.restart_to_update}</button></div>`}`)}
456
+ >${o?Iw.restarting:Iw.restart_to_update}</button></div>`}`)}
457
457
  </div>
458
- `}}qs=new WeakMap,du=new WeakMap,fn=new WeakMap,Jd=new WeakSet,kS=function(t){var r;t!==s(this,fn)&&((r=s(this,fn))==null||r.removeEventListener("change",s(this,Da)),h(this,fn,t),t==null||t.addEventListener("change",s(this,Da)),t==null||t.subscribe())},Da=new WeakMap,Kd=new WeakMap;const wU=zt(yU),bU=250,SU=1e3;var Gn,Yn,Ws,$i,js,La,An,CS,Xd,Qd,TS,Rm,$S;class _U extends Nt{constructor(){super(...arguments);p(this,An);p(this,Gn,EU());p(this,Yn,null);p(this,Ws,!1);p(this,$i,null);p(this,js,"");p(this,La,null);p(this,Xd,t=>{h(this,js,t.currentTarget.value)});p(this,Qd,t=>{t.preventDefault();const r=s(this,js).trim();r.length===0||s(this,La)===null||s(this,La).authenticate(r)})}disconnected(){var t;u(this,An,Rm).call(this),(t=s(this,Yn))==null||t.withdraw(),h(this,Yn,null),h(this,Ws,!1),Vh(null,s(this,Gn))}template(t,r,i){var o;return h(this,La,r),u(this,An,TS).call(this,t),t.kind==="needs-upgrade"?((o=s(this,Yn))==null||o.withdraw(),h(this,Yn,null),Vh(wU(t.instructions,i),s(this,Gn)),s(this,Gn)):(Vh(Gp(u(this,An,CS).call(this,t)),s(this,Gn)),u(this,An,$S).call(this),s(this,Gn))}}Gn=new WeakMap,Yn=new WeakMap,Ws=new WeakMap,$i=new WeakMap,js=new WeakMap,La=new WeakMap,An=new WeakSet,CS=function(t){switch(t.kind){case"connecting":return M`
458
+ `}}qs=new WeakMap,du=new WeakMap,fn=new WeakMap,Jd=new WeakSet,kS=function(t){var r;t!==s(this,fn)&&((r=s(this,fn))==null||r.removeEventListener("change",s(this,La)),h(this,fn,t),t==null||t.addEventListener("change",s(this,La)),t==null||t.subscribe())},La=new WeakMap,Kd=new WeakMap;const IZ=zt(RZ),xZ=250,PZ=1e3;var Gn,Yn,Ws,$i,js,Da,An,CS,Xd,Qd,TS,$m,$S;class LZ extends Nt{constructor(){super(...arguments);p(this,An);p(this,Gn,MZ());p(this,Yn,null);p(this,Ws,!1);p(this,$i,null);p(this,js,"");p(this,Da,null);p(this,Xd,t=>{h(this,js,t.currentTarget.value)});p(this,Qd,t=>{t.preventDefault();const r=s(this,js).trim();r.length===0||s(this,Da)===null||s(this,Da).authenticate(r)})}disconnected(){var t;u(this,An,$m).call(this),(t=s(this,Yn))==null||t.withdraw(),h(this,Yn,null),h(this,Ws,!1),Fh(null,s(this,Gn))}template(t,r,i){var o;return h(this,Da,r),u(this,An,TS).call(this,t),t.kind==="needs-upgrade"?((o=s(this,Yn))==null||o.withdraw(),h(this,Yn,null),Fh(IZ(t.instructions,i),s(this,Gn)),s(this,Gn)):(Fh(Gp(u(this,An,CS).call(this,t)),s(this,Gn)),u(this,An,$S).call(this),s(this,Gn))}}Gn=new WeakMap,Yn=new WeakMap,Ws=new WeakMap,$i=new WeakMap,js=new WeakMap,Da=new WeakMap,An=new WeakSet,CS=function(t){switch(t.kind){case"connecting":return M`
459
459
  <div class="system-modal" role="status" aria-live="polite">
460
460
  <tv-icon name="spinner" size="xl" spinning></tv-icon>
461
461
  <h2>Connecting</h2>
@@ -464,7 +464,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
464
464
  <div class="system-modal" role="status" aria-live="polite">
465
465
  <tv-icon name="spinner" size="xl" spinning></tv-icon>
466
466
  <h2>Disconnected</h2>
467
- <p>${kU(t.nextRetryAt)}</p>
467
+ <p>${OZ(t.nextRetryAt)}</p>
468
468
  </div>
469
469
  `;case"unauthorized":{const r=!!t.invalid;return r&&h(this,js,""),M`
470
470
  <form class="system-modal auth-form" @submit=${s(this,Qd)}>
@@ -497,7 +497,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
497
497
  <p class="server-url">${t.serverURL}</p>
498
498
  <p>${t.message}</p>
499
499
  </div>
500
- `}},Xd=new WeakMap,Qd=new WeakMap,TS=function(t){const r=t.kind==="disconnected"&&t.nextRetryAt!==null;r&&s(this,$i)===null?h(this,$i,setInterval(()=>this.render(),bU)):r||u(this,An,Rm).call(this)},Rm=function(){s(this,$i)!==null&&(clearInterval(s(this,$i)),h(this,$i,null))},$S=function(){s(this,Yn)!==null||s(this,Ws)||(h(this,Ws,!0),queueMicrotask(()=>{if(h(this,Ws,!1),!this.isConnected||!s(this,Gn).isConnected||s(this,Yn)!==null)return;const t=s(this,Gn).querySelector("dialog");t!==null&&h(this,Yn,Yp(t,()=>{}))}))};const AU=zt(_U);function EU(){const n=document.createElement("section");return n.className="system-modal-host",n}function kU(n){if(n===null)return"Reattempting now…";const e=n-Date.now();return e<=0?"Reattempting now…":`Reattempting in ${Math.ceil(e/SU)}s…`}const CU=1400,Sh=new WeakMap;function TU(n,e){var o;const t=e.ownerDocument,r=(o=t.defaultView)==null?void 0:o.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 $U={writeClipboard:TU,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function RU(n,e,t){const r=n.currentTarget;if(!r)return;e.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,o=i!=null&&i.classList.contains("copy-button-status")?i:null;o&&(o.textContent="",o.textContent="Copied");const a=Sh.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:e.scheduler};l.handle=e.scheduler.setTimeout(()=>{Sh.get(r)===l&&(Sh.delete(r),r.toggleAttribute("copied",!1),o&&(o.textContent=""))},CU),Sh.set(r,l),t()}function RS({label:n,prompt:e="",intent:t,copied:r=!1,onActivate:i=()=>{}},o=$U){return M`
500
+ `}},Xd=new WeakMap,Qd=new WeakMap,TS=function(t){const r=t.kind==="disconnected"&&t.nextRetryAt!==null;r&&s(this,$i)===null?h(this,$i,setInterval(()=>this.render(),xZ)):r||u(this,An,$m).call(this)},$m=function(){s(this,$i)!==null&&(clearInterval(s(this,$i)),h(this,$i,null))},$S=function(){s(this,Yn)!==null||s(this,Ws)||(h(this,Ws,!0),queueMicrotask(()=>{if(h(this,Ws,!1),!this.isConnected||!s(this,Gn).isConnected||s(this,Yn)!==null)return;const t=s(this,Gn).querySelector("dialog");t!==null&&h(this,Yn,Yp(t,()=>{}))}))};const DZ=zt(LZ);function MZ(){const n=document.createElement("section");return n.className="system-modal-host",n}function OZ(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,Sh=new WeakMap;function zZ(n,e){var o;const t=e.ownerDocument,r=(o=t.defaultView)==null?void 0:o.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 ZZ={writeClipboard:zZ,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function HZ(n,e,t){const r=n.currentTarget;if(!r)return;e.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,o=i!=null&&i.classList.contains("copy-button-status")?i:null;o&&(o.textContent="",o.textContent="Copied");const a=Sh.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:e.scheduler};l.handle=e.scheduler.setTimeout(()=>{Sh.get(r)===l&&(Sh.delete(r),r.toggleAttribute("copied",!1),o&&(o.textContent=""))},NZ),Sh.set(r,l),t()}function RS({label:n,prompt:e="",intent:t,copied:r=!1,onActivate:i=()=>{}},o=ZZ){return M`
501
501
  <button
502
502
  class="copy-button"
503
503
  size="sm"
@@ -505,7 +505,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
505
505
  intent=${t??te}
506
506
  ?copied=${r}
507
507
  prompt=${e}
508
- @click=${a=>RU(a,o,i)}
508
+ @click=${a=>HZ(a,o,i)}
509
509
  >
510
510
  <span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
511
511
  <span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
@@ -516,7 +516,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
516
516
  aria-live="polite"
517
517
  >${r?"Copied":te}</span
518
518
  >
519
- `}const IS="1.4.0",IU="tv-desktop-upgrade-recommendation-dismissed",xU=`### Recommended desktop upgrade available
519
+ `}const IS="1.4.0",UZ="tv-desktop-upgrade-recommendation-dismissed",VZ=`### Recommended desktop upgrade available
520
520
 
521
521
  The Television desktop app is now a downloaded Mac app that updates itself. This copy was installed with npm and receives no more updates.
522
522
 
@@ -526,7 +526,7 @@ To move to the downloaded app on an Apple Silicon Mac:
526
526
  2. Open the downloaded disk image and drag Television to Applications.
527
527
  3. Quit this app, then open Television from Applications. It keeps your saved server connection.
528
528
 
529
- From then on, open Television from Applications, not with \`tv-desktop\`.`;function PU(n){var e;return!n.electron||n.noticesSuppressed||((e=n.updateState)==null?void 0:e.toast)!=null||n.shellVersion===null||!Op(n.shellVersion)||n.shellVersion===vd?!1:Cg(IS,n.shellVersion)}var Ma;class xS extends HTMLElement{constructor(){super(...arguments);p(this,Ma,new Zg(this))}connectedCallback(){s(this,Ma).connect()}disconnectedCallback(){s(this,Ma).disconnect()}attributeChangedCallback(){s(this,Ma).refresh()}}Ma=new WeakMap,C(xS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",xS);const DU="tv-update-dismissed",Ro={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},LU="update-popover";function MU(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)}var Oa,Pr,Na,pu,fu,ep;class OU extends Nt{constructor(){super(...arguments);p(this,Oa);p(this,Pr);p(this,Na,!1);p(this,pu,()=>{});p(this,fu,()=>{});p(this,ep,t=>{var r;(r=s(this,Pr))==null||r.disconnect(),h(this,Pr,void 0),h(this,Oa,t),h(this,Na,(t==null?void 0:t.hasAttribute("open"))??!1),t&&(h(this,Pr,new MutationObserver(()=>{const i=t.hasAttribute("open");i!==s(this,Na)&&(h(this,Na,i),i?s(this,pu).call(this):s(this,fu).call(this))})),s(this,Pr).observe(t,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var t;(t=s(this,Pr))==null||t.disconnect(),h(this,Pr,void 0),h(this,Oa,void 0)}template({body:t,prompt:r,copied:i=!1,restart:o,panelRef:a,bellRef:l,onPresent:c=()=>{},onDismiss:d=()=>{},onCopy:f=()=>{},onRestart:g=()=>{}}){h(this,pu,c),h(this,fu,d);const y=()=>{var _;(_=s(this,Oa))==null||_.removeAttribute("open")},v=_=>{const E=_.currentTarget;_.key!=="Escape"||!MU(_,E)||(_.preventDefault(),_.stopPropagation(),E.removeAttribute("open"))};return M`
529
+ From then on, open Television from Applications, not with \`tv-desktop\`.`;function FZ(n){var e;return!n.electron||n.noticesSuppressed||((e=n.updateState)==null?void 0:e.toast)!=null||n.shellVersion===null||!Op(n.shellVersion)||n.shellVersion===vd?!1:kg(IS,n.shellVersion)}var Ma;class xS extends HTMLElement{constructor(){super(...arguments);p(this,Ma,new Zg(this))}connectedCallback(){s(this,Ma).connect()}disconnectedCallback(){s(this,Ma).disconnect()}attributeChangedCallback(){s(this,Ma).refresh()}}Ma=new WeakMap,C(xS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",xS);const BZ="tv-update-dismissed",Ro={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},qZ="update-popover";function WZ(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)}var Oa,Pr,Na,pu,fu,ep;class jZ extends Nt{constructor(){super(...arguments);p(this,Oa);p(this,Pr);p(this,Na,!1);p(this,pu,()=>{});p(this,fu,()=>{});p(this,ep,t=>{var r;(r=s(this,Pr))==null||r.disconnect(),h(this,Pr,void 0),h(this,Oa,t),h(this,Na,(t==null?void 0:t.hasAttribute("open"))??!1),t&&(h(this,Pr,new MutationObserver(()=>{const i=t.hasAttribute("open");i!==s(this,Na)&&(h(this,Na,i),i?s(this,pu).call(this):s(this,fu).call(this))})),s(this,Pr).observe(t,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var t;(t=s(this,Pr))==null||t.disconnect(),h(this,Pr,void 0),h(this,Oa,void 0)}template({body:t,prompt:r,copied:i=!1,restart:o,panelRef:a,bellRef:l,onPresent:c=()=>{},onDismiss:d=()=>{},onCopy:f=()=>{},onRestart:g=()=>{}}){h(this,pu,c),h(this,fu,d);const y=()=>{var _;(_=s(this,Oa))==null||_.removeAttribute("open")},v=_=>{const E=_.currentTarget;_.key!=="Escape"||!WZ(_,E)||(_.preventDefault(),_.stopPropagation(),E.removeAttribute("open"))};return M`
530
530
  <button
531
531
  class="update-bell"
532
532
  id="update-bell"
@@ -540,7 +540,7 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
540
540
  </button>
541
541
 
542
542
  <tv-popover
543
- id=${LU}
543
+ id=${qZ}
544
544
  manual
545
545
  trigger="update-bell"
546
546
  role="status"
@@ -564,21 +564,21 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
564
564
  >${o==="restarting"?Ro.restarting:Ro.restart_to_update}</button>`}
565
565
  </div>
566
566
  </tv-popover>
567
- `}}Oa=new WeakMap,Pr=new WeakMap,Na=new WeakMap,pu=new WeakMap,fu=new WeakMap,ep=new WeakMap;const NU=zt(OU);function zU(n,e){return e===null?!0:Cg(n,e)}const Dw=new Set;var Gt,Pt,mu,Dt,gu,za,Jn,Gs,Ys,Js,Ua,Ye,Dr,Ks,Za,Fa,Xs,Ri,q,Im,xm,Pm,Dm,Lm,Mm,Om,Qs,eo,rd,tc,Nm,PS,zm,Um,Zm,tp,np,rp,ip,sp,op,nc,DS;class UU{constructor(e=()=>{}){p(this,q);p(this,Gt,null);p(this,Pt,null);p(this,mu,null);p(this,Dt,null);p(this,gu,"");p(this,za);p(this,Jn,!1);p(this,Gs,!1);p(this,Ys,!1);p(this,Js,!1);p(this,Ua,null);p(this,Ye,!1);p(this,Dr,!1);p(this,Ks,null);p(this,Za,null);p(this,Fa,!1);p(this,Xs,[]);p(this,Ri);p(this,Qs,()=>{s(this,Ri).call(this)});p(this,eo,()=>{u(this,q,Zm).call(this),s(this,Ri).call(this)});p(this,tp,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e===null||s(this,Ye)||(h(this,Ye,!0),e.kind==="server"&&u(this,q,zm).call(this,e.toast),s(this,Ri).call(this))});p(this,np,()=>{var t,r;if(!s(this,Ye))return;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e!==null&&((r=u(this,q,Im).call(this))==null||r.setItem(u(this,q,Nm).call(this,e),e.version)),h(this,Ye,!1),h(this,Dr,!0),s(this,Ri).call(this)});p(this,rp,()=>{var e;(e=s(this,Dt))==null||e.restart()});p(this,ip,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);(e==null?void 0:e.kind)!=="server"||e.prompt===void 0||u(this,q,Um).call(this,"update_prompt_copy_clicked",e.toast)});p(this,sp,e=>{h(this,Ks,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});p(this,op,e=>{h(this,Za,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});h(this,Ri,e)}get presented(){return s(this,Ye)}configure({connectionOwner:e=null,primaryServerURL:t="",presentation:r=null,dismissalStorage:i,desktopRecommendation:o=null,desktopUpdate:a=null}){e!==s(this,Gt)&&(u(this,q,Pm).call(this),h(this,Gt,e),u(this,q,xm).call(this)),r!==s(this,Pt)&&(u(this,q,Lm).call(this),h(this,Pt,r),u(this,q,Dm).call(this)),a!==s(this,Dt)&&(u(this,q,Om).call(this),h(this,Dt,a),u(this,q,Mm).call(this)),h(this,gu,t),h(this,za,i),h(this,mu,o)}connect(){s(this,Jn)||(h(this,Jn,!0),u(this,q,xm).call(this),u(this,q,Dm).call(this),u(this,q,Mm).call(this))}disconnect(){s(this,Jn)&&(u(this,q,Pm).call(this),u(this,q,Lm).call(this),u(this,q,Om).call(this),h(this,Jn,!1),h(this,Ks,null),h(this,Za,null))}template(){var l,c,d;const e=((l=s(this,Pt))==null?void 0:l.toastsSuppressed)??!1,t=u(this,q,tc).call(this,e),r=t===null?null:`${t.kind}:${t.version}`;if(t===null?(h(this,Ua,null),h(this,Ye,!1),h(this,Dr,!0)):r!==s(this,Ua)&&(h(this,Ua,r),h(this,Ye,u(this,q,PS).call(this,t)),h(this,Dr,!0),s(this,Ye)&&t.kind==="server"&&!e&&u(this,q,zm).call(this,t.toast)),t===null||e)return h(this,Ye,!1),h(this,Dr,!0),u(this,q,nc).call(this),te;const i=(c=s(this,Ks))==null?void 0:c.querySelector(".copy-button"),o=s(this,Ye)&&!s(this,Dr)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=NU({body:lS(ES(t.markdown)),prompt:t.kind==="server"?t.prompt:void 0,copied:o,restart:t.kind!=="desktop-self-update"?void 0:(d=s(this,Dt))!=null&&d.restarting?"restarting":"ready",presented:s(this,Ye),panelRef:s(this,sp),bellRef:s(this,op),onPresent:s(this,tp),onDismiss:s(this,np),onCopy:s(this,ip),onRestart:s(this,rp)});return h(this,Dr,!1),u(this,q,nc).call(this),a}}Gt=new WeakMap,Pt=new WeakMap,mu=new WeakMap,Dt=new WeakMap,gu=new WeakMap,za=new WeakMap,Jn=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,Js=new WeakMap,Ua=new WeakMap,Ye=new WeakMap,Dr=new WeakMap,Ks=new WeakMap,Za=new WeakMap,Fa=new WeakMap,Xs=new WeakMap,Ri=new WeakMap,q=new WeakSet,Im=function(){return s(this,za)!==void 0?s(this,za):typeof localStorage>"u"?null:localStorage},xm=function(){!s(this,Jn)||s(this,Gs)||s(this,Gt)===null||(s(this,Gt).addEventListener("server-status",s(this,eo)),s(this,Gt).addEventListener("change",s(this,eo)),h(this,Gs,!0))},Pm=function(){!s(this,Gs)||s(this,Gt)===null||(s(this,Gt).removeEventListener("server-status",s(this,eo)),s(this,Gt).removeEventListener("change",s(this,eo)),h(this,Gs,!1))},Dm=function(){!s(this,Jn)||s(this,Ys)||s(this,Pt)===null||(s(this,Pt).addEventListener("change",s(this,Qs)),h(this,Ys,!0))},Lm=function(){!s(this,Ys)||s(this,Pt)===null||(s(this,Pt).removeEventListener("change",s(this,Qs)),h(this,Ys,!1))},Mm=function(){!s(this,Jn)||s(this,Js)||s(this,Dt)===null||(s(this,Dt).addEventListener("change",s(this,Qs)),s(this,Dt).subscribe(),h(this,Js,!0))},Om=function(){!s(this,Js)||s(this,Dt)===null||(s(this,Dt).removeEventListener("change",s(this,Qs)),h(this,Js,!1))},Qs=new WeakMap,eo=new WeakMap,rd=function(){var t;const e=((t=s(this,Gt))==null?void 0:t.connection)??null;return(e==null?void 0:e.url)===s(this,gu)?e:null},tc=function(e){var a,l;const t=((a=u(this,q,rd).call(this))==null?void 0:a.updateState)??null,r=(t==null?void 0:t.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=e?null:((l=s(this,Dt))==null?void 0:l.version)??null;if(i!==null)return{kind:"desktop-self-update",version:i,markdown:jO(i)};const o=s(this,mu);return o!==null&&PU({...o,noticesSuppressed:e,updateState:t})?{kind:"recommendation",version:IS,markdown:xU}:null},Nm=function(e){switch(e.kind){case"server":return DU;case"desktop-self-update":return WO;case"recommendation":return IU}},PS=function(e){var r;const t=((r=u(this,q,Im).call(this))==null?void 0:r.getItem(u(this,q,Nm).call(this,e)))??null;return e.kind==="desktop-self-update"?t!==e.version:zU(e.version,t!==null&&Op(t)?t:null)},zm=function(e){Dw.has(e.version)||(Dw.add(e.version),u(this,q,Um).call(this,"update_toast_shown",e))},Um=function(e,t){var r;s(this,Xs).push({event:e,properties:{server_version:((r=u(this,q,rd).call(this))==null?void 0:r.serverVersion)??"",channel_version:t.version}}),u(this,q,Zm).call(this)},Zm=function(){if(s(this,Xs).length===0)return;const e=u(this,q,rd).call(this);if(!e||e.status!=="connected")return;const t=s(this,Xs);h(this,Xs,[]);for(const r of t)e.sendTelemetrySignal(r.event,r.properties)},tp=new WeakMap,np=new WeakMap,rp=new WeakMap,ip=new WeakMap,sp=new WeakMap,op=new WeakMap,nc=function(){s(this,Fa)||(h(this,Fa,!0),queueMicrotask(()=>{h(this,Fa,!1),u(this,q,DS).call(this)}))},DS=function(){const e=s(this,Ks);e!==null&&(s(this,Ye)&&s(this,Za)===null||e.toggleAttribute("open",s(this,Ye)))};const ZU=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,FU=""+new URL("table-oeG9uAN1.png",import.meta.url).href,HU=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,VU=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,Lw="Artifact skills",BU="Artifact skills",qU="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",WU="Copy prompt";function _h({artifactSkill:n,name:e,description:t,prompt:r,thumbnail:i},o){return M`
567
+ `}}Oa=new WeakMap,Pr=new WeakMap,Na=new WeakMap,pu=new WeakMap,fu=new WeakMap,ep=new WeakMap;const GZ=zt(jZ);function YZ(n,e){return e===null?!0:kg(n,e)}const xw=new Set;var Gt,Pt,mu,Lt,gu,za,Jn,Gs,Ys,Js,Za,Ye,Lr,Ks,Ha,Ua,Xs,Ri,q,Rm,Im,xm,Pm,Lm,Dm,Mm,Qs,eo,rd,tc,Om,PS,Nm,zm,Zm,tp,np,rp,ip,sp,op,nc,LS;class JZ{constructor(e=()=>{}){p(this,q);p(this,Gt,null);p(this,Pt,null);p(this,mu,null);p(this,Lt,null);p(this,gu,"");p(this,za);p(this,Jn,!1);p(this,Gs,!1);p(this,Ys,!1);p(this,Js,!1);p(this,Za,null);p(this,Ye,!1);p(this,Lr,!1);p(this,Ks,null);p(this,Ha,null);p(this,Ua,!1);p(this,Xs,[]);p(this,Ri);p(this,Qs,()=>{s(this,Ri).call(this)});p(this,eo,()=>{u(this,q,Zm).call(this),s(this,Ri).call(this)});p(this,tp,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e===null||s(this,Ye)||(h(this,Ye,!0),e.kind==="server"&&u(this,q,Nm).call(this,e.toast),s(this,Ri).call(this))});p(this,np,()=>{var t,r;if(!s(this,Ye))return;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e!==null&&((r=u(this,q,Rm).call(this))==null||r.setItem(u(this,q,Om).call(this,e),e.version)),h(this,Ye,!1),h(this,Lr,!0),s(this,Ri).call(this)});p(this,rp,()=>{var e;(e=s(this,Lt))==null||e.restart()});p(this,ip,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);(e==null?void 0:e.kind)!=="server"||e.prompt===void 0||u(this,q,zm).call(this,"update_prompt_copy_clicked",e.toast)});p(this,sp,e=>{h(this,Ks,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});p(this,op,e=>{h(this,Ha,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});h(this,Ri,e)}get presented(){return s(this,Ye)}configure({connectionOwner:e=null,primaryServerURL:t="",presentation:r=null,dismissalStorage:i,desktopRecommendation:o=null,desktopUpdate:a=null}){e!==s(this,Gt)&&(u(this,q,xm).call(this),h(this,Gt,e),u(this,q,Im).call(this)),r!==s(this,Pt)&&(u(this,q,Lm).call(this),h(this,Pt,r),u(this,q,Pm).call(this)),a!==s(this,Lt)&&(u(this,q,Mm).call(this),h(this,Lt,a),u(this,q,Dm).call(this)),h(this,gu,t),h(this,za,i),h(this,mu,o)}connect(){s(this,Jn)||(h(this,Jn,!0),u(this,q,Im).call(this),u(this,q,Pm).call(this),u(this,q,Dm).call(this))}disconnect(){s(this,Jn)&&(u(this,q,xm).call(this),u(this,q,Lm).call(this),u(this,q,Mm).call(this),h(this,Jn,!1),h(this,Ks,null),h(this,Ha,null))}template(){var l,c,d;const e=((l=s(this,Pt))==null?void 0:l.toastsSuppressed)??!1,t=u(this,q,tc).call(this,e),r=t===null?null:`${t.kind}:${t.version}`;if(t===null?(h(this,Za,null),h(this,Ye,!1),h(this,Lr,!0)):r!==s(this,Za)&&(h(this,Za,r),h(this,Ye,u(this,q,PS).call(this,t)),h(this,Lr,!0),s(this,Ye)&&t.kind==="server"&&!e&&u(this,q,Nm).call(this,t.toast)),t===null||e)return h(this,Ye,!1),h(this,Lr,!0),u(this,q,nc).call(this),te;const i=(c=s(this,Ks))==null?void 0:c.querySelector(".copy-button"),o=s(this,Ye)&&!s(this,Lr)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=GZ({body:lS(ES(t.markdown)),prompt:t.kind==="server"?t.prompt:void 0,copied:o,restart:t.kind!=="desktop-self-update"?void 0:(d=s(this,Lt))!=null&&d.restarting?"restarting":"ready",presented:s(this,Ye),panelRef:s(this,sp),bellRef:s(this,op),onPresent:s(this,tp),onDismiss:s(this,np),onCopy:s(this,ip),onRestart:s(this,rp)});return h(this,Lr,!1),u(this,q,nc).call(this),a}}Gt=new WeakMap,Pt=new WeakMap,mu=new WeakMap,Lt=new WeakMap,gu=new WeakMap,za=new WeakMap,Jn=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,Js=new WeakMap,Za=new WeakMap,Ye=new WeakMap,Lr=new WeakMap,Ks=new WeakMap,Ha=new WeakMap,Ua=new WeakMap,Xs=new WeakMap,Ri=new WeakMap,q=new WeakSet,Rm=function(){return s(this,za)!==void 0?s(this,za):typeof localStorage>"u"?null:localStorage},Im=function(){!s(this,Jn)||s(this,Gs)||s(this,Gt)===null||(s(this,Gt).addEventListener("server-status",s(this,eo)),s(this,Gt).addEventListener("change",s(this,eo)),h(this,Gs,!0))},xm=function(){!s(this,Gs)||s(this,Gt)===null||(s(this,Gt).removeEventListener("server-status",s(this,eo)),s(this,Gt).removeEventListener("change",s(this,eo)),h(this,Gs,!1))},Pm=function(){!s(this,Jn)||s(this,Ys)||s(this,Pt)===null||(s(this,Pt).addEventListener("change",s(this,Qs)),h(this,Ys,!0))},Lm=function(){!s(this,Ys)||s(this,Pt)===null||(s(this,Pt).removeEventListener("change",s(this,Qs)),h(this,Ys,!1))},Dm=function(){!s(this,Jn)||s(this,Js)||s(this,Lt)===null||(s(this,Lt).addEventListener("change",s(this,Qs)),s(this,Lt).subscribe(),h(this,Js,!0))},Mm=function(){!s(this,Js)||s(this,Lt)===null||(s(this,Lt).removeEventListener("change",s(this,Qs)),h(this,Js,!1))},Qs=new WeakMap,eo=new WeakMap,rd=function(){var t;const e=((t=s(this,Gt))==null?void 0:t.connection)??null;return(e==null?void 0:e.url)===s(this,gu)?e:null},tc=function(e){var a,l;const t=((a=u(this,q,rd).call(this))==null?void 0:a.updateState)??null,r=(t==null?void 0:t.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=e?null:((l=s(this,Lt))==null?void 0:l.version)??null;if(i!==null)return{kind:"desktop-self-update",version:i,markdown:GO(i)};const o=s(this,mu);return o!==null&&FZ({...o,noticesSuppressed:e,updateState:t})?{kind:"recommendation",version:IS,markdown:VZ}:null},Om=function(e){switch(e.kind){case"server":return BZ;case"desktop-self-update":return jO;case"recommendation":return UZ}},PS=function(e){var r;const t=((r=u(this,q,Rm).call(this))==null?void 0:r.getItem(u(this,q,Om).call(this,e)))??null;return e.kind==="desktop-self-update"?t!==e.version:YZ(e.version,t!==null&&Op(t)?t:null)},Nm=function(e){xw.has(e.version)||(xw.add(e.version),u(this,q,zm).call(this,"update_toast_shown",e))},zm=function(e,t){var r;s(this,Xs).push({event:e,properties:{server_version:((r=u(this,q,rd).call(this))==null?void 0:r.serverVersion)??"",channel_version:t.version}}),u(this,q,Zm).call(this)},Zm=function(){if(s(this,Xs).length===0)return;const e=u(this,q,rd).call(this);if(!e||e.status!=="connected")return;const t=s(this,Xs);h(this,Xs,[]);for(const r of t)e.sendTelemetrySignal(r.event,r.properties)},tp=new WeakMap,np=new WeakMap,rp=new WeakMap,ip=new WeakMap,sp=new WeakMap,op=new WeakMap,nc=function(){s(this,Ua)||(h(this,Ua,!0),queueMicrotask(()=>{h(this,Ua,!1),u(this,q,LS).call(this)}))},LS=function(){const e=s(this,Ks);e!==null&&(s(this,Ye)&&s(this,Ha)===null||e.toggleAttribute("open",s(this,Ye)))};const KZ=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,XZ=""+new URL("table-oeG9uAN1.png",import.meta.url).href,QZ=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,eH=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,Pw="Artifact skills",tH="Artifact skills",nH="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",rH="Copy prompt";function _h({artifactSkill:n,name:e,description:t,prompt:r,thumbnail:i},o){return M`
568
568
  <article class="skill-card">
569
569
  <div class="skill-thumb"><img src=${i} alt="" /></div>
570
570
  <div class="skill-name">${e}</div>
571
571
  <p class="skill-desc">${t}</p>
572
- ${RS({label:WU,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
572
+ ${RS({label:rH,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
573
573
  </article>
574
- `}class jU extends Nt{template(e=null){return M`
574
+ `}class iH extends Nt{template(e=null){return M`
575
575
  <button
576
576
  class="skill-trigger"
577
577
  variant="ghost"
578
578
  icon
579
579
  id="skills-trigger"
580
- aria-label=${Lw}
581
- title=${Lw}
580
+ aria-label=${Pw}
581
+ title=${Pw}
582
582
  >
583
583
  <tv-icon name="skills" size="sm"></tv-icon>
584
584
  </button>
@@ -588,27 +588,27 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
588
588
  trigger="skills-trigger"
589
589
  class="skill-popover"
590
590
  >
591
- <div class="skill-heading">${BU}</div>
592
- <p class="skill-intro">${qU}</p>
591
+ <div class="skill-heading">${tH}</div>
592
+ <p class="skill-intro">${nH}</p>
593
593
  <div class="skill-grid">
594
- ${_h({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:ZU},e)}
595
- ${_h({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:FU},e)}
596
- ${_h({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:HU},e)}
597
- ${_h({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:VU},e)}
594
+ ${_h({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:KZ},e)}
595
+ ${_h({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:XZ},e)}
596
+ ${_h({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:QZ},e)}
597
+ ${_h({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:eH},e)}
598
598
  </div>
599
599
  </tv-popover>
600
- `}}const GU=zt(jU),YU=600;let JU=0;const Mw=new WeakMap,i0=n=>{if(n.id)return n.id;let e=Mw.get(n);if(!e){do e=`tv-select-${++JU}`;while(n.ownerDocument.getElementById(e));Mw.set(n,e)}return n.id=e,e},Ah=n=>{var e;return((e=n.textContent)==null?void 0:e.trim())??""};var vu;class LS extends HTMLElement{constructor(){super();p(this,vu,this.attachInternals());s(this,vu).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){s(this,vu).ariaSelected=String(this.hasAttribute("selected"))}}vu=new WeakMap,C(LS,"observedAttributes",["selected"]);var it,Lr,Ha,Ii,xi,yu,W,ti,Ho,Fm,id,ni,sd,Hm,OS,od,NS;class MS extends HTMLElement{constructor(){super();p(this,W);p(this,it,new Zg(this,{select:!0,refresh:()=>u(this,W,sd).call(this),opened:()=>{h(this,xi,""),u(this,W,ni).call(this,u(this,W,Ho).call(this))},closed:()=>{u(this,W,ni).call(this,void 0),h(this,xi,"")},keydown:t=>u(this,W,NS).call(this,t),pointermove:t=>{const r=u(this,W,Fm).call(this,t);r&&u(this,W,ni).call(this,r)},click:t=>{const r=u(this,W,Fm).call(this,t);r&&u(this,W,od).call(this,r)},selectedRow:()=>u(this,W,Ho).call(this),unpair:t=>u(this,W,OS).call(this,t)}));p(this,Lr);p(this,Ha,"");p(this,Ii);p(this,xi,"");p(this,yu,0);this.attachInternals().role="listbox"}connectedCallback(){s(this,it).connect()}disconnectedCallback(){s(this,it).disconnect()}attributeChangedCallback(){s(this,it).refresh()}get value(){var t;return((t=u(this,W,Ho).call(this))==null?void 0:t.getAttribute("value"))??""}set value(t){const r=u(this,W,ti).call(this).find(i=>i.getAttribute("value")===t);r&&(u(this,W,id).call(this,r),u(this,W,sd).call(this))}}it=new WeakMap,Lr=new WeakMap,Ha=new WeakMap,Ii=new WeakMap,xi=new WeakMap,yu=new WeakMap,W=new WeakSet,ti=function(){return[...this.querySelectorAll("tv-option")].filter(t=>t.closest("tv-select")===this)},Ho=function(){return u(this,W,ti).call(this).find(t=>t.hasAttribute("selected"))},Fm=function(t){const r=t.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},id=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("selected",r===t)},ni=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("highlighted",r===t);if(s(this,it).trigger&&Uo(s(this,it).trigger,"aria-activedescendant",t?i0(t):null),t){const r=t.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},sd=function(){var l;const t=u(this,W,ti).call(this),r=u(this,W,Ho).call(this)??t[0];r&&u(this,W,id).call(this,r);const i=s(this,it).trigger;if(!i)return;Uo(i,"role","combobox"),Uo(i,"aria-haspopup","listbox"),Uo(i,"aria-controls",i0(this));for(const c of t)i0(c);const o=t.find(c=>c.hasAttribute("highlighted"));Uo(i,"aria-activedescendant",this.hasAttribute("open")&&o?o.id:null);const a=r?Ah(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}u(this,W,Hm).call(this,i,t)},Hm=function(t,r){if(s(this,Ii)||(h(this,Ii,new ResizeObserver(()=>{const c=s(this,it).trigger;c&&u(this,W,Hm).call(this,c,u(this,W,ti).call(this))})),s(this,Ii).observe(t)),!t.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(t),o=JSON.stringify([t.id,r.map(Ah),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(o===s(this,Ha))return;h(this,Ha,o);const a=t.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,t.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${Ah(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),s(this,Lr)??h(this,Lr,this.ownerDocument.createElement("style")),s(this,Lr).textContent=`:where(button[id="${CSS.escape(t.id)}"]) { width: ${l}px; }`,s(this,Lr).isConnected||this.ownerDocument.head.append(s(this,Lr))},OS=function(t){var r,i;for(const o of["role","aria-haspopup","aria-controls","aria-activedescendant"])t.removeAttribute(o);(r=s(this,Ii))==null||r.disconnect(),h(this,Ii,void 0),(i=s(this,Lr))==null||i.remove(),h(this,Lr,void 0),h(this,Ha,"")},od=function(t){const r=u(this,W,Ho).call(this)!==t;u(this,W,id).call(this,t),u(this,W,sd).call(this),s(this,it).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},NS=function(t){if(!s(this,it).open)return this.ownerDocument.activeElement!==s(this,it).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)?!1:(t.preventDefault(),t.stopImmediatePropagation(),s(this,it).show(!0),!0);const r=u(this,W,ti).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(t.key==="Tab")return t.stopImmediatePropagation(),this.ownerDocument.activeElement!==s(this,it).trigger?(t.preventDefault(),!0):(r[i]&&u(this,W,od).call(this,r[i]),!0);if(t.key==="Escape")return!1;const o=t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(t.key)&&!o)return!1;if(t.preventDefault(),t.stopImmediatePropagation(),t.key==="Enter"||t.key===" ")r[i]&&u(this,W,od).call(this,r[i]);else if(t.key==="Home")u(this,W,ni).call(this,r[0]);else if(t.key==="End")u(this,W,ni).call(this,r.at(-1));else if(t.key==="ArrowDown"||t.key==="ArrowUp")u(this,W,ni).call(this,r[Math.max(0,Math.min(r.length-1,i+(t.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();h(this,xi,a-s(this,yu)>YU?t.key.toLowerCase():s(this,xi)+t.key.toLowerCase()),h(this,yu,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(d=>Ah(d).toLowerCase().startsWith(s(this,xi)));c&&u(this,W,ni).call(this,c)}return!0},C(MS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",LS);customElements.get("tv-select")||customElements.define("tv-select",MS);/**
600
+ `}}const sH=zt(iH),oH=600;let aH=0;const Lw=new WeakMap,r0=n=>{if(n.id)return n.id;let e=Lw.get(n);if(!e){do e=`tv-select-${++aH}`;while(n.ownerDocument.getElementById(e));Lw.set(n,e)}return n.id=e,e},Ah=n=>{var e;return((e=n.textContent)==null?void 0:e.trim())??""};var vu;class DS extends HTMLElement{constructor(){super();p(this,vu,this.attachInternals());s(this,vu).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){s(this,vu).ariaSelected=String(this.hasAttribute("selected"))}}vu=new WeakMap,C(DS,"observedAttributes",["selected"]);var it,Dr,Va,Ii,xi,yu,W,ti,Vo,Hm,id,ni,sd,Um,OS,od,NS;class MS extends HTMLElement{constructor(){super();p(this,W);p(this,it,new Zg(this,{select:!0,refresh:()=>u(this,W,sd).call(this),opened:()=>{h(this,xi,""),u(this,W,ni).call(this,u(this,W,Vo).call(this))},closed:()=>{u(this,W,ni).call(this,void 0),h(this,xi,"")},keydown:t=>u(this,W,NS).call(this,t),pointermove:t=>{const r=u(this,W,Hm).call(this,t);r&&u(this,W,ni).call(this,r)},click:t=>{const r=u(this,W,Hm).call(this,t);r&&u(this,W,od).call(this,r)},selectedRow:()=>u(this,W,Vo).call(this),unpair:t=>u(this,W,OS).call(this,t)}));p(this,Dr);p(this,Va,"");p(this,Ii);p(this,xi,"");p(this,yu,0);this.attachInternals().role="listbox"}connectedCallback(){s(this,it).connect()}disconnectedCallback(){s(this,it).disconnect()}attributeChangedCallback(){s(this,it).refresh()}get value(){var t;return((t=u(this,W,Vo).call(this))==null?void 0:t.getAttribute("value"))??""}set value(t){const r=u(this,W,ti).call(this).find(i=>i.getAttribute("value")===t);r&&(u(this,W,id).call(this,r),u(this,W,sd).call(this))}}it=new WeakMap,Dr=new WeakMap,Va=new WeakMap,Ii=new WeakMap,xi=new WeakMap,yu=new WeakMap,W=new WeakSet,ti=function(){return[...this.querySelectorAll("tv-option")].filter(t=>t.closest("tv-select")===this)},Vo=function(){return u(this,W,ti).call(this).find(t=>t.hasAttribute("selected"))},Hm=function(t){const r=t.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},id=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("selected",r===t)},ni=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("highlighted",r===t);if(s(this,it).trigger&&Zo(s(this,it).trigger,"aria-activedescendant",t?r0(t):null),t){const r=t.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},sd=function(){var l;const t=u(this,W,ti).call(this),r=u(this,W,Vo).call(this)??t[0];r&&u(this,W,id).call(this,r);const i=s(this,it).trigger;if(!i)return;Zo(i,"role","combobox"),Zo(i,"aria-haspopup","listbox"),Zo(i,"aria-controls",r0(this));for(const c of t)r0(c);const o=t.find(c=>c.hasAttribute("highlighted"));Zo(i,"aria-activedescendant",this.hasAttribute("open")&&o?o.id:null);const a=r?Ah(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}u(this,W,Um).call(this,i,t)},Um=function(t,r){if(s(this,Ii)||(h(this,Ii,new ResizeObserver(()=>{const c=s(this,it).trigger;c&&u(this,W,Um).call(this,c,u(this,W,ti).call(this))})),s(this,Ii).observe(t)),!t.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(t),o=JSON.stringify([t.id,r.map(Ah),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(o===s(this,Va))return;h(this,Va,o);const a=t.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,t.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${Ah(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),s(this,Dr)??h(this,Dr,this.ownerDocument.createElement("style")),s(this,Dr).textContent=`:where(button[id="${CSS.escape(t.id)}"]) { width: ${l}px; }`,s(this,Dr).isConnected||this.ownerDocument.head.append(s(this,Dr))},OS=function(t){var r,i;for(const o of["role","aria-haspopup","aria-controls","aria-activedescendant"])t.removeAttribute(o);(r=s(this,Ii))==null||r.disconnect(),h(this,Ii,void 0),(i=s(this,Dr))==null||i.remove(),h(this,Dr,void 0),h(this,Va,"")},od=function(t){const r=u(this,W,Vo).call(this)!==t;u(this,W,id).call(this,t),u(this,W,sd).call(this),s(this,it).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},NS=function(t){if(!s(this,it).open)return this.ownerDocument.activeElement!==s(this,it).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)?!1:(t.preventDefault(),t.stopImmediatePropagation(),s(this,it).show(!0),!0);const r=u(this,W,ti).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(t.key==="Tab")return t.stopImmediatePropagation(),this.ownerDocument.activeElement!==s(this,it).trigger?(t.preventDefault(),!0):(r[i]&&u(this,W,od).call(this,r[i]),!0);if(t.key==="Escape")return!1;const o=t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(t.key)&&!o)return!1;if(t.preventDefault(),t.stopImmediatePropagation(),t.key==="Enter"||t.key===" ")r[i]&&u(this,W,od).call(this,r[i]);else if(t.key==="Home")u(this,W,ni).call(this,r[0]);else if(t.key==="End")u(this,W,ni).call(this,r.at(-1));else if(t.key==="ArrowDown"||t.key==="ArrowUp")u(this,W,ni).call(this,r[Math.max(0,Math.min(r.length-1,i+(t.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();h(this,xi,a-s(this,yu)>oH?t.key.toLowerCase():s(this,xi)+t.key.toLowerCase()),h(this,yu,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(d=>Ah(d).toLowerCase().startsWith(s(this,xi)));c&&u(this,W,ni).call(this,c)}return!0},C(MS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",DS);customElements.get("tv-select")||customElements.define("tv-select",MS);/**
601
601
  * @license
602
602
  * Copyright 2020 Google LLC
603
603
  * SPDX-License-Identifier: BSD-3-Clause
604
- */const KU=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.PROPERTY&&n.type!==nr.ATTRIBUTE&&n.type!==nr.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!c6(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[e]){if(e===at||e===te)return e;const t=n.element,r=n.name;if(n.type===nr.PROPERTY){if(e===t[r])return at}else if(n.type===nr.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return at}else if(n.type===nr.ATTRIBUTE&&t.getAttribute(r)===e+"")return at;return u6(n),e}}),Ow="Settings",Nw="Refresh themes",XU="Themes directory",QU="None";function zw(n){return n instanceof Error?n.message:String(n)}var bt,to,Mr,Kn,wu,Or,Nr,no,Va,Ba,bn,zS,ap,lp,Vm,cp,up,hp,ad;class eZ extends Nt{constructor(){super(...arguments);p(this,bn);p(this,bt,null);p(this,to,null);p(this,Mr,!1);p(this,Kn,null);p(this,wu,!1);p(this,Or,0);p(this,Nr,null);p(this,no,!1);p(this,Va,wn());p(this,Ba,wn());p(this,ap,t=>{var i;if((i=s(this,Nr))==null||i.disconnect(),h(this,Nr,null),h(this,no,!1),!t)return;const r=()=>{const o=t.hasAttribute("open");o!==s(this,no)&&(h(this,no,o),o&&u(this,bn,Vm).call(this,!1))};h(this,Nr,new MutationObserver(r)),s(this,Nr).observe(t,{attributes:!0,attributeFilter:["open"]}),r()});p(this,lp,()=>{u(this,bn,Vm).call(this,!0)});p(this,cp,t=>{var o;const r=t.currentTarget,i=r.value;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.appearanceMode)??"system",this.render(),u(this,bn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});p(this,up,t=>{var o;const r=t.currentTarget,i=r.value||null;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.activeThemeName)??"",this.render(),u(this,bn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});p(this,hp,t=>{var a;const r=t.currentTarget,i=r.value,o=r.checked;r.checked=((a=s(this,bt))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),u(this,bn,ad).call(this,()=>{var l;return(l=s(this,bt))==null?void 0:l.setThemeJavaScriptConsent(i,o)},"Unable to change theme JavaScript consent")})}template(t){var g,y;h(this,bt,t);const r=t.snapshot.connection.status==="connected";s(this,wu)&&!r&&u(this,bn,zS).call(this),h(this,wu,r);const{activeThemeName:i,appearanceMode:o,themeJavaScriptConsentIds:a}=t.snapshot.display,l=((g=s(this,to))==null?void 0:g.themes)??[],c=((y=s(this,to))==null?void 0:y.errors)??[],d=i===null?void 0:l.find(v=>v.id===i&&v.enableMainJS===!0),f=i!==null&&a.includes(i);return queueMicrotask(()=>{var v,_;this.isConnected&&(s(this,Va).value&&(s(this,Va).value.value=((v=s(this,bt))==null?void 0:v.snapshot.display.appearanceMode)??"system"),s(this,Ba).value&&(s(this,Ba).value.value=((_=s(this,bt))==null?void 0:_.snapshot.display.activeThemeName)??""))}),M`
604
+ */const lH=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.PROPERTY&&n.type!==nr.ATTRIBUTE&&n.type!==nr.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!c6(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[e]){if(e===at||e===te)return e;const t=n.element,r=n.name;if(n.type===nr.PROPERTY){if(e===t[r])return at}else if(n.type===nr.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return at}else if(n.type===nr.ATTRIBUTE&&t.getAttribute(r)===e+"")return at;return u6(n),e}}),Dw="Settings",Mw="Refresh themes",cH="Themes directory",uH="None";function Ow(n){return n instanceof Error?n.message:String(n)}var bt,to,Mr,Kn,wu,Or,Nr,no,Fa,Ba,bn,zS,ap,lp,Vm,cp,up,hp,ad;class hH extends Nt{constructor(){super(...arguments);p(this,bn);p(this,bt,null);p(this,to,null);p(this,Mr,!1);p(this,Kn,null);p(this,wu,!1);p(this,Or,0);p(this,Nr,null);p(this,no,!1);p(this,Fa,wn());p(this,Ba,wn());p(this,ap,t=>{var i;if((i=s(this,Nr))==null||i.disconnect(),h(this,Nr,null),h(this,no,!1),!t)return;const r=()=>{const o=t.hasAttribute("open");o!==s(this,no)&&(h(this,no,o),o&&u(this,bn,Vm).call(this,!1))};h(this,Nr,new MutationObserver(r)),s(this,Nr).observe(t,{attributes:!0,attributeFilter:["open"]}),r()});p(this,lp,()=>{u(this,bn,Vm).call(this,!0)});p(this,cp,t=>{var o;const r=t.currentTarget,i=r.value;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.appearanceMode)??"system",this.render(),u(this,bn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});p(this,up,t=>{var o;const r=t.currentTarget,i=r.value||null;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.activeThemeName)??"",this.render(),u(this,bn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});p(this,hp,t=>{var a;const r=t.currentTarget,i=r.value,o=r.checked;r.checked=((a=s(this,bt))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),u(this,bn,ad).call(this,()=>{var l;return(l=s(this,bt))==null?void 0:l.setThemeJavaScriptConsent(i,o)},"Unable to change theme JavaScript consent")})}template(t){var g,y;h(this,bt,t);const r=t.snapshot.connection.status==="connected";s(this,wu)&&!r&&u(this,bn,zS).call(this),h(this,wu,r);const{activeThemeName:i,appearanceMode:o,themeJavaScriptConsentIds:a}=t.snapshot.display,l=((g=s(this,to))==null?void 0:g.themes)??[],c=((y=s(this,to))==null?void 0:y.errors)??[],d=i===null?void 0:l.find(v=>v.id===i&&v.enableMainJS===!0),f=i!==null&&a.includes(i);return queueMicrotask(()=>{var v,_;this.isConnected&&(s(this,Fa).value&&(s(this,Fa).value.value=((v=s(this,bt))==null?void 0:v.snapshot.display.appearanceMode)??"system"),s(this,Ba).value&&(s(this,Ba).value.value=((_=s(this,bt))==null?void 0:_.snapshot.display.activeThemeName)??""))}),M`
605
605
  <button
606
606
  class="settings-trigger"
607
607
  variant="ghost"
608
608
  icon
609
609
  id="settings-trigger"
610
- aria-label=${Ow}
611
- title=${Ow}
610
+ aria-label=${Dw}
611
+ title=${Dw}
612
612
  >
613
613
  <tv-icon name="settings" size="sm"></tv-icon>
614
614
  </button>
@@ -627,7 +627,7 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
627
627
  <tv-select
628
628
  trigger="settings-appearance"
629
629
  name="appearance-mode"
630
- ${Je(s(this,Va))}
630
+ ${Je(s(this,Fa))}
631
631
  @change=${s(this,cp)}
632
632
  >
633
633
  <tv-option value="system" ?selected=${o==="system"}>Adapt to system</tv-option>
@@ -646,7 +646,7 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
646
646
  ${Je(s(this,Ba))}
647
647
  @change=${s(this,up)}
648
648
  >
649
- <tv-option value="" ?selected=${i===null}>${QU}</tv-option>
649
+ <tv-option value="" ?selected=${i===null}>${uH}</tv-option>
650
650
  ${l.map(v=>M`
651
651
  <tv-option
652
652
  value=${v.id}
@@ -658,8 +658,8 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
658
658
  type="button"
659
659
  variant="ghost"
660
660
  icon
661
- aria-label=${Nw}
662
- title=${Nw}
661
+ aria-label=${Mw}
662
+ title=${Mw}
663
663
  ?disabled=${s(this,Mr)||!r}
664
664
  @click=${s(this,lp)}
665
665
  >
@@ -680,7 +680,7 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
680
680
  role="switch"
681
681
  name="theme-javascript-consent"
682
682
  value=${d.id}
683
- .checked=${KU(f)}
683
+ .checked=${lH(f)}
684
684
  @change=${s(this,hp)}
685
685
  >
686
686
  <span>Enable experimental javascript for this theme</span>
@@ -693,12 +693,12 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
693
693
  ${c.length>0?M`
694
694
  <div class="settings-errors" aria-label="Theme validation errors">
695
695
  ${c.map(v=>M`
696
- <p><strong>${v.folder??XU}</strong>: ${v.error}</p>
696
+ <p><strong>${v.folder??cH}</strong>: ${v.error}</p>
697
697
  `)}
698
698
  </div>
699
699
  `:null}
700
700
  </tv-popover>
701
- `}disconnected(){var t;(t=s(this,Nr))==null||t.disconnect(),h(this,Nr,null),h(this,no,!1),h(this,bt,null),h(this,Or,s(this,Or)+1)}}bt=new WeakMap,to=new WeakMap,Mr=new WeakMap,Kn=new WeakMap,wu=new WeakMap,Or=new WeakMap,Nr=new WeakMap,no=new WeakMap,Va=new WeakMap,Ba=new WeakMap,bn=new WeakSet,zS=function(){h(this,to,null),h(this,Kn,null),h(this,Mr,!1),h(this,Or,s(this,Or)+1)},ap=new WeakMap,lp=new WeakMap,Vm=async function(t){const r=s(this,bt);if(r===null||r.snapshot.connection.status!=="connected"||s(this,Mr))return;const i=++nh(this,Or)._;h(this,Mr,!0),h(this,Kn,null),this.render();try{const o=await(t?r.refreshThemes():r.listThemes());if(i!==s(this,Or))return;h(this,to,o)}catch(o){if(i!==s(this,Or))return;h(this,Kn,`${t?"Unable to refresh themes":"Unable to load themes"}: ${zw(o)}`)}finally{i===s(this,Or)&&(h(this,Mr,!1),this.render())}},cp=new WeakMap,up=new WeakMap,hp=new WeakMap,ad=async function(t,r){h(this,Kn,null),this.render();try{await t()}catch(i){h(this,Kn,`${r}: ${zw(i)}`),this.render()}};const tZ=zt(eZ),Nl={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},nZ=(n,{items:e,distance:t,edges:r})=>{const i=new Set;let o=0,a=!1;const l=v=>{v.removeAttribute("data-item-edge-fade");for(const _ of Object.values(Nl))v.style.removeProperty(_)},c=()=>{o=0;const v=new Set(n.querySelectorAll(e)),_=[];for(const F of i)v.has(F)||(f.unobserve(F),i.delete(F),_.push(F));for(const F of v)i.has(F)||(i.add(F),f.observe(F));const x=n.getBoundingClientRect().left+n.clientLeft,B=x+n.clientWidth,P=Math.max(0,Math.min(t,n.clientWidth/2)),J=n.scrollLeft>1?P:0,O=n.scrollLeft<n.scrollWidth-n.clientWidth-1?P:0,Y=[...v].map(F=>({item:F,bounds:F.getBoundingClientRect()}));for(const F of _)l(F);for(const{item:F,bounds:j}of Y){const fe=J>0&&j.left<x+J&&j.right>x,de=O>0&&j.right>B-O&&j.left<B;if(!fe&&!de){l(F);continue}F.style.setProperty(Nl.start,`${x-j.left}px`),F.style.setProperty(Nl.end,`${B-j.left}px`),F.style.setProperty(Nl.left,`${J}px`),F.style.setProperty(Nl.right,`${O}px`),F.setAttribute("data-item-edge-fade","")}},d=()=>{!a&&!o&&(o=requestAnimationFrame(c))},f=new ResizeObserver(d);f.observe(n);const g=new MutationObserver(d);return g.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",d,{passive:!0}),d(),{refresh:d,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(o),f.disconnect(),g.disconnect(),n.removeEventListener("scroll",d);for(const v of i)l(v);i.clear()}}}},zl=.5;var St,qa,Wa,ro,Pi,Xn,zr,Ur,Di,Li,mn,Mi,ja,Oi,io,bu,Me,Zr,Fr,Yt,dp,L,US,ZS,Su,_u,Au,pp,Eu,Vo,Bm,FS,ld,qm,Wm,jm,HS,VS,Ga,ku,BS,ss,cd,qS,WS,jS,GS,Bo,YS,rc;class rZ extends Nt{constructor(){super(...arguments);p(this,L);p(this,St,wn());p(this,qa);p(this,Wa);p(this,ro,!1);p(this,Pi,0);p(this,Xn,!1);p(this,zr,!1);p(this,Ur,!1);p(this,Di,0);p(this,Li,null);p(this,mn,!1);p(this,Mi,null);p(this,ja,null);p(this,Oi,null);p(this,io,null);p(this,bu,!1);p(this,Me,null);p(this,Zr,!1);p(this,Fr,!1);p(this,Yt,!1);p(this,dp,()=>{u(this,L,rc).call(this)});p(this,Su,t=>{var o;const r=s(this,Me);if(r===null||r.pointerId!==t.pointerId||!r.dragging&&Math.hypot(t.clientX-r.originX,t.clientY-r.originY)<=A6)return;const i=s(this,St).value;if(i){if(r.currentX=t.clientX,r.currentY=t.clientY,r.dragging)this.render();else{u(this,L,Bo).call(this);const a=r.tab.getBoundingClientRect();h(this,Zr,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(t.pointerId),this.render(),(o=r.onReorderChange)==null||o.call(r,u(this,L,jm).call(this,r))}u(this,L,Wm).call(this,r),u(this,L,Bm).call(this,r)}});p(this,_u,t=>{const r=s(this,Me);r===null||r.pointerId!==t.pointerId||u(this,L,Vo).call(this,!0,!0)});p(this,Au,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,L,Vo).call(this,!1,!0)});p(this,pp,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,L,Vo).call(this,!1,!0)});p(this,Eu,t=>{var r;t.key!=="Escape"||!((r=s(this,Me))!=null&&r.dragging)||(t.preventDefault(),u(this,L,Vo).call(this,!1,!0))});p(this,Ga,()=>{h(this,mn,!0),u(this,L,ss).call(this,!1)});p(this,ku,()=>{h(this,mn,!0),u(this,L,ss).call(this,!0)})}connected(){var t;h(this,qa,void 0),h(this,Wa,void 0),h(this,mn,!1),u(this,L,BS).call(this),typeof document<"u"&&((t=document.fonts)==null||t.addEventListener("loadingdone",s(this,ku))),document.addEventListener("television-theme-styles-changed",s(this,Ga)),h(this,io,new MutationObserver(s(this,Ga))),s(this,io).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",s(this,Su)),window.addEventListener("pointerup",s(this,_u)),window.addEventListener("pointercancel",s(this,Au)),window.addEventListener("keydown",s(this,Eu))}template(t,r,i=null,o,a=!1){var x,B;u(this,L,YS).call(this,a);const l=(x=s(this,Me))!=null&&x.dragging?s(this,Me):null,c=(l==null?void 0:l.provisionalPages)??(r==null?void 0:r.pages),d=sZ(r,c),f=(l==null?void 0:l.artifactId)??i,g=((B=r==null?void 0:r.selectedPage)==null?void 0:B.artifactIds[0])??null,y=`${(r==null?void 0:r.id)??""}:${d.map(({key:P,label:J})=>`${P}:${J}`).join("|")}`,v=g!==s(this,qa),_=y!==s(this,Wa);v&&h(this,Fr,!1);const E=v||l===null&&_;return _&&h(this,mn,!0),h(this,qa,g),h(this,Wa,y),u(this,L,ss).call(this,E,v,v&&!_),M`
701
+ `}disconnected(){var t;(t=s(this,Nr))==null||t.disconnect(),h(this,Nr,null),h(this,no,!1),h(this,bt,null),h(this,Or,s(this,Or)+1)}}bt=new WeakMap,to=new WeakMap,Mr=new WeakMap,Kn=new WeakMap,wu=new WeakMap,Or=new WeakMap,Nr=new WeakMap,no=new WeakMap,Fa=new WeakMap,Ba=new WeakMap,bn=new WeakSet,zS=function(){h(this,to,null),h(this,Kn,null),h(this,Mr,!1),h(this,Or,s(this,Or)+1)},ap=new WeakMap,lp=new WeakMap,Vm=async function(t){const r=s(this,bt);if(r===null||r.snapshot.connection.status!=="connected"||s(this,Mr))return;const i=++nh(this,Or)._;h(this,Mr,!0),h(this,Kn,null),this.render();try{const o=await(t?r.refreshThemes():r.listThemes());if(i!==s(this,Or))return;h(this,to,o)}catch(o){if(i!==s(this,Or))return;h(this,Kn,`${t?"Unable to refresh themes":"Unable to load themes"}: ${Ow(o)}`)}finally{i===s(this,Or)&&(h(this,Mr,!1),this.render())}},cp=new WeakMap,up=new WeakMap,hp=new WeakMap,ad=async function(t,r){h(this,Kn,null),this.render();try{await t()}catch(i){h(this,Kn,`${r}: ${Ow(i)}`),this.render()}};const dH=zt(hH),Nl={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},pH=(n,{items:e,distance:t,edges:r})=>{const i=new Set;let o=0,a=!1;const l=v=>{v.removeAttribute("data-item-edge-fade");for(const _ of Object.values(Nl))v.style.removeProperty(_)},c=()=>{o=0;const v=new Set(n.querySelectorAll(e)),_=[];for(const U of i)v.has(U)||(f.unobserve(U),i.delete(U),_.push(U));for(const U of v)i.has(U)||(i.add(U),f.observe(U));const x=n.getBoundingClientRect().left+n.clientLeft,B=x+n.clientWidth,P=Math.max(0,Math.min(t,n.clientWidth/2)),J=n.scrollLeft>1?P:0,O=n.scrollLeft<n.scrollWidth-n.clientWidth-1?P:0,Y=[...v].map(U=>({item:U,bounds:U.getBoundingClientRect()}));for(const U of _)l(U);for(const{item:U,bounds:j}of Y){const fe=J>0&&j.left<x+J&&j.right>x,de=O>0&&j.right>B-O&&j.left<B;if(!fe&&!de){l(U);continue}U.style.setProperty(Nl.start,`${x-j.left}px`),U.style.setProperty(Nl.end,`${B-j.left}px`),U.style.setProperty(Nl.left,`${J}px`),U.style.setProperty(Nl.right,`${O}px`),U.setAttribute("data-item-edge-fade","")}},d=()=>{!a&&!o&&(o=requestAnimationFrame(c))},f=new ResizeObserver(d);f.observe(n);const g=new MutationObserver(d);return g.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",d,{passive:!0}),d(),{refresh:d,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(o),f.disconnect(),g.disconnect(),n.removeEventListener("scroll",d);for(const v of i)l(v);i.clear()}}}},zl=.5;var St,qa,Wa,ro,Pi,Xn,zr,Zr,Li,Di,mn,Mi,ja,Oi,io,bu,Me,Hr,Ur,Yt,dp,D,ZS,HS,Su,_u,Au,pp,Eu,Fo,Fm,US,ld,Bm,qm,Wm,VS,FS,Ga,ku,BS,ss,cd,qS,WS,jS,GS,Bo,YS,rc;class fH extends Nt{constructor(){super(...arguments);p(this,D);p(this,St,wn());p(this,qa);p(this,Wa);p(this,ro,!1);p(this,Pi,0);p(this,Xn,!1);p(this,zr,!1);p(this,Zr,!1);p(this,Li,0);p(this,Di,null);p(this,mn,!1);p(this,Mi,null);p(this,ja,null);p(this,Oi,null);p(this,io,null);p(this,bu,!1);p(this,Me,null);p(this,Hr,!1);p(this,Ur,!1);p(this,Yt,!1);p(this,dp,()=>{u(this,D,rc).call(this)});p(this,Su,t=>{var o;const r=s(this,Me);if(r===null||r.pointerId!==t.pointerId||!r.dragging&&Math.hypot(t.clientX-r.originX,t.clientY-r.originY)<=A6)return;const i=s(this,St).value;if(i){if(r.currentX=t.clientX,r.currentY=t.clientY,r.dragging)this.render();else{u(this,D,Bo).call(this);const a=r.tab.getBoundingClientRect();h(this,Hr,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(t.pointerId),this.render(),(o=r.onReorderChange)==null||o.call(r,u(this,D,Wm).call(this,r))}u(this,D,qm).call(this,r),u(this,D,Fm).call(this,r)}});p(this,_u,t=>{const r=s(this,Me);r===null||r.pointerId!==t.pointerId||u(this,D,Fo).call(this,!0,!0)});p(this,Au,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,D,Fo).call(this,!1,!0)});p(this,pp,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,D,Fo).call(this,!1,!0)});p(this,Eu,t=>{var r;t.key!=="Escape"||!((r=s(this,Me))!=null&&r.dragging)||(t.preventDefault(),u(this,D,Fo).call(this,!1,!0))});p(this,Ga,()=>{h(this,mn,!0),u(this,D,ss).call(this,!1)});p(this,ku,()=>{h(this,mn,!0),u(this,D,ss).call(this,!0)})}connected(){var t;h(this,qa,void 0),h(this,Wa,void 0),h(this,mn,!1),u(this,D,BS).call(this),typeof document<"u"&&((t=document.fonts)==null||t.addEventListener("loadingdone",s(this,ku))),document.addEventListener("television-theme-styles-changed",s(this,Ga)),h(this,io,new MutationObserver(s(this,Ga))),s(this,io).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",s(this,Su)),window.addEventListener("pointerup",s(this,_u)),window.addEventListener("pointercancel",s(this,Au)),window.addEventListener("keydown",s(this,Eu))}template(t,r,i=null,o,a=!1){var x,B;u(this,D,YS).call(this,a);const l=(x=s(this,Me))!=null&&x.dragging?s(this,Me):null,c=(l==null?void 0:l.provisionalPages)??(r==null?void 0:r.pages),d=gH(r,c),f=(l==null?void 0:l.artifactId)??i,g=((B=r==null?void 0:r.selectedPage)==null?void 0:B.artifactIds[0])??null,y=`${(r==null?void 0:r.id)??""}:${d.map(({key:P,label:J})=>`${P}:${J}`).join("|")}`,v=g!==s(this,qa),_=y!==s(this,Wa);v&&h(this,Ur,!1);const E=v||l===null&&_;return _&&h(this,mn,!0),h(this,qa,g),h(this,Wa,y),u(this,D,ss).call(this,E,v,v&&!_),M`
702
702
  <div
703
703
  class="tab-strip"
704
704
  role="tablist"
@@ -707,32 +707,32 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
707
707
  @scroll=${s(this,dp)}
708
708
  @lostpointercapture=${s(this,pp)}
709
709
  >
710
- ${Cd(d,({key:P})=>P,(P,J)=>{const O=P.artifactId!==null&&P.artifactId===g,Y=P.artifactId!==null&&P.artifactId===f,F=Y&&l!==null;return M`
710
+ ${Cd(d,({key:P})=>P,(P,J)=>{const O=P.artifactId!==null&&P.artifactId===g,Y=P.artifactId!==null&&P.artifactId===f,U=Y&&l!==null;return M`
711
711
  ${Y?M`
712
712
  <span
713
713
  class="tab-placeholder"
714
714
  aria-hidden="true"
715
- style=${Td(F?{width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
715
+ style=${Td(U?{width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
716
716
  ></span>
717
717
  `:null}
718
718
  <div
719
719
  class=${Y?"tab dragged":"tab"}
720
- ?dragging=${F}
721
- style=${Td(F?{left:`${l.tabLeft+l.currentX-l.originX}px`,top:`${l.tabTop+l.currentY-l.originY}px`,width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
720
+ ?dragging=${U}
721
+ style=${Td(U?{left:`${l.tabLeft+l.currentX-l.originX}px`,top:`${l.tabTop+l.currentY-l.originY}px`,width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
722
722
  @keydown=${j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),j.currentTarget.click())}}
723
723
  role="tab"
724
724
  aria-selected=${O?"true":"false"}
725
725
  tabindex=${O?"0":"-1"}
726
726
  data-artifact-id=${P.artifactId??""}
727
- @pointerdown=${f===null?j=>u(this,L,US).call(this,j,t,r,P,o):null}
728
- @click=${j=>u(this,L,ZS).call(this,j,t,r,P)}
729
- @dblclick=${O&&r!==null&&!F?()=>wm(t,r,P.page,!P.page.geometry.full_screen):null}
727
+ @pointerdown=${f===null?j=>u(this,D,ZS).call(this,j,t,r,P,o):null}
728
+ @click=${j=>u(this,D,HS).call(this,j,t,r,P)}
729
+ @dblclick=${O&&r!==null&&!U?()=>ym(t,r,P.page,!P.page.geometry.full_screen):null}
730
730
  >
731
731
  <span class="tab-label">${P.label}</span>
732
732
  </div>
733
733
  `})}
734
734
  </div>
735
- `}disconnected(){var t,r,i,o;h(this,ro,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Pi)),h(this,Pi,0),h(this,Xn,!1),h(this,zr,!1),h(this,Ur,!1),u(this,L,Bo).call(this),h(this,Fr,!1),h(this,mn,!1),(t=s(this,Mi))==null||t.disconnect(),h(this,Mi,null),h(this,ja,null),(r=s(this,Oi))==null||r.dispose(),h(this,Oi,null),(i=s(this,io))==null||i.disconnect(),h(this,io,null),document.removeEventListener("television-theme-styles-changed",s(this,Ga)),typeof document<"u"&&((o=document.fonts)==null||o.removeEventListener("loadingdone",s(this,ku))),window.removeEventListener("pointermove",s(this,Su)),window.removeEventListener("pointerup",s(this,_u)),window.removeEventListener("pointercancel",s(this,Au)),window.removeEventListener("keydown",s(this,Eu)),u(this,L,Vo).call(this,!1,!1),h(this,Zr,!1)}}St=new WeakMap,qa=new WeakMap,Wa=new WeakMap,ro=new WeakMap,Pi=new WeakMap,Xn=new WeakMap,zr=new WeakMap,Ur=new WeakMap,Di=new WeakMap,Li=new WeakMap,mn=new WeakMap,Mi=new WeakMap,ja=new WeakMap,Oi=new WeakMap,io=new WeakMap,bu=new WeakMap,Me=new WeakMap,Zr=new WeakMap,Fr=new WeakMap,Yt=new WeakMap,dp=new WeakMap,L=new WeakSet,US=function(t,r,i,o,a){s(this,Yt)||s(this,Me)!==null||i===null||o.artifactId===null||t.button!==0||!t.isPrimary||(h(this,Zr,!1),h(this,Me,{pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,tab:t.currentTarget,application:r,channelId:i.id,artifactId:o.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(o.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}))},ZS=function(t,r,i,o){var a;if(t.detail!==0&&s(this,Zr)){h(this,Zr,!1);return}h(this,Zr,!1),!((a=s(this,Me))!=null&&a.dragging||i===null||o.artifactId===null)&&r.selectPage(i.id,o.artifactId)},Su=new WeakMap,_u=new WeakMap,Au=new WeakMap,pp=new WeakMap,Eu=new WeakMap,Vo=function(t,r){var a;const i=s(this,Me);if(i===null)return;if(u(this,L,ld).call(this,i),i.edgeScrollMoved&&h(this,Fr,!0),i.dragging&&(h(this,Xn,s(this,zr)),s(this,zr)||h(this,Ur,!1)),i.dragging&&t&&!oZ(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();h(this,Me,null),(a=i.onReorderChange)==null||a.call(i,null);const o=s(this,St).value;i.dragging&&(o!=null&&o.hasPointerCapture(i.pointerId))&&o.releasePointerCapture(i.pointerId),r&&this.render()},Bm=function(t){const r=s(this,St).value,i=r?u(this,L,qm).call(this,r,t.currentX):0,o=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=zl:((r==null?void 0:r.scrollLeft)??0)>=o-zl;if(s(this,Yt)||!t.dragging||i===0||o===0||a||typeof requestAnimationFrame!="function"){u(this,L,ld).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{u(this,L,FS).call(this,t,l)}))},FS=function(t,r){if(t.edgeScrollFrame=0,s(this,Yt)||s(this,Me)!==t||!t.dragging){t.edgeScrollTimestamp=null;return}const i=s(this,St).value;if(!i){t.edgeScrollTimestamp=null;return}const o=u(this,L,qm).call(this,i,t.currentX),a=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,o!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),d=i.scrollLeft,f=o*l+t.edgeScrollRemainder,g=Math.max(0,Math.min(c,d+f));i.scrollLeft=g;const y=i.scrollLeft-d;y!==0&&(t.edgeScrollMoved=!0),t.edgeScrollRemainder=g===0||g===c?0:f-y,y!==0&&(u(this,L,rc).call(this,i),u(this,L,Wm).call(this,t))}u(this,L,Bm).call(this,t)},ld=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},qm=function(t,r){const i=t.getBoundingClientRect();return r>=i.left&&r<i.left+Qt?-$d*(i.left+Qt-r)/Qt:r>i.right-Qt&&r<=i.right?$d*(r-(i.right-Qt))/Qt:0},Wm=function(t){var _;const r=s(this,St).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const o=i.nextElementSibling,a=t.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=t.slot,d=i.previousElementSibling;for(;d!=null&&d.classList.contains("tab");){const E=d.getBoundingClientRect();if(l>=E.left+E.width/2)break;c-=1,d=d.previousElementSibling}let f=o==null?void 0:o.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const E=f.getBoundingClientRect();if(l<=E.left+E.width/2)break;c+=1,f=f.nextElementSibling}if(c===t.slot)return;const g=u(this,L,HS).call(this,r),y=[...t.provisionalPages],[v]=y.splice(t.slot,1);v&&(y.splice(c,0,v),t.provisionalPages=y,t.slot=c,this.render(),(_=t.onReorderChange)==null||_.call(t,u(this,L,jm).call(this,t)),queueMicrotask(()=>u(this,L,VS).call(this,t,g)))},jm=function(t){return{channelId:t.channelId,pages:t.provisionalPages,carriedArtifactId:t.artifactId}},HS=function(t){return new Map([...t.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},VS=function(t,r){if(s(this,Yt))return;const i=s(this,St).value;if(i)for(const o of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(o.dataset.artifactId??"");if(a===void 0)continue;const l=a-o.getBoundingClientRect().left;if(Math.abs(l)<=zl)continue;const c=o.animate({translate:[`${l}px 0`,"0px 0"]},{duration:Go,easing:"ease"});t.displacementAnimations.add(c),c.finished.finally(()=>{t.displacementAnimations.delete(c)}).catch(()=>{})}},Ga=new WeakMap,ku=new WeakMap,BS=function(){s(this,bu)||typeof document>"u"||!document.fonts||(h(this,bu,!0),document.fonts.ready.then(()=>{this.isConnected&&(h(this,mn,!0),u(this,L,ss).call(this,!0))}))},ss=function(t,r=!1,i=!1){s(this,Xn)||h(this,Xn,t),t&&r&&(h(this,zr,!0),h(this,Ur,i&&!s(this,Yt))),!(s(this,ro)||s(this,Pi)!==0)&&(h(this,ro,!0),queueMicrotask(()=>{if(h(this,ro,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){u(this,L,cd).call(this);return}h(this,Pi,requestAnimationFrame(()=>{h(this,Pi,0),u(this,L,cd).call(this)}))}}))},cd=function(){var l,c;const t=s(this,St).value;if(!t)return;s(this,mn)&&(h(this,mn,!1),u(this,L,WS).call(this,t)),u(this,L,jS).call(this,t),u(this,L,qS).call(this,t);const r=((l=s(this,Me))==null?void 0:l.dragging)===!0,i=s(this,zr),o=i&&s(this,Ur),a=!r&&(i||s(this,Xn)&&!s(this,Fr));r?h(this,Xn,i):(h(this,Xn,!1),h(this,zr,!1),h(this,Ur,!1),i&&h(this,Fr,!1)),a&&u(this,L,GS).call(this,t,o),u(this,L,rc).call(this,t),(c=s(this,Oi))==null||c.refresh()},qS=function(t){for(const r of t.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},WS=function(t){var r;for(const i of t.querySelectorAll(".tab")){const o=i.querySelector(".tab-label");if(!o)continue;const a=document.createRange();a.selectNodeContents(o);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),d=Ul(c.paddingLeft)+Ul(c.paddingRight)+Ul(c.borderLeftWidth)+Ul(c.borderRightWidth),g=Math.ceil(l.width)+d>T9+$9?"capped":"hugging";i.dataset.compression!==g&&(i.dataset.compression=g)}},jS=function(t){var r,i;typeof ResizeObserver>"u"||s(this,ja)===t||((r=s(this,Mi))==null||r.disconnect(),s(this,Mi)??h(this,Mi,new ResizeObserver(()=>{s(this,Yt)?(h(this,Xn,!0),u(this,L,cd).call(this)):u(this,L,ss).call(this,!0)})),s(this,Mi).observe(t),h(this,ja,t),(i=s(this,Oi))==null||i.dispose(),h(this,Oi,nZ(t,{items:".tab:not(.dragged)",distance:R9,edges:"both"})))},GS=function(t,r){const i=t.querySelector('.tab[aria-selected="true"]');if(!i){u(this,L,Bo).call(this);return}const o=t.getBoundingClientRect(),a=i.getBoundingClientRect(),l=Ul(getComputedStyle(i).translate),c=Math.max(0,Math.min(t.scrollLeft+a.left-l+a.width/2-(o.left+o.width/2),t.scrollWidth-t.clientWidth));if(u(this,L,Bo).call(this),s(this,Yt)||!r||Math.abs(t.scrollLeft-c)<=zl||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:B6,easing:"ease"});h(this,Li,f);const g=()=>{var v;if(f!==s(this,Li))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Li,null),h(this,Di,0),u(this,L,rc).call(this,t)):h(this,Di,requestAnimationFrame(g))};h(this,Di,requestAnimationFrame(g))},Bo=function(){var t;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Di)),h(this,Di,0),(t=s(this,Li))==null||t.cancel(),h(this,Li,null)},YS=function(t){var i;if(s(this,Yt)===t||(h(this,Yt,t),!t))return;u(this,L,Bo).call(this),h(this,Ur,!1),h(this,Fr,!1);const r=s(this,Me);if(r!==null){u(this,L,ld).call(this,r);for(const o of r.displacementAnimations)o.cancel();r.displacementAnimations.clear(),h(this,Me,null),r.dragging&&((i=s(this,St).value)!=null&&i.hasPointerCapture(r.pointerId))&&s(this,St).value.releasePointerCapture(r.pointerId),queueMicrotask(()=>{var o;return(o=r.onReorderChange)==null?void 0:o.call(r,null)})}u(this,L,ss).call(this,!0,!0,!1)},rc=function(t=s(this,St).value){if(!t)return;const r=Math.max(0,t.scrollWidth-t.clientWidth);t.toggleAttribute("data-overflow",r>zl)};const iZ=zt(rZ);function sZ(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{var a;const o=r.artifactIds[0]??null;return{page:r,artifactId:o,label:o===null?"":((a=t.get(o))==null?void 0:a.title)??"",key:o??`empty-page-${i}`}})}function oZ(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function Ul(n){const e=Number.parseFloat(n);return Number.isFinite(e)?e:0}let aZ=0;var so,_t,Cu,st,Hr,Qn,Ya,Vr,Tu,Jt,fp,mp,$u,il,JS,gp,vp,KS,yp,wp;class lZ extends Nt{constructor(){super(...arguments);p(this,il);p(this,so,new UU(()=>this.render()));p(this,_t,new E6(()=>this.render()));p(this,Cu,`channel-switcher-trigger-${++aZ}`);p(this,st,null);p(this,Hr,null);p(this,Qn,!1);p(this,Ya,null);p(this,Vr,null);p(this,Tu,wn());p(this,Jt,null);p(this,fp,t=>{var r,i,o;(r=s(this,st))==null||r.removeAttribute("open"),((i=s(this,Vr))==null?void 0:i.display.focusedChannelId)!==t&&((o=s(this,Ya))==null||o.focusChannel(t).catch(()=>{}))});p(this,mp,t=>{s(this,Qn)||(h(this,Qn,!0),this.render(),t.detail===0&&requestAnimationFrame(()=>{var r;(r=s(this,st))!=null&&r.hasAttribute("open")&&u(this,il,JS).call(this,0)}))});p(this,$u,t=>{const r=s(this,st);r===null||!r.hasAttribute("open")||s(this,_t).dragging||r.querySelector("input, tv-menu[open]")||g6(t,[...r.querySelectorAll('.channel[role="option"]')])});p(this,gp,t=>{var r,i;h(this,Jt,{channelId:t,scrollTop:((i=(r=s(this,st))==null?void 0:r.querySelector(".channel-switcher-pop-body"))==null?void 0:i.scrollTop)??0,result:null})});p(this,vp,(t,r)=>{var i;((i=s(this,Jt))==null?void 0:i.channelId)===t&&(s(this,Jt).result=r?"deleted":"cancelled",this.render())});p(this,yp,t=>{var r;(r=s(this,Hr))==null||r.disconnect(),h(this,Hr,null),s(this,st)!==null&&s(this,Jt)===null&&s(this,_t).disconnect(),h(this,st,t instanceof HTMLElement?t:null),s(this,st)!==null&&(s(this,_t).connect(),h(this,Hr,new MutationObserver(s(this,wp))),s(this,Hr).observe(s(this,st),{attributes:!0,attributeFilter:["open"]}))});p(this,wp,()=>{var t;(((t=s(this,st))==null?void 0:t.hasAttribute("open"))??!0)||s(this,Jt)===null&&(h(this,Qn,!1),this.render())})}connected(){s(this,so).connect(),document.addEventListener("keydown",s(this,$u))}template(t,r,i={}){var l;h(this,Ya,t),h(this,Vr,r);const o=i.collapsed||i.sidebarTransitioning;(i.sidebarTransitioning||!o||r.focusedChannel===null)&&h(this,Qn,!1),s(this,_t).update(t,r,{management:!0,dragging:!0,revealMovedRow:!0,onDeleteStart:s(this,gp),onDeleteEnd:s(this,vp),selectChannel:s(this,fp),highlightOnPointerMove:!0,motionSuppressed:i.sidebarTransitioning});const a=s(this,Jt);return a!=null&&a.result&&(r.channels.length===0||r.focusedChannel!==null)&&(a.result==="cancelled"||!r.channels.some(({id:c})=>c===a.channelId))&&queueMicrotask(()=>u(this,il,KS).call(this,a)),s(this,so).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),M`
735
+ `}disconnected(){var t,r,i,o;h(this,ro,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Pi)),h(this,Pi,0),h(this,Xn,!1),h(this,zr,!1),h(this,Zr,!1),u(this,D,Bo).call(this),h(this,Ur,!1),h(this,mn,!1),(t=s(this,Mi))==null||t.disconnect(),h(this,Mi,null),h(this,ja,null),(r=s(this,Oi))==null||r.dispose(),h(this,Oi,null),(i=s(this,io))==null||i.disconnect(),h(this,io,null),document.removeEventListener("television-theme-styles-changed",s(this,Ga)),typeof document<"u"&&((o=document.fonts)==null||o.removeEventListener("loadingdone",s(this,ku))),window.removeEventListener("pointermove",s(this,Su)),window.removeEventListener("pointerup",s(this,_u)),window.removeEventListener("pointercancel",s(this,Au)),window.removeEventListener("keydown",s(this,Eu)),u(this,D,Fo).call(this,!1,!1),h(this,Hr,!1)}}St=new WeakMap,qa=new WeakMap,Wa=new WeakMap,ro=new WeakMap,Pi=new WeakMap,Xn=new WeakMap,zr=new WeakMap,Zr=new WeakMap,Li=new WeakMap,Di=new WeakMap,mn=new WeakMap,Mi=new WeakMap,ja=new WeakMap,Oi=new WeakMap,io=new WeakMap,bu=new WeakMap,Me=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Yt=new WeakMap,dp=new WeakMap,D=new WeakSet,ZS=function(t,r,i,o,a){s(this,Yt)||s(this,Me)!==null||i===null||o.artifactId===null||t.button!==0||!t.isPrimary||(h(this,Hr,!1),h(this,Me,{pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,tab:t.currentTarget,application:r,channelId:i.id,artifactId:o.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(o.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}))},HS=function(t,r,i,o){var a;if(t.detail!==0&&s(this,Hr)){h(this,Hr,!1);return}h(this,Hr,!1),!((a=s(this,Me))!=null&&a.dragging||i===null||o.artifactId===null)&&r.selectPage(i.id,o.artifactId)},Su=new WeakMap,_u=new WeakMap,Au=new WeakMap,pp=new WeakMap,Eu=new WeakMap,Fo=function(t,r){var a;const i=s(this,Me);if(i===null)return;if(u(this,D,ld).call(this,i),i.edgeScrollMoved&&h(this,Ur,!0),i.dragging&&(h(this,Xn,s(this,zr)),s(this,zr)||h(this,Zr,!1)),i.dragging&&t&&!vH(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();h(this,Me,null),(a=i.onReorderChange)==null||a.call(i,null);const o=s(this,St).value;i.dragging&&(o!=null&&o.hasPointerCapture(i.pointerId))&&o.releasePointerCapture(i.pointerId),r&&this.render()},Fm=function(t){const r=s(this,St).value,i=r?u(this,D,Bm).call(this,r,t.currentX):0,o=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=zl:((r==null?void 0:r.scrollLeft)??0)>=o-zl;if(s(this,Yt)||!t.dragging||i===0||o===0||a||typeof requestAnimationFrame!="function"){u(this,D,ld).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{u(this,D,US).call(this,t,l)}))},US=function(t,r){if(t.edgeScrollFrame=0,s(this,Yt)||s(this,Me)!==t||!t.dragging){t.edgeScrollTimestamp=null;return}const i=s(this,St).value;if(!i){t.edgeScrollTimestamp=null;return}const o=u(this,D,Bm).call(this,i,t.currentX),a=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,o!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),d=i.scrollLeft,f=o*l+t.edgeScrollRemainder,g=Math.max(0,Math.min(c,d+f));i.scrollLeft=g;const y=i.scrollLeft-d;y!==0&&(t.edgeScrollMoved=!0),t.edgeScrollRemainder=g===0||g===c?0:f-y,y!==0&&(u(this,D,rc).call(this,i),u(this,D,qm).call(this,t))}u(this,D,Fm).call(this,t)},ld=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},Bm=function(t,r){const i=t.getBoundingClientRect();return r>=i.left&&r<i.left+Qt?-$d*(i.left+Qt-r)/Qt:r>i.right-Qt&&r<=i.right?$d*(r-(i.right-Qt))/Qt:0},qm=function(t){var _;const r=s(this,St).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const o=i.nextElementSibling,a=t.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=t.slot,d=i.previousElementSibling;for(;d!=null&&d.classList.contains("tab");){const E=d.getBoundingClientRect();if(l>=E.left+E.width/2)break;c-=1,d=d.previousElementSibling}let f=o==null?void 0:o.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const E=f.getBoundingClientRect();if(l<=E.left+E.width/2)break;c+=1,f=f.nextElementSibling}if(c===t.slot)return;const g=u(this,D,VS).call(this,r),y=[...t.provisionalPages],[v]=y.splice(t.slot,1);v&&(y.splice(c,0,v),t.provisionalPages=y,t.slot=c,this.render(),(_=t.onReorderChange)==null||_.call(t,u(this,D,Wm).call(this,t)),queueMicrotask(()=>u(this,D,FS).call(this,t,g)))},Wm=function(t){return{channelId:t.channelId,pages:t.provisionalPages,carriedArtifactId:t.artifactId}},VS=function(t){return new Map([...t.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},FS=function(t,r){if(s(this,Yt))return;const i=s(this,St).value;if(i)for(const o of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(o.dataset.artifactId??"");if(a===void 0)continue;const l=a-o.getBoundingClientRect().left;if(Math.abs(l)<=zl)continue;const c=o.animate({translate:[`${l}px 0`,"0px 0"]},{duration:Go,easing:"ease"});t.displacementAnimations.add(c),c.finished.finally(()=>{t.displacementAnimations.delete(c)}).catch(()=>{})}},Ga=new WeakMap,ku=new WeakMap,BS=function(){s(this,bu)||typeof document>"u"||!document.fonts||(h(this,bu,!0),document.fonts.ready.then(()=>{this.isConnected&&(h(this,mn,!0),u(this,D,ss).call(this,!0))}))},ss=function(t,r=!1,i=!1){s(this,Xn)||h(this,Xn,t),t&&r&&(h(this,zr,!0),h(this,Zr,i&&!s(this,Yt))),!(s(this,ro)||s(this,Pi)!==0)&&(h(this,ro,!0),queueMicrotask(()=>{if(h(this,ro,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){u(this,D,cd).call(this);return}h(this,Pi,requestAnimationFrame(()=>{h(this,Pi,0),u(this,D,cd).call(this)}))}}))},cd=function(){var l,c;const t=s(this,St).value;if(!t)return;s(this,mn)&&(h(this,mn,!1),u(this,D,WS).call(this,t)),u(this,D,jS).call(this,t),u(this,D,qS).call(this,t);const r=((l=s(this,Me))==null?void 0:l.dragging)===!0,i=s(this,zr),o=i&&s(this,Zr),a=!r&&(i||s(this,Xn)&&!s(this,Ur));r?h(this,Xn,i):(h(this,Xn,!1),h(this,zr,!1),h(this,Zr,!1),i&&h(this,Ur,!1)),a&&u(this,D,GS).call(this,t,o),u(this,D,rc).call(this,t),(c=s(this,Oi))==null||c.refresh()},qS=function(t){for(const r of t.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},WS=function(t){var r;for(const i of t.querySelectorAll(".tab")){const o=i.querySelector(".tab-label");if(!o)continue;const a=document.createRange();a.selectNodeContents(o);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),d=Zl(c.paddingLeft)+Zl(c.paddingRight)+Zl(c.borderLeftWidth)+Zl(c.borderRightWidth),g=Math.ceil(l.width)+d>zz+Zz?"capped":"hugging";i.dataset.compression!==g&&(i.dataset.compression=g)}},jS=function(t){var r,i;typeof ResizeObserver>"u"||s(this,ja)===t||((r=s(this,Mi))==null||r.disconnect(),s(this,Mi)??h(this,Mi,new ResizeObserver(()=>{s(this,Yt)?(h(this,Xn,!0),u(this,D,cd).call(this)):u(this,D,ss).call(this,!0)})),s(this,Mi).observe(t),h(this,ja,t),(i=s(this,Oi))==null||i.dispose(),h(this,Oi,pH(t,{items:".tab:not(.dragged)",distance:Hz,edges:"both"})))},GS=function(t,r){const i=t.querySelector('.tab[aria-selected="true"]');if(!i){u(this,D,Bo).call(this);return}const o=t.getBoundingClientRect(),a=i.getBoundingClientRect(),l=Zl(getComputedStyle(i).translate),c=Math.max(0,Math.min(t.scrollLeft+a.left-l+a.width/2-(o.left+o.width/2),t.scrollWidth-t.clientWidth));if(u(this,D,Bo).call(this),s(this,Yt)||!r||Math.abs(t.scrollLeft-c)<=zl||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:B6,easing:"ease"});h(this,Di,f);const g=()=>{var v;if(f!==s(this,Di))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Di,null),h(this,Li,0),u(this,D,rc).call(this,t)):h(this,Li,requestAnimationFrame(g))};h(this,Li,requestAnimationFrame(g))},Bo=function(){var t;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Li)),h(this,Li,0),(t=s(this,Di))==null||t.cancel(),h(this,Di,null)},YS=function(t){var i;if(s(this,Yt)===t||(h(this,Yt,t),!t))return;u(this,D,Bo).call(this),h(this,Zr,!1),h(this,Ur,!1);const r=s(this,Me);if(r!==null){u(this,D,ld).call(this,r);for(const o of r.displacementAnimations)o.cancel();r.displacementAnimations.clear(),h(this,Me,null),r.dragging&&((i=s(this,St).value)!=null&&i.hasPointerCapture(r.pointerId))&&s(this,St).value.releasePointerCapture(r.pointerId),queueMicrotask(()=>{var o;return(o=r.onReorderChange)==null?void 0:o.call(r,null)})}u(this,D,ss).call(this,!0,!0,!1)},rc=function(t=s(this,St).value){if(!t)return;const r=Math.max(0,t.scrollWidth-t.clientWidth);t.toggleAttribute("data-overflow",r>zl)};const mH=zt(fH);function gH(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{var a;const o=r.artifactIds[0]??null;return{page:r,artifactId:o,label:o===null?"":((a=t.get(o))==null?void 0:a.title)??"",key:o??`empty-page-${i}`}})}function vH(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function Zl(n){const e=Number.parseFloat(n);return Number.isFinite(e)?e:0}let yH=0;var so,_t,Cu,st,Vr,Qn,Ya,Fr,Tu,Jt,fp,mp,$u,il,JS,gp,vp,KS,yp,wp;class wH extends Nt{constructor(){super(...arguments);p(this,il);p(this,so,new JZ(()=>this.render()));p(this,_t,new E6(()=>this.render()));p(this,Cu,`channel-switcher-trigger-${++yH}`);p(this,st,null);p(this,Vr,null);p(this,Qn,!1);p(this,Ya,null);p(this,Fr,null);p(this,Tu,wn());p(this,Jt,null);p(this,fp,t=>{var r,i,o;(r=s(this,st))==null||r.removeAttribute("open"),((i=s(this,Fr))==null?void 0:i.display.focusedChannelId)!==t&&((o=s(this,Ya))==null||o.focusChannel(t).catch(()=>{}))});p(this,mp,t=>{s(this,Qn)||(h(this,Qn,!0),this.render(),t.detail===0&&requestAnimationFrame(()=>{var r;(r=s(this,st))!=null&&r.hasAttribute("open")&&u(this,il,JS).call(this,0)}))});p(this,$u,t=>{const r=s(this,st);r===null||!r.hasAttribute("open")||s(this,_t).dragging||r.querySelector("input, tv-menu[open]")||g6(t,[...r.querySelectorAll('.channel[role="option"]')])});p(this,gp,t=>{var r,i;h(this,Jt,{channelId:t,scrollTop:((i=(r=s(this,st))==null?void 0:r.querySelector(".channel-switcher-pop-body"))==null?void 0:i.scrollTop)??0,result:null})});p(this,vp,(t,r)=>{var i;((i=s(this,Jt))==null?void 0:i.channelId)===t&&(s(this,Jt).result=r?"deleted":"cancelled",this.render())});p(this,yp,t=>{var r;(r=s(this,Vr))==null||r.disconnect(),h(this,Vr,null),s(this,st)!==null&&s(this,Jt)===null&&s(this,_t).disconnect(),h(this,st,t instanceof HTMLElement?t:null),s(this,st)!==null&&(s(this,_t).connect(),h(this,Vr,new MutationObserver(s(this,wp))),s(this,Vr).observe(s(this,st),{attributes:!0,attributeFilter:["open"]}))});p(this,wp,()=>{var t;(((t=s(this,st))==null?void 0:t.hasAttribute("open"))??!0)||s(this,Jt)===null&&(h(this,Qn,!1),this.render())})}connected(){s(this,so).connect(),document.addEventListener("keydown",s(this,$u))}template(t,r,i={}){var l;h(this,Ya,t),h(this,Fr,r);const o=i.collapsed||i.sidebarTransitioning;(i.sidebarTransitioning||!o||r.focusedChannel===null)&&h(this,Qn,!1),s(this,_t).update(t,r,{management:!0,dragging:!0,revealMovedRow:!0,onDeleteStart:s(this,gp),onDeleteEnd:s(this,vp),selectChannel:s(this,fp),highlightOnPointerMove:!0,motionSuppressed:i.sidebarTransitioning});const a=s(this,Jt);return a!=null&&a.result&&(r.channels.length===0||r.focusedChannel!==null)&&(a.result==="cancelled"||!r.channels.some(({id:c})=>c===a.channelId))&&queueMicrotask(()=>u(this,il,KS).call(this,a)),s(this,so).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),M`
736
736
  <header class="top-bar" ${Je(s(this,Tu))}>
737
737
  ${o?M`
738
738
  <div class="top-bar-lead">
@@ -795,31 +795,31 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
795
795
  `}
796
796
  </div>
797
797
  `:null}
798
- ${iZ(t,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
798
+ ${mH(t,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
799
799
  <div class="top-bar-controls">
800
- ${GU((l=i.connectionOwner)==null?void 0:l.connection)}
801
- ${tZ(t)}
800
+ ${sH((l=i.connectionOwner)==null?void 0:l.connection)}
801
+ ${dH(t)}
802
802
  ${s(this,so).template()}
803
803
  </div>
804
804
  </header>
805
805
  ${s(this,_t).overlayTemplate()}
806
- `}disconnected(){var t;s(this,so).disconnect(),document.removeEventListener("keydown",s(this,$u)),s(this,_t).disconnect(),(t=s(this,Hr))==null||t.disconnect(),h(this,Hr,null),h(this,st,null),h(this,Qn,!1),h(this,Ya,null),h(this,Vr,null),h(this,Jt,null)}}so=new WeakMap,_t=new WeakMap,Cu=new WeakMap,st=new WeakMap,Hr=new WeakMap,Qn=new WeakMap,Ya=new WeakMap,Vr=new WeakMap,Tu=new WeakMap,Jt=new WeakMap,fp=new WeakMap,mp=new WeakMap,$u=new WeakMap,il=new WeakSet,JS=function(t){var r;wc((r=s(this,st))==null?void 0:r.querySelectorAll('.channel[role="option"]')[t])},gp=new WeakMap,vp=new WeakMap,KS=function(t){var d,f;if(s(this,Jt)!==t||s(this,Vr)===null)return;h(this,Jt,null);const r=s(this,Vr).focusedChannel;h(this,Qn,r!==null),this.render();const i=s(this,st);if(i===null){s(this,_t).disconnect(),(f=(d=s(this,Tu).value)==null?void 0:d.querySelector(".sidebar-expand"))==null||f.focus();return}i.setAttribute("open","");const o=i.querySelector(".channel-switcher-pop-body");o&&(o.scrollTop=t.scrollTop);const a=t.result==="cancelled"&&s(this,Vr).channels.some(({id:g})=>g===t.channelId)?t.channelId:r==null?void 0:r.id,l=[...i.querySelectorAll(".channel-row")].find(g=>g.dataset.channelId===a),c=l==null?void 0:l.querySelector(".channel");c==null||c.focus({preventScroll:!0}),t.result==="deleted"&&(c==null||c.scrollIntoView({block:"nearest"}))},yp=new WeakMap,wp=new WeakMap;const cZ=zt(lZ);var er,Ru,oo,Ja,ot,Lt,Kt,Xt,ao,me,gn,Ni,Ka,zi,Iu,bp,lo,Sp,_p,Ap,H,ud,Gm,XS,xu,Ep,ri,os,ic,hd,Ym,QS,e_,kp,Cp,Tp,Pu,$p,as,sc,t_;class uZ extends Nt{constructor(){super(...arguments);p(this,H);p(this,er,null);p(this,Ru);p(this,oo,null);p(this,Ja,null);p(this,ot,mh);p(this,Lt,!1);p(this,Kt,null);p(this,Xt,null);p(this,ao,null);p(this,me,!1);p(this,gn,!1);p(this,Ni,mh);p(this,Ka,0);p(this,zi,null);p(this,Iu,t=>{var r;if(t.key==="Escape"&&s(this,Kt)!==null){t.preventDefault(),t.stopPropagation(),u(this,H,as).call(this);return}L_(t,navigator.platform)&&(t.preventDefault(),t.stopPropagation(),(r=s(this,er))==null||r.handleNavigationKey(t.key))});p(this,bp,t=>{h(this,Ru,t??void 0),this.render()});p(this,lo,()=>{this.render()});p(this,Sp,()=>u(this,H,ud).call(this,!0));p(this,_p,()=>u(this,H,ud).call(this,!1));p(this,Ap,()=>{const t=s(this,me)?!s(this,gn):!s(this,Lt);u(this,H,ud).call(this,t)});p(this,xu,t=>{const r=s(this,zi),i=u(this,H,os).call(this).closest("#app");if(!r||!i)return;h(this,Ni,t);const o=P9(1-t/r.expandedSidebarWidth,r),a=(c,d)=>{i.style.setProperty(`--motion-${c}`,`${d}px`)};a("boundary",o.sidebarBoundary),a("toggle-left",o.toggleLeft),a("toggle-top",r.toggleTop),a("toggle-width",r.toggleWidth),a("toggle-height",r.toggleHeight),a("toggle-wipe",o.toggleWipe),a("lead-reservation",o.leadReservation),a("switcher-left",r.collapsedToggleLeft+r.toggleWidth+r.toggleSwitcherGap-o.sidebarBoundary-r.barInset),i.style.setProperty("--motion-titlebar-opacity",String(o.titlebarOpacity)),i.style.setProperty("--motion-switcher-opacity",String(o.switcherOpacity));const l=u(this,H,os).call(this);l.style.removeProperty("left"),l.style.removeProperty("top")});p(this,Ep,t=>{var o;if(!s(this,me))return;const r=t===0;if(r!==s(this,gn))return;const i=document.activeElement===s(this,Xt);u(this,H,ri).call(this,r),this.render(),i&&((o=s(this,Xt))==null||o.focus({preventScroll:!0}))});p(this,kp,t=>{if(t.button!==0||s(this,Kt)!==null)return;const r=t.currentTarget,i=r.closest("#app");i!==null&&(r.setPointerCapture(t.pointerId),h(this,Kt,{pointerId:t.pointerId,startX:t.clientX,startWidth:s(this,ot),root:i}),t.preventDefault())});p(this,Cp,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,H,sc).call(this,r.root,r.startWidth+t.clientX-r.startX)});p(this,Tp,t=>{var o;const r=s(this,Kt);if(r===null||t.pointerId!==r.pointerId)return;h(this,Kt,null);const i=((o=s(this,oo))==null?void 0:o.commit(s(this,ot)))??s(this,ot);u(this,H,sc).call(this,r.root,i)});p(this,Pu,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,H,as).call(this)});p(this,$p,t=>{var i;const r=t.currentTarget.closest("#app");r!==null&&((i=s(this,oo))==null||i.clear(),u(this,H,sc).call(this,r,mh))})}update(t,r){const i=r[0],o=r[1].sidebarWidthPreference,a=r[1].sidebarCollapsedPreference;s(this,er)!==i&&(s(this,er)!==null&&this.isConnected&&(s(this,er).removeEventListener("change",s(this,lo)),i.addEventListener("change",s(this,lo))),h(this,er,i));const l=s(this,oo)!==o,c=s(this,Ja)!==a;return l&&(u(this,H,as).call(this),h(this,oo,o),h(this,ot,o.read()??mh)),c&&(u(this,H,as).call(this),h(this,Ja,a),h(this,Lt,a.read())),(l||c)&&u(this,H,ri).call(this,s(this,Lt)),super.update(t,r)}connected(){var t;(t=s(this,er))==null||t.addEventListener("change",s(this,lo)),document.addEventListener("keydown",s(this,Iu),{capture:!0})}disconnected(){var t,r;u(this,H,as).call(this),s(this,me)?u(this,H,ri).call(this,s(this,gn)):(t=s(this,ao))==null||t.cancel(),(r=s(this,er))==null||r.removeEventListener("change",s(this,lo)),document.removeEventListener("keydown",s(this,Iu),{capture:!0})}template(t,r){const i=fN(t.snapshot,r.runtimeServerURL),o=t.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),M`
806
+ `}disconnected(){var t;s(this,so).disconnect(),document.removeEventListener("keydown",s(this,$u)),s(this,_t).disconnect(),(t=s(this,Vr))==null||t.disconnect(),h(this,Vr,null),h(this,st,null),h(this,Qn,!1),h(this,Ya,null),h(this,Fr,null),h(this,Jt,null)}}so=new WeakMap,_t=new WeakMap,Cu=new WeakMap,st=new WeakMap,Vr=new WeakMap,Qn=new WeakMap,Ya=new WeakMap,Fr=new WeakMap,Tu=new WeakMap,Jt=new WeakMap,fp=new WeakMap,mp=new WeakMap,$u=new WeakMap,il=new WeakSet,JS=function(t){var r;wc((r=s(this,st))==null?void 0:r.querySelectorAll('.channel[role="option"]')[t])},gp=new WeakMap,vp=new WeakMap,KS=function(t){var d,f;if(s(this,Jt)!==t||s(this,Fr)===null)return;h(this,Jt,null);const r=s(this,Fr).focusedChannel;h(this,Qn,r!==null),this.render();const i=s(this,st);if(i===null){s(this,_t).disconnect(),(f=(d=s(this,Tu).value)==null?void 0:d.querySelector(".sidebar-expand"))==null||f.focus();return}i.setAttribute("open","");const o=i.querySelector(".channel-switcher-pop-body");o&&(o.scrollTop=t.scrollTop);const a=t.result==="cancelled"&&s(this,Fr).channels.some(({id:g})=>g===t.channelId)?t.channelId:r==null?void 0:r.id,l=[...i.querySelectorAll(".channel-row")].find(g=>g.dataset.channelId===a),c=l==null?void 0:l.querySelector(".channel");c==null||c.focus({preventScroll:!0}),t.result==="deleted"&&(c==null||c.scrollIntoView({block:"nearest"}))},yp=new WeakMap,wp=new WeakMap;const bH=zt(wH);var er,Ru,oo,Ja,ot,Dt,Kt,Xt,ao,me,gn,Ni,Ka,zi,Iu,bp,lo,Sp,_p,Ap,V,ud,jm,XS,xu,Ep,ri,os,ic,hd,Gm,QS,e_,kp,Cp,Tp,Pu,$p,as,sc,t_;class SH extends Nt{constructor(){super(...arguments);p(this,V);p(this,er,null);p(this,Ru);p(this,oo,null);p(this,Ja,null);p(this,ot,mh);p(this,Dt,!1);p(this,Kt,null);p(this,Xt,null);p(this,ao,null);p(this,me,!1);p(this,gn,!1);p(this,Ni,mh);p(this,Ka,0);p(this,zi,null);p(this,Iu,t=>{var r;if(t.key==="Escape"&&s(this,Kt)!==null){t.preventDefault(),t.stopPropagation(),u(this,V,as).call(this);return}D_(t,navigator.platform)&&(t.preventDefault(),t.stopPropagation(),(r=s(this,er))==null||r.handleNavigationKey(t.key))});p(this,bp,t=>{h(this,Ru,t??void 0),this.render()});p(this,lo,()=>{this.render()});p(this,Sp,()=>u(this,V,ud).call(this,!0));p(this,_p,()=>u(this,V,ud).call(this,!1));p(this,Ap,()=>{const t=s(this,me)?!s(this,gn):!s(this,Dt);u(this,V,ud).call(this,t)});p(this,xu,t=>{const r=s(this,zi),i=u(this,V,os).call(this).closest("#app");if(!r||!i)return;h(this,Ni,t);const o=Fz(1-t/r.expandedSidebarWidth,r),a=(c,d)=>{i.style.setProperty(`--motion-${c}`,`${d}px`)};a("boundary",o.sidebarBoundary),a("toggle-left",o.toggleLeft),a("toggle-top",r.toggleTop),a("toggle-width",r.toggleWidth),a("toggle-height",r.toggleHeight),a("toggle-wipe",o.toggleWipe),a("lead-reservation",o.leadReservation),a("switcher-left",r.collapsedToggleLeft+r.toggleWidth+r.toggleSwitcherGap-o.sidebarBoundary-r.barInset),i.style.setProperty("--motion-titlebar-opacity",String(o.titlebarOpacity)),i.style.setProperty("--motion-switcher-opacity",String(o.switcherOpacity));const l=u(this,V,os).call(this);l.style.removeProperty("left"),l.style.removeProperty("top")});p(this,Ep,t=>{var o;if(!s(this,me))return;const r=t===0;if(r!==s(this,gn))return;const i=document.activeElement===s(this,Xt);u(this,V,ri).call(this,r),this.render(),i&&((o=s(this,Xt))==null||o.focus({preventScroll:!0}))});p(this,kp,t=>{if(t.button!==0||s(this,Kt)!==null)return;const r=t.currentTarget,i=r.closest("#app");i!==null&&(r.setPointerCapture(t.pointerId),h(this,Kt,{pointerId:t.pointerId,startX:t.clientX,startWidth:s(this,ot),root:i}),t.preventDefault())});p(this,Cp,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,V,sc).call(this,r.root,r.startWidth+t.clientX-r.startX)});p(this,Tp,t=>{var o;const r=s(this,Kt);if(r===null||t.pointerId!==r.pointerId)return;h(this,Kt,null);const i=((o=s(this,oo))==null?void 0:o.commit(s(this,ot)))??s(this,ot);u(this,V,sc).call(this,r.root,i)});p(this,Pu,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,V,as).call(this)});p(this,$p,t=>{var i;const r=t.currentTarget.closest("#app");r!==null&&((i=s(this,oo))==null||i.clear(),u(this,V,sc).call(this,r,mh))})}update(t,r){const i=r[0],o=r[1].sidebarWidthPreference,a=r[1].sidebarCollapsedPreference;s(this,er)!==i&&(s(this,er)!==null&&this.isConnected&&(s(this,er).removeEventListener("change",s(this,lo)),i.addEventListener("change",s(this,lo))),h(this,er,i));const l=s(this,oo)!==o,c=s(this,Ja)!==a;return l&&(u(this,V,as).call(this),h(this,oo,o),h(this,ot,o.read()??mh)),c&&(u(this,V,as).call(this),h(this,Ja,a),h(this,Dt,a.read())),(l||c)&&u(this,V,ri).call(this,s(this,Dt)),super.update(t,r)}connected(){var t;(t=s(this,er))==null||t.addEventListener("change",s(this,lo)),document.addEventListener("keydown",s(this,Iu),{capture:!0})}disconnected(){var t,r;u(this,V,as).call(this),s(this,me)?u(this,V,ri).call(this,s(this,gn)):(t=s(this,ao))==null||t.cancel(),(r=s(this,er))==null||r.removeEventListener("change",s(this,lo)),document.removeEventListener("keydown",s(this,Iu),{capture:!0})}template(t,r){const i=m9(t.snapshot,r.runtimeServerURL),o=t.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),M`
807
807
  <div
808
808
  id="app"
809
809
  tabindex="-1"
810
810
  data-app-state=${i.kind}
811
811
  ?data-sidebar-transition=${s(this,me)}
812
812
  ?data-sidebar-motion=${s(this,me)}
813
- style=${u(this,H,e_).call(this)}
813
+ style=${u(this,V,e_).call(this)}
814
814
  >
815
- ${dZ(i)?u(this,H,t_).call(this,t,o,r):null}
816
- ${pZ(i)?AU(i,t,r.desktopUpdate):null}
815
+ ${AH(i)?u(this,V,t_).call(this,t,o,r):null}
816
+ ${EH(i)?DZ(i,t,r.desktopUpdate):null}
817
817
  </div>
818
818
  <div id="foreground-overlay" inert aria-hidden="true"></div>
819
- `}}er=new WeakMap,Ru=new WeakMap,oo=new WeakMap,Ja=new WeakMap,ot=new WeakMap,Lt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,ao=new WeakMap,me=new WeakMap,gn=new WeakMap,Ni=new WeakMap,Ka=new WeakMap,zi=new WeakMap,Iu=new WeakMap,bp=new WeakMap,lo=new WeakMap,Sp=new WeakMap,_p=new WeakMap,Ap=new WeakMap,H=new WeakSet,ud=function(t){var c,d;if(!s(this,me)&&s(this,Lt)===t||s(this,me)&&s(this,gn)===t)return;u(this,H,as).call(this);const r=document.activeElement===s(this,Xt);if((c=s(this,Ja))==null||c.setCollapsed(t),matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,H,ri).call(this,t),this.render(),r&&((d=s(this,Xt))==null||d.focus({preventScroll:!0}));return}if(h(this,gn,t),s(this,me)){u(this,H,ic).call(this),u(this,H,Gm).call(this);return}const i=u(this,H,os).call(this),o=i.closest("#app"),a=i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();if(!o||!l||a.width===0){u(this,H,ri).call(this,t),this.render();return}for(const f of o.getAnimations({subtree:!0}))f.cancel();h(this,me,!0),h(this,Ka,a.top-l.top),h(this,zi,null),i.style.left=`${a.left-l.left}px`,i.style.top=`${s(this,Ka)}px`,u(this,H,ic).call(this),this.render(),queueMicrotask(()=>{s(this,me)&&(u(this,H,XS).call(this),r&&i.focus({preventScroll:!0}),u(this,H,Gm).call(this))})},Gm=function(){const t=u(this,H,os).call(this).closest("#app"),r=s(this,ao);if(!t||!r||!s(this,zi))return;const i=s(this,gn)?0:s(this,ot);r.move({root:t,width:s(this,ot),target:i,onFrame:s(this,xu),onFinish:s(this,Ep)})},XS=function(){const r=u(this,H,os).call(this).closest("#app"),i=r==null?void 0:r.querySelector(".sidebar-titlebar > .sidebar-toggle-seat"),o=r==null?void 0:r.querySelector(".top-bar > .top-bar-lead"),a=o==null?void 0:o.querySelector(":scope > .sidebar-toggle-seat"),l=o==null?void 0:o.querySelector(":scope > .channel-switcher"),c=o==null?void 0:o.closest(".top-bar");if(!r||!i||!o||!a||!c){u(this,H,ri).call(this,s(this,gn)),this.render();return}const d=i.closest(".app-sidebar");r.removeAttribute("data-sidebar-motion");const f=r.getBoundingClientRect(),g=o.style.display;o.style.display="none";const y=i.getBoundingClientRect();d.style.marginLeft=`${-s(this,ot)}px`,o.style.display=g;const v=a.getBoundingClientRect(),_=l==null?void 0:l.getBoundingClientRect();h(this,zi,{expandedSidebarWidth:s(this,ot),expandedToggleLeft:y.left-f.left,collapsedToggleLeft:v.left-f.left,toggleTop:s(this,Ka),toggleWidth:v.width,toggleHeight:v.height,toggleSwitcherGap:_?_.left-v.right:0,collapsedLeadReservation:o.getBoundingClientRect().width,hasSwitcher:!!l,barInset:c.getBoundingClientRect().left-f.left}),d.style.removeProperty("margin-left"),r.setAttribute("data-sidebar-motion",""),s(this,xu).call(this,s(this,Ni))},xu=new WeakMap,Ep=new WeakMap,ri=function(t){var r;(r=s(this,ao))==null||r.cancel(),h(this,Lt,t),h(this,me,!1),h(this,Ni,t?0:s(this,ot)),h(this,ao,new L9(s(this,Ni))),h(this,zi,null),u(this,H,QS).call(this),u(this,H,ic).call(this)},os=function(){if(s(this,Xt)!==null)return s(this,Xt);const t=document.createElement("button");return t.type="button",t.setAttribute("variant","ghost"),t.setAttribute("icon",""),t.append(u(this,H,hd).call(this)),t.addEventListener("pointerdown",r=>{r.button===0&&t.setPointerCapture(r.pointerId)}),t.addEventListener("click",s(this,Ap)),h(this,Xt,t),u(this,H,ic).call(this),t},ic=function(){var o;const t=s(this,Xt);if(t===null)return;const r=s(this,me)?s(this,gn):s(this,Lt);t.className=s(this,me)?"sidebar-motion-toggle sidebar-toggle":r?"sidebar-expand":"sidebar-collapse",s(this,me)?t.querySelectorAll(":scope > .sidebar-toggle-paint").length!==2&&t.replaceChildren(u(this,H,Ym).call(this,"expanded-paint"),u(this,H,Ym).call(this,"collapsed-paint")):(t.children.length!==1||!((o=t.firstElementChild)!=null&&o.matches("tv-icon[name='sidebar']")))&&t.replaceChildren(u(this,H,hd).call(this));const i=r?"Show sidebar":"Collapse sidebar";t.setAttribute("aria-label",i),t.title=i},hd=function(){const t=document.createElement("tv-icon");return t.setAttribute("name","sidebar"),t.setAttribute("size","sm"),t},Ym=function(t){const r=document.createElement("span");return r.className=`sidebar-toggle-paint ${t}`,r.setAttribute("aria-hidden","true"),r.append(u(this,H,hd).call(this)),r},QS=function(){const t=s(this,Xt);t!==null&&(t.style.removeProperty("left"),t.style.removeProperty("top"))},e_=function(){const t=[`--sidebar-width: ${s(this,ot)}px`];return s(this,me)&&t.push(`--motion-boundary: ${s(this,Ni)}px`),t.join("; ")},kp=new WeakMap,Cp=new WeakMap,Tp=new WeakMap,Pu=new WeakMap,$p=new WeakMap,as=function(){const t=s(this,Kt);if(t===null)return;h(this,Kt,null),u(this,H,sc).call(this,t.root,t.startWidth);const r=t.root.querySelector(".app-sidebar-resize");r!=null&&r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId)},sc=function(t,r){h(this,ot,B8(r)),u(this,H,ri).call(this,s(this,Lt)),t.style.setProperty("--sidebar-width",`${s(this,ot)}px`)},t_=function(t,r,i){const o=!s(this,Lt)||s(this,me),a=u(this,H,os).call(this);return M`
819
+ `}}er=new WeakMap,Ru=new WeakMap,oo=new WeakMap,Ja=new WeakMap,ot=new WeakMap,Dt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,ao=new WeakMap,me=new WeakMap,gn=new WeakMap,Ni=new WeakMap,Ka=new WeakMap,zi=new WeakMap,Iu=new WeakMap,bp=new WeakMap,lo=new WeakMap,Sp=new WeakMap,_p=new WeakMap,Ap=new WeakMap,V=new WeakSet,ud=function(t){var c,d;if(!s(this,me)&&s(this,Dt)===t||s(this,me)&&s(this,gn)===t)return;u(this,V,as).call(this);const r=document.activeElement===s(this,Xt);if((c=s(this,Ja))==null||c.setCollapsed(t),matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,V,ri).call(this,t),this.render(),r&&((d=s(this,Xt))==null||d.focus({preventScroll:!0}));return}if(h(this,gn,t),s(this,me)){u(this,V,ic).call(this),u(this,V,jm).call(this);return}const i=u(this,V,os).call(this),o=i.closest("#app"),a=i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();if(!o||!l||a.width===0){u(this,V,ri).call(this,t),this.render();return}for(const f of o.getAnimations({subtree:!0}))f.cancel();h(this,me,!0),h(this,Ka,a.top-l.top),h(this,zi,null),i.style.left=`${a.left-l.left}px`,i.style.top=`${s(this,Ka)}px`,u(this,V,ic).call(this),this.render(),queueMicrotask(()=>{s(this,me)&&(u(this,V,XS).call(this),r&&i.focus({preventScroll:!0}),u(this,V,jm).call(this))})},jm=function(){const t=u(this,V,os).call(this).closest("#app"),r=s(this,ao);if(!t||!r||!s(this,zi))return;const i=s(this,gn)?0:s(this,ot);r.move({root:t,width:s(this,ot),target:i,onFrame:s(this,xu),onFinish:s(this,Ep)})},XS=function(){const r=u(this,V,os).call(this).closest("#app"),i=r==null?void 0:r.querySelector(".sidebar-titlebar > .sidebar-toggle-seat"),o=r==null?void 0:r.querySelector(".top-bar > .top-bar-lead"),a=o==null?void 0:o.querySelector(":scope > .sidebar-toggle-seat"),l=o==null?void 0:o.querySelector(":scope > .channel-switcher"),c=o==null?void 0:o.closest(".top-bar");if(!r||!i||!o||!a||!c){u(this,V,ri).call(this,s(this,gn)),this.render();return}const d=i.closest(".app-sidebar");r.removeAttribute("data-sidebar-motion");const f=r.getBoundingClientRect(),g=o.style.display;o.style.display="none";const y=i.getBoundingClientRect();d.style.marginLeft=`${-s(this,ot)}px`,o.style.display=g;const v=a.getBoundingClientRect(),_=l==null?void 0:l.getBoundingClientRect();h(this,zi,{expandedSidebarWidth:s(this,ot),expandedToggleLeft:y.left-f.left,collapsedToggleLeft:v.left-f.left,toggleTop:s(this,Ka),toggleWidth:v.width,toggleHeight:v.height,toggleSwitcherGap:_?_.left-v.right:0,collapsedLeadReservation:o.getBoundingClientRect().width,hasSwitcher:!!l,barInset:c.getBoundingClientRect().left-f.left}),d.style.removeProperty("margin-left"),r.setAttribute("data-sidebar-motion",""),s(this,xu).call(this,s(this,Ni))},xu=new WeakMap,Ep=new WeakMap,ri=function(t){var r;(r=s(this,ao))==null||r.cancel(),h(this,Dt,t),h(this,me,!1),h(this,Ni,t?0:s(this,ot)),h(this,ao,new qz(s(this,Ni))),h(this,zi,null),u(this,V,QS).call(this),u(this,V,ic).call(this)},os=function(){if(s(this,Xt)!==null)return s(this,Xt);const t=document.createElement("button");return t.type="button",t.setAttribute("variant","ghost"),t.setAttribute("icon",""),t.append(u(this,V,hd).call(this)),t.addEventListener("pointerdown",r=>{r.button===0&&t.setPointerCapture(r.pointerId)}),t.addEventListener("click",s(this,Ap)),h(this,Xt,t),u(this,V,ic).call(this),t},ic=function(){var o;const t=s(this,Xt);if(t===null)return;const r=s(this,me)?s(this,gn):s(this,Dt);t.className=s(this,me)?"sidebar-motion-toggle sidebar-toggle":r?"sidebar-expand":"sidebar-collapse",s(this,me)?t.querySelectorAll(":scope > .sidebar-toggle-paint").length!==2&&t.replaceChildren(u(this,V,Gm).call(this,"expanded-paint"),u(this,V,Gm).call(this,"collapsed-paint")):(t.children.length!==1||!((o=t.firstElementChild)!=null&&o.matches("tv-icon[name='sidebar']")))&&t.replaceChildren(u(this,V,hd).call(this));const i=r?"Show sidebar":"Collapse sidebar";t.setAttribute("aria-label",i),t.title=i},hd=function(){const t=document.createElement("tv-icon");return t.setAttribute("name","sidebar"),t.setAttribute("size","sm"),t},Gm=function(t){const r=document.createElement("span");return r.className=`sidebar-toggle-paint ${t}`,r.setAttribute("aria-hidden","true"),r.append(u(this,V,hd).call(this)),r},QS=function(){const t=s(this,Xt);t!==null&&(t.style.removeProperty("left"),t.style.removeProperty("top"))},e_=function(){const t=[`--sidebar-width: ${s(this,ot)}px`];return s(this,me)&&t.push(`--motion-boundary: ${s(this,Ni)}px`),t.join("; ")},kp=new WeakMap,Cp=new WeakMap,Tp=new WeakMap,Pu=new WeakMap,$p=new WeakMap,as=function(){const t=s(this,Kt);if(t===null)return;h(this,Kt,null),u(this,V,sc).call(this,t.root,t.startWidth);const r=t.root.querySelector(".app-sidebar-resize");r!=null&&r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId)},sc=function(t,r){h(this,ot,Bb(r)),u(this,V,ri).call(this,s(this,Dt)),t.style.setProperty("--sidebar-width",`${s(this,ot)}px`)},t_=function(t,r,i){const o=!s(this,Dt)||s(this,me),a=u(this,V,os).call(this);return M`
820
820
  ${o?M`
821
821
  <aside class="app-sidebar">
822
- ${S9(t,r,i.electronMode,s(this,Sp),s(this,me)?null:a,s(this,me))}
822
+ ${Pz(t,r,i.electronMode,s(this,Sp),s(this,me)?null:a,s(this,me))}
823
823
  </aside>
824
824
  ${s(this,me)?null:M`
825
825
  <div
@@ -835,8 +835,8 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
835
835
  `}
836
836
  `:null}
837
837
  <main class="app-main">
838
- ${cZ(t,r,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,onTabReorderChange:s(this,bp),collapsed:s(this,Lt),onExpandSidebar:s(this,_p),sidebarToggle:s(this,me)?null:s(this,Lt)?a:void 0,sidebarTransitioning:s(this,me)})}
839
- ${l7(t,r.focusedChannel,s(this,Ru),s(this,me))}
838
+ ${bH(t,r,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,onTabReorderChange:s(this,bp),collapsed:s(this,Dt),onExpandSidebar:s(this,_p),sidebarToggle:s(this,me)?null:s(this,Dt)?a:void 0,sidebarTransitioning:s(this,me)})}
839
+ ${w7(t,r.focusedChannel,s(this,Ru),s(this,me))}
840
840
  </main>
841
841
  ${s(this,me)?a:null}
842
- `};const hZ=zt(uZ);function dZ(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function pZ(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const n_="television-appearance-mode";function fZ(n){return n==="system"||n==="light"||n==="dark"}function mZ(){try{const n=window.localStorage.getItem(n_);return fZ(n)?n:"system"}catch{return"system"}}function r_(){return window.__televisionAppearanceResolver??YO(mZ())}function gZ(n,e){return e==="light"||e==="dark"?e:n}function vZ(n){r_().setPreference(n);try{window.localStorage.setItem(n_,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Ng();Object.defineProperty(window,"__tvVersion",{value:Ng(),writable:!1,configurable:!1});r_();const yZ=DZ(),Sn=Br();Sn?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const Qg=c5(),i_=u5(),wZ=new lR(Sn?"television-electron":"television-browser",aR()),bZ=new DO(window.localStorage),SZ=new xO(window.localStorage),Uw=U8(),_Z=Uw?v5({storage:Uw,clientApp:Sn?"desktop":"browser",desktopAppVersion:Sn?F2():null}):null,e1=Vi(Sn?Qg:window.location.origin),t1=zO({search:window.location.search}),_n=zg(),s_=new BO,n1=VO({detection:t1,primaryServerURL:e1,navigationLatch:_n,presentation:s_}),Se=new bO({localStore:wZ,serverURL:Qg,launchToken:i_,telemetryMeta:_Z,navigationPending:()=>_n.pending,...t1.electron?{decideBoot:n=>n1.decideBoot(n)}:{}}),AZ=n=>{J$(Ke,n)},Ke=new Z$({connectionOwner:Se,navigationKeyHandler:AZ,retainedGateHalted:()=>n1.gated}),ps=globalThis.__televisionNativeBridge;Sn&&ps&&ps.onNavigationKey(n=>Ke.handleNavigationKey(n));const EZ=new GO({electron:Sn,bridge:ps});if(i_){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}NO({owner:Se,primaryServerURL:e1,navigationLatch:_n});n1.attach(Se);const kZ=()=>{const n=Se.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));RO(t)}).catch(()=>{})},o_=()=>{Se.connection.status==="connected"&&M9(Se.connection.url)};let Ld=null,Jm=null,a_=Se.connection.status;const CZ=()=>{_n.pending||_n.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const e=new URL(window.location.href);e.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`)}window.location.reload()})},l_=(n,e,t)=>{if(_n.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(e)},i=Ld,o=z9(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),d=i!==null&&!a&&l&&!c,f=i!==null&&p_(i.consentIds,r.consentIds);if(Ld=r,o!==null&&(a||d)){CZ();return}if(o===null&&c){lw(Se.connection.url);return}o!==null&&c&&t&&!a&&f&&lw(Se.connection.url)},TZ=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},c_=(n,e)=>{if(_n.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const t={activeThemeName:n,serverURL:Se.connection.url,appearance:TZ()},r=Jm;Jm=t,!(!e&&(r==null?void 0:r.activeThemeName)===t.activeThemeName&&r.serverURL===t.serverURL&&r.appearance===t.appearance)&&U9(t.serverURL,t.activeThemeName,()=>Ke.listThemes())},u_=()=>{if(!_n.pending){if(a_=Se.connection.status,Se.connection.status!=="connected"){O9(),N9(),Z9(),Ld=null,Jm=null;return}o_(),kZ()}};let Km,Xm;const r1=(n,e)=>{const t=gZ(n,e);t!==Km&&(vZ(t),Km=t),t!==Xm&&Sn&&typeof(ps==null?void 0:ps.setAppearanceMode)=="function"&&(ps.setAppearanceMode(t),Xm=t)},Xp=()=>{const n=Ke.snapshot;if(n.connection.status!=="connected"){Km=void 0,Xm=void 0;return}n.ready&&(r1(n.display.appearanceMode,n.display.activeThemeColorScheme),a_===Se.connection.status&&(l_(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),c_(n.display.activeThemeName,!1)))},$Z=n=>{if(_n.pending)return;r1(Ke.snapshot.display.appearanceMode,n.activeThemeColorScheme);const e=Ld,t=e!==null&&e.activeThemeName===n.themeName&&!p_(e.consentIds,new Set(n.themeJavaScriptConsentIds));l_(n.themeName,n.themeJavaScriptConsentIds,!0),!(_n.pending||t)&&(o_(),c_(n.themeName,!0))},RZ=n=>{_n.pending||r1(n.appearanceMode,Ke.snapshot.display.activeThemeColorScheme)};u_();Xp();Se.addEventListener("change",u_);Ke.addEventListener("change",Xp);Ke.addEventListener("theme-changed",$Z);Ke.addEventListener("appearance-changed",RZ);const IZ=new MutationObserver(()=>{Xp()});IZ.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});Fb.register("ServerConnectionOwner",()=>Se);Fb.register("ApplicationService",()=>Ke);const hc=globalThis.__telepath??(globalThis.__telepath={});hc.applicationService=Ke;hc.connectionOwner=Se;const xZ=hc.renderCompleteCallbacks??(hc.renderCompleteCallbacks=new Set);Sn&&document.body.classList.add("electron");let Zw=!1,Fw=!1;const PZ=n=>{if(!yZ||Fw||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const e=document.querySelector("#settings-popover");e!==null&&(Fw=!0,e.setAttribute("open",""))},h_=()=>{Zw||(Vh(hZ(Ke,{runtimeServerURL:Qg,electronMode:Sn,connectionOwner:Se,primaryServerURL:e1,updatePresentation:s_,desktopRecommendation:t1,desktopUpdate:EZ,sidebarWidthPreference:bZ,sidebarCollapsedPreference:SZ,onRenderComplete(n){PZ(n);for(const e of xZ)e(n)}}),document.body),Zw=!0,Xp())},d_=()=>{const n=Se.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Se.connectError===null||(Se.removeEventListener("change",d_),h_())};Sn?Se.addEventListener("change",d_):h_();Se.connect();function DZ(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function p_(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}
842
+ `};const _H=zt(SH);function AH(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function EH(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const n_="television-appearance-mode";function kH(n){return n==="system"||n==="light"||n==="dark"}function CH(){try{const n=window.localStorage.getItem(n_);return kH(n)?n:"system"}catch{return"system"}}function r_(){return window.__televisionAppearanceResolver??JO(CH())}function TH(n,e){return e==="light"||e==="dark"?e:n}function $H(n){r_().setPreference(n);try{window.localStorage.setItem(n_,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Og();Object.defineProperty(window,"__tvVersion",{value:Og(),writable:!1,configurable:!1});r_();const RH=BH(),Sn=Br();Sn?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const Xg=uP(),i_=hP(),IH=new c$(Sn?"television-electron":"television-browser",l$()),xH=new DO(window.localStorage),PH=new PO(window.localStorage),Nw=Zb(),LH=Nw?yP({storage:Nw,clientApp:Sn?"desktop":"browser",desktopAppVersion:Sn?U8():null}):null,Qg=Fi(Sn?Xg:window.location.origin),e1=ZO({search:window.location.search}),_n=Ng(),s_=new qO,t1=BO({detection:e1,primaryServerURL:Qg,navigationLatch:_n,presentation:s_}),Se=new SO({localStore:IH,serverURL:Xg,launchToken:i_,telemetryMeta:LH,navigationPending:()=>_n.pending,...e1.electron?{decideBoot:n=>t1.decideBoot(n)}:{}}),DH=n=>{KT(Ke,n)},Ke=new UT({connectionOwner:Se,navigationKeyHandler:DH,retainedGateHalted:()=>t1.gated}),ps=globalThis.__televisionNativeBridge;Sn&&ps&&ps.onNavigationKey(n=>Ke.handleNavigationKey(n));const MH=new YO({electron:Sn,bridge:ps});if(i_){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}zO({owner:Se,primaryServerURL:Qg,navigationLatch:_n});t1.attach(Se);const OH=()=>{const n=Se.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));IO(t)}).catch(()=>{})},o_=()=>{Se.connection.status==="connected"&&Wz(Se.connection.url)};let Dd=null,Ym=null,a_=Se.connection.status;const NH=()=>{_n.pending||_n.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const e=new URL(window.location.href);e.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`)}window.location.reload()})},l_=(n,e,t)=>{if(_n.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(e)},i=Dd,o=Yz(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),d=i!==null&&!a&&l&&!c,f=i!==null&&p_(i.consentIds,r.consentIds);if(Dd=r,o!==null&&(a||d)){NH();return}if(o===null&&c){ow(Se.connection.url);return}o!==null&&c&&t&&!a&&f&&ow(Se.connection.url)},zH=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},c_=(n,e)=>{if(_n.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const t={activeThemeName:n,serverURL:Se.connection.url,appearance:zH()},r=Ym;Ym=t,!(!e&&(r==null?void 0:r.activeThemeName)===t.activeThemeName&&r.serverURL===t.serverURL&&r.appearance===t.appearance)&&Jz(t.serverURL,t.activeThemeName,()=>Ke.listThemes())},u_=()=>{if(!_n.pending){if(a_=Se.connection.status,Se.connection.status!=="connected"){jz(),Gz(),Kz(),Dd=null,Ym=null;return}o_(),OH()}};let Jm,Km;const n1=(n,e)=>{const t=TH(n,e);t!==Jm&&($H(t),Jm=t),t!==Km&&Sn&&typeof(ps==null?void 0:ps.setAppearanceMode)=="function"&&(ps.setAppearanceMode(t),Km=t)},Xp=()=>{const n=Ke.snapshot;if(n.connection.status!=="connected"){Jm=void 0,Km=void 0;return}n.ready&&(n1(n.display.appearanceMode,n.display.activeThemeColorScheme),a_===Se.connection.status&&(l_(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),c_(n.display.activeThemeName,!1)))},ZH=n=>{if(_n.pending)return;n1(Ke.snapshot.display.appearanceMode,n.activeThemeColorScheme);const e=Dd,t=e!==null&&e.activeThemeName===n.themeName&&!p_(e.consentIds,new Set(n.themeJavaScriptConsentIds));l_(n.themeName,n.themeJavaScriptConsentIds,!0),!(_n.pending||t)&&(o_(),c_(n.themeName,!0))},HH=n=>{_n.pending||n1(n.appearanceMode,Ke.snapshot.display.activeThemeColorScheme)};u_();Xp();Se.addEventListener("change",u_);Ke.addEventListener("change",Xp);Ke.addEventListener("theme-changed",ZH);Ke.addEventListener("appearance-changed",HH);const UH=new MutationObserver(()=>{Xp()});UH.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});U2.register("ServerConnectionOwner",()=>Se);U2.register("ApplicationService",()=>Ke);const hc=globalThis.__telepath??(globalThis.__telepath={});hc.applicationService=Ke;hc.connectionOwner=Se;const VH=hc.renderCompleteCallbacks??(hc.renderCompleteCallbacks=new Set);Sn&&document.body.classList.add("electron");let zw=!1,Zw=!1;const FH=n=>{if(!RH||Zw||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const e=document.querySelector("#settings-popover");e!==null&&(Zw=!0,e.setAttribute("open",""))},h_=()=>{zw||(Fh(_H(Ke,{runtimeServerURL:Xg,electronMode:Sn,connectionOwner:Se,primaryServerURL:Qg,updatePresentation:s_,desktopRecommendation:e1,desktopUpdate:MH,sidebarWidthPreference:xH,sidebarCollapsedPreference:PH,onRenderComplete(n){FH(n);for(const e of VH)e(n)}}),document.body),zw=!0,Xp())},d_=()=>{const n=Se.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Se.connectError===null||(Se.removeEventListener("change",d_),h_())};Sn?Se.addEventListener("change",d_):h_();Se.connect();function BH(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function p_(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}