@telepath-computer/television 1.4.8 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- var __=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 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 $1=Object.prototype.toString,Fw=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 Z_(){if(R1)return df;R1=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Fw,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_=Fw,I1=Object.keys,kh=I1?function(e){return I1(e)}:Z_(),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 U_(r)?x1(H_.call(r)):x1(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,P1=Lu,B_=Gr,ko=re,L1=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=!!L1&&L1(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=Lu,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_=V_,W_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",j_=Object.prototype.toString,G_=Array.prototype.concat,D1=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?D1(n,e,t,!0):D1(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,e4=Yw,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=Gw,Jw=Yw,i4=t4,s4=Jw(),Kw=function(){return s4};n4(Kw,{getPolyfill:Jw,implementation:r4,shim:i4});var Qm=Kw,Yr=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},eg=Object,Xw=Error,o4=EvalError,a4=RangeError,tg=ReferenceError,l4=URIError,c4=Math.abs,u4=Math.floor,h4=Math.max,d4=Math.min,p4=Math.pow,f4=Math.round,ng=Number.isNaN||function(e){return e!==e},m4=ng,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},M1=typeof Symbol<"u"&&Symbol,v4=ol,rg=function(){return typeof M1!="function"||typeof Symbol!="function"||typeof M1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v4()},Qw=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,y4=eg,e2=y4.getPrototypeOf||null,w4="Function.prototype.bind called on incompatible ",b4=Object.prototype.toString,S4=Math.max,_4="[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},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,O1(r,arguments));return Object(f)===f?f:this}return t.apply(e,O1(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,ig=Function.prototype.call,sg=Function.prototype.apply,T4=typeof Reflect<"u"&&Reflect&&Reflect.apply,$4=Du,R4=sg,I4=ig,x4=T4,t2=x4||$4.call(I4,R4),P4=Du,L4=re,D4=ig,M4=t2,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,N1=sl,n2;try{n2=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var pf=!!n2&&N1&&N1(Object.prototype,"__proto__"),r2=Object,z1=r2.getPrototypeOf,N4=pf&&typeof pf.get=="function"?O4([pf.get]):typeof z1=="function"?function(e){return z1(e==null?e:r2(e))}:!1,Z1=Qw,H1=e2,U1=N4,i2=Z1?function(e){return Z1(e)}:H1?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return H1(e)}:U1?function(e){return U1(e)}:null,z4=Function.prototype.call,Z4=Object.prototype.hasOwnProperty,H4=Du,Jr=H4.call(z4,Z4),ne,U4=eg,V4=Xw,F4=o4,B4=a4,q4=tg,Xa=Gr,Yo=re,W4=l4,j4=c4,G4=u4,Y4=h4,J4=d4,K4=p4,X4=f4,Q4=g4,s2=Function,ff=function(n){try{return s2('"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=rg(),Ue=i2,nA=e2,rA=Qw,o2=sg,Mu=ig,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%":s2,"%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%":o2,"%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},V1={__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(o2,Array.prototype.splice),F1=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 F1(e,uA,function(o,a,l,c){i[i.length]=l?F1(c,hA,"$1"):a||o}),i},pA=function(e,t){var r=e,i;if(dd(V1,r)&&(i=V1[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},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 fA=Rp,W1=Lu,a2=fA.hasArrayLengthDefineBug(),mA=a2&&og(),gA=Gi(),vA=gA("Object.prototype.propertyIsEnumerable"),ag=function(e,t,r,i,o,a){if(!W1){if(!e(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||o in i&&vA(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&&mA(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(W1(i,o,r(a)),!0)},yA=re,El=Jr,wA={__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)&&!wA[t])return!1;var r=El(e,"[[Value]]")||El(e,"[[Writable]]"),i=El(e,"[[Get]]")||El(e,"[[Set]]");if(r&&i)throw new yA("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},bA=re,SA=al,_A=l2,c2=function(e){if(typeof e<"u"&&!SA(e))throw new bA("Assertion failed: `Desc` must be a Property Descriptor");return _A(e)},AA=re,j1=Jr,EA=al,u2=function(e){if(typeof e>"u")return!1;if(!EA(e))throw new AA("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,h2=function(e,t){return e===t?e===0?1/e===1/t:!0:G1(e)&&G1(t)},Y1=re,kA=Yr,CA=ag,TA=c2,$A=u2,RA=ll,IA=h2,lg=function(e,t,r){if(!kA(e))throw new Y1("Assertion failed: Type(O) is not Object");if(!RA(t))throw new Y1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return CA($A,IA,TA,e,t,i)},d2=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 xA=/^\s*class\b/,a0=function(e){try{var t=d2.call(e);return xA.test(t)}catch{return!1}},yf=function(e){try{return a0(e)?!1:(d2.call(e),!0)}catch{return!1}},Ih=Object.prototype.toString,PA="[object Object]",LA="[object Function]",DA="[object GeneratorFunction]",MA="[object HTMLAllCollection]",OA="[object HTML document.all class]",NA="[object HTMLCollection]",zA=typeof Symbol=="function"&&!!Symbol.toStringTag,ZA=!(0 in[,]),l0=function(){return!1};if(typeof document=="object"){var HA=document.all;Ih.call(HA)===Ih.call(document.all)&&(l0=function(e){if((ZA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ih.call(e);return(t===MA||t===OA||t===NA||t===PA)&&e("")==null}catch{}return!1})}var p2=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(zA)return yf(e);if(a0(e))return!1;var t=Ih.call(e);return t!==LA&&t!==DA&&!/^\[object HTML/.test(t)?!1:yf(e)},UA=p2,VA=function(e){return!!e},Tn=Jr,rh=re,FA=Yr,J1=UA,wf=VA,BA=function(e){if(!FA(e))throw new rh("ToPropertyDescriptor requires an object");var t={};if(Tn(e,"enumerable")&&(t["[[Enumerable]]"]=wf(e.enumerable)),Tn(e,"configurable")&&(t["[[Configurable]]"]=wf(e.configurable)),Tn(e,"value")&&(t["[[Value]]"]=e.value),Tn(e,"writable")&&(t["[[Writable]]"]=wf(e.writable)),Tn(e,"get")){var r=e.get;if(typeof r<"u"&&!J1(r))throw new rh("getter must be a function");t["[[Get]]"]=r}if(Tn(e,"set")){var i=e.set;if(typeof i<"u"&&!J1(i))throw new rh("setter must be a function");t["[[Set]]"]=i}if((Tn(t,"[[Get]]")||Tn(t,"[[Set]]"))&&(Tn(t,"[[Value]]")||Tn(t,"[[Writable]]")))throw new rh("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},bf=re,qA=Yr,K1=al,WA=ag,jA=c2,GA=u2,YA=ll,JA=h2,KA=BA,XA=function(e,t,r){if(!qA(e))throw new bf("Assertion failed: Type(O) is not Object");if(!YA(t))throw new bf("Assertion failed: P is not a Property Key");var i=K1(r)?r:KA(r);if(!K1(i))throw new bf("Assertion failed: Desc is not a valid Property Descriptor");return WA(GA,JA,jA,e,t,i)},X1=re,QA=Yr,eE=XA,tE=ll,nE=function(e,t,r){if(!QA(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,f2={};try{f2.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var lE=!("toString"in f2),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=i2,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,m2=wE,bE=Rp(),cg=Xw;function Nu(n,e,t){var r=new cg(t);return m2(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!");m2(Nu.prototype,cg.prototype);var SE=Nu,_E=SE,g2=function(){return typeof SuppressedError=="function"?SuppressedError:_E},AE=mo,sv=Qm(),EE=g2,kE=function(){var e=EE();return AE(sv,{SuppressedError:e},{SuppressedError:function(){return sv.SuppressedError!==e}}),e};kE();var CE=re,TE=al,$E=l2,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,LE=function(e,t){return e===t?e===0?1/e===1/t:!0:av(e)&&av(t)},cl=p2,DE=function(e){return!!e},$n=Jr,ih=re,ME=Yr,lv=cl,Af=DE,OE=function(e){if(!ME(e))throw new ih("ToPropertyDescriptor requires an object");var t={};if($n(e,"enumerable")&&(t["[[Enumerable]]"]=Af(e.enumerable)),$n(e,"configurable")&&(t["[[Configurable]]"]=Af(e.configurable)),$n(e,"value")&&(t["[[Value]]"]=e.value),$n(e,"writable")&&(t["[[Writable]]"]=Af(e.writable)),$n(e,"get")){var r=e.get;if(typeof r<"u"&&!lv(r))throw new ih("getter must be a function");t["[[Get]]"]=r}if($n(e,"set")){var i=e.set;if(typeof i<"u"&&!lv(i))throw new ih("setter must be a function");t["[[Set]]"]=i}if(($n(t,"[[Get]]")||$n(t,"[[Set]]"))&&($n(t,"[[Value]]")||$n(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,ZE=RE,HE=PE,UE=ll,VE=LE,FE=OE,zu=function(e,t,r){if(!NE(e))throw new Ef("Assertion failed: Type(O) is not Object");if(!UE(t))throw new Ef("Assertion failed: P is not a Property Key");var i=cv(r)?r:FE(r);if(!cv(i))throw new Ef("Assertion failed: Desc is not a valid Property Descriptor");return zE(HE,VE,ZE,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,Zi=String.prototype.replace,_k=String.prototype.toUpperCase,pv=String.prototype.toLowerCase,v2=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,y2=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||v2.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 Zi.call(i,t,"$&_")+"."+Zi.call(Zi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zi.call(e,t,"$&_")}var h0=fk,yv=h0.custom,wv=S2(yv)?yv:null,w2={__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(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?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=Vk(o,r);if(typeof i>"u")i=[];else if(_2(i,e)>=0)return"[Circular]";function y(Ze,le,sr){if(le&&(i=Ak.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"&&!bv(e)){var v=Lk(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"):u0.call(e);return typeof e=="object"&&!Qa?kl(E):E}if(Zk(e)){for(var x="<"+pv.call(String(e.nodeName)),B=e.attributes||[],P=0;P<B.length;P++)x+=" "+B[P].name+"="+b2(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&&!Uk(J)?"["+p0(J,g)+"]":"[ "+tr.call(J,", ")+" ]"}if(Tk(e)){var O=sh(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!y2.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(Dk(e)){var Y=[];return uv&&uv.call(e,function(Ze,le){Y.push(y(le,e,!0)+" => "+y(Ze,e))}),Sv("Map",fd.call(e),Y,g)}if(Nk(e)){var U=[];return hv&&hv.call(e,function(Ze){U.push(y(Ze,e))}),Sv("Set",md.call(e),U,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",Fe=!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+(Fe||de?"["+tr.call(fv.call([],Fe||[],de||[]),": ")+"] ":"");return j.length===0?Xe+"{}":g?Xe+"{"+p0(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 kk(n){return Zi.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 S2(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 Lk(n){if(n.name)return n.name;var e=Sk.call(bk.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 Dk(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 Zk(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(fg.call(n,0,e.maxStringLength),e)+r}var i=Ek[e.quoteStyle||"single"];i.lastIndex=0;var o=Zi.call(Zi.call(n,i,"\\$1"),/[\x00-\x1f]/g,Hk);return b2(o,"single",e)}function Hk(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 Uk(n){for(var e=0;e<n.length;e++)if(_2(n[e],`
2
- `)>=0)return!1;return!0}function Vk(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 C_=Object.defineProperty;var R1=n=>{throw TypeError(n)};var T_=(n,e,t)=>e in n?C_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>T_(n,typeof e!="symbol"?e+"":e,t),hf=(n,e,t)=>e.has(n)||R1("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)?R1("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 $_,a as R_,b as I_,c as x_,d as P_,e as L_,f as D_,g as M_,U as O_,A as N_,h as z_}from"./artifact-bridge-BEUWXKq7.js";import{m as Z_,a as H_,b as U_}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 V_(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 I1=Object.prototype.toString,jw=function(e){var t=I1.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&I1.call(e.callee)==="[object Function]"),r},df,x1;function F_(){if(x1)return df;x1=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=jw,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 B_=Array.prototype.slice,q_=jw,P1=Object.keys,kh=P1?function(e){return P1(e)}:F_(),L1=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 q_(r)?L1(B_.call(r)):L1(r)})}else Object.keys=kh;return Object.keys||kh};var W_=kh,Ch=Object.defineProperty||!1;if(Ch)try{Ch({},"a",{value:1})}catch{Ch=!1}var Lu=Ch,Gr=SyntaxError,re=TypeError,j_=Object.getOwnPropertyDescriptor,Th=j_;if(Th)try{Th([],"length")}catch{Th=null}var sl=Th,D1=Lu,G_=Gr,ko=re,M1=sl,Gw=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=!!M1&&M1(e,t);if(D1)D1(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 G_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},a0=Lu,Yw=function(){return!!a0};Yw.hasArrayLengthDefineBug=function(){if(!a0)return null;try{return a0([],"length",{value:1}).length!==1}catch{return!0}};var Rp=Yw,Y_=W_,J_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",K_=Object.prototype.toString,X_=Array.prototype.concat,O1=Gw,Q_=function(n){return typeof n=="function"&&K_.call(n)==="[object Function]"},Jw=Rp(),e4=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!Q_(r)||!r())return}Jw?O1(n,e,t,!0):O1(n,e,t)},Kw=function(n,e){var t=arguments.length>2?arguments[2]:{},r=Y_(e);J_&&(r=X_.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)e4(n,r[i],e[r[i]],t[r[i]])};Kw.supportsDescriptors=!!Jw;var mo=Kw,$h={exports:{}};typeof self<"u"?$h.exports=self:typeof window<"u"?$h.exports=window:$h.exports=Function("return this")();var Xw=$h.exports,t4=Xw,Qw=function(){return typeof ls!="object"||!ls||ls.Math!==Math||ls.Array!==Array?t4:ls},n4=mo,r4=sl,i4=Qw,s4=function(){var e=i4();if(n4.supportsDescriptors){var t=r4(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},o4=mo,a4=Xw,e2=Qw,l4=s4,c4=e2(),t2=function(){return c4};o4(t2,{getPolyfill:e2,implementation:a4,shim:l4});var tg=t2,Yr=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},ng=Object,n2=Error,u4=EvalError,h4=RangeError,rg=ReferenceError,d4=URIError,p4=Math.abs,f4=Math.floor,m4=Math.max,g4=Math.min,v4=Math.pow,y4=Math.round,ig=Number.isNaN||function(e){return e!==e},w4=ig,b4=function(e){return w4(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},N1=typeof Symbol<"u"&&Symbol,S4=ol,sg=function(){return typeof N1!="function"||typeof Symbol!="function"||typeof N1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:S4()},pf,z1;function r2(){return z1||(z1=1,pf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),pf}var ff,Z1;function i2(){if(Z1)return ff;Z1=1;var n=ng;return ff=n.getPrototypeOf||null,ff}var _4="Function.prototype.bind called on incompatible ",A4=Object.prototype.toString,E4=Math.max,k4="[object Function]",H1=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},C4=function(e,t){for(var r=[],i=t,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},T4=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},$4=function(e){var t=this;if(typeof t!="function"||A4.apply(t)!==k4)throw new TypeError(_4+t);for(var r=C4(arguments,1),i,o=function(){if(this instanceof i){var f=t.apply(this,H1(r,arguments));return Object(f)===f?f:this}return t.apply(e,H1(r,arguments))},a=E4(0,t.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+T4(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},R4=$4,Du=Function.prototype.bind||R4,og=Function.prototype.call,ag=Function.prototype.apply,I4=typeof Reflect<"u"&&Reflect&&Reflect.apply,x4=Du,P4=ag,L4=og,D4=I4,s2=D4||x4.call(L4,P4),M4=Du,O4=re,N4=og,z4=s2,Ip=function(e){if(e.length<1||typeof e[0]!="function")throw new O4("a function is required");return z4(M4,N4,e)},Z4=Ip,U1=sl,o2;try{o2=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var mf=!!o2&&U1&&U1(Object.prototype,"__proto__"),a2=Object,V1=a2.getPrototypeOf,H4=mf&&typeof mf.get=="function"?Z4([mf.get]):typeof V1=="function"?function(e){return V1(e==null?e:a2(e))}:!1,F1=r2(),B1=i2(),q1=H4,l2=F1?function(e){return F1(e)}:B1?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return B1(e)}:q1?function(e){return q1(e)}:null,U4=Function.prototype.call,V4=Object.prototype.hasOwnProperty,F4=Du,Jr=F4.call(U4,V4),ne,B4=ng,q4=n2,W4=u4,j4=h4,G4=rg,Xa=Gr,Yo=re,Y4=d4,J4=p4,K4=f4,X4=m4,Q4=g4,eA=v4,tA=y4,nA=b4,c2=Function,gf=function(n){try{return c2('"use strict"; return ('+n+").constructor;")()}catch{}},dc=sl,rA=Lu,vf=function(){throw new Yo},iA=dc?function(){try{return arguments.callee,vf}catch{try{return dc(arguments,"callee").get}catch{return vf}}}():vf,Co=sg(),Ue=l2,sA=i2(),oA=r2(),u2=ag,Mu=og,Io={},aA=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%":q4,"%eval%":eval,"%EvalError%":W4,"%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%":c2,"%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%":B4,"%Object.getOwnPropertyDescriptor%":dc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":j4,"%ReferenceError%":G4,"%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%":iA,"%TypedArray%":aA,"%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%":Y4,"%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%":u2,"%Object.defineProperty%":rA,"%Object.getPrototypeOf%":sA,"%Math.abs%":J4,"%Math.floor%":K4,"%Math.max%":X4,"%Math.min%":Q4,"%Math.pow%":eA,"%Math.round%":tA,"%Math.sign%":nA,"%Reflect.getPrototypeOf%":oA};if(Ue)try{null.error}catch(n){var lA=Ue(Ue(n));co["%Error.prototype%"]=lA}var cA=function n(e){var t;if(e==="%AsyncFunction%")t=gf("async function () {}");else if(e==="%GeneratorFunction%")t=gf("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=gf("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},W1={__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,uA=Ou.call(Mu,Array.prototype.concat),hA=Ou.call(u2,Array.prototype.splice),j1=Ou.call(Mu,String.prototype.replace),pd=Ou.call(Mu,String.prototype.slice),dA=Ou.call(Mu,RegExp.prototype.exec),pA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fA=/\\(\\)?/g,mA=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 j1(e,pA,function(o,a,l,c){i[i.length]=l?j1(c,fA,"$1"):a||o}),i},gA=function(e,t){var r=e,i;if(dd(W1,r)&&(i=W1[r],r="%"+i[0]+"%"),dd(co,r)){var o=co[r];if(o===Io&&(o=cA(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(dA(/^%?[^%]*%?$/,e)===null)throw new Xa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=mA(e),i=r.length>0?r[0]:"",o=gA("%"+i+"%",t),a=o.name,l=o.value,c=!1,d=o.alias;d&&(i=d[0],hA(r,uA([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},yf,G1;function Gi(){if(G1)return yf;G1=1;var n=rn,e=Ip,t=e([n("%String.prototype.indexOf%")]);return yf=function(i,o){var a=n(i,!!o);return typeof a=="function"&&t(i,".prototype.")>-1?e([a]):a},yf}var wf,Y1;function lg(){if(Y1)return wf;Y1=1;var n=rn,e=n("%Array%"),t=!e.isArray&&Gi()("Object.prototype.toString");return wf=e.isArray||function(i){return t(i)==="[object Array]"},wf}var vA=Rp,J1=Lu,h2=vA.hasArrayLengthDefineBug(),yA=h2&&lg(),wA=Gi(),bA=wA("Object.prototype.propertyIsEnumerable"),cg=function(e,t,r,i,o,a){if(!J1){if(!e(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||o in i&&bA(i,o)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[o]=l,t(i[o],l)}return h2&&o==="length"&&"[[Value]]"in a&&yA(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(J1(i,o,r(a)),!0)},SA=re,El=Jr,_A={__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)&&!_A[t])return!1;var r=El(e,"[[Value]]")||El(e,"[[Writable]]"),i=El(e,"[[Get]]")||El(e,"[[Set]]");if(r&&i)throw new SA("Property Descriptors may not be both accessor and data descriptors");return!0},d2=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},AA=re,EA=al,kA=d2,p2=function(e){if(typeof e<"u"&&!EA(e))throw new AA("Assertion failed: `Desc` must be a Property Descriptor");return kA(e)},CA=re,K1=Jr,TA=al,f2=function(e){if(typeof e>"u")return!1;if(!TA(e))throw new CA("Assertion failed: `Desc` must be a Property Descriptor");return!(!K1(e,"[[Value]]")&&!K1(e,"[[Writable]]"))},ll=function(e){return typeof e=="string"||typeof e=="symbol"},X1=ig,m2=function(e,t){return e===t?e===0?1/e===1/t:!0:X1(e)&&X1(t)},Q1=re,$A=Yr,RA=cg,IA=p2,xA=f2,PA=ll,LA=m2,ug=function(e,t,r){if(!$A(e))throw new Q1("Assertion failed: Type(O) is not Object");if(!PA(t))throw new Q1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return RA(xA,LA,IA,e,t,i)},g2=Function.prototype.toString,qo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,l0,Rh;if(typeof qo=="function"&&typeof Object.defineProperty=="function")try{l0=Object.defineProperty({},"length",{get:function(){throw Rh}}),Rh={},qo(function(){throw 42},null,l0)}catch(n){n!==Rh&&(qo=null)}else qo=null;var DA=/^\s*class\b/,c0=function(e){try{var t=g2.call(e);return DA.test(t)}catch{return!1}},bf=function(e){try{return c0(e)?!1:(g2.call(e),!0)}catch{return!1}},Ih=Object.prototype.toString,MA="[object Object]",OA="[object Function]",NA="[object GeneratorFunction]",zA="[object HTMLAllCollection]",ZA="[object HTML document.all class]",HA="[object HTMLCollection]",UA=typeof Symbol=="function"&&!!Symbol.toStringTag,VA=!(0 in[,]),u0=function(){return!1};if(typeof document=="object"){var FA=document.all;Ih.call(FA)===Ih.call(document.all)&&(u0=function(e){if((VA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ih.call(e);return(t===zA||t===ZA||t===HA||t===MA)&&e("")==null}catch{}return!1})}var v2=qo?function(e){if(u0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{qo(e,null,l0)}catch(t){if(t!==Rh)return!1}return!c0(e)&&bf(e)}:function(e){if(u0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(UA)return bf(e);if(c0(e))return!1;var t=Ih.call(e);return t!==OA&&t!==NA&&!/^\[object HTML/.test(t)?!1:bf(e)},BA=v2,qA=function(e){return!!e},Tn=Jr,rh=re,WA=Yr,ev=BA,Sf=qA,jA=function(e){if(!WA(e))throw new rh("ToPropertyDescriptor requires an object");var t={};if(Tn(e,"enumerable")&&(t["[[Enumerable]]"]=Sf(e.enumerable)),Tn(e,"configurable")&&(t["[[Configurable]]"]=Sf(e.configurable)),Tn(e,"value")&&(t["[[Value]]"]=e.value),Tn(e,"writable")&&(t["[[Writable]]"]=Sf(e.writable)),Tn(e,"get")){var r=e.get;if(typeof r<"u"&&!ev(r))throw new rh("getter must be a function");t["[[Get]]"]=r}if(Tn(e,"set")){var i=e.set;if(typeof i<"u"&&!ev(i))throw new rh("setter must be a function");t["[[Set]]"]=i}if((Tn(t,"[[Get]]")||Tn(t,"[[Set]]"))&&(Tn(t,"[[Value]]")||Tn(t,"[[Writable]]")))throw new rh("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},_f=re,GA=Yr,tv=al,YA=cg,JA=p2,KA=f2,XA=ll,QA=m2,eE=jA,tE=function(e,t,r){if(!GA(e))throw new _f("Assertion failed: Type(O) is not Object");if(!XA(t))throw new _f("Assertion failed: P is not a Property Key");var i=tv(r)?r:eE(r);if(!tv(i))throw new _f("Assertion failed: Desc is not a valid Property Descriptor");return YA(KA,QA,JA,e,t,i)},nv=re,nE=Yr,rE=tE,iE=ll,sE=function(e,t,r){if(!nE(e))throw new nv("Assertion failed: Type(O) is not Object");if(!iE(t))throw new nv("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return rE(e,t,i)},oE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,aE=ng,lE=aE.setPrototypeOf||null,cE=Ip,rv=sl,uE=re,y2={};try{y2.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var hE=!("toString"in y2),Af=rv&&rv(Object.prototype,"__proto__"),dE=hE&&(!!Af&&typeof Af.set=="function"&&cE([Af.set])||function(e,t){if(e==null)throw new uE("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),iv=oE,pE=lE,sv=dE,fE=re,mE=iv?function(e,t){if(iv(e,t))return e;throw new fE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:pE||(sv?function(e,t){return sv(e,t),e}:null),ov=re,gE=Yr,av=l2,vE=function(e){if(!gE(e))throw new ov("Assertion failed: O must be an Object");if(!av)throw new ov("This environment does not support fetching prototypes.");return av(e)},yE=re,wE=mE,bE=Yr,SE=vE,_E=function(e,t){if(t!==null&&!bE(t))throw new yE("Assertion failed: V must be Object or Null");try{wE(e,t)}catch{return!1}return SE(e)===t},Ef=ug,lv=sE,w2=_E,AE=Rp(),hg=n2;function Nu(n,e,t){var r=new hg(t);return w2(r,xh),delete r.constructor,lv(r,"error",n),lv(r,"suppressed",e),r}AE&&Object.defineProperty(Nu,"prototype",{writable:!1});var xh=Nu.prototype;if(!Ef(xh,"constructor",Nu)||!Ef(xh,"message","")||!Ef(xh,"name","SuppressedError"))throw new hg("unable to install SuppressedError.prototype properties; please report this!");w2(Nu.prototype,hg.prototype);var EE=Nu,kE=EE,b2=function(){return typeof SuppressedError=="function"?SuppressedError:kE},CE=mo,cv=tg(),TE=b2,$E=function(){var e=TE();return CE(cv,{SuppressedError:e},{SuppressedError:function(){return cv.SuppressedError!==e}}),e};$E();var RE=re,IE=al,xE=d2,PE=function(e){if(typeof e<"u"&&!IE(e))throw new RE("Assertion failed: `Desc` must be a Property Descriptor");return xE(e)},LE=re,uv=Jr,DE=al,ME=function(e){if(typeof e>"u")return!1;if(!DE(e))throw new LE("Assertion failed: `Desc` must be a Property Descriptor");return!(!uv(e,"[[Value]]")&&!uv(e,"[[Writable]]"))},hv=ig,OE=function(e,t){return e===t?e===0?1/e===1/t:!0:hv(e)&&hv(t)},cl=v2,NE=function(e){return!!e},$n=Jr,ih=re,zE=Yr,dv=cl,kf=NE,ZE=function(e){if(!zE(e))throw new ih("ToPropertyDescriptor requires an object");var t={};if($n(e,"enumerable")&&(t["[[Enumerable]]"]=kf(e.enumerable)),$n(e,"configurable")&&(t["[[Configurable]]"]=kf(e.configurable)),$n(e,"value")&&(t["[[Value]]"]=e.value),$n(e,"writable")&&(t["[[Writable]]"]=kf(e.writable)),$n(e,"get")){var r=e.get;if(typeof r<"u"&&!dv(r))throw new ih("getter must be a function");t["[[Get]]"]=r}if($n(e,"set")){var i=e.set;if(typeof i<"u"&&!dv(i))throw new ih("setter must be a function");t["[[Set]]"]=i}if(($n(t,"[[Get]]")||$n(t,"[[Set]]"))&&($n(t,"[[Value]]")||$n(t,"[[Writable]]")))throw new ih("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},Cf=re,HE=Yr,pv=al,UE=cg,VE=PE,FE=ME,BE=ll,qE=OE,WE=ZE,zu=function(e,t,r){if(!HE(e))throw new Cf("Assertion failed: Type(O) is not Object");if(!BE(t))throw new Cf("Assertion failed: P is not a Property Key");var i=pv(r)?r:WE(r);if(!pv(i))throw new Cf("Assertion failed: Desc is not a valid Property Descriptor");return UE(FE,qE,VE,e,t,i)},jE=ol(),GE=jE?Symbol.dispose||Symbol("Symbol.dispose"):null,YE=ol,JE=GE,dg=function(){return YE()&&Symbol.dispose||JE},KE=sg,XE=zu,QE=dg,ek=function(){var e=QE();return KE()&&XE(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},tk=ol(),nk=tk?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,rk=ol,ik=nk,pg=function(){return rk()&&Symbol.asyncDispose||ik},sk=sg,ok=zu,ak=pg,lk=function(){var e=ak();return sk()&&ok(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},ck=lg(),uk=rn,hk=Gi(),dk=re,pk=ck,fk=uk("%Reflect.apply%",!0)||hk("Function.prototype.apply"),xp=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!pk(r))throw new dk("Assertion failed: optional `argumentsList`, if provided, must be a List");return fk(e,t,r)};const mk={},gk=Object.freeze(Object.defineProperty({__proto__:null,default:mk},Symbol.toStringTag,{value:"Module"})),vk=V_(gk);var fg=typeof Map=="function"&&Map.prototype,Tf=Object.getOwnPropertyDescriptor&&fg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fd=fg&&Tf&&typeof Tf.get=="function"?Tf.get:null,fv=fg&&Map.prototype.forEach,mg=typeof Set=="function"&&Set.prototype,$f=Object.getOwnPropertyDescriptor&&mg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,md=mg&&$f&&typeof $f.get=="function"?$f.get:null,mv=mg&&Set.prototype.forEach,yk=typeof WeakMap=="function"&&WeakMap.prototype,oc=yk?WeakMap.prototype.has:null,wk=typeof WeakSet=="function"&&WeakSet.prototype,ac=wk?WeakSet.prototype.has:null,bk=typeof WeakRef=="function"&&WeakRef.prototype,gv=bk?WeakRef.prototype.deref:null,Sk=Boolean.prototype.valueOf,_k=Object.prototype.toString,Ak=Function.prototype.toString,Ek=String.prototype.match,gg=String.prototype.slice,Zi=String.prototype.replace,kk=String.prototype.toUpperCase,vv=String.prototype.toLowerCase,S2=RegExp.prototype.test,yv=Array.prototype.concat,tr=Array.prototype.join,Ck=Array.prototype.slice,wv=Math.floor,h0=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Rf=Object.getOwnPropertySymbols,d0=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,_2=Object.prototype.propertyIsEnumerable,bv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function Sv(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||S2.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-wv(-n):wv(n);if(r!==n){var i=String(r),o=gg.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 p0=vk,_v=p0.custom,Av=k2(_v)?_v:null,A2={__proto__:null,double:'"',single:"'"},Tk={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ul=function n(e,t,r,i){var o=t||{};if(pr(o,"quoteStyle")&&!pr(A2,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 T2(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?Sv(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return l?Sv(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 f0(e)?"[Array]":"[Object]";var g=qk(o,r);if(typeof i>"u")i=[];else if(C2(i,e)>=0)return"[Circular]";function y(Ze,le,sr){if(le&&(i=Ck.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"&&!Ev(e)){var v=Ok(e),_=sh(e,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(_.length>0?" { "+tr.call(_,", ")+" }":"")}if(k2(e)){var E=Qa?Zi.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):d0.call(e);return typeof e=="object"&&!Qa?kl(E):E}if(Vk(e)){for(var x="<"+vv.call(String(e.nodeName)),B=e.attributes||[],P=0;P<B.length;P++)x+=" "+B[P].name+"="+E2($k(B[P].value),"double",o);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+vv.call(String(e.nodeName))+">",x}if(f0(e)){if(e.length===0)return"[]";var J=sh(e,y);return g&&!Bk(J)?"["+m0(J,g)+"]":"[ "+tr.call(J,", ")+" ]"}if(Ik(e)){var O=sh(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!_2.call(e,"cause")?"{ ["+String(e)+"] "+tr.call(yv.call("[cause]: "+y(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+tr.call(O,", ")+" }"}if(typeof e=="object"&&a){if(Av&&typeof e[Av]=="function"&&p0)return p0(e,{depth:f-r});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Nk(e)){var Y=[];return fv&&fv.call(e,function(Ze,le){Y.push(y(le,e,!0)+" => "+y(Ze,e))}),kv("Map",fd.call(e),Y,g)}if(Hk(e)){var U=[];return mv&&mv.call(e,function(Ze){U.push(y(Ze,e))}),kv("Set",md.call(e),U,g)}if(zk(e))return If("WeakMap");if(Uk(e))return If("WeakSet");if(Zk(e))return If("WeakRef");if(Pk(e))return kl(y(Number(e)));if(Dk(e))return kl(y(h0.call(e)));if(Lk(e))return kl(Sk.call(e));if(xk(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(!Rk(e)&&!Ev(e)){var j=sh(e,y),fe=bv?bv(e)===Object.prototype:e instanceof Object||e.constructor===Object,de=e instanceof Object?"":"null prototype",Fe=!fe&&lc&&Object(e)===e&&lc in e?gg.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(yv.call([],Fe||[],de||[]),": ")+"] ":"");return j.length===0?Xe+"{}":g?Xe+"{"+m0(j,g)+"}":Xe+"{ "+tr.call(j,", ")+" }"}return String(e)};function E2(n,e,t){var r=t.quoteStyle||e,i=A2[r];return i+n+i}function $k(n){return Zi.call(String(n),/"/g,"&quot;")}function go(n){return!lc||!(typeof n=="object"&&(lc in n||typeof n[lc]<"u"))}function f0(n){return Yi(n)==="[object Array]"&&go(n)}function Rk(n){return Yi(n)==="[object Date]"&&go(n)}function Ev(n){return Yi(n)==="[object RegExp]"&&go(n)}function Ik(n){return Yi(n)==="[object Error]"&&go(n)}function xk(n){return Yi(n)==="[object String]"&&go(n)}function Pk(n){return Yi(n)==="[object Number]"&&go(n)}function Lk(n){return Yi(n)==="[object Boolean]"&&go(n)}function k2(n){if(Qa)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!d0)return!1;try{return d0.call(n),!0}catch{}return!1}function Dk(n){if(!n||typeof n!="object"||!h0)return!1;try{return h0.call(n),!0}catch{}return!1}var Mk=Object.prototype.hasOwnProperty||function(n){return n in this};function pr(n,e){return Mk.call(n,e)}function Yi(n){return _k.call(n)}function Ok(n){if(n.name)return n.name;var e=Ek.call(Ak.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function C2(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 Nk(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 zk(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 Zk(n){if(!gv||!n||typeof n!="object")return!1;try{return gv.call(n),!0}catch{}return!1}function Hk(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 Uk(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 Vk(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function T2(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return T2(gg.call(n,0,e.maxStringLength),e)+r}var i=Tk[e.quoteStyle||"single"];i.lastIndex=0;var o=Zi.call(Zi.call(n,i,"\\$1"),/[\x00-\x1f]/g,Fk);return E2(o,"single",e)}function Fk(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":"")+kk.call(e.toString(16))}function kl(n){return"Object("+n+")"}function If(n){return n+" { ? }"}function kv(n,e,t,r){var i=r?m0(t,r):tr.call(t,", ");return n+" ("+e+") {"+i+"}"}function Bk(n){for(var e=0;e<n.length;e++)if(C2(n[e],`
2
+ `)>=0)return!1;return!0}function qk(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 m0(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||(v2.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++)y2.call(n,o[d])&&r.push("["+e(o[d])+"]: "+e(n[o[d]],n));return r}var Fk=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 "+Fk(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,Zu=Gi(),Kk=ul,Xk=re,_v=Jk("%Map%",!0),Qk=Zu("Map.prototype.get",!0),e3=Zu("Map.prototype.set",!0),t3=Zu("Map.prototype.has",!0),n3=Zu("Map.prototype.delete",!0),r3=Zu("Map.prototype.size",!0),E2=!!_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=n3(e,r);return r3(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return Qk(e,r)},has:function(r){return e?t3(e,r):!1},set:function(r,i){e||(e=new _v),e3(e,r,i)}};return t},i3=rn,Lp=Gi(),s3=ul,oh=E2,o3=re,To=i3("%WeakMap%",!0),a3=Lp("WeakMap.prototype.get",!0),l3=Lp("WeakMap.prototype.set",!0),c3=Lp("WeakMap.prototype.has",!0),u3=Lp("WeakMap.prototype.delete",!0),h3=To?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new o3("Side channel does not contain "+s3(i))},delete:function(i){if(To&&i&&(typeof i=="object"||typeof i=="function")){if(e)return u3(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?a3(e,i):t&&t.get(i)},has:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?c3(e,i):!!t&&t.has(i)},set:function(i,o){To&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new To),l3(e,i,o)):oh&&(t||(t=oh()),t.set(i,o))}};return r}:oh,d3=re,p3=ul,f3=Yk,m3=E2,g3=h3,v3=g3||m3||f3,y3=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":p3(r);throw new d3("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=v3()),e.set(r,i)}};return t},w3=Jr,Cl=y3(),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&&w3(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,k2=Gr,Vi=gg,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 vg=Hu,b3=vg,yg=function(e){return new b3("normal",e)},Rf,Av;function S3(){if(Av)return Rf;Av=1;var n=ol;return Rf=function(){return n()&&!!Symbol.toStringTag},Rf}var _3=rn,Ev=_3("%Object.defineProperty%",!0),A3=S3()(),E3=Jr,k3=re,ah=A3?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 k3("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ah&&(r||!E3(e,ah))&&(Ev?Ev(e,ah,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[ah]=t)},T2={exports:{}},C3=rn,kv=Bw,T3=Rp(),Cv=sl,Tv=re,$3=C3("%Math.floor%"),R3=function(e,t){if(typeof e!="function")throw new Tv("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||$3(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)&&(T3?kv(e,"length",t,!0,!0):kv(e,"length",t)),e},I3=Du,x3=sg,P3=t2,L3=function(){return P3(I3,x3,arguments)};(function(n){var e=R3,t=Lu,r=Ip,i=L3;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 wg=T2.exports,D3=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},M3=Object,O3=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||M3(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},N3=Jr,z3=og(),Z3=D3,H3=O3,U3=function(e){return e&&typeof e=="object"&&N3(e,"[[DisposableResourceStack]]")&&z3(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||Z3(e["[[DisposableResourceStack]]"],H3))},V3=Yr,F3=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(V3(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},B3=F3,bg=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":B3(e)},q3=re,W3=ul,j3=ll,G3=function(e,t){if(!j3(t))throw new q3("Assertion failed: P is not a Property Key, got "+W3(t));return e[t]},$v=re,Y3=G3,J3=cl,K3=ll,Rv=ul,X3=function(e,t){if(!K3(t))throw new $v("Assertion failed: P is not a Property Key");var r=Y3(e,t);if(r!=null){if(!J3(r))throw new $v(Rv(t)+" is not a function: "+Rv(r));return r}},f0={exports:{}},Q3=rn,eC=Q3,Iv=eC("%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 tC=f0.exports,If=re,Lv=cl,nC=tC,rC=function(e){if(!nC(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(!Lv(t["[[Resolve]]"])||!Lv(t["[[Reject]]"]))throw new If("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},Dv=Gr,iC=re,xf=xp,Mv=X3,sC=rC,oC=bg,Ov=ug(),Nv=hg(),aC=function(e,t){if(oC(e)!=="Object")throw new iC("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new Dv("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 Dv("`Symbol.dispose` is not supported");if(r=Mv(e,Ov),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var o=sC(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},lC=Gr,Pf=re,cC=cl,uC=bg,hC=aC,dC=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new lC("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"&&uC(e)!=="Object")throw new Pf("`V` must be an Object, or `null` or `undefined`");if(r=hC(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],!cC(r))throw new Pf("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},pC=Gr,lh=re,fC=U3,zv=dC,mC=Gi(),gC=mC("Array.prototype.push"),$2=function(e,t,r){if(!fC(e))throw new lh("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new pC("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 gC(e["[[DisposableResourceStack]]"],o),"UNUSED"},Lf,Zv;function Sg(){if(Zv)return Lf;Zv=1;var n=rn,e=wg,t=Gr,r=n("%Promise.resolve%",!0),i=r&&e(r);return Lf=function(a,l){if(!i)throw new t("This environment does not support Promises.");return i(a,l)},Lf}var Df,Hv;function vC(){if(Hv)return Df;Hv=1;var n=rn,e=Gr,t=n("%Promise%",!0),r=xp,i=Sg(),o=bg;return Df=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)},Df}var Mf,Uv;function yC(){if(Uv)return Mf;Uv=1;var n=vg;return Mf=function(t){return new n("throw",t)},Mf}var wC=rn,Of=Gr,Vv=re,bC=wC("%Promise%",!0),SC=Gi(),Fv=SC("Promise.prototype.then",!0),_C=vg,Bv=vC(),AC=yg,EC=Sg(),qv=yC(),kC=g2(),R2=function(e,t){if(!(t instanceof _C))throw new Vv("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new Vv("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"&&EC(bC,t),l=function(y){if(t.type()==="throw"){var v=t.value(),_=new kC(y,v);t=qv(_)}else t=qv(y)},c=i==="ASYNC-DISPOSE"&&function(v){return Fv(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 Fv(_,AC)},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},I2=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Dp=tg,_g=re,CC=xp,hl=lg,TC=zu,x2=cl,$C=yg,Et=gg,RC=C2,P2=mo.supportsDescriptors,IC=wg,Ag=$2,xC=R2,L2=I2,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]]",L2())},D2=function(){var e=this;return Et.assert(e,"[[DisposableState]]"),Et.get(e,"[[DisposableState]]")==="DISPOSED"},Uu=IC(D2);P2?TC(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),xC(Et.get(e,"[[DisposeCapability]]"),$C())["?"]()});hl(en.prototype,"use",function(e){var t=this;if(Uu(t))throw new Dp("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(Uu(r))throw new Dp("a disposed stack can not use anything new");if(!x2(t))throw new _g("`onDispose` must be a function");var i=function(){return CC(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(Uu(t))throw new Dp("a disposed stack can not defer anything new");if(!x2(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(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});Wv&&hl(en.prototype,Wv,en.prototype.dispose);RC(en.prototype,"DisposableStack");var PC=en,LC=PC,DC=function(){return typeof DisposableStack=="function"?DisposableStack:LC},MC=mo,OC=Qm(),NC=DC,zC=function(){var e=NC();return MC(OC,{DisposableStack:e},{DisposableStack:!0}),e},ZC=rn,Mp=tg,Eg=re,jv=ZC("%Promise%",!0),kg=$2,HC=xp,dl=lg,UC=zu,VC=R2,O2=cl,N2=I2,FC=yg,Gv=Sg(),kt=gg,BC=C2,z2=mo.supportsDescriptors,qC=wg,WC=Gi(),jC=WC("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]]",N2())},Z2=function(){var e=this;return kt.assert(e,"[[AsyncDisposableState]]"),kt.get(e,"[[AsyncDisposableState]]")==="disposed"},Vu=qC(Z2);z2?UC(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)?Gv(jv):(H2(e),jC(Gv(jv,VC(kt.get(e,"[[DisposeCapability]]"),FC())),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 kg(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 Eg("`onDisposeAsync` must be a function");var i=function(){return HC(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(Vu(t))throw new Mp("a disposed stack can not defer anything new");if(!O2(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(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});Yv&&dl(tn.prototype,Yv,tn.prototype.disposeAsync);BC(tn.prototype,"AsyncDisposableStack");var GC=tn,YC=GC,JC=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:YC},KC=mo,XC=Qm(),QC=JC,eT=function(){var e=QC();return KC(XC,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},tT=KE,nT=sk,rT=zC,iT=eT,sT=function(){tT(),nT(),rT(),iT()};sT();const Jv=new WeakMap;function oT(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 aT(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class lT{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 aT();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(oT(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 lT,cT=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function uT(n){for(const e of Object.keys(n))if(cT.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function hT(n,e){uT(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}),hT(this,c)}}return n}class Kr extends globalThis.EventTarget{}const dT="X-Television-Client-Meta",pT="telemetry-activity",fT="telemetry-signal",V2={kind:"single",full_screen:!1},F2={width:560,height:740};function mT(n){return n.layout.flatMap(e=>e.artifactIds)}function gT(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())vT(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 vT(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(),yT=sn(),wT=sn(),bT=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"),Qv=B2("ValidationError"),ST=200,_T=300,ch=401;class AT{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 ET(i);if(!i.ok||i.status<ST||i.status>=_T)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[dT]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function ET(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 kT(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var mr,Md,q2;class CT{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 Qv("channelID is required, but no channels exist."):new Qv(`channelID is required when multiple channels exist. Available channels: ${kT(t)}`)};var gr;class TT{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 $T{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 RT{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 IT{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 xT{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 PT{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 AT(e,t)),this.channels=new CT(s(this,Ht)),this.artifacts=new TT(s(this,Ht)),this.display=new xT(s(this,Ht)),this.themes=new $T(s(this,Ht)),this.markdown=new RT(s(this,Ht)),this.telemetry=new IT(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",LT=/^\d+\.\d+\.\d+$/,DT=3;function Op(n){return LT.test(n)}function Cg(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<DT;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function MT(n,e){return n===vd||e===vd?!1:n!==e}const OT=400,NT=404,W2=500,zT=600,ZT={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,Rn,g0,xo,j2,v0,G2,Lh,y0,Y2,Po,J2,hr,w0,K2,Ie;class HT 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,FT());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 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,L,hr).call(this),this.dispatchEvent(new yT("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new wT("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new bT("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,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,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,Rn).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,Rn).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,Rn).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,Rn).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,Rn).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,Rn).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,Rn).call(this,s(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>u(this,L,v0).call(this,t))}async deleteChannel(t){u(this,L,Ie).call(this),await u(this,L,Rn).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=gT(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),ty(d))throw await u(this,L,g0).call(this,()=>u(this,L,v0).call(this,t)),d;if(!f||!GT(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=ny(s(this,ce),t);await u(this,L,Rn).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,Rn=async function(t,r){try{return await t}catch(i){throw!s(this,$t)&&ty(i)&&await u(this,L,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,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)})},v0=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Hf(()=>r.channels.get({channelID:t})),i=>u(this,L,y0).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([Hf(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{u(this,L,y0).call(this,t,i),u(this,L,Lh).call(this,o)})},Lh=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)]))})},Y2=function(t,r){const i=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Hf(()=>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));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: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)]))});BT(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)?UT(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 Xv("artifact-content-changed",{artifactID:g}))}catch{}finally{s(this,vr).delete(o)}},hr=function(){s(this,$t)||(h(this,gs,u(this,L,w0).call(this)),u(this,L,K2).call(this),this.dispatchEvent(new At("change")))},w0=function(){var o;const t=[...s(this,ce).channels.values()].map(a=>WT(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:jT(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:VT(((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 UT(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 VT(n){return n===null?null:Object.freeze({...n})}function FT(){return{channels:new Map,display:S0(ZT)}}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 YT(e)}}function BT(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&&qT(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 b0(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function qT(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function WT(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 jT(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:{...V2},size:{...F2}}]}function GT(n){return n instanceof pl&&n.status!==void 0&&n.status>=OT&&n.status<W2}function ty(n){return n instanceof pl&&(n.status===void 0||n.status>=W2&&n.status<zT)}async function Hf(n){try{return await n()}catch(e){if(e instanceof pl&&e.status===NT)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 YT(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function JT(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=KT(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 KT(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 X2="0123456789ABCDEFGHJKMNPQRSTVWXYZ",wd=32,XT=16,Q2=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 Hl extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function QT(n){const e=Math.floor(n()*wd)%wd;return X2.charAt(e)}function e$(n){const e=t$(),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 t$(){return i$()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function n$(n,e){let t="";for(;n>0;n--)t=QT(e)+t;return t}function r$(n,e=Q2){if(isNaN(n))throw new Hl(hs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>iy)throw new Hl(hs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${iy}: ${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 i$(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Tg(n,e){const t=e$(),r=Date.now();return r$(r,Q2)+n$(XT,t)}const Ul=sn(),e8=sn(),t8=sn(),s$=sn(),Uf=sn(),o$="store-";function Fi(n){return new URL(n).origin}function a$(){return{authTokens:{}}}var ys,ws,bs;class l$ extends Kr{constructor(t,r,i={}){super();p(this,ys);p(this,ws);p(this,bs);h(this,ys,`${o$}${t}`),h(this,ws,i.storage??u$());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,h$(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[Fi(e)]??null}function oy(n,e,t){return{authTokens:{...n.authTokens,[Fi(e)]:t}}}function c$(n,e){const t=Fi(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function u$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function h$(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 _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 d$(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 p$(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 f$=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 m$=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 g$(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const v$={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 y$(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 w$(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 b$(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 S$(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 _$(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 A$(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 E$(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 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,_0,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},l8=k("$ZodError",a8),c8=k("$ZodError",a8,{Parent:Error});function k$(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 C$(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 s8(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 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}},T$=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}},$$=Zp(c8),R$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xg(n)(e,t,i)},I$=n=>(e,t,r)=>xg(n)(e,t,r),x$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pg(n)(e,t,i)},P$=n=>async(e,t,r)=>Pg(n)(e,t,r),L$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(e,t,i)},D$=n=>(e,t,r)=>zp(n)(e,t,r),M$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zp(n)(e,t,i)},O$=n=>async(e,t,r)=>Zp(n)(e,t,r),N$=/^[cC][^\s-]{8,}$/,z$=/^[0-9a-z]+$/,Z$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,H$=/^[0-9a-vA-V]{20}$/,U$=/^[A-Za-z0-9]{27}$/,V$=/^[a-zA-Z0-9_-]{21}$/,F$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B$=/^([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)$/,q$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,W$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j$(){return new RegExp(W$,"u")}const G$=/^(?:(?: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])$/,Y$=/^(([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}|:))$/,J$=/^((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])$/,K$=/^(([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])$/,X$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u8=/^[A-Za-z0-9_-]*$/,Q$=/^\+[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])))",eR=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 tR(n){return new RegExp(`^${d8(n)}$`)}function nR(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 rR=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}$`)},iR=/^-?\d+$/,p8=/^-?\d+(?:\.\d+)?$/,sR=/^(?:true|false)$/i,oR=/^[^A-Z]*$/,aR=/^[^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})}}),lR=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):d$(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})}}),cR=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]=v$[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=iR)}),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})}}),uR=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})}}),hR=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})}}),dR=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})}}),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=()=>{})}),pR=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})}}),fR=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=oR),Hp.init(n,e)}),mR=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=aR),Hp.init(n,e)}),gR=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})}}),vR=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})}}),yR=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})}}),wR=k("$ZodCheckOverwrite",(n,e)=>{Ct.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class bR{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=f0(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 Rf=="function"?Rf(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||(S2.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof Rf=="function")for(var d=0;d<o.length;d++)_2.call(n,o[d])&&r.push("["+e(o[d])+"]: "+e(n[o[d]],n));return r}var Wk=ul,jk=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},Gk=function(n,e){if(n){var t=Pp(n,e);return t&&t.value}},Yk=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},Kk=function(n,e){if(n)return Pp(n,e,!0)},Xk=function(){var e,t={assert:function(r){if(!t.has(r))throw new jk("Side channel does not contain "+Wk(r))},delete:function(r){var i=Kk(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return Gk(e,r)},has:function(r){return Jk(e,r)},set:function(r,i){e||(e={next:void 0}),Yk(e,r,i)}};return t},Qk=rn,Zu=Gi(),e3=ul,t3=re,Cv=Qk("%Map%",!0),n3=Zu("Map.prototype.get",!0),r3=Zu("Map.prototype.set",!0),i3=Zu("Map.prototype.has",!0),s3=Zu("Map.prototype.delete",!0),o3=Zu("Map.prototype.size",!0),$2=!!Cv&&function(){var e,t={assert:function(r){if(!t.has(r))throw new t3("Side channel does not contain "+e3(r))},delete:function(r){if(e){var i=s3(e,r);return o3(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return n3(e,r)},has:function(r){return e?i3(e,r):!1},set:function(r,i){e||(e=new Cv),r3(e,r,i)}};return t},a3=rn,Lp=Gi(),l3=ul,oh=$2,c3=re,To=a3("%WeakMap%",!0),u3=Lp("WeakMap.prototype.get",!0),h3=Lp("WeakMap.prototype.set",!0),d3=Lp("WeakMap.prototype.has",!0),p3=Lp("WeakMap.prototype.delete",!0),f3=To?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new c3("Side channel does not contain "+l3(i))},delete:function(i){if(To&&i&&(typeof i=="object"||typeof i=="function")){if(e)return p3(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?u3(e,i):t&&t.get(i)},has:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?d3(e,i):!!t&&t.has(i)},set:function(i,o){To&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new To),h3(e,i,o)):oh&&(t||(t=oh()),t.set(i,o))}};return r}:oh,m3=re,g3=ul,v3=Xk,y3=$2,w3=f3,b3=w3||y3||v3,S3=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":g3(r);throw new m3("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=b3()),e.set(r,i)}};return t},_3=Jr,Cl=S3(),cr=re,vg={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),!vg.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&&_3(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(vg);var yg=vg,R2=Gr,Vi=yg,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 R2('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 R2('Assertion failed: Completion Record is not of type "normal"');return Vi.get(this,"[[Value]]")};var wg=Hu,A3=wg,bg=function(e){return new A3("normal",e)},xf,Tv;function E3(){if(Tv)return xf;Tv=1;var n=ol;return xf=function(){return n()&&!!Symbol.toStringTag},xf}var k3=rn,$v=k3("%Object.defineProperty%",!0),C3=E3()(),T3=Jr,$3=re,ah=C3?Symbol.toStringTag:null,I2=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 $3("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ah&&(r||!T3(e,ah))&&($v?$v(e,ah,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[ah]=t)},x2={exports:{}},R3=rn,Rv=Gw,I3=Rp(),Iv=sl,xv=re,x3=R3("%Math.floor%"),P3=function(e,t){if(typeof e!="function")throw new xv("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||x3(t)!==t)throw new xv("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Iv){var a=Iv(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!r)&&(I3?Rv(e,"length",t,!0,!0):Rv(e,"length",t)),e},L3=Du,D3=ag,M3=s2,O3=function(){return M3(L3,D3,arguments)};(function(n){var e=P3,t=Lu,r=Ip,i=O3;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})(x2);var Sg=x2.exports,N3=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},z3=Object,Z3=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||z3(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},H3=Jr,U3=lg(),V3=N3,F3=Z3,B3=function(e){return e&&typeof e=="object"&&H3(e,"[[DisposableResourceStack]]")&&U3(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||V3(e["[[DisposableResourceStack]]"],F3))},q3=Yr,W3=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(q3(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},j3=W3,_g=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":j3(e)},G3=re,Y3=ul,J3=ll,K3=function(e,t){if(!J3(t))throw new G3("Assertion failed: P is not a Property Key, got "+Y3(t));return e[t]},Pv=re,X3=K3,Q3=cl,eC=ll,Lv=ul,tC=function(e,t){if(!eC(t))throw new Pv("Assertion failed: P is not a Property Key");var r=X3(e,t);if(r!=null){if(!Q3(r))throw new Pv(Lv(t)+" is not a function: "+Lv(r));return r}},g0={exports:{}},nC=rn,rC=nC,Dv=rC("%Reflect.construct%",!0),gd=zu;try{gd({},"",{"[[Get]]":function(){}})}catch{gd=null}if(gd&&Dv){var Mv={},Ov={};gd(Ov,"length",{"[[Get]]":function(){throw Mv},"[[Enumerable]]":!0}),g0.exports=function(e){try{Dv(e,Ov)}catch(t){return t===Mv}}}else g0.exports=function(e){return typeof e=="function"&&!!e.prototype};var iC=g0.exports,Pf=re,Nv=cl,sC=iC,oC=function(e){if(!sC(e))throw new Pf("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 Pf("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=o});if(!Nv(t["[[Resolve]]"])||!Nv(t["[[Reject]]"]))throw new Pf("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},zv=Gr,aC=re,Lf=xp,Zv=tC,lC=oC,cC=_g,Hv=dg(),Uv=pg(),uC=function(e,t){if(cC(e)!=="Object")throw new aC("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new zv("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&Uv&&(r=Zv(e,Uv)),!r){if(!Hv)throw new zv("`Symbol.dispose` is not supported");if(r=Zv(e,Hv),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var o=lC(Promise);try{Lf(r,i),Lf(o["[[Resolve]]"],void 0,[void 0])}catch(a){o["[[Reject]]"](a)}return o["[[Promise]]"]}Lf(r,i)}}return r},hC=Gr,Df=re,dC=cl,pC=_g,fC=uC,mC=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new hC("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"&&pC(e)!=="Object")throw new Df("`V` must be an Object, or `null` or `undefined`");if(r=fC(e,t),typeof r>"u")throw new Df("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!dC(r))throw new Df("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},gC=Gr,lh=re,vC=B3,Vv=mC,yC=Gi(),wC=yC("Array.prototype.push"),P2=function(e,t,r){if(!vC(e))throw new lh("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new gC("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=Vv(t,r)}else{if(typeof t<"u")throw new lh("Assertion failed: `V` must be undefined when `method` is present");o=Vv(void 0,r,i)}return wC(e["[[DisposableResourceStack]]"],o),"UNUSED"},Mf,Fv;function Ag(){if(Fv)return Mf;Fv=1;var n=rn,e=Sg,t=Gr,r=n("%Promise.resolve%",!0),i=r&&e(r);return Mf=function(a,l){if(!i)throw new t("This environment does not support Promises.");return i(a,l)},Mf}var Of,Bv;function bC(){if(Bv)return Of;Bv=1;var n=rn,e=Gr,t=n("%Promise%",!0),r=xp,i=Ag(),o=_g;return Of=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)},Of}var Nf,qv;function SC(){if(qv)return Nf;qv=1;var n=wg;return Nf=function(t){return new n("throw",t)},Nf}var _C=rn,zf=Gr,Wv=re,AC=_C("%Promise%",!0),EC=Gi(),jv=EC("Promise.prototype.then",!0),kC=wg,Gv=bC(),CC=bg,TC=Ag(),Yv=SC(),$C=b2(),L2=function(e,t){if(!(t instanceof kC))throw new Wv("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new Wv("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 zf("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&TC(AC,t),l=function(y){if(t.type()==="throw"){var v=t.value(),_=new $C(y,v);t=Yv(_)}else t=Yv(y)},c=i==="ASYNC-DISPOSE"&&function(v){return jv(a,function(){var _=Gv(v["[[ResourceValue]]"],v["[[Hint]]"],v["[[DisposeMethod]]"]);if(!_)throw new zf("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return jv(_,CC)},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=Gv(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(g)throw new zf("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(y){l(y)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:t},D2=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Dp=rg,Eg=re,RC=xp,hl=ug,IC=zu,M2=cl,xC=bg,Et=yg,PC=I2,O2=mo.supportsDescriptors,LC=Sg,kg=P2,DC=L2,N2=D2,Jv=dg(),en=function n(){if(!(this instanceof n)||Et.has(this,"[[DisposableState]]")||Et.has(this,"[[DisposeCapability]]"))throw new Eg("can only be used with new");Et.set(this,"[[DisposableState]]","PENDING"),Et.set(this,"[[DisposeCapability]]",N2())},z2=function(){var e=this;return Et.assert(e,"[[DisposableState]]"),Et.get(e,"[[DisposableState]]")==="DISPOSED"},Uu=LC(z2);O2?IC(en.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":z2}):en.prototype.disposed=!1;var Z2=function(e){Et.set(e,"[[DisposableState]]","DISPOSED"),O2||(e.disposed=!0)};hl(en.prototype,"dispose",function(){var e=this;if(!Uu(e))return Z2(e),DC(Et.get(e,"[[DisposeCapability]]"),xC())["?"]()});hl(en.prototype,"use",function(e){var t=this;if(Uu(t))throw new Dp("a disposed stack can not use anything new");return kg(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(!M2(t))throw new Eg("`onDispose` must be a function");var i=function(){return RC(t,void 0,[e])};return kg(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(!M2(e))throw new Eg("`onDispose` must be a function");kg(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]]",N2()),Z2(e),t});Jv&&hl(en.prototype,Jv,en.prototype.dispose);PC(en.prototype,"DisposableStack");var MC=en,OC=MC,NC=function(){return typeof DisposableStack=="function"?DisposableStack:OC},zC=mo,ZC=tg(),HC=NC,UC=function(){var e=HC();return zC(ZC,{DisposableStack:e},{DisposableStack:!0}),e},VC=rn,Mp=rg,Cg=re,Kv=VC("%Promise%",!0),Tg=P2,FC=xp,dl=ug,BC=zu,qC=L2,H2=cl,U2=D2,WC=bg,Xv=Ag(),kt=yg,jC=I2,V2=mo.supportsDescriptors,GC=Sg,YC=Gi(),JC=YC("Promise.prototype.then",!0),Qv=pg(),tn=function n(){if(!(this instanceof n)||kt.has(this,"[[AsyncDisposableState]]")||kt.has(this,"[[DisposeCapability]]"))throw new Cg("can only be used with new");kt.set(this,"[[AsyncDisposableState]]","pending"),kt.set(this,"[[DisposeCapability]]",U2())},F2=function(){var e=this;return kt.assert(e,"[[AsyncDisposableState]]"),kt.get(e,"[[AsyncDisposableState]]")==="disposed"},Vu=GC(F2);V2?BC(tn.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":F2}):tn.prototype.disposed=!1;var B2=function(e){kt.set(e,"[[AsyncDisposableState]]","disposed"),V2||(e.disposed=!0)};dl(tn.prototype,"disposeAsync",function(){var e=this;return Vu(e)?Xv(Kv):(B2(e),JC(Xv(Kv,qC(kt.get(e,"[[DisposeCapability]]"),WC())),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 Tg(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(!H2(t))throw new Cg("`onDisposeAsync` must be a function");var i=function(){return FC(t,void 0,[e])};return i.value=e,Tg(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(!H2(e))throw new Cg("`onDispose` must be a function");Tg(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]]",U2()),B2(e),t});Qv&&dl(tn.prototype,Qv,tn.prototype.disposeAsync);jC(tn.prototype,"AsyncDisposableStack");var KC=tn,XC=KC,QC=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:XC},eT=mo,tT=tg(),nT=QC,rT=function(){var e=nT();return eT(tT,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},iT=ek,sT=lk,oT=UC,aT=rT,lT=function(){iT(),sT(),oT(),aT()};lT();const ey=new WeakMap;function cT(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 ty(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function uT(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class hT{constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw ty();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw ty();if(t.constructor.name==="AsyncFunction")throw uT();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=ey.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=ey.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(cT(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 q2=new hT,dT=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function pT(n){for(const e of Object.keys(n))if(dT.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function fT(n,e){pT(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}),fT(this,c)}}return n}class Kr extends globalThis.EventTarget{}const mT="X-Television-Client-Meta",gT="telemetry-activity",vT="telemetry-signal",W2={kind:"single",full_screen:!1},j2={width:560,height:740};function yT(n){return n.layout.flatMap(e=>e.artifactIds)}function wT(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())bT(r,t,e);return{valid:e.length===0,errors:e}}function pc(n){return n.flatMap(e=>e.artifactIds)}function v0(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 bT(n,e,t){if(!Zf(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`),!Zf(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`),!Zf(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 Zf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const At=sn(),Ph=sn(),ny=sn(),ST=sn(),_T=sn(),AT=sn();function G2(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const pl=G2("RequestError"),ry=G2("ValidationError"),ET=200,kT=300,ch=401;class CT{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 TT(i);if(!i.ok||i.status<ET||i.status>=kT)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 Hf(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 Hf(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 Hf(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[mT]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function TT(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function Hf(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 $T(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var mr,Md,Y2;class RT{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,Y2).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,Y2=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 ry("channelID is required, but no channels exist."):new ry(`channelID is required when multiple channels exist. Available channels: ${$T(t)}`)};var gr;class IT{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 xT{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 PT{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 LT{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 DT{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 MT{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 CT(e,t)),this.channels=new RT(s(this,Ht)),this.artifacts=new IT(s(this,Ht)),this.display=new DT(s(this,Ht)),this.themes=new xT(s(this,Ht)),this.markdown=new PT(s(this,Ht)),this.telemetry=new LT(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",OT=/^\d+\.\d+\.\d+$/,NT=3;function Op(n){return OT.test(n)}function $g(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<NT;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function zT(n,e){return n===vd||e===vd?!1:n!==e}const ZT=400,HT=404,J2=500,UT=600,VT={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,Rn,y0,xo,K2,w0,X2,Lh,b0,Q2,Po,e8,hr,S0,t8,Ie;class FT 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,WT());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,e8).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 ny("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 ST("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new _T("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new AT("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,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,S0).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,Rn).call(this,s(this,ee).connection.client.channels.create({name:t}),()=>u(this,L,K2).call(this));return r}focusChannel(t){return u(this,L,Ie).call(this),u(this,L,Rn).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,Rn).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,Rn).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,Rn).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,Rn).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,Rn).call(this,s(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>u(this,L,w0).call(this,t))}async deleteChannel(t){u(this,L,Ie).call(this),await u(this,L,Rn).call(this,s(this,ee).connection.client.channels.remove({channelID:t}),()=>u(this,L,X2).call(this,t))}updateChannelPages(t,r){u(this,L,Ie).call(this);const i=wT(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),sy(d))throw await u(this,L,y0).call(this,()=>u(this,L,w0).call(this,t)),d;if(!f||!KT(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=oy(s(this,ce),t);await u(this,L,Rn).call(this,s(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>u(this,L,Q2).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,Rn=async function(t,r){try{return await t}catch(i){throw!s(this,$t)&&sy(i)&&await u(this,L,y0).call(this,r),i}},y0=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))},K2=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)})},w0=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Vf(()=>r.channels.get({channelID:t})),i=>u(this,L,b0).call(this,t,i))},X2=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,async()=>{const[i,o]=await Promise.all([Vf(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{u(this,L,b0).call(this,t,i),u(this,L,Lh).call(this,o)})},Lh=function(t){s(this,ce).display=A0(t),s(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},b0=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)]))})},Q2=function(t,r){const i=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Vf(()=>i.artifacts.get({artifactID:t})),o=>{const a=oy(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,L,hr).call(this)}finally{s(this,vr).delete(o)}},e8=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:A0(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)]))});jT(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)?BT(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 ny("artifact-content-changed",{artifactID:g}))}catch{}finally{s(this,vr).delete(o)}},hr=function(){s(this,$t)||(h(this,gs,u(this,L,S0).call(this)),u(this,L,t8).call(this),this.dispatchEvent(new At("change")))},S0=function(){var o;const t=[...s(this,ce).channels.values()].map(a=>YT(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:JT(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:qT(((o=i.updateState)==null?void 0:o.desktop)??null)})})},t8=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 BT(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 qT(n){return n===null?null:Object.freeze({...n})}function WT(){return{channels:new Map,display:A0(VT)}}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=iy(o.previousPages,e.artifact.id)),!pc(i.channel.layout).includes(e.artifact.id)){const a=i.channel.layout,l=iy(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=v0(o.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const a=i.channel.layout,l=v0(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 XT(e)}}function jT(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=_0(r,i);if(o!==-1){n.set(e,[...r[o].artifactIds]);return}const a=_0(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&&GT(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 _0(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function GT(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function YT(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:_0(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 JT(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 iy(n,e){return pc(n).includes(e)?us(n):[...us(n),{artifactIds:[e],geometry:{...W2},size:{...j2}}]}function KT(n){return n instanceof pl&&n.status!==void 0&&n.status>=ZT&&n.status<J2}function sy(n){return n instanceof pl&&(n.status===void 0||n.status>=J2&&n.status<UT)}async function Vf(n){try{return await n()}catch(e){if(e instanceof pl&&e.status===HT)return null;throw e}}function oy(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 A0(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function XT(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function QT(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:(ay(),n.selectPage(r.id,g),!0)}const i=e$(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:(ay(),n.focusChannel(l).catch(()=>{}),!0)}function e$(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 ay(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const n8="0123456789ABCDEFGHJKMNPQRSTVWXYZ",wd=32,t$=16,r8=10,ly=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 n$(n){const e=Math.floor(n()*wd)%wd;return n8.charAt(e)}function r$(n){const e=i$(),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 i$(){return a$()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function s$(n,e){let t="";for(;n>0;n--)t=n$(e)+t;return t}function o$(n,e=r8){if(isNaN(n))throw new Hl(hs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>ly)throw new Hl(hs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${ly}: ${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=n8.charAt(t)+r,n=(n-t)/wd;return r}function a$(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Rg(n,e){const t=r$(),r=Date.now();return o$(r,r8)+s$(t$,t)}const Ul=sn(),i8=sn(),s8=sn(),l$=sn(),Ff=sn(),c$="store-";function Fi(n){return new URL(n).origin}function u$(){return{authTokens:{}}}var ys,ws,bs;class h$ extends Kr{constructor(t,r,i={}){super();p(this,ys);p(this,ws);p(this,bs);h(this,ys,`${c$}${t}`),h(this,ws,i.storage??p$());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,f$(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 cy(n,e){return n.authTokens[Fi(e)]??null}function uy(n,e,t){return{authTokens:{...n.authTokens,[Fi(e)]:t}}}function d$(n,e){const t=Fi(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function p$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function f$(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 o8 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const a8={};function Bi(n){return a8}function l8(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 E0(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 Ig(n){return n==null}function xg(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function m$(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 hy=Symbol("evaluating");function ue(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==hy)return r===void 0&&(r=hy,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 dy(n){return JSON.stringify(n)}function g$(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const c8="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function fc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const v$=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 u8(n){return el(n)?{...n}:Array.isArray(n)?[...n]:n}const y$=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 w$(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const b$={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 S$(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 _$(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 A$(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 E$(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 k$(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 C$(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 T$(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 Pg(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 h8=(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,E0,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},d8=k("$ZodError",h8),p8=k("$ZodError",h8,{Parent:Error});function $$(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 R$(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 Lg=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 c8(l,i==null?void 0:i.callee),l}return a.value},Dg=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 c8(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??d8)(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},I$=zp(p8),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}},x$=Zp(p8),P$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Lg(n)(e,t,i)},L$=n=>(e,t,r)=>Lg(n)(e,t,r),D$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dg(n)(e,t,i)},M$=n=>async(e,t,r)=>Dg(n)(e,t,r),O$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(e,t,i)},N$=n=>(e,t,r)=>zp(n)(e,t,r),z$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zp(n)(e,t,i)},Z$=n=>async(e,t,r)=>Zp(n)(e,t,r),H$=/^[cC][^\s-]{8,}$/,U$=/^[0-9a-z]+$/,V$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,F$=/^[0-9a-vA-V]{20}$/,B$=/^[A-Za-z0-9]{27}$/,q$=/^[a-zA-Z0-9_-]{21}$/,W$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j$=/^([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})$/,py=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)$/,G$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Y$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function J$(){return new RegExp(Y$,"u")}const 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])$/,X$=/^(([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}|:))$/,Q$=/^((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])$/,eR=/^(([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])$/,tR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,f8=/^[A-Za-z0-9_-]*$/,nR=/^\+[1-9]\d{6,14}$/,m8="(?:(?:\\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])))",rR=new RegExp(`^${m8}$`);function g8(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 iR(n){return new RegExp(`^${g8(n)}$`)}function sR(n){const e=g8({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(`^${m8}T(?:${r})$`)}const oR=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}$`)},aR=/^-?\d+$/,v8=/^-?\d+(?:\.\d+)?$/,lR=/^(?:true|false)$/i,cR=/^[^A-Z]*$/,uR=/^[^a-z]*$/,Ct=k("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),y8={number:"number",bigint:"bigint",object:"date"},w8=k("$ZodCheckLessThan",(n,e)=>{Ct.init(n,e);const t=y8[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})}}),b8=k("$ZodCheckGreaterThan",(n,e)=>{Ct.init(n,e);const t=y8[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})}}),hR=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):m$(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})}}),dR=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]=b$[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=aR)}),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})}}),pR=k("$ZodCheckMaxLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Ig(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=Pg(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),fR=k("$ZodCheckMinLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Ig(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=Pg(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),mR=k("$ZodCheckLengthEquals",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Ig(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=Pg(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=()=>{})}),gR=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})}}),vR=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=cR),Hp.init(n,e)}),yR=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=uR),Hp.init(n,e)}),wR=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})}}),bR=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})}}),SR=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})}}),_R=k("$ZodCheckOverwrite",(n,e)=>{Ct.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class AR{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 SR={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=SR;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=T$(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return $$(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}))}),Lg=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()??rR(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),Lg.init(n,e)}),_R=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=B$),_e.init(n,e)}),AR=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)}),ER=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=q$),_e.init(n,e)}),kR=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})}}}),CR=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=j$()),_e.init(n,e)}),TR=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=V$),_e.init(n,e)}),$R=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=N$),_e.init(n,e)}),RR=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=z$),_e.init(n,e)}),IR=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=Z$),_e.init(n,e)}),xR=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=H$),_e.init(n,e)}),PR=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=U$),_e.init(n,e)}),LR=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=nR(e)),_e.init(n,e)}),DR=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=eR),_e.init(n,e)}),MR=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=tR(e)),_e.init(n,e)}),OR=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=F$),_e.init(n,e)}),NR=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=G$),_e.init(n,e),n._zod.bag.format="ipv4"}),zR=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Y$),_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})}}}),ZR=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=J$),_e.init(n,e)}),HR=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=K$),_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 UR=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=X$),_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 VR(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 FR=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=u8),_e.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{VR(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),BR=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=Q$),_e.init(n,e)});function qR(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 WR=k("$ZodJWT",(n,e)=>{_e.init(n,e),n._zod.check=t=>{qR(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}}),jR=k("$ZodNumberFormat",(n,e)=>{cR.init(n,e),y8.init(n,e)}),GR=k("$ZodBoolean",(n,e)=>{Ee.init(n,e),n._zod.pattern=sR,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}}),YR=k("$ZodUnknown",(n,e)=>{Ee.init(n,e),n._zod.parse=t=>t}),JR=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 KR=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 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=g$(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 XR=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}}),QR=k("$ZodObjectJIT",(n,e)=>{XR.init(n,e);const t=n._zod.parse,r=Np(()=>w8(e)),i=y=>{var J;const v=new bR(["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],U=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 ER={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=ER;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=I$(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return x$(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}))}),Mg=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()??oR(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),Mg.init(n,e)}),kR=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=j$),_e.init(n,e)}),CR=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=py(r))}else e.pattern??(e.pattern=py());_e.init(n,e)}),TR=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=G$),_e.init(n,e)}),$R=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})}}}),RR=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=J$()),_e.init(n,e)}),IR=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=q$),_e.init(n,e)}),xR=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=H$),_e.init(n,e)}),PR=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=U$),_e.init(n,e)}),LR=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=V$),_e.init(n,e)}),DR=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=F$),_e.init(n,e)}),MR=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=B$),_e.init(n,e)}),OR=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=sR(e)),_e.init(n,e)}),NR=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=rR),_e.init(n,e)}),zR=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=iR(e)),_e.init(n,e)}),ZR=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=W$),_e.init(n,e)}),HR=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=K$),_e.init(n,e),n._zod.bag.format="ipv4"}),UR=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=X$),_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})}}}),VR=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Q$),_e.init(n,e)}),FR=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=eR),_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 S8(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const BR=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=tR),_e.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{S8(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function qR(n){if(!f8.test(n))return!1;const e=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return S8(t)}const WR=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=f8),_e.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{qR(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),jR=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=nR),_e.init(n,e)});function GR(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 YR=k("$ZodJWT",(n,e)=>{_e.init(n,e),n._zod.check=t=>{GR(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),_8=k("$ZodNumber",(n,e)=>{Ee.init(n,e),n._zod.pattern=n._zod.bag.pattern??v8,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}}),JR=k("$ZodNumberFormat",(n,e)=>{dR.init(n,e),_8.init(n,e)}),KR=k("$ZodBoolean",(n,e)=>{Ee.init(n,e),n._zod.pattern=lR,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}}),XR=k("$ZodUnknown",(n,e)=>{Ee.init(n,e),n._zod.parse=t=>t}),QR=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 fy(n,e,t){n.issues.length&&e.issues.push(...jo(t,n.issues)),e.value[t]=n.value}const eI=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=>fy(d,t,a))):fy(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 A8(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=w$(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function E8(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 tI=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(()=>A8(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?E8(f,d,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),nI=k("$ZodObjectJIT",(n,e)=>{tI.init(n,e);const t=n._zod.parse,r=Np(()=>A8(e)),i=y=>{var J;const v=new AR(["shape","payload","ctx"]),_=r.value,E=O=>{const Y=dy(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=dy(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
8
  if (${U} in input) {
9
9
  payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({
@@ -37,26 +37,26 @@ var __=Object.defineProperty;var T1=n=>{throw TypeError(n)};var A_=(n,e,t)=>e in
37
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=!r8.jitless,d=l&&f$.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 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 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=>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,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)}}),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"&&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}}),rI=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=>m$.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 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 py(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(`^(${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)=>{_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)}),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 Vl=globalThis.__zod_globalRegistry;function vI(n,e){return new n({type:"string",...H(e)})}function yI(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function wy(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function wI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function bI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function SI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function _I(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function AI(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function EI(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function kI(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function CI(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function TI(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function $I(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function RI(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function II(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function xI(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function PI(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function LI(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function DI(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function MI(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function OI(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function NI(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 ZI(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function HI(n,e){return new n({type:"string",format:"date",check:"string_format",...H(e)})}function UI(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function VI(n,e){return new n({type:"string",format:"duration",check:"string_format",...H(e)})}function FI(n,e){return new n({type:"number",checks:[],...H(e)})}function BI(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function qI(n,e){return new n({type:"boolean",...H(e)})}function WI(n){return new n({type:"unknown"})}function jI(n,e){return new n({type:"never",...H(e)})}function by(n,e){return new m8({check:"less_than",...H(e),value:n,inclusive:!1})}function Vf(n,e){return new m8({check:"less_than",...H(e),value:n,inclusive:!0})}function Sy(n,e){return new g8({check:"greater_than",...H(e),value:n,inclusive:!1})}function Ff(n,e){return new g8({check:"greater_than",...H(e),value:n,inclusive:!0})}function _y(n,e){return new lR({check:"multiple_of",...H(e),value:n})}function A8(n,e){return new uR({check:"max_length",...H(e),maximum:n})}function Sd(n,e){return new hR({check:"min_length",...H(e),minimum:n})}function E8(n,e){return new dR({check:"length_equals",...H(e),length:n})}function GI(n,e){return new pR({check:"string_format",format:"regex",...H(e),pattern:n})}function YI(n){return new fR({check:"string_format",format:"lowercase",...H(n)})}function JI(n){return new mR({check:"string_format",format:"uppercase",...H(n)})}function KI(n,e){return new gR({check:"string_format",format:"includes",...H(e),includes:n})}function XI(n,e){return new vR({check:"string_format",format:"starts_with",...H(e),prefix:n})}function QI(n,e){return new yR({check:"string_format",format:"ends_with",...H(e),suffix:n})}function fl(n){return new wR({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=>p$(n))}function sx(n,e,t){return new n({type:"array",element:e,...H(t)})}function ox(n,e,t){return new n({type:"custom",check:"custom",fn:e,...H(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",...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>
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=!a8.jitless,d=l&&v$.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?E8([],_,y,v,g,n):y):t(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:_,inst:n}),y)}});function my(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 k8=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=>xg(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=>my(c,i,n,o)):my(l,i,n,o)}}),rI=k("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,k8.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)}}),iI=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])=>gy(t,c,d)):gy(t,o,a)}});function k0(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=k0(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=k0(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 gy(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=k0(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 sI=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"&&v8.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}}),oI=k("$ZodEnum",(n,e)=>{Ee.init(n,e);const t=l8(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>y$.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}}),aI=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}}),lI=k("$ZodTransform",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new o8(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 vy(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const C8=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(`^(${xg(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=>vy(o,t.value)):vy(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),cI=k("$ZodExactOptional",(n,e)=>{C8.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)}),uI=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(`^(${xg(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)}),hI=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=>yy(o,e)):yy(i,e)}});function yy(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const dI=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))}),pI=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=>wy(o,n)):wy(i,n)}});function wy(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 fI=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)}}),mI=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 gI=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(by):by(i)}});function by(n){return n.value=Object.freeze(n.value),n}const vI=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=>Sy(o,t,r,n));Sy(i,t,r,n)}});function Sy(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 _y;class yI{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 wI(){return new yI}(_y=globalThis).__zod_globalRegistry??(_y.__zod_globalRegistry=wI());const Vl=globalThis.__zod_globalRegistry;function bI(n,e){return new n({type:"string",...H(e)})}function SI(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function Ay(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function _I(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function AI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function EI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function kI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function CI(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function TI(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function $I(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function RI(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function II(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function xI(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function PI(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function LI(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function DI(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function MI(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function OI(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function NI(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function zI(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function ZI(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function HI(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)})}function UI(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)})}function VI(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function FI(n,e){return new n({type:"string",format:"date",check:"string_format",...H(e)})}function BI(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function qI(n,e){return new n({type:"string",format:"duration",check:"string_format",...H(e)})}function WI(n,e){return new n({type:"number",checks:[],...H(e)})}function jI(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function GI(n,e){return new n({type:"boolean",...H(e)})}function YI(n){return new n({type:"unknown"})}function JI(n,e){return new n({type:"never",...H(e)})}function Ey(n,e){return new w8({check:"less_than",...H(e),value:n,inclusive:!1})}function Bf(n,e){return new w8({check:"less_than",...H(e),value:n,inclusive:!0})}function ky(n,e){return new b8({check:"greater_than",...H(e),value:n,inclusive:!1})}function qf(n,e){return new b8({check:"greater_than",...H(e),value:n,inclusive:!0})}function Cy(n,e){return new hR({check:"multiple_of",...H(e),value:n})}function T8(n,e){return new pR({check:"max_length",...H(e),maximum:n})}function Sd(n,e){return new fR({check:"min_length",...H(e),minimum:n})}function $8(n,e){return new mR({check:"length_equals",...H(e),length:n})}function KI(n,e){return new gR({check:"string_format",format:"regex",...H(e),pattern:n})}function XI(n){return new vR({check:"string_format",format:"lowercase",...H(n)})}function QI(n){return new yR({check:"string_format",format:"uppercase",...H(n)})}function ex(n,e){return new wR({check:"string_format",format:"includes",...H(e),includes:n})}function tx(n,e){return new bR({check:"string_format",format:"starts_with",...H(e),prefix:n})}function nx(n,e){return new SR({check:"string_format",format:"ends_with",...H(e),suffix:n})}function fl(n){return new _R({check:"overwrite",tx:n})}function rx(n){return fl(e=>e.normalize(n))}function ix(){return fl(n=>n.trim())}function sx(){return fl(n=>n.toLowerCase())}function ox(){return fl(n=>n.toUpperCase())}function ax(){return fl(n=>g$(n))}function lx(n,e,t){return new n({type:"array",element:e,...H(t)})}function cx(n,e,t){return new n({type:"custom",check:"custom",fn:e,...H(t)})}function ux(n){const e=hx(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 hx(n,e){const t=new Ct({check:"custom",...H(e)});return t._zod.check=n,t}function R8(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 I8(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 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 cx=(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)},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=i8(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=Le(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]=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)},_x=(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},Ax=(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},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=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)}},kx=(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"}]},Cx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},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,t.default=JSON.parse(JSON.stringify(i.defaultValue))},$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,e.io==="input"&&(t._prefault=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;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;Le(o,e,r);const a=e.seen.get(n);a.ref=o},xx=(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},Px=k("ZodISODateTime",(n,e)=>{LR.init(n,e),Ce.init(n,e)});function Lx(n){return ZI(Px,n)}const Dx=k("ZodISODate",(n,e)=>{DR.init(n,e),Ce.init(n,e)});function Mx(n){return HI(Dx,n)}const Ox=k("ZodISOTime",(n,e)=>{MR.init(n,e),Ce.init(n,e)});function Nx(n){return UI(Ox,n)}const zx=k("ZodISODuration",(n,e)=>{OR.init(n,e),Ce.init(n,e)});function Zx(n){return VI(zx,n)}const R8=(n,e)=>{l8.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>C$(n,t)},flatten:{value:t=>k$(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",R8),on=k("ZodError",R8,{Parent:Error}),Hx=xg(on),Ux=Pg(on),Vx=zp(on),Fx=Zp(on),Bx=R$(on),qx=I$(on),Wx=x$(on),jx=P$(on),Gx=L$(on),Yx=D$(on),Jx=M$(on),Kx=O$(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)=>Hx(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>Vx(n,t,r),n.parseAsync=async(t,r)=>Ux(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>Fx(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(F5(t,r)),n.superRefine=t=>n.check(B5(t)),n.overwrite=t=>n.check(fl(t)),n.optional=()=>Cy(n),n.exactOptional=()=>I5(n),n.nullable=()=>Ty(n),n.nullish=()=>Cy(Ty(n)),n.nonoptional=t=>O5(n,t),n.array=()=>z(n),n.or=t=>X([n,t]),n.and=t=>Up(n,t),n.transform=t=>$y(n,$5(t)),n.default=t=>L5(n,t),n.prefault=t=>M5(n,t),n.catch=t=>z5(n,t),n.pipe=t=>$y(n,t),n.readonly=()=>U5(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)=>{Lg.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(A8(...r)),n.length=(...r)=>n.check(E8(...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)=>{Lg.init(n,e),I8.init(n,e),n.email=t=>n.check(yI(Qx,t)),n.url=t=>n.check(AI(e5,t)),n.jwt=t=>n.check(zI(m5,t)),n.emoji=t=>n.check(EI(t5,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(n5,t)),n.guid=t=>n.check(wy(Ey,t)),n.cuid=t=>n.check(CI(r5,t)),n.cuid2=t=>n.check(TI(i5,t)),n.ulid=t=>n.check($I(s5,t)),n.base64=t=>n.check(MI(d5,t)),n.base64url=t=>n.check(OI(p5,t)),n.xid=t=>n.check(RI(o5,t)),n.ksuid=t=>n.check(II(a5,t)),n.ipv4=t=>n.check(xI(l5,t)),n.ipv6=t=>n.check(PI(c5,t)),n.cidrv4=t=>n.check(LI(u5,t)),n.cidrv6=t=>n.check(DI(h5,t)),n.e164=t=>n.check(NI(f5,t)),n.datetime=t=>n.check(Lx(t)),n.date=t=>n.check(Mx(t)),n.time=t=>n.check(Nx(t)),n.duration=t=>n.check(Zx(t))});function m(n){return vI(Xx,n)}const Ce=k("ZodStringFormat",(n,e)=>{_e.init(n,e),I8.init(n,e)}),Qx=k("ZodEmail",(n,e)=>{ER.init(n,e),Ce.init(n,e)}),Ey=k("ZodGUID",(n,e)=>{_R.init(n,e),Ce.init(n,e)}),ph=k("ZodUUID",(n,e)=>{AR.init(n,e),Ce.init(n,e)}),e5=k("ZodURL",(n,e)=>{kR.init(n,e),Ce.init(n,e)}),t5=k("ZodEmoji",(n,e)=>{CR.init(n,e),Ce.init(n,e)}),n5=k("ZodNanoID",(n,e)=>{TR.init(n,e),Ce.init(n,e)}),r5=k("ZodCUID",(n,e)=>{$R.init(n,e),Ce.init(n,e)}),i5=k("ZodCUID2",(n,e)=>{RR.init(n,e),Ce.init(n,e)}),s5=k("ZodULID",(n,e)=>{IR.init(n,e),Ce.init(n,e)}),o5=k("ZodXID",(n,e)=>{xR.init(n,e),Ce.init(n,e)}),a5=k("ZodKSUID",(n,e)=>{PR.init(n,e),Ce.init(n,e)}),l5=k("ZodIPv4",(n,e)=>{NR.init(n,e),Ce.init(n,e)}),c5=k("ZodIPv6",(n,e)=>{zR.init(n,e),Ce.init(n,e)}),u5=k("ZodCIDRv4",(n,e)=>{ZR.init(n,e),Ce.init(n,e)}),h5=k("ZodCIDRv6",(n,e)=>{HR.init(n,e),Ce.init(n,e)}),d5=k("ZodBase64",(n,e)=>{UR.init(n,e),Ce.init(n,e)}),p5=k("ZodBase64URL",(n,e)=>{FR.init(n,e),Ce.init(n,e)}),f5=k("ZodE164",(n,e)=>{BR.init(n,e),Ce.init(n,e)}),m5=k("ZodJWT",(n,e)=>{WR.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)=>dx(n,r,i),n.gt=(r,i)=>n.check(Sy(r,i)),n.gte=(r,i)=>n.check(Ff(r,i)),n.min=(r,i)=>n.check(Ff(r,i)),n.lt=(r,i)=>n.check(by(r,i)),n.lte=(r,i)=>n.check(Vf(r,i)),n.max=(r,i)=>n.check(Vf(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(Ff(0,r)),n.negative=r=>n.check(by(0,r)),n.nonpositive=r=>n.check(Vf(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 FI(x8,n)}const g5=k("ZodNumberFormat",(n,e)=>{jR.init(n,e),x8.init(n,e)});function ky(n){return BI(g5,n)}const v5=k("ZodBoolean",(n,e)=>{GR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>px(n,t,r)});function Ve(n){return qI(v5,n)}const y5=k("ZodUnknown",(n,e)=>{YR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mx()});function S(){return WI(y5)}const w5=k("ZodNever",(n,e)=>{JR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>fx(n,t,r)});function b5(n){return jI(w5,n)}const S5=k("ZodArray",(n,e)=>{KR.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(A8(t,r)),n.length=(t,r)=>n.check(E8(t,r)),n.unwrap=()=>n.element});function z(n,e){return sx(S5,n,e)}const P8=k("ZodObject",(n,e)=>{QR.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=()=>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:b5()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>b$(n,t),n.safeExtend=t=>S$(n,t),n.merge=t=>_$(n,t),n.pick=t=>y$(n,t),n.omit=t=>w$(n,t),n.partial=(...t)=>A$(O8,n,t[0]),n.required=(...t)=>E$(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)=>_x(n,t,r,i),n.options=e.options});function X(n,e){return new D8({type:"union",options:n,...H(e)})}const _5=k("ZodDiscriminatedUnion",(n,e)=>{D8.init(n,e),eI.init(n,e)});function A5(n,e,t){return new _5({type:"union",options:e,discriminator:n,...H(t)})}const E5=k("ZodIntersection",(n,e)=>{tI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ax(n,t,r,i)});function Up(n,e){return new E5({type:"intersection",left:n,right:e})}const k5=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 k5({type:"record",keyType:n,valueType:e,...H(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:[],...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 E0({...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 E0({type:"enum",entries:t,...H(e)})}const C5=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 C5({type:"literal",values:Array.isArray(n)?n:[n],...H(e)})}const T5=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 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 $5(n){return new T5({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 Cy(n){return new O8({type:"optional",innerType:n})}const R5=k("ZodExactOptional",(n,e)=>{oI.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 I5(n){return new R5({type:"optional",innerType:n})}const x5=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 x5({type:"nullable",innerType:n})}const P5=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 L5(n,e){return new P5({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():o8(e)}})}const D5=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 M5(n,e){return new D5({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():o8(e)}})}const N8=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 O5(n,e){return new N8({type:"nonoptional",innerType:n,...H(e)})}const N5=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 z5(n,e){return new N5({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const Z5=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 Z5({type:"pipe",in:n,out:e})}const H5=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 U5(n){return new H5({type:"readonly",innerType:n})}const V5=k("ZodCustom",(n,e)=>{fI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>yx(n,t)});function F5(n,e={}){return ox(V5,n,e)}function B5(n){return ax(n)}const q5=[".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 W5(n){return Z8(n).toLowerCase()}function j5(n,e){const t=W5(n);return e.some(r=>t.endsWith(r))}function k0(n){return!z8(n)&&j5(n,q5)}function G5(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 Y5=L8({id:m().min(1),kind:$("path"),title:m(),path:m()}).strict(),J5=L8({id:m().min(1),kind:$("url"),title:m(),url:m().refine(G5,{message:"url must be an http(s) URL"})}).strict();A5("kind",[Y5,J5]);const K5=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function X5(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}:K5.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Ry(n,e){return X5(n,e).kind==="web"}const Q5="/views/markdown/",eP="/views/url-unsupported/";function tP(n){try{const{protocol:e}=new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function H8(n){return`/artifact/${encodeURIComponent(n)}`}function nP(n,e){return`${H8(n)}/${encodeURIComponent(e)}`}function rP(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&&tP(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:eP,contentURL:null};if(k0(n.path)){const r={viewURL:Q5,contentURL:rP(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=z8(n.path)?`${H8(n.id)}/`:nP(n.id,Z8(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const iP="serverURL",sP="token",oP="mode",aP="desktopAppVersion",lP="electron";function cP(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(iP);return r?new URL(r).origin:new URL(e).origin}function uP(n=window.location.search){return new URLSearchParams(n).get(sP)}function Br(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(oP)===lP}function U8(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(aP)}const Iy="tv.telemetry.clientId",hP=5,dP=60,pP=1e3,fP=hP*dP*pP,xy=["pointerdown","scroll","keydown"],Py=["focus"],Ly=["visibilitychange"],mP="hidden";function gP(n,e=SP){const t=n.getItem(Iy);if(t)return t;const r=e();return n.setItem(Iy,r),r}function vP(n){return{clientId:gP(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function yP(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 wP(n){return new bP(n)}var Ac,wr,ai,Ec,kc,Ut,Ss,Cc,Od,V8;class bP{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 xy)s(this,ai).addEventListener(e,s(this,Ut)),s(this,wr).addEventListener(e,s(this,Ut));for(const e of Py)s(this,ai).addEventListener(e,s(this,Ut));for(const e of Ly)s(this,wr).addEventListener(e,s(this,Ut))}}stop(){if(s(this,Ss)){h(this,Ss,!1);for(const e of xy)s(this,ai).removeEventListener(e,s(this,Ut)),s(this,wr).removeEventListener(e,s(this,Ut));for(const e of Py)s(this,ai).removeEventListener(e,s(this,Ut));for(const e of Ly)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===mP)return;const e=s(this,kc).call(this);e-s(this,Cc)<fP||(h(this,Cc,e),s(this,Ec).call(this,{type:pT,clientId:s(this,Ac).clientId}))};function SP(){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"},_P=1,AP=w({_meta:A(m(),S()).nullish(),terminal:Ve().optional().default(!1)}),EP=w({_meta:A(m(),S()).nullish(),label:m().nullish(),name:m(),optional:Ve().optional().default(!1),secret:Ve().optional().default(!0)}),kP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),name:m()}),CP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),link:m().nullish(),name:m(),vars:z(EP)}),TP=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),description:m().nullish(),env:A(m(),m()).optional(),id:m(),name:m()}),$P=X([CP.and(w({type:$("env_var")})),TP.and(w({type:$("terminal")})),kP]),RP=w({_meta:A(m(),S()).nullish(),methodId:m()}),IP=w({_meta:A(m(),S()).nullish()}),xP=w({_meta:A(m(),S()).nullish(),blob:m(),mimeType:m().nullish(),uri:m()}),PP=w({default:Ve().nullish(),description:m().nullish(),title:m().nullish()}),LP=w({_meta:A(m(),S()).nullish()}),DP=w({_meta:A(m(),S()).nullish()}),MP=w({amount:G(),currency:m()}),OP=w({_meta:A(m(),S()).nullish(),terminalId:m()}),NP=w({_meta:A(m(),S()).nullish(),newText:m(),oldText:m().nullish(),path:m()}),zP=X([m(),G(),G(),Ve(),z(m())]),ZP=w({content:A(m(),zP).nullish()}),HP=X([ZP.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),UP=w({_meta:A(m(),S()).nullish()}),F8=m(),VP=w({_meta:A(m(),S()).nullish(),elicitationId:F8}),FP=w({_meta:A(m(),S()).nullish(),action:HP}),BP=$("object"),qP=$("string"),WP=w({_meta:A(m(),S()).nullish()}),jP=w({_meta:A(m(),S()).nullish(),form:UP.nullish(),url:WP.nullish()}),GP=w({elicitationId:F8,url:m().url()}),B8=w({const:m(),title:m()}),q8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),YP=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:YP,data:S().optional(),message:m()}),j8=S(),G8=S(),Y8=S(),JP=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()}),KP=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),XP=w({_meta:A(m(),S()).nullish()}),QP=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cursor:m().nullish(),cwd:m().nullish()}),eL=w({_meta:A(m(),S()).nullish()}),tL=w({_meta:A(m(),S()).nullish(),logout:eL.nullish()}),nL=w({_meta:A(m(),S()).nullish()}),rL=w({_meta:A(m(),S()).nullish()}),iL=w({_meta:A(m(),S()).nullish(),http:Ve().optional().default(!1),sse:Ve().optional().default(!1)}),sL=w({_meta:A(m(),S()).nullish(),headers:z(J8),name:m(),url:m()}),oL=w({_meta:A(m(),S()).nullish(),headers:z(J8),name:m(),url:m()}),aL=w({_meta:A(m(),S()).nullish(),args:z(m()),command:m(),env:z(q8),name:m()}),Vp=X([sL.and(w({type:$("http")})),oL.and(w({type:$("sse")})),aL]),Dg=m(),lL=w({_meta:A(m(),S()).nullish(),description:m().nullish(),modelId:Dg,name:m()}),cL=X([$("error"),$("warning"),$("information"),$("hint")]),uL=w({_meta:A(m(),S()).nullish()}),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(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),gL=w({diff:m(),uri:m()}),vL=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()}),yL=w({_meta:A(m(),S()).nullish()}),wL=w({_meta:A(m(),S()).nullish()}),bL=w({languageId:m(),text:m(),uri:m()}),SL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),_L=X([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),AL=w({excerpts:z(vL),uri:m()}),EL=w({_meta:A(m(),S()).nullish()}),kL=w({_meta:A(m(),S()).nullish()}),CL=w({name:m(),owner:m(),remoteUrl:m()}),TL=w({_meta:A(m(),S()).nullish()}),$L=w({_meta:A(m(),S()).nullish(),jump:yL.nullish(),rename:kL.nullish(),searchAndReplace:TL.nullish()}),RL=w({id:m(),isRegex:Ve().nullish(),replace:m(),search:m(),uri:m()}),IL=X([$("automatic"),$("diagnostic"),$("manual")]),xL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),PL=w({_meta:A(m(),S()).nullish(),diagnostics:uL.nullish(),editHistory:mL.nullish(),openFiles:wL.nullish(),recentFiles:SL.nullish(),relatedSnippets:EL.nullish(),userActions:xL.nullish()}),LL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp)}),DL=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),X8=m(),ML=X([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),OL=w({_meta:A(m(),S()).nullish(),kind:ML,name:m(),optionId:X8}),NL=X([$("high"),$("medium"),$("low")]),zL=X([$("pending"),$("in_progress"),$("completed")]),ZL=w({_meta:A(m(),S()).nullish(),content:m(),priority:NL,status:zL}),HL=w({_meta:A(m(),S()).nullish(),entries:z(ZL)}),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"})}),UL=w({id:m(),position:Wi,uri:m()}),VL=w({id:m(),newName:m(),position:Wi,uri:m()}),FL=w({action:m(),position:Wi,timestampMs:G(),uri:m()}),Q8=X([$("utf-16"),$("utf-32"),$("utf-8")]),BL=w({_meta:A(m(),S()).nullish(),auth:AP.optional().default({terminal:!1}),elicitation:jP.nullish(),fs:JP.optional().default({readTextFile:!1,writeTextFile:!1}),nes:$L.nullish(),positionEncodings:z(Q8).optional(),terminal:Ve().optional().default(!1)}),qL=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),WL=w({_meta:A(m(),S()).nullish(),clientCapabilities:BL.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:K8.nullish(),protocolVersion:eb}),ml=w({end:Wi,start:Wi}),jL=w({message:m(),range:ml,severity:cL,uri:m()}),GL=w({languageId:m(),lastFocusedMs:G().nullish(),uri:m(),visibleRange:ml.nullish()}),YL=w({_meta:A(m(),S()).nullish(),diagnostics:z(jL).nullish(),editHistory:z(gL).nullish(),openFiles:z(GL).nullish(),recentFiles:z(bL).nullish(),relatedSnippets:z(AL).nullish(),userActions:z(FL).nullish()}),JL=w({newText:m(),range:ml}),KL=w({cursorPosition:Wi.nullish(),edits:z(JL),id:m(),uri:m()}),XL=X([KL.and(w({kind:$("edit")})),UL.and(w({kind:$("jump")})),VL.and(w({kind:$("rename")})),RL.and(w({kind:$("searchAndReplace")}))]),QL=w({_meta:A(m(),S()).nullish(),content:m()}),eD=w({_meta:A(m(),S()).nullish()}),ho=X([G(),m()]).nullable();w({_meta:A(m(),S()).nullish(),requestId:ho});const tD=M8(["assistant","user"]),Fu=w({_meta:A(m(),S()).nullish(),audience:z(tD).nullish(),lastModified:m().nullish(),priority:G().nullish()}),nD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m()}),rD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m(),uri:m().nullish()}),iD=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()}),sD=w({_meta:A(m(),S()).nullish(),optionId:X8}),oD=X([w({outcome:$("cancelled")}),sD.and(w({outcome:$("selected")}))]),aD=w({_meta:A(m(),S()).nullish(),outcome:oD}),lD=w({_meta:A(m(),S()).nullish()}),cD=w({_meta:A(m(),S()).nullish()}),uD=w({currentValue:Ve()}),hD=m(),tb=m(),dD=X([$("mode"),$("model"),$("thought_level"),m()]),Mg=m(),nb=w({_meta:A(m(),S()).nullish(),description:m().nullish(),name:m(),value:Mg}),pD=w({_meta:A(m(),S()).nullish(),group:hD,name:m(),options:z(nb)}),fD=X([z(nb),z(pD)]),mD=w({currentValue:Mg,options:fD}),gl=Up(X([mD.and(w({type:$("select")})),uD.and(w({type:$("boolean")}))]),w({_meta:A(m(),S()).nullish(),category:dD.nullish(),description:m().nullish(),id:tb,name:m()})),gD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),vD=w({_meta:A(m(),S()).nullish()}),ae=m(),yD=w({_meta:A(m(),S()).nullish(),id:m(),sessionId:ae}),wD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),bD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),SD=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}),_D=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),AD=w({_meta:A(m(),S()).nullish(),position:Wi,sessionId:ae,uri:m(),version:G(),visibleRange:ml}),ED=w({_meta:A(m(),S()).nullish(),languageId:m(),sessionId:ae,text:m(),uri:m(),version:G()}),kD=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),CD=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()}),TD=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}),$D=w({_meta:A(m(),S()).nullish(),id:m(),reason:_L.nullish(),sessionId:ae}),ob=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),RD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp).optional(),sessionId:ae}),ID=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),sessionId:ae,title:m().nullish(),updatedAt:m().nullish()}),xD=w({_meta:A(m(),S()).nullish(),nextCursor:m().nullish(),sessions:z(ID)}),PD=w({_meta:A(m(),S()).nullish(),title:m().nullish(),updatedAt:m().nullish()}),LD=w({_meta:A(m(),S()).nullish()}),Fp=m(),DD=w({_meta:A(m(),S()).nullish(),currentModeId:Fp}),MD=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:Fp,name:m()}),Bp=w({_meta:A(m(),S()).nullish(),availableModes:z(MD),currentModeId:Fp}),qp=w({_meta:A(m(),S()).nullish(),availableModels:z(lL),currentModelId:Dg}),OD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),ND=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}),ZD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),HD=w({_meta:A(m(),S()).nullish()}),UD=w({_meta:A(m(),S()).nullish(),additionalDirectories:lD.nullish(),close:cD.nullish(),fork:vD.nullish(),list:LD.nullish(),resume:HD.nullish()}),VD=Up(X([w({type:$("boolean"),value:Ve()}),w({value:Mg})]),w({_meta:A(m(),S()).nullish(),configId:tb,sessionId:ae})),FD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),BD=w({_meta:A(m(),S()).nullish(),modeId:Fp,sessionId:ae}),qD=w({_meta:A(m(),S()).nullish()}),WD=w({_meta:A(m(),S()).nullish(),modelId:Dg,sessionId:ae}),jD=w({_meta:A(m(),S()).nullish()}),GD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),YD=X([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),JD=X([$("email"),$("uri"),$("date"),$("date-time")]),KD=w({default:m().nullish(),description:m().nullish(),enum:z(m()).nullish(),format:JD.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()}),XD=w({_meta:A(m(),S()).nullish(),context:YL.nullish(),position:Wi,selection:ml.nullish(),sessionId:ae,triggerKind:IL,uri:m(),version:G()}),QD=w({_meta:A(m(),S()).nullish(),suggestions:z(XL)}),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()}),ab=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),nM=w({_meta:A(m(),S()).nullish(),exitStatus:tM.nullish(),output:m(),truncated:Ve()}),rM=w({_meta:A(m(),S()).nullish(),annotations:Fu.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([wD,ED,sM,_D,kD,AD,yD,$D,j8]).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:hL.nullish(),didFocus:dL.nullish(),didOpen:pL.nullish(),didSave:fL.nullish()}),cM=w({_meta:A(m(),S()).nullish(),document:lM.nullish()}),uM=w({_meta:A(m(),S()).nullish(),context:PL.nullish(),events:cM.nullish()}),hM=w({_meta:A(m(),S()).nullish(),auth:tL.optional().default({}),loadSession:Ve().optional().default(!1),mcpCapabilities:iL.optional().default({http:!1,sse:!1}),nes:uM.nullish(),positionEncoding:Q8.nullish(),promptCapabilities:qL.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:UD.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:K8.nullish(),authMethods:z($P).optional().default([]),protocolVersion:eb}),pM=w({_meta:A(m(),S()).nullish(),mimeType:m().nullish(),text:m(),uri:m()}),fM=X([pM,xP]),mM=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),resource:fM}),Og=X([rM.and(w({type:$("text")})),rD.and(w({type:$("image")})),nD.and(w({type:$("audio")})),iD.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(B8)}),lb=X([gM.and(w({type:$("content")})),NP.and(w({type:$("diff")})),eM.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")]),wM=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(OL),sessionId:ae,toolCall:pb}),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:qP}),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([KD.and(w({type:$("string")})),DL.and(w({type:$("number")})),KP.and(w({type:$("integer")})),PP.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:BP.optional().default("object")}),RM=w({requestedSchema:$M}),IM=Up(X([RM.and(w({mode:$("form")})),GP.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:YD,usage:xM.nullish(),userMessageId:m().nullish()});X([w({id:ho,result:X([dM,IP,rL,zD,ND,xD,OD,ZD,DP,qD,FD,PM,jD,GD,QD,LP,Y8])}),w({error:W8,id:ho})]);const LM=w({_meta:A(m(),S()).nullish(),cost:MP.nullish(),size:G(),used:G()}),DM=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")})),pb.and(w({sessionUpdate:$("tool_call_update")})),HL.and(w({sessionUpdate:$("plan")})),AM.and(w({sessionUpdate:$("available_commands_update")})),DD.and(w({sessionUpdate:$("current_mode_update")})),gD.and(w({sessionUpdate:$("config_option_update")})),PD.and(w({sessionUpdate:$("session_info_update")})),LM.and(w({sessionUpdate:$("usage_update")}))]),mb=w({_meta:A(m(),S()).nullish(),sessionId:ae,update:DM});w({method:m(),params:X([mb,VP,j8]).nullish()});const gb=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:CL.nullish(),workspaceFolders:z(OM).nullish(),workspaceUri:m().nullish()});w({id:ho,method:m(),params:X([WL,RP,nL,LL,TD,QP,CD,RD,SD,BD,VD,vM,WD,NM,XD,bD,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,IM,G8]).nullish()});const zM=w({_meta:A(m(),S()).nullish()});X([w({id:ho,result:X([zM,QL,aD,OP,nM,eD,MM,XP,FP,Y8])}),w({error:W8,id:ho})]);var oe;class ZM{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 HM(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,Pn,Rc,Ae,yb,C0,wb,bb,Sb,_b,T0,Fl;class HM{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,Pn,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,Pn).signal.addEventListener("abort",()=>i())})),u(this,Ae,yb).call(this)}get signal(){return s(this,Pn).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,Fl).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,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,Pn=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,Pn).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,C0).call(this,e)}},C0=function(e){if(s(this,Pn).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,Pn).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 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()}}},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 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()}}},_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)},T0=function(){if(s(this,Pn).signal.aborted)throw s(this,Pn).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,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 UM(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);UM(this,()=>s(this,t),()=>{h(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,t)}}return t=new WeakMap,e}const VM=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,FM=/^\[[^\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=/^[A-Za-z0-9_@%+=:,./-]+$/,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,Ln,Rt,Dn,ci,ln,br,Mn,cn,ui,un,ia,sa,On,tt,Sr,oa,_s,_r,hi,Ic,hn,Nn,zd,zn,R,$0,kb,Cb,Tb,Dh,$b,Rb,Ib,xb,Pb,Lb,Db,rs,Lo,Do,dr,Mb,Mo,R0,I0,Mh,Ob,Oh,x0,P0,xc,Pc,Nh,Oo,L0,Nb;class KM extends JM{constructor(t){super();p(this,R);p(this,ra,"disconnected");p(this,Ln,null);p(this,Rt,new Map);p(this,Dn,null);p(this,ci,null);p(this,ln,null);p(this,br,null);p(this,Mn,null);p(this,cn,null);p(this,ui);p(this,un,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,hn);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,hn,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,hn).enabled??!1}setToken(t){s(this,hn).token=t??""}setEnabled(t){s(this,hn).enabled=t,t||(u(this,R,Nh).call(this),h(this,Ln,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,Ln,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,qf(t)),t}}}dispose(){u(this,R,Nh).call(this),h(this,Ln,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,Mn)===null||s(this,un)!==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,I0).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,$0).call(this,"ready"));const t=u(this,R,Oh).call(this);((r=s(this,cn))==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,Mn,null),h(this,un,null),u(this,R,L0).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,un)||i!==r.channelID)&&h(this,Sr,!0);return}s(this,un)!==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,Dh).call(this).catch(c=>{u(this,R,Oo).call(this,qf(c))}))}}ra=new WeakMap,Ln=new WeakMap,Rt=new WeakMap,Dn=new WeakMap,ci=new WeakMap,ln=new WeakMap,br=new WeakMap,Mn=new WeakMap,cn=new WeakMap,ui=new WeakMap,un=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,hn=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,Ln)??"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,Ln)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},kb=async function(){try{const{stream:t,socket:r,metadata:i}=await nO({serverURL:s(this,hn).serverURL,token:s(this,hn).token,createSocket:s(this,Ic),onDisconnect:s(this,zd)});h(this,cn,i),h(this,zn,r),r.addEventListener("close",s(this,xc)),r.addEventListener("error",s(this,Pc)),h(this,Dn,new ZM(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,Dn).initialize({protocolVersion:_P,clientCapabilities:{},clientInfo:YM})}catch(t){throw t}},Cb=function(t){u(this,R,Oo).call(this,qf(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,L0).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,cn))==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,Mn,i),h(this,un,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,Ln,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,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,Do).call(this,o);return}u(this,R,Lo).call(this,o)},Lb=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,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=Dy(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:Dy(`${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 Uf("messages-changed"))},Do=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Uf("messages-changed"))},dr=function(t){s(this,ra)!==t&&(h(this,ra,t),this.dispatchEvent(new s$("status-changed")))},Mb=function(t){var d;const r=s(this,un);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>`."],c=((d=s(this,cn))==null?void 0:d.tvArgs)??[];return c.length>0&&l.push(`To reach this Television server, add these arguments to each tv command that contacts it: ${c.map(sO).join(" ")}`),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,Mn))throw new Error("ACP session is not ready");return s(this,Mn)},Mh=function(){if(!s(this,Dn))throw new Error("ACP connection is not ready");return s(this,Dn)},Ob=function(){var r;const t=(r=s(this,cn))==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,`${Eb}-${(s(this,hn).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,eO(s(this,Nn),t,s(this,hn).clientGUID??"default-client"))},P0=function(t){var r;return((r=s(this,cn))==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,Mn,null),h(this,un,null),h(this,cn,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,Mn)!==null||s(this,un)!==null||s(this,cn)!==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,Ln,t??null),u(this,R,dr).call(this,"disconnected"))},L0=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 Uf("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 Dy(n){let e=n;return e=e.replace(VM,""),e=e.replace(FM,""),e=e.replace(BM,""),e=zb(e),e}function tO(n){let e=n;return e=e.replace(jM,""),e=zb(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 nO(n){const e=n.createSocket(aO(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=oO(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,tvArgs:i}=n;if((e==="openclaw"||e==="hermes")&&(t==="deterministic"||t==="mapped")&&typeof r=="string"&&r.length>0&&iO(i))return{agent:e,sessionIdStrategy:t,sessionCwd:r,tvArgs:i};throw new Error("ACP bridge ready status missing bootstrap metadata")}function iO(n){return Array.isArray(n)&&n.every(e=>typeof e=="string")}function sO(n){return WM.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`}function oO(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 aO(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 lO{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,D0;class cO{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,D0).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,D0).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(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"))},D0=function(e){const t={version:zy,entries:e};s(this,la).setItem(Ny,JSON.stringify(t))};function Zb(){return typeof window>"u"?null:window.localStorage}function uO(n){const e=n.getItem(Oy);if(e)return e;const t=Tg().toLowerCase();return n.setItem(Oy,t),t}const Zy=4401,hO=401,fh=1e3,dO=3e4;class Hh extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class pO 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 PT(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 cO(t.acpStorage,this.url):new lO);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?wP({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&&!mT(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=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 fO(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(mO(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(SO(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=bO(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(!wO(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=gO(g);if(!l){d(y===Zy?new Hh:new Error("Connection closed before initialization"));return}if(y===Zy){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,dO),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:fT,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 fO(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function mO(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 yP(t))r.searchParams.set(i,o);return r.hash="",r.toString()}function gO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const vO={"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},yO=new Set(Object.keys(vO));function wO(n){return yO.has(n)}function bO(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 SO(n){return n instanceof pl&&n.status===hO}const _O="Local";var Vt,dn,rr,M0,O0,Hb,Dc,Mc,Oc,Nc,zc;class AO 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,dn,!1);p(this,Dc,()=>{s(this,dn)||(u(this,rr,Hb).call(this),this.dispatchEvent(new At("change")))});p(this,Mc,t=>{s(this,dn)||this.dispatchEvent(new Ph("server-event",{serverURL:t.serverURL,event:t.event}))});p(this,Oc,()=>{s(this,dn)||this.dispatchEvent(new Ul("channels-changed"))});p(this,Nc,t=>{s(this,dn)||this.dispatchEvent(new e8("server-reconnected",{serverURL:t.serverURL}))});p(this,zc,t=>{s(this,dn)||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?uO(this.acpStorage):Tg().toLowerCase());const r=Fi(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&s(this,Vt).set(oy(s(this,Vt).get(),r,t.launchToken));const i=t.launchToken??sy(s(this,Vt).get(),r),o=t.createSocket??(l=>new WebSocket(l)),a=t.createConnection??(l=>new pO(l));this.connection=a({url:r,name:t.connectionName??_O,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 sy(s(this,Vt).get(),this.connection.url)}async connect(){await u(this,rr,M0).call(this,this.connection.token)}async authenticate(t){s(this,Vt).set(oy(s(this,Vt).get(),this.connection.url,t)),await u(this,rr,M0).call(this,t)}dispose(){s(this,dn)||(h(this,dn,!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,dn=new WeakMap,rr=new WeakSet,M0=async function(t){if(!s(this,dn)){u(this,rr,O0).call(this,null);try{await this.connection.connect(t)}catch(r){u(this,rr,O0).call(this,r instanceof Hh?null:r instanceof Error?r.message:String(r))}}},O0=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=c$(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 N0="tv-nav:",nl="tv-reload",Hy=100,EO=1e3,kO=60,CO=60,TO=24,$O=30,RO=$O*TO*CO*kO*EO;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,z0,Z0;class IO 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,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))}}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,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,Z0),JSON.stringify(u(this,Pe,Vb).call(this)))}catch(t){if(!LO(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)}},z0=function(){if(s(this,ge).length<=Hy)return;const t=s(this,ge).length-Hy;h(this,ge,s(this,ge).slice(t)),h(this,pe,Math.max(-1,s(this,pe)-t))},Z0=function(){return xO(s(this,Zc))};function xO(n){return`${N0}${n}`}function PO(n){const e=Date.now()-RO,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(!Fb(l)){t.push(i);continue}!n.has(o)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function LO(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 Wf="tv-channel-sidebar-collapsed";var Es;class DO{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",H0=160,U0=350,mh=260,MO=/^-?\d+$/;var ks;class OO{constructor(e){p(this,ks);h(this,ks,e)}read(){const e=s(this,ks).getItem(jf);if(e===null||!MO.test(e))return null;const t=BigInt(e);return t<BigInt(H0)?H0:t>BigInt(U0)?U0:Number(t)}commit(e){const t=Bb(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 Bb(n){return Math.min(Math.max(n,H0),U0)}const NO="1.4.8";function Ng(n=NO){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 V0="tv-reload-attempted";function zO(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:MT(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 ZO(n){const e=n.getItem(V0);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 HO(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=zO({bundleVersion:i,serverVersion:d.message.version,originMatch:d.serverURL===n.primaryServerURL,marker:ZO(e)});switch(f.action){case"reload":e.setItem(V0,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(V0),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 UO(n){const e=Br(n.search),t=U8(n.search),r=t!==null&&Op(t)?t:null;return{electron:e,shellVersion:r}}function VO(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 FO=`# 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 x8(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 dx=(n,e={})=>t=>{const r=R8({...t,processors:e});return Le(n,r),I8(r,n),x8(r,n)},_d=(n,e,t={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=R8({...i??{},target:o,io:e,processors:t});return Le(n,a),I8(a,n),x8(a,n)},px={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fx=(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=px[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}))])}},mx=(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)},gx=(n,e,t,r)=>{t.type="boolean"},vx=(n,e,t,r)=>{t.not={}},yx=(n,e,t,r)=>{},wx=(n,e,t,r)=>{const i=n._zod.def,o=l8(i.entries);o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),t.enum=o},bx=(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},Sx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_x=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ax=(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"]})},Ex=(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)},kx=(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},Cx=(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},Tx=(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)}},$x=(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"}]},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},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,t.default=JSON.parse(JSON.stringify(i.defaultValue))},xx=(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)))},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;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=a},Lx=(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},Dx=(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},P8=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Mx=k("ZodISODateTime",(n,e)=>{OR.init(n,e),Ce.init(n,e)});function Ox(n){return VI(Mx,n)}const Nx=k("ZodISODate",(n,e)=>{NR.init(n,e),Ce.init(n,e)});function zx(n){return FI(Nx,n)}const Zx=k("ZodISOTime",(n,e)=>{zR.init(n,e),Ce.init(n,e)});function Hx(n){return BI(Zx,n)}const Ux=k("ZodISODuration",(n,e)=>{ZR.init(n,e),Ce.init(n,e)});function Vx(n){return qI(Ux,n)}const L8=(n,e)=>{d8.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>R$(n,t)},flatten:{value:t=>$$(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,E0,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,E0,2)}},isEmpty:{get(){return n.issues.length===0}}})},Ty=k("ZodError",L8),on=k("ZodError",L8,{Parent:Error}),Fx=Lg(on),Bx=Dg(on),qx=zp(on),Wx=Zp(on),jx=P$(on),Gx=L$(on),Yx=D$(on),Jx=M$(on),Kx=O$(on),Xx=N$(on),Qx=z$(on),e5=Z$(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=dx(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)=>Fx(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>qx(n,t,r),n.parseAsync=async(t,r)=>Bx(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>Wx(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>jx(n,t,r),n.decode=(t,r)=>Gx(n,t,r),n.encodeAsync=async(t,r)=>Yx(n,t,r),n.decodeAsync=async(t,r)=>Jx(n,t,r),n.safeEncode=(t,r)=>Kx(n,t,r),n.safeDecode=(t,r)=>Xx(n,t,r),n.safeEncodeAsync=async(t,r)=>Qx(n,t,r),n.safeDecodeAsync=async(t,r)=>e5(n,t,r),n.refine=(t,r)=>n.check(W5(t,r)),n.superRefine=t=>n.check(j5(t)),n.overwrite=t=>n.check(fl(t)),n.optional=()=>Iy(n),n.exactOptional=()=>L5(n),n.nullable=()=>xy(n),n.nullish=()=>Iy(xy(n)),n.nonoptional=t=>Z5(n,t),n.array=()=>z(n),n.or=t=>X([n,t]),n.and=t=>Up(n,t),n.transform=t=>Py(n,x5(t)),n.default=t=>O5(n,t),n.prefault=t=>z5(n,t),n.catch=t=>U5(n,t),n.pipe=t=>Py(n,t),n.readonly=()=>B5(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)),D8=k("_ZodString",(n,e)=>{Mg.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>fx(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(KI(...r)),n.includes=(...r)=>n.check(ex(...r)),n.startsWith=(...r)=>n.check(tx(...r)),n.endsWith=(...r)=>n.check(nx(...r)),n.min=(...r)=>n.check(Sd(...r)),n.max=(...r)=>n.check(T8(...r)),n.length=(...r)=>n.check($8(...r)),n.nonempty=(...r)=>n.check(Sd(1,...r)),n.lowercase=r=>n.check(XI(r)),n.uppercase=r=>n.check(QI(r)),n.trim=()=>n.check(ix()),n.normalize=(...r)=>n.check(rx(...r)),n.toLowerCase=()=>n.check(sx()),n.toUpperCase=()=>n.check(ox()),n.slugify=()=>n.check(ax())}),t5=k("ZodString",(n,e)=>{Mg.init(n,e),D8.init(n,e),n.email=t=>n.check(SI(n5,t)),n.url=t=>n.check(CI(r5,t)),n.jwt=t=>n.check(UI(y5,t)),n.emoji=t=>n.check(TI(i5,t)),n.guid=t=>n.check(Ay($y,t)),n.uuid=t=>n.check(_I(ph,t)),n.uuidv4=t=>n.check(AI(ph,t)),n.uuidv6=t=>n.check(EI(ph,t)),n.uuidv7=t=>n.check(kI(ph,t)),n.nanoid=t=>n.check($I(s5,t)),n.guid=t=>n.check(Ay($y,t)),n.cuid=t=>n.check(RI(o5,t)),n.cuid2=t=>n.check(II(a5,t)),n.ulid=t=>n.check(xI(l5,t)),n.base64=t=>n.check(zI(m5,t)),n.base64url=t=>n.check(ZI(g5,t)),n.xid=t=>n.check(PI(c5,t)),n.ksuid=t=>n.check(LI(u5,t)),n.ipv4=t=>n.check(DI(h5,t)),n.ipv6=t=>n.check(MI(d5,t)),n.cidrv4=t=>n.check(OI(p5,t)),n.cidrv6=t=>n.check(NI(f5,t)),n.e164=t=>n.check(HI(v5,t)),n.datetime=t=>n.check(Ox(t)),n.date=t=>n.check(zx(t)),n.time=t=>n.check(Hx(t)),n.duration=t=>n.check(Vx(t))});function m(n){return bI(t5,n)}const Ce=k("ZodStringFormat",(n,e)=>{_e.init(n,e),D8.init(n,e)}),n5=k("ZodEmail",(n,e)=>{TR.init(n,e),Ce.init(n,e)}),$y=k("ZodGUID",(n,e)=>{kR.init(n,e),Ce.init(n,e)}),ph=k("ZodUUID",(n,e)=>{CR.init(n,e),Ce.init(n,e)}),r5=k("ZodURL",(n,e)=>{$R.init(n,e),Ce.init(n,e)}),i5=k("ZodEmoji",(n,e)=>{RR.init(n,e),Ce.init(n,e)}),s5=k("ZodNanoID",(n,e)=>{IR.init(n,e),Ce.init(n,e)}),o5=k("ZodCUID",(n,e)=>{xR.init(n,e),Ce.init(n,e)}),a5=k("ZodCUID2",(n,e)=>{PR.init(n,e),Ce.init(n,e)}),l5=k("ZodULID",(n,e)=>{LR.init(n,e),Ce.init(n,e)}),c5=k("ZodXID",(n,e)=>{DR.init(n,e),Ce.init(n,e)}),u5=k("ZodKSUID",(n,e)=>{MR.init(n,e),Ce.init(n,e)}),h5=k("ZodIPv4",(n,e)=>{HR.init(n,e),Ce.init(n,e)}),d5=k("ZodIPv6",(n,e)=>{UR.init(n,e),Ce.init(n,e)}),p5=k("ZodCIDRv4",(n,e)=>{VR.init(n,e),Ce.init(n,e)}),f5=k("ZodCIDRv6",(n,e)=>{FR.init(n,e),Ce.init(n,e)}),m5=k("ZodBase64",(n,e)=>{BR.init(n,e),Ce.init(n,e)}),g5=k("ZodBase64URL",(n,e)=>{WR.init(n,e),Ce.init(n,e)}),v5=k("ZodE164",(n,e)=>{jR.init(n,e),Ce.init(n,e)}),y5=k("ZodJWT",(n,e)=>{YR.init(n,e),Ce.init(n,e)}),M8=k("ZodNumber",(n,e)=>{_8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>mx(n,r,i),n.gt=(r,i)=>n.check(ky(r,i)),n.gte=(r,i)=>n.check(qf(r,i)),n.min=(r,i)=>n.check(qf(r,i)),n.lt=(r,i)=>n.check(Ey(r,i)),n.lte=(r,i)=>n.check(Bf(r,i)),n.max=(r,i)=>n.check(Bf(r,i)),n.int=r=>n.check(Ry(r)),n.safe=r=>n.check(Ry(r)),n.positive=r=>n.check(ky(0,r)),n.nonnegative=r=>n.check(qf(0,r)),n.negative=r=>n.check(Ey(0,r)),n.nonpositive=r=>n.check(Bf(0,r)),n.multipleOf=(r,i)=>n.check(Cy(r,i)),n.step=(r,i)=>n.check(Cy(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 WI(M8,n)}const w5=k("ZodNumberFormat",(n,e)=>{JR.init(n,e),M8.init(n,e)});function Ry(n){return jI(w5,n)}const b5=k("ZodBoolean",(n,e)=>{KR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>gx(n,t,r)});function Ve(n){return GI(b5,n)}const S5=k("ZodUnknown",(n,e)=>{XR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>yx()});function S(){return YI(S5)}const _5=k("ZodNever",(n,e)=>{QR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>vx(n,t,r)});function A5(n){return JI(_5,n)}const E5=k("ZodArray",(n,e)=>{eI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ax(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(T8(t,r)),n.length=(t,r)=>n.check($8(t,r)),n.unwrap=()=>n.element});function z(n,e){return lx(E5,n,e)}const O8=k("ZodObject",(n,e)=>{nI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ex(n,t,r,i),ue(n,"shape",()=>e.shape),n.keyof=()=>Z8(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:A5()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>A$(n,t),n.safeExtend=t=>E$(n,t),n.merge=t=>k$(n,t),n.pick=t=>S$(n,t),n.omit=t=>_$(n,t),n.partial=(...t)=>C$(H8,n,t[0]),n.required=(...t)=>T$(U8,n,t[0])});function N8(n,e){const t={type:"object",shape:n??{},...H(e)};return new O8(t)}function w(n,e){return new O8({type:"object",shape:n,catchall:S(),...H(e)})}const z8=k("ZodUnion",(n,e)=>{k8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>kx(n,t,r,i),n.options=e.options});function X(n,e){return new z8({type:"union",options:n,...H(e)})}const k5=k("ZodDiscriminatedUnion",(n,e)=>{z8.init(n,e),rI.init(n,e)});function C5(n,e,t){return new k5({type:"union",options:e,discriminator:n,...H(t)})}const T5=k("ZodIntersection",(n,e)=>{iI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Cx(n,t,r,i)});function Up(n,e){return new T5({type:"intersection",left:n,right:e})}const $5=k("ZodRecord",(n,e)=>{sI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Tx(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function A(n,e,t){return new $5({type:"record",keyType:n,valueType:e,...H(t)})}const C0=k("ZodEnum",(n,e)=>{oI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>wx(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 C0({...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 C0({...e,checks:[],...H(i),entries:o})}});function Z8(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new C0({type:"enum",entries:t,...H(e)})}const R5=k("ZodLiteral",(n,e)=>{aI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>bx(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 R5({type:"literal",values:Array.isArray(n)?n:[n],...H(e)})}const I5=k("ZodTransform",(n,e)=>{lI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>_x(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new o8(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 x5(n){return new I5({type:"transform",transform:n})}const H8=k("ZodOptional",(n,e)=>{C8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>P8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Iy(n){return new H8({type:"optional",innerType:n})}const P5=k("ZodExactOptional",(n,e)=>{cI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>P8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function L5(n){return new P5({type:"optional",innerType:n})}const D5=k("ZodNullable",(n,e)=>{uI.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 xy(n){return new D5({type:"nullable",innerType:n})}const M5=k("ZodDefault",(n,e)=>{hI.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.removeDefault=n.unwrap});function O5(n,e){return new M5({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():u8(e)}})}const N5=k("ZodPrefault",(n,e)=>{dI.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 z5(n,e){return new N5({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():u8(e)}})}const U8=k("ZodNonOptional",(n,e)=>{pI.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 Z5(n,e){return new U8({type:"nonoptional",innerType:n,...H(e)})}const H5=k("ZodCatch",(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,n.removeCatch=n.unwrap});function U5(n,e){return new H5({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const V5=k("ZodPipe",(n,e)=>{mI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Lx(n,t,r,i),n.in=e.in,n.out=e.out});function Py(n,e){return new V5({type:"pipe",in:n,out:e})}const F5=k("ZodReadonly",(n,e)=>{gI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Dx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function B5(n){return new F5({type:"readonly",innerType:n})}const q5=k("ZodCustom",(n,e)=>{vI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Sx(n,t)});function W5(n,e={}){return cx(q5,n,e)}function j5(n){return ux(n)}const G5=[".md",".markdown"];function V8(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function F8(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function Y5(n){return F8(n).toLowerCase()}function J5(n,e){const t=Y5(n);return e.some(r=>t.endsWith(r))}function T0(n){return!V8(n)&&J5(n,G5)}function K5(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 X5=N8({id:m().min(1),kind:$("path"),title:m(),path:m()}).strict(),Q5=N8({id:m().min(1),kind:$("url"),title:m(),url:m().refine(K5,{message:"url must be an http(s) URL"})}).strict();C5("kind",[X5,Q5]);const eP=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function tP(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}:eP.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Ly(n,e){return tP(n,e).kind==="web"}const nP="/views/markdown/",rP="/views/url-unsupported/";function iP(n){try{const{protocol:e}=new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function B8(n){return`/artifact/${encodeURIComponent(n)}`}function sP(n,e){return`${B8(n)}/${encodeURIComponent(e)}`}function oP(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&&iP(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:rP,contentURL:null};if(T0(n.path)){const r={viewURL:nP,contentURL:oP(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=V8(n.path)?`${B8(n.id)}/`:sP(n.id,F8(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const aP="serverURL",lP="token",cP="mode",uP="desktopAppVersion",hP="electron";function dP(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(aP);return r?new URL(r).origin:new URL(e).origin}function pP(n=window.location.search){return new URLSearchParams(n).get(lP)}function Br(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(cP)===hP}function q8(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(uP)}const Dy="tv.telemetry.clientId",fP=5,mP=60,gP=1e3,vP=fP*mP*gP,My=["pointerdown","scroll","keydown"],Oy=["focus"],Ny=["visibilitychange"],yP="hidden";function wP(n,e=EP){const t=n.getItem(Dy);if(t)return t;const r=e();return n.setItem(Dy,r),r}function bP(n){return{clientId:wP(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function SP(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 _P(n){return new AP(n)}var Ac,wr,ai,Ec,kc,Ut,Ss,Cc,Od,W8;class AP{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,W8).call(this))}start(){if(!s(this,Ss)){h(this,Ss,!0);for(const e of My)s(this,ai).addEventListener(e,s(this,Ut)),s(this,wr).addEventListener(e,s(this,Ut));for(const e of Oy)s(this,ai).addEventListener(e,s(this,Ut));for(const e of Ny)s(this,wr).addEventListener(e,s(this,Ut))}}stop(){if(s(this,Ss)){h(this,Ss,!1);for(const e of My)s(this,ai).removeEventListener(e,s(this,Ut)),s(this,wr).removeEventListener(e,s(this,Ut));for(const e of Oy)s(this,ai).removeEventListener(e,s(this,Ut));for(const e of Ny)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,W8=function(){if(s(this,wr).visibilityState===yP)return;const e=s(this,kc).call(this);e-s(this,Cc)<vP||(h(this,Cc,e),s(this,Ec).call(this,{type:gT,clientId:s(this,Ac).clientId}))};function EP(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Rg().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"},kP=1,CP=w({_meta:A(m(),S()).nullish(),terminal:Ve().optional().default(!1)}),TP=w({_meta:A(m(),S()).nullish(),label:m().nullish(),name:m(),optional:Ve().optional().default(!1),secret:Ve().optional().default(!0)}),$P=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),name:m()}),RP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),link:m().nullish(),name:m(),vars:z(TP)}),IP=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),description:m().nullish(),env:A(m(),m()).optional(),id:m(),name:m()}),xP=X([RP.and(w({type:$("env_var")})),IP.and(w({type:$("terminal")})),$P]),PP=w({_meta:A(m(),S()).nullish(),methodId:m()}),LP=w({_meta:A(m(),S()).nullish()}),DP=w({_meta:A(m(),S()).nullish(),blob:m(),mimeType:m().nullish(),uri:m()}),MP=w({default:Ve().nullish(),description:m().nullish(),title:m().nullish()}),OP=w({_meta:A(m(),S()).nullish()}),NP=w({_meta:A(m(),S()).nullish()}),zP=w({amount:G(),currency:m()}),ZP=w({_meta:A(m(),S()).nullish(),terminalId:m()}),HP=w({_meta:A(m(),S()).nullish(),newText:m(),oldText:m().nullish(),path:m()}),UP=X([m(),G(),G(),Ve(),z(m())]),VP=w({content:A(m(),UP).nullish()}),FP=X([VP.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),BP=w({_meta:A(m(),S()).nullish()}),j8=m(),qP=w({_meta:A(m(),S()).nullish(),elicitationId:j8}),WP=w({_meta:A(m(),S()).nullish(),action:FP}),jP=$("object"),GP=$("string"),YP=w({_meta:A(m(),S()).nullish()}),JP=w({_meta:A(m(),S()).nullish(),form:BP.nullish(),url:YP.nullish()}),KP=w({elicitationId:j8,url:m().url()}),G8=w({const:m(),title:m()}),Y8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),XP=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"})]),J8=w({code:XP,data:S().optional(),message:m()}),K8=S(),X8=S(),Q8=S(),QP=w({_meta:A(m(),S()).nullish(),readTextFile:Ve().optional().default(!1),writeTextFile:Ve().optional().default(!1)}),eb=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),tb=w({_meta:A(m(),S()).nullish(),name:m(),title:m().nullish(),version:m()}),eL=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),tL=w({_meta:A(m(),S()).nullish()}),nL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cursor:m().nullish(),cwd:m().nullish()}),rL=w({_meta:A(m(),S()).nullish()}),iL=w({_meta:A(m(),S()).nullish(),logout:rL.nullish()}),sL=w({_meta:A(m(),S()).nullish()}),oL=w({_meta:A(m(),S()).nullish()}),aL=w({_meta:A(m(),S()).nullish(),http:Ve().optional().default(!1),sse:Ve().optional().default(!1)}),lL=w({_meta:A(m(),S()).nullish(),headers:z(eb),name:m(),url:m()}),cL=w({_meta:A(m(),S()).nullish(),headers:z(eb),name:m(),url:m()}),uL=w({_meta:A(m(),S()).nullish(),args:z(m()),command:m(),env:z(Y8),name:m()}),Vp=X([lL.and(w({type:$("http")})),cL.and(w({type:$("sse")})),uL]),Og=m(),hL=w({_meta:A(m(),S()).nullish(),description:m().nullish(),modelId:Og,name:m()}),dL=X([$("error"),$("warning"),$("information"),$("hint")]),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()}),vL=w({_meta:A(m(),S()).nullish()}),yL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),wL=w({diff:m(),uri:m()}),bL=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()}),SL=w({_meta:A(m(),S()).nullish()}),_L=w({_meta:A(m(),S()).nullish()}),AL=w({languageId:m(),text:m(),uri:m()}),EL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),kL=X([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),CL=w({excerpts:z(bL),uri:m()}),TL=w({_meta:A(m(),S()).nullish()}),$L=w({_meta:A(m(),S()).nullish()}),RL=w({name:m(),owner:m(),remoteUrl:m()}),IL=w({_meta:A(m(),S()).nullish()}),xL=w({_meta:A(m(),S()).nullish(),jump:SL.nullish(),rename:$L.nullish(),searchAndReplace:IL.nullish()}),PL=w({id:m(),isRegex:Ve().nullish(),replace:m(),search:m(),uri:m()}),LL=X([$("automatic"),$("diagnostic"),$("manual")]),DL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),ML=w({_meta:A(m(),S()).nullish(),diagnostics:pL.nullish(),editHistory:yL.nullish(),openFiles:_L.nullish(),recentFiles:EL.nullish(),relatedSnippets:TL.nullish(),userActions:DL.nullish()}),OL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp)}),NL=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),nb=m(),zL=X([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),ZL=w({_meta:A(m(),S()).nullish(),kind:zL,name:m(),optionId:nb}),HL=X([$("high"),$("medium"),$("low")]),UL=X([$("pending"),$("in_progress"),$("completed")]),VL=w({_meta:A(m(),S()).nullish(),content:m(),priority:HL,status:UL}),FL=w({_meta:A(m(),S()).nullish(),entries:z(VL)}),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"})}),BL=w({id:m(),position:Wi,uri:m()}),qL=w({id:m(),newName:m(),position:Wi,uri:m()}),WL=w({action:m(),position:Wi,timestampMs:G(),uri:m()}),rb=X([$("utf-16"),$("utf-32"),$("utf-8")]),jL=w({_meta:A(m(),S()).nullish(),auth:CP.optional().default({terminal:!1}),elicitation:JP.nullish(),fs:QP.optional().default({readTextFile:!1,writeTextFile:!1}),nes:xL.nullish(),positionEncodings:z(rb).optional(),terminal:Ve().optional().default(!1)}),GL=w({_meta:A(m(),S()).nullish(),audio:Ve().optional().default(!1),embeddedContext:Ve().optional().default(!1),image:Ve().optional().default(!1)}),ib=G().int().gte(0).lte(65535),YL=w({_meta:A(m(),S()).nullish(),clientCapabilities:jL.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:tb.nullish(),protocolVersion:ib}),ml=w({end:Wi,start:Wi}),JL=w({message:m(),range:ml,severity:dL,uri:m()}),KL=w({languageId:m(),lastFocusedMs:G().nullish(),uri:m(),visibleRange:ml.nullish()}),XL=w({_meta:A(m(),S()).nullish(),diagnostics:z(JL).nullish(),editHistory:z(wL).nullish(),openFiles:z(KL).nullish(),recentFiles:z(AL).nullish(),relatedSnippets:z(CL).nullish(),userActions:z(WL).nullish()}),QL=w({newText:m(),range:ml}),eD=w({cursorPosition:Wi.nullish(),edits:z(QL),id:m(),uri:m()}),tD=X([eD.and(w({kind:$("edit")})),BL.and(w({kind:$("jump")})),qL.and(w({kind:$("rename")})),PL.and(w({kind:$("searchAndReplace")}))]),nD=w({_meta:A(m(),S()).nullish(),content:m()}),rD=w({_meta:A(m(),S()).nullish()}),ho=X([G(),m()]).nullable();w({_meta:A(m(),S()).nullish(),requestId:ho});const iD=Z8(["assistant","user"]),Fu=w({_meta:A(m(),S()).nullish(),audience:z(iD).nullish(),lastModified:m().nullish(),priority:G().nullish()}),sD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m()}),oD=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),data:m(),mimeType:m(),uri:m().nullish()}),aD=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()}),lD=w({_meta:A(m(),S()).nullish(),optionId:nb}),cD=X([w({outcome:$("cancelled")}),lD.and(w({outcome:$("selected")}))]),uD=w({_meta:A(m(),S()).nullish(),outcome:cD}),hD=w({_meta:A(m(),S()).nullish()}),dD=w({_meta:A(m(),S()).nullish()}),pD=w({currentValue:Ve()}),fD=m(),sb=m(),mD=X([$("mode"),$("model"),$("thought_level"),m()]),Ng=m(),ob=w({_meta:A(m(),S()).nullish(),description:m().nullish(),name:m(),value:Ng}),gD=w({_meta:A(m(),S()).nullish(),group:fD,name:m(),options:z(ob)}),vD=X([z(ob),z(gD)]),yD=w({currentValue:Ng,options:vD}),gl=Up(X([yD.and(w({type:$("select")})),pD.and(w({type:$("boolean")}))]),w({_meta:A(m(),S()).nullish(),category:mD.nullish(),description:m().nullish(),id:sb,name:m()})),wD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),bD=w({_meta:A(m(),S()).nullish()}),ae=m(),SD=w({_meta:A(m(),S()).nullish(),id:m(),sessionId:ae}),_D=w({_meta:A(m(),S()).nullish(),sessionId:ae}),AD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),ED=w({_meta:A(m(),S()).nullish(),sessionId:ae}),ab=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),command:m(),cwd:m().nullish(),env:z(Y8).optional(),outputByteLimit:G().nullish(),sessionId:ae}),kD=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),CD=w({_meta:A(m(),S()).nullish(),position:Wi,sessionId:ae,uri:m(),version:G(),visibleRange:ml}),TD=w({_meta:A(m(),S()).nullish(),languageId:m(),sessionId:ae,text:m(),uri:m(),version:G()}),$D=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),RD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp).optional(),sessionId:ae}),lb=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),sessionId:ae}),cb=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}),xD=w({_meta:A(m(),S()).nullish(),id:m(),reason:kL.nullish(),sessionId:ae}),ub=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),PD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Vp).optional(),sessionId:ae}),LD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),sessionId:ae,title:m().nullish(),updatedAt:m().nullish()}),DD=w({_meta:A(m(),S()).nullish(),nextCursor:m().nullish(),sessions:z(LD)}),MD=w({_meta:A(m(),S()).nullish(),title:m().nullish(),updatedAt:m().nullish()}),OD=w({_meta:A(m(),S()).nullish()}),Fp=m(),ND=w({_meta:A(m(),S()).nullish(),currentModeId:Fp}),zD=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:Fp,name:m()}),Bp=w({_meta:A(m(),S()).nullish(),availableModes:z(zD),currentModeId:Fp}),qp=w({_meta:A(m(),S()).nullish(),availableModels:z(hL),currentModelId:Og}),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(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),VD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),FD=w({_meta:A(m(),S()).nullish()}),BD=w({_meta:A(m(),S()).nullish(),additionalDirectories:hD.nullish(),close:dD.nullish(),fork:bD.nullish(),list:OD.nullish(),resume:FD.nullish()}),qD=Up(X([w({type:$("boolean"),value:Ve()}),w({value:Ng})]),w({_meta:A(m(),S()).nullish(),configId:sb,sessionId:ae})),WD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),jD=w({_meta:A(m(),S()).nullish(),modeId:Fp,sessionId:ae}),GD=w({_meta:A(m(),S()).nullish()}),YD=w({_meta:A(m(),S()).nullish(),modelId:Og,sessionId:ae}),JD=w({_meta:A(m(),S()).nullish()}),KD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),XD=X([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),QD=X([$("email"),$("uri"),$("date"),$("date-time")]),eM=w({default:m().nullish(),description:m().nullish(),enum:z(m()).nullish(),format:QD.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(G8).nullish(),pattern:m().nullish(),title:m().nullish()}),tM=w({_meta:A(m(),S()).nullish(),context:XL.nullish(),position:Wi,selection:ml.nullish(),sessionId:ae,triggerKind:LL,uri:m(),version:G()}),nM=w({_meta:A(m(),S()).nullish(),suggestions:z(tD)}),rM=w({_meta:A(m(),S()).nullish(),terminalId:m()}),iM=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()}),hb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),sM=w({_meta:A(m(),S()).nullish(),exitStatus:iM.nullish(),output:m(),truncated:Ve()}),oM=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),text:m()}),aM=w({range:ml.nullish(),text:m()}),lM=w({_meta:A(m(),S()).nullish(),contentChanges:z(aM),sessionId:ae,uri:m(),version:G()});w({method:m(),params:X([_D,TD,lM,kD,$D,CD,SD,xD,K8]).nullish()});const cM=X([$("full"),$("incremental")]),uM=w({_meta:A(m(),S()).nullish(),syncKind:cM}),hM=w({_meta:A(m(),S()).nullish(),didChange:uM.nullish(),didClose:fL.nullish(),didFocus:mL.nullish(),didOpen:gL.nullish(),didSave:vL.nullish()}),dM=w({_meta:A(m(),S()).nullish(),document:hM.nullish()}),pM=w({_meta:A(m(),S()).nullish(),context:ML.nullish(),events:dM.nullish()}),fM=w({_meta:A(m(),S()).nullish(),auth:iL.optional().default({}),loadSession:Ve().optional().default(!1),mcpCapabilities:aL.optional().default({http:!1,sse:!1}),nes:pM.nullish(),positionEncoding:rb.nullish(),promptCapabilities:GL.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:BD.optional().default({})}),mM=w({_meta:A(m(),S()).nullish(),agentCapabilities:fM.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:tb.nullish(),authMethods:z(xP).optional().default([]),protocolVersion:ib}),gM=w({_meta:A(m(),S()).nullish(),mimeType:m().nullish(),text:m(),uri:m()}),vM=X([gM,DP]),yM=w({_meta:A(m(),S()).nullish(),annotations:Fu.nullish(),resource:vM}),zg=X([oM.and(w({type:$("text")})),oD.and(w({type:$("image")})),sD.and(w({type:$("audio")})),aD.and(w({type:$("resource_link")})),yM.and(w({type:$("resource")}))]),wM=w({_meta:A(m(),S()).nullish(),content:zg}),Wf=w({_meta:A(m(),S()).nullish(),content:zg,messageId:m().nullish()}),bM=w({_meta:A(m(),S()).nullish(),messageId:m().nullish(),prompt:z(zg),sessionId:ae}),SM=w({anyOf:z(G8)}),db=X([wM.and(w({type:$("content")})),HP.and(w({type:$("diff")})),rM.and(w({type:$("terminal")}))]),pb=m(),fb=w({_meta:A(m(),S()).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m()}),mb=X([$("pending"),$("in_progress"),$("completed"),$("failed")]),gb=X([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),_M=w({_meta:A(m(),S()).nullish(),content:z(db).optional(),kind:gb.optional(),locations:z(fb).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:mb.optional(),title:m(),toolCallId:pb}),vb=w({_meta:A(m(),S()).nullish(),content:z(db).nullish(),kind:gb.nullish(),locations:z(fb).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:mb.nullish(),title:m().nullish(),toolCallId:pb}),yb=w({_meta:A(m(),S()).nullish(),options:z(ZL),sessionId:ae,toolCall:vb}),AM=w({_meta:A(m(),S()).nullish(),hint:m()}),EM=AM,kM=w({_meta:A(m(),S()).nullish(),description:m(),input:EM.nullish(),name:m()}),CM=w({_meta:A(m(),S()).nullish(),availableCommands:z(kM)}),TM=w({enum:z(m()),type:GP}),$M=X([TM,SM]),RM=w({default:z(m()).nullish(),description:m().nullish(),items:$M,maxItems:G().nullish(),minItems:G().nullish(),title:m().nullish()}),IM=X([eM.and(w({type:$("string")})),NL.and(w({type:$("number")})),eL.and(w({type:$("integer")})),MP.and(w({type:$("boolean")})),RM.and(w({type:$("array")}))]),xM=w({description:m().nullish(),properties:A(m(),IM).optional().default({}),required:z(m()).nullish(),title:m().nullish(),type:jP.optional().default("object")}),PM=w({requestedSchema:xM}),LM=Up(X([PM.and(w({mode:$("form")})),KP.and(w({mode:$("url")}))]),w({_meta:A(m(),S()).nullish(),message:m(),sessionId:ae})),DM=w({cachedReadTokens:G().nullish(),cachedWriteTokens:G().nullish(),inputTokens:G(),outputTokens:G(),thoughtTokens:G().nullish(),totalTokens:G()}),MM=w({_meta:A(m(),S()).nullish(),stopReason:XD,usage:DM.nullish(),userMessageId:m().nullish()});X([w({id:ho,result:X([mM,LP,oL,UD,HD,DD,ZD,VD,NP,GD,WD,MM,JD,KD,nM,OP,Q8])}),w({error:J8,id:ho})]);const OM=w({_meta:A(m(),S()).nullish(),cost:zP.nullish(),size:G(),used:G()}),NM=X([Wf.and(w({sessionUpdate:$("user_message_chunk")})),Wf.and(w({sessionUpdate:$("agent_message_chunk")})),Wf.and(w({sessionUpdate:$("agent_thought_chunk")})),_M.and(w({sessionUpdate:$("tool_call")})),vb.and(w({sessionUpdate:$("tool_call_update")})),FL.and(w({sessionUpdate:$("plan")})),CM.and(w({sessionUpdate:$("available_commands_update")})),ND.and(w({sessionUpdate:$("current_mode_update")})),wD.and(w({sessionUpdate:$("config_option_update")})),MD.and(w({sessionUpdate:$("session_info_update")})),OM.and(w({sessionUpdate:$("usage_update")}))]),wb=w({_meta:A(m(),S()).nullish(),sessionId:ae,update:NM});w({method:m(),params:X([wb,qP,K8]).nullish()});const bb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),zM=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()}),ZM=w({name:m(),uri:m()}),HM=w({_meta:A(m(),S()).nullish(),repository:RL.nullish(),workspaceFolders:z(ZM).nullish(),workspaceUri:m().nullish()});w({id:ho,method:m(),params:X([YL,PP,sL,OL,ID,nL,RD,PD,ED,jD,qD,bM,YD,HM,tM,AD,X8]).nullish()});const Sb=w({_meta:A(m(),S()).nullish(),content:m(),path:m(),sessionId:ae});w({id:ho,method:m(),params:X([Sb,cb,yb,ab,hb,ub,bb,lb,LM,X8]).nullish()});const UM=w({_meta:A(m(),S()).nullish()});X([w({id:ho,result:X([UM,nD,uD,ZP,sM,rD,zM,tL,WP,Q8])}),w({error:J8,id:ho})]);var oe;class VM{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=Sb.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,E)}case ur.fs_read_text_file:{const E=cb.parse(l);return(d=r.readTextFile)==null?void 0:d.call(r,E)}case ur.session_request_permission:{const E=yb.parse(l);return r.requestPermission(E)}case ur.terminal_create:{const E=ab.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,E)}case ur.terminal_output:{const E=hb.parse(l);return(g=r.terminalOutput)==null?void 0:g.call(r,E)}case ur.terminal_release:{const E=ub.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,E))??{}}case ur.terminal_wait_for_exit:{const E=bb.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,E)}case ur.terminal_kill:{const E=lb.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=wb.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Oe.methodNotFound(a)}};h(this,oe,new FM(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,Pn,Rc,Ae,_b,$0,Ab,Eb,kb,Cb,R0,Fl;class FM{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,Pn,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,Pn).signal.addEventListener("abort",()=>i())})),u(this,Ae,_b).call(this)}get signal(){return s(this,Pn).signal}get closed(){return s(this,Rc)}async sendRequest(e,t){u(this,Ae,R0).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,R0).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,Pn=new WeakMap,Rc=new WeakMap,Ae=new WeakSet,_b=async function(){let e;try{const t=s(this,ta).readable.getReader();try{for(;!s(this,Pn).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{u(this,Ae,Ab).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,$0).call(this,e)}},$0=function(e){if(s(this,Pn).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,Pn).abort(t)},Ab=async function(e){if("method"in e&&"id"in e){const t=await u(this,Ae,Eb).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,kb).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?u(this,Ae,Cb).call(this,e):console.error("Invalid message",{message:e})},Eb=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 Ty)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()}}},kb=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 Ty)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()}}},Cb=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)},R0=function(){if(s(this,Pn).signal.aborted)throw s(this,Pn).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,$0).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 BM(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function Tb(n){var t;class e extends n{constructor(...o){super(...o);p(this,t,!1);BM(this,()=>s(this,t),()=>{h(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,t)}}return t=new WeakMap,e}const qM=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,WM=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,jM=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,GM=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,YM=/^[A-Za-z0-9_@%+=:,./-]+$/,JM=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,KM="single_session",XM={name:"television-acp-client",version:"0.0.0"},$b="agent:main:television",QM=Tb(Kr);var ra,Ln,Rt,Dn,ci,ln,br,Mn,cn,ui,un,ia,sa,On,tt,Sr,oa,_s,_r,hi,Ic,hn,Nn,zd,zn,R,I0,Rb,Ib,xb,Dh,Pb,Lb,Db,Mb,Ob,Nb,zb,rs,Lo,Do,dr,Zb,Mo,x0,P0,Mh,Hb,Oh,L0,D0,xc,Pc,Nh,Oo,M0,Ub;class eO extends QM{constructor(t){super();p(this,R);p(this,ra,"disconnected");p(this,Ln,null);p(this,Rt,new Map);p(this,Dn,null);p(this,ci,null);p(this,ln,null);p(this,br,null);p(this,Mn,null);p(this,cn,null);p(this,ui);p(this,un,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,hn);p(this,Nn);p(this,zd,t=>{u(this,R,Ib).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,hn,t),h(this,Nn,t.sessionMode??KM),h(this,ui,t.mappedSessionStore??tO()),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,hn).enabled??!1}setToken(t){s(this,hn).token=t??""}setEnabled(t){s(this,hn).enabled=t,t||(u(this,R,Nh).call(this),h(this,Ln,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,Ln,null),h(this,ci,u(this,R,Rb).call(this)));try{await s(this,ci),await u(this,R,Dh).call(this)}catch(t){throw u(this,R,Oo).call(this,jf(t)),t}}}dispose(){u(this,R,Nh).call(this),h(this,Ln,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,I0).call(this,"ready")),(s(this,Mn)===null||s(this,un)!==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,P0).call(this),prompt:[{type:"text",text:u(this,R,Zb).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,Ub).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,I0).call(this,"ready"));const t=u(this,R,Oh).call(this);((r=s(this,cn))==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,Mn,null),h(this,un,null),u(this,R,M0).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,P0).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,un)||i!==r.channelID)&&h(this,Sr,!0);return}s(this,un)!==u(this,R,L0).call(this,r.channelID)&&(h(this,ln,null),h(this,br,null),s(this,Dn)&&this.status==="ready"&&u(this,R,Dh).call(this).catch(c=>{u(this,R,Oo).call(this,jf(c))}))}}ra=new WeakMap,Ln=new WeakMap,Rt=new WeakMap,Dn=new WeakMap,ci=new WeakMap,ln=new WeakMap,br=new WeakMap,Mn=new WeakMap,cn=new WeakMap,ui=new WeakMap,un=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,hn=new WeakMap,Nn=new WeakMap,zd=new WeakMap,zn=new WeakMap,R=new WeakSet,I0=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,Ln)??"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,Ln)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},Rb=async function(){try{const{stream:t,socket:r,metadata:i}=await sO({serverURL:s(this,hn).serverURL,token:s(this,hn).token,createSocket:s(this,Ic),onDisconnect:s(this,zd)});h(this,cn,i),h(this,zn,r),r.addEventListener("close",s(this,xc)),r.addEventListener("error",s(this,Pc)),h(this,Dn,new VM(o=>({connection:o,sessionUpdate:async a=>{await u(this,R,Lb).call(this,a)},requestPermission:async a=>u(this,R,Db).call(this,a)}),t)),await s(this,Dn).initialize({protocolVersion:kP,clientCapabilities:{},clientInfo:XM})}catch(t){throw t}},Ib=function(t){u(this,R,Oo).call(this,jf(t))},xb=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,Pb).call(this,t)),await s(this,ln)},Pb=async function(t){var c;const r=u(this,R,Mh).call(this);u(this,R,M0).call(this);let i,o=!1,a=null;const l={cwd:u(this,R,Hb).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(h(this,_s,!0),h(this,_r,null),((c=s(this,cn))==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(nO(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,xb).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),h(this,Mn,i),h(this,un,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,Ln,null),u(this,R,dr).call(this,"ready")},Lb=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&u(this,R,zb).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&u(this,R,Mb).call(this,r.content.text);return;case"tool_call":u(this,R,Ob).call(this,r);return;case"tool_call_update":u(this,R,Nb).call(this,r);return;case"agent_thought_chunk":return;default:return}},Db=async function(t){return{outcome:{outcome:"cancelled"}}},Mb=function(t){h(this,_r,null);const r=iO(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"})},Ob=function(t){u(this,R,rs).call(this,"final");const r=u(this,R,x0).call(this,t.toolCallId),i=Zy("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)},Nb=function(t){const r=u(this,R,x0).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",o=Zy(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)},zb=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=zy(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:zy(`${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 Ff("messages-changed"))},Do=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 l$("status-changed")))},Zb=function(t){var d;const r=s(this,un);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||GM.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>`."],c=((d=s(this,cn))==null?void 0:d.tvArgs)??[];return c.length>0&&l.push(`To reach this Television server, add these arguments to each tv command that contacts it: ${c.map(lO).join(" ")}`),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},x0=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},P0=function(){if(!s(this,Mn))throw new Error("ACP session is not ready");return s(this,Mn)},Mh=function(){if(!s(this,Dn))throw new Error("ACP connection is not ready");return s(this,Dn)},Hb=function(){var r;const t=(r=s(this,cn))==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,D0).call(this,`${$b}-${(s(this,hn).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,L0).call(this,t)},L0=function(t){return u(this,R,D0).call(this,rO(s(this,Nn),t,s(this,hn).clientGUID??"default-client"))},D0=function(t){var r;return((r=s(this,cn))==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,Mn,null),h(this,un,null),h(this,cn,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,Mn)!==null||s(this,un)!==null||s(this,cn)!==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,Ln,t??null),u(this,R,dr).call(this,"disconnected"))},M0=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"))},Ub=function(){return this.status==="disconnected"};function tO(){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 nO(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function rO(n,e,t){return n==="single_session"?`${$b}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function Vb(n){return n.replace(/^(?:\s*\n)+/,"")}function zy(n){let e=n;return e=e.replace(qM,""),e=e.replace(WM,""),e=e.replace(jM,""),e=Vb(e),e}function iO(n){let e=n;return e=e.replace(JM,""),e=Vb(e),e}function Zy(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function sO(n){const e=n.createSocket(uO(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=cO(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=oO(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 oO(n){const{agent:e,sessionIdStrategy:t,sessionCwd:r,tvArgs:i}=n;if((e==="openclaw"||e==="hermes")&&(t==="deterministic"||t==="mapped")&&typeof r=="string"&&r.length>0&&aO(i))return{agent:e,sessionIdStrategy:t,sessionCwd:r,tvArgs:i};throw new Error("ACP bridge ready status missing bootstrap metadata")}function aO(n){return Array.isArray(n)&&n.every(e=>typeof e=="string")}function lO(n){return YM.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`}function cO(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 uO(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 jf(n){return n instanceof Error?n.message:String(n)}const Hy="television.acpClientGUID",Uy="television.acpMappedSessions",Vy=1;var aa;class hO{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,O0;class dO{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,O0).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,O0).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(Uy);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!==Vy?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},O0=function(e){const t={version:Vy,entries:e};s(this,la).setItem(Uy,JSON.stringify(t))};function Fb(){return typeof window>"u"?null:window.localStorage}function pO(n){const e=n.getItem(Hy);if(e)return e;const t=Rg().toLowerCase();return n.setItem(Hy,t),t}const Fy=4401,fO=401,fh=1e3,mO=3e4;class Hh extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class gO 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 MT(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 dO(t.acpStorage,this.url):new hO);this.acpClient=new eO({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?_P({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&&!yT(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...W2},size:{...j2}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=v0(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 vO(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(yO(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 i8("server-reconnected",{serverURL:this.url}))}catch(y){if(EO(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=AO(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 s8("server-status",{serverURL:this.url,message:_})),E?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new At("change"));return}if(!_O(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=wO(g);if(!l){d(y===Fy?new Hh:new Error("Connection closed before initialization"));return}if(y===Fy){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,mO),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:vT,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 vO(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function yO(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 SP(t))r.searchParams.set(i,o);return r.hash="",r.toString()}function wO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const bO={"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},SO=new Set(Object.keys(bO));function _O(n){return SO.has(n)}function AO(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 EO(n){return n instanceof pl&&n.status===fO}const kO="Local";var Vt,dn,rr,N0,z0,Bb,Dc,Mc,Oc,Nc,zc;class CO 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,dn,!1);p(this,Dc,()=>{s(this,dn)||(u(this,rr,Bb).call(this),this.dispatchEvent(new At("change")))});p(this,Mc,t=>{s(this,dn)||this.dispatchEvent(new Ph("server-event",{serverURL:t.serverURL,event:t.event}))});p(this,Oc,()=>{s(this,dn)||this.dispatchEvent(new Ul("channels-changed"))});p(this,Nc,t=>{s(this,dn)||this.dispatchEvent(new i8("server-reconnected",{serverURL:t.serverURL}))});p(this,zc,t=>{s(this,dn)||this.dispatchEvent(new s8("server-status",{serverURL:t.serverURL,message:t.message}))});h(this,Vt,t.localStore),this.acpStorage=t.acpStorage===void 0?Fb():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?pO(this.acpStorage):Rg().toLowerCase());const r=Fi(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&s(this,Vt).set(uy(s(this,Vt).get(),r,t.launchToken));const i=t.launchToken??cy(s(this,Vt).get(),r),o=t.createSocket??(l=>new WebSocket(l)),a=t.createConnection??(l=>new gO(l));this.connection=a({url:r,name:t.connectionName??kO,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 cy(s(this,Vt).get(),this.connection.url)}async connect(){await u(this,rr,N0).call(this,this.connection.token)}async authenticate(t){s(this,Vt).set(uy(s(this,Vt).get(),this.connection.url,t)),await u(this,rr,N0).call(this,t)}dispose(){s(this,dn)||(h(this,dn,!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,dn=new WeakMap,rr=new WeakSet,N0=async function(t){if(!s(this,dn)){u(this,rr,z0).call(this,null);try{await this.connection.connect(t)}catch(r){u(this,rr,z0).call(this,r instanceof Hh?null:r instanceof Error?r.message:String(r))}}},z0=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new At("change")))},Bb=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=s(this,Vt).get(),r=d$(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 Z0="tv-nav:",nl="tv-reload",By=100,TO=1e3,$O=60,RO=60,IO=24,xO=30,PO=xO*IO*RO*$O*TO;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,qb,Qr,Wb,H0,U0;class LO 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,qb).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,H0).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,qb=function(){const t=localStorage.getItem(s(this,Pe,U0));if(t!==null)try{const r=JSON.parse(t);if(!jb(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,H0).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,Wb).call(this)))}catch(t){if(!OO(t))throw t}this.dispatchEvent(new At("change"))},Wb=function(){return{v:1,entries:s(this,ge).map(t=>({...t})),cursor:s(this,pe),lastWritten:s(this,As)}},H0=function(){if(s(this,ge).length<=By)return;const t=s(this,ge).length-By;h(this,ge,s(this,ge).slice(t)),h(this,pe,Math.max(-1,s(this,pe)-t))},U0=function(){return DO(s(this,Zc))};function DO(n){return`${Z0}${n}`}function MO(n){const e=Date.now()-PO,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(Z0)))continue;const o=i.slice(Z0.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{t.push(i);continue}if(!jb(l)){t.push(i);continue}!n.has(o)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function OO(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function jb(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 Gf="tv-channel-sidebar-collapsed";var Es;class NO{constructor(e){p(this,Es);h(this,Es,e)}read(){return s(this,Es).getItem(Gf)==="true"}setCollapsed(e){try{e?s(this,Es).setItem(Gf,"true"):s(this,Es).removeItem(Gf)}catch{}}}Es=new WeakMap;const Yf="tv-channel-sidebar-width",V0=160,F0=350,mh=260,zO=/^-?\d+$/;var ks;class ZO{constructor(e){p(this,ks);h(this,ks,e)}read(){const e=s(this,ks).getItem(Yf);if(e===null||!zO.test(e))return null;const t=BigInt(e);return t<BigInt(V0)?V0:t>BigInt(F0)?F0:Number(t)}commit(e){const t=Gb(Math.round(e));try{s(this,ks).setItem(Yf,String(t))}catch{}return t}clear(){try{s(this,ks).removeItem(Yf)}catch{}}}ks=new WeakMap;function Gb(n){return Math.min(Math.max(n,V0),F0)}const HO="1.4.10";function Zg(n=HO){return n!==void 0&&n.length>0?n:"0.0.0"}function Hg(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const B0="tv-reload-attempted";function UO(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:zT(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 VO(n){const e=n.getItem(B0);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 FO(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??Hg(),i=n.bundleVersion??Zg();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=UO({bundleVersion:i,serverVersion:d.message.version,originMatch:d.serverURL===n.primaryServerURL,marker:VO(e)});switch(f.action){case"reload":e.setItem(B0,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(B0),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 BO(n){const e=Br(n.search),t=q8(n.search),r=t!==null&&Op(t)?t:null;return{electron:e,shellVersion:r}}function qO(n){return!n.electron||n.requiredDesktopVersion===null||!Op(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===vd?!1:$g(n.requiredDesktopVersion,n.shellVersion)}const WO=`# 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.`,BO=`# 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.`,jO=`# 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 qb(n,e=!1){return e?FO:n===null?BO:n.upgradeMarkdown}function qO(n){const e=VO(n);return{gated:e,instructionsMarkdown:e?qb(n.desktop):null,suppressUpdateToast:e}}function WO(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 qO({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 jO 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 GO=`### 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 Yb(n,e=!1){return e?WO:n===null?jO:n.upgradeMarkdown}function GO(n){const e=qO(n);return{gated:e,instructionsMarkdown:e?Yb(n.desktop):null,suppressUpdateToast:e}}function YO(n){const e=n.reload??(()=>location.reload()),t=n.navigationLatch??Hg();let r=null,i=!1;const o=new Set,a=f=>{var g;return GO({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 JO 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 KO=`### Desktop app update ready
48
48
 
49
- Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,YO="tv-desktop-self-update-dismissed";function JO(n){return GO.replace("{version}",n)}var Hc,ha,Uc,Cs,da;class KO 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 XO(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",Uy="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,F0,e6,t6,No,Uh,Vw;let QO=(Vw=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,F0).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,F0=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,F0).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")},Vw);var Rs,va,Is,xs,ya,ze,B0,n6,r6,zo,Vh;class e9 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,B0).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,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!==Uy)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,B0).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,Uy,t)},Vh=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.`,XO="tv-desktop-self-update-dismissed";function QO(n){return KO.replace("{version}",n)}var Hc,ha,Uc,Cs,da;class e9 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 t9(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 Jb(n){return typeof n=="object"&&n!==null}function Kb(n){return!Jb(n)||n.type!=="ready"?!1:!("id"in n)}function Xb(n){return!(!Jb(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const Qb=sn(),e6="No handler registered for update-content",t6="handleUpdateContent: handler already registered",qy="television-artifact-bridge";function n6(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const r6=Tb(Kr);var pa,fa,ma,Ts,$s,ga,Ne,q0,i6,s6,No,Uh,Ww;let n9=(Ww=class extends r6{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,i6).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,q0).call(this,t)}handleUpdateContent(t){if(u(this,Ne,Uh).call(this),s(this,Ts)!==null)throw new Error(t6);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,q0=function(t){const r={type:"content-updated",content:t};u(this,Ne,No).call(this,r)},i6=function(t){if(this.disposed||t.source!==s(this,pa).contentWindow)return;const r=t.data;if(Kb(r)){h(this,ga,!0),this.dispatchEvent(new Qb("ready")),s(this,$s)!==null&&u(this,Ne,q0).call(this,s(this,$s));return}if(Xb(r)){u(this,Ne,s6).call(this,r);return}},s6=async function(t){const r=s(this,Ts);if(r===null){u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:e6}});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:n6(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")},Ww);var Rs,va,Is,xs,ya,ze,W0,o6,a6,zo,Vh;class r9 extends r6{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,o6).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,W0).call(this,t)}handleUpdateContent(t){if(u(this,ze,Vh).call(this),s(this,Is)!==null)throw new Error(t6);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,W0=function(t){const r={type:"content-updated",content:t};u(this,ze,zo).call(this,r)},o6=function(t){var o;if(this.disposed)return;const r=t.detail??t;if(!r||r.channel!==qy)return;const i=(o=r.args)==null?void 0:o[0];if(Kb(i)){h(this,ya,!0),this.dispatchEvent(new Qb("ready")),s(this,xs)!==null&&u(this,ze,W0).call(this,s(this,xs));return}if(Xb(i)){u(this,ze,a6).call(this,i);return}},a6=async function(t){const r=s(this,Is);if(r===null){u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:e6}});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:n6(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,qy,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,Vy=n=>n,Ed=cc.trustedTypes,Fy=Ed?Ed.createPolicy("lit-html",{createHTML:n=>n}):void 0,i6="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,s6="?"+ii,t9=`<${s6}>`,po=document,gc=()=>po.createComment(""),vc=n=>n===null||typeof n!="object"&&typeof n!="function",Zg=Array.isArray,n9=n=>Zg(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,r9=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),M=r9(1),at=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),Gy=new WeakMap,ds=po.createTreeWalker(po,129);function a6(n,e){if(!Zg(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fy!==void 0?Fy.createHTML(e):e}const i9=(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+t9: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]=i9(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]==="."?o9:_[1]==="?"?a9:_[1]==="@"?l9: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 s9{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 c9(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):n9(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 s9(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){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=Vy(e).nextSibling;Vy(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??"")}},o9=class extends jp{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===te?void 0:e}},a9=class extends jp{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==te)}},l9=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 c9{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 u9={I:Wp},Yf=cc.litHtmlPolyfillSupport;Yf==null||Yf(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};/**
53
+ */const cc=globalThis,Wy=n=>n,Ed=cc.trustedTypes,jy=Ed?Ed.createPolicy("lit-html",{createHTML:n=>n}):void 0,l6="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,c6="?"+ii,i9=`<${c6}>`,po=document,gc=()=>po.createComment(""),vc=n=>n===null||typeof n!="object"&&typeof n!="function",Ug=Array.isArray,s9=n=>Ug(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Jf=`[
54
+ \f\r]`,Tl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gy=/-->/g,Yy=/>/g,es=RegExp(`>|${Jf}(?:([^\\s"'>=/]+)(${Jf}*=${Jf}*(?:[^
55
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Jy=/'/g,Ky=/"/g,u6=/^(?:script|style|textarea|title)$/i,o9=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),M=o9(1),at=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),Xy=new WeakMap,ds=po.createTreeWalker(po,129);function h6(n,e){if(!Ug(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return jy!==void 0?jy.createHTML(e):e}const a9=(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=Gy:f[1]!==void 0?a=Yy:f[2]!==void 0?(u6.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]==='"'?Ky:Jy):a===Ky||a===Jy?a=es:a===Gy||a===Yy?a=Tl:(a=es,i=void 0);const v=a===es&&n[l+1].startsWith("/>")?" ":"";o+=a===Tl?c+i9:g>=0?(r.push(d),c.slice(0,g)+l6+c.slice(g)+ii+v):c+ii+(g===-2?l:v)}return[h6(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]=a9(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(l6)){const y=f[a++],v=i.getAttribute(g).split(ii),_=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:_[2],strings:v,ctor:_[1]==="."?c9:_[1]==="?"?u9:_[1]==="@"?h9:jp}),i.removeAttribute(g)}else g.startsWith(ii)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(u6.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===c6)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 l9{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 d9(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 d6{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):s9(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(h6(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 l9(i,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Xy.get(e.strings);return t===void 0&&Xy.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 d6(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=Wy(e).nextSibling;Wy(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??"")}},c9=class extends jp{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===te?void 0:e}},u9=class extends jp{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==te)}},h9=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 d9{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 p9={I:Wp},Kf=cc.litHtmlPolyfillSupport;Kf==null||Kf(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:h9}=u9,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 h9(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),d9={},u6=(n,e=d9)=>n._$AH=e,p9=n=>n._$AH,Jf=n=>{n._$AR(),n._$AA.remove()};/**
59
+ */const{I:f9}=p9,Qy=n=>n,p6=n=>n.strings===void 0,ew=()=>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(ew(),i),l=r.insertBefore(ew(),i);t=new f9(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=Qy(d).nextSibling;Qy(r).insertBefore(d,i),d=f}}}return t},ts=(n,e,t=n)=>(n._$AI(e,t),n),m9={},f6=(n,e=m9)=>n._$AH=e,g9=n=>n._$AH,Xf=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),g9(e)}};function f9(n){this._$AN!==void 0?(kd(this),this._$AM=n,h6(this)):this._$AM=n}function m9(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 g9=n=>{n.type==nr.CHILD&&(n._$AP??(n._$AP=m9),n._$AQ??(n._$AQ=f9))};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 v9(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 y9='<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>',w9='<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>',b9='<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>',S9='<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>',_9='<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>',A9='<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>',E9='<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>',k9='<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>',C9='<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>',T9='<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>',$9='<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>',R9='<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>',I9='<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>',x9='<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>',P9='<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>',L9='<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>',D9='<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>',M9='<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>',O9='<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>',N9='<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>',z9='<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>',Z9='<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>',H9='<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>',U9='<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>',V9='<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>',F9='<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>',B9='<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>',q9='<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>',W9='<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>',j9='<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>',G9='<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>',Y9='<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>',J9='<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>',K9='<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>',X9='<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>',Q9='<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>',eN='<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>',tN='<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>',nN='<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>',rN='<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>',iN='<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>',sN='<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>',oN='<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>',aN='<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>',lN='<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>',cN='<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>',uN='<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>',hN='<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>',dN='<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>',pN='<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>',fN='<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>',mN='<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>',gN='<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>',vN='<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>',yN='<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>',wN='<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>',bN='<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>',SN='<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>',_N='<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>',AN='<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>',EN='<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>',kN='<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>',CN='<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>',TN='<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>',$N='<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>',RN='<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>',IN='<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>',xN='<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>',PN='<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>',LN='<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>',DN='<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>',MN='<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>',ON='<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>',NN='<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>',zN='<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>',ZN='<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>',HN='<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>',UN='<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>',VN='<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>',FN='<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>',BN='<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>',qN='<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>',WN='<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>',jN='<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>',GN='<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>',YN='<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>',JN='<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>',KN='<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>',XN='<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>',QN='<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>',ez='<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>',tz='<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>',nz='<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>',rz='<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>',iz='<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>',sz='<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>',oz='<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>',az='<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>',lz='<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>',cz='<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>',uz='<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>',hz=':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(hz);const f6={check:y9,close:w9,copy:b9,pin:S9,search:_9,add:A9,more:E9,settings:k9,expand:C9,collapse:T9,"collapse-up":$9,select:R9,skills:I9,notification:x9,artifact:P9,spinner:L9,locked:D9,unpin:M9,back:O9,forward:N9,television:z9,calendar:Z9,grid:H9,hash:U9,delete:V9,edit:F9,link:B9,external:q9,download:W9,reload:j9,warning:G9,info:Y9,file:J9,folder:K9,clock:X9,user:Q9,upload:eN,star:tN,home:nN,send:rN,filter:iN,sort:sN,help:oN,chart:aN,image:lN,chat:cN,location:uN,play:hN,pause:dN,stop:pN,video:fN,music:mN,error:gN,email:vN,phone:yN,web:wN,tag:bN,bookmark:SN,table:_N,code:AN,group:EN,up:kN,down:CN,money:TN,bank:$N,card:RN,wallet:IN,gauge:xN,activity:PN,"trend-up":LN,"trend-down":DN,database:MN,server:ON,deploy:NN,list:zN,terminal:ZN,branch:HN,shield:UN,sidebar:VN,plane:FN,car:BN,bus:qN,bed:WN,food:jN,cake:GN,tent:YN,microphone:JN,luggage:KN,key:XN,sun:QN,moon:ez,at:tz,briefcase:nz,bicycle:rz,train:iz,gift:sz,book:oz,camera:az,inbox:lz,hourglass:cz,printer:uz};function dz(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=dz(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 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,j0,Zd,Hd,Ud,Vd,Fd,G0;class pz{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,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,Fd,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,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)),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))},Zd=new WeakMap,Hd=new WeakMap,Ud=new WeakMap,Vd=new WeakMap,Fd=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,Ls,ba,mi,gi,ht,Y0,v6,J0,jc,y6,K0;class Hg{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,W0.get(e)),s(this,$e)||(h(this,$e,new pz(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&&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,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,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,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 fz 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 Hg(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",fz);customElements.get("tv-menu")||customElements.define("tv-menu",w6);let mz=0;var Gc;class gz extends Nt{constructor(){super(...arguments);p(this,Gc,`menu-trigger-${++mz}`)}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)},m6=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),w9(e)}};function v9(n){this._$AN!==void 0?(kd(this),this._$AM=n,m6(this)):this._$AM=n}function y9(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 w9=n=>{n.type==nr.CHILD&&(n._$AP??(n._$AP=y9),n._$AQ??(n._$AQ=v9))};class g6 extends Bu{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),m6(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(p6(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 g6{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 b9(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 S9='<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>',_9='<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>',A9='<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>',E9='<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>',k9='<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>',C9='<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>',T9='<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>',$9='<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>',R9='<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>',I9='<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>',x9='<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>',P9='<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>',L9='<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>',D9='<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>',M9='<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>',O9='<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>',N9='<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>',z9='<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>',Z9='<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>',H9='<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>',U9='<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>',V9='<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>',F9='<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>',B9='<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>',q9='<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>',W9='<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>',j9='<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>',G9='<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>',Y9='<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>',J9='<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>',K9='<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>',X9='<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>',Q9='<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>',eN='<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>',tN='<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>',nN='<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>',rN='<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>',iN='<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>',sN='<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>',oN='<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>',aN='<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>',lN='<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>',cN='<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>',uN='<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>',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,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>',dN='<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>',pN='<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>',fN='<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>',mN='<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>',gN='<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>',vN='<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>',yN='<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>',wN='<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>',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,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',SN='<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>',_N='<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>',AN='<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>',EN='<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>',kN='<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>',CN='<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>',TN='<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>',$N='<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>',RN='<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>',IN='<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>',xN='<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>',PN='<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>',LN='<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>',DN='<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>',MN='<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>',ON='<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>',NN='<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>',zN='<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>',ZN='<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>',HN='<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>',UN='<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>',VN='<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>',FN='<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>',BN='<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>',qN='<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>',WN='<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>',jN='<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>',GN='<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>',YN='<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>',JN='<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>',KN='<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>',XN='<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>',QN='<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>',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,8v8H96Zm64,24V200H96V72ZM40,72H80V200H40ZM216,200H176V72h40V200Z"/></svg>',tz='<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>',nz='<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>',rz='<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>',iz='<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>',sz='<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>',oz='<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>',az='<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>',lz='<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>',cz='<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>',uz='<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>',hz='<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>',dz='<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>',pz='<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>',fz=':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}}',v6=new CSSStyleSheet;v6.replaceSync(fz);const y6={check:S9,close:_9,copy:A9,pin:E9,search:k9,add:C9,more:T9,settings:$9,expand:R9,collapse:I9,"collapse-up":x9,select:P9,skills:L9,notification:D9,artifact:M9,spinner:O9,locked:N9,unpin:z9,back:Z9,forward:H9,television:U9,calendar:V9,grid:F9,hash:B9,delete:q9,edit:W9,link:j9,external:G9,download:Y9,reload:J9,warning:K9,info:X9,file:Q9,folder:eN,clock:tN,user:nN,upload:rN,star:iN,home:sN,send:oN,filter:aN,sort:lN,help:cN,chart:uN,image:hN,chat:dN,location:pN,play:fN,pause:mN,stop:gN,video:vN,music:yN,error:wN,email:bN,phone:SN,web:_N,tag:AN,bookmark:EN,table:kN,code:CN,group:TN,up:$N,down:RN,money:IN,bank:xN,card:PN,wallet:LN,gauge:DN,activity:MN,"trend-up":ON,"trend-down":NN,database:zN,server:ZN,deploy:HN,list:UN,terminal:VN,branch:FN,shield:BN,sidebar:qN,plane:WN,car:jN,bus:GN,bed:YN,food:JN,cake:KN,tent:XN,microphone:QN,luggage:ez,key:tz,sun:nz,moon:rz,at:iz,briefcase:sz,bicycle:oz,train:az,gift:lz,book:cz,camera:uz,inbox:hz,hourglass:dz,printer:pz};function mz(n){return n!==null&&Object.hasOwn(y6,n)}var Bc,j0;class w6 extends HTMLElement{constructor(){super(...arguments);p(this,Bc)}connectedCallback(){u(this,Bc,j0).call(this)}attributeChangedCallback(){this.isConnected&&u(this,Bc,j0).call(this)}}Bc=new WeakSet,j0=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[v6],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=mz(r)?y6[r]:""},C(w6,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",w6);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 b6(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 G0=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,Y0,Zd,Hd,Ud,Vd,Fd,J0;class gz{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,Y0).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,Y0).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)),G0.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,Y0=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,K0,S6,X0,jc,_6,Q0;class Vg{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,G0.get(e)),s(this,$e)||(h(this,$e,new gz(e)),G0.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,X0).call(this),u(this,ht,Q0).call(this),e&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),u(this,ht,K0).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,K0).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,S6).call(this),u(this,ht,_6).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,X0).call(this),u(this,ht,Q0).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,K0=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)},S6=function(){s(this,gi).clear(),this.host.addEventListener("scroll",s(this,jc),!0)},X0=function(){this.host.removeEventListener("scroll",s(this,jc),!0),s(this,gi).clear()},jc=new WeakMap,_6=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")},Q0=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 vz extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var vi,ir,em,tm,E6;class A6 extends HTMLElement{constructor(){super();p(this,ir);p(this,vi,new Vg(this,{opened:t=>{t&&wc(u(this,ir,em).call(this)[0])},keydown:t=>u(this,ir,E6).call(this,t),pointermove:t=>wc(u(this,ir,tm).call(this,t)??void 0),click:t=>{u(this,ir,tm).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,em=function(){return[...this.querySelectorAll("tv-menu-item")]},tm=function(t){const r=t.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},E6=function(t){if(!s(this,vi).open)return!1;const r=u(this,ir,em).call(this),i=r.indexOf(this.ownerDocument.activeElement);return b6(t,r)?!0:t.key==="Enter"&&i>=0?(t.preventDefault(),t.stopImmediatePropagation(),r[i].click(),!0):!1},C(A6,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",vz);customElements.get("tv-menu")||customElements.define("tv-menu",A6);let yz=0;var Gc;class wz extends Nt{constructor(){super(...arguments);p(this,Gc,`menu-trigger-${++yz}`)}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(gz);/**
69
+ </tv-menu>`}}Gc=new WeakMap;const k6=zt(wz);/**
70
70
  * @license
71
71
  * Copyright 2020 Google LLC
72
72
  * SPDX-License-Identifier: BSD-3-Clause
73
- */const bn=()=>new vz;class vz{}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 bn=()=>new bz;class bz{}const Qf=new WeakMap,Je=vl(class extends g6{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=Qf.get(e);t===void 0&&(t=new WeakMap,Qf.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=Qf.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=p9(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 tw=(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=g9(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=tw(a,v,_),f=tw(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 Xf(i[y]),y--;else Xf(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&&Xf(E)}return this.ut=a,f6(n,c),at}});/**
78
78
  * @license
79
79
  * Copyright 2018 Google LLC
80
80
  * SPDX-License-Identifier: BSD-3-Clause
81
- */const _6="important",yz=" !"+_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(yz);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?_6:""):t[r]=i}}return at}}),wz=24;function bz(n){return!Xy(n.source)||!Xy(n.current)||!Tz(n.source,n.current)||!$z(n)||!Cz(n.geometry)?{kind:"invalidated"}:Az(n.pointer,n.geometry)==="pinned"?Sz(n):_z(n)}function Sz(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)??Ez(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 _z(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?kz(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 Az(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+wz);return n.y<i?"pinned":"unpinned"}function Ez(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function kz(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function Cz(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 Tz(n,e){return em(n.pinnedChannelIds,e.pinnedChannelIds)&&em(n.unpinnedChannelIds,e.unpinnedChannelIds)}function $z(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,Rz="New channel",ns=".channel-group:not(.channel-group-withdrawal) .channel-row",Iz=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,tm,k6,C6,T6,$6,Bh,R6,I6,x6,P6,Bl,Ho,L6,D6,nm,ql,Bd,qd,Wd,jd,M6,rm,im,O6,Yc,Jc,N6,Gd,Kc,z6,Z6,Wl,sm,H6,U6,jl,om,am,lm,V6,qh,Xc,Qc,eu,tu,F6,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,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,bn());p(this,Sa,bn());p(this,_a,bn());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(Rz).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,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,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,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,D6).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 C6="important",Sz=" !"+C6,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(Sz);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?C6:""):t[r]=i}}return at}}),_z=24;function Az(n){return!nw(n.source)||!nw(n.current)||!Iz(n.source,n.current)||!xz(n)||!Rz(n.geometry)?{kind:"invalidated"}:Cz(n.pointer,n.geometry)==="pinned"?Ez(n):kz(n)}function Ez(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)??Tz(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 kz(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?$z(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 Cz(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+_z);return n.y<i?"pinned":"unpinned"}function Tz(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function $z(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function Rz(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function nw(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function Iz(n,e){return nm(n.pinnedChannelIds,e.pinnedChannelIds)&&nm(n.unpinnedChannelIds,e.unpinnedChannelIds)}function xz(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)&&nm(e,t)&&i}function nm(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const T6=4,Go=200,Qt=28,$d=800,gh="ease",rw=.5,Rl=.5,Pz="New channel",ns=".channel-group:not(.channel-group-withdrawal) .channel-row",Lz=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,rm,R6,I6,x6,P6,Bh,L6,D6,M6,O6,Bl,Ho,N6,z6,im,ql,Bd,qd,Wd,jd,Z6,sm,om,H6,Yc,Jc,U6,Gd,Kc,V6,F6,Wl,am,B6,q6,jl,lm,cm,um,W6,qh,Xc,Qc,eu,tu,j6,hm,Wh,jh,Gl,dm,pm;class $6{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,bn());p(this,Sa,bn());p(this,_a,bn());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(Pz).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)<=T6||u(this,T,V6).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,hm).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,N6).call(this),u(this,T,j6).call(this,t),u(this,T,x6).call(this,t),u(this,T,M6).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,hm).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,sm).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,z6).call(this)}template(){var r;const e=s(this,nt);if(e===null)return te;const t=u(this,T,O6).call(this,iw(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,rm).call(this,"Pinned",t.pinned)}
89
+ ${u(this,T,rm).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,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,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,D6).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,dm).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,rm=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"
@@ -97,7 +97,7 @@ Television updates its desktop app automatically. Version {version} has download
97
97
  ?drag-collapsed=${d}
98
98
  >
99
99
  <div class="channel-group-label" id=${`channel-group-${r}`}>${e}</div>
100
- ${Cd(c,g=>g.kind==="row"?g.row.channel.id:g.key,g=>g.kind==="row"?u(this,T,k6).call(this,g.row):M`
100
+ ${Cd(c,g=>g.kind==="row"?g.row.channel.id:g.key,g=>g.kind==="row"?u(this,T,R6).call(this,g.row):M`
101
101
  <span
102
102
  class="channel-placeholder"
103
103
  aria-hidden="true"
@@ -107,7 +107,7 @@ Television updates its desktop app automatically. Version {version} has download
107
107
  ></span>
108
108
  `)}
109
109
  </div>
110
- `},k6=function(e){var c;const{channel:t,pinned:r,selected:i}=e,o=((c=s(this,se))==null?void 0:c.channelId)===t.id?s(this,se):null,a=o!==null&&r&&o.placement.kind==="placement"&&o.placement.side==="unpinned",l=t.id===s(this,ft);return M`
110
+ `},R6=function(e){var c;const{channel:t,pinned:r,selected:i}=e,o=((c=s(this,se))==null?void 0:c.channelId)===t.id?s(this,se):null,a=o!==null&&r&&o.placement.kind==="placement"&&o.placement.side==="unpinned",l=t.id===s(this,ft);return M`
111
111
  <div
112
112
  class=${`channel-row${o!==null?" dragged":""}${a?" unpinning":""}`}
113
113
  data-channel-id=${t.id}
@@ -149,12 +149,12 @@ Television updates its desktop app automatically. Version {version} has download
149
149
  @keydown=${d=>{d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),d.stopPropagation(),d.currentTarget.click())}}
150
150
  @pointermove=${s(this,Gd)}
151
151
  aria-selected=${i?"true":te}
152
- @pointerdown=${d=>s(this,Ge).dragging??s(this,Ge).management?u(this,T,O6).call(this,t.id,d):void 0}
153
- @click=${d=>u(this,T,N6).call(this,t.id,d)}
152
+ @pointerdown=${d=>s(this,Ge).dragging??s(this,Ge).management?u(this,T,H6).call(this,t.id,d):void 0}
153
+ @click=${d=>u(this,T,U6).call(this,t.id,d)}
154
154
  >
155
155
  ${t.name}
156
156
  </div>
157
- ${s(this,Ge).management?S6(u(this,T,C6).call(this,e),{trigger:d=>M`
157
+ ${s(this,Ge).management?k6(u(this,T,I6).call(this,e),{trigger:d=>M`
158
158
  <button
159
159
  class="channel-menu-trigger"
160
160
  variant="ghost"
@@ -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,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`
174
+ `},I6=function(e){const{channel:t,pinned:r}=e;return[{label:"Rename",action:()=>u(this,T,im).call(this,t.id)},{label:r?"Unpin":"Pin",action:()=>u(this,T,Z6).call(this,t.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>u(this,T,P6).call(this,t.id,t.name)}]},x6=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)))},P6=function(e,t){var i,o,a,l,c;if(s(this,mt)!==null||s(this,gt)!==null)return;u(this,T,om).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))},L6=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)})},D6=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"
@@ -187,12 +187,12 @@ Television updates its desktop app automatically. Version {version} has download
187
187
  <button type="button" autofocus @click=${()=>u(this,T,Bh).call(this)}>
188
188
  Cancel
189
189
  </button>
190
- <button type="button" intent="danger" @click=${()=>u(this,T,R6).call(this)}>
190
+ <button type="button" intent="danger" @click=${()=>u(this,T,L6).call(this)}>
191
191
  Delete
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,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=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,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,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))},L6=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,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))},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,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,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,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=xz({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=bz({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=!Pz(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,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,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,U6).call(this,e);return}}u(this,T,sm).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},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,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&&!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 xz(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-Iz));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 Pz(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 pn,Yd;class Lz extends Nt{constructor(){super(...arguments);p(this,pn,new E6(()=>this.render()));p(this,Yd,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,pn).connect()}template(t,r,i,o,a,l=!1){return s(this,pn).update(t,r,{management:!0,motionSuppressed:l}),M`
195
+ `)},M6=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=iw(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))},O6=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,im).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))},N6=function(){var r;h(this,be,null),u(this,T,dm).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)))},z6=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))},im=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,Z6=function(e,t){var o;if(s(this,It)===null||s(this,nt)===null)return;if(u(this,T,om).call(this,e),s(this,Ge).revealMovedRow){const a=u(this,T,sm).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)})},sm=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},om=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"))},H6=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,U6=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,V6=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,F6).call(this,r),a=Dz({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)},F6=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=Az({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=!Mz(e.placement,E),B=x?u(this,T,cm).call(this,e):null;e.placement=E,(x||r)&&u(this,T,um).call(this,e,B,!1),u(this,T,am).call(this,e)},am=function(e){const t=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=t?u(this,T,lm).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)<=rw:((t==null?void 0:t.scrollTop)??0)>=i-rw;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,B6).call(this,e,a)}))},B6=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,lm).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,q6).call(this,e);return}}u(this,T,am).call(this,e)},q6=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},lm=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},cm=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}},um=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,W6).call(this,e,t,r)})},W6=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,j6=function(e){const t=Yl(e);s(this,se)!==null&&!s(this,se).completed&&!sw(s(this,se).source,t)&&u(this,T,jh).call(this),s(this,be)!==null&&!sw(s(this,be).source,t)&&h(this,be,null)},hm=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,cm).call(this,e);h(this,se,null),u(this,T,pm).call(this,e),t&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),u(this,T,um).call(this,e,r,!0)},dm=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,pm).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},pm=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 Dz(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=ow(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-Lz));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:ow(n.pointer.y-n.wideRow.top,0,t)}}function iw(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 sw(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 Mz(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 ow(n,e,t){return Math.max(e,Math.min(t,n))}var pn,Yd;class Oz extends Nt{constructor(){super(...arguments);p(this,pn,new $6(()=>this.render()));p(this,Yd,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,pn).connect()}template(t,r,i,o,a,l=!1){return s(this,pn).update(t,r,{management:!0,motionSuppressed:l}),M`
196
196
  <nav class="sidebar" ?dragging=${s(this,pn).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,pn).overlayTemplate()}
240
- `}disconnected(){s(this,pn).disconnect()}}pn=new WeakMap,Yd=new WeakMap;const Dz=zt(Lz),Mz=1280,Oz=800,rw=.4,iw=.4,B6=280,sw=180,Nz=14,zz=45,Zz=16,ow=64,Hz=90,Uz=1,Vz=24,Fz=230,Bz=230;function qz(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 Wz(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 jz{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=Wz(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",Ug="tv-theme";let si=null,Wr=null,Hi=null,Ui=null,ei=null,aw=0,Id=0;function Gz(n){const e=document.createElement("link"),t=new URL("/theme/theme.css",n);t.searchParams.set(Ug,Vg()),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 Yz(){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(Ug,Vg()),e.src=t.toString(),e.dataset.televisionScript=q6,Wr==null||Wr.remove(),document.head.append(e),Wr=e,e}function Jz(){Wr==null||Wr.remove(),Wr=null}function Kz(){return Wr}async function Xz(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),Hi=c),d!==null&&(l.after(d),Ui=d))}function Qz(){W6()}function W6(){return Id+=1,Hi==null||Hi.remove(),Ui==null||Ui.remove(),Hi=null,Ui=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(Ug,Vg());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=t7(t.toString(),e7()),r}function e7(){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 t7(n,e){return`<!doctype html>
240
+ `}disconnected(){s(this,pn).disconnect()}}pn=new WeakMap,Yd=new WeakMap;const Nz=zt(Oz),zz=1280,Zz=800,aw=.4,lw=.4,G6=280,cw=180,Hz=14,Uz=45,Vz=16,uw=64,Fz=90,Bz=1,qz=24,Wz=230,jz=230;function Gz(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)),_=fm((d-y)/(t-y)),E=o+a,x=i+E,B=c?fm((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 Yz(n,e,t,r){const i=r*Math.abs(e-n);if(i===0)return e;const a=1-(1-fm(t/i))**2;return n+(e-n)*a}function fm(n){return Math.max(0,Math.min(1,n))}var kr,wi,Cr,Aa,Ea,Ms,jr,Gh,mm;class Jz{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,mm).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:cw*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,mm).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=Yz(1-s(this,Aa)/s(this,Ms),1-s(this,Ea)/s(this,Ms),Number(e.currentTime??0),cw);h(this,Cr,s(this,Ms)*(1-t))},mm=function(){var e;cancelAnimationFrame(s(this,wi)),h(this,wi,0),(e=s(this,kr))==null||e.cancel(),h(this,kr,null)};const Y6="television-active-theme",Fg="tv-theme";let si=null,Wr=null,Hi=null,Ui=null,ei=null,hw=0,Id=0;function Kz(n){const e=document.createElement("link"),t=new URL("/theme/theme.css",n);t.searchParams.set(Fg,Bg()),e.rel="stylesheet",e.href=t.toString(),e.dataset.televisionStyle=Y6;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 Xz(){si&&(si.remove(),si=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function dw(n){const e=document.createElement("script"),t=new URL("/theme/main.js",n);return t.searchParams.set(Fg,Bg()),e.src=t.toString(),e.dataset.televisionScript=Y6,Wr==null||Wr.remove(),document.head.append(e),Wr=e,e}function Qz(){Wr==null||Wr.remove(),Wr=null}function e7(){return Wr}async function t7(n,e,t){const r=J6();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?pw(n,"background"):null,d=o.enableIframeOverlayJS===!0?pw(n,"overlay"):null;r===Id&&(c!==null&&(a.before(c),Hi=c),d!==null&&(l.after(d),Ui=d))}function n7(){J6()}function J6(){return Id+=1,Hi==null||Hi.remove(),Ui==null||Ui.remove(),Hi=null,Ui=null,Id}function pw(n,e){const t=e==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);t.searchParams.set(Fg,Bg());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=i7(t.toString(),r7()),r}function r7(){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 i7(n,e){return`<!doctype html>
241
241
  <html data-theme="${e}">
242
242
  <head>
243
243
  <meta charset="utf-8">
@@ -255,19 +255,19 @@ 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[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 Vg(){return aw+=1,`${Date.now()}-${aw}`}const n7=404,r7="/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:r7,contentURL:null}:uw(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:o7(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var We,jt,ka,Os,Ns,fn,zs,Ca,wt,Ta,$a,Un,bi,Si,Zs,K,Jh,Y6,J6,fm,K6,Vn,Kh,Jl,mm,X6,gm,vm,is;class i7 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,fn,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,fn)||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?!a7(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,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,fn=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,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 K6(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&&K6({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 X6(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&&(X6(e)||e.isConnected&&e.closest("#foreground-overlay")===null&&(ei=e))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>X6(document.activeElement))},{capture:!0});function Bg(){return hw+=1,`${Date.now()}-${hw}`}const s7=404,o7="/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 fw(n.currentURL)&&!n.electron?t=fr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:o7,contentURL:null}:fw(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:c7(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var We,jt,ka,Os,Ns,fn,zs,Ca,wt,Ta,$a,Un,bi,Si,Zs,K,Jh,Q6,eS,gm,tS,Vn,Kh,Jl,vm,nS,ym,wm,is;class a7 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,fn,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,fn)||s(this,Os).call(this,!0)})}get currentFrame(){return s(this,jt)}connected(){u(this,K,Kh).call(this),u(this,K,vm).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?!u7(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,wm).call(this)?!1:(u(this,K,ym).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"||!T0(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,fn=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,wm).call(this)){u(this,K,tS).call(this,t.artifact);return}const r=Yh(t),i=u(this,K,Q6).call(this,r.renderer);u(this,K,eS).call(this,i,r),u(this,K,gm).call(this,i),u(this,K,Kh).call(this),u(this,K,vm).call(this)},Q6=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},eS=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},gm=function(t){s(this,ka)!==t&&(h(this,ka,t),this.render(t))},tS=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,gm).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
- <h1>${M_()}</h1>
262
- <p>${O_()}</p>
261
+ <h1>${Z_()}</h1>
262
+ <p>${H_()}</p>
263
263
  <section class="artifact-missing-path" aria-label="Missing artifact path">
264
264
  <p class="artifact-missing-path-label">Registered path:</p>
265
265
  <p><code>${t.path}</code></p>
266
266
  </section>
267
- <p>${N_()}</p>
267
+ <p>${U_()}</p>
268
268
  </div>
269
269
  </section>
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,fn)&&r===s(this,zs)||(u(this,K,Jl).call(this),s(this,Os).call(this,!1),!t||!r||!this.isConnected))return;if(h(this,fn,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,fn)){h(this,zs,null);return}s(this,fn).removeEventListener("load",s(this,Vn)),s(this,fn).removeEventListener("did-finish-load",s(this,Vn)),s(this,fn).removeEventListener("did-fail-load",s(this,Vn)),h(this,fn,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 e9(r):new QO(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,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,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===n7){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)}},vm=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"&&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,Un,null)};const s7=zt(i7);function uw(n){return n.startsWith("http://")||n.startsWith("https://")}function o7(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function a7(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,ym,Xh,Qh;class l7{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=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&&u7(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,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,c7(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,ym=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 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 c7(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function u7(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 h7="/views/url-unsupported/";class d7 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",bn());C(this,"_trustedChannel",new l7((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?!m7(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&g7(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&&f7(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(!Ry(t.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===h7||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 IO(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,fn)&&r===s(this,zs)||(u(this,K,Jl).call(this),s(this,Os).call(this,!1),!t||!r||!this.isConnected))return;if(h(this,fn,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,fn)){h(this,zs,null);return}s(this,fn).removeEventListener("load",s(this,Vn)),s(this,fn).removeEventListener("did-finish-load",s(this,Vn)),s(this,fn).removeEventListener("did-fail-load",s(this,Vn)),h(this,fn,null),h(this,zs,null)},vm=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 r9(r):new n9(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,nS).call(this)},nS=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,ym).call(this))},ym=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===s7){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)}},wm=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"&&T0(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 l7=zt(a7);function fw(n){return n.startsWith("http://")||n.startsWith("https://")}function c7(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function u7(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,bm,Xh,Qh;class h7{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=gw(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&&p7(i)===e.origin;!c&&!d&&!f||u(this,Ot,bm).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!==mw)return;const r=gw((o=t.args)==null?void 0:o[0]),i=s(this,Ai);!r||!i||u(this,Ot,bm).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,mw,a)}})});p(this,su,e=>{const t=vw(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});p(this,ou,e=>{vw(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,d7(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,bm=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 mw="television-artifact-bridge";function gw(n){return $_(n)||R_(n)||I_(n)||x_(n)||P_(n)||L_(n)||D_(n)||M_(n)?n:null}function d7(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function p7(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function vw(n){return n.detail??n}const f7="/views/url-unsupported/";class m7 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",bn());C(this,"_trustedChannel",new h7((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?!y7(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&w7(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:O_,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();K6({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&&v7(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:N_,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(!Ly(t.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===f7||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 LO(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):yw(i,i)}convertIframeNavigationURL(t){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&fr(this._artifact.url)&&fr(t)?qr(t):yw(t,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string"||!Ly(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&&(rS(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,12 +321,12 @@ html, body {
321
321
  ${Je(this._rootRef)}
322
322
  >
323
323
  <div class="artifact-frame-clip">
324
- ${s7(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
324
+ ${l7(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>
328
328
  ${this.navigationControlsTemplate()}
329
- ${S6(this.menuEntries(),{trigger:a=>M`
329
+ ${k6(this.menuEntries(),{trigger:a=>M`
330
330
  <button
331
331
  icon
332
332
  size="sm"
@@ -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 p7=zt(d7);function f7(n){return n.startsWith("http://")||n.startsWith("https://")}function m7(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 g7(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 Fg(n){return{width:1-rw+rw*n.width/Mz,height:1-iw+iw*n.height/Oz}}function tS(n){return{width:Math.min(Fz,n.width),height:Math.min(Bz,n.height)}}function mw(n,e){const t=Fg(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 v7(n,e){const t=Fg(e);return{width:n.width/t.width,height:n.height/t.height}}const gw=.5,vh=2,y7=120,w7=["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,bm,ed,sS,au,lu,cu,uu,Bs,hu,Sm,an,_m,Uo,oS,aS,Ql;class b7 extends Nt{constructor(){super(...arguments);p(this,Z);p(this,Hs,bn());p(this,Bn,bn());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,Sm).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,Sm).call(this,r))}});p(this,hu,()=>{const t=s(this,rt);!t||vw(u(this,Z,Kl).call(this,t.filmstrip),t.pageBox)||(u(this,Z,bm).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=_7(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`
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 g7=zt(m7);function v7(n){return n.startsWith("http://")||n.startsWith("https://")}function y7(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"?rS(n.url,e.url):!0}function w7(n,e){return n.kind==="path"&&e.kind==="path"&&n.id===e.id&&(n.title!==e.title||n.path!==e.path)}function rS(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 yw(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 iS(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 Sm(n,e,t,r){iS(n,e,t,t.size,r)}function qg(n){return{width:1-aw+aw*n.width/zz,height:1-lw+lw*n.height/Zz}}function sS(n){return{width:Math.min(Wz,n.width),height:Math.min(jz,n.height)}}function ww(n,e){const t=qg(e),r=sS(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 b7(n,e){const t=qg(e);return{width:n.width/t.width,height:n.height/t.height}}const bw=.5,vh=2,S7=120,_7=["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,oS,aS,Kl,lS,Xl,_m,ed,cS,au,lu,cu,uu,Bs,hu,Am,an,Em,Uo,uS,hS,Ql;class A7 extends Nt{constructor(){super(...arguments);p(this,Z);p(this,Hs,bn());p(this,Bn,bn());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,Am).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,Am).call(this,r))}});p(this,hu,()=>{const t=s(this,rt);!t||Sw(u(this,Z,Kl).call(this,t.filmstrip),t.pageBox)||(u(this,Z,_m).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=k7(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,uS).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,oS).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,hS).call(this,U))}),M`
346
346
  <section
347
347
  class="stage"
348
348
  ${Je(s(this,Hs))}
349
- style=${`--handle-band: ${Nz}px; --handle-reach: ${zz}px; --handle-thickness: ${Zz}px;`}
349
+ style=${`--handle-band: ${Hz}px; --handle-reach: ${Uz}px; --handle-thickness: ${Vz}px;`}
350
350
  >
351
351
  ${r!==null&&c.length===0?M`
352
352
  <div class="stage-empty">
@@ -363,16 +363,16 @@ html, body {
363
363
  data-page-key=${ve}
364
364
  ?selected=${Xe}
365
365
  ?full-screen=${de.geometry.full_screen}
366
- style=${u(this,Z,iS).call(this,de)}
366
+ style=${u(this,Z,lS).call(this,de)}
367
367
  @click=${Xe||Fe===null?null:()=>t.selectPage(r.id,Fe.id)}
368
368
  >
369
- ${Fe?p7(t,Fe,{viewURL:t.getArtifactViewURL(Fe),contentURL:t.getArtifactContentURL(Fe),fullScreen:de.geometry.full_screen,inert:!Xe,onFullScreenChange:Ze=>wm(t,r,de,Ze)}):null}
369
+ ${Fe?g7(t,Fe,{viewURL:t.getArtifactViewURL(Fe),contentURL:t.getArtifactContentURL(Fe),fullScreen:de.geometry.full_screen,inert:!Xe,onFullScreenChange:Ze=>Sm(t,r,de,Ze)}):null}
370
370
  ${Xe?M`
371
371
  <div class="page-handles" aria-hidden="true">
372
- ${w7.map(Ze=>M`
372
+ ${_7.map(Ze=>M`
373
373
  <span
374
374
  class="page-handle ${Ze}"
375
- @pointerdown=${le=>u(this,Z,sS).call(this,le,Ze,t,r,de,ve)}
375
+ @pointerdown=${le=>u(this,Z,cS).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,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);vw(o,s(this,Ir))||(u(this,Z,bm).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=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,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=mw(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},bm=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")},y7)))},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),_=Fg(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,Z,_m).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,_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=v7(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)}},_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)},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)<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 S7=zt(b7);function _7(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,oS=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)})))},aS=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);Sw(o,s(this,Ir))||(u(this,Z,_m).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)}},lS=function(t){if(t.geometry.full_screen||s(this,Ir)===null)return"";const r=ww(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=ww(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},_m=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")},S7)))},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")},cS=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),_=qg(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,Am=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=sS(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-uw&&a>=t.pageBox.height-uw,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,Em).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,Em).call(this,r.stage,!1),t&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),Sm(r.application,r.channel,r.page,!0);else if(t){const i={...r.baselineSize},o=b7(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?iS(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)}},Em=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,aS).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)<bw||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:G6,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))},uS=function(){const t=s(this,Bn).value;return t?new Map([...t.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},hS=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)<=bw)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 E7=zt(A7);function k7(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 Sw(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:A7,getPrototypeOf:E7,getOwnPropertyDescriptor:k7}=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),C7=ut(Array.prototype.lastIndexOf),ww=ut(Array.prototype.pop),Il=ut(Array.prototype.push),T7=ut(Array.prototype.splice),nd=ut(String.prototype.toLowerCase),Xf=ut(String.prototype.toString),Qf=ut(String.prototype.match),xl=ut(String.prototype.replace),$7=ut(String.prototype.indexOf),R7=ut(String.prototype.trim),Tt=ut(Object.prototype.hasOwnProperty),Qe=ut(RegExp.prototype.test),Pl=I7(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 I7(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&&(A7(e)||(e[r]=o),i=o)}n[i]=!0}return n}function x7(n){for(let e=0;e<n.length;e++)Tt(n,e)||(n[e]=null);return n}function In(n){const e=td(null);for(const[t,r]of cS(n))Tt(n,t)&&(Array.isArray(r)?e[t]=x7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=In(r):e[t]=r);return e}function Ll(n,e){for(;n!==null;){const r=k7(n,e);if(r){if(r.get)return ut(r.get);if(typeof r.value=="function")return ut(r.value)}n=E7(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"]),P7=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"]),L7=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"]),D7=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M7=nn(/<%[\w\W]*|[\w\W]*%>/gm),O7=nn(/\$\{[\w\W]*/gm),N7=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),z7=nn(/^aria-[\-\w]+$/),uS=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z7=nn(/^(?:\w+script|data):/i),H7=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hS=nn(/^html$/i),U7=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ew=Object.freeze({__proto__:null,ARIA_ATTR:z7,ATTR_WHITESPACE:H7,CUSTOM_ELEMENT:U7,DATA_ATTR:N7,DOCTYPE_NAME:hS,ERB_EXPR:M7,IS_ALLOWED_URI:uS,IS_SCRIPT_OR_DATA:Z7,MUSTACHE_EXPR:D7,TMPLIT_EXPR:O7});const Dl={element:1,text:3,progressingInstruction:7,comment:8,document:9},V7=function(){return typeof window>"u"?null:window},F7=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]:V7();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=kw();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}=Ew;let{IS_ALLOWED_URI:i1}=Ew,He=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={},kn=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 De=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=In(b),Al=v_.indexOf(b.PARSER_MEDIA_TYPE)===-1?y_:b.PARSER_MEDIA_TYPE,De=Al==="application/xhtml+xml"?Xf:nd,He=Tt(b,"ALLOWED_TAGS")?Q({},b.ALLOWED_TAGS,De):s1,Be=Tt(b,"ALLOWED_ATTR")?Q({},b.ALLOWED_ATTR,De):o1,af=Tt(b,"ALLOWED_NAMESPACES")?Q({},b.ALLOWED_NAMESPACES,Xf):m_,sf=Tt(b,"ADD_URI_SAFE_ATTR")?Q(In(f1),b.ADD_URI_SAFE_ATTR,De):f1,d1=Tt(b,"ADD_DATA_URI_TAGS")?Q(In(p1),b.ADD_DATA_URI_TAGS,De):p1,kn=Tt(b,"FORBID_CONTENTS")?Q({},b.FORBID_CONTENTS,De):rf,Sl=Tt(b,"FORBID_TAGS")?Q({},b.FORBID_TAGS,De):In({}),Gu=Tt(b,"FORBID_ATTR")?Q({},b.FORBID_ATTR,De):In({}),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&&(He=Q({},Sw),Be=td(null),So.html===!0&&(Q(He,bw),Q(Be,_w)),So.svg===!0&&(Q(He,e0),Q(Be,r0),Q(Be,wh)),So.svgFilters===!0&&(Q(He,t0),Q(Be,r0),Q(Be,wh)),So.mathMl===!0&&(Q(He,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:(He===s1&&(He=In(He)),Q(He,b.ADD_TAGS,De))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xr.attributeCheck=b.ADD_ATTR:(Be===o1&&(Be=In(Be)),Q(Be,b.ADD_ATTR,De))),b.ADD_URI_SAFE_ATTR&&Q(sf,b.ADD_URI_SAFE_ATTR,De),b.FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,b.FORBID_CONTENTS,De)),b.ADD_FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,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=F7(v,i)),O!==null&&typeof Y=="string"&&(Y=O.createHTML(""));ct&&ct(b),Ao=b}},g1=Q({},[...e0,...t0,...P7]),v1=Q({},[...n0,...L7]),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},Cn=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{Cn(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=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},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(F,b,I){yh(F,N=>{N.call(e,b,I,Ao)})}const S1=function(b){let I=null;if(ar(ve.beforeSanitizeElements,b,null),cf(b))return Cn(b),!0;const N=De(b.nodeName);if(ar(ve.uponSanitizeElement,b,{tagName:N,allowedTags:He}),Yu&&b.hasChildNodes()&&!b1(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 Cn(b),!0;if(!(Xr.tagCheck instanceof Function&&Xr.tagCheck(N))&&(!He[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&&!kn[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 Cn(b),!0}return b instanceof c&&!b_(b)||(N==="noscript"||N==="noembed"||N==="noframes")&&Qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(Cn(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)},_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(Zt,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"&&$7(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=De(Re),uf=lr;let qe=Re==="value"?uf:R7(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,Ze,le],C1=>{qe=xl(qe,C1," ")});const k1=De(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)?Cn(b):ww(e.removed)}catch{Qi(Re,b)}}ar(ve.afterSanitizeAttributes,b,null)},S_=function F(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&&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"&&!b1(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=y1("<!---->"),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=y1(F),!I)return bo?null:Ku?Y:""}I&&tf&&Cn(I.firstChild);const Re=w1(_l?F:I);for(;ye=Re.nextNode();)S1(ye),E1(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 _1(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=C7(ve[F],b);return I===-1?void 0:T7(ve[F],I,1)[0]}return ww(ve[F])},e.removeHooks=function(F){ve[F]=[]},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 B7=(()=>{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)}}>`)},q7=/^(?:[ \t]*(?:\n|$))+/,W7=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,j7=/^ {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+|$)/,G7=/^ {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(),Y7=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]+)*)/,J7=/^[^\n]+/,jg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,K7=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),X7=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]*?(?:-->|$))/,Q7=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(),eZ=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vS).getRegex(),Yg={blockquote:eZ,code:W7,def:K7,fences:j7,heading:G7,hr:Wu,html:Q7,lheading:gS,list:X7,newline:q7,paragraph:vS,table:cs,text:J7},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(),tZ={...Yg,lheading:Y7,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()},nZ={...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()},rZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,iZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yS=/^( {2,}|\\)\n(?!\s*$)/,sZ=/^(`+|[^`])(?:(?= {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,oZ=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),wS=/(?!~)[\p{P}\p{S}]/u,aZ=/(?!~)[\s\p{P}\p{S}]/u,lZ=/(?:[^\s\p{P}\p{S}]|~)/u,cZ=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",B7?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bS=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,uZ=ie(bS,"u").replace(/punct/g,yl).getRegex(),hZ=ie(bS,"u").replace(/punct/g,wS).getRegex(),SS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dZ=ie(SS,"gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),pZ=ie(SS,"gu").replace(/notPunctSpace/g,lZ).replace(/punctSpace/g,aZ).replace(/punct/g,wS).getRegex(),fZ=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(),mZ=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yl).getRegex(),gZ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",vZ=ie(gZ,"gu").replace(/notPunctSpace/g,Jg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),yZ=ie(/\\(punct)/,"gu").replace(/punct/g,yl).getRegex(),wZ=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(),bZ=ie(Gg).replace("(?:-->|$)","-->").getRegex(),SZ=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",bZ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_Z=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(),AZ=ie("reflink|nolink(?!\\()","g").replace("reflink",_S).replace("nolink",AS).getRegex(),Tw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Kg={_backpedal:cs,anyPunctuation:yZ,autolink:wZ,blockSkip:cZ,br:yS,code:iZ,del:cs,delLDelim:cs,delRDelim:cs,emStrongLDelim:uZ,emStrongRDelimAst:dZ,emStrongRDelimUnd:fZ,escape:rZ,link:_Z,nolink:AS,punctuation:oZ,reflink:_S,reflinkSearch:AZ,tag:SZ,text:sZ,url:cs},EZ={...Kg,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},Cm={...Kg,emStrongRDelimAst:pZ,emStrongLDelim:hZ,delLDelim:mZ,delRDelim:vZ,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()},kZ={...Cm,br:ie(yS).replace("{2,}","*").getRegex(),text:ie(Cm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bh={normal:Yg,gfm:tZ,pedantic:nZ},Ml={normal:Kg,gfm:Cm,breaks:kZ,pedantic:EZ},CZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$w=n=>CZ[n];function xn(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 TZ(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function $Z(n,e=0){let t=e,r="";for(let i of n)if(i===" "){let 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 RZ(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
390
+ */class km 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:[]}}}km.directiveName="unsafeHTML",km.resultType=1;const dS=vl(km);/*! @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:pS,setPrototypeOf:_w,isFrozen:C7,getPrototypeOf:T7,getOwnPropertyDescriptor:$7}=Object;let{freeze:ct,seal:nn,create:td}=Object,{apply:Cm,construct:Tm}=typeof Reflect<"u"&&Reflect;ct||(ct=function(e){return e});nn||(nn=function(e){return e});Cm||(Cm=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)});Tm||(Tm=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),R7=ut(Array.prototype.lastIndexOf),Aw=ut(Array.prototype.pop),Il=ut(Array.prototype.push),I7=ut(Array.prototype.splice),nd=ut(String.prototype.toLowerCase),e0=ut(String.prototype.toString),t0=ut(String.prototype.match),xl=ut(String.prototype.replace),x7=ut(String.prototype.indexOf),P7=ut(String.prototype.trim),Tt=ut(Object.prototype.hasOwnProperty),Qe=ut(RegExp.prototype.test),Pl=L7(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 Cm(n,e,r)}}function L7(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Tm(n,t)}}function Q(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nd;_w&&_w(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(C7(e)||(e[r]=o),i=o)}n[i]=!0}return n}function D7(n){for(let e=0;e<n.length;e++)Tt(n,e)||(n[e]=null);return n}function In(n){const e=td(null);for(const[t,r]of pS(n))Tt(n,t)&&(Array.isArray(r)?e[t]=D7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=In(r):e[t]=r);return e}function Ll(n,e){for(;n!==null;){const r=$7(n,e);if(r){if(r.get)return ut(r.get);if(typeof r.value=="function")return ut(r.value)}n=T7(n)}function t(){return null}return t}const Ew=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"]),n0=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"]),r0=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"]),M7=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"]),i0=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"]),O7=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kw=ct(["#text"]),Cw=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"]),s0=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"]),Tw=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"]),N7=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z7=nn(/<%[\w\W]*|[\w\W]*%>/gm),Z7=nn(/\$\{[\w\W]*/gm),H7=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),U7=nn(/^aria-[\-\w]+$/),fS=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V7=nn(/^(?:\w+script|data):/i),F7=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mS=nn(/^html$/i),B7=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var $w=Object.freeze({__proto__:null,ARIA_ATTR:U7,ATTR_WHITESPACE:F7,CUSTOM_ELEMENT:B7,DATA_ATTR:H7,DOCTYPE_NAME:mS,ERB_EXPR:z7,IS_ALLOWED_URI:fS,IS_SCRIPT_OR_DATA:V7,MUSTACHE_EXPR:N7,TMPLIT_EXPR:Z7});const Dl={element:1,text:3,progressingInstruction:7,comment:8,document:9},q7=function(){return typeof window>"u"?null:window},W7=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}},Rw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q7();const e=F=>gS(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=Rw();e.isSupported=typeof pS=="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:o1}=$w,He=null;const a1=Q({},[...Ew,...n0,...r0,...i0,...kw]);let Be=null;const l1=Q({},[...Cw,...s0,...Tw,...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 c1=!0,Qp=!0,u1=!1,h1=!0,wo=!1,Yu=!0,Xi=!1,ef=!1,tf=!1,bo=!1,Ju=!1,Ku=!1,d1=!0,p1=!1;const y_="user-content-";let nf=!0,_l=!1,So={},kn=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 f1=null;const m1=Q({},["audio","video","img","source","image","track"]);let sf=null;const g1=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 w_=Q({},[Xu,Qu,or],e0);let eh=Q({},["mi","mo","mn","ms","mtext"]),th=Q({},["annotation-xml"]);const b_=Q({},["title","style","font","a","script"]);let Al=null;const S_=["application/xhtml+xml","text/html"],__="text/html";let De=null,Ao=null;const A_=t.createElement("form"),v1=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=In(b),Al=S_.indexOf(b.PARSER_MEDIA_TYPE)===-1?__:b.PARSER_MEDIA_TYPE,De=Al==="application/xhtml+xml"?e0:nd,He=Tt(b,"ALLOWED_TAGS")?Q({},b.ALLOWED_TAGS,De):a1,Be=Tt(b,"ALLOWED_ATTR")?Q({},b.ALLOWED_ATTR,De):l1,af=Tt(b,"ALLOWED_NAMESPACES")?Q({},b.ALLOWED_NAMESPACES,e0):w_,sf=Tt(b,"ADD_URI_SAFE_ATTR")?Q(In(g1),b.ADD_URI_SAFE_ATTR,De):g1,f1=Tt(b,"ADD_DATA_URI_TAGS")?Q(In(m1),b.ADD_DATA_URI_TAGS,De):m1,kn=Tt(b,"FORBID_CONTENTS")?Q({},b.FORBID_CONTENTS,De):rf,Sl=Tt(b,"FORBID_TAGS")?Q({},b.FORBID_TAGS,De):In({}),Gu=Tt(b,"FORBID_ATTR")?Q({},b.FORBID_ATTR,De):In({}),So=Tt(b,"USE_PROFILES")?b.USE_PROFILES:!1,c1=b.ALLOW_ARIA_ATTR!==!1,Qp=b.ALLOW_DATA_ATTR!==!1,u1=b.ALLOW_UNKNOWN_PROTOCOLS||!1,h1=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,d1=b.SANITIZE_DOM!==!1,p1=b.SANITIZE_NAMED_PROPS||!1,nf=b.KEEP_CONTENT!==!1,_l=b.IN_PLACE||!1,o1=b.ALLOWED_URI_REGEXP||fS,_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&&v1(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&v1(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({},kw),Be=td(null),So.html===!0&&(Q(He,Ew),Q(Be,Cw)),So.svg===!0&&(Q(He,n0),Q(Be,s0),Q(Be,wh)),So.svgFilters===!0&&(Q(He,r0),Q(Be,s0),Q(Be,wh)),So.mathMl===!0&&(Q(He,i0),Q(Be,Tw),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===a1&&(He=In(He)),Q(He,b.ADD_TAGS,De))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xr.attributeCheck=b.ADD_ATTR:(Be===l1&&(Be=In(Be)),Q(Be,b.ADD_ATTR,De))),b.ADD_URI_SAFE_ATTR&&Q(sf,b.ADD_URI_SAFE_ATTR,De),b.FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,b.FORBID_CONTENTS,De)),b.ADD_FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,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=W7(v,i)),O!==null&&typeof Y=="string"&&(Y=O.createHTML(""));ct&&ct(b),Ao=b}},y1=Q({},[...n0,...r0,...M7]),w1=Q({},[...i0,...O7]),E_=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]):!!y1[N]:b.namespaceURI===Xu?I.namespaceURI===or?N==="math":I.namespaceURI===Qu?N==="math"&&th[ye]:!!w1[N]:b.namespaceURI===or?I.namespaceURI===Qu&&!th[ye]||I.namespaceURI===Xu&&!eh[ye]?!1:!w1[N]&&(b_[N]||!y1[N]):!!(Al==="application/xhtml+xml"&&af[b.namespaceURI]):!1},Cn=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{Cn(I)}catch{}else try{I.setAttribute(b,"")}catch{}},b1=function(b){let I=null,N=null;if(tf)b="<remove></remove>"+b;else{const Re=t0(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},S1=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")},_1=function(b){return typeof l=="function"&&b instanceof l};function ar(F,b,I){yh(F,N=>{N.call(e,b,I,Ao)})}const A1=function(b){let I=null;if(ar(ve.beforeSanitizeElements,b,null),cf(b))return Cn(b),!0;const N=De(b.nodeName);if(ar(ve.uponSanitizeElement,b,{tagName:N,allowedTags:He}),Yu&&b.hasChildNodes()&&!_1(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 Cn(b),!0;if(!(Xr.tagCheck instanceof Function&&Xr.tagCheck(N))&&(!He[N]||Sl[N])){if(!Sl[N]&&k1(N)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N)))return!1;if(nf&&!kn[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 Cn(b),!0}return b instanceof c&&!E_(b)||(N==="noscript"||N==="noembed"||N==="noframes")&&Qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(Cn(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)},E1=function(b,I,N){if(Gu[I]||d1&&(I==="id"||I==="name")&&(N in t||N in A_))return!1;if(!(Qp&&!Gu[I]&&Qe(sr,I))){if(!(c1&&Qe(Zt,I))){if(!(Xr.attributeCheck instanceof Function&&Xr.attributeCheck(I,b))){if(!Be[I]||Gu[I]){if(!(k1(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(o1,xl(N,bl,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&x7(N,"data:")===0&&f1[b])){if(!(u1&&!Qe(wl,xl(N,bl,"")))){if(N)return!1}}}}}}}return!0},k1=function(b){return b!=="annotation-xml"&&t0(b,ju)},C1=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:P7(uf);if(N.attrName=Eo,N.attrValue=qe,N.keepAttr=!0,N.forceKeepAttr=void 0,ar(ve.uponSanitizeAttribute,b,N),qe=N.attrValue,p1&&(Eo==="id"||Eo==="name")&&(Qi(Re,b),qe=y_+qe),Yu&&Qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qe)){Qi(Re,b);continue}if(Eo==="attributename"&&t0(qe,"href")){Qi(Re,b);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){Qi(Re,b);continue}if(!h1&&Qe(/\/>/i,qe)){Qi(Re,b);continue}wo&&yh([Xe,Ze,le],$1=>{qe=xl(qe,$1," ")});const T1=De(b.nodeName);if(!E1(T1,Eo,qe)){Qi(Re,b);continue}if(O&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!dt)switch(v.getAttributeType(T1,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)?Cn(b):Aw(e.removed)}catch{Qi(Re,b)}}ar(ve.afterSanitizeAttributes,b,null)},k_=function F(b){let I=null;const N=S1(b);for(ar(ve.beforeSanitizeShadowDOM,b,null);I=N.nextNode();)ar(ve.uponSanitizeShadowNode,I,null),A1(I),C1(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"&&!_1(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=b1("<!---->"),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=b1(F),!I)return bo?null:Ku?Y:""}I&&tf&&Cn(I.firstChild);const Re=S1(_l?F:I);for(;ye=Re.nextNode();)A1(ye),C1(ye),ye.content instanceof o&&k_(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(mS,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 E1(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=R7(ve[F],b);return I===-1?void 0:I7(ve[F],I,1)[0]}return Aw(ve[F])},e.removeHooks=function(F){ve[F]=[]},e.removeAllHooks=function(){ve=Rw()},e}var vS=gS();function Wg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yo=Wg();function yS(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 j7=(()=>{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)}}>`)},G7=/^(?:[ \t]*(?:\n|$))+/,Y7=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,J7=/^ {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+|$)/,K7=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jg=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bS=ie(wS).replace(/bull/g,jg).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(),X7=ie(wS).replace(/bull/g,jg).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(),Gg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Q7=/^[^\n]+/,Yg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,eZ=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tZ=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jg).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]*?(?:-->|$))/,nZ=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(),SS=ie(Gg).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(),rZ=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",SS).getRegex(),Kg={blockquote:rZ,code:Y7,def:eZ,fences:J7,heading:K7,hr:Wu,html:nZ,lheading:bS,list:tZ,newline:G7,paragraph:SS,table:cs,text:Q7},Iw=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(),iZ={...Kg,lheading:X7,table:Iw,paragraph:ie(Gg).replace("hr",Wu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Iw).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()},sZ={...Kg,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(Gg).replace("hr",Wu).replace("heading",` *#{1,6} *[^
392
+ ]`).replace("lheading",bS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},oZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,aZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_S=/^( {2,}|\\)\n(?!\s*$)/,lZ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yl=/[\p{P}\p{S}]/u,Kp=/[\s\p{P}\p{S}]/u,Xg=/[^\s\p{P}\p{S}]/u,cZ=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),AS=/(?!~)[\p{P}\p{S}]/u,uZ=/(?!~)[\s\p{P}\p{S}]/u,hZ=/(?:[^\s\p{P}\p{S}]|~)/u,dZ=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",j7?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ES=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,pZ=ie(ES,"u").replace(/punct/g,yl).getRegex(),fZ=ie(ES,"u").replace(/punct/g,AS).getRegex(),kS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mZ=ie(kS,"gu").replace(/notPunctSpace/g,Xg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),gZ=ie(kS,"gu").replace(/notPunctSpace/g,hZ).replace(/punctSpace/g,uZ).replace(/punct/g,AS).getRegex(),vZ=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),yZ=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yl).getRegex(),wZ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bZ=ie(wZ,"gu").replace(/notPunctSpace/g,Xg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),SZ=ie(/\\(punct)/,"gu").replace(/punct/g,yl).getRegex(),_Z=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(),AZ=ie(Jg).replace("(?:-->|$)","-->").getRegex(),EZ=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",AZ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,kZ=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),CS=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",xd).replace("ref",Yg).getRegex(),TS=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yg).getRegex(),CZ=ie("reflink|nolink(?!\\()","g").replace("reflink",CS).replace("nolink",TS).getRegex(),xw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Qg={_backpedal:cs,anyPunctuation:SZ,autolink:_Z,blockSkip:dZ,br:_S,code:aZ,del:cs,delLDelim:cs,delRDelim:cs,emStrongLDelim:pZ,emStrongRDelimAst:mZ,emStrongRDelimUnd:vZ,escape:oZ,link:kZ,nolink:TS,punctuation:cZ,reflink:CS,reflinkSearch:CZ,tag:EZ,text:lZ,url:cs},TZ={...Qg,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},$m={...Qg,emStrongRDelimAst:gZ,emStrongLDelim:fZ,delLDelim:yZ,delRDelim:bZ,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xw).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",xw).getRegex()},$Z={...$m,br:ie(_S).replace("{2,}","*").getRegex(),text:ie($m.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bh={normal:Kg,gfm:iZ,pedantic:sZ},Ml={normal:Qg,gfm:$m,breaks:$Z,pedantic:TZ},RZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pw=n=>RZ[n];function xn(n,e){if(e){if(lt.escapeTest.test(n))return n.replace(lt.escapeReplace,Pw)}else if(lt.escapeTestNoEncode.test(n))return n.replace(lt.escapeReplaceNoEncode,Pw);return n}function Lw(n){try{n=encodeURI(n).replace(lt.percentDecode,"%")}catch{return null}return n}function Dw(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 IZ(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 xZ(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 Mw(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 PZ(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=RZ(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=PZ(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=$Z(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=xZ(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
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
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=TZ(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}}}},yn=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=Dw(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(Dw(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=IZ(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)),Mw(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 Mw(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}}}},yn=class Rm{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 Rm(t).lex(e)}static lexInline(e,t){return new Rm(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
  `)?"":`
@@ -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>${xn(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="'+xn(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 xn(t);n=i;let o=`<img src="${n}" alt="${xn(t)}"`;return e&&(o+=` title="${xn(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:xn(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}},wn=class $m{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 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?yn.lex:yn.lexInline}provideParser(){return this.block?wn.parse:wn.parseInline}},C(Eh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(Eh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Eh),IZ=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",wn);C(this,"Renderer",Ld);C(this,"TextRenderer",Xg);C(this,"Lexer",yn);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 yn.lex(n,e??this.defaults)}parser(n,e){return wn.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?yn.lex:yn.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?wn.parse:wn.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?yn.lex:yn.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?wn.parse:wn.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>"+xn(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},fo=new IZ;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=wn;he.parser=wn.parse;he.Renderer=Ld;he.TextRenderer=Xg;he.Lexer=yn;he.lexer=yn.lex;he.Tokenizer=Pd;he.Hooks=ec;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;wn.parse;yn.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,mn,Jd,kS,La,Kd;class xZ extends Nt{constructor(){super(...arguments);p(this,Jd);p(this,qs,null);p(this,du,bn());p(this,mn,null);p(this,La,()=>{this.render()});p(this,Kd,()=>{var t;(t=s(this,mn))==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,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,null)}template(t,r){var a,l;u(this,Jd,kS).call(this,r??null);const i=((a=s(this,mn))==null?void 0:a.version)??null,o=((l=s(this,mn))==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>${xn(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=Lw(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return e&&(o+=' title="'+xn(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=Lw(n);if(i===null)return xn(t);n=i;let o=`<img src="${n}" alt="${xn(t)}"`;return e&&(o+=` title="${xn(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:xn(n.text)}},e1=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}},wn=class Im{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 e1}static parse(e,t){return new Im(t).parse(e)}static parseInline(e,t){return new Im(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?yn.lex:yn.lexInline}provideParser(){return this.block?wn.parse:wn.parseInline}},C(Eh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(Eh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Eh),LZ=class{constructor(...n){C(this,"defaults",Wg());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",wn);C(this,"Renderer",Ld);C(this,"TextRenderer",e1);C(this,"Lexer",yn);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 yn.lex(n,e??this.defaults)}parser(n,e){return wn.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?yn.lex:yn.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?wn.parse:wn.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?yn.lex:yn.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?wn.parse:wn.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>"+xn(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},fo=new LZ;function he(n,e){return fo.parse(n,e)}he.options=he.setOptions=function(n){return fo.setOptions(n),he.defaults=fo.defaults,yS(he.defaults),he};he.getDefaults=Wg;he.defaults=yo;he.use=function(...n){return fo.use(...n),he.defaults=fo.defaults,yS(he.defaults),he};he.walkTokens=function(n,e){return fo.walkTokens(n,e)};he.parseInline=fo.parseInline;he.Parser=wn;he.parser=wn.parse;he.Renderer=Ld;he.TextRenderer=e1;he.Lexer=yn;he.lexer=yn.lex;he.Tokenizer=Pd;he.Hooks=ec;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;wn.parse;yn.lex;vS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function $S(n){const e=he.parse(n,{async:!1});return vS.sanitize(e,{USE_PROFILES:{html:!0}})}const Ow={restart_to_update:"Restart to update",restarting:"Restarting…"};var qs,du,mn,Jd,RS,La,Kd;class DZ extends Nt{constructor(){super(...arguments);p(this,Jd);p(this,qs,null);p(this,du,bn());p(this,mn,null);p(this,La,()=>{this.render()});p(this,Kd,()=>{var t;(t=s(this,mn))==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,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,null)}template(t,r){var a,l;u(this,Jd,RS).call(this,r??null);const i=((a=s(this,mn))==null?void 0:a.version)??null,o=((l=s(this,mn))==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(qb(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">${dS($S(Yb(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?Ow.restarting:Ow.restart_to_update}</button></div>`}`)}
457
457
  </div>
458
- `}}qs=new WeakMap,du=new WeakMap,mn=new WeakMap,Jd=new WeakSet,kS=function(t){var r;t!==s(this,mn)&&((r=s(this,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,t),t==null||t.addEventListener("change",s(this,La)),t==null||t.subscribe())},La=new WeakMap,Kd=new WeakMap;const PZ=zt(xZ),LZ=250,DZ=1e3;var Gn,Yn,Ws,$i,js,Da,En,CS,Xd,Qd,TS,Rm,$S;class MZ extends Nt{constructor(){super(...arguments);p(this,En);p(this,Gn,NZ());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,En,Rm).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,En,TS).call(this,t),t.kind==="needs-upgrade"?((o=s(this,Yn))==null||o.withdraw(),h(this,Yn,null),Fh(PZ(t.instructions,i),s(this,Gn)),s(this,Gn)):(Fh(Gp(u(this,En,CS).call(this,t)),s(this,Gn)),u(this,En,$S).call(this),s(this,Gn))}}Gn=new WeakMap,Yn=new WeakMap,Ws=new WeakMap,$i=new WeakMap,js=new WeakMap,Da=new WeakMap,En=new WeakSet,CS=function(t){switch(t.kind){case"connecting":return M`
458
+ `}}qs=new WeakMap,du=new WeakMap,mn=new WeakMap,Jd=new WeakSet,RS=function(t){var r;t!==s(this,mn)&&((r=s(this,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,t),t==null||t.addEventListener("change",s(this,La)),t==null||t.subscribe())},La=new WeakMap,Kd=new WeakMap;const MZ=zt(DZ),OZ=250,NZ=1e3;var Gn,Yn,Ws,$i,js,Da,En,IS,Xd,Qd,xS,xm,PS;class zZ extends Nt{constructor(){super(...arguments);p(this,En);p(this,Gn,HZ());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,En,xm).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,En,xS).call(this,t),t.kind==="needs-upgrade"?((o=s(this,Yn))==null||o.withdraw(),h(this,Yn,null),Fh(MZ(t.instructions,i),s(this,Gn)),s(this,Gn)):(Fh(Gp(u(this,En,IS).call(this,t)),s(this,Gn)),u(this,En,PS).call(this),s(this,Gn))}}Gn=new WeakMap,Yn=new WeakMap,Ws=new WeakMap,$i=new WeakMap,js=new WeakMap,Da=new WeakMap,En=new WeakSet,IS=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>${zZ(t.nextRetryAt)}</p>
467
+ <p>${UZ(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(),LZ)):r||u(this,En,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 OZ=zt(MZ);function NZ(){const n=document.createElement("section");return n.className="system-modal-host",n}function zZ(n){if(n===null)return"Reattempting now…";const e=n-Date.now();return e<=0?"Reattempting now…":`Reattempting in ${Math.ceil(e/DZ)}s…`}const ZZ=1400,Sh=new WeakMap;function HZ(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 UZ={writeClipboard:HZ,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function VZ(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=""))},ZZ),Sh.set(r,l),t()}function RS({label:n,prompt:e="",intent:t,copied:r=!1,onActivate:i=()=>{}},o=UZ){return M`
500
+ `}},Xd=new WeakMap,Qd=new WeakMap,xS=function(t){const r=t.kind==="disconnected"&&t.nextRetryAt!==null;r&&s(this,$i)===null?h(this,$i,setInterval(()=>this.render(),OZ)):r||u(this,En,xm).call(this)},xm=function(){s(this,$i)!==null&&(clearInterval(s(this,$i)),h(this,$i,null))},PS=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 ZZ=zt(zZ);function HZ(){const n=document.createElement("section");return n.className="system-modal-host",n}function UZ(n){if(n===null)return"Reattempting now…";const e=n-Date.now();return e<=0?"Reattempting now…":`Reattempting in ${Math.ceil(e/NZ)}s…`}const VZ=1400,Sh=new WeakMap;function FZ(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 BZ={writeClipboard:FZ,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function qZ(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=""))},VZ),Sh.set(r,l),t()}function LS({label:n,prompt:e="",intent:t,copied:r=!1,onActivate:i=()=>{}},o=BZ){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=>VZ(a,o,i)}
508
+ @click=${a=>qZ(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",FZ="tv-desktop-upgrade-recommendation-dismissed",BZ=`### Recommended desktop upgrade available
519
+ `}const DS="1.4.0",WZ="tv-desktop-upgrade-recommendation-dismissed",jZ=`### 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 qZ(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 Hg(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 WZ="tv-update-dismissed",Ro={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},jZ="update-popover";function GZ(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 YZ 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"||!GZ(_,E)||(_.preventDefault(),_.stopPropagation(),E.removeAttribute("open"))};return M`
529
+ From then on, open Television from Applications, not with \`tv-desktop\`.`;function GZ(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:$g(DS,n.shellVersion)}var Ma;class MS extends HTMLElement{constructor(){super(...arguments);p(this,Ma,new Vg(this))}connectedCallback(){s(this,Ma).connect()}disconnectedCallback(){s(this,Ma).disconnect()}attributeChangedCallback(){s(this,Ma).refresh()}}Ma=new WeakMap,C(MS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",MS);const YZ="tv-update-dismissed",Ro={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},JZ="update-popover";function KZ(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 XZ 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"||!KZ(_,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=${jZ}
543
+ id=${JZ}
544
544
  manual
545
545
  trigger="update-bell"
546
546
  role="status"
@@ -554,7 +554,7 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
554
554
  <button size="sm" class="update-later" @click=${y}
555
555
  >${Ro.later}</button
556
556
  >
557
- ${r===void 0?te:RS({label:Ro.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:f})}
557
+ ${r===void 0?te:LS({label:Ro.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:f})}
558
558
  ${o===void 0?te:M`<button
559
559
  size="sm"
560
560
  intent="primary"
@@ -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 JZ=zt(YZ);function KZ(n,e){return e===null?!0:Cg(n,e)}const Lw=new Set;var Gt,Pt,mu,Lt,gu,za,Jn,Gs,Ys,Js,Za,Ye,Lr,Ks,Ha,Ua,Xs,Ri,q,Im,xm,Pm,Lm,Dm,Mm,Om,Qs,eo,rd,tc,Nm,PS,zm,Zm,Hm,tp,np,rp,ip,sp,op,nc,LS;class XZ{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,Hm).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,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,Pm).call(this),h(this,Gt,e),u(this,q,xm).call(this)),r!==s(this,Pt)&&(u(this,q,Dm).call(this),h(this,Pt,r),u(this,q,Lm).call(this)),a!==s(this,Lt)&&(u(this,q,Om).call(this),h(this,Lt,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,Lm).call(this),u(this,q,Mm).call(this))}disconnect(){s(this,Jn)&&(u(this,q,Pm).call(this),u(this,q,Dm).call(this),u(this,q,Om).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,zm).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=JZ({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,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))},Lm=function(){!s(this,Jn)||s(this,Ys)||s(this,Pt)===null||(s(this,Pt).addEventListener("change",s(this,Qs)),h(this,Ys,!0))},Dm=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,Lt)===null||(s(this,Lt).addEventListener("change",s(this,Qs)),s(this,Lt).subscribe(),h(this,Js,!0))},Om=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:JO(i)};const o=s(this,mu);return o!==null&&qZ({...o,noticesSuppressed:e,updateState:t})?{kind:"recommendation",version:IS,markdown:BZ}:null},Nm=function(e){switch(e.kind){case"server":return WZ;case"desktop-self-update":return YO;case"recommendation":return FZ}},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:KZ(e.version,t!==null&&Op(t)?t:null)},zm=function(e){Lw.has(e.version)||(Lw.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,Hm).call(this)},Hm=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 QZ=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,eH=""+new URL("table-oeG9uAN1.png",import.meta.url).href,tH=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,nH=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,Dw="Artifact skills",rH="Artifact skills",iH="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",sH="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 QZ=zt(XZ);function eH(n,e){return e===null?!0:$g(n,e)}const Nw=new Set;var Gt,Pt,mu,Lt,gu,za,Jn,Gs,Ys,Js,Za,Ye,Lr,Ks,Ha,Ua,Xs,Ri,q,Pm,Lm,Dm,Mm,Om,Nm,zm,Qs,eo,rd,tc,Zm,OS,Hm,Um,Vm,tp,np,rp,ip,sp,op,nc,NS;class tH{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,Vm).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,Hm).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,Pm).call(this))==null||r.setItem(u(this,q,Zm).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,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,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,Dm).call(this),h(this,Gt,e),u(this,q,Lm).call(this)),r!==s(this,Pt)&&(u(this,q,Om).call(this),h(this,Pt,r),u(this,q,Mm).call(this)),a!==s(this,Lt)&&(u(this,q,zm).call(this),h(this,Lt,a),u(this,q,Nm).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,Lm).call(this),u(this,q,Mm).call(this),u(this,q,Nm).call(this))}disconnect(){s(this,Jn)&&(u(this,q,Dm).call(this),u(this,q,Om).call(this),u(this,q,zm).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,OS).call(this,t)),h(this,Lr,!0),s(this,Ye)&&t.kind==="server"&&!e&&u(this,q,Hm).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=QZ({body:dS($S(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,Pm=function(){return s(this,za)!==void 0?s(this,za):typeof localStorage>"u"?null:localStorage},Lm=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))},Dm=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))},Mm=function(){!s(this,Jn)||s(this,Ys)||s(this,Pt)===null||(s(this,Pt).addEventListener("change",s(this,Qs)),h(this,Ys,!0))},Om=function(){!s(this,Ys)||s(this,Pt)===null||(s(this,Pt).removeEventListener("change",s(this,Qs)),h(this,Ys,!1))},Nm=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))},zm=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:QO(i)};const o=s(this,mu);return o!==null&&GZ({...o,noticesSuppressed:e,updateState:t})?{kind:"recommendation",version:DS,markdown:jZ}:null},Zm=function(e){switch(e.kind){case"server":return YZ;case"desktop-self-update":return XO;case"recommendation":return WZ}},OS=function(e){var r;const t=((r=u(this,q,Pm).call(this))==null?void 0:r.getItem(u(this,q,Zm).call(this,e)))??null;return e.kind==="desktop-self-update"?t!==e.version:eH(e.version,t!==null&&Op(t)?t:null)},Hm=function(e){Nw.has(e.version)||(Nw.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,Vm).call(this)},Vm=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,NS).call(this)}))},NS=function(){const e=s(this,Ks);e!==null&&(s(this,Ye)&&s(this,Ha)===null||e.toggleAttribute("open",s(this,Ye)))};const nH=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,rH=""+new URL("table-oeG9uAN1.png",import.meta.url).href,iH=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,sH=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,zw="Artifact skills",oH="Artifact skills",aH="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",lH="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:sH,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
572
+ ${LS({label:lH,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
573
573
  </article>
574
- `}class oH extends Nt{template(e=null){return M`
574
+ `}class cH 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=${Dw}
581
- title=${Dw}
580
+ aria-label=${zw}
581
+ title=${zw}
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">${rH}</div>
592
- <p class="skill-intro">${iH}</p>
591
+ <div class="skill-heading">${oH}</div>
592
+ <p class="skill-intro">${aH}</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:QZ},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:eH},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:tH},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:nH},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:nH},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:rH},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:iH},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:sH},e)}
598
598
  </div>
599
599
  </tv-popover>
600
- `}}const aH=zt(oH),lH=600;let cH=0;const Mw=new WeakMap,i0=n=>{if(n.id)return n.id;let e=Mw.get(n);if(!e){do e=`tv-select-${++cH}`;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 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,Um,id,ni,sd,Vm,OS,od,NS;class MS extends HTMLElement{constructor(){super();p(this,W);p(this,it,new Hg(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,Um).call(this,t);r&&u(this,W,ni).call(this,r)},click:t=>{const r=u(this,W,Um).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"))},Um=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?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,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",i0(this));for(const c of t)i0(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,Vm).call(this,i,t)},Vm=function(t,r){if(s(this,Ii)||(h(this,Ii,new ResizeObserver(()=>{const c=s(this,it).trigger;c&&u(this,W,Vm).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)>lH?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);/**
600
+ `}}const uH=zt(cH),hH=600;let dH=0;const Zw=new WeakMap,o0=n=>{if(n.id)return n.id;let e=Zw.get(n);if(!e){do e=`tv-select-${++dH}`;while(n.ownerDocument.getElementById(e));Zw.set(n,e)}return n.id=e,e},Ah=n=>{var e;return((e=n.textContent)==null?void 0:e.trim())??""};var vu;class zS 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(zS,"observedAttributes",["selected"]);var it,Dr,Va,Ii,xi,yu,W,ti,Vo,Fm,id,ni,sd,Bm,HS,od,US;class ZS extends HTMLElement{constructor(){super();p(this,W);p(this,it,new Vg(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,US).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,Vo).call(this),unpair:t=>u(this,W,HS).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"))},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&&Zo(s(this,it).trigger,"aria-activedescendant",t?o0(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",o0(this));for(const c of t)o0(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,Bm).call(this,i,t)},Bm=function(t,r){if(s(this,Ii)||(h(this,Ii,new ResizeObserver(()=>{const c=s(this,it).trigger;c&&u(this,W,Bm).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))},HS=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}))},US=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)>hH?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(ZS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",zS);customElements.get("tv-select")||customElements.define("tv-select",ZS);/**
601
601
  * @license
602
602
  * Copyright 2020 Google LLC
603
603
  * SPDX-License-Identifier: BSD-3-Clause
604
- */const uH=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",hH="Themes directory",dH="None";function zw(n){return n instanceof Error?n.message:String(n)}var bt,to,Mr,Kn,wu,Or,Nr,no,Fa,Ba,Sn,zS,ap,lp,Fm,cp,up,hp,ad;class pH extends Nt{constructor(){super(...arguments);p(this,Sn);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,bn());p(this,Ba,bn());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,Sn,Fm).call(this,!1))};h(this,Nr,new MutationObserver(r)),s(this,Nr).observe(t,{attributes:!0,attributeFilter:["open"]}),r()});p(this,lp,()=>{u(this,Sn,Fm).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,Sn,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,Sn,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,Sn,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,Sn,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`
604
+ */const pH=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(!p6(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 f6(n),e}}),Hw="Settings",Uw="Refresh themes",fH="Themes directory",mH="None";function Vw(n){return n instanceof Error?n.message:String(n)}var bt,to,Mr,Kn,wu,Or,Nr,no,Fa,Ba,Sn,VS,ap,lp,qm,cp,up,hp,ad;class gH extends Nt{constructor(){super(...arguments);p(this,Sn);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,bn());p(this,Ba,bn());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,Sn,qm).call(this,!1))};h(this,Nr,new MutationObserver(r)),s(this,Nr).observe(t,{attributes:!0,attributeFilter:["open"]}),r()});p(this,lp,()=>{u(this,Sn,qm).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,Sn,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,Sn,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,Sn,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,Sn,VS).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=${Hw}
611
+ title=${Hw}
612
612
  >
613
613
  <tv-icon name="settings" size="sm"></tv-icon>
614
614
  </button>
@@ -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}>${dH}</tv-option>
649
+ <tv-option value="" ?selected=${i===null}>${mH}</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=${Uw}
662
+ title=${Uw}
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=${uH(f)}
683
+ .checked=${pH(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??hH}</strong>: ${v.error}</p>
696
+ <p><strong>${v.folder??fH}</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,Fa=new WeakMap,Ba=new WeakMap,Sn=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,Fm=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 fH=zt(pH),Nl={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},mH=(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,gn,Mi,ja,Oi,io,bu,Me,Hr,Ur,Yt,dp,D,ZS,HS,Su,_u,Au,pp,Eu,Fo,Bm,US,ld,qm,Wm,jm,VS,FS,Ga,ku,BS,ss,cd,qS,WS,jS,GS,Bo,YS,rc;class gH extends Nt{constructor(){super(...arguments);p(this,D);p(this,St,bn());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,gn,!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,jm).call(this,r))}u(this,D,Wm).call(this,r),u(this,D,Bm).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,gn,!0),u(this,D,ss).call(this,!1)});p(this,ku,()=>{h(this,gn,!0),u(this,D,ss).call(this,!0)})}connected(){var t;h(this,qa,void 0),h(this,Wa,void 0),h(this,gn,!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=yH(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,gn,!0),h(this,qa,g),h(this,Wa,y),u(this,D,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,Sn=new WeakSet,VS=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,qm=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"}: ${Vw(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}: ${Vw(i)}`),this.render()}};const vH=zt(gH),Nl={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},yH=(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,gn,Mi,ja,Oi,io,bu,Me,Hr,Ur,Yt,dp,D,FS,BS,Su,_u,Au,pp,Eu,Fo,Wm,qS,ld,jm,Gm,Ym,WS,jS,Ga,ku,GS,ss,cd,YS,JS,KS,XS,Bo,QS,rc;class wH extends Nt{constructor(){super(...arguments);p(this,D);p(this,St,bn());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,gn,!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)<=T6)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,Ym).call(this,r))}u(this,D,Gm).call(this,r),u(this,D,Wm).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,gn,!0),u(this,D,ss).call(this,!1)});p(this,ku,()=>{h(this,gn,!0),u(this,D,ss).call(this,!0)})}connected(){var t;h(this,qa,void 0),h(this,Wa,void 0),h(this,gn,!1),u(this,D,GS).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,QS).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=SH(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,gn,!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"
@@ -724,15 +724,15 @@ From then on, open Television from Applications, not with \`tv-desktop\`.`;funct
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,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?()=>wm(t,r,P.page,!P.page.geometry.full_screen):null}
727
+ @pointerdown=${f===null?j=>u(this,D,FS).call(this,j,t,r,P,o):null}
728
+ @click=${j=>u(this,D,BS).call(this,j,t,r,P)}
729
+ @dblclick=${O&&r!==null&&!U?()=>Sm(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,Zr,!1),u(this,D,Bo).call(this),h(this,Ur,!1),h(this,gn,!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,gn=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&&!wH(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,D,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,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,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,D,rc).call(this,i),u(this,D,Wm).call(this,t))}u(this,D,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,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,jm).call(this,t)),queueMicrotask(()=>u(this,D,FS).call(this,t,g)))},jm=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,gn,!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,gn)&&(h(this,gn,!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>Hz+Uz?"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,mH(t,{items:".tab:not(.dragged)",distance:Vz,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 vH=zt(gH);function yH(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 wH(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 bH=0;var so,_t,Cu,st,Vr,Qn,Ya,Fr,Tu,Jt,fp,mp,$u,il,JS,gp,vp,KS,yp,wp;class SH extends Nt{constructor(){super(...arguments);p(this,il);p(this,so,new XZ(()=>this.render()));p(this,_t,new E6(()=>this.render()));p(this,Cu,`channel-switcher-trigger-${++bH}`);p(this,st,null);p(this,Vr,null);p(this,Qn,!1);p(this,Ya,null);p(this,Fr,null);p(this,Tu,bn());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`
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,gn,!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,gn=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,FS=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}))},BS=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&&!_H(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()},Wm=function(t){const r=s(this,St).value,i=r?u(this,D,jm).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,qS).call(this,t,l)}))},qS=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,jm).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,Gm).call(this,t))}u(this,D,Wm).call(this,t)},ld=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},jm=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},Gm=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,WS).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,Ym).call(this,t)),queueMicrotask(()=>u(this,D,jS).call(this,t,g)))},Ym=function(t){return{channelId:t.channelId,pages:t.provisionalPages,carriedArtifactId:t.artifactId}},WS=function(t){return new Map([...t.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},jS=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,GS=function(){s(this,bu)||typeof document>"u"||!document.fonts||(h(this,bu,!0),document.fonts.ready.then(()=>{this.isConnected&&(h(this,gn,!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,gn)&&(h(this,gn,!1),u(this,D,JS).call(this,t)),u(this,D,KS).call(this,t),u(this,D,YS).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,XS).call(this,t,o),u(this,D,rc).call(this,t),(c=s(this,Oi))==null||c.refresh()},YS=function(t){for(const r of t.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},JS=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>Fz+Bz?"capped":"hugging";i.dataset.compression!==g&&(i.dataset.compression=g)}},KS=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,yH(t,{items:".tab:not(.dragged)",distance:qz,edges:"both"})))},XS=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:G6,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)},QS=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 bH=zt(wH);function SH(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 _H(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 AH=0;var so,_t,Cu,st,Vr,Qn,Ya,Fr,Tu,Jt,fp,mp,$u,il,e_,gp,vp,t_,yp,wp;class EH extends Nt{constructor(){super(...arguments);p(this,il);p(this,so,new tH(()=>this.render()));p(this,_t,new $6(()=>this.render()));p(this,Cu,`channel-switcher-trigger-${++AH}`);p(this,st,null);p(this,Vr,null);p(this,Qn,!1);p(this,Ya,null);p(this,Fr,null);p(this,Tu,bn());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,e_).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]")||b6(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,t_).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
- ${vH(t,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
798
+ ${bH(t,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
799
799
  <div class="top-bar-controls">
800
- ${aH((l=i.connectionOwner)==null?void 0:l.connection)}
801
- ${fH(t)}
800
+ ${uH((l=i.connectionOwner)==null?void 0:l.connection)}
801
+ ${vH(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,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 _H=zt(SH);var er,Ru,oo,Ja,ot,Dt,Kt,Xt,ao,me,vn,Ni,Ka,zi,Iu,bp,lo,Sp,_p,Ap,V,ud,Gm,XS,xu,Ep,ri,os,ic,hd,Ym,QS,e_,kp,Cp,Tp,Pu,$p,as,sc,t_;class AH 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,vn,!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,vn):!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=qz(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,vn))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,vn)):(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=v9(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,e_=function(t){var r;wc((r=s(this,st))==null?void 0:r.querySelectorAll('.channel[role="option"]')[t])},gp=new WeakMap,vp=new WeakMap,t_=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 kH=zt(EH);var er,Ru,oo,Ja,ot,Dt,Kt,Xt,ao,me,vn,Ni,Ka,zi,Iu,bp,lo,Sp,_p,Ap,V,ud,Jm,n_,xu,Ep,ri,os,ic,hd,Km,r_,i_,kp,Cp,Tp,Pu,$p,as,sc,s_;class CH 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,vn,!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}z_(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,vn):!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=Gz(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,vn))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,vn)):(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=b9(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,V,e_).call(this)}
813
+ style=${u(this,V,i_).call(this)}
814
814
  >
815
- ${kH(i)?u(this,V,t_).call(this,t,o,r):null}
816
- ${CH(i)?OZ(i,t,r.desktopUpdate):null}
815
+ ${$H(i)?u(this,V,s_).call(this,t,o,r):null}
816
+ ${RH(i)?ZZ(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,Dt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,ao=new WeakMap,me=new WeakMap,vn=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,vn)===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,vn,t),s(this,me)){u(this,V,ic).call(this),u(this,V,Gm).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,Gm).call(this))})},Gm=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,vn)?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,vn)),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 jz(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,vn):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,Ym).call(this,"expanded-paint"),u(this,V,Ym).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},Ym=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`
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,vn=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,vn)===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,vn,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,n_).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,vn)?0:s(this,ot);r.move({root:t,width:s(this,ot),target:i,onFrame:s(this,xu),onFinish:s(this,Ep)})},n_=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,vn)),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 Jz(s(this,Ni))),h(this,zi,null),u(this,V,r_).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,vn):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,Km).call(this,"expanded-paint"),u(this,V,Km).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},Km=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},r_=function(){const t=s(this,Xt);t!==null&&(t.style.removeProperty("left"),t.style.removeProperty("top"))},i_=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,Gb(r)),u(this,V,ri).call(this,s(this,Dt)),t.style.setProperty("--sidebar-width",`${s(this,ot)}px`)},s_=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
- ${Dz(t,r,i.electronMode,s(this,Sp),s(this,me)?null:a,s(this,me))}
822
+ ${Nz(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
- ${_H(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
- ${S7(t,r.focusedChannel,s(this,Ru),s(this,me))}
838
+ ${kH(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
+ ${E7(t,r.focusedChannel,s(this,Ru),s(this,me))}
840
840
  </main>
841
841
  ${s(this,me)?a:null}
842
- `};const EH=zt(AH);function kH(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function CH(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const n_="television-appearance-mode";function TH(n){return n==="system"||n==="light"||n==="dark"}function $H(){try{const n=window.localStorage.getItem(n_);return TH(n)?n:"system"}catch{return"system"}}function r_(){return window.__televisionAppearanceResolver??XO($H())}function RH(n,e){return e==="light"||e==="dark"?e:n}function IH(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 xH=WH(),_n=Br();_n?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const Qg=cP(),i_=uP(),PH=new l$(_n?"television-electron":"television-browser",a$()),LH=new OO(window.localStorage),DH=new DO(window.localStorage),Zw=Zb(),MH=Zw?vP({storage:Zw,clientApp:_n?"desktop":"browser",desktopAppVersion:_n?U8():null}):null,e1=Fi(_n?Qg:window.location.origin),t1=UO({search:window.location.search}),An=zg(),s_=new jO,n1=WO({detection:t1,primaryServerURL:e1,navigationLatch:An,presentation:s_}),Se=new AO({localStore:PH,serverURL:Qg,launchToken:i_,telemetryMeta:MH,navigationPending:()=>An.pending,...t1.electron?{decideBoot:n=>n1.decideBoot(n)}:{}}),OH=n=>{JT(Ke,n)},Ke=new HT({connectionOwner:Se,navigationKeyHandler:OH,retainedGateHalted:()=>n1.gated}),ps=globalThis.__televisionNativeBridge;_n&&ps&&ps.onNavigationKey(n=>Ke.handleNavigationKey(n));const NH=new KO({electron:_n,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}`)}HO({owner:Se,primaryServerURL:e1,navigationLatch:An});n1.attach(Se);const zH=()=>{const n=Se.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));PO(t)}).catch(()=>{})},o_=()=>{Se.connection.status==="connected"&&Gz(Se.connection.url)};let Dd=null,Jm=null,a_=Se.connection.status;const ZH=()=>{An.pending||An.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(An.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=Kz(),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)){ZH();return}if(o===null&&c){lw(Se.connection.url);return}o!==null&&c&&t&&!a&&f&&lw(Se.connection.url)},HH=()=>{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(An.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const t={activeThemeName:n,serverURL:Se.connection.url,appearance:HH()},r=Jm;Jm=t,!(!e&&(r==null?void 0:r.activeThemeName)===t.activeThemeName&&r.serverURL===t.serverURL&&r.appearance===t.appearance)&&Xz(t.serverURL,t.activeThemeName,()=>Ke.listThemes())},u_=()=>{if(!An.pending){if(a_=Se.connection.status,Se.connection.status!=="connected"){Yz(),Jz(),Qz(),Dd=null,Jm=null;return}o_(),zH()}};let Km,Xm;const r1=(n,e)=>{const t=RH(n,e);t!==Km&&(IH(t),Km=t),t!==Xm&&_n&&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)))},UH=n=>{if(An.pending)return;r1(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),!(An.pending||t)&&(o_(),c_(n.themeName,!0))},VH=n=>{An.pending||r1(n.appearanceMode,Ke.snapshot.display.activeThemeColorScheme)};u_();Xp();Se.addEventListener("change",u_);Ke.addEventListener("change",Xp);Ke.addEventListener("theme-changed",UH);Ke.addEventListener("appearance-changed",VH);const FH=new MutationObserver(()=>{Xp()});FH.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 BH=hc.renderCompleteCallbacks??(hc.renderCompleteCallbacks=new Set);_n&&document.body.classList.add("electron");let Hw=!1,Uw=!1;const qH=n=>{if(!xH||Uw||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const e=document.querySelector("#settings-popover");e!==null&&(Uw=!0,e.setAttribute("open",""))},h_=()=>{Hw||(Fh(EH(Ke,{runtimeServerURL:Qg,electronMode:_n,connectionOwner:Se,primaryServerURL:e1,updatePresentation:s_,desktopRecommendation:t1,desktopUpdate:NH,sidebarWidthPreference:LH,sidebarCollapsedPreference:DH,onRenderComplete(n){qH(n);for(const e of BH)e(n)}}),document.body),Hw=!0,Xp())},d_=()=>{const n=Se.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Se.connectError===null||(Se.removeEventListener("change",d_),h_())};_n?Se.addEventListener("change",d_):h_();Se.connect();function WH(){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 TH=zt(CH);function $H(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function RH(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const o_="television-appearance-mode";function IH(n){return n==="system"||n==="light"||n==="dark"}function xH(){try{const n=window.localStorage.getItem(o_);return IH(n)?n:"system"}catch{return"system"}}function a_(){return window.__televisionAppearanceResolver??t9(xH())}function PH(n,e){return e==="light"||e==="dark"?e:n}function LH(n){a_().setPreference(n);try{window.localStorage.setItem(o_,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Zg();Object.defineProperty(window,"__tvVersion",{value:Zg(),writable:!1,configurable:!1});a_();const DH=YH(),_n=Br();_n?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const t1=dP(),l_=pP(),MH=new h$(_n?"television-electron":"television-browser",u$()),OH=new ZO(window.localStorage),NH=new NO(window.localStorage),Fw=Fb(),zH=Fw?bP({storage:Fw,clientApp:_n?"desktop":"browser",desktopAppVersion:_n?q8():null}):null,n1=Fi(_n?t1:window.location.origin),r1=BO({search:window.location.search}),An=Hg(),c_=new JO,i1=YO({detection:r1,primaryServerURL:n1,navigationLatch:An,presentation:c_}),Se=new CO({localStore:MH,serverURL:t1,launchToken:l_,telemetryMeta:zH,navigationPending:()=>An.pending,...r1.electron?{decideBoot:n=>i1.decideBoot(n)}:{}}),ZH=n=>{QT(Ke,n)},Ke=new FT({connectionOwner:Se,navigationKeyHandler:ZH,retainedGateHalted:()=>i1.gated}),ps=globalThis.__televisionNativeBridge;_n&&ps&&ps.onNavigationKey(n=>Ke.handleNavigationKey(n));const HH=new e9({electron:_n,bridge:ps});if(l_){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}FO({owner:Se,primaryServerURL:n1,navigationLatch:An});i1.attach(Se);const UH=()=>{const n=Se.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));MO(t)}).catch(()=>{})},u_=()=>{Se.connection.status==="connected"&&Kz(Se.connection.url)};let Dd=null,Xm=null,h_=Se.connection.status;const VH=()=>{An.pending||An.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()})},d_=(n,e,t)=>{if(An.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=e7(),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&&v_(i.consentIds,r.consentIds);if(Dd=r,o!==null&&(a||d)){VH();return}if(o===null&&c){dw(Se.connection.url);return}o!==null&&c&&t&&!a&&f&&dw(Se.connection.url)},FH=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},p_=(n,e)=>{if(An.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const t={activeThemeName:n,serverURL:Se.connection.url,appearance:FH()},r=Xm;Xm=t,!(!e&&(r==null?void 0:r.activeThemeName)===t.activeThemeName&&r.serverURL===t.serverURL&&r.appearance===t.appearance)&&t7(t.serverURL,t.activeThemeName,()=>Ke.listThemes())},f_=()=>{if(!An.pending){if(h_=Se.connection.status,Se.connection.status!=="connected"){Xz(),Qz(),n7(),Dd=null,Xm=null;return}u_(),UH()}};let Qm,eg;const s1=(n,e)=>{const t=PH(n,e);t!==Qm&&(LH(t),Qm=t),t!==eg&&_n&&typeof(ps==null?void 0:ps.setAppearanceMode)=="function"&&(ps.setAppearanceMode(t),eg=t)},Xp=()=>{const n=Ke.snapshot;if(n.connection.status!=="connected"){Qm=void 0,eg=void 0;return}n.ready&&(s1(n.display.appearanceMode,n.display.activeThemeColorScheme),h_===Se.connection.status&&(d_(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),p_(n.display.activeThemeName,!1)))},BH=n=>{if(An.pending)return;s1(Ke.snapshot.display.appearanceMode,n.activeThemeColorScheme);const e=Dd,t=e!==null&&e.activeThemeName===n.themeName&&!v_(e.consentIds,new Set(n.themeJavaScriptConsentIds));d_(n.themeName,n.themeJavaScriptConsentIds,!0),!(An.pending||t)&&(u_(),p_(n.themeName,!0))},qH=n=>{An.pending||s1(n.appearanceMode,Ke.snapshot.display.activeThemeColorScheme)};f_();Xp();Se.addEventListener("change",f_);Ke.addEventListener("change",Xp);Ke.addEventListener("theme-changed",BH);Ke.addEventListener("appearance-changed",qH);const WH=new MutationObserver(()=>{Xp()});WH.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});q2.register("ServerConnectionOwner",()=>Se);q2.register("ApplicationService",()=>Ke);const hc=globalThis.__telepath??(globalThis.__telepath={});hc.applicationService=Ke;hc.connectionOwner=Se;const jH=hc.renderCompleteCallbacks??(hc.renderCompleteCallbacks=new Set);_n&&document.body.classList.add("electron");let Bw=!1,qw=!1;const GH=n=>{if(!DH||qw||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const e=document.querySelector("#settings-popover");e!==null&&(qw=!0,e.setAttribute("open",""))},m_=()=>{Bw||(Fh(TH(Ke,{runtimeServerURL:t1,electronMode:_n,connectionOwner:Se,primaryServerURL:n1,updatePresentation:c_,desktopRecommendation:r1,desktopUpdate:HH,sidebarWidthPreference:OH,sidebarCollapsedPreference:NH,onRenderComplete(n){GH(n);for(const e of jH)e(n)}}),document.body),Bw=!0,Xp())},g_=()=>{const n=Se.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Se.connectError===null||(Se.removeEventListener("change",g_),m_())};_n?Se.addEventListener("change",g_):m_();Se.connect();function YH(){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 v_(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}