const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatPage-AitDGZKH.js","assets/chat-BVoaeFpp.js","assets/ChatWindow.vue_vue_type_script_setup_true_lang-zPFvWywX.js","assets/useNostr-XONW-p_l.js","assets/ChatWindow-CHiy55Bk.css","assets/FilmGrid.vue_vue_type_script_setup_true_lang-Dj0SEfcW.js","assets/useContentImages-7wLVntsF.js","assets/SongGrid.vue_vue_type_script_setup_true_lang-IvAOIQYW.js","assets/FilmDetail.vue_vue_type_script_setup_true_lang-BhKlPG3Y.js","assets/SongDetail.vue_vue_type_script_setup_true_lang-B3om3Z8v.js","assets/ChatPage-B49DA8RU.css","assets/GuidePage-DncbNAAY.js","assets/GuidePage-CXT-xcyj.css","assets/WidgetDemoPage-Mol6efr5.js","assets/WidgetDemoPage-BSWX2CxO.css","assets/ConversationViewerPage-PTutY4Lq.js"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();const np="modulepreload",sp=function(e){return"/aiui/"+e},ac={},wn=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=sp(c),c in ac)return;ac[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":np,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,b)=>{f.addEventListener("load",h),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return t().catch(r)})};function xl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $e={},Ks=[],kn=()=>{},vf=()=>!1,Eo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Tl=e=>e.startsWith("onUpdate:"),lt=Object.assign,Al=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ip=Object.prototype.hasOwnProperty,Re=(e,t)=>ip.call(e,t),oe=Array.isArray,Gs=e=>gr(e)==="[object Map]",oi=e=>gr(e)==="[object Set]",lc=e=>gr(e)==="[object Date]",he=e=>typeof e=="function",Ye=e=>typeof e=="string",on=e=>typeof e=="symbol",Pe=e=>e!==null&&typeof e=="object",wf=e=>(Pe(e)||he(e))&&he(e.then)&&he(e.catch),_f=Object.prototype.toString,gr=e=>_f.call(e),rp=e=>gr(e).slice(8,-1),kf=e=>gr(e)==="[object Object]",So=e=>Ye(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ji=xl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Co=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},op=/-\w/g,Xt=Co(e=>e.replace(op,t=>t.slice(1).toUpperCase())),ap=/\B([A-Z])/g,ps=Co(e=>e.replace(ap,"-$1").toLowerCase()),Po=Co(e=>e.charAt(0).toUpperCase()+e.slice(1)),ea=Co(e=>e?`on${Po(e)}`:""),cs=(e,t)=>!Object.is(e,t),Kr=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Io=e=>{const t=parseFloat(e);return isNaN(t)?e:t},lp=e=>{const t=Ye(e)?Number(e):NaN;return isNaN(t)?e:t};let cc;const Ro=()=>cc||(cc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function us(e){if(oe(e)){const t={};for(let n=0;n{if(n){const s=n.split(up);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function st(e){let t="";if(Ye(e))t=e;else if(oe(e))for(let n=0;nai(n,t))}const Af=e=>!!(e&&e.__v_isRef===!0),dt=e=>Ye(e)?e:e==null?"":oe(e)||Pe(e)&&(e.toString===_f||!he(e.toString))?Af(e)?dt(e.value):JSON.stringify(e,Ef,2):String(e),Ef=(e,t)=>Af(t)?Ef(e,t.value):Gs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,i],r)=>(n[ta(s,r)+" =>"]=i,n),{})}:oi(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ta(n))}:on(t)?ta(t):Pe(t)&&!oe(t)&&!kf(t)?String(t):t,ta=(e,t="")=>{var n;return on(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let wt;class Sf{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=wt,!t&&wt&&(this.index=(wt.scopes||(wt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(wt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(zi){let t=zi;for(zi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Hi;){let t=Hi;for(Hi=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Nf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Mf(e){let t,n=e.depsTail,s=n;for(;s;){const i=s.prevDep;s.version===-1?(s===n&&(n=i),Pl(s),yp(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=i}e.deps=t,e.depsTail=n}function Ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Of(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Of(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Qi)||(e.globalVersion=Qi,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ka(e))))return;e.flags|=2;const t=e.dep,n=De,s=rn;De=e,rn=!0;try{Nf(e);const i=e.fn(e._value);(t.version===0||cs(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{De=n,rn=s,Mf(e),e.flags&=-3}}function Pl(e,t=!1){const{dep:n,prevSub:s,nextSub:i}=e;if(s&&(s.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Pl(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yp(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let rn=!0;const $f=[];function Bn(){$f.push(rn),rn=!1}function jn(){const e=$f.pop();rn=e===void 0?!0:e}function uc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=De;De=void 0;try{t()}finally{De=n}}}let Qi=0;class bp{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Il{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!De||!rn||De===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==De)n=this.activeLink=new bp(De,this),De.deps?(n.prevDep=De.depsTail,De.depsTail.nextDep=n,De.depsTail=n):De.deps=De.depsTail=n,Df(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=De.depsTail,n.nextDep=void 0,De.depsTail.nextDep=n,De.depsTail=n,De.deps===n&&(De.deps=s)}return n}trigger(t){this.version++,Qi++,this.notify(t)}notify(t){Sl();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Cl()}}}function Df(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Df(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const lo=new WeakMap,Ps=Symbol(""),Ga=Symbol(""),er=Symbol("");function _t(e,t,n){if(rn&&De){let s=lo.get(e);s||lo.set(e,s=new Map);let i=s.get(n);i||(s.set(n,i=new Il),i.map=s,i.key=n),i.track()}}function On(e,t,n,s,i,r){const o=lo.get(e);if(!o){Qi++;return}const a=l=>{l&&l.trigger()};if(Sl(),t==="clear")o.forEach(a);else{const l=oe(e),c=l&&So(n);if(l&&n==="length"){const u=Number(s);o.forEach((d,f)=>{(f==="length"||f===er||!on(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(er)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Ps)),Gs(e)&&a(o.get(Ga)));break;case"delete":l||(a(o.get(Ps)),Gs(e)&&a(o.get(Ga)));break;case"set":Gs(e)&&a(o.get(Ps));break}}Cl()}function vp(e,t){const n=lo.get(e);return n&&n.get(t)}function Ds(e){const t=Ee(e);return t===e?t:(_t(t,"iterate",er),Wt(e)?t:t.map(an))}function Lo(e){return _t(e=Ee(e),"iterate",er),e}function ns(e,t){return Hn(e)?Js(Fn(e)?an(t):t):an(t)}const wp={__proto__:null,[Symbol.iterator](){return sa(this,Symbol.iterator,e=>ns(this,e))},concat(...e){return Ds(this).concat(...e.map(t=>oe(t)?Ds(t):t))},entries(){return sa(this,"entries",e=>(e[1]=ns(this,e[1]),e))},every(e,t){return Sn(this,"every",e,t,void 0,arguments)},filter(e,t){return Sn(this,"filter",e,t,n=>n.map(s=>ns(this,s)),arguments)},find(e,t){return Sn(this,"find",e,t,n=>ns(this,n),arguments)},findIndex(e,t){return Sn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Sn(this,"findLast",e,t,n=>ns(this,n),arguments)},findLastIndex(e,t){return Sn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Sn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ia(this,"includes",e)},indexOf(...e){return ia(this,"indexOf",e)},join(e){return Ds(this).join(e)},lastIndexOf(...e){return ia(this,"lastIndexOf",e)},map(e,t){return Sn(this,"map",e,t,void 0,arguments)},pop(){return di(this,"pop")},push(...e){return di(this,"push",e)},reduce(e,...t){return fc(this,"reduce",e,t)},reduceRight(e,...t){return fc(this,"reduceRight",e,t)},shift(){return di(this,"shift")},some(e,t){return Sn(this,"some",e,t,void 0,arguments)},splice(...e){return di(this,"splice",e)},toReversed(){return Ds(this).toReversed()},toSorted(e){return Ds(this).toSorted(e)},toSpliced(...e){return Ds(this).toSpliced(...e)},unshift(...e){return di(this,"unshift",e)},values(){return sa(this,"values",e=>ns(this,e))}};function sa(e,t,n){const s=Lo(e),i=s[t]();return s!==e&&!Wt(e)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=n(r.value)),r}),i}const _p=Array.prototype;function Sn(e,t,n,s,i,r){const o=Lo(e),a=o!==e&&!Wt(e),l=o[t];if(l!==_p[t]){const d=l.apply(e,r);return a?an(d):d}let c=n;o!==e&&(a?c=function(d,f){return n.call(this,ns(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=l.call(o,c,s);return a&&i?i(u):u}function fc(e,t,n,s){const i=Lo(e);let r=n;return i!==e&&(Wt(e)?n.length>3&&(r=function(o,a,l){return n.call(this,o,a,l,e)}):r=function(o,a,l){return n.call(this,o,ns(e,a),l,e)}),i[t](r,...s)}function ia(e,t,n){const s=Ee(e);_t(s,"iterate",er);const i=s[t](...n);return(i===-1||i===!1)&&No(n[0])?(n[0]=Ee(n[0]),s[t](...n)):i}function di(e,t,n=[]){Bn(),Sl();const s=Ee(e)[t].apply(e,n);return Cl(),jn(),s}const kp=xl("__proto__,__v_isRef,__isVue"),Ff=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(on));function xp(e){on(e)||(e=String(e));const t=Ee(this);return _t(t,"has",e),t.hasOwnProperty(e)}class Uf{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(i?r?Np:zf:r?Hf:jf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=oe(t);if(!i){let l;if(o&&(l=wp[n]))return l;if(n==="hasOwnProperty")return xp}const a=Reflect.get(t,n,qe(t)?t:s);if((on(n)?Ff.has(n):kp(n))||(i||_t(t,"get",n),r))return a;if(qe(a)){const l=o&&So(n)?a:a.value;return i&&Pe(l)?Ht(l):l}return Pe(a)?i?Ht(a):yr(a):a}}class Bf extends Uf{constructor(t=!1){super(!1,t)}set(t,n,s,i){let r=t[n];const o=oe(t)&&So(n);if(!this._isShallow){const c=Hn(r);if(!Wt(s)&&!Hn(s)&&(r=Ee(r),s=Ee(s)),!o&&qe(r)&&!qe(s))return c||(r.value=s),!0}const a=o?Number(n)e,Cr=e=>Reflect.getPrototypeOf(e);function Cp(e,t,n){return function(...s){const i=this.__v_raw,r=Ee(i),o=Gs(r),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=i[e](...s),u=n?Ya:t?Js:an;return!t&&_t(r,"iterate",l?Ga:Ps),lt(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Pr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Pp(e,t){const n={get(i){const r=this.__v_raw,o=Ee(r),a=Ee(i);e||(cs(i,a)&&_t(o,"get",i),_t(o,"get",a));const{has:l}=Cr(o),c=t?Ya:e?Js:an;if(l.call(o,i))return c(r.get(i));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!e&&_t(Ee(i),"iterate",Ps),i.size},has(i){const r=this.__v_raw,o=Ee(r),a=Ee(i);return e||(cs(i,a)&&_t(o,"has",i),_t(o,"has",a)),i===a?r.has(i):r.has(i)||r.has(a)},forEach(i,r){const o=this,a=o.__v_raw,l=Ee(a),c=t?Ya:e?Js:an;return!e&&_t(l,"iterate",Ps),a.forEach((u,d)=>i.call(r,c(u),c(d),o))}};return lt(n,e?{add:Pr("add"),set:Pr("set"),delete:Pr("delete"),clear:Pr("clear")}:{add(i){!t&&!Wt(i)&&!Hn(i)&&(i=Ee(i));const r=Ee(this);return Cr(r).has.call(r,i)||(r.add(i),On(r,"add",i,i)),this},set(i,r){!t&&!Wt(r)&&!Hn(r)&&(r=Ee(r));const o=Ee(this),{has:a,get:l}=Cr(o);let c=a.call(o,i);c||(i=Ee(i),c=a.call(o,i));const u=l.call(o,i);return o.set(i,r),c?cs(r,u)&&On(o,"set",i,r):On(o,"add",i,r),this},delete(i){const r=Ee(this),{has:o,get:a}=Cr(r);let l=o.call(r,i);l||(i=Ee(i),l=o.call(r,i)),a&&a.call(r,i);const c=r.delete(i);return l&&On(r,"delete",i,void 0),c},clear(){const i=Ee(this),r=i.size!==0,o=i.clear();return r&&On(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Cp(i,e,t)}),n}function Rl(e,t){const n=Pp(e,t);return(s,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(Re(n,i)&&i in s?n:s,i,r)}const Ip={get:Rl(!1,!1)},Rp={get:Rl(!1,!0)},Lp={get:Rl(!0,!1)};const jf=new WeakMap,Hf=new WeakMap,zf=new WeakMap,Np=new WeakMap;function Mp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Op(e){return e.__v_skip||!Object.isExtensible(e)?0:Mp(rp(e))}function yr(e){return Hn(e)?e:Ll(e,!1,Ap,Ip,jf)}function Vf(e){return Ll(e,!1,Sp,Rp,Hf)}function Ht(e){return Ll(e,!0,Ep,Lp,zf)}function Ll(e,t,n,s,i){if(!Pe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Op(e);if(r===0)return e;const o=i.get(e);if(o)return o;const a=new Proxy(e,r===2?s:n);return i.set(e,a),a}function Fn(e){return Hn(e)?Fn(e.__v_raw):!!(e&&e.__v_isReactive)}function Hn(e){return!!(e&&e.__v_isReadonly)}function Wt(e){return!!(e&&e.__v_isShallow)}function No(e){return e?!!e.__v_raw:!1}function Ee(e){const t=e&&e.__v_raw;return t?Ee(t):e}function Nl(e){return!Re(e,"__v_skip")&&Object.isExtensible(e)&&xf(e,"__v_skip",!0),e}const an=e=>Pe(e)?yr(e):e,Js=e=>Pe(e)?Ht(e):e;function qe(e){return e?e.__v_isRef===!0:!1}function F(e){return qf(e,!1)}function Wf(e){return qf(e,!0)}function qf(e,t){return qe(e)?e:new $p(e,t)}class $p{constructor(t,n){this.dep=new Il,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ee(t),this._value=n?t:an(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Wt(t)||Hn(t);t=s?t:Ee(t),cs(t,n)&&(this._rawValue=t,this._value=s?t:an(t),this.dep.trigger())}}function B_(e){e.dep&&e.dep.trigger()}function G(e){return qe(e)?e.value:e}const Dp={get:(e,t,n)=>t==="__v_raw"?e:G(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return qe(i)&&!qe(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};function Kf(e){return Fn(e)?e:new Proxy(e,Dp)}function Fp(e){const t=oe(e)?new Array(e.length):{};for(const n in e)t[n]=Gf(e,n);return t}class Up{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=Ee(t);let i=!0,r=t;if(!oe(t)||!So(String(n)))do i=!No(r)||Wt(r);while(i&&(r=r.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=G(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&qe(this._raw[this._key])){const n=this._object[this._key];if(qe(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return vp(this._raw,this._key)}}class Bp{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function j_(e,t,n){return qe(e)?e:he(e)?new Bp(e):Pe(e)&&arguments.length>1?Gf(e,t,n):F(e)}function Gf(e,t,n){return new Up(e,t,n)}class jp{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Il(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&De!==this)return Lf(this,!0),!0}get value(){const t=this.dep.track();return Of(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hp(e,t,n=!1){let s,i;return he(e)?s=e:(s=e.get,i=e.set),new jp(s,i,n)}const Ir={},co=new WeakMap;let Ts;function zp(e,t=!1,n=Ts){if(n){let s=co.get(n);s||co.set(n,s=[]),s.push(e)}}function Vp(e,t,n=$e){const{immediate:s,deep:i,once:r,scheduler:o,augmentJob:a,call:l}=n,c=w=>i?w:Wt(w)||i===!1||i===0?$n(w,1):$n(w);let u,d,f,h,b=!1,g=!1;if(qe(e)?(d=()=>e.value,b=Wt(e)):Fn(e)?(d=()=>c(e),b=!0):oe(e)?(g=!0,b=e.some(w=>Fn(w)||Wt(w)),d=()=>e.map(w=>{if(qe(w))return w.value;if(Fn(w))return c(w);if(he(w))return l?l(w,2):w()})):he(e)?t?d=l?()=>l(e,2):e:d=()=>{if(f){Bn();try{f()}finally{jn()}}const w=Ts;Ts=u;try{return l?l(e,3,[h]):e(h)}finally{Ts=w}}:d=kn,t&&i){const w=d,C=i===!0?1/0:i;d=()=>$n(w(),C)}const E=Pf(),x=()=>{u.stop(),E&&E.active&&Al(E.effects,u)};if(r&&t){const w=t;t=(...C)=>{w(...C),x()}}let y=g?new Array(e.length).fill(Ir):Ir;const k=w=>{if(!(!(u.flags&1)||!u.dirty&&!w))if(t){const C=u.run();if(i||b||(g?C.some((N,q)=>cs(N,y[q])):cs(C,y))){f&&f();const N=Ts;Ts=u;try{const q=[C,y===Ir?void 0:g&&y[0]===Ir?[]:y,h];y=C,l?l(t,3,q):t(...q)}finally{Ts=N}}}else u.run()};return a&&a(k),u=new If(d),u.scheduler=o?()=>o(k,!1):k,h=w=>zp(w,!1,u),f=u.onStop=()=>{const w=co.get(u);if(w){if(l)l(w,4);else for(const C of w)C();co.delete(u)}},t?s?k(!0):y=u.run():o?o(k.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function $n(e,t=1/0,n){if(t<=0||!Pe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qe(e))$n(e.value,t,n);else if(oe(e))for(let s=0;s{$n(s,t,n)});else if(kf(e)){for(const s in e)$n(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&$n(e[s],t,n)}return e}function br(e,t,n,s){try{return s?e(...s):e()}catch(i){vr(i,t,n)}}function ln(e,t,n,s){if(he(e)){const i=br(e,t,n,s);return i&&wf(i)&&i.catch(r=>{vr(r,t,n)}),i}if(oe(e)){const i=[];for(let r=0;r>>1,i=Lt[s],r=tr(i);r=tr(n)?Lt.push(e):Lt.splice(qp(t),0,e),e.flags|=1,Xf()}}function Xf(){uo||(uo=Yf.then(Jf))}function Kp(e){oe(e)?Ys.push(...e):ss&&e.id===-1?ss.splice(Vs+1,0,e):e.flags&1||(Ys.push(e),e.flags|=1),Xf()}function dc(e,t,n=gn+1){for(;ntr(n)-tr(s));if(Ys.length=0,ss){ss.push(...t);return}for(ss=t,Vs=0;Vse.id==null?e.flags&2?-1:1/0:e.id;function Jf(e){try{for(gn=0;gn{s._d&&mo(-1);const r=fo(t);let o;try{o=e(...i)}finally{fo(r),s._d&&mo(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function hc(e,t){if(yt===null)return e;const n=Uo(yt),s=e.dirs||(e.dirs=[]);for(let i=0;i1)return n&&he(t)?t.call(s&&s.proxy):t}}function Gp(){return!!(jl()||Is)}const Yp=Symbol.for("v-scx"),Xp=()=>Gt(Yp);function Yt(e,t,n){return ed(e,t,n)}function ed(e,t,n=$e){const{immediate:s,deep:i,flush:r,once:o}=n,a=lt({},n),l=t&&s||!t&&r!=="post";let c;if(Qs){if(r==="sync"){const h=Xp();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=kn,h.resume=kn,h.pause=kn,h}}const u=gt;a.call=(h,b,g)=>ln(h,u,b,g);let d=!1;r==="post"?a.scheduler=h=>{vt(h,u&&u.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(h,b)=>{b?h():Ml(h)}),a.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=Vp(e,t,a);return Qs&&(c?c.push(f):l&&f()),f}function Zp(e,t,n){const s=this.proxy,i=Ye(e)?e.includes(".")?td(s,e):()=>s[e]:e.bind(s,s);let r;he(t)?r=t:(r=t.handler,n=t);const o=_r(this),a=ed(i,r.bind(s),n);return o(),a}function td(e,t){const n=t.split(".");return()=>{let s=e;for(let i=0;ie.__isTeleport,Vi=e=>e&&(e.disabled||e.disabled===""),pc=e=>e&&(e.defer||e.defer===""),mc=e=>typeof SVGElement<"u"&&e instanceof SVGElement,gc=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Xa=(e,t)=>{const n=e&&e.to;return Ye(n)?t?t(n):null:n},id={name:"Teleport",__isTeleport:!0,process(e,t,n,s,i,r,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:b,createText:g,createComment:E}}=c,x=Vi(t.props);let{shapeFlag:y,children:k,dynamicChildren:w}=t;if(e==null){const C=t.el=g(""),N=t.anchor=g("");h(C,n,s),h(N,n,s);const q=(M,O)=>{y&16&&u(k,M,O,i,r,o,a,l)},U=()=>{const M=t.target=Xa(t.props,b),O=Za(M,t,g,h);M&&(o!=="svg"&&mc(M)?o="svg":o!=="mathml"&&gc(M)&&(o="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(M),x||(q(M,O),Yr(t,!1)))};x&&(q(n,N),Yr(t,!0)),pc(t.props)?(t.el.__isMounted=!1,vt(()=>{U(),delete t.el.__isMounted},r)):U()}else{if(pc(t.props)&&e.el.__isMounted===!1){vt(()=>{id.process(e,t,n,s,i,r,o,a,l,c)},r);return}t.el=e.el,t.targetStart=e.targetStart;const C=t.anchor=e.anchor,N=t.target=e.target,q=t.targetAnchor=e.targetAnchor,U=Vi(e.props),M=U?n:N,O=U?C:q;if(o==="svg"||mc(N)?o="svg":(o==="mathml"||gc(N))&&(o="mathml"),w?(f(e.dynamicChildren,w,M,i,r,o,a),Ul(e,t,!0)):l||d(e,t,M,O,i,r,o,a,!1),x)U?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Rr(t,n,C,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=Xa(t.props,b);j&&Rr(t,j,null,c,0)}else U&&Rr(t,N,q,c,1);Yr(t,x)}},remove(e,t,n,{um:s,o:{remove:i}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=e;if(d&&(i(c),i(u)),r&&i(l),o&16){const h=r||!Vi(f);for(let b=0;b{e.isMounted=!0}),Oo(()=>{e.isUnmounting=!0}),e}const Kt=[Function,Array],rd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Kt,onEnter:Kt,onAfterEnter:Kt,onEnterCancelled:Kt,onBeforeLeave:Kt,onLeave:Kt,onAfterLeave:Kt,onLeaveCancelled:Kt,onBeforeAppear:Kt,onAppear:Kt,onAfterAppear:Kt,onAppearCancelled:Kt},od=e=>{const t=e.subTree;return t.component?od(t.component):t},em={name:"BaseTransition",props:rd,setup(e,{slots:t}){const n=jl(),s=Qp();return()=>{const i=t.default&&cd(t.default(),!0);if(!i||!i.length)return;const r=ad(i),o=Ee(e),{mode:a}=o;if(s.isLeaving)return ra(r);const l=yc(r);if(!l)return ra(r);let c=Ja(l,o,s,n,d=>c=d);l.type!==kt&&sr(l,c);let u=n.subTree&&yc(n.subTree);if(u&&u.type!==kt&&!As(u,l)&&od(n).type!==kt){let d=Ja(u,o,s,n);if(sr(u,d),a==="out-in"&&l.type!==kt)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},ra(r);a==="in-out"&&l.type!==kt?d.delayLeave=(f,h,b)=>{const g=ld(s,u);g[String(u.key)]=u,f[bn]=()=>{h(),f[bn]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{b(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function ad(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==kt){t=n;break}}return t}const tm=em;function ld(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ja(e,t,n,s,i){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:b,onLeaveCancelled:g,onBeforeAppear:E,onAppear:x,onAfterAppear:y,onAppearCancelled:k}=t,w=String(e.key),C=ld(n,e),N=(M,O)=>{M&&ln(M,s,9,O)},q=(M,O)=>{const j=O[1];N(M,O),oe(M)?M.every(z=>z.length<=1)&&j():M.length<=1&&j()},U={mode:o,persisted:a,beforeEnter(M){let O=l;if(!n.isMounted)if(r)O=E||l;else return;M[bn]&&M[bn](!0);const j=C[w];j&&As(e,j)&&j.el[bn]&&j.el[bn](),N(O,[M])},enter(M){if(C[w]===e)return;let O=c,j=u,z=d;if(!n.isMounted)if(r)O=x||c,j=y||u,z=k||d;else return;let re=!1;M[hi]=Ue=>{re||(re=!0,Ue?N(z,[M]):N(j,[M]),U.delayedLeave&&U.delayedLeave(),M[hi]=void 0)};const _e=M[hi].bind(null,!1);O?q(O,[M,_e]):_e()},leave(M,O){const j=String(e.key);if(M[hi]&&M[hi](!0),n.isUnmounting)return O();N(f,[M]);let z=!1;M[bn]=_e=>{z||(z=!0,O(),_e?N(g,[M]):N(b,[M]),M[bn]=void 0,C[j]===e&&delete C[j])};const re=M[bn].bind(null,!1);C[j]=e,h?q(h,[M,re]):re()},clone(M){const O=Ja(M,t,n,s,i);return i&&i(O),O}};return U}function ra(e){if(wr(e))return e=ds(e),e.children=null,e}function yc(e){if(!wr(e))return sd(e.type)&&e.children?ad(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&he(n.default))return n.default()}}function sr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,sr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function cd(e,t=!1,n){let s=[],i=0;for(let r=0;r1)for(let r=0;rWi(g,t&&(oe(t)?t[E]:t),n,s,i));return}if(Xs(s)&&!i){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Wi(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?Uo(s.component):s.el,o=i?null:r,{i:a,r:l}=e,c=t&&t.r,u=a.refs===$e?a.refs={}:a.refs,d=a.setupState,f=Ee(d),h=d===$e?vf:g=>bc(u,g)?!1:Re(f,g),b=(g,E)=>!(E&&bc(u,E));if(c!=null&&c!==l){if(vc(t),Ye(c))u[c]=null,h(c)&&(d[c]=null);else if(qe(c)){const g=t;b(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(he(l))br(l,a,12,[o,u]);else{const g=Ye(l),E=qe(l);if(g||E){const x=()=>{if(e.f){const y=g?h(l)?d[l]:u[l]:b()||!e.k?l.value:u[e.k];if(i)oe(y)&&Al(y,r);else if(oe(y))y.includes(r)||y.push(r);else if(g)u[l]=[r],h(l)&&(d[l]=u[l]);else{const k=[r];b(l,e.k)&&(l.value=k),e.k&&(u[e.k]=k)}}else g?(u[l]=o,h(l)&&(d[l]=o)):E&&(b(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const y=()=>{x(),ho.delete(e)};y.id=-1,ho.set(e,y),vt(y,n)}else vc(e),x()}}}function vc(e){const t=ho.get(e);t&&(t.flags|=8,ho.delete(e))}const wc=e=>e.nodeType===8;Ro().requestIdleCallback;Ro().cancelIdleCallback;function nm(e,t){if(wc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(wc(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Xs=e=>!!e.type.__asyncLoader;function H_(e){he(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:i=200,hydrate:r,timeout:o,suspensible:a=!0,onError:l}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let b;return c||(b=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),l)return new Promise((E,x)=>{l(g,()=>E(f()),()=>x(g),d+1)});throw g}).then(g=>b!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return ms({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(b,g,E){let x=!1;(g.bu||(g.bu=[])).push(()=>x=!0);const y=()=>{x||E()},k=r?()=>{const w=r(y,C=>nm(b,C));w&&(g.bum||(g.bum=[])).push(w)}:y;u?k():h().then(()=>!g.isUnmounted&&k())},get __asyncResolved(){return u},setup(){const b=gt;if($l(b),u)return()=>Lr(u,b);const g=k=>{c=null,vr(k,b,13,!s)};if(a&&b.suspense||Qs)return h().then(k=>()=>Lr(k,b)).catch(k=>(g(k),()=>s?Fe(s,{error:k}):null));const E=F(!1),x=F(),y=F(!!i);return i&&setTimeout(()=>{y.value=!1},i),o!=null&&setTimeout(()=>{if(!E.value&&!x.value){const k=new Error(`Async component timed out after ${o}ms.`);g(k),x.value=k}},o),h().then(()=>{E.value=!0,b.parent&&wr(b.parent.vnode)&&b.parent.update()}).catch(k=>{g(k),x.value=k}),()=>{if(E.value&&u)return Lr(u,b);if(x.value&&s)return Fe(s,{error:x.value});if(n&&!y.value)return Lr(n,b)}}})}function Lr(e,t){const{ref:n,props:s,children:i,ce:r}=t.vnode,o=Fe(e,s,i);return o.ref=n,o.ce=r,delete t.vnode.ce,o}const wr=e=>e.type.__isKeepAlive;function sm(e,t){ud(e,"a",t)}function im(e,t){ud(e,"da",t)}function ud(e,t,n=gt){const s=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Mo(t,s,n),n){let i=n.parent;for(;i&&i.parent;)wr(i.parent.vnode)&&rm(s,t,n,i),i=i.parent}}function rm(e,t,n,s){const i=Mo(t,e,s,!0);$o(()=>{Al(s[t],i)},n)}function Mo(e,t,n=gt,s=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{Bn();const a=_r(n),l=ln(t,n,e,o);return a(),jn(),l});return s?i.unshift(r):i.push(r),r}}const Vn=e=>(t,n=gt)=>{(!Qs||e==="sp")&&Mo(e,(...s)=>t(...s),n)},om=Vn("bm"),Ls=Vn("m"),am=Vn("bu"),lm=Vn("u"),Oo=Vn("bum"),$o=Vn("um"),cm=Vn("sp"),um=Vn("rtg"),fm=Vn("rtc");function dm(e,t=gt){Mo("ec",e,t)}const hm="components";function z_(e,t){return mm(hm,e,!0,t)||e}const pm=Symbol.for("v-ndc");function mm(e,t,n=!0,s=!1){const i=yt||gt;if(i){const r=i.type;{const a=Qm(r,!1);if(a&&(a===t||a===Xt(t)||a===Po(Xt(t))))return r}const o=_c(i[e]||r[e],t)||_c(i.appContext[e],t);return!o&&s?r:o}}function _c(e,t){return e&&(e[t]||e[Xt(t)]||e[Po(Xt(t))])}function V_(e,t,n,s){let i;const r=n,o=oe(e);if(o||Ye(e)){const a=o&&Fn(e);let l=!1,c=!1;a&&(l=!Wt(e),c=Hn(e),e=Lo(e)),i=new Array(e.length);for(let u=0,d=e.length;ut(a,l,void 0,r));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,c=a.length;l0;return t!=="default"&&(n.name=t),be(),fs(zt,null,[Fe("slot",n,s)],c?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),be();const o=r&&fd(r(n)),a=n.key||o&&o.key,l=fs(zt,{key:(a&&!on(a)?a:`_${t}`)+(!o&&s?"_fb":"")},o||[],o&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function fd(e){return e.some(t=>rr(t)?!(t.type===kt||t.type===zt&&!fd(t.children)):!0)?e:null}const Qa=e=>e?Rd(e)?Uo(e):Qa(e.parent):null,qi=lt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Qa(e.parent),$root:e=>Qa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>hd(e),$forceUpdate:e=>e.f||(e.f=()=>{Ml(e.update)}),$nextTick:e=>e.n||(e.n=Rs.bind(e.proxy)),$watch:e=>Zp.bind(e)}),oa=(e,t)=>e!==$e&&!e.__isScriptSetup&&Re(e,t),gm={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const f=o[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(oa(s,t))return o[t]=1,s[t];if(i!==$e&&Re(i,t))return o[t]=2,i[t];if(Re(r,t))return o[t]=3,r[t];if(n!==$e&&Re(n,t))return o[t]=4,n[t];el&&(o[t]=0)}}const c=qi[t];let u,d;if(c)return t==="$attrs"&&_t(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==$e&&Re(n,t))return o[t]=4,n[t];if(d=l.config.globalProperties,Re(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:i,ctx:r}=e;return oa(i,t)?(i[t]=n,!0):s!==$e&&Re(s,t)?(s[t]=n,!0):Re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:i,props:r,type:o}},a){let l;return!!(n[a]||e!==$e&&a[0]!=="$"&&Re(e,a)||oa(t,a)||Re(r,a)||Re(s,a)||Re(qi,a)||Re(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function kc(e){return oe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let el=!0;function ym(e){const t=hd(e),n=e.proxy,s=e.ctx;el=!1,t.beforeCreate&&xc(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:b,activated:g,deactivated:E,beforeDestroy:x,beforeUnmount:y,destroyed:k,unmounted:w,render:C,renderTracked:N,renderTriggered:q,errorCaptured:U,serverPrefetch:M,expose:O,inheritAttrs:j,components:z,directives:re,filters:_e}=t;if(c&&bm(c,s,null),o)for(const fe in o){const me=o[fe];he(me)&&(s[fe]=me.bind(n))}if(i){const fe=i.call(n,n);Pe(fe)&&(e.data=yr(fe))}if(el=!0,r)for(const fe in r){const me=r[fe],Tt=he(me)?me.bind(n,n):he(me.get)?me.get.bind(n,n):kn,At=!he(me)&&he(me.set)?me.set.bind(n):kn,ke=Oe({get:Tt,set:At});Object.defineProperty(s,fe,{enumerable:!0,configurable:!0,get:()=>ke.value,set:Ke=>ke.value=Ke})}if(a)for(const fe in a)dd(a[fe],s,n,fe);if(l){const fe=he(l)?l.call(n):l;Reflect.ownKeys(fe).forEach(me=>{Gr(me,fe[me])})}u&&xc(u,e,"c");function Te(fe,me){oe(me)?me.forEach(Tt=>fe(Tt.bind(n))):me&&fe(me.bind(n))}if(Te(om,d),Te(Ls,f),Te(am,h),Te(lm,b),Te(sm,g),Te(im,E),Te(dm,U),Te(fm,N),Te(um,q),Te(Oo,y),Te($o,w),Te(cm,M),oe(O))if(O.length){const fe=e.exposed||(e.exposed={});O.forEach(me=>{Object.defineProperty(fe,me,{get:()=>n[me],set:Tt=>n[me]=Tt,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===kn&&(e.render=C),j!=null&&(e.inheritAttrs=j),z&&(e.components=z),re&&(e.directives=re),M&&$l(e)}function bm(e,t,n=kn){oe(e)&&(e=tl(e));for(const s in e){const i=e[s];let r;Pe(i)?"default"in i?r=Gt(i.from||s,i.default,!0):r=Gt(i.from||s):r=Gt(i),qe(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[s]=r}}function xc(e,t,n){ln(oe(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function dd(e,t,n,s){let i=s.includes(".")?td(n,s):()=>n[s];if(Ye(e)){const r=t[e];he(r)&&Yt(i,r)}else if(he(e))Yt(i,e.bind(n));else if(Pe(e))if(oe(e))e.forEach(r=>dd(r,t,n,s));else{const r=he(e.handler)?e.handler.bind(n):t[e.handler];he(r)&&Yt(i,r,e)}}function hd(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,a=r.get(t);let l;return a?l=a:!i.length&&!n&&!s?l=t:(l={},i.length&&i.forEach(c=>po(l,c,o,!0)),po(l,t,o)),Pe(t)&&r.set(t,l),l}function po(e,t,n,s=!1){const{mixins:i,extends:r}=t;r&&po(e,r,n,!0),i&&i.forEach(o=>po(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const a=vm[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const vm={data:Tc,props:Ac,emits:Ac,methods:Bi,computed:Bi,beforeCreate:It,created:It,beforeMount:It,mounted:It,beforeUpdate:It,updated:It,beforeDestroy:It,beforeUnmount:It,destroyed:It,unmounted:It,activated:It,deactivated:It,errorCaptured:It,serverPrefetch:It,components:Bi,directives:Bi,watch:_m,provide:Tc,inject:wm};function Tc(e,t){return t?e?function(){return lt(he(e)?e.call(this,this):e,he(t)?t.call(this,this):t)}:t:e}function wm(e,t){return Bi(tl(e),tl(t))}function tl(e){if(oe(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xt(t)}Modifiers`]||e[`${ps(t)}Modifiers`];function Am(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||$e;let i=n;const r=t.startsWith("update:"),o=r&&Tm(s,t.slice(7));o&&(o.trim&&(i=n.map(u=>Ye(u)?u.trim():u)),o.number&&(i=n.map(Io)));let a,l=s[a=ea(t)]||s[a=ea(Xt(t))];!l&&r&&(l=s[a=ea(ps(t))]),l&&ln(l,e,6,i);const c=s[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,ln(c,e,6,i)}}const Em=new WeakMap;function md(e,t,n=!1){const s=n?Em:t.emitsCache,i=s.get(e);if(i!==void 0)return i;const r=e.emits;let o={},a=!1;if(!he(e)){const l=c=>{const u=md(c,t,!0);u&&(a=!0,lt(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!r&&!a?(Pe(e)&&s.set(e,null),null):(oe(r)?r.forEach(l=>o[l]=null):lt(o,r),Pe(e)&&s.set(e,o),o)}function Do(e,t){return!e||!Eo(t)?!1:(t=t.slice(2).replace(/Once$/,""),Re(e,t[0].toLowerCase()+t.slice(1))||Re(e,ps(t))||Re(e,t))}function Ec(e){const{type:t,vnode:n,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:b,inheritAttrs:g}=e,E=fo(e);let x,y;try{if(n.shapeFlag&4){const w=i||s,C=w;x=vn(c.call(C,w,u,d,h,f,b)),y=a}else{const w=t;x=vn(w.length>1?w(d,{attrs:a,slots:o,emit:l}):w(d,null)),y=t.props?a:Sm(a)}}catch(w){Ki.length=0,vr(w,e,1),x=Fe(kt)}let k=x;if(y&&g!==!1){const w=Object.keys(y),{shapeFlag:C}=k;w.length&&C&7&&(r&&w.some(Tl)&&(y=Cm(y,r)),k=ds(k,y,!1,!0))}return n.dirs&&(k=ds(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&sr(k,n.transition),x=k,fo(E),x}const Sm=e=>{let t;for(const n in e)(n==="class"||n==="style"||Eo(n))&&((t||(t={}))[n]=e[n]);return t},Cm=(e,t)=>{const n={};for(const s in e)(!Tl(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pm(e,t,n){const{props:s,children:i,component:r}=e,{props:o,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?Sc(s,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let d=0;dObject.create(yd),vd=e=>Object.getPrototypeOf(e)===yd;function Rm(e,t,n,s=!1){const i={},r=bd();e.propsDefaults=Object.create(null),wd(e,t,i,r);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=s?i:Vf(i):e.type.props?e.props=i:e.props=r,e.attrs=r}function Lm(e,t,n,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=e,a=Ee(i),[l]=e.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=_d(d,t,!0);lt(o,f),h&&a.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!l)return Pe(e)&&s.set(e,Ks),Ks;if(oe(r))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Fl=e=>oe(e)?e.map(vn):[vn(e)],Mm=(e,t,n)=>{if(t._n)return t;const s=nr((...i)=>Fl(t(...i)),n);return s._c=!1,s},kd=(e,t,n)=>{const s=e._ctx;for(const i in e){if(Dl(i))continue;const r=e[i];if(he(r))t[i]=Mm(i,r,s);else if(r!=null){const o=Fl(r);t[i]=()=>o}}},xd=(e,t)=>{const n=Fl(t);e.slots.default=()=>n},Td=(e,t,n)=>{for(const s in t)(n||!Dl(s))&&(e[s]=t[s])},Om=(e,t,n)=>{const s=e.slots=bd();if(e.vnode.shapeFlag&32){const i=t._;i?(Td(s,t,n),n&&xf(s,"_",i,!0)):kd(t,s)}else t&&xd(e,t)},$m=(e,t,n)=>{const{vnode:s,slots:i}=e;let r=!0,o=$e;if(s.shapeFlag&32){const a=t._;a?n&&a===1?r=!1:Td(i,t,n):(r=!t.$stable,kd(t,i)),o=t}else t&&(xd(e,t),o={default:1});if(r)for(const a in i)!Dl(a)&&o[a]==null&&delete i[a]},vt=jm;function Dm(e){return Fm(e)}function Fm(e,t){const n=Ro();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=kn,insertStaticContent:b}=e,g=(m,v,T,S=null,$=null,P=null,V=void 0,W=null,H=!!v.dynamicChildren)=>{if(m===v)return;m&&!As(m,v)&&(S=I(m),Ke(m,$,P,!0),m=null),v.patchFlag===-2&&(H=!1,v.dynamicChildren=null);const{type:D,ref:se,shapeFlag:X}=v;switch(D){case Fo:E(m,v,T,S);break;case kt:x(m,v,T,S);break;case Xr:m==null&&y(v,T,S,V);break;case zt:z(m,v,T,S,$,P,V,W,H);break;default:X&1?C(m,v,T,S,$,P,V,W,H):X&6?re(m,v,T,S,$,P,V,W,H):(X&64||X&128)&&D.process(m,v,T,S,$,P,V,W,H,K)}se!=null&&$?Wi(se,m&&m.ref,P,v||m,!v):se==null&&m&&m.ref!=null&&Wi(m.ref,null,P,m,!0)},E=(m,v,T,S)=>{if(m==null)s(v.el=a(v.children),T,S);else{const $=v.el=m.el;v.children!==m.children&&c($,v.children)}},x=(m,v,T,S)=>{m==null?s(v.el=l(v.children||""),T,S):v.el=m.el},y=(m,v,T,S)=>{[m.el,m.anchor]=b(m.children,v,T,S,m.el,m.anchor)},k=({el:m,anchor:v},T,S)=>{let $;for(;m&&m!==v;)$=f(m),s(m,T,S),m=$;s(v,T,S)},w=({el:m,anchor:v})=>{let T;for(;m&&m!==v;)T=f(m),i(m),m=T;i(v)},C=(m,v,T,S,$,P,V,W,H)=>{if(v.type==="svg"?V="svg":v.type==="math"&&(V="mathml"),m==null)N(v,T,S,$,P,V,W,H);else{const D=m.el&&m.el._isVueCE?m.el:null;try{D&&D._beginPatch(),M(m,v,$,P,V,W,H)}finally{D&&D._endPatch()}}},N=(m,v,T,S,$,P,V,W)=>{let H,D;const{props:se,shapeFlag:X,transition:te,dirs:ie}=m;if(H=m.el=o(m.type,P,se&&se.is,se),X&8?u(H,m.children):X&16&&U(m.children,H,null,S,$,aa(m,P),V,W),ie&&ys(m,null,S,"created"),q(H,m,m.scopeId,V,S),se){for(const ge in se)ge!=="value"&&!ji(ge)&&r(H,ge,null,se[ge],P,S);"value"in se&&r(H,"value",null,se.value,P),(D=se.onVnodeBeforeMount)&&fn(D,S,m)}ie&&ys(m,null,S,"beforeMount");const de=Um($,te);de&&te.beforeEnter(H),s(H,v,T),((D=se&&se.onVnodeMounted)||de||ie)&&vt(()=>{D&&fn(D,S,m),de&&te.enter(H),ie&&ys(m,null,S,"mounted")},$)},q=(m,v,T,S,$)=>{if(T&&h(m,T),S)for(let P=0;P{for(let D=H;D{const W=v.el=m.el;let{patchFlag:H,dynamicChildren:D,dirs:se}=v;H|=m.patchFlag&16;const X=m.props||$e,te=v.props||$e;let ie;if(T&&bs(T,!1),(ie=te.onVnodeBeforeUpdate)&&fn(ie,T,v,m),se&&ys(v,m,T,"beforeUpdate"),T&&bs(T,!0),(X.innerHTML&&te.innerHTML==null||X.textContent&&te.textContent==null)&&u(W,""),D?O(m.dynamicChildren,D,W,T,S,aa(v,$),P):V||me(m,v,W,null,T,S,aa(v,$),P,!1),H>0){if(H&16)j(W,X,te,T,$);else if(H&2&&X.class!==te.class&&r(W,"class",null,te.class,$),H&4&&r(W,"style",X.style,te.style,$),H&8){const de=v.dynamicProps;for(let ge=0;ge{ie&&fn(ie,T,v,m),se&&ys(v,m,T,"updated")},S)},O=(m,v,T,S,$,P,V)=>{for(let W=0;W{if(v!==T){if(v!==$e)for(const P in v)!ji(P)&&!(P in T)&&r(m,P,v[P],null,$,S);for(const P in T){if(ji(P))continue;const V=T[P],W=v[P];V!==W&&P!=="value"&&r(m,P,W,V,$,S)}"value"in T&&r(m,"value",v.value,T.value,$)}},z=(m,v,T,S,$,P,V,W,H)=>{const D=v.el=m?m.el:a(""),se=v.anchor=m?m.anchor:a("");let{patchFlag:X,dynamicChildren:te,slotScopeIds:ie}=v;ie&&(W=W?W.concat(ie):ie),m==null?(s(D,T,S),s(se,T,S),U(v.children||[],T,se,$,P,V,W,H)):X>0&&X&64&&te&&m.dynamicChildren&&m.dynamicChildren.length===te.length?(O(m.dynamicChildren,te,T,$,P,V,W),(v.key!=null||$&&v===$.subTree)&&Ul(m,v,!0)):me(m,v,T,se,$,P,V,W,H)},re=(m,v,T,S,$,P,V,W,H)=>{v.slotScopeIds=W,m==null?v.shapeFlag&512?$.ctx.activate(v,T,S,V,H):_e(v,T,S,$,P,V,H):Ue(m,v,H)},_e=(m,v,T,S,$,P,V)=>{const W=m.component=Gm(m,S,$);if(wr(m)&&(W.ctx.renderer=K),Ym(W,!1,V),W.asyncDep){if($&&$.registerDep(W,Te,V),!m.el){const H=W.subTree=Fe(kt);x(null,H,v,T),m.placeholder=H.el}}else Te(W,m,v,T,$,P,V)},Ue=(m,v,T)=>{const S=v.component=m.component;if(Pm(m,v,T))if(S.asyncDep&&!S.asyncResolved){fe(S,v,T);return}else S.next=v,S.update();else v.el=m.el,S.vnode=v},Te=(m,v,T,S,$,P,V)=>{const W=()=>{if(m.isMounted){let{next:X,bu:te,u:ie,parent:de,vnode:ge}=m;{const Xe=Ad(m);if(Xe){X&&(X.el=ge.el,fe(m,X,V)),Xe.asyncDep.then(()=>{vt(()=>{m.isUnmounted||D()},$)});return}}let ve=X,He;bs(m,!1),X?(X.el=ge.el,fe(m,X,V)):X=ge,te&&Kr(te),(He=X.props&&X.props.onVnodeBeforeUpdate)&&fn(He,de,X,ge),bs(m,!0);const ze=Ec(m),it=m.subTree;m.subTree=ze,g(it,ze,d(it.el),I(it),m,$,P),X.el=ze.el,ve===null&&Im(m,ze.el),ie&&vt(ie,$),(He=X.props&&X.props.onVnodeUpdated)&&vt(()=>fn(He,de,X,ge),$)}else{let X;const{el:te,props:ie}=v,{bm:de,m:ge,parent:ve,root:He,type:ze}=m,it=Xs(v);bs(m,!1),de&&Kr(de),!it&&(X=ie&&ie.onVnodeBeforeMount)&&fn(X,ve,v),bs(m,!0);{He.ce&&He.ce._hasShadowRoot()&&He.ce._injectChildStyle(ze);const Xe=m.subTree=Ec(m);g(null,Xe,T,S,m,$,P),v.el=Xe.el}if(ge&&vt(ge,$),!it&&(X=ie&&ie.onVnodeMounted)){const Xe=v;vt(()=>fn(X,ve,Xe),$)}(v.shapeFlag&256||ve&&Xs(ve.vnode)&&ve.vnode.shapeFlag&256)&&m.a&&vt(m.a,$),m.isMounted=!0,v=T=S=null}};m.scope.on();const H=m.effect=new If(W);m.scope.off();const D=m.update=H.run.bind(H),se=m.job=H.runIfDirty.bind(H);se.i=m,se.id=m.uid,H.scheduler=()=>Ml(se),bs(m,!0),D()},fe=(m,v,T)=>{v.component=m;const S=m.vnode.props;m.vnode=v,m.next=null,Lm(m,v.props,S,T),$m(m,v.children,T),Bn(),dc(m),jn()},me=(m,v,T,S,$,P,V,W,H=!1)=>{const D=m&&m.children,se=m?m.shapeFlag:0,X=v.children,{patchFlag:te,shapeFlag:ie}=v;if(te>0){if(te&128){At(D,X,T,S,$,P,V,W,H);return}else if(te&256){Tt(D,X,T,S,$,P,V,W,H);return}}ie&8?(se&16&&Ce(D,$,P),X!==D&&u(T,X)):se&16?ie&16?At(D,X,T,S,$,P,V,W,H):Ce(D,$,P,!0):(se&8&&u(T,""),ie&16&&U(X,T,S,$,P,V,W,H))},Tt=(m,v,T,S,$,P,V,W,H)=>{m=m||Ks,v=v||Ks;const D=m.length,se=v.length,X=Math.min(D,se);let te;for(te=0;tese?Ce(m,$,P,!0,!1,X):U(v,T,S,$,P,V,W,H,X)},At=(m,v,T,S,$,P,V,W,H)=>{let D=0;const se=v.length;let X=m.length-1,te=se-1;for(;D<=X&&D<=te;){const ie=m[D],de=v[D]=H?Nn(v[D]):vn(v[D]);if(As(ie,de))g(ie,de,T,null,$,P,V,W,H);else break;D++}for(;D<=X&&D<=te;){const ie=m[X],de=v[te]=H?Nn(v[te]):vn(v[te]);if(As(ie,de))g(ie,de,T,null,$,P,V,W,H);else break;X--,te--}if(D>X){if(D<=te){const ie=te+1,de=iete)for(;D<=X;)Ke(m[D],$,P,!0),D++;else{const ie=D,de=D,ge=new Map;for(D=de;D<=te;D++){const Ne=v[D]=H?Nn(v[D]):vn(v[D]);Ne.key!=null&&ge.set(Ne.key,D)}let ve,He=0;const ze=te-de+1;let it=!1,Xe=0;const Dt=new Array(ze);for(D=0;D=ze){Ke(Ne,$,P,!0);continue}let Ze;if(Ne.key!=null)Ze=ge.get(Ne.key);else for(ve=de;ve<=te;ve++)if(Dt[ve-de]===0&&As(Ne,v[ve])){Ze=ve;break}Ze===void 0?Ke(Ne,$,P,!0):(Dt[Ze-de]=D+1,Ze>=Xe?Xe=Ze:it=!0,g(Ne,v[Ze],T,null,$,P,V,W,H),He++)}const Jt=it?Bm(Dt):Ks;for(ve=Jt.length-1,D=ze-1;D>=0;D--){const Ne=de+D,Ze=v[Ne],Je=v[Ne+1],Ve=Ne+1{const{el:P,type:V,transition:W,children:H,shapeFlag:D}=m;if(D&6){ke(m.component.subTree,v,T,S);return}if(D&128){m.suspense.move(v,T,S);return}if(D&64){V.move(m,v,T,K);return}if(V===zt){s(P,v,T);for(let X=0;XW.enter(P),$);else{const{leave:X,delayLeave:te,afterLeave:ie}=W,de=()=>{m.ctx.isUnmounted?i(P):s(P,v,T)},ge=()=>{P._isLeaving&&P[bn](!0),X(P,()=>{de(),ie&&ie()})};te?te(P,de,ge):ge()}else s(P,v,T)},Ke=(m,v,T,S=!1,$=!1)=>{const{type:P,props:V,ref:W,children:H,dynamicChildren:D,shapeFlag:se,patchFlag:X,dirs:te,cacheIndex:ie}=m;if(X===-2&&($=!1),W!=null&&(Bn(),Wi(W,null,T,m,!0),jn()),ie!=null&&(v.renderCache[ie]=void 0),se&256){v.ctx.deactivate(m);return}const de=se&1&&te,ge=!Xs(m);let ve;if(ge&&(ve=V&&V.onVnodeBeforeUnmount)&&fn(ve,v,m),se&6)le(m.component,T,S);else{if(se&128){m.suspense.unmount(T,S);return}de&&ys(m,null,v,"beforeUnmount"),se&64?m.type.remove(m,v,T,K,S):D&&!D.hasOnce&&(P!==zt||X>0&&X&64)?Ce(D,v,T,!1,!0):(P===zt&&X&384||!$&&se&16)&&Ce(H,v,T),S&&J(m)}(ge&&(ve=V&&V.onVnodeUnmounted)||de)&&vt(()=>{ve&&fn(ve,v,m),de&&ys(m,null,v,"unmounted")},T)},J=m=>{const{type:v,el:T,anchor:S,transition:$}=m;if(v===zt){ee(T,S);return}if(v===Xr){w(m);return}const P=()=>{i(T),$&&!$.persisted&&$.afterLeave&&$.afterLeave()};if(m.shapeFlag&1&&$&&!$.persisted){const{leave:V,delayLeave:W}=$,H=()=>V(T,P);W?W(m.el,P,H):H()}else P()},ee=(m,v)=>{let T;for(;m!==v;)T=f(m),i(m),m=T;i(v)},le=(m,v,T)=>{const{bum:S,scope:$,job:P,subTree:V,um:W,m:H,a:D}=m;Pc(H),Pc(D),S&&Kr(S),$.stop(),P&&(P.flags|=8,Ke(V,m,v,T)),W&&vt(W,v),vt(()=>{m.isUnmounted=!0},v)},Ce=(m,v,T,S=!1,$=!1,P=0)=>{for(let V=P;V{if(m.shapeFlag&6)return I(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const v=f(m.anchor||m.el),T=v&&v[nd];return T?f(T):v};let A=!1;const R=(m,v,T)=>{let S;m==null?v._vnode&&(Ke(v._vnode,null,null,!0),S=v._vnode.component):g(v._vnode||null,m,v,null,null,null,T),v._vnode=m,A||(A=!0,dc(S),Zf(),A=!1)},K={p:g,um:Ke,m:ke,r:J,mt:_e,mc:U,pc:me,pbc:O,n:I,o:e};return{render:R,hydrate:void 0,createApp:xm(R)}}function aa({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function bs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Um(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ul(e,t,n=!1){const s=e.children,i=t.children;if(oe(s)&&oe(i))for(let r=0;r>1,e[n[a]]0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=t[o];return n}function Ad(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ad(t)}function Pc(e){if(e)for(let t=0;te.__isSuspense;function jm(e,t){t&&t.pendingBranch?oe(e)?t.effects.push(...e):t.effects.push(e):Kp(e)}const zt=Symbol.for("v-fgt"),Fo=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),Xr=Symbol.for("v-stc"),Ki=[];let Vt=null;function be(e=!1){Ki.push(Vt=e?null:[])}function Hm(){Ki.pop(),Vt=Ki[Ki.length-1]||null}let ir=1;function mo(e,t=!1){ir+=e,e<0&&Vt&&t&&(Vt.hasOnce=!0)}function Cd(e){return e.dynamicChildren=ir>0?Vt||Ks:null,Hm(),ir>0&&Vt&&Vt.push(e),e}function xe(e,t,n,s,i,r){return Cd(L(e,t,n,s,i,r,!0))}function fs(e,t,n,s,i){return Cd(Fe(e,t,n,s,i,!0))}function rr(e){return e?e.__v_isVNode===!0:!1}function As(e,t){return e.type===t.type&&e.key===t.key}const Pd=({key:e})=>e??null,Zr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ye(e)||qe(e)||he(e)?{i:yt,r:e,k:t,f:!!n}:e:null);function L(e,t=null,n=null,s=0,i=null,r=e===zt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pd(t),ref:t&&Zr(t),scopeId:Qf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:yt};return a?(Bl(l,n),r&128&&e.normalize(l)):n&&(l.shapeFlag|=Ye(n)?8:16),ir>0&&!o&&Vt&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Vt.push(l),l}const Fe=zm;function zm(e,t=null,n=null,s=0,i=null,r=!1){if((!e||e===pm)&&(e=kt),rr(e)){const a=ds(e,t,!0);return n&&Bl(a,n),ir>0&&!r&&Vt&&(a.shapeFlag&6?Vt[Vt.indexOf(e)]=a:Vt.push(a)),a.patchFlag=-2,a}if(eg(e)&&(e=e.__vccOpts),t){t=Vm(t);let{class:a,style:l}=t;a&&!Ye(a)&&(t.class=st(a)),Pe(l)&&(No(l)&&!oe(l)&&(l=lt({},l)),t.style=us(l))}const o=Ye(e)?1:Sd(e)?128:sd(e)?64:Pe(e)?4:he(e)?2:0;return L(e,t,n,s,i,o,r,!0)}function Vm(e){return e?No(e)||vd(e)?lt({},e):e:null}function ds(e,t,n=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:a,transition:l}=e,c=t?Wm(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Pd(c),ref:t&&t.ref?n&&r?oe(r)?r.concat(Zr(t)):[r,Zr(t)]:Zr(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==zt?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ds(e.ssContent),ssFallback:e.ssFallback&&ds(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&sr(u,l.clone(u)),u}function Id(e=" ",t=0){return Fe(Fo,null,e,t)}function q_(e,t){const n=Fe(Xr,null,e);return n.staticCount=t,n}function xt(e="",t=!1){return t?(be(),fs(kt,null,e)):Fe(kt,null,e)}function vn(e){return e==null||typeof e=="boolean"?Fe(kt):oe(e)?Fe(zt,null,e.slice()):rr(e)?Nn(e):Fe(Fo,null,String(e))}function Nn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ds(e)}function Bl(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(oe(t))n=16;else if(typeof t=="object")if(s&65){const i=t.default;i&&(i._c&&(i._d=!1),Bl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!vd(t)?t._ctx=yt:i===3&&yt&&(yt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else he(t)?(t={default:t,_ctx:yt},n=32):(t=String(t),s&64?(n=16,t=[Id(t)]):n=8);e.children=t,e.shapeFlag|=n}function Wm(...e){const t={};for(let n=0;ngt||yt;let go,sl;{const e=Ro(),t=(n,s)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};go=t("__VUE_INSTANCE_SETTERS__",n=>gt=n),sl=t("__VUE_SSR_SETTERS__",n=>Qs=n)}const _r=e=>{const t=gt;return go(e),e.scope.on(),()=>{e.scope.off(),go(t)}},Ic=()=>{gt&>.scope.off(),go(null)};function Rd(e){return e.vnode.shapeFlag&4}let Qs=!1;function Ym(e,t=!1,n=!1){t&&sl(t);const{props:s,children:i}=e.vnode,r=Rd(e);Rm(e,s,r,t),Om(e,i,n||t);const o=r?Xm(e,t):void 0;return t&&sl(!1),o}function Xm(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gm);const{setup:s}=n;if(s){Bn();const i=e.setupContext=s.length>1?Jm(e):null,r=_r(e),o=br(s,e,0,[e.props,i]),a=wf(o);if(jn(),r(),(a||e.sp)&&!Xs(e)&&$l(e),a){if(o.then(Ic,Ic),t)return o.then(l=>{Rc(e,l)}).catch(l=>{vr(l,e,0)});e.asyncDep=o}else Rc(e,o)}else Ld(e)}function Rc(e,t,n){he(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Pe(t)&&(e.setupState=Kf(t)),Ld(e)}function Ld(e,t,n){const s=e.type;e.render||(e.render=s.render||kn);{const i=_r(e);Bn();try{ym(e)}finally{jn(),i()}}}const Zm={get(e,t){return _t(e,"get",""),e[t]}};function Jm(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Zm),slots:e.slots,emit:e.emit,expose:t}}function Uo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Kf(Nl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in qi)return qi[n](e)},has(t,n){return n in t||n in qi}})):e.proxy}function Qm(e,t=!0){return he(e)?e.displayName||e.name:e.name||t&&e.__name}function eg(e){return he(e)&&"__vccOpts"in e}const Oe=(e,t)=>Hp(e,t,Qs);function Hl(e,t,n){try{mo(-1);const s=arguments.length;return s===2?Pe(t)&&!oe(t)?rr(t)?Fe(e,null,[t]):Fe(e,t):Fe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&rr(n)&&(n=[n]),Fe(e,t,n))}finally{mo(1)}}const tg="3.5.29";let il;const Lc=typeof window<"u"&&window.trustedTypes;if(Lc)try{il=Lc.createPolicy("vue",{createHTML:e=>e})}catch{}const Nd=il?e=>il.createHTML(e):e=>e,ng="http://www.w3.org/2000/svg",sg="http://www.w3.org/1998/Math/MathML",Ln=typeof document<"u"?document:null,Nc=Ln&&Ln.createElement("template"),ig={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const i=t==="svg"?Ln.createElementNS(ng,e):t==="mathml"?Ln.createElementNS(sg,e):n?Ln.createElement(e,{is:n}):Ln.createElement(e);return e==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:e=>Ln.createTextNode(e),createComment:e=>Ln.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ln.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,i,r){const o=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Nc.innerHTML=Nd(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=Nc.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Gn="transition",pi="animation",or=Symbol("_vtc"),Md={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rg=lt({},rd,Md),og=e=>(e.displayName="Transition",e.props=rg,e),yo=og((e,{slots:t})=>Hl(tm,ag(e),t)),vs=(e,t=[])=>{oe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Mc=e=>e?oe(e)?e.some(t=>t.length>1):e.length>1:!1;function ag(e){const t={};for(const z in e)z in Md||(t[z]=e[z]);if(e.css===!1)return t;const{name:n="v",type:s,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,b=lg(i),g=b&&b[0],E=b&&b[1],{onBeforeEnter:x,onEnter:y,onEnterCancelled:k,onLeave:w,onLeaveCancelled:C,onBeforeAppear:N=x,onAppear:q=y,onAppearCancelled:U=k}=t,M=(z,re,_e,Ue)=>{z._enterCancelled=Ue,ws(z,re?u:a),ws(z,re?c:o),_e&&_e()},O=(z,re)=>{z._isLeaving=!1,ws(z,d),ws(z,h),ws(z,f),re&&re()},j=z=>(re,_e)=>{const Ue=z?q:y,Te=()=>M(re,z,_e);vs(Ue,[re,Te]),Oc(()=>{ws(re,z?l:r),Cn(re,z?u:a),Mc(Ue)||$c(re,s,g,Te)})};return lt(t,{onBeforeEnter(z){vs(x,[z]),Cn(z,r),Cn(z,o)},onBeforeAppear(z){vs(N,[z]),Cn(z,l),Cn(z,c)},onEnter:j(!1),onAppear:j(!0),onLeave(z,re){z._isLeaving=!0;const _e=()=>O(z,re);Cn(z,d),z._enterCancelled?(Cn(z,f),Uc(z)):(Uc(z),Cn(z,f)),Oc(()=>{z._isLeaving&&(ws(z,d),Cn(z,h),Mc(w)||$c(z,s,E,_e))}),vs(w,[z,_e])},onEnterCancelled(z){M(z,!1,void 0,!0),vs(k,[z])},onAppearCancelled(z){M(z,!0,void 0,!0),vs(U,[z])},onLeaveCancelled(z){O(z),vs(C,[z])}})}function lg(e){if(e==null)return null;if(Pe(e))return[la(e.enter),la(e.leave)];{const t=la(e);return[t,t]}}function la(e){return lp(e)}function Cn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[or]||(e[or]=new Set)).add(t)}function ws(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[or];n&&(n.delete(t),n.size||(e[or]=void 0))}function Oc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cg=0;function $c(e,t,n,s){const i=e._endId=++cg,r=()=>{i===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:o,timeout:a,propCount:l}=ug(e,t);if(!o)return s();const c=o+"end";let u=0;const d=()=>{e.removeEventListener(c,f),r()},f=h=>{h.target===e&&++u>=l&&d()};setTimeout(()=>{u(n[b]||"").split(", "),i=s(`${Gn}Delay`),r=s(`${Gn}Duration`),o=Dc(i,r),a=s(`${pi}Delay`),l=s(`${pi}Duration`),c=Dc(a,l);let u=null,d=0,f=0;t===Gn?o>0&&(u=Gn,d=o,f=r.length):t===pi?c>0&&(u=pi,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Gn:pi:null,f=u?u===Gn?r.length:l.length:0);const h=u===Gn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Gn}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Dc(e,t){for(;e.lengthFc(n)+Fc(e[s])))}function Fc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Uc(e){return(e?e.ownerDocument:document).body.offsetHeight}function fg(e,t,n){const s=e[or];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const bo=Symbol("_vod"),Od=Symbol("_vsh"),K_={name:"show",beforeMount(e,{value:t},{transition:n}){e[bo]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):mi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),mi(e,!0),s.enter(e)):s.leave(e,()=>{mi(e,!1)}):mi(e,t))},beforeUnmount(e,{value:t}){mi(e,t)}};function mi(e,t){e.style.display=t?e[bo]:"none",e[Od]=!t}const dg=Symbol(""),hg=/(?:^|;)\s*display\s*:/;function pg(e,t,n){const s=e.style,i=Ye(n);let r=!1;if(n&&!i){if(t)if(Ye(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Jr(s,a,"")}else for(const o in t)n[o]==null&&Jr(s,o,"");for(const o in n)o==="display"&&(r=!0),Jr(s,o,n[o])}else if(i){if(t!==n){const o=s[dg];o&&(n+=";"+o),s.cssText=n,r=hg.test(n)}}else t&&e.removeAttribute("style");bo in e&&(e[bo]=r?s.display:"",e[Od]&&(s.display="none"))}const Bc=/\s*!important$/;function Jr(e,t,n){if(oe(n))n.forEach(s=>Jr(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=mg(e,t);Bc.test(n)?e.setProperty(ps(s),n.replace(Bc,""),"important"):e[s]=n}}const jc=["Webkit","Moz","ms"],ca={};function mg(e,t){const n=ca[t];if(n)return n;let s=Xt(t);if(s!=="filter"&&s in e)return ca[t]=s;s=Po(s);for(let i=0;iua||(vg.then(()=>ua=0),ua=Date.now());function _g(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;ln(kg(s,n.value),t,5,[s])};return n.value=e,n.attached=wg(),n}function kg(e,t){if(oe(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>i=>!i._stopped&&s&&s(i))}else return t}const Kc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,xg=(e,t,n,s,i,r)=>{const o=i==="svg";t==="class"?fg(e,s,o):t==="style"?pg(e,n,s):Eo(t)?Tl(t)||yg(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tg(e,t,s,o))?(Vc(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zc(e,t,s,o,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ye(s))?Vc(e,Xt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),zc(e,t,s,o))};function Tg(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Kc(t)&&he(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Kc(t)&&Ye(n)?!1:t in e}const ei=e=>{const t=e.props["onUpdate:modelValue"]||!1;return oe(t)?n=>Kr(t,n):t};function Ag(e){e.target.composing=!0}function Gc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Un=Symbol("_assign");function Yc(e,t,n){return t&&(e=e.trim()),n&&(e=Io(e)),e}const Xc={created(e,{modifiers:{lazy:t,trim:n,number:s}},i){e[Un]=ei(i);const r=s||i.props&&i.props.type==="number";rs(e,t?"change":"input",o=>{o.target.composing||e[Un](Yc(e.value,n,r))}),(n||r)&&rs(e,"change",()=>{e.value=Yc(e.value,n,r)}),t||(rs(e,"compositionstart",Ag),rs(e,"compositionend",Gc),rs(e,"change",Gc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:i,number:r}},o){if(e[Un]=ei(o),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?Io(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||i&&e.value.trim()===l)||(e.value=l))}},G_={deep:!0,created(e,t,n){e[Un]=ei(n),rs(e,"change",()=>{const s=e._modelValue,i=ar(e),r=e.checked,o=e[Un];if(oe(s)){const a=El(s,i),l=a!==-1;if(r&&!l)o(s.concat(i));else if(!r&&l){const c=[...s];c.splice(a,1),o(c)}}else if(oi(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o($d(e,r))})},mounted:Zc,beforeUpdate(e,t,n){e[Un]=ei(n),Zc(e,t,n)}};function Zc(e,{value:t,oldValue:n},s){e._modelValue=t;let i;if(oe(t))i=El(t,s.props.value)>-1;else if(oi(t))i=t.has(s.props.value);else{if(t===n)return;i=ai(t,$d(e,!0))}e.checked!==i&&(e.checked=i)}const Y_={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const i=oi(t);rs(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Io(ar(o)):ar(o));e[Un](e.multiple?i?new Set(r):r:r[0]),e._assigning=!0,Rs(()=>{e._assigning=!1})}),e[Un]=ei(s)},mounted(e,{value:t}){Jc(e,t)},beforeUpdate(e,t,n){e[Un]=ei(n)},updated(e,{value:t}){e._assigning||Jc(e,t)}};function Jc(e,t){const n=e.multiple,s=oe(t);if(!(n&&!s&&!oi(t))){for(let i=0,r=e.options.length;iString(c)===String(a)):o.selected=El(t,a)>-1}else o.selected=t.has(a);else if(ai(ar(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ar(e){return"_value"in e?e._value:e.value}function $d(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Eg=["ctrl","shift","alt","meta"],Sg={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Eg.some(n=>e[`${n}Key`]&&!t.includes(n))},Mn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((i,...r)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(i=>{if(!("key"in i))return;const r=ps(i.key);if(t.some(o=>o===r||Cg[o]===r))return e(i)}))},Pg=lt({patchProp:xg},ig);let eu;function Ig(){return eu||(eu=Dm(Pg))}const Rg=((...e)=>{const t=Ig().createApp(...e),{mount:n}=t;return t.mount=s=>{const i=Ng(s);if(!i)return;const r=t._component;!he(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Lg(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t});function Lg(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ng(e){return Ye(e)?document.querySelector(e):e}let Dd;const Bo=e=>Dd=e,Fd=Symbol();function rl(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Gi;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Gi||(Gi={}));function Mg(){const e=Cf(!0),t=e.run(()=>F({}));let n=[],s=[];const i=Nl({install(r){Bo(i),i._a=r,r.provide(Fd,i),r.config.globalProperties.$pinia=i,s.forEach(o=>n.push(o)),s=[]},use(r){return this._a?n.push(r):s.push(r),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const Ud=()=>{};function tu(e,t,n,s=Ud){e.add(t);const i=()=>{e.delete(t)&&s()};return!n&&Pf()&&gp(i),i}function Fs(e,...t){e.forEach(n=>{n(...t)})}const Og=e=>e(),nu=Symbol(),fa=Symbol();function ol(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];rl(i)&&rl(s)&&e.hasOwnProperty(n)&&!qe(s)&&!Fn(s)?e[n]=ol(i,s):e[n]=s}return e}const $g=Symbol();function Dg(e){return!rl(e)||!Object.prototype.hasOwnProperty.call(e,$g)}const{assign:ts}=Object;function Fg(e){return!!(qe(e)&&e.effect)}function Ug(e,t,n,s){const{state:i,actions:r,getters:o}=t,a=n.state.value[e];let l;function c(){a||(n.state.value[e]=i?i():{});const u=Fp(n.state.value[e]);return ts(u,r,Object.keys(o||{}).reduce((d,f)=>(d[f]=Nl(Oe(()=>{Bo(n);const h=n._s.get(e);return o[f].call(h,h)})),d),{}))}return l=Bd(e,c,t,n,s,!0),l}function Bd(e,t,n={},s,i,r){let o;const a=ts({actions:{}},n),l={deep:!0};let c,u,d=new Set,f=new Set,h;const b=s.state.value[e];!r&&!b&&(s.state.value[e]={});let g;function E(U){let M;c=u=!1,typeof U=="function"?(U(s.state.value[e]),M={type:Gi.patchFunction,storeId:e,events:h}):(ol(s.state.value[e],U),M={type:Gi.patchObject,payload:U,storeId:e,events:h});const O=g=Symbol();Rs().then(()=>{g===O&&(c=!0)}),u=!0,Fs(d,M,s.state.value[e])}const x=r?function(){const{state:M}=n,O=M?M():{};this.$patch(j=>{ts(j,O)})}:Ud;function y(){o.stop(),d.clear(),f.clear(),s._s.delete(e)}const k=(U,M="")=>{if(nu in U)return U[fa]=M,U;const O=function(){Bo(s);const j=Array.from(arguments),z=new Set,re=new Set;function _e(fe){z.add(fe)}function Ue(fe){re.add(fe)}Fs(f,{args:j,name:O[fa],store:C,after:_e,onError:Ue});let Te;try{Te=U.apply(this&&this.$id===e?this:C,j)}catch(fe){throw Fs(re,fe),fe}return Te instanceof Promise?Te.then(fe=>(Fs(z,fe),fe)).catch(fe=>(Fs(re,fe),Promise.reject(fe))):(Fs(z,Te),Te)};return O[nu]=!0,O[fa]=M,O},w={_p:s,$id:e,$onAction:tu.bind(null,f),$patch:E,$reset:x,$subscribe(U,M={}){const O=tu(d,U,M.detached,()=>j()),j=o.run(()=>Yt(()=>s.state.value[e],z=>{(M.flush==="sync"?u:c)&&U({storeId:e,type:Gi.direct,events:h},z)},ts({},l,M)));return O},$dispose:y},C=yr(w);s._s.set(e,C);const q=(s._a&&s._a.runWithContext||Og)(()=>s._e.run(()=>(o=Cf()).run(()=>t({action:k}))));for(const U in q){const M=q[U];if(qe(M)&&!Fg(M)||Fn(M))r||(b&&Dg(M)&&(qe(M)?M.value=b[U]:ol(M,b[U])),s.state.value[e][U]=M);else if(typeof M=="function"){const O=k(M,U);q[U]=O,a.actions[U]=M}}return ts(C,q),ts(Ee(C),q),Object.defineProperty(C,"$state",{get:()=>s.state.value[e],set:U=>{E(M=>{ts(M,U)})}}),s._p.forEach(U=>{ts(C,o.run(()=>U({store:C,app:s._a,pinia:s,options:a})))}),b&&r&&n.hydrate&&n.hydrate(C.$state,b),c=!0,u=!0,C}function zl(e,t,n){let s;const i=typeof t=="function";s=i?n:t;function r(o,a){const l=Gp();return o=o||(l?Gt(Fd,null):null),o&&Bo(o),o=Dd,o._s.has(e)||(i?Bd(e,t,s,o):Ug(e,s,o)),o._s.get(e)}return r.$id=e,r}const Ws=typeof document<"u";function jd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Bg(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&jd(e.default)}const Ie=Object.assign;function da(e,t){const n={};for(const s in t){const i=t[s];n[s]=cn(i)?i.map(e):e(i)}return n}const Yi=()=>{},cn=Array.isArray;function su(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}let Ge=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Hd=Symbol("");Ge.MATCHER_NOT_FOUND+"",Ge.NAVIGATION_GUARD_REDIRECT+"",Ge.NAVIGATION_ABORTED+"",Ge.NAVIGATION_CANCELLED+"",Ge.NAVIGATION_DUPLICATED+"";function ti(e,t){return Ie(new Error,{type:e,[Hd]:!0},t)}function Pn(e,t){return e instanceof Error&&Hd in e&&(t==null||!!(e.type&t))}const jg=["params","query","hash"];function Hg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of jg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const zg=Symbol(""),iu=Symbol(""),jo=Symbol(""),Vl=Symbol(""),al=Symbol("");function X_(){return Gt(jo)}function Z_(e){return Gt(Vl)}const zd=/#/g,Vg=/&/g,Wg=/\//g,qg=/=/g,Kg=/\?/g,Vd=/\+/g,Gg=/%5B/g,Yg=/%5D/g,Wd=/%5E/g,Xg=/%60/g,qd=/%7B/g,Zg=/%7C/g,Kd=/%7D/g,Jg=/%20/g;function Wl(e){return e==null?"":encodeURI(""+e).replace(Zg,"|").replace(Gg,"[").replace(Yg,"]")}function Qg(e){return Wl(e).replace(qd,"{").replace(Kd,"}").replace(Wd,"^")}function ll(e){return Wl(e).replace(Vd,"%2B").replace(Jg,"+").replace(zd,"%23").replace(Vg,"%26").replace(Xg,"`").replace(qd,"{").replace(Kd,"}").replace(Wd,"^")}function ey(e){return ll(e).replace(qg,"%3D")}function ty(e){return Wl(e).replace(zd,"%23").replace(Kg,"%3F")}function ny(e){return ty(e).replace(Wg,"%2F")}function lr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const sy=/\/$/,iy=e=>e.replace(sy,"");function ha(e,t,n="/"){let s,i={},r="",o="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(s=t.slice(0,l),r=t.slice(l,a>0?a:t.length),i=e(r.slice(1))),a>=0&&(s=s||t.slice(0,a),o=t.slice(a,t.length)),s=ly(s??t,n),{fullPath:s+r+o,path:s,query:i,hash:lr(o)}}function ry(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function ru(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function oy(e,t,n){const s=t.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&ni(t.matched[s],n.matched[i])&&Gd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ni(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Gd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!ay(e[n],t[n]))return!1;return!0}function ay(e,t){return cn(e)?ou(e,t):cn(t)?ou(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function ou(e,t){return cn(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function ly(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=n.length-1,o,a;for(o=0;o1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(o).join("/")}const Yn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let cl=(function(e){return e.pop="pop",e.push="push",e})({}),pa=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function cy(e){if(!e)if(Ws){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),iy(e)}const uy=/^[^#]+#/;function fy(e,t){return e.replace(uy,"#")+t}function dy(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Ho=()=>({left:window.scrollX,top:window.scrollY});function hy(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=dy(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function au(e,t){return(history.state?history.state.position-t:-1)+e}const ul=new Map;function py(e,t){ul.set(e,t)}function my(e){const t=ul.get(e);return ul.delete(e),t}function gy(e){return typeof e=="string"||e&&typeof e=="object"}function Yd(e){return typeof e=="string"||typeof e=="symbol"}function yy(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;si&&ll(i)):[s&&ll(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function by(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=cn(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return t}function gi(){let e=[];function t(s){return e.push(s),()=>{const i=e.indexOf(s);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function is(e,t,n,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(ti(Ge.NAVIGATION_ABORTED,{from:n,to:t})):f instanceof Error?l(f):gy(f)?l(ti(Ge.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(o&&s.enterCallbacks[i]===o&&typeof f=="function"&&o.push(f),a())},u=r(()=>e.call(s&&s.instances[i],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function ma(e,t,n,s,i=r=>r()){const r=[];for(const o of e)for(const a in o.components){let l=o.components[a];if(!(t!=="beforeRouteEnter"&&!o.instances[a]))if(jd(l)){const c=(l.__vccOpts||l)[t];c&&r.push(is(c,n,s,o,a,i))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const d=Bg(u)?u.default:u;o.mods[a]=u,o.components[a]=d;const f=(d.__vccOpts||d)[t];return f&&is(f,n,s,o,a,i)()}))}}return r}function vy(e,t){const n=[],s=[],i=[],r=Math.max(t.matched.length,e.matched.length);for(let o=0;oni(c,a))?s.push(a):n.push(a));const l=e.matched[o];l&&(t.matched.find(c=>ni(c,l))||i.push(l))}return[n,s,i]}let wy=()=>location.protocol+"//"+location.host;function Xd(e,t){const{pathname:n,search:s,hash:i}=t,r=e.indexOf("#");if(r>-1){let o=i.includes(e.slice(r))?e.slice(r).length:1,a=i.slice(o);return a[0]!=="/"&&(a="/"+a),ru(a,"")}return ru(n,e)+s+i}function _y(e,t,n,s){let i=[],r=[],o=null;const a=({state:f})=>{const h=Xd(e,location),b=n.value,g=t.value;let E=0;if(f){if(n.value=h,t.value=f,o&&o===b){o=null;return}E=g?f.position-g.position:0}else s(h);i.forEach(x=>{x(n.value,b,{delta:E,type:cl.pop,direction:E?E>0?pa.forward:pa.back:pa.unknown})})};function l(){o=n.value}function c(f){i.push(f);const h=()=>{const b=i.indexOf(f);b>-1&&i.splice(b,1)};return r.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Ie({},f.state,{scroll:Ho()}),"")}}function d(){for(const f of r)f();r=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function cu(e,t,n,s=!1,i=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:i?Ho():null}}function ky(e){const{history:t,location:n}=window,s={value:Xd(e,n)},i={value:t.state};i.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+l:wy()+e+l;try{t[u?"replaceState":"pushState"](c,"",f),i.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function o(l,c){r(l,Ie({},t.state,cu(i.value.back,l,i.value.forward,!0),c,{position:i.value.position}),!0),s.value=l}function a(l,c){const u=Ie({},i.value,t.state,{forward:l,scroll:Ho()});r(u.current,u,!0),r(l,Ie({},cu(s.value,l,null),{position:u.position+1},c),!1),s.value=l}return{location:s,state:i,push:a,replace:o}}function xy(e){e=cy(e);const t=ky(e),n=_y(e,t.state,t.location,t.replace);function s(r,o=!0){o||n.pauseListeners(),history.go(r)}const i=Ie({location:"",base:e,go:s,createHref:fy.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}let Ss=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var ot=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(ot||{});const Ty={type:Ss.Static,value:""},Ay=/[a-zA-Z0-9_]/;function Ey(e){if(!e)return[[]];if(e==="/")return[[Ty]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=ot.Static,s=n;const i=[];let r;function o(){r&&i.push(r),r=[]}let a=0,l,c="",u="";function d(){c&&(n===ot.Static?r.push({type:Ss.Static,value:c}):n===ot.Param||n===ot.ParamRegExp||n===ot.ParamRegExpEnd?(r.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Ss.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;at.length?t.length===1&&t[0]===Rt.Static+Rt.Segment?1:-1:0}function Zd(e,t){let n=0;const s=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const Ry={strict:!1,end:!0,sensitive:!1};function Ly(e,t,n){const s=Py(Ey(e.path),n),i=Ie(s,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Ny(e,t){const n=[],s=new Map;t=su(Ry,t);function i(d){return s.get(d)}function r(d,f,h){const b=!h,g=hu(d);g.aliasOf=h&&h.record;const E=su(t,d),x=[g];if("alias"in d){const w=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of w)x.push(hu(Ie({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g})))}let y,k;for(const w of x){const{path:C}=w;if(f&&C[0]!=="/"){const N=f.record.path,q=N[N.length-1]==="/"?"":"/";w.path=f.record.path+(C&&q+C)}if(y=Ly(w,f,E),h?h.alias.push(y):(k=k||y,k!==y&&k.alias.push(y),b&&d.name&&!pu(y)&&o(d.name)),Jd(y)&&l(y),g.children){const N=g.children;for(let q=0;q{o(k)}:Yi}function o(d){if(Yd(d)){const f=s.get(d);f&&(s.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(o),f.alias.forEach(o))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&s.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function a(){return n}function l(d){const f=$y(d,n);n.splice(f,0,d),d.record.name&&!pu(d)&&s.set(d.record.name,d)}function c(d,f){let h,b={},g,E;if("name"in d&&d.name){if(h=s.get(d.name),!h)throw ti(Ge.MATCHER_NOT_FOUND,{location:d});E=h.record.name,b=Ie(du(f.params,h.keys.filter(k=>!k.optional).concat(h.parent?h.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),d.params&&du(d.params,h.keys.map(k=>k.name))),g=h.stringify(b)}else if(d.path!=null)g=d.path,h=n.find(k=>k.re.test(g)),h&&(b=h.parse(g),E=h.record.name);else{if(h=f.name?s.get(f.name):n.find(k=>k.re.test(f.path)),!h)throw ti(Ge.MATCHER_NOT_FOUND,{location:d,currentLocation:f});E=h.record.name,b=Ie({},f.params,d.params),g=h.stringify(b)}const x=[];let y=h;for(;y;)x.unshift(y.record),y=y.parent;return{name:E,path:g,params:b,matched:x,meta:Oy(x)}}e.forEach(d=>r(d));function u(){n.length=0,s.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:i}}function du(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function hu(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:My(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function My(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function pu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Oy(e){return e.reduce((t,n)=>Ie(t,n.meta),{})}function $y(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;Zd(e,t[r])<0?s=r:n=r+1}const i=Dy(e);return i&&(s=t.lastIndexOf(i,s-1)),s}function Dy(e){let t=e;for(;t=t.parent;)if(Jd(t)&&Zd(e,t)===0)return t}function Jd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function mu(e){const t=Gt(jo),n=Gt(Vl),s=Oe(()=>{const l=G(e.to);return t.resolve(l)}),i=Oe(()=>{const{matched:l}=s.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(ni.bind(null,u));if(f>-1)return f;const h=gu(l[c-2]);return c>1&&gu(u)===h&&d[d.length-1].path!==h?d.findIndex(ni.bind(null,l[c-2])):f}),r=Oe(()=>i.value>-1&&Hy(n.params,s.value.params)),o=Oe(()=>i.value>-1&&i.value===n.matched.length-1&&Gd(n.params,s.value.params));function a(l={}){if(jy(l)){const c=t[G(e.replace)?"replace":"push"](G(e.to)).catch(Yi);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:Oe(()=>s.value.href),isActive:r,isExactActive:o,navigate:a}}function Fy(e){return e.length===1?e[0]:e}const Uy=ms({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:mu,setup(e,{slots:t}){const n=yr(mu(e)),{options:s}=Gt(jo),i=Oe(()=>({[yu(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[yu(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&Fy(t.default(n));return e.custom?r:Hl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),By=Uy;function jy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Hy(e,t){for(const n in t){const s=t[n],i=e[n];if(typeof s=="string"){if(s!==i)return!1}else if(!cn(i)||i.length!==s.length||s.some((r,o)=>r.valueOf()!==i[o].valueOf()))return!1}return!0}function gu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const yu=(e,t,n)=>e??t??n,zy=ms({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Gt(al),i=Oe(()=>e.route||s.value),r=Gt(iu,0),o=Oe(()=>{let c=G(r);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=Oe(()=>i.value.matched[o.value]);Gr(iu,Oe(()=>o.value+1)),Gr(zg,a),Gr(al,i);const l=F();return Yt(()=>[l.value,a.value,e.name],([c,u,d],[f,h,b])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!ni(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=i.value,u=e.name,d=a.value,f=d&&d.components[u];if(!f)return bu(n.default,{Component:f,route:c});const h=d.props[u],b=h?h===!0?c.params:typeof h=="function"?h(c):h:null,E=Hl(f,Ie({},b,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return bu(n.default,{Component:E,route:c})||E}}});function bu(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Qd=zy;function Vy(e){const t=Ny(e.routes,e),n=e.parseQuery||yy,s=e.stringifyQuery||lu,i=e.history,r=gi(),o=gi(),a=gi(),l=Wf(Yn);let c=Yn;Ws&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=da.bind(null,I=>""+I),d=da.bind(null,ny),f=da.bind(null,lr);function h(I,A){let R,K;return Yd(I)?(R=t.getRecordMatcher(I),K=A):K=I,t.addRoute(K,R)}function b(I){const A=t.getRecordMatcher(I);A&&t.removeRoute(A)}function g(){return t.getRoutes().map(I=>I.record)}function E(I){return!!t.getRecordMatcher(I)}function x(I,A){if(A=Ie({},A||l.value),typeof I=="string"){const T=ha(n,I,A.path),S=t.resolve({path:T.path},A),$=i.createHref(T.fullPath);return Ie(T,S,{params:f(S.params),hash:lr(T.hash),redirectedFrom:void 0,href:$})}let R;if(I.path!=null)R=Ie({},I,{path:ha(n,I.path,A.path).path});else{const T=Ie({},I.params);for(const S in T)T[S]==null&&delete T[S];R=Ie({},I,{params:d(T)}),A.params=d(A.params)}const K=t.resolve(R,A),ae=I.hash||"";K.params=u(f(K.params));const m=ry(s,Ie({},I,{hash:Qg(ae),path:K.path})),v=i.createHref(m);return Ie({fullPath:m,hash:ae,query:s===lu?by(I.query):I.query||{}},K,{redirectedFrom:void 0,href:v})}function y(I){return typeof I=="string"?ha(n,I,l.value.path):Ie({},I)}function k(I,A){if(c!==I)return ti(Ge.NAVIGATION_CANCELLED,{from:A,to:I})}function w(I){return q(I)}function C(I){return w(Ie(y(I),{replace:!0}))}function N(I,A){const R=I.matched[I.matched.length-1];if(R&&R.redirect){const{redirect:K}=R;let ae=typeof K=="function"?K(I,A):K;return typeof ae=="string"&&(ae=ae.includes("?")||ae.includes("#")?ae=y(ae):{path:ae},ae.params={}),Ie({query:I.query,hash:I.hash,params:ae.path!=null?{}:I.params},ae)}}function q(I,A){const R=c=x(I),K=l.value,ae=I.state,m=I.force,v=I.replace===!0,T=N(R,K);if(T)return q(Ie(y(T),{state:typeof T=="object"?Ie({},ae,T.state):ae,force:m,replace:v}),A||R);const S=R;S.redirectedFrom=A;let $;return!m&&oy(s,K,R)&&($=ti(Ge.NAVIGATION_DUPLICATED,{to:S,from:K}),ke(K,K,!0,!1)),($?Promise.resolve($):O(S,K)).catch(P=>Pn(P)?Pn(P,Ge.NAVIGATION_GUARD_REDIRECT)?P:At(P):me(P,S,K)).then(P=>{if(P){if(Pn(P,Ge.NAVIGATION_GUARD_REDIRECT))return q(Ie({replace:v},y(P.to),{state:typeof P.to=="object"?Ie({},ae,P.to.state):ae,force:m}),A||S)}else P=z(S,K,!0,v,ae);return j(S,K,P),P})}function U(I,A){const R=k(I,A);return R?Promise.reject(R):Promise.resolve()}function M(I){const A=ee.values().next().value;return A&&typeof A.runWithContext=="function"?A.runWithContext(I):I()}function O(I,A){let R;const[K,ae,m]=vy(I,A);R=ma(K.reverse(),"beforeRouteLeave",I,A);for(const T of K)T.leaveGuards.forEach(S=>{R.push(is(S,I,A))});const v=U.bind(null,I,A);return R.push(v),Ce(R).then(()=>{R=[];for(const T of r.list())R.push(is(T,I,A));return R.push(v),Ce(R)}).then(()=>{R=ma(ae,"beforeRouteUpdate",I,A);for(const T of ae)T.updateGuards.forEach(S=>{R.push(is(S,I,A))});return R.push(v),Ce(R)}).then(()=>{R=[];for(const T of m)if(T.beforeEnter)if(cn(T.beforeEnter))for(const S of T.beforeEnter)R.push(is(S,I,A));else R.push(is(T.beforeEnter,I,A));return R.push(v),Ce(R)}).then(()=>(I.matched.forEach(T=>T.enterCallbacks={}),R=ma(m,"beforeRouteEnter",I,A,M),R.push(v),Ce(R))).then(()=>{R=[];for(const T of o.list())R.push(is(T,I,A));return R.push(v),Ce(R)}).catch(T=>Pn(T,Ge.NAVIGATION_CANCELLED)?T:Promise.reject(T))}function j(I,A,R){a.list().forEach(K=>M(()=>K(I,A,R)))}function z(I,A,R,K,ae){const m=k(I,A);if(m)return m;const v=A===Yn,T=Ws?history.state:{};R&&(K||v?i.replace(I.fullPath,Ie({scroll:v&&T&&T.scroll},ae)):i.push(I.fullPath,ae)),l.value=I,ke(I,A,R,v),At()}let re;function _e(){re||(re=i.listen((I,A,R)=>{if(!le.listening)return;const K=x(I),ae=N(K,le.currentRoute.value);if(ae){q(Ie(ae,{replace:!0,force:!0}),K).catch(Yi);return}c=K;const m=l.value;Ws&&py(au(m.fullPath,R.delta),Ho()),O(K,m).catch(v=>Pn(v,Ge.NAVIGATION_ABORTED|Ge.NAVIGATION_CANCELLED)?v:Pn(v,Ge.NAVIGATION_GUARD_REDIRECT)?(q(Ie(y(v.to),{force:!0}),K).then(T=>{Pn(T,Ge.NAVIGATION_ABORTED|Ge.NAVIGATION_DUPLICATED)&&!R.delta&&R.type===cl.pop&&i.go(-1,!1)}).catch(Yi),Promise.reject()):(R.delta&&i.go(-R.delta,!1),me(v,K,m))).then(v=>{v=v||z(K,m,!1),v&&(R.delta&&!Pn(v,Ge.NAVIGATION_CANCELLED)?i.go(-R.delta,!1):R.type===cl.pop&&Pn(v,Ge.NAVIGATION_ABORTED|Ge.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),j(K,m,v)}).catch(Yi)}))}let Ue=gi(),Te=gi(),fe;function me(I,A,R){At(I);const K=Te.list();return K.length?K.forEach(ae=>ae(I,A,R)):console.error(I),Promise.reject(I)}function Tt(){return fe&&l.value!==Yn?Promise.resolve():new Promise((I,A)=>{Ue.add([I,A])})}function At(I){return fe||(fe=!I,_e(),Ue.list().forEach(([A,R])=>I?R(I):A()),Ue.reset()),I}function ke(I,A,R,K){const{scrollBehavior:ae}=e;if(!Ws||!ae)return Promise.resolve();const m=!R&&my(au(I.fullPath,0))||(K||!R)&&history.state&&history.state.scroll||null;return Rs().then(()=>ae(I,A,m)).then(v=>v&&hy(v)).catch(v=>me(v,I,A))}const Ke=I=>i.go(I);let J;const ee=new Set,le={currentRoute:l,listening:!0,addRoute:h,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:E,getRoutes:g,resolve:x,options:e,push:w,replace:C,go:Ke,back:()=>Ke(-1),forward:()=>Ke(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Te.add,isReady:Tt,install(I){I.component("RouterLink",By),I.component("RouterView",Qd),I.config.globalProperties.$router=le,Object.defineProperty(I.config.globalProperties,"$route",{enumerable:!0,get:()=>G(l)}),Ws&&!J&&l.value===Yn&&(J=!0,w(i.location).catch(K=>{}));const A={};for(const K in Yn)Object.defineProperty(A,K,{get:()=>l.value[K],enumerable:!0});I.provide(jo,le),I.provide(Vl,Vf(A)),I.provide(al,l);const R=I.unmount;ee.add(I),I.unmount=function(){ee.delete(I),ee.size<1&&(c=Yn,re&&re(),re=null,l.value=Yn,J=!1,fe=!1),R()}}};function Ce(I){return I.reduce((A,R)=>A.then(()=>M(R)),Promise.resolve())}return le}const ga=F("dark");function ql(){const e=Oe(()=>ga.value==="dark"),t=i=>{ga.value=i,localStorage.setItem("aiui-theme",i),document.documentElement.classList.toggle("dark",i==="dark"),document.documentElement.classList.toggle("light",i==="light")};return{currentTheme:ga,isDark:e,setTheme:t,toggleTheme:()=>{t(e.value?"light":"dark")},initTheme:()=>{const i=localStorage.getItem("aiui-theme");i?t(i):window.matchMedia("(prefers-color-scheme: dark)").matches?t("dark"):t("light")}}}let Wy=0;const tt=new Map,Qr=[],eo=[];let Xi=[],to=null,ya=!1,cr=null;function Nr(){return`aiui-${++Wy}-${Date.now()}`}function Us(e){window.parent!==window&&cr&&window.parent.postMessage(e,cr)}function vu(e){if(!cr||e.origin!==cr)return;const t=e.data;if(!(!t||typeof t.type!="string"))switch(t.type){case"context:response":{const n=tt.get(t.id);n&&(tt.delete(t.id),n.resolve({data:t.data,permitted:t.permitted}));break}case"action:response":{const n=tt.get(t.id);n&&(tt.delete(t.id),n.resolve({success:t.success,error:t.error}));break}case"chat:response":{const n=tt.get(t.id);n&&(tt.delete(t.id),t.success?n.resolve({text:t.text??"",surfaces:Array.isArray(t.surfaces)?t.surfaces:[]}):n.reject(new Error(t.error||"Chat request failed")));break}case"content:push":{const n=tt.get(t.id);n&&(tt.delete(t.id),n.resolve({films:Array.isArray(t.films)?t.films:[],songs:Array.isArray(t.songs)?t.songs:[],podcasts:Array.isArray(t.podcasts)?t.podcasts:[],images:Array.isArray(t.images)?t.images:[],permitted:t.permitted!==!1}));break}case"permissions:update":{Xi=t.categories||[];for(const n of Qr)n(Xi);break}case"theme:response":{const n=t.theme;if(n){to=n;for(const s of eo)s(n)}break}case"chat:prefill":{const n=typeof t.text=="string"?t.text:"";if(!n)break;Zi?Zi(n):no=n;break}}}let Zi=null,no="";function qy(){if(typeof document<"u"&&document.referrer)try{return new URL(document.referrer).origin}catch{}return window.location.origin}const Qt={init(e){ya||(ya=!0,cr=e??qy(),window.addEventListener("message",vu),Us({type:"ready"}))},onPrefill(e){if(Zi=e,no){const t=no;no="",e(t)}return()=>{Zi===e&&(Zi=null)}},destroy(){window.removeEventListener("message",vu),tt.clear(),ya=!1},isInArchy(){return window.parent!==window},requestContext(e,t){const n=Nr();return new Promise((s,i)=>{tt.set(n,{resolve:s,reject:i}),Us({type:"context:request",id:n,category:e,query:t}),setTimeout(()=>{tt.has(n)&&(tt.delete(n),i(new Error(`Context request timed out: ${e}`)))},1e4)})},requestAction(e,t={}){const n=Nr();return new Promise((s,i)=>{tt.set(n,{resolve:s,reject:i}),Us({type:"action:request",id:n,action:e,params:t}),setTimeout(()=>{tt.has(n)&&(tt.delete(n),i(new Error(`Action request timed out: ${e}`)))},3e4)})},sendChat(e){const t=Nr();return new Promise((n,s)=>{tt.set(t,{resolve:n,reject:s}),Us({type:"chat:request",id:t,text:e}),setTimeout(()=>{tt.has(t)&&(tt.delete(t),s(new Error("Chat request timed out")))},43e4)})},requestArchyContent(e,t){const n=Nr();return new Promise((s,i)=>{tt.set(n,{resolve:s,reject:i}),Us({type:"content:request",id:n,kind:e,scope:t}),setTimeout(()=>{tt.has(n)&&(tt.delete(n),i(new Error(`Content request timed out: ${e}`)))},3e4)})},requestTheme(){Us({type:"theme:request"})},onPermissionsUpdate(e){return Qr.push(e),Xi.length>0&&e(Xi),()=>{const t=Qr.indexOf(e);t!==-1&&Qr.splice(t,1)}},onThemeUpdate(e){return eo.push(e),to&&e(to),()=>{const t=eo.indexOf(e);t!==-1&&eo.splice(t,1)}},getPermissions(){return[...Xi]},getTheme(){return to}};function zo(e,t){return fetch(e,t)}async function Ky(e){const t=e.filter(n=>typeof n=="string"&&/^https?:\/\//i.test(n.trim())).slice(0,8);if(t.length===0)return[];try{const n=new URLSearchParams;t.forEach(o=>n.append("url",o));const s=await zo(`/api/rss-articles?${n}`,{signal:AbortSignal.timeout(15e3)});return s.ok?((await s.json()).articles??[]).filter(o=>o.title&&o.url).map(o=>({title:o.title??"",url:o.url??"",content:o.content,imgSrc:o.imgSrc})):[]}catch(n){return console.warn("[AIUI rss]",n),[]}}function Es(e){const t=e.toLowerCase().trim();return t?/\b(news|latest|recent|current|what'?s happening|updates? about|headlines?|breaking|press|media coverage)\b/.test(t)||/what'?s the latest|latest \w+ news/.test(t)||/what are people saying|what'?s the word|what do people think/.test(t)||/what happened (today|this week|recently|yesterday)|any updates? on|what'?s (new|going on)|trending|in the news/i.test(t)||/current events|today'?s top|catch me up|brief me|fill me in/i.test(t):!1}function as(e){const t=e.toLowerCase();return/for instant .* news|check these sources|for (the )?latest (bitcoin )?news|direct sources/i.test(t)||/(have )?access to (live )?web search|want me to (go back and )?search/i.test(t)||/i can'?t access the web.{0,30}(but|however)|having trouble reaching the web.{0,30}(but|however)|unable to browse.{0,30}(but|however)|can'?t search the web.{0,30}(but|however)/i.test(t)||/here are.{0,20}(reliable|trusted|good) sources|top sources for/i.test(t)}function Gy(e){return e?/\b(song|songs|music|track|tracks|playlist|playlists|album|albums|listen|listening|sing|singing|singer|singers|band|bands|artist|artists|rapper|rappers|rap|hip hop|r&b|rock|jazz|classical|edm|electronic|pop music|concert|concerts|vinyl|soundtrack|anthem|beat|beats|melody|melodies|tune|tunes|lyric|lyrics|acoustic|remix|dj|genre|genres|spotify|soundcloud|bandcamp|musician|musicians|composer|composers|orchestra|symphony|punk|metal|reggae|blues|soul|funk|country music|grammys?|billboard|top 40|mixtape|ep\b|lp\b|discography|jam|jams|banger|bangers)\b/i.test(e)||/recommend.*(song|music|track|listen)/i.test(e)||/play\s+(me\s+)?(some|a)\b/i.test(e)||/what genre|favorite (song|music|band|artist|jam|tune)|best (song|album|track|music)/i.test(e):!1}function Yy(e){const t=e.toLowerCase().trim();return/\b(website|websites|where to check|best places? to check|places? to (look|check|find)|check online|resources?|sources? to (check|read|visit)|links?|urls?|sites?|portals?|platforms? for|tools? for|apps? for|services? for)\b/.test(t)||/where (can i|should i) (check|look|find|go|visit|browse)/.test(t)||/point me to|direct me to|link me|send me (to|a link|some links)|any good (sites|resources|tools|platforms)/i.test(t)}function Xy(e){return/\b(book|books|read|reading|novel|novels|author|authors|nonfiction|non-fiction|recommend.*read|must.read|literature|memoir|memoirs|biography|biographies|autobiography|paperback|hardcover|kindle|audible|audiobook|audiobooks|bookshelf|bestseller|bestsellers|goodreads|epub)\b/i.test(e)||/what should i read|favorite reads?|reading list|book club|book recommendation|suggest.*book|what.*worth reading|good reads?|anything to read|currently reading/i.test(e)}function Zy(e){return/\b(novel|author|pages?|ISBN|published|bestsell|literary|fiction|nonfiction|book)\b/i.test(e)&&(e.match(/\bby\s+[A-Z]/g)?.length??0)>=1}function vo(e){return/\b(tv\b|tv shows?|tv series|series|television|streaming|binge|watch|recommend.*shows?|best shows?|seasons?|netflix|hbo|hulu|disney\+?|apple tv|amazon prime|peacock|paramount\+?|showtime|miniseries|docuseries|sitcom|drama series|limited series|pilot|showrunner|renewed|cancelled|premiere)\b/i.test(e)||/what'?s good on|anything to (binge|watch)|what should (i|we) (watch|stream)|good (shows?|series) to|new (shows?|series)|best (shows?|series)|recommend.*(shows?|series|watch)/i.test(e)}function Jy(e){return/\b(image|images|photo|photos|picture|pictures|screenshot|screenshots|gallery|artwork|illustration|visual|infographic|diagram|chart)\b/i.test(e)}function wu(e){return/\b(restaurant|restaurants|place|places|food|eat|eating|dining|cafe|cafes|bar|bars|pub|pubs|brunch|lunch|dinner|bistro|pizza|pizzeria|sushi|ramen|tacos|burger|bakery|deli|steakhouse|where to eat|good food|best food|where should i eat|recommend.*eat|recommend.*restaurant|recommend.*place|hungry|starving|takeout|take-?out|delivery|reservation|reservations|michelin|yelp|zagat|foodie|gastropub|tapas|dim sum|bbq|barbecue|food truck|brewery|winery|cocktail bar|speakeasy|rooftop bar|happy hour)\b/i.test(e)||/where.*(eat|food|drink|grab|dine)|best.*(brunch|lunch|dinner|food|restaurant|eat|spot)|good.*(food|restaurant|eat|spot)|what'?s good to eat/i.test(e)}function Qy(e){return/\b(restaurant|cuisine|menu|reserv|dining|address|open|hours|price range|\$\$|\$\$\$|michelin|yelp|rating)\b/i.test(e)&&(e.match(/\b(?:restaurant|cafe|bar|bistro|pub|pizzeria|bakery|deli|steakhouse|grill)\b/gi)?.length??0)>=2}function eb(e){return e?/\b(recipe|recipes|cook|cooking|bake|baking|meal|meals|dish|dishes|ingredient|ingredients|how to make|how to cook|how to bake)\b/i.test(e)||/make me a|cook me|bake me|recipe for|what can i (make|cook|bake)|meal prep|meal plan/i.test(e):!1}function _u(e){return/=3}function ur(e){return e?/\b(nostr|npub[a-z0-9]{8,}|nip-?\d+|damus|primal|snort|amethyst|coracle|iris|nos\.social|zaps?\b|relays?\b|naddr|nevent|nprofile|note1[a-z0-9]+|nostrich|fiatjaf)\b/i.test(e)||/\b(social media|social network|social protocol)\b.*\b(decentrali|censorship|relay|open)\b/i.test(e)||/decentralized social|censorship.resistant.*(social|network|protocol)/i.test(e):!1}function xu(e){return/\bnostr\b/i.test(e)?!0:[/\bnpub[a-z0-9]{8,}\b/i,/\bnip-?\d+\b/i,/\b(damus|primal|snort|amethyst|coracle|iris|nos\.social|nostrudel)\b/i,/\b(relay|relays)\b.*\b(wss?:\/\/|connect|publish)\b/i,/\bzaps?\b.*\b(lightning|sats|send)\b/i,/\bnote1[a-z0-9]+\b/i,/\bnevent[a-z0-9]+\b/i,/\bnprofile[a-z0-9]+\b/i,/\bnostrich\b/i,/\bfiatjaf\b/i].filter(n=>n.test(e)).length>=2}function Kl(e){return e?/\b(app|apps|application|applications|client|clients|wallet|wallets|tool|tools|software|download|install)\b/i.test(e)&&/\b(best|good|recommend|suggest|which|what|top|favorite|popular|use|try|need)\b/i.test(e)||/what app|which app|best app|recommend.*app|suggest.*app|best.*client|best.*wallet|recommend.*wallet|recommend.*tool/i.test(e)||/what.*(use|download|install) for|how (do i|to) (use|get|install|set up)/i.test(e):!1}function tb(e){const t=e.toLowerCase();return[/popular (clients?|apps?|wallets?|tools?) include/i,/you (can|could|might|should) (use|try|check out|download|install)/i,/available (on|for) (ios|android|web|desktop|mac|windows|linux)/i,/download (from|on|at)/i,/(app store|play store|google play|f-?droid|github releases?)/i,/open.?source.*(app|client|tool|wallet)/i].filter(s=>s.test(t)).length>=2}function ba(e){const t=/\b(what|is|are|the|a|an|latest|recent|current|news|about|for|how|why|when|where|can|could|should|would|tell|me|please|best|good)\b/gi;return e.replace(t," ").replace(/\s+/g," ").trim().slice(0,60)||""}function nb(e){const t=e.toLowerCase().trim();return/\b(film|films|movie|movies)\b/.test(t)?"film":/\b(podcast|episode)\b/.test(t)?"podcast":/\b(song|music|track|album|band|artist|listen)\b/.test(t)?"song":/\b(book|books|read|reading|novel|author|nonfiction|non-fiction)\b/.test(t)?"book":/\b(tv\b|tv show|tv series|series|television|streaming|binge|watch)\b/.test(t)?"tvshow":/\b(image|images|photo|photos|picture|pictures|screenshot|gallery|artwork|illustration)\b/.test(t)?"image":/\b(restaurant|restaurants|place|places|food|eat|dining|cafe|cafes|bar|bars|pub|pubs|brunch|lunch|dinner|bistro|pizza|pizzeria|sushi|ramen|tacos|burger|bakery|deli|steakhouse|hungry)\b/.test(t)?"place":eb(t)?"recipe":fl(t)?"code":Kl(t)?"app":ur(t)?"nostr":Es(t)?"news":Yy(t)?"websites":null}function Tu(e,t,n,s,i,r,o,a,l,c,u,d,f,h=!1,b=!1){const g=e.toLowerCase().trim(),E=nb(e),x=[];t&&x.push("film"),i&&x.push("book"),r&&x.push("tvshow"),o&&x.push("image"),a&&x.push("place"),b&&x.push("recipe"),n&&x.push("song"),s&&x.push("podcast"),h&&x.push("code"),f&&x.push("app"),u&&x.push("magazine"),l&&x.push("news"),c&&x.push("websites"),d&&x.push("nostr");const y=k=>{const w=k.filter(N=>x.includes(N)),C=x.filter(N=>!w.includes(N));return[...w,...C]};if(ur(g))return y(["nostr","app","magazine","websites"]);if(Kl(g)){const k=y(["app","nostr","magazine","websites"]);return k.length>0?k:d?["nostr"]:[]}if(Es(g))return y(["magazine","news","websites","podcast"]);if(u&&x.length===1)return["magazine"];if(c&&x.length===1)return["websites"];if(E&&x.includes(E)){const k=x.filter(w=>w!==E);return[E,...k]}return x}const va=[{id:"damus",name:"Damus",description:"Native iOS Nostr client with Lightning zaps",longDescription:"Damus is the premier Nostr client for iOS. It provides a Twitter-like experience on the Nostr protocol with native Lightning Network integration for zaps (tips). Features include relay management, DMs, profile customization, and a smooth native UI.",category:"nostr-client",platforms:["ios"],url:"https://damus.io",keywords:["damus","damus.io","damus app"],howTo:["Download Damus from the App Store","Create a new Nostr identity or import your nsec key","Add relays (defaults are provided)","Follow people by their npub or NIP-05 address","Connect a Lightning wallet for zaps"],relatedApps:["primal","amethyst","snort"]},{id:"primal",name:"Primal",description:"Fast Nostr client with built-in wallet and caching",longDescription:"Primal is a high-performance Nostr client available on iOS, Android, and web. It features a built-in Lightning wallet (via Primal Wallet), advanced search and discovery through its caching layer, and a polished social media experience. The caching infrastructure makes it one of the fastest Nostr clients.",category:"nostr-client",platforms:["ios","android","web"],url:"https://primal.net",keywords:["primal","primal.net","primal app","primal wallet"],howTo:["Visit primal.net or download the mobile app","Create a new account or log in with your nsec/extension","Set up your Primal Wallet for sending and receiving zaps","Explore trending content and follow accounts"],relatedApps:["damus","snort","alby"]},{id:"snort",name:"Snort",description:"Clean web-based Nostr client",longDescription:"Snort is a web-based Nostr client with a clean, minimal interface. It supports NIP-07 browser extensions for key management, Lightning zaps, image/video uploads, and relay management. Great for users who prefer a browser-based experience.",category:"nostr-client",platforms:["web"],url:"https://snort.social",keywords:["snort","snort.social"],howTo:["Visit snort.social in your browser","Install a NIP-07 extension (like nos2x or Alby) for key management","Create or import your Nostr identity","Configure relays and start posting"],relatedApps:["primal","damus","alby"]},{id:"amethyst",name:"Amethyst",description:"Feature-rich Android Nostr client",longDescription:"Amethyst is the most popular Nostr client for Android. It supports a wide range of NIPs including long-form content, communities, live streams, and marketplace features. Deep Lightning integration for zaps and a highly customizable interface.",category:"nostr-client",platforms:["android"],url:"https://github.com/vitorpamplona/amethyst",keywords:["amethyst","amethyst nostr","amethyst app"],howTo:["Install from Google Play Store or F-Droid","Create a new keypair or import existing nsec","Configure your relay list","Connect a Lightning wallet for zaps"],relatedApps:["damus","primal","snort"]},{id:"coracle",name:"Coracle",description:"Relay-focused web Nostr client",longDescription:"Coracle is a web-based Nostr client that puts relay management front and center. It features excellent relay discovery, community-based feeds, and a focus on the social graph. Built with privacy and decentralization principles in mind.",category:"nostr-client",platforms:["web"],url:"https://coracle.social",keywords:["coracle","coracle.social"],relatedApps:["snort","nostrudel"]},{id:"iris",name:"Iris",description:"Nostr client with built-in key management",longDescription:"Iris is a Nostr client that focuses on ease of use with built-in key management. Available on web and as a desktop app. Features include DMs, profile management, and a clean interface.",category:"nostr-client",platforms:["web","desktop"],url:"https://iris.to",keywords:["iris","iris.to","iris nostr"],relatedApps:["snort","primal"]},{id:"nostrudel",name:"noStrudel",description:"Power-user Nostr web client",longDescription:"noStrudel is a feature-packed web client for Nostr power users. It supports a wide range of NIPs, advanced relay management, DVMs (Data Vending Machines), and experimental Nostr features. Great for developers and advanced users.",category:"nostr-client",platforms:["web"],url:"https://nostrudel.ninja",keywords:["nostrudel","nostrudel.ninja","no strudel"],relatedApps:["coracle","snort"]},{id:"phoenix",name:"Phoenix",description:"Non-custodial Lightning wallet by ACINQ",longDescription:"Phoenix is a self-custodial Lightning wallet built by ACINQ (the team behind Eclair). It automatically manages channels and liquidity, making Lightning payments as simple as on-chain transactions. No channel management needed — just send and receive.",category:"lightning-wallet",platforms:["ios","android"],url:"https://phoenix.acinq.co",keywords:["phoenix","phoenix wallet","acinq","phoenix.acinq.co"],howTo:["Download Phoenix from App Store or Play Store","Back up your 12-word seed phrase securely","Receive your first payment — a channel opens automatically","Use for Lightning payments, zaps, and daily spending"],relatedApps:["breez","zeus","mutiny"]},{id:"breez",name:"Breez",description:"Non-custodial Lightning wallet with POS features",longDescription:"Breez is a non-custodial Lightning wallet that doubles as a point-of-sale system for merchants. Features include a built-in podcast player with streaming sats, fiat on-ramps, and seamless channel management via the Breez SDK.",category:"lightning-wallet",platforms:["ios","android"],url:"https://breez.technology",keywords:["breez","breez wallet","breez.technology","breez sdk"],relatedApps:["phoenix","zeus","mutiny"]},{id:"zeus",name:"Zeus",description:"Lightning node management and wallet",longDescription:"Zeus is a mobile Lightning wallet that can connect to your own Lightning node (LND, Core Lightning, or Eclair) or run an embedded node. Full control over channels, routing, and node management from your phone.",category:"lightning-wallet",platforms:["ios","android"],url:"https://zeusln.com",keywords:["zeus","zeus wallet","zeusln","zeus lightning","zeusln.com"],relatedApps:["phoenix","breez"]},{id:"alby",name:"Alby",description:"Lightning browser extension and NIP-07 signer",longDescription:"Alby is a browser extension that brings Lightning payments and Nostr key management to every website. It acts as a NIP-07 signer for Nostr clients and enables one-click Lightning payments across the web. Also offers Alby Hub for self-custodial Lightning.",category:"lightning-wallet",platforms:["web","desktop"],url:"https://getalby.com",keywords:["alby","getalby","alby extension","alby hub","getalby.com","nip-07"],howTo:["Install the Alby browser extension","Create a new Lightning wallet or connect existing one","Use Alby to sign in to Nostr web clients","Send zaps and Lightning payments from any website"],relatedApps:["snort","phoenix","primal"]},{id:"mutiny",name:"Mutiny Wallet",description:"Self-custodial Lightning wallet in the browser",longDescription:"Mutiny is a self-custodial Bitcoin and Lightning wallet that runs entirely in your web browser using WebAssembly. Features Nostr integration, fedimint support, and LSP-managed channels. Privacy-focused with optional Tor support.",category:"lightning-wallet",platforms:["web","ios","android"],url:"https://mutinywallet.com",keywords:["mutiny","mutiny wallet","mutinywallet.com"],relatedApps:["phoenix","breez"]},{id:"wallet-of-satoshi",name:"Wallet of Satoshi",description:"Simple custodial Lightning wallet",longDescription:"Wallet of Satoshi is the easiest way to get started with Lightning. As a custodial wallet, it requires no channel management — just install and start sending/receiving. Great for beginners, though advanced users may prefer self-custodial options.",category:"lightning-wallet",platforms:["ios","android"],url:"https://www.walletofsatoshi.com",keywords:["wallet of satoshi","walletofsatoshi","wos"],relatedApps:["phoenix","breez"]},{id:"sparrow",name:"Sparrow Wallet",description:"Full-featured Bitcoin desktop wallet",longDescription:"Sparrow is the gold standard for Bitcoin desktop wallets. It supports hardware wallets, multisig, coin control, PSBT, and connects to your own node via Electrum. Excellent for privacy-conscious users with features like PayJoin and whirlpool integration.",category:"bitcoin-wallet",platforms:["desktop"],url:"https://sparrowwallet.com",keywords:["sparrow","sparrow wallet","sparrowwallet.com"],howTo:["Download from sparrowwallet.com (verify GPG signature)","Connect to your own Electrum server or use a public one","Create a new wallet or import from hardware wallet","Enable coin control for better privacy"],relatedApps:["bluewallet","nunchuk","coldcard"]},{id:"bluewallet",name:"BlueWallet",description:"Mobile Bitcoin and Lightning wallet",longDescription:"BlueWallet is a popular open-source Bitcoin wallet for iOS and Android. Supports on-chain and Lightning (via LNDHub), multisig vaults, watch-only wallets, and coin control. Clean interface suitable for both beginners and advanced users.",category:"bitcoin-wallet",platforms:["ios","android","desktop"],url:"https://bluewallet.io",keywords:["bluewallet","blue wallet","bluewallet.io"],relatedApps:["sparrow","phoenix"]},{id:"nunchuk",name:"Nunchuk",description:"Collaborative multisig Bitcoin wallet",longDescription:"Nunchuk specializes in collaborative multisig for Bitcoin self-custody. Features include assisted multisig with hardware wallets, inheritance planning, spending policies, and a clean mobile/desktop experience. Ideal for securing larger amounts.",category:"bitcoin-wallet",platforms:["ios","android","desktop"],url:"https://nunchuk.io",keywords:["nunchuk","nunchuk.io","nunchuk wallet"],relatedApps:["sparrow","coldcard"]},{id:"coldcard",name:"Coldcard",description:"Air-gapped Bitcoin hardware signer",longDescription:"Coldcard is a Bitcoin-only hardware signing device focused on security. Features air-gapped operation (via SD card or NFC), duress PINs, dice roll entropy, and PSBT support. The gold standard for cold storage security.",category:"bitcoin-wallet",platforms:["cli"],url:"https://coldcard.com",keywords:["coldcard","coldcard.com","cold card"],relatedApps:["sparrow","nunchuk"]},{id:"simplex-chat",name:"SimpleX Chat",description:"Private messenger with no user IDs",longDescription:"SimpleX Chat is the only messenger that has no user identifiers — not even random numbers. It uses temporary anonymous pairwise addresses for each contact, making metadata analysis extremely difficult. Supports groups, voice, video, and file sharing.",category:"privacy",platforms:["ios","android","desktop","cli"],url:"https://simplex.chat",keywords:["simplex","simplex chat","simplex.chat"],relatedApps:["signal"]},{id:"signal",name:"Signal",description:"End-to-end encrypted messaging",longDescription:"Signal is the industry standard for encrypted messaging. Uses the Signal Protocol for E2E encryption of messages, calls, and video. Open source, no ads, no tracking. Requires a phone number for registration.",category:"privacy",platforms:["ios","android","desktop"],url:"https://signal.org",keywords:["signal","signal.org","signal messenger","signal app"],relatedApps:["simplex-chat"]},{id:"mullvad",name:"Mullvad VPN",description:"Privacy-focused VPN accepting Bitcoin",longDescription:"Mullvad is a VPN service that prioritizes privacy. No email or personal info needed to sign up — just a generated account number. Accepts Bitcoin and cash payments. Open-source clients, WireGuard support, and a strict no-logging policy.",category:"privacy",platforms:["ios","android","desktop","cli"],url:"https://mullvad.net",keywords:["mullvad","mullvad vpn","mullvad.net"]},{id:"start9",name:"Start9",description:"Sovereign computing platform for self-hosting",longDescription:"Start9 (formerly Embassy) is a Linux-based operating system for running a personal server. Self-host Bitcoin Core, Lightning, Nostr relays, and 200+ other services with a simple web UI. True digital sovereignty without command-line knowledge.",category:"node",platforms:["nodeos","desktop"],url:"https://start9.com",keywords:["start9","start9.com","embassy","startos"],howTo:["Purchase a Start9 server or install StartOS on your own hardware","Access the web dashboard from your local network","Install services: Bitcoin Core, LND, Nostr relay, etc.","Configure Tor for remote access"],relatedApps:["umbrel","raspiblitz"]},{id:"umbrel",name:"Umbrel",description:"Personal home server OS with app store",longDescription:"Umbrel is a beautiful OS for running a personal server at home. One-click install for Bitcoin Core, Lightning, Nostr relays, and hundreds of self-hosted apps. Runs on Raspberry Pi or any x86 hardware.",category:"node",platforms:["nodeos","desktop"],url:"https://umbrel.com",keywords:["umbrel","umbrel.com","umbrel os"],relatedApps:["start9","raspiblitz"]},{id:"raspiblitz",name:"RaspiBlitz",description:"DIY Bitcoin/Lightning node for Raspberry Pi",longDescription:"RaspiBlitz is a do-it-yourself Bitcoin and Lightning Network node running on a Raspberry Pi. Features a touchscreen LCD, automated setup scripts, and a focus on education. Great for learning how nodes work hands-on.",category:"node",platforms:["nodeos"],url:"https://raspiblitz.org",keywords:["raspiblitz","raspi blitz","raspiblitz.org"],relatedApps:["start9","umbrel","mynode"]},{id:"mynode",name:"myNode",description:"Easy Bitcoin and Lightning node",longDescription:"myNode provides a simple way to run a Bitcoin and Lightning node. Premium and community editions available. Includes Bitcoin Core, LND, Electrum Server, BTC Pay Server, and other essential services.",category:"node",platforms:["nodeos"],url:"https://mynodebtc.com",keywords:["mynode","mynodebtc","my node"],relatedApps:["start9","umbrel","raspiblitz"]},{id:"ndk",name:"NDK",description:"Nostr Development Kit for building apps",longDescription:"NDK (Nostr Development Kit) is a JavaScript/TypeScript library for building Nostr applications. It handles relay connections, event signing, caching, and subscription management. The most popular framework for Nostr web development.",category:"dev-tool",platforms:["web","desktop","cli"],url:"https://github.com/nostr-dev-kit/ndk",keywords:["ndk","nostr development kit","nostr-dev-kit"],relatedApps:["nostr-tools","nak"]},{id:"nostr-tools",name:"nostr-tools",description:"Low-level Nostr protocol utilities",longDescription:"nostr-tools is a low-level JavaScript library for working with the Nostr protocol. Provides event creation, signing, relay communication, NIP implementations, and key management. Foundation library used by many Nostr clients.",category:"dev-tool",platforms:["web","desktop","cli"],url:"https://github.com/nbd-wtf/nostr-tools",keywords:["nostr-tools","nostr tools"],relatedApps:["ndk","nak"]},{id:"nak",name:"Nak",description:"Nostr CLI tool for power users",longDescription:"Nak is a command-line tool for interacting with Nostr relays. Useful for debugging, testing, and scripting. Can publish events, query relays, decode/encode Nostr identifiers, and manage keys from the terminal.",category:"dev-tool",platforms:["cli"],url:"https://github.com/fiatjaf/nak",keywords:["nak","nak cli","nak nostr"],relatedApps:["ndk","nostr-tools"]}],sb=[],eh=[],ib=[],th=/\[\[film:(f?\d+)\]\]/gi,Gl=/\[\[film_ext:([^|]+)\|(\d{4})\|([^\]]+)\]\]/gi,nh=/\[\[song:(s?\d+)\]\]/gi,sh=/\[\[song_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,ih=/\[\[podcast:(p?\d+)\]\]/gi,rh=/\[\[podcast_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,rb=/\[\[book:(b?\d+)\]\]/gi,oh=/\[\[book_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,ah=/\[\[tv_ext:([^|]+)\|([^|\]]+)(?:\|([^|\]]+))?\]\]/gi,lh=/\[\[place_ext:([^|]+)\|([^|]*)(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?\]\]/gi,ch=/\[\[app_ext:([^|]+)\|([^|]*)(?:\|([^|]*))?(?:\|([^|]*))?\]\]/gi,ob=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,ab=/^https?:\/\//i;function lb(e){const t=/\[([^\]]*)\]\((https?:\/\/[^)]+)\)/.exec(e),n=t?t[2]:/(https?:\/\/[^\s)\]"'<>]+)/.exec(e)?.[1];if(!n?.trim())return;const s=n.trim();if(!(s.length>2048))try{const i=new URL(s);return/^https?:$/i.test(i.protocol)?i.href:void 0}catch{return}}function cb(e){const t=[/(?:analyst|according to)\s+\*{0,2}([A-Z][^*\n]+?)\*{0,2}(?:\s+(?:is|calls?|says?|cited)|\.|,)/,/\bby\s+\*{0,2}([A-Z][a-zA-Z]+(?:\s+[A-Z][a-zA-Z]+)+)\*{0,2}/,/(?:source|—)\s*:?\s*\*{0,2}([A-Z][^*\n]+?)\*{0,2}(?:\s|$|\.|,)/,/\*\*([A-Z][^*]+)\*\*(?:\s+(?:is|calls?|says?|cited|predicts?))/];for(const n of t){const s=n.exec(e);if(s){const i=s[1].trim().slice(0,60);if(i.length>3&&i.length<50)return i}}}function ub(e){const t=/!\[[^\]]*\]\((https?:\/\/[^)]+)\)/.exec(e),n=t?t[1]:/(https?:\/\/[^\s)\]"'<>]+\.(?:jpg|jpeg|png|gif|webp)(?:\?[^\s)\]]*)?)/i.exec(e)?.[1];if(n?.trim())try{const s=new URL(n.trim());return/^https?:$/i.test(s.protocol)?s.href:void 0}catch{return}}function Wn(e,t,n){for(;n>0&&(e[t]===` `||e[t]==="\r");)t+=1,n-=1;const s=e.lastIndexOf(` `,t-1),i=s===-1?0:s+1,r=e.indexOf(` `,t+n),o=r===-1?e.length:r;let a=e.slice(i,o);a=a.replace(e.slice(t,t+n),""),a=a.replace(/\[\[(?:film|song|podcast)(?:_ext)?:[^\]]*\]\]/g,""),a=a.replace(/^\s*[-*•]\s*/,"").replace(/^\s*\d+\.\s*/,""),a=a.replace(/\*\*[^*]+\*\*\s*[-–—:]\s*/,"").replace(/\*\*[^*]+\*\*\s*/,""),a=a.replace(/\*\*/g,"").replace(/\*/g,""),a=a.replace(/\(\d{4}\)\s*/g,""),a=a.replace(/^[\s\-–—:,]+/,"").replace(/[\s\-–—:,]+$/,"");const l=a.trim().slice(0,300);return l.length>=10?l:""}function wo(e){return e.toLowerCase().trim().replace(/\/$/,"")}const fb=2e3;function Au(e){return e.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\|/g,", ").replace(/,\s*,+/g,",").replace(/(^|\n)\s*,\s*/g,"$1").replace(/\s*,\s*($|\n)/g,"$1")}function dn(e,t,n,s,i){const r=Au(t).replace(/\s+/g," ").trim().slice(0,150);let o=Au(n).replace(/\n{3,}/g,` `).trim().slice(0,fb);if(r.length<2||o.length<15)return;const a=r.toLowerCase(),l=o.toLowerCase();if(a.length>=10&&l.startsWith(a.slice(0,Math.min(a.length,40)))&&(o=o.slice(r.length).replace(/^[\s.,:;—–-]+/,"").trim(),o.length<15))return;const c=`${r.slice(0,50)}`;if(s.has(c))return;s.add(c);const u=/!\[[^\]]*\]\((https?:\/\/[^)]+)\)/.exec(n)?.[1],d=u?(()=>{try{const f=new URL(u.trim());return/^https?:$/i.test(f.protocol)?f.href:void 0}catch{return}})():void 0;e.push({title:r,content:o,url:lb(n),author:cb(n),imageUrl:d,group:i})}function Bs(e){return e.replace(/\[\[(?:podcast|film|song|book|tvshow|podcast_ext|film_ext|song_ext|book_ext|tv_ext|place_ext|recipe_ext|event_ext):[^\]]*\]\]/g,"").replace(/^\s*\n---\s*\n?/g,"").replace(/\n---\s*$/g,"").replace(/\n{3,}/g,` `).trim()}function Eu(e){const t=[],n=new Set,s=e.replace(/\n+(?:Sources|References|Links):?\s*\n[\s\S]*$/i,"").replace(/\n+\*{0,2}For deeper[^:]*:[\s\S]*$/im,""),i=[],r=/^#{2,3}\s+(.+)$/gm;let o;for(;(o=r.exec(s))!==null;){const h=o[1].trim().replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?\s*/gu,"").replace(/^[#*_\s-]+/,"").trim();h.length>1&&i.push({title:h,start:o.index,contentStart:o.index+o[0].length})}for(let f=0;fx.replace(/^[-•]\s*/,"").trim()).filter(x=>x.length>10);if(E.length>=2)for(const x of E){const y=Bs(x);if(y.length<15)continue;const k=/^\*\*([^*]+)\*\*\s*[:\u2014\u2013–]\s*(.+)/s.exec(y);if(k)dn(t,k[1].trim(),k[2].trim(),n,h.title);else{const w=/^([^.!?]{10,80}[.!?])/.exec(y),C=w?w[1]:y.slice(0,60);dn(t,C,y,n,h.title)}}else dn(t,h.title,g,n)}const a=/\*\*([^*]+(?:camp| side| view)[^*]*)\*\*[🟠🔴🟢]?\s*\n([\s\S]+?)(?=\n\*\*[^*]+(?:camp| side)[^*]*\*\*|\n#{2,3}\s|\n\nThis is|\n\nFor deeper|$)/gimu;for(;(o=a.exec(s))!==null;){const f=o[1].trim(),h=Bs(o[2]);h.length>15&&dn(t,f,h,n)}const l=i.length>0?i[0].start:-1,c=l>0?l:s.indexOf(` --- `);if(c>0){const f=s.slice(0,c).trim().replace(/^[#*_\s-]+/gm,"").trim();f.length>30&&!n.has("Summary")&&dn(t,"Summary",f,n)}if(t.length===0){const f=/(?:^|\n)\s*\*\*([^*]+?)\*\*\s*:?\s*(?:\n|$)/g,h=[];for(;(o=f.exec(s))!==null;){const x=o[1].trim(),y=s.slice(Math.max(0,o.index-10),o.index);/\d+\.\s*$/.test(y)||/[-•]\s*$/.test(y)||x.length>2&&x.length<100&&h.push({title:x,start:o.index,end:o.index+o[0].length})}const b=/(?:^|\n)\s*\d+\.\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,g=[];for(;(o=b.exec(s))!==null;){const x=o[1].trim();x.length>1&&g.push({title:x,start:o.index,contentStart:o.index+o[0].length})}let E;if(g.length>0&&h.length>0){const x=g[0].start,y=h.filter(k=>k.end<=x).pop();y&&(E=y.title)}for(let x=0;x=15&&dn(t,y.title,w,n,E)}if(t.length===0){const x=/(?:^|\n)\s*[-•]\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,y=[];for(;(o=x.exec(s))!==null;){const k=o[1].trim();k.length>1&&y.push({title:k,start:o.index,contentStart:o.index+o[0].length})}for(let k=0;k=15&&dn(t,w.title,N,n)}}if(t.length===0){const x=/(?:^|\n)\s*\*\*([^*]{3,60})\*\*\s*[-–—:]+\s*([\s\S]*?)(?=\n\s*\*\*[^*]{3,60}\*\*\s*[-–—:]|\n{2,}\*\*[^*]+\*\*\s*:|\s*$)/g;for(;(o=x.exec(s))!==null;){const y=o[1].trim(),k=Bs(o[2].trim());y.length>2&&k.length>=15&&dn(t,y,k,n)}}if(t.length>0){const x=g.length>0?g[0].start:s.length,y=h.length>0&&h[0].start30){const w=s.slice(0,k).replace(/\*\*/g,"").replace(/^[#*_\s-]+/gm,"").trim();w.length>30&&!n.has("Summary")&&dn(t,"Summary",w,n)}}}const u=/(This is being called[^.]+\.[^"]*"[^"]+"[^.]*\.)/i.exec(s);u&&!n.has("Key")&&dn(t,"Key takeaway",u[1].trim(),n);const d=["Summary","Key takeaway"];return t.sort((f,h)=>{const b=d.indexOf(f.title),g=d.indexOf(h.title);return b>=0&&g>=0?b-g:b>=0?-1:g>=0?1:0}),t}function db(e){return ub(e)}function Su(e){const t=[],n=new Set,s=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;let i;for(;(i=s.exec(e))!==null;){const r=i[1].trim().slice(0,500),o=i[2].trim();if(r.length<2)continue;const a=/^https?:\/\//i.test(o)?o:`https://${o}`,l=wo(a);n.has(l)||(n.add(l),t.push({title:r,url:a,content:void 0}))}return t}function Cu(e){const t=[],n=new Set;let s;const i=new RegExp(ob.source,"g");for(;(s=i.exec(e))!==null;){const r=s[1].trim().slice(0,500),o=s[2].trim();if(r.length<2||o.length<10||!ab.test(o))continue;try{new URL(o)}catch{continue}const a=o.toLowerCase().replace(/\/$/,"");n.has(a)||(n.add(a),t.push({title:r,url:o,content:void 0}))}return t}function js(e,t){const n=new Map;for(const s of e)n.set(wo(s.url),s);for(const s of t){const i=wo(s.url);n.has(i)||n.set(i,s)}return[...n.values()]}function hb(e){return e.startsWith("f")?e:`f${e}`}function Vo(e){const t=[];let n;const s=new RegExp(th.source,"gi");for(;(n=s.exec(e))!==null;){const i=hb(n[1]);t.includes(i)||t.push(i)}return t}function pb(e){return e.map(t=>sb.find(n=>n.id===t)).filter(t=>!!t)}function mb(e){const t=[],n=new Set;let s;const i=new RegExp(Gl.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=parseInt(s[2],10),a=s[3].trim(),l=`${r.toLowerCase()}|${o}`;n.has(l)||(n.add(l),t.push({id:`ext-${l.replace(/\W/g,"-")}`,title:r,year:o,posterUrl:"",synopsis:Wn(e,s.index,s[0].length),genres:[],rating:0,runtime:0,director:a,cast:[],sources:[]}))}return t}function wa(e){const t=pb(Vo(e)),n=mb(e);return[...t,...n]}function gb(e){return e.startsWith("s")?e:`s${e}`}function uh(e){const t=[];let n;const s=new RegExp(nh.source,"gi");for(;(n=s.exec(e))!==null;){const i=gb(n[1]);t.includes(i)||t.push(i)}return t}function yb(e){return e.map(t=>eh.find(n=>n.id===t)).filter(t=>!!t)}function fh(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),i=["latest news","protocol updates","community debates","real-time information","training cutoff","bip discussion","beyond my training","what people are saying","want me to go","search for what","look up things","direct answer","for deeper coverage","for instant","check these sources","bip 110","bip discussions","web search","developer mailing list","mailing list reactions","technical opinions","community sentiment","twitter","reddit","github","stackexchange","bitcoin bips","bitcoin mailing","canonical source","formal dev","what i'd suggest","for bip","sources to","series","season","episode","animated","anime","netflix","amazon","streaming","hbo","hulu","disney","showtime","cancelled","renewed","viewership","rotten tomatoes","imdb","published","author","edition","chapter","novel","nonfiction","product","brand","company","startup","pricing","meaning","definition","synonym","refers to","describes","example","similar to","also known as","originates from","a word","a term","conveys","evokes","suggests"];for(const r of i)if(n.includes(r)||s.includes(r))return!1;return!(n.length>55||s.length>40||/\b(the act of|a type of|when something|which means|referring to|something that)\b/i.test(s)||/^(this|these|it|that|here|there|when|where|what|how|why|if|but|and|or|the |a |an )\b/i.test(n))}function bb(e){const t=[],n=new Set;let s;const i=new RegExp(sh.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=s[2].trim();if(!fh(r,o))continue;const a=s[3]?parseInt(s[3],10):void 0,l=`${r.toLowerCase()}|${o.toLowerCase()}`;n.has(l)||(n.add(l),t.push({id:`ext-${l.replace(/\W/g,"-")}`,title:r,artist:o,year:a,coverUrl:void 0,sources:[]}))}return t}function Pu(e){const t=e.toLowerCase(),n=[],s=new Set;for(const i of eh){const r=i.id;if(s.has(r))continue;const o=i.title.toLowerCase(),a=i.artist.toLowerCase();if(!t.includes(o))continue;const l=new RegExp("\\b"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","i");if(!l.test(t))continue;const c=t.indexOf(o),d=t.match(l)?.index??-1;d<0||Math.abs(c-d)>120||(s.add(r),n.push({song:i,pos:Math.min(c,d)}))}return n.sort((i,r)=>i.pos-r.pos).map(i=>i.song)}function Iu(e){const t=[],n=new Set,s=[{re:/"([^"]{2,80})"\s+by\s+([A-Za-z0-9][^,\n.]{1,50}?)(?:\s*[,\n.]|$)/gi,titleIdx:1,artistIdx:2},{re:/\*\*([^*]{2,80})\*\*\s+by\s+([A-Za-z0-9][^,\n.]{1,50}?)(?:\s*[,\n.]|$)/g,titleIdx:1,artistIdx:2},{re:/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)?([^\n\-–—]{2,60}?)\s*[-–—]\s*([A-Za-z0-9][^,\n]{1,50}?)(?:\s*[,\n.]|$)/gm,titleIdx:1,artistIdx:2},{re:/([A-Za-z0-9][^\-–—\n]{2,60}?)\s+[-–—]\s+([A-Za-z0-9][^,\n]{1,50}?)(?=\s*[,\n.]|$)/g,titleIdx:1,artistIdx:2}];for(const{re:i,titleIdx:r,artistIdx:o}of s){let a;const l=new RegExp(i.source,i.flags);for(;(a=l.exec(e))!==null;){const c=a[r].trim(),u=a[o].trim();if(c.length<2||u.length<2||!fh(c,u)||/^\d{4}$/.test(c)||/^\d{4}$/.test(u)||/(\[\[)?(film|song|podcast|book|tv|place|recipe|event)(_ext)?:/i.test(c)||/(\[\[)?(film|song|podcast|book|tv|place|recipe|event)(_ext)?:/i.test(u)||/\*\*\[\[/.test(c)||c.includes("]]**"))continue;const d=`${c.toLowerCase()}|${u.toLowerCase()}`;n.has(d)||(n.add(d),t.push({title:c,artist:u,pos:a.index}))}}return t.sort((i,r)=>i.pos-r.pos).map(({title:i,artist:r})=>({id:`ext-${`${i}|${r}`.toLowerCase().replace(/\W/g,"-")}`,title:i,artist:r,coverUrl:void 0,sources:[]}))}function _a(e,t=""){const n=yb(uh(e)),s=bb(e),i=[...n,...s],r=Vo(e).length>0||/\[\[film_ext:/.test(e)||Yl(e).length>0||/\[\[podcast_ext:/.test(e)||/\[\[tv_ext:/.test(e)||/\[\[book_ext:/.test(e);if(i.length>0){if(r)return i;const d=Pu(e),f=Iu(e),h=new Set(i.map(g=>`${g.title.toLowerCase()}|${g.artist.toLowerCase()}`)),b=[...d,...f].filter(g=>!h.has(`${g.title.toLowerCase()}|${g.artist.toLowerCase()}`));return[...i,...b]}if(r)return[];if(as(e))return[];const o=t.toLowerCase();if(o&&!Gy(o))return[];const a=Pu(e),l=Iu(e),c=new Set(a.map(d=>`${d.title.toLowerCase()}|${d.artist.toLowerCase()}`)),u=l.filter(d=>!c.has(`${d.title.toLowerCase()}|${d.artist.toLowerCase()}`));return[...a,...u]}function vb(e){return e.startsWith("p")?e:`p${e}`}function Yl(e){const t=[];let n;const s=new RegExp(ih.source,"gi");for(;(n=s.exec(e))!==null;){const i=vb(n[1]);t.includes(i)||t.push(i)}return t}function wb(e){return e.map(t=>ib.find(n=>n.id===t)).filter(t=>!!t)}function _b(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),i=["bitcoin mailing list","mailing list","developer mailing list","gnusha.org","canonical source","formal dev","github","stackexchange","reddit","twitter","latest news","protocol updates","web search","training cutoff","documentation","bip discussion","bip 110","bitcoin bips"];for(const r of i)if(n.includes(r)||s.includes(r))return!1;return!(n.length>80||s.length>50)}function kb(e){const t=[],n=new Set;let s;const i=new RegExp(rh.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=s[2].trim();if(!_b(r,o))continue;const a=s[3]?parseInt(s[3],10):void 0,l=`${r.toLowerCase()}|${o.toLowerCase()}`;n.has(l)||(n.add(l),t.push({id:`ext-${l.replace(/\W/g,"-")}`,title:r,host:o,year:a,coverUrl:void 0,sources:[]}))}return t}function ka(e){const t=wb(Yl(e)),n=kb(e);return[...t,...n]}function xb(e){const t=[],n=new Set;let s;const i=new RegExp(oh.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=s[2].trim(),a=s[3]?parseInt(s[3],10):void 0,l=`${r.toLowerCase()}|${o.toLowerCase()}`;n.has(l)||(n.add(l),t.push({id:`ext-${l.replace(/\W/g,"-")}`,title:r,author:o,year:a,coverUrl:void 0,description:Wn(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function Tb(e){const t=[],n=new Set,s=[{re:/[""\u201C\u201D]([^"""\u201C\u201D]{2,80})[""\u201C\u201D]\s+by\s+([A-Z][^,\n]{1,50}?)(?:\s+(?:is|was|has|—|–|-)|[,()\n.]|$)/gi,titleIdx:1,authorIdx:2},{re:/\*\*([^*]{2,80})\*\*\s+(?:by|—|–)\s+\*?([A-Z][^*\n]{1,50}?)\*?(?:\s+(?:is|was|has|—|–|-)|[,()*\n.]|$)/g,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*{0,2}([^*\n\-–—]{2,80}?)\*{0,2}\s+(?:by|—|–)\s+\*?([A-Z][^*\n]{1,50}?)\*?(?:\s+(?:is|was|has|—|–|-)|[,()*\n.]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*\d+\.\s*\*\*([^*]{2,80})\*\*\s+by\s+([A-Z][^,\n(—–-]{1,50}?)(?:\s*[,()\n—–-]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*[-•]\s+([^—–\n]{2,80}?)\s+[—–]\s+([A-Z][^,\n(]{1,50}?)(?:\s*\(\d{4}\))?(?:\s*[,\n]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n|[.!?]\s+)([A-Z][a-z]+(?:\s+[A-Z][a-z]*){1,8})\s+by\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){0,4})(?:\s+[a-z]|[,.()\n—–-]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:read|enjoy|recommend|check out|try|start with|pick up)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){1,8})\s+by\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){0,4})(?:\s+[a-z]|[,.()\n—–-]|$)/gi,titleIdx:1,authorIdx:2}];for(const{re:i,titleIdx:r,authorIdx:o}of s){let a;const l=new RegExp(i.source,i.flags);for(;(a=l.exec(e))!==null;){const c=a[r].trim().replace(/^\*\*|\*\*$/g,"").replace(/^\[|\]$/g,""),u=a[o].trim().replace(/^\*\*|\*\*$/g,"");if(c.length<2||u.length<2||/\[\[(film|song|podcast|book)(_ext)?:/.test(c)||/^\d{4}$/.test(c)||/^\d{4}$/.test(u))continue;const d=e.substring(a.index+a[0].length,a.index+a[0].length+200);if(/^\s*\]\s*\(https?:/.test(d)||/\]\(https?:\/\//.test(a[0]))continue;const f=`${c.toLowerCase()}|${u.toLowerCase()}`;if(n.has(f))continue;n.add(f);const h=Wn(e,a.index,a[0].length);t.push({title:c,author:u,desc:h,pos:a.index})}}return t.sort((i,r)=>i.pos-r.pos).map(({title:i,author:r,desc:o})=>({id:`ext-${`${i}|${r}`.toLowerCase().replace(/\W/g,"-")}`,title:i,author:r,description:o,coverUrl:void 0,genres:[],sources:[]}))}function xa(e,t){const n=xb(e);if(n.length>0)return n;if(!Xy(t)&&!Zy(e))return[];if(as(e))return[];const s=e.replace(/\n---\n\s*(?:Sources|References|Links):?\s*\n[\s\S]*$/i,"");return Tb(s)}function Ab(e){const t=[],n=new Set;let s;const i=new RegExp(ah.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=s[2].trim(),a=s[3]?.trim(),l=/^\d{4}$/.test(o),c=l?parseInt(o,10):a&&/^\d{4}$/.test(a)?parseInt(a,10):void 0,u=l?a||void 0:o||void 0,d=r.toLowerCase();n.has(d)||(n.add(d),t.push({id:`ext-${d.replace(/\W/g,"-")}`,title:r,creator:u||void 0,year:c,synopsis:Wn(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function Eb(e){return/\b(season|episodes?|showrunner|streaming|renewed|cancelled|premiere|network|HBO|Netflix|AMC|FX|Apple TV|Disney\+|created by)\b/i.test(e)?(e.match(/\bseason\b/gi)?.length??0)>=1?!0:[/\bepisodes?\b/i,/\bshowrunner\b/i,/\bstreaming\b/i,/\brenewed\b/i,/\bcancelled\b/i,/\bpremiere\b/i,/\bnetwork\b/i,/\b(HBO|Netflix|AMC|FX|Apple TV|Disney\+|Hulu|Amazon Prime)\b/i,/\bseries\b/i,/\bpilot\b/i,/\bminiseries\b/i,/\bcreated by\b/i].filter(s=>s.test(e)).length>=2:!1}function Sb(e){const t=[],n=new Set,s=[/"([^"]{2,60})"\s*[-–—]\s*(?:a |an )?(?:series|show|tv)/gi,/\*\*([^*]{2,60})\*\*\s*[-–—:]\s*(?:a |an )?(?:\w+ )?(?:series|show|drama|comedy|thriller|animated)/gi,/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*{0,2}([^*\n]{2,60}?)\*{0,2}\s*\((\d{4})(?:[-–]\d{0,4})?(?:,\s*\d+ seasons?)?\)/gm,/\*\*([^*]{2,60})\*\*\s*[-–—:]\s*\d+\s*seasons?/gi,/"([^"]{2,60})"\s*[-–—]\s*([A-Z][^,\n.]{1,50}?)(?:\s*[,()\n]|$)/gi];for(const i of s){let r;const o=new RegExp(i.source,i.flags);for(;(r=o.exec(e))!==null;){const a=r[1].trim().replace(/^\*\*|\*\*$/g,"");if(a.length<2||/\[\[(film|song|podcast|book|tv)(_ext)?:/.test(a))continue;const l=a.toLowerCase();if(n.has(l))continue;n.add(l);const c=Wn(e,r.index,r[0].length);t.push({title:a,desc:c,pos:r.index})}}return t.sort((i,r)=>i.pos-r.pos).map(({title:i,desc:r})=>({id:`ext-${i.toLowerCase().replace(/\W/g,"-")}`,title:i,synopsis:r,genres:[],sources:[]}))}function Cb(e){const t=[],n=new Set;let s;const i=new RegExp(Gl.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=parseInt(s[2],10),a=s[3].trim(),l=r.toLowerCase();n.has(l)||(n.add(l),t.push({id:`ext-${l.replace(/\W/g,"-")}`,title:r,year:o,synopsis:Wn(e,s.index,s[0].length),creator:a,genres:[],sources:[]}))}return t}function Ta(e,t){const n=Ab(e);return n.length>0?n:!vo(t)&&!Eb(e)?[]:as(e)?[]:vo(t)&&/\[\[film_ext:/.test(e)?Cb(e):Vo(e).length>0?[]:Sb(e)}function Pb(e){const t=[],n=new Set,s=/!\[([^\]]*)\]\((https?:\/\/[^)]+)\)/gi;let i;for(;(i=s.exec(e))!==null;){const o=i[1].trim(),a=i[2].trim();if(n.has(a))continue;n.add(a);const l=new URL(a).hostname.replace(/^www\./,"");t.push({id:`img-${n.size}`,url:a,alt:o||void 0,title:o||void 0,source:l})}const r=/(https?:\/\/[^\s)"'>]+\.(?:jpg|jpeg|png|gif|webp|svg|avif|bmp|tiff)(?:\?[^\s)"'>]*)?)/gi;for(;(i=r.exec(e))!==null;){const o=i[1].trim();if(n.has(o))continue;n.add(o);const a=new URL(o).hostname.replace(/^www\./,"");t.push({id:`img-${n.size}`,url:o,source:a})}return t}function Ru(e,t){const n=Pb(e);return n.length===0?[]:Jy(t)||n.length>=2||n.length===1&&n[0].alt&&n[0].alt.length>2?n:[]}function Ib(e){const t=[],n=new Set;let s;const i=new RegExp(lh.source,"gi");for(;(s=i.exec(e))!==null;){const r=s[1].trim(),o=s[2]?.trim()||void 0,a=s[3]?.trim()||void 0,l=s[4]?parseFloat(s[4]):void 0,c=s[5]?parseInt(s[5],10):void 0,u=s[6]?.trim()||void 0,d=r.toLowerCase();n.has(d)||(n.add(d),t.push({id:`ext-place-${d.replace(/\W/g,"-")}`,name:r,cuisine:o,city:a,rating:l&&!isNaN(l)?l:void 0,priceLevel:c&&c>=1&&c<=4?c:void 0,address:u,description:Wn(e,s.index,s[0].length),sources:[]}))}return t}function Rb(e){const t=[],n=new Set,s="restaurant|cafe|bar|bistro|pub|pizzeria|bakery|deli|steakhouse|grill|eatery|spot|joint|trattoria|taqueria|brasserie|cantina|chophouse|creamery|diner|tavern",i=[new RegExp(`\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*(?:a |an )?(?:(\\w[\\w\\s]{1,30}?)\\s+)?(?:${s})`,"gi"),new RegExp(`(?:^|\\n)\\s*(?:\\d+\\.\\s*|[-•]\\s*)\\*{0,2}([^*\\n]{2,60}?)\\*{0,2}\\s*[-–—(]\\s*(?:(\\w[\\w\\s&]{1,30}?)\\s+)?(?:${s}|cuisine|food|dining)`,"gim"),new RegExp(`\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*([^\\n]{3,120}?\\b(?:${s})\\b[^\\n]{0,40})`,"gi"),new RegExp(`(?:^|\\n)\\s*(?:\\d+\\.\\s*|[-•]\\s*)\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*([^\\n]{3,120}?\\b(?:${s})\\b[^\\n]{0,40})`,"gim")];for(const r of i){let o;const a=new RegExp(r.source,r.flags);for(;(o=a.exec(e))!==null;){const l=o[1].trim().replace(/^\*\*|\*\*$/g,"").replace(/^\[|\]$/g,"");if(l.length<2||/\[\[(film|song|podcast|book|tv|place)(_ext)?:/.test(l))continue;const c=l.toLowerCase();if(n.has(c))continue;n.add(c);const u=o[2]?.trim(),d=Wn(e,o.index,o[0].length),f=e.slice(o.index,o.index+300),h=/(\d\.?\d?)\s*(?:\/\s*5|stars?|★)/i.exec(f),b=h?parseFloat(h[1]):void 0,g=/(\${1,4})\b/.exec(f),E=g?g[1].length:void 0;t.push({name:l,cuisine:u,desc:d,rating:b,priceLevel:E,pos:o.index})}}return t.sort((r,o)=>r.pos-o.pos).map(({name:r,cuisine:o,desc:a,rating:l,priceLevel:c})=>({id:`ext-place-${r.toLowerCase().replace(/\W/g,"-")}`,name:r,cuisine:o,rating:l,priceLevel:c,description:a,sources:[]}))}function Lb(e){const t=[],n=new Set,s=/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*\*([^*]{2,60})\*\*\s*[-–—:]\s*([^\n]{5,200})/gm;let i;for(;(i=s.exec(e))!==null;){const r=i[1].trim();if(r.length<2||/\[\[(film|song|podcast|book|tv|place)(_ext)?:/.test(r))continue;const o=r.toLowerCase();n.has(o)||(n.add(o),t.push({name:r,desc:i[2].trim(),pos:i.index}))}return t.sort((r,o)=>r.pos-o.pos).map(({name:r,desc:o})=>({id:`ext-place-${r.toLowerCase().replace(/\W/g,"-")}`,name:r,description:o,sources:[]}))}function Lu(e,t){const n=Ib(e);if(n.length>0)return n;if(!wu(t)&&!Qy(e))return[];if(as(e))return[];const s=Rb(e);if(wu(t)){const i=Lb(e),r=new Set(s.map(l=>l.name.toLowerCase())),o=i.filter(l=>!r.has(l.name.toLowerCase())),a=[...s,...o];return a.length>0?a:[]}return s}function Aa(e){const t=[],n=/```(\w*)\n([\s\S]*?)```/g;let s;for(;(s=n.exec(e))!==null;){const i=s[1]||"text",r=s[2].trimEnd();if(r.length<3)continue;const o=e.slice(Math.max(0,s.index-200),s.index),a=/(?:^|\n)\s*(?:\*\*([^*]{2,80})\*\*|#+\s+(.{2,80}))\s*\n?\s*$/.exec(o),l=a?.[1]||a?.[2]||void 0;t.push({language:i,code:r,label:l})}return t}function dh(e){return e.replace(th,"").replace(Gl,"").replace(/\n{3,}/g,` `).trim()}function hh(e){return e.replace(nh,"").replace(sh,"").replace(/\n{3,}/g,` `).trim()}function ph(e){return e.replace(ih,"").replace(rh,"").replace(/\n{3,}/g,` `).trim()}function Nb(e){return e.replace(rb,"").replace(oh,"").replace(/\n{3,}/g,` `).trim()}function Mb(e){return e.replace(ah,"").replace(/\n{3,}/g,` `).trim()}function Ob(e){return e.replace(lh,"").replace(/\n{3,}/g,` `).trim()}function $b(e){return e.replace(ch,"").replace(/\n{3,}/g,` `).trim()}function Db(e){return dh(hh(ph(Nb(Mb(Ob(Ub(Bb($b(e)))))))))}function Fb(e){return e.replace(/^[\s]*[-*]\s*\[[^\]]+\]\(https?:\/\/[^)\s]+\)\s*$/gm,"").replace(/\s*\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,(t,n)=>` ${n}`).replace(/\n{3,}/g,` `).trim()}const mh=/]+)>([\s\S]*?)<\/recipe_ext>/gi;function Nu(e){const t=[];let n;for(;(n=mh.exec(e))!==null;){const s=n[1],i=n[2],r=s.match(/title="([^"]*)"/)?.[1]||"Recipe",o=s.match(/servings="([^"]*)"/)?.[1],a=s.match(/time="([^"]*)"/)?.[1],l=s.match(/calories="([^"]*)"/)?.[1],c=i.split(` `).map(f=>f.trim()).filter(Boolean),u=[],d=[];for(const f of c)/^[-*]\s+/.test(f)?u.push(f.replace(/^[-*]\s+/,"")):/^\d+[.)]\s+/.test(f)&&d.push(f.replace(/^\d+[.)]\s+/,""));t.push({title:r,servings:o,time:a,calories:l,ingredients:u,steps:d})}return t}function Ub(e){return e.replace(mh,"").replace(/\n{3,}/g,` `).trim()}const gh=/]*?)(?:\/>|>([\s\S]*?)<\/event_ext>)/gi;function J_(e){const t=[];let n;for(;(n=gh.exec(e))!==null;){const s=n[1],i=n[2]?.trim(),r=s.match(/title="([^"]*)"/)?.[1]||"Event",o=s.match(/date="([^"]*)"/)?.[1]||"",a=s.match(/location="([^"]*)"/)?.[1],l=s.match(/url="([^"]*)"/)?.[1];t.push({title:r,date:o,location:a,url:l,description:i})}return t}function Bb(e){return e.replace(gh,"").replace(/\n{3,}/g,` `).trim()}const jb=/\.(com|org|net|io|co|app|dev|xyz|social|news|info|me|tv|fm|live|chat|fyi|ai|so|world|land|pub|lol|cafe|money|exchange|market|tech|design|page|site|online|store|cloud|network|community|foundation)$/i,Hb=/\.(js|ts|css|html|json|md|txt|pdf|png|jpg|jpeg|gif|svg|vue|yaml|yml|xml|csv|sql|sh|py|rb|go|rs|toml|lock|env|log|map|wasm|woff2?|ttf|eot|ico)$/i;function Mu(e){const t=[],n=new Set,s=[];let i;const r=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;for(;(i=r.exec(e))!==null;)s.push([i.index,i.index+i[0].length]);const o=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;for(;(i=o.exec(e))!==null;)s.push([i.index,i.index+i[0].length]);const a=/https?:\/\/[^\s)\]"'<>,]+/g;for(;(i=a.exec(e))!==null;)s.push([i.index,i.index+i[0].length]);function l(u,d){return s.some(([f,h])=>u>=f&&u+d<=h)}const c=/\b([a-zA-Z][a-zA-Z0-9-]*(?:\.[a-zA-Z][a-zA-Z0-9-]*)*\.[a-zA-Z]{2,})\b/g;for(;(i=c.exec(e))!==null;){if(l(i.index,i[0].length))continue;const u=i[1];if(!jb.test(u)||Hb.test(u)||/^\d/.test(u))continue;const d=`https://${u}`,f=wo(d);if(n.has(f))continue;n.add(f);const h=u.charAt(0).toUpperCase()+u.slice(1);t.push({title:h,url:d,content:void 0})}return t}function Ou(e,t){const n=[],s=new Set;let i=!1;const r=new RegExp(ch.source,"gi");let o;for(;(o=r.exec(e))!==null;){i=!0;const d=o[1].trim(),f=o[2]?.trim()||"dev-tool",h=(o[3]?.trim()||"web").split(",").map(x=>x.trim()),b=o[4]?.trim()||"",g=`ext-${d.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(s.has(g))continue;s.add(g);const E=va.find(x=>x.name.toLowerCase()===d.toLowerCase()||x.keywords.some(y=>y.toLowerCase()===d.toLowerCase()));if(E&&!s.has(E.id))s.add(E.id),n.push(E);else if(!E){const x=Wn(e,o.index,o[0].length)||`${d} — ${f} app`;n.push({id:g,name:d,description:x,longDescription:x,category:f,platforms:h,url:b,keywords:[d.toLowerCase()]})}}const a=e.toLowerCase();for(const d of va){if(s.has(d.id))continue;const f=[d.name.toLowerCase(),...d.keywords.map(h=>h.toLowerCase())];for(const h of f){if(h.length<3)continue;const b=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if((h.length<=4?new RegExp(`\\b${b}\\b`,"i"):new RegExp(b,"i")).test(a)&&!s.has(d.id)){s.add(d.id),n.push(d);break}}}if(i)return n;const l=t.toLowerCase(),c=va.some(d=>[d.name.toLowerCase(),...d.keywords.map(f=>f.toLowerCase())].some(f=>f.length>=3&&l.includes(f)));return(Kl(t)||ur(t)||c||tb(e))&&n.length>=1||n.length>=2?n:[]}const zb=[],Vb=[],Wb=[],Bt=F(!1),Et=F([]),$u=F([]),Du=F([]),Mr=F([]),Ea=F([]),Fu=F([]),Sa=F([]),Uu=F(null),St=F([]),Ct=F([]),Xn=F([]),Bu=F([]),ju=F([]),Hu=F([]),zu=F([]),yi=F(null),bi=F(null),vi=F(null),wi=F(null),_i=F(null),ki=F(null),xi=F(null),Ti=F(null),Ai=F(null),Ei=F(null),Si=F(null),Hs=F(null),Or=F(0),pe=F("Recommended Films"),Ca=F(""),Vu=F(""),en=F("film"),Zn=F("film"),jt=F([]),$r=F(null),Dr=F(null),Fr=F(null),Ur=F([]),Pa=F(!1),In=F({film:!1,song:!1,podcast:!1,image:!1}),Br=F(!1);function Ia(){function e(A,R="",K=[]){Ca.value=R.trim(),Vu.value=A;const ae=_a(A,R);let m=wa(A);const v=ka(A),T=xa(A,R),S=Ta(A,R);S.length>0&&vo(R)&&(m=m.filter(ye=>!ye.id.startsWith("ext-")));const $=Cu(A),P=Su(A),V=Mu(A);Ea.value=[];const H=$.length>0||P.length>0||V.length>0?$:[],D=js(js(H,P),V),se=D.length>0,X=Ou(A,R),te=X.length>0,ie=Aa(A),de=ie.length>0&&(fl(R)||ku(A)),ge=ur(R)||xu(A),ve=Ru(A,R),He=Lu(A,R),ze=Nu(A),it=ze.length>0||_u(A),Xe=Eu(A),Dt=m.length>0||ae.length>0||v.length>0||T.length>0||S.length>0||ve.length>0||He.length>0,Jt=Xe.length>=1&&(Es(R)||as(A)||/sentiment|bearish|bull case|macro|%|BTC|bitcoin|BIP|protocol|debate|what'?s happening|ETF|inflow|trading at|key developments|price recovery|institutional|analyst watch|market cap/i.test(A)||!Dt&&!se&&Xe.length>=2),Ne=Es(R)||as(A),Ze=Ne&&(K.length>0||D.length>0||Es(R)),Je=js(K,Ea.value);if(D.length>0&&Ne){const ye=D.map(Be=>Be.url);Ky(ye).then(Be=>{if(Be.length===0)return;Ea.value=Be;const je=js(Mr.value,Be);if(Mr.value=je,!jt.value.includes("news")){const Ut=jt.value.indexOf("prompt");Ut>=0?jt.value=[...jt.value.slice(0,Ut),"news",...jt.value.slice(Ut)]:jt.value=["news",...jt.value],Zn.value="news"}const ht=ba(Ca.value);pe.value=ht?`${ht} — ${je.length} articles`:`${je.length} Articles`})}const Ve=Tu(R,m.length>0,ae.length>0,v.length>0,T.length>0,S.length>0,ve.length>0,He.length>0,Ze,se,Jt,ge,te,de,it),ci=Pa.value?[["film",Et.value.length],["song",St.value.length],["podcast",Ct.value.length],["image",Xn.value.length]].filter(([,ye])=>ye>0).sort((ye,Be)=>Be[1]-ye[1]).map(([ye])=>ye):[],Ns=Ve.filter(ye=>!ci.includes(ye)),un=[...ci,...Ns],Go=un.length>0?[...un,"prompt"]:["prompt"];jt.value=Go,Zn.value=un[0]??"prompt";const gs=Ve.includes("film"),Yo=Ve.includes("book"),Xo=Ve.includes("tvshow"),Qe=Ve.includes("image"),qn=Ve.includes("place"),Zo=Ve.includes("song"),Ar=Ve.includes("podcast"),ui=Ve.includes("news"),Er=Ve.includes("websites"),fi=Ve.includes("magazine"),Jo=Ve.includes("recipe"),qt=Ve.includes("app"),xn=Ve.includes("code"),Tn=gs?m:[],Ft=Yo?T:[],Ot=Xo?S:[],Ms=Qe?ve:[],rt=qn?He:[],An=Zo?ae:[],En=Ar?v:[],Kn=ui?Je:[],Os=Er?D:[],Sr=fi?Xe:[],ne=Jo?ze:[],_=qt?X:[],B=xn?ie:[];In.value.film||(Et.value=Tn),In.value.song||(St.value=An),In.value.podcast||(Ct.value=En),In.value.image||(Xn.value=Ms),$u.value=Ft,Du.value=Ot,Bu.value=rt,Mr.value=Kn,Fu.value=Os,ju.value=ne,Hu.value=_,zu.value=B,Sa.value=Sr,Uu.value=fi?db(A)??K[0]?.imgSrc??null:null,yi.value=null,bi.value=null,vi.value=null,xi.value=null,Ti.value=null,wi.value=null,_i.value=null,ki.value=null,Ei.value=null,Si.value=null,Ai.value=null,Hs.value=null,Tn.length>0||Ft.length>0||Ot.length>0?en.value="film":An.length>0?en.value="song":En.length>0?en.value="podcast":(Kn.length>0,en.value="film");const Q=un[0];if(ci.includes(Q))Q==="image"?pe.value=`${Xn.value.length} Images`:Q==="film"?pe.value=Et.value.length===1?Et.value[0].title:`${Et.value.length} Films`:Q==="song"?pe.value=St.value.length===1?St.value[0].title:`${St.value.length} Songs`:pe.value=Ct.value.length===1?Ct.value[0].title:`${Ct.value.length} Podcasts`;else if(Q==="place"&&rt.length>0)pe.value=rt.length===1?rt[0].name:`${rt.length} Places`;else if(Q==="tvshow"&&Ot.length>0)pe.value=Ot.length===1?Ot[0].title:`${Ot.length} TV Series`;else if(Q==="book"&&Ft.length>0)pe.value=Ft.length===1?Ft[0].title:`${Ft.length} Books`;else if(Q==="image"&&Ms.length>0)pe.value=`${Ms.length} Images`;else if(Tn.length===1)pe.value=Tn[0].title;else if(Tn.length>1)pe.value=`${Tn.length} Films`;else if(Ft.length===1)pe.value=Ft[0].title;else if(Ft.length>1)pe.value=`${Ft.length} Books`;else if(Ot.length===1)pe.value=Ot[0].title;else if(Ot.length>1)pe.value=`${Ot.length} TV Series`;else if(An.length===1)pe.value=An[0].title;else if(An.length>1)pe.value=`${An.length} Songs`;else if(rt.length===1)pe.value=rt[0].name;else if(rt.length>1)pe.value=`${rt.length} Places`;else if(En.length===1)pe.value=En[0].title;else if(En.length>1)pe.value=`${En.length} Podcasts`;else if(Kn.length>0){const ye=ba(R);pe.value=ye?`${ye} — ${Kn.length} articles`:`${Kn.length} Articles`}else if(Sr.length>0){const ye=ba(R);pe.value=ye?`${ye} — Brief`:"AI Brief"}else ne.length===1?pe.value=ne[0].title:ne.length>1?pe.value=`${ne.length} Recipes`:B.length>0?pe.value=`${B.length} Code Blocks`:_.length>0?pe.value=`${_.length} Apps`:Os.length>0?pe.value=`${Os.length} Websites`:ge?pe.value="Nostr":pe.value!=="Nothing found"&&pe.value!=="Loading…"&&(pe.value="Content");Bt.value=un.length>0}function t(){Br.value=!0,pe.value="Loading…"}function n(A){Et.value=A.films??[],St.value=A.songs??[],Ct.value=A.podcasts??[],Xn.value=A.images??[],In.value={film:Et.value.length>0,song:St.value.length>0,podcast:Ct.value.length>0,image:Xn.value.length>0},Pa.value=In.value.film||In.value.song||In.value.podcast||In.value.image;const R=[["film",Et.value.length],["song",St.value.length],["podcast",Ct.value.length],["image",Xn.value.length]].filter(([,K])=>K>0).sort((K,ae)=>ae[1]-K[1]).map(([K])=>K);if(R.length>0){jt.value=[...R,"prompt"],R.includes(Zn.value)||(Zn.value=R[0]);const K=R[0];K==="image"?pe.value=`${Xn.value.length} Images`:K==="film"?pe.value=Et.value.length===1?Et.value[0].title:`${Et.value.length} Films`:K==="song"?pe.value=St.value.length===1?St.value[0].title:`${St.value.length} Songs`:pe.value=Ct.value.length===1?Ct.value[0].title:`${Ct.value.length} Podcasts`,Bt.value=!0}else Br.value&&(pe.value="Nothing found");Br.value=!1}function s(A){jt.value.includes(A)&&(Zn.value=A)}function i(A,R,K=[]){let ae=wa(A);const m=_a(A,R),v=ka(A),T=xa(A,R),S=Ta(A,R);S.length>0&&vo(R)&&(ae=ae.filter(Ve=>!Ve.id.startsWith("ext-")));const $=Eu(A),P=Cu(A),V=Su(A),W=Mu(A),H=K.length>0&&(Es(R)||as(A)),D=H?K:[],X=P.length>0||V.length>0||W.length>0?P:[],te=js(js(X,V),W),ie=te.length>0,de=Ou(A,R),ge=de.length>0,ve=Aa(A),He=ve.length>0&&(fl(R)||ku(A)),ze=ur(R)||xu(A),it=Ru(A,R),Xe=Lu(A,R),Jt=Nu(A).length>0||_u(A),Ne=ae.length>0||m.length>0||v.length>0||T.length>0||S.length>0||it.length>0||Xe.length>0,Ze=$.length>=1&&(Es(R)||as(A)||/sentiment|bearish|bull case|macro|%|BTC|bitcoin|BIP|protocol|debate|what'?s happening|ETF|inflow|trading at|key developments|price recovery|institutional|analyst watch|market cap/i.test(A)||!Ne&&!ie&&$.length>=2),Je=Tu(R,ae.length>0,m.length>0,v.length>0,T.length>0,S.length>0,it.length>0,Xe.length>0,H,ie,Ze,ze,ge,He,Jt);return{films:Je.includes("film")?ae:[],books:Je.includes("book")?T:[],tvSeries:Je.includes("tvshow")?S:[],images:Je.includes("image")?it:[],places:Je.includes("place")?Xe:[],songs:Je.includes("song")?m:[],podcasts:Je.includes("podcast")?v:[],newsLinks:Je.includes("news")?D:[],websitesLinks:Je.includes("websites")?te:[],magazineSections:Je.includes("magazine")?$:[],apps:Je.includes("app")?de:[],codeBlocks:Je.includes("code")?ve:[],hasNostr:ze}}function r(){yi.value=null,bi.value=null,vi.value=null,xi.value=null,Ti.value=null,wi.value=null,_i.value=null,ki.value=null,Ei.value=null,Si.value=null,Ai.value=null,Hs.value=null,$r.value=null,Dr.value=null,Fr.value=null,Ur.value=[]}function o(A){r(),yi.value=A}function a(){yi.value=null}function l(A){r(),bi.value=A}function c(){bi.value=null}function u(A){r(),wi.value=A}function d(){wi.value=null}function f(A){r(),_i.value=A}function h(){_i.value=null}function b(A){r(),ki.value=A,Bt.value=!0}function g(){ki.value=null}function E(A){r(),Ai.value=A,Bt.value=!0}function x(){Ai.value=null}function y(A,R){r(),Dr.value={content:A,title:R},Bt.value=!0}function k(){Dr.value=null}function w(A,R){r(),Fr.value={url:A,title:R},Bt.value=!0}function C(){Fr.value=null}function N(A){r(),Ur.value=A,Bt.value=!0}function q(){Ur.value=[]}function U(A,R){r(),Hs.value=A,Or.value=R}function M(){Hs.value=null}function O(A){const R=Sa.value;if(!R.length)return;let K=Or.value;K+=A==="next"?1:-1,K<0&&(K=R.length-1),K>=R.length&&(K=0),Or.value=K,Hs.value=R[K]}function j(A){r(),vi.value=A}function z(){vi.value=null}function re(A){r(),xi.value=A}function _e(){xi.value=null}function Ue(A){r(),Ti.value=A}function Te(){Ti.value=null}function fe(A){r(),Ei.value=A}function me(){Ei.value=null}function Tt(A){r(),Si.value=A}function At(){Si.value=null}function ke(A){r(),$r.value=A}function Ke(){$r.value=null}function J(){Bt.value=!0,Zn.value="design-system",jt.value=["design-system"],pe.value="Design System",r()}function ee(){Bt.value=!1,r(),Zn.value="film",jt.value=[]}function le(){Et.value=[...zb],St.value=[],Ct.value=[],pe.value="Your Film Library",en.value="film",Bt.value=!0,r()}function Ce(){Et.value=[],St.value=[...Vb],Ct.value=[],pe.value="Your Song Library",en.value="song",Bt.value=!0,r()}function I(){Et.value=[],St.value=[],Ct.value=[...Wb],pe.value="Your Podcast Library",en.value="podcast",Bt.value=!0,r()}return{panelOpen:Bt,panelFilms:Et,panelBooks:$u,panelTVSeries:Du,panelImages:Xn,panelPlaces:Bu,panelSongs:St,panelPodcasts:Ct,archyContentActive:Pa,archyContentLoading:Br,beginArchyContentLoad:t,setArchyContent:n,panelWebResults:Mr,panelWebsites:Fu,panelRecipes:ju,panelApps:Hu,panelCodeBlocks:zu,panelMagazineSections:Sa,panelMagazineHeroImage:Uu,selectedFilm:yi,selectedBook:bi,selectedTVSeries:vi,selectedImage:xi,selectedPlace:Ti,selectedSong:wi,selectedPodcast:_i,selectedArticle:ki,selectedRecipe:Ei,selectedApp:Si,selectedWebsite:Ai,selectedMagazineSection:Hs,magazineSectionIndex:Or,panelTitle:pe,panelQuery:Ca,panelResponseText:Vu,contentType:en,activeTab:Zn,availableTabs:jt,setActiveTab:s,extractFilmIds:Vo,extractAllFilms:wa,extractAllBooks:xa,extractAllTVSeries:Ta,extractSongIds:uh,extractAllSongs:_a,extractPodcastIds:Yl,extractAllPodcasts:ka,extractCodeBlocks:Aa,getContextualInlineContent:i,updatePanelFromText:e,stripFilmTags:dh,stripSongTags:hh,stripPodcastTags:ph,stripContentTags:Db,stripMarkdownLinks:Fb,openFilmDetail:o,closeFilmDetail:a,openBookDetail:l,closeBookDetail:c,openSongDetail:u,closeSongDetail:d,openPodcastDetail:f,closePodcastDetail:h,openArticleDetail:b,closeArticleDetail:g,openWebsiteDetail:E,closeWebsiteDetail:x,openRecipeDetail:fe,closeRecipeDetail:me,openAppDetail:Tt,closeAppDetail:At,openMagazineSectionDetail:U,closeMagazineSectionDetail:M,navigateMagazineSection:O,openTVSeriesDetail:j,closeTVSeriesDetail:z,openImageDetail:re,closeImageDetail:_e,openPlaceDetail:Ue,closePlaceDetail:Te,selectedDesignSystemItem:$r,openDesignSystemItem:ke,closeDesignSystemItem:Ke,longFormArticle:Dr,openLongFormArticle:y,closeLongFormArticle:k,pdfUrl:Fr,openPdfViewer:w,closePdfViewer:C,mapPlaces:Ur,openMapView:N,closeMapView:q,enterDesignSystemMode:J,closePanel:ee,showAllFilms:le,showAllSongs:Ce,showAllPodcasts:I}}const qb=[{id:"bitcoin-core",name:"Bitcoin Core",state:"running",status:"Synced — Block 893,412"},{id:"lnd",name:"LND",state:"running",status:"6 channels, 12 peers"},{id:"mempool",name:"Mempool",state:"running",status:"Healthy"},{id:"btcpay-server",name:"BTCPay Server",state:"running",status:"Healthy"},{id:"nextcloud",name:"Nextcloud",state:"running",status:"847 files, 12.4 GB used"},{id:"immich",name:"Immich",state:"running",status:"2,341 photos, 89 videos"},{id:"nostr-rs-relay",name:"nostr-rs-relay",state:"running",status:"14,203 events"},{id:"home-assistant",name:"Home Assistant",state:"stopped",status:"Stopped"},{id:"searxng",name:"SearXNG",state:"running",status:"Healthy"},{id:"grafana",name:"Grafana",state:"running",status:"Healthy"},{id:"ollama",name:"Ollama",state:"stopped",status:"Stopped"}],Kb={name:"Archipelago",version:"0.9.2"},Gb={connected:!0},Yb={available:!0,status:"active",alias:"MyNode",num_active_channels:6,num_peers:12,synced_to_chain:!0,block_height:893412,balance_sats:125e4,channel_balance_sats:35e5,pending_open_balance:0},Xb={available:!0,block_height:893412,sync_progress:1,chain:"mainnet",mempool_tx_count:42350,mempool_size:128e6},Zb=[{name:"Documents",path:"/Documents",type:"folder"},{name:"Photos",path:"/Photos",type:"folder"},{name:"Music",path:"/Music",type:"folder"},{name:"Videos",path:"/Videos",type:"folder"},{name:"family-reunion-2024.jpg",path:"/Photos/family-reunion-2024.jpg",type:"file",size:42e5,modified:"2024-12-25"},{name:"sunset-beach.jpg",path:"/Photos/sunset-beach.jpg",type:"file",size:38e5,modified:"2024-11-15"},{name:"node-setup-guide.pdf",path:"/Documents/node-setup-guide.pdf",type:"file",size:21e5,modified:"2024-10-01"},{name:"bitcoin-whitepaper.pdf",path:"/Documents/bitcoin-whitepaper.pdf",type:"file",size:184e3,modified:"2024-01-03"},{name:"household-budget.ods",path:"/Documents/household-budget.ods",type:"file",size:45e3,modified:"2025-02-28"},{name:"birthday-video.mp4",path:"/Videos/birthday-video.mp4",type:"file",size:25e7,modified:"2025-01-15"},{name:"conference-talk.mp4",path:"/Videos/conference-talk.mp4",type:"file",size:18e7,modified:"2024-09-20"},{name:"podcast-episode.mp3",path:"/Music/podcast-episode.mp3",type:"file",size:45e6,modified:"2025-03-01"},{name:"backup-keys.txt",path:"/Documents/backup-keys.txt",type:"file",size:1200,modified:"2024-06-15"},{name:"recipes.md",path:"/Documents/recipes.md",type:"file",size:8500,modified:"2025-02-14"},{name:"travel-plans.md",path:"/Documents/travel-plans.md",type:"file",size:3200,modified:"2025-03-05"}],Ra=F(!1),tn=F(!1),hn=F([]),Wu=F(null),Ci=F([]),Pi=F({}),jr=F({}),Ii=F({}),Ri=F([]),Li=F({available:!1});let Hr=[];function Jb(){function e(){if(tn.value)return;const f=!!window.__AIUI_EMBEDDED__;if(Ra.value=f,new URLSearchParams(window.location.search).has("mockArchy")&&!f){tn.value=!0,Ra.value=!0,hn.value=["apps","system","network","wallet","bitcoin","files"],Ci.value=qb,Pi.value=Kb,jr.value=Gb,Ii.value=Yb,Li.value=Xb,Ri.value=Zb,console.log("[AIUI] Mock Archy data loaded for dev testing");return}if(!f||!Qt.isInArchy())return;Qt.init(),tn.value=!0;const b=Qt.onPermissionsUpdate(E=>{hn.value=E,t(E)});Hr.push(b);const g=Qt.onThemeUpdate(E=>{Wu.value=E.accent,c(E.accent),ql().setTheme(E.mode)});Hr.push(g),Qt.requestTheme(),a(),l("own")}async function t(f){const h=[];function b(g,E,x=()=>!0){return Qt.requestContext(g).then(y=>{if(!y.permitted){console.warn(`[AIUI Archy] ${g}: not permitted — user should enable in Archy Settings`);return}y.data&&x(y.data)&&E(y.data)}).catch(y=>{console.warn(`[AIUI Archy] ${g} fetch failed:`,y?.message??y)})}f.includes("apps")&&h.push(b("apps",g=>{Ci.value=g},Array.isArray)),f.includes("system")&&h.push(b("system",g=>{Pi.value=g})),f.includes("network")&&h.push(b("network",g=>{jr.value=g})),f.includes("wallet")&&h.push(b("wallet",g=>{Ii.value=g})),f.includes("bitcoin")&&h.push(b("bitcoin",g=>{Li.value=g})),f.includes("files")&&h.push(b("files",g=>{Ri.value=g},Array.isArray)),await Promise.all(h)}async function n(){tn.value&&await t(hn.value)}async function s(f,h={}){return tn.value?Qt.requestAction(f,h):{success:!1,error:"Not initialized"}}async function i(f){const h=await s("read-file",{path:f}),b=h.data;return h.success&&b?b:null}async function r(f,h=50){const b=await s("tail-logs",{appId:f,lines:String(h)}),g=b.data;return b.success&&g?g.lines:null}async function o(f="all",h="own"){if(tn.value)try{const b=await Qt.requestArchyContent(f,h);if(!b.permitted){console.warn("[AIUI Archy] content: not permitted — user should enable Media/File access in Archy Settings");return}const g=Ia();g.setArchyContent({films:b.films,songs:g.panelSongs.value,podcasts:b.podcasts,images:b.images})}catch(b){console.warn("[AIUI Archy] content fetch failed:",b?.message??b)}}async function a(){if(!tn.value)return;const f=[],h=[],b=[],g=new Set,E=k=>{if(!k)return!1;let w=!1;for(const C of k.films??[]){const N=`film:${C.id}`;g.has(N)||(g.add(N),f.push(C),w=!0)}for(const C of k.podcasts??[]){const N=`pod:${C.id}`;g.has(N)||(g.add(N),h.push(C),w=!0)}for(const C of k.images??[]){const N=`img:${C.id}`;g.has(N)||(g.add(N),b.push(C),w=!0)}return w},x=()=>{const k=Ia();k.setArchyContent({films:[...f],songs:k.panelSongs.value,podcasts:[...h],images:[...b]})},y=k=>Qt.requestArchyContent("all",k).then(w=>w.permitted?w:(console.warn(`[AIUI Archy] content(${k}): not permitted — enable Media/File access in Archy Settings`),null)).catch(w=>(console.warn(`[AIUI Archy] content(${k}) failed:`,w?.message??w),null));E(await y("own"))&&x(),await Promise.all(["owned","peers"].map(k=>y(k).then(w=>{E(w)&&x()})))}async function l(f="own"){if(tn.value)try{const h=await Qt.requestArchyContent("library",f);if(!h.permitted){console.warn("[AIUI Archy] library: not permitted — user should enable Media/File access in Archy Settings");return}const b=Ia();b.setArchyContent({films:b.panelFilms.value,songs:h.songs,podcasts:b.panelPodcasts.value})}catch(h){console.warn("[AIUI Archy] library fetch failed:",h?.message??h)}}function c(f){document.documentElement.style.setProperty("--color-accent",f)}function u(){if(!tn.value)return"";const f=[];if(hn.value.includes("apps")&&Ci.value.length>0){const h=Ci.value.map(b=>`- ${b.name} (${b.state}${b.status?", "+b.status:""})`).join(` `);f.push(`**Installed apps on this node:** ${h} You can view recent app logs by requesting the tail-logs action with an appId.`)}if(hn.value.includes("system")&&Pi.value.name){const h=Pi.value;f.push(`**System:** ${h.name}${h.version?" v"+h.version:""}`)}if(hn.value.includes("network")){const h=jr.value;f.push(`**Network:** ${h.connected?"Connected":"Disconnected"}`)}if(hn.value.includes("wallet")&&Ii.value.available){const h=Ii.value,b=[];h.alias&&b.push(h.alias),h.num_active_channels!==void 0&&b.push(`${h.num_active_channels} channels`),h.num_peers!==void 0&&b.push(`${h.num_peers} peers`),h.balance_sats!==void 0&&b.push(`On-chain: ${h.balance_sats.toLocaleString()} sats`),h.channel_balance_sats!==void 0&&b.push(`In channels: ${h.channel_balance_sats.toLocaleString()} sats`),h.synced_to_chain!==void 0&&b.push(h.synced_to_chain?"synced":"syncing"),f.push(`**Lightning (LND):** ${b.join(" | ")}`)}if(hn.value.includes("bitcoin")&&Li.value.available){const h=Li.value,b=h.sync_progress?(h.sync_progress*100).toFixed(2)+"%":"unknown",g=[`Block ${h.block_height?.toLocaleString()??"?"}`,`${b} synced`];h.chain&&g.push(h.chain),h.mempool_tx_count&&g.push(`mempool: ${h.mempool_tx_count.toLocaleString()} txs`),f.push(`**Bitcoin:** ${g.join(", ")}`)}if(hn.value.includes("files")&&Ri.value.length>0){const h=Ri.value,b=h.filter(N=>N.type==="folder"),g=h.filter(N=>N.type==="file"),E=g.filter(N=>/\.(jpg|jpeg|png|gif|webp|svg|heic|heif)$/i.test(N.name)),x=g.filter(N=>/\.(mp4|mkv|avi|mov|webm)$/i.test(N.name)),y=g.filter(N=>/\.(mp3|flac|wav|ogg|m4a|aac|opus)$/i.test(N.name)),k=g.filter(N=>/\.(pdf|doc|docx|txt|md|ods|xlsx|csv)$/i.test(N.name)),w=[`${h.length} items`];b.length>0&&w.push(`${b.length} folders (${b.map(N=>N.name).join(", ")})`),E.length>0&&w.push(`${E.length} images`),x.length>0&&w.push(`${x.length} videos`),y.length>0&&w.push(`${y.length} audio files`),k.length>0&&w.push(`${k.length} documents`);const C=g.slice(0,15).map(N=>N.name).join(", ");f.push(`**Files:** ${w.join(" | ")} Recent: ${C} You can read file contents by requesting the read-file action with a file path.`)}return f.length===0?"":` **Archy Node Context** (this user is running AIUI on their Archipelago node): ${f.join(` `)} You can help the user manage their node, check service status, browse files, and recommend apps. Available actions: open an app (open-app), install an app (install-app), tail app logs (tail-logs), read a file (read-file), navigate in Archy (navigate). When recommending apps, use [[app_ext:...]] tags and check if they're already installed. When discussing the user's files, mention specific files you can see. If the user asks about their photos, videos, or music, reference the file counts above.`}function d(){for(const f of Hr)f();Hr=[],Qt.destroy(),tn.value=!1}return{isEmbedded:Ht(Ra),isInitialized:Ht(tn),permissions:Ht(hn),accentColor:Ht(Wu),installedApps:Ht(Ci),systemInfo:Ht(Pi),networkInfo:Ht(jr),walletInfo:Ht(Ii),fileList:Ht(Ri),bitcoinInfo:Ht(Li),init:e,destroy:d,refreshContext:n,requestAction:s,readFile:i,tailLogs:r,requestArchyContent:o,requestArchyAllContent:a,requestArchyLibrary:l,buildArchyContext:u}}function Qb(){const e=F(0),t=F(!1),n=F(typeof window<"u"?window.innerHeight:0);let s=typeof window<"u"?window.innerHeight:0,i=null;function r(){i&&clearTimeout(i),i=setTimeout(()=>{const a=window.visualViewport;if(!a)return;const l=Math.max(0,s-a.height);e.value=l,t.value=l>100,n.value=a.height},50)}function o(){const a=window.visualViewport;a&&!t.value&&(s=a.height,n.value=a.height)}return Ls(()=>{const a=window.visualViewport;a&&(s=a.height,n.value=a.height,a.addEventListener("resize",r),a.addEventListener("scroll",r)),window.addEventListener("resize",o)}),$o(()=>{const a=window.visualViewport;a&&(a.removeEventListener("resize",r),a.removeEventListener("scroll",r)),window.removeEventListener("resize",o)}),{keyboardHeight:e,isKeyboardOpen:t,viewportHeight:n}}const ev=/^https?:\/\//i,tv=zl("articleOverlay",()=>{const e=F(!1),t=F(null),n=F(""),s=F(null),i=F(null);function r(a,l="",c,u){const d=String(a??"").trim();if(ev.test(d)){try{new URL(d)}catch{return}t.value=d,n.value=String(l??"Article").slice(0,200),s.value=typeof c=="string"&&c.trim().length>0?c.trim():null,i.value=typeof u=="string"&&u.trim().length>0?u.trim():null,e.value=!0}}function o(){e.value=!1,t.value=null,n.value="",s.value=null,i.value=null}return{isOpen:e,url:t,title:n,content:s,imgSrc:i,open:r,close:o}});const{entries:yh,setPrototypeOf:qu,isFrozen:nv,getPrototypeOf:sv,getOwnPropertyDescriptor:iv}=Object;let{freeze:Nt,seal:Zt,create:dl}=Object,{apply:hl,construct:pl}=typeof Reflect<"u"&&Reflect;Nt||(Nt=function(t){return t});Zt||(Zt=function(t){return t});hl||(hl=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),r=2;r1?n-1:0),i=1;i1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:so;qu&&qu(e,null);let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){const r=n(i);r!==i&&(nv(t)||(t[s]=r),i=r)}e[i]=!0}return e}function uv(e){for(let t=0;t/gm),mv=Zt(/\$\{[\w\W]*/gm),gv=Zt(/^data-[\-\w.\u00B7-\uFFFF]+$/),yv=Zt(/^aria-[\-\w]+$/),bh=Zt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bv=Zt(/^(?:\w+script|data):/i),vv=Zt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vh=Zt(/^html$/i),wv=Zt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ju=Object.freeze({__proto__:null,ARIA_ATTR:yv,ATTR_WHITESPACE:vv,CUSTOM_ELEMENT:wv,DATA_ATTR:gv,DOCTYPE_NAME:vh,ERB_EXPR:pv,IS_ALLOWED_URI:bh,IS_SCRIPT_OR_DATA:bv,MUSTACHE_EXPR:hv,TMPLIT_EXPR:mv});const Di={element:1,text:3,progressingInstruction:7,comment:8,document:9},_v=function(){return typeof window>"u"?null:window},kv=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const r="dompurify"+(s?"#"+s:"");try{return t.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Qu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function wh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_v();const t=ne=>wh(ne);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Di.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,i=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:h}=e,b=l.prototype,g=$i(b,"cloneNode"),E=$i(b,"remove"),x=$i(b,"nextSibling"),y=$i(b,"childNodes"),k=$i(b,"parentNode");if(typeof o=="function"){const ne=n.createElement("template");ne.content&&ne.content.ownerDocument&&(n=ne.content.ownerDocument)}let w,C="";const{implementation:N,createNodeIterator:q,createDocumentFragment:U,getElementsByTagName:M}=n,{importNode:O}=s;let j=Qu();t.isSupported=typeof yh=="function"&&typeof k=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:re,TMPLIT_EXPR:_e,DATA_ATTR:Ue,ARIA_ATTR:Te,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:me,CUSTOM_ELEMENT:Tt}=Ju;let{IS_ALLOWED_URI:At}=Ju,ke=null;const Ke=we({},[...Gu,...Ma,...Oa,...$a,...Yu]);let J=null;const ee=we({},[...Xu,...Da,...Zu,...Vr]);let le=Object.seal(dl(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}})),Ce=null,I=null;const A=Object.seal(dl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let R=!0,K=!0,ae=!1,m=!0,v=!1,T=!0,S=!1,$=!1,P=!1,V=!1,W=!1,H=!1,D=!0,se=!1;const X="user-content-";let te=!0,ie=!1,de={},ge=null;const ve=we({},["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 He=null;const ze=we({},["audio","video","img","source","image","track"]);let it=null;const Xe=we({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",Jt="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml";let Ze=Ne,Je=!1,Ve=null;const ci=we({},[Dt,Jt,Ne],La);let Ns=we({},["mi","mo","mn","ms","mtext"]),un=we({},["annotation-xml"]);const Go=we({},["title","style","font","a","script"]);let gs=null;const Yo=["application/xhtml+xml","text/html"],Xo="text/html";let Qe=null,qn=null;const Zo=n.createElement("form"),Ar=function(_){return _ instanceof RegExp||_ instanceof Function},ui=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(qn&&qn===_)){if((!_||typeof _!="object")&&(_={}),_=mn(_),gs=Yo.indexOf(_.PARSER_MEDIA_TYPE)===-1?Xo:_.PARSER_MEDIA_TYPE,Qe=gs==="application/xhtml+xml"?La:so,ke=nn(_,"ALLOWED_TAGS")?we({},_.ALLOWED_TAGS,Qe):Ke,J=nn(_,"ALLOWED_ATTR")?we({},_.ALLOWED_ATTR,Qe):ee,Ve=nn(_,"ALLOWED_NAMESPACES")?we({},_.ALLOWED_NAMESPACES,La):ci,it=nn(_,"ADD_URI_SAFE_ATTR")?we(mn(Xe),_.ADD_URI_SAFE_ATTR,Qe):Xe,He=nn(_,"ADD_DATA_URI_TAGS")?we(mn(ze),_.ADD_DATA_URI_TAGS,Qe):ze,ge=nn(_,"FORBID_CONTENTS")?we({},_.FORBID_CONTENTS,Qe):ve,Ce=nn(_,"FORBID_TAGS")?we({},_.FORBID_TAGS,Qe):mn({}),I=nn(_,"FORBID_ATTR")?we({},_.FORBID_ATTR,Qe):mn({}),de=nn(_,"USE_PROFILES")?_.USE_PROFILES:!1,R=_.ALLOW_ARIA_ATTR!==!1,K=_.ALLOW_DATA_ATTR!==!1,ae=_.ALLOW_UNKNOWN_PROTOCOLS||!1,m=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,v=_.SAFE_FOR_TEMPLATES||!1,T=_.SAFE_FOR_XML!==!1,S=_.WHOLE_DOCUMENT||!1,V=_.RETURN_DOM||!1,W=_.RETURN_DOM_FRAGMENT||!1,H=_.RETURN_TRUSTED_TYPE||!1,P=_.FORCE_BODY||!1,D=_.SANITIZE_DOM!==!1,se=_.SANITIZE_NAMED_PROPS||!1,te=_.KEEP_CONTENT!==!1,ie=_.IN_PLACE||!1,At=_.ALLOWED_URI_REGEXP||bh,Ze=_.NAMESPACE||Ne,Ns=_.MATHML_TEXT_INTEGRATION_POINTS||Ns,un=_.HTML_INTEGRATION_POINTS||un,le=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Ar(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Ar(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),v&&(K=!1),W&&(V=!0),de&&(ke=we({},Yu),J=[],de.html===!0&&(we(ke,Gu),we(J,Xu)),de.svg===!0&&(we(ke,Ma),we(J,Da),we(J,Vr)),de.svgFilters===!0&&(we(ke,Oa),we(J,Da),we(J,Vr)),de.mathMl===!0&&(we(ke,$a),we(J,Zu),we(J,Vr))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?A.tagCheck=_.ADD_TAGS:(ke===Ke&&(ke=mn(ke)),we(ke,_.ADD_TAGS,Qe))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?A.attributeCheck=_.ADD_ATTR:(J===ee&&(J=mn(J)),we(J,_.ADD_ATTR,Qe))),_.ADD_URI_SAFE_ATTR&&we(it,_.ADD_URI_SAFE_ATTR,Qe),_.FORBID_CONTENTS&&(ge===ve&&(ge=mn(ge)),we(ge,_.FORBID_CONTENTS,Qe)),_.ADD_FORBID_CONTENTS&&(ge===ve&&(ge=mn(ge)),we(ge,_.ADD_FORBID_CONTENTS,Qe)),te&&(ke["#text"]=!0),S&&we(ke,["html","head","body"]),ke.table&&(we(ke,["tbody"]),delete Ce.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=_.TRUSTED_TYPES_POLICY,C=w.createHTML("")}else w===void 0&&(w=kv(h,i)),w!==null&&typeof C=="string"&&(C=w.createHTML(""));Nt&&Nt(_),qn=_}},Er=we({},[...Ma,...Oa,...fv]),fi=we({},[...$a,...dv]),Jo=function(_){let B=k(_);(!B||!B.tagName)&&(B={namespaceURI:Ze,tagName:"template"});const Q=so(_.tagName),ye=so(B.tagName);return Ve[_.namespaceURI]?_.namespaceURI===Jt?B.namespaceURI===Ne?Q==="svg":B.namespaceURI===Dt?Q==="svg"&&(ye==="annotation-xml"||Ns[ye]):!!Er[Q]:_.namespaceURI===Dt?B.namespaceURI===Ne?Q==="math":B.namespaceURI===Jt?Q==="math"&&un[ye]:!!fi[Q]:_.namespaceURI===Ne?B.namespaceURI===Jt&&!un[ye]||B.namespaceURI===Dt&&!Ns[ye]?!1:!fi[Q]&&(Go[Q]||!Er[Q]):!!(gs==="application/xhtml+xml"&&Ve[_.namespaceURI]):!1},qt=function(_){Ni(t.removed,{element:_});try{k(_).removeChild(_)}catch{E(_)}},xn=function(_,B){try{Ni(t.removed,{attribute:B.getAttributeNode(_),from:B})}catch{Ni(t.removed,{attribute:null,from:B})}if(B.removeAttribute(_),_==="is")if(V||W)try{qt(B)}catch{}else try{B.setAttribute(_,"")}catch{}},Tn=function(_){let B=null,Q=null;if(P)_=""+_;else{const je=Na(_,/^[\r\n\t ]+/);Q=je&&je[0]}gs==="application/xhtml+xml"&&Ze===Ne&&(_=''+_+"");const ye=w?w.createHTML(_):_;if(Ze===Ne)try{B=new f().parseFromString(ye,gs)}catch{}if(!B||!B.documentElement){B=N.createDocument(Ze,"template",null);try{B.documentElement.innerHTML=Je?C:ye}catch{}}const Be=B.body||B.documentElement;return _&&Q&&Be.insertBefore(n.createTextNode(Q),Be.childNodes[0]||null),Ze===Ne?M.call(B,S?"html":"body")[0]:S?B.documentElement:Be},Ft=function(_){return q.call(_.ownerDocument||_,_,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ot=function(_){return _ instanceof d&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof u)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Ms=function(_){return typeof a=="function"&&_ instanceof a};function rt(ne,_,B){zr(ne,Q=>{Q.call(t,_,B,qn)})}const An=function(_){let B=null;if(rt(j.beforeSanitizeElements,_,null),Ot(_))return qt(_),!0;const Q=Qe(_.nodeName);if(rt(j.uponSanitizeElement,_,{tagName:Q,allowedTags:ke}),T&&_.hasChildNodes()&&!Ms(_.firstElementChild)&&Pt(/<[/\w!]/g,_.innerHTML)&&Pt(/<[/\w!]/g,_.textContent)||_.nodeType===Di.progressingInstruction||T&&_.nodeType===Di.comment&&Pt(/<[/\w]/g,_.data))return qt(_),!0;if(!(A.tagCheck instanceof Function&&A.tagCheck(Q))&&(!ke[Q]||Ce[Q])){if(!Ce[Q]&&Kn(Q)&&(le.tagNameCheck instanceof RegExp&&Pt(le.tagNameCheck,Q)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Q)))return!1;if(te&&!ge[Q]){const ye=k(_)||_.parentNode,Be=y(_)||_.childNodes;if(Be&&ye){const je=Be.length;for(let ht=je-1;ht>=0;--ht){const Ut=g(Be[ht],!0);Ut.__removalCount=(_.__removalCount||0)+1,ye.insertBefore(Ut,x(_))}}}return qt(_),!0}return _ instanceof l&&!Jo(_)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&Pt(/<\/no(script|embed|frames)/i,_.innerHTML)?(qt(_),!0):(v&&_.nodeType===Di.text&&(B=_.textContent,zr([z,re,_e],ye=>{B=Mi(B,ye," ")}),_.textContent!==B&&(Ni(t.removed,{element:_.cloneNode()}),_.textContent=B)),rt(j.afterSanitizeElements,_,null),!1)},En=function(_,B,Q){if(D&&(B==="id"||B==="name")&&(Q in n||Q in Zo))return!1;if(!(K&&!I[B]&&Pt(Ue,B))){if(!(R&&Pt(Te,B))){if(!(A.attributeCheck instanceof Function&&A.attributeCheck(B,_))){if(!J[B]||I[B]){if(!(Kn(_)&&(le.tagNameCheck instanceof RegExp&&Pt(le.tagNameCheck,_)||le.tagNameCheck instanceof Function&&le.tagNameCheck(_))&&(le.attributeNameCheck instanceof RegExp&&Pt(le.attributeNameCheck,B)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(B,_))||B==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&Pt(le.tagNameCheck,Q)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Q))))return!1}else if(!it[B]){if(!Pt(At,Mi(Q,me,""))){if(!((B==="src"||B==="xlink:href"||B==="href")&&_!=="script"&&av(Q,"data:")===0&&He[_])){if(!(ae&&!Pt(fe,Mi(Q,me,"")))){if(Q)return!1}}}}}}}return!0},Kn=function(_){return _!=="annotation-xml"&&Na(_,Tt)},Os=function(_){rt(j.beforeSanitizeAttributes,_,null);const{attributes:B}=_;if(!B||Ot(_))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let ye=B.length;for(;ye--;){const Be=B[ye],{name:je,namespaceURI:ht,value:Ut}=Be,$s=Qe(je),Qo=Ut;let pt=je==="value"?Qo:lv(Qo);if(Q.attrName=$s,Q.attrValue=pt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,rt(j.uponSanitizeAttribute,_,Q),pt=Q.attrValue,se&&($s==="id"||$s==="name")&&(xn(je,_),pt=X+pt),T&&Pt(/((--!?|])>)|<\/(style|title|textarea)/i,pt)){xn(je,_);continue}if($s==="attributename"&&Na(pt,"href")){xn(je,_);continue}if(Q.forceKeepAttr)continue;if(!Q.keepAttr){xn(je,_);continue}if(!m&&Pt(/\/>/i,pt)){xn(je,_);continue}v&&zr([z,re,_e],oc=>{pt=Mi(pt,oc," ")});const rc=Qe(_.nodeName);if(!En(rc,$s,pt)){xn(je,_);continue}if(w&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!ht)switch(h.getAttributeType(rc,$s)){case"TrustedHTML":{pt=w.createHTML(pt);break}case"TrustedScriptURL":{pt=w.createScriptURL(pt);break}}if(pt!==Qo)try{ht?_.setAttributeNS(ht,je,pt):_.setAttribute(je,pt),Ot(_)?qt(_):Ku(t.removed)}catch{xn(je,_)}}rt(j.afterSanitizeAttributes,_,null)},Sr=function ne(_){let B=null;const Q=Ft(_);for(rt(j.beforeSanitizeShadowDOM,_,null);B=Q.nextNode();)rt(j.uponSanitizeShadowNode,B,null),An(B),Os(B),B.content instanceof r&&ne(B.content);rt(j.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(ne){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,Q=null,ye=null,Be=null;if(Je=!ne,Je&&(ne=""),typeof ne!="string"&&!Ms(ne))if(typeof ne.toString=="function"){if(ne=ne.toString(),typeof ne!="string")throw Oi("dirty is not a string, aborting")}else throw Oi("toString is not a function");if(!t.isSupported)return ne;if($||ui(_),t.removed=[],typeof ne=="string"&&(ie=!1),ie){if(ne.nodeName){const Ut=Qe(ne.nodeName);if(!ke[Ut]||Ce[Ut])throw Oi("root node is forbidden and cannot be sanitized in-place")}}else if(ne instanceof a)B=Tn(""),Q=B.ownerDocument.importNode(ne,!0),Q.nodeType===Di.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?B=Q:B.appendChild(Q);else{if(!V&&!v&&!S&&ne.indexOf("<")===-1)return w&&H?w.createHTML(ne):ne;if(B=Tn(ne),!B)return V?null:H?C:""}B&&P&&qt(B.firstChild);const je=Ft(ie?ne:B);for(;ye=je.nextNode();)An(ye),Os(ye),ye.content instanceof r&&Sr(ye.content);if(ie)return ne;if(V){if(W)for(Be=U.call(B.ownerDocument);B.firstChild;)Be.appendChild(B.firstChild);else Be=B;return(J.shadowroot||J.shadowrootmode)&&(Be=O.call(s,Be,!0)),Be}let ht=S?B.outerHTML:B.innerHTML;return S&&ke["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&Pt(vh,B.ownerDocument.doctype.name)&&(ht=" `+ht),v&&zr([z,re,_e],Ut=>{ht=Mi(ht,Ut," ")}),w&&H?w.createHTML(ht):ht},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ui(ne),$=!0},t.clearConfig=function(){qn=null,$=!1},t.isValidAttribute=function(ne,_,B){qn||ui({});const Q=Qe(ne),ye=Qe(_);return En(Q,ye,B)},t.addHook=function(ne,_){typeof _=="function"&&Ni(j[ne],_)},t.removeHook=function(ne,_){if(_!==void 0){const B=rv(j[ne],_);return B===-1?void 0:ov(j[ne],B,1)[0]}return Ku(j[ne])},t.removeHooks=function(ne){j[ne]=[]},t.removeAllHooks=function(){j=Qu()},t}var xv=wh();function Tv(e){try{const t=new URL(e);return/^https?:$/i.test(t.protocol)}catch{return!1}}function Q_(e){return!!e&&typeof e=="string"&&/^https?:\/\//i.test(e.trim())}const Av=["p","br","a","strong","em","b","i","ul","ol","li","blockquote","h1","h2","h3","h4","span","div"];function Ev(e){return xv.sanitize(e,{ALLOWED_TAGS:Av,ALLOWED_ATTR:["href","src","target","rel"]})}function Sv(e){return e.replace(/&/g,"&").replace(//g,">")}function ek(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}const Cv=["disabled"],Pv=["href"],Iv={class:"relative flex-1 min-h-0 bg-black/20 overflow-hidden"},Rv={class:"[&_p]:mb-3 [&_ul]:list-disc [&_ol]:list-decimal [&_li]:ml-4 [&_a]:underline [&_a]:underline-offset-2 [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic"},Lv=["src","alt"],Nv=["innerHTML"],Mv=["href"],Ov=["src"],$v=ms({__name:"ArticleOverlay",setup(e){const t=tv(),{isDark:n}=ql(),s=Oe(()=>{const d=t.content;return d?/<[a-z][\s\S]*>/i.test(d)?Ev(d):`

${Sv(d)}

`:""}),i=F(null),r=F(0),o=F(!1);function a(){o.value=!0,r.value++}function l(){o.value=!1}function c(d){d.key==="Escape"&&t.isOpen&&(t.close(),d.preventDefault(),d.stopPropagation())}Yt(()=>t.isOpen,d=>{d||(o.value=!1)}),Ls(()=>{window.addEventListener("keydown",c,!0)}),Oo(()=>{window.removeEventListener("keydown",c,!0)});const u=["w-full max-w-[calc(100vw-3rem)] h-[80vh] max-h-[calc(100vh-5rem)]","md:max-w-[calc(100vw-5rem)]"];return(d,f)=>(be(),fs(Ol,{to:"body"},[Fe(yo,{name:"app-launcher"},{default:nr(()=>[G(t).isOpen?(be(),xe("div",{key:0,class:"fixed inset-0 z-[2400] flex items-center justify-center p-6 md:p-10",onClick:f[2]||(f[2]=Mn(h=>G(t).close(),["self"]))},[f[7]||(f[7]=L("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),L("div",{class:st(["article-overlay-panel relative z-10 flex flex-col overflow-hidden rounded-2xl shadow-2xl path-glass-card",u])},[L("div",{class:"flex items-center gap-3 px-4 py-3 shrink-0",style:us(G(n)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[G(t).content?xt("",!0):(be(),xe("button",{key:0,type:"button",class:st(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors transition-transform duration-300 disabled:opacity-70 disabled:cursor-not-allowed",G(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Refresh page",title:"Refresh",disabled:o.value,onClick:a},[(be(),xe("svg",{class:st(["w-5 h-5",{"animate-spin":o.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[...f[3]||(f[3]=[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],10,Cv)),L("span",{class:st(["flex-1 truncate text-sm font-medium min-w-0",G(n)?"text-white/90":"text-gray-900"])},dt(G(t).title||"Article"),3),G(t).url?(be(),xe("a",{key:1,href:G(t).url,target:"_blank",rel:"noopener noreferrer",class:st(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors shrink-0",G(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Open in new tab",title:"Open in new tab",onClick:f[0]||(f[0]=Mn(()=>{},["stop"]))},[...f[4]||(f[4]=[L("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,Pv)):xt("",!0),L("button",{type:"button",class:st(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors shrink-0",G(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Close",onClick:f[1]||(f[1]=h=>G(t).close())},[...f[5]||(f[5]=[L("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)],4),L("div",Iv,[G(t).content?(be(),xe("div",{key:0,class:st(["absolute inset-0 overflow-y-auto p-4 md:p-6 text-sm leading-relaxed",G(n)?"text-white/90":"text-gray-900"])},[L("article",Rv,[G(t).imgSrc&&G(Tv)(G(t).imgSrc)?(be(),xe("img",{key:0,src:G(t).imgSrc,alt:G(t).title,class:"w-full rounded-lg object-cover max-h-48 mb-4"},null,8,Lv)):xt("",!0),L("div",{innerHTML:s.value},null,8,Nv)]),L("a",{href:G(t).url??void 0,target:"_blank",rel:"noopener noreferrer",class:st(["inline-flex items-center gap-1.5 mt-4 text-sm",G(n)?"text-white/70 hover:text-white":"text-gray-500 hover:text-gray-800"])},[...f[6]||(f[6]=[Id(" Read full article ",-1),L("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,Mv)],2)):G(t).url?(be(),xe("iframe",{ref_key:"iframeRef",ref:i,key:r.value,src:G(t).url,class:"absolute inset-0 w-full h-full border-0",style:{"-ms-overflow-style":"none","scrollbar-width":"none"},title:"Article content",onLoad:l},null,40,Ov)):xt("",!0)])])])):xt("",!0)]),_:1})]))}}),Xl=(e,t)=>{const n=e.__vccOpts||e;for(const[s,i]of t)n[s]=i;return n},Dv=Xl($v,[["__scopeId","data-v-1860e4c6"]]),Fv=zl("videoPlayer",()=>{const e=F(!1),t=F(""),n=F(""),s=F(null);function i(o,a,l){t.value=o,n.value=a,s.value=l??null,e.value=!0}function r(){e.value=!1,t.value="",n.value="",s.value=null}return{isOpen:e,videoUrl:t,title:n,posterUrl:s,open:i,close:r}}),Uv={class:"flex-1 min-h-0 relative flex items-center justify-center"},Bv={key:0,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},jv={class:"w-20 h-20 rounded-full flex items-center justify-center bg-black/40 backdrop-blur-sm"},Hv={key:0,class:"w-10 h-10 text-white",fill:"currentColor",viewBox:"0 0 24 24"},zv={key:1,class:"w-10 h-10 text-white",fill:"currentColor",viewBox:"0 0 24 24"},Vv={key:0,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Wv={class:"path-glass-card !rounded-none px-4 py-3 space-y-2"},qv={class:"flex items-center gap-3"},Kv={class:"min-w-0 flex-1 max-w-[280px]"},Gv={class:"text-sm font-semibold truncate text-white/90"},Yv={class:"flex items-center gap-2 flex-1 justify-center"},Xv={key:0,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},Zv={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},Jv={class:"text-xs font-mono tabular-nums text-white/40 ml-1"},Qv={class:"flex items-center gap-1 shrink-0"},ew={class:"h-16 bg-gradient-to-b from-black/60 to-transparent flex items-start justify-end px-4 pt-3"},tw=ms({__name:"VideoPlayerOverlay",setup(e){const t=Fv(),n=F(null),s=F(null),i=F(null),r=F(!1),o=F(!1),a=F(0),l=F(0),c=F(0),u=F(!0),d=F(!1);let f=null,h=null,b=null,g=null,E=!1;const x=[];function y(){return E?Promise.resolve():new Promise(J=>{if(window.YT?.Player){E=!0,J();return}if(x.push(J),!document.getElementById("yt-iframe-api")){const ee=document.createElement("script");ee.id="yt-iframe-api",ee.src="https://www.youtube.com/iframe_api",document.head.appendChild(ee),window.onYouTubeIframeAPIReady=()=>{E=!0,x.forEach(le=>le()),x.length=0}}})}function k(J){const ee=J.match(/\/embed\/([a-zA-Z0-9_-]{11})/);if(ee)return ee[1];const le=J.match(/[?&]v=([a-zA-Z0-9_-]{11})/);if(le)return le[1];const Ce=J.match(/youtu\.be\/([a-zA-Z0-9_-]{11})/);return Ce?Ce[1]:null}async function w(J){const ee=k(J);if(!ee||!s.value)return;o.value=!0,await y();const le=window.YT,Ce=document.createElement("div");Ce.id="yt-video-player",s.value.innerHTML="",s.value.appendChild(Ce),b=new le.Player("yt-video-player",{videoId:ee,width:"100%",height:"100%",playerVars:{autoplay:1,controls:0,modestbranding:1,rel:0,showinfo:0,iv_load_policy:3,fs:0,playsinline:1},events:{onReady:()=>{o.value=!1,r.value=!0,C(),me()},onStateChange:I=>{const A=I.data;r.value=A===1,o.value=A===3,A===0&&(r.value=!1,u.value=!0)}}})}function C(){h&&cancelAnimationFrame(h);function J(){b?.getCurrentTime&&b?.getDuration&&(a.value=b.getCurrentTime()??0,l.value=b.getDuration()??0,c.value=l.value>0?a.value/l.value*100:0),h=requestAnimationFrame(J)}J()}function N(){h&&(cancelAnimationFrame(h),h=null)}function q(){if(N(),b?.destroy)try{b.destroy()}catch{}b=null,s.value&&(s.value.innerHTML=""),r.value=!1,o.value=!1,a.value=0,l.value=0,c.value=0}function U(){b&&(r.value?b.pauseVideo():b.playVideo(),Te())}function M(J){if(!b?.seekTo)return;const ee=Math.max(0,Math.min(l.value,a.value+J));b.seekTo(ee,!0),me()}function O(J){if(!b?.seekTo||l.value<=0)return;const ee=J/100*l.value;b.seekTo(ee,!0)}function j(J){if(!i.value)return;const ee=i.value.getBoundingClientRect(),le=Math.max(0,Math.min(100,(J.clientX-ee.left)/ee.width*100));O(le)}let z=!1;function re(J){z=!0,j(J);const ee=Ce=>{z&&j(Ce)},le=()=>{z=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",le)};window.addEventListener("mousemove",ee),window.addEventListener("mouseup",le)}function _e(){n.value&&(document.fullscreenElement?document.exitFullscreen():n.value.requestFullscreen())}function Ue(){q(),t.close()}function Te(){d.value=!0,g&&clearTimeout(g),g=setTimeout(()=>{d.value=!1},600)}function fe(J){const ee=J.target;(ee===n.value||ee.closest(".flex-1.min-h-0"))&&U()}function me(){u.value=!0,Tt()}function Tt(){f&&clearTimeout(f),f=setTimeout(()=>{r.value&&(u.value=!1)},3e3)}function At(J){if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),Ue();return}if(J.key===" "||J.key==="k"){J.preventDefault(),U(),me();return}if(J.key==="ArrowLeft"){J.preventDefault(),M(-10);return}if(J.key==="ArrowRight"){J.preventDefault(),M(10);return}if(J.key==="f"){J.preventDefault(),_e();return}}function ke(J){const ee=Math.floor(J),le=Math.floor(ee/3600),Ce=Math.floor(ee%3600/60),I=ee%60;return le>0?`${le}:${String(Ce).padStart(2,"0")}:${String(I).padStart(2,"0")}`:`${Ce}:${String(I).padStart(2,"0")}`}function Ke(J){J.key==="Escape"&&t.isOpen&&(J.preventDefault(),J.stopPropagation(),Ue())}return Yt(()=>t.isOpen,async J=>{J?(await Rs(),n.value?.focus(),w(t.videoUrl),me()):q()}),Ls(()=>{window.addEventListener("keydown",Ke,!0)}),Oo(()=>{q(),window.removeEventListener("keydown",Ke,!0),f&&clearTimeout(f),g&&clearTimeout(g)}),(J,ee)=>(be(),fs(Ol,{to:"body"},[Fe(yo,{name:"video-player"},{default:nr(()=>[G(t).isOpen?(be(),xe("div",{key:0,ref_key:"containerRef",ref:n,class:st(["fixed inset-0 z-[2500] flex flex-col bg-black",u.value?"":"cursor-none"]),onMousemove:me,onTouchstartPassive:me,onKeydown:At,onClick:fe,tabindex:"0"},[L("div",Uv,[L("div",{ref_key:"playerRef",ref:s,class:"w-full h-full"},null,512),Fe(yo,{name:"center-icon"},{default:nr(()=>[d.value?(be(),xe("div",Bv,[L("div",jv,[r.value?(be(),xe("svg",Hv,[...ee[2]||(ee[2]=[L("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(be(),xe("svg",zv,[...ee[3]||(ee[3]=[L("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))])])):xt("",!0)]),_:1}),o.value?(be(),xe("div",Vv,[...ee[4]||(ee[4]=[L("svg",{class:"w-12 h-12 animate-spin text-white/60",fill:"none",viewBox:"0 0 24 24"},[L("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),L("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])):xt("",!0)]),L("div",{class:st(["absolute bottom-0 left-0 right-0 transition-all duration-300 z-20",u.value?"opacity-100 translate-y-0":"opacity-0 translate-y-4"])},[ee[13]||(ee[13]=L("div",{class:"h-24 bg-gradient-to-t from-black/80 to-transparent pointer-events-none"},null,-1)),L("div",Wv,[L("div",{ref_key:"scrubberRef",ref:i,class:"group w-full h-1.5 rounded-full cursor-pointer bg-white/15 transition-all hover:h-2.5",onClick:j,onMousedown:re},[L("div",{class:"h-full bg-accent rounded-full transition-[width] duration-75 relative",style:us({width:`${c.value}%`})},[...ee[5]||(ee[5]=[L("div",{class:"absolute right-0 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full bg-white shadow-md opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)])],4)],544),L("div",qv,[L("div",Kv,[L("p",Gv,dt(G(t).title),1),ee[6]||(ee[6]=L("p",{class:"text-xs truncate text-white/40"},"Free Documentary",-1))]),L("div",Yv,[L("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 transition-all hover:scale-105 active:scale-95","aria-label":"Rewind 10 seconds",onClick:ee[0]||(ee[0]=Mn(le=>M(-10),["stop"]))},[...ee[7]||(ee[7]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})],-1)])]),L("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 transition-all hover:scale-105 active:scale-95","aria-label":"Play or pause",onClick:Mn(U,["stop"])},[r.value?(be(),xe("svg",Xv,[...ee[8]||(ee[8]=[L("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(be(),xe("svg",Zv,[...ee[9]||(ee[9]=[L("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),L("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 transition-all hover:scale-105 active:scale-95","aria-label":"Forward 10 seconds",onClick:ee[1]||(ee[1]=Mn(le=>M(10),["stop"]))},[...ee[10]||(ee[10]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z"})],-1)])]),L("span",Jv,dt(ke(a.value))+" / "+dt(ke(l.value)),1)]),L("div",Qv,[L("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/60 hover:text-white/90 transition-colors","aria-label":"Toggle fullscreen",onClick:Mn(_e,["stop"])},[...ee[11]||(ee[11]=[L("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})],-1)])]),L("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/60 hover:text-white/90 transition-colors","aria-label":"Close video player",onClick:Mn(Ue,["stop"])},[...ee[12]||(ee[12]=[L("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])])],2),L("div",{class:st(["absolute top-0 left-0 right-0 transition-all duration-300 z-20",u.value?"opacity-100 translate-y-0":"opacity-0 -translate-y-4"])},[L("div",ew,[L("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 hover:bg-white/10 transition-colors","aria-label":"Close",onClick:Mn(Ue,["stop"])},[...ee[14]||(ee[14]=[L("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])],2)],34)):xt("",!0)]),_:1})]))}}),nw=Xl(tw,[["__scopeId","data-v-1316aff3"]]);function Z(e,t,n){return(t=iw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sw(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iw(e){var t=sw(e,"string");return typeof t=="symbol"?t:t+""}function rw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ef(e,t){for(var n=0;nt){var n=gw(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}var bw=(function(){function e(t,n){rw(this,e),bt.element(t)?this.element=t:bt.string(t)&&(this.element=document.querySelector(t)),bt.element(this.element)&&bt.empty(this.element.rangeTouch)&&(this.config=nf({},sf,{},n),this.init())}return ow(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(t){var n=this,s=t?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(i){n.element[s](i,function(r){return n.set(r)},!1)})}},{key:"get",value:function(t){if(!e.enabled||!bt.event(t))return null;var n,s=t.target,i=t.changedTouches[0],r=parseFloat(s.getAttribute("min"))||0,o=parseFloat(s.getAttribute("max"))||100,a=parseFloat(s.getAttribute("step"))||1,l=s.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(n=100/l.width*(i.clientX-l.left))?n=0:100n?n-=(100-2*n)*c:50e!==null&&typeof e<"u"?e.constructor:null,zn=(e,t)=>!!(e&&t&&e instanceof t),Jl=e=>e===null||typeof e>"u",Eh=e=>xr(e)===Object,vw=e=>xr(e)===Number&&!Number.isNaN(e),Wo=e=>xr(e)===String,ww=e=>xr(e)===Boolean,Sh=e=>typeof e=="function",Ch=e=>Array.isArray(e),_w=e=>zn(e,WeakMap),Ph=e=>zn(e,NodeList),kw=e=>xr(e)===Text,xw=e=>zn(e,Event),Tw=e=>zn(e,KeyboardEvent),Aw=e=>zn(e,window.TextTrackCue)||zn(e,window.VTTCue),Ew=e=>zn(e,TextTrack)||!Jl(e)&&Wo(e.kind),Sw=e=>zn(e,Promise)&&Sh(e.then);function Cw(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}function Ih(e){return Jl(e)||(Wo(e)||Ch(e)||Ph(e))&&!e.length||Eh(e)&&!Object.keys(e).length}function Pw(e){if(zn(e,window.URL))return!0;if(!Wo(e))return!1;let t=e;(!e.startsWith("http://")||!e.startsWith("https://"))&&(t=`http://${e}`);try{return!Ih(new URL(t).hostname)}catch{return!1}}var p={nullOrUndefined:Jl,object:Eh,number:vw,string:Wo,boolean:ww,function:Sh,array:Ch,weakMap:_w,nodeList:Ph,element:Cw,textNode:kw,event:xw,keyboardEvent:Tw,cue:Aw,track:Ew,promise:Sw,url:Pw,empty:Ih};const ml=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n=Object.keys(t).find(s=>e.style[s]!==void 0);return p.string(n)?t[n]:!1})();function Rh(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function Iw(e){return JSON.parse(JSON.stringify(e))}function Lh(e,t){return t.split(".").reduce((n,s)=>n&&n[s],e)}function et(e={},...t){if(!t.length)return e;const n=t.shift();return p.object(n)?(Object.keys(n).forEach(s=>{p.object(n[s])?(Object.keys(e).includes(s)||Object.assign(e,{[s]:{}}),et(e[s],n[s])):Object.assign(e,{[s]:n[s]})}),et(e,...t)):e}function Nh(e,t){const n=e.length?e:[e];Array.from(n).reverse().forEach((s,i)=>{const r=i>0?t.cloneNode(!0):t,o=s.parentNode,a=s.nextSibling;r.appendChild(s),a?o.insertBefore(r,a):o.appendChild(r)})}function gl(e,t){!p.element(e)||p.empty(t)||Object.entries(t).filter(([,n])=>!p.nullOrUndefined(n)).forEach(([n,s])=>e.setAttribute(n,s))}function ce(e,t,n){const s=document.createElement(e);return p.object(t)&&gl(s,t),p.string(n)&&(s.textContent=n),s}function Rw(e,t){!p.element(e)||!p.element(t)||t.parentNode.insertBefore(e,t.nextSibling)}function rf(e,t,n,s){p.element(t)&&t.appendChild(ce(e,n,s))}function Dn(e){if(p.nodeList(e)||p.array(e)){Array.from(e).forEach(Dn);return}!p.element(e)||!p.element(e.parentNode)||e.parentNode.removeChild(e)}function io(e){if(!p.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function _o(e,t){return!p.element(t)||!p.element(t.parentNode)||!p.element(e)?null:(t.parentNode.replaceChild(e,t),e)}function yn(e,t){if(!p.string(e)||p.empty(e))return{};const n={},s=et({},t);return e.split(",").forEach(i=>{const r=i.trim(),o=r.replace(".",""),l=r.replace(/[[\]]/g,"").split("="),[c]=l,u=l.length>1?l[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":p.string(s.class)?n.class=`${s.class} ${o}`:n.class=o;break;case"#":n.id=r.replace("#","");break;case"[":n[c]=u;break}}),et(s,n)}function _s(e,t){if(!p.element(e))return;let n=t;p.boolean(n)||(n=!e.hidden),e.hidden=n}function Le(e,t,n){if(p.nodeList(e))return Array.from(e).map(s=>Le(s,t,n));if(p.element(e)){let s="toggle";return typeof n<"u"&&(s=n?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function ko(e,t){return p.element(e)&&e.classList.contains(t)}function Cs(e,t){const{prototype:n}=Element;function s(){return Array.from(document.querySelectorAll(t)).includes(this)}return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||s).call(e,t)}function Lw(e,t){const{prototype:n}=Element;function s(){let r=this;do{if(Cs.matches(r,t))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}return(n.closest||s).call(e,t)}function fr(e){return this.elements.container.querySelectorAll(e)}function at(e){return this.elements.container.querySelector(e)}function Fa(e=null,t=!1){p.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const of={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},nt={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const n=nt[e]||t!=="html5",s=n&&nt.rangeInput;return{api:n,ui:s}},pip:document.pictureInPictureEnabled&&!ce("video").disablePictureInPicture,airplay:p.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(p.empty(e))return!1;const[t]=e.split("/");let n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(of).includes(n)&&(n+=`; codecs="${of[e]}"`);try{return!!(n&&this.media.canPlayType(n).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:ml!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Nw=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function dr(e,t,n,s=!1,i=!0,r=!1){if(!e||!("addEventListener"in e)||p.empty(t)||!p.function(n))return;const o=t.split(" ");let a=r;Nw&&(a={passive:i,capture:r}),o.forEach(l=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:l,callback:n,options:a}),e[s?"addEventListener":"removeEventListener"](l,n,a)})}function Ae(e,t="",n,s=!0,i=!1){dr.call(this,e,t,n,!0,s,i)}function qo(e,t="",n,s=!0,i=!1){dr.call(this,e,t,n,!1,s,i)}function Ql(e,t="",n,s=!0,i=!1){const r=(...o)=>{qo(e,t,r,s,i),n.apply(this,o)};dr.call(this,e,t,r,!0,s,i)}function ue(e,t="",n=!1,s={}){if(!p.element(e)||p.empty(t))return;const i=new CustomEvent(t,{bubbles:n,detail:{...s,plyr:this}});e.dispatchEvent(i)}function Mw(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:n,callback:s,options:i}=e;t.removeEventListener(n,s,i)}),this.eventListeners=[])}function Ow(){return new Promise(e=>this.ready?setTimeout(e,0):Ae.call(this,this.elements.container,"ready",e)).then(()=>{})}function _n(e){p.promise(e)&&e.then(null,()=>{})}function yl(e){return p.array(e)?e.filter((t,n)=>e.indexOf(t)===n):e}function Mh(e,t){return!p.array(e)||!e.length?null:e.reduce((n,s)=>Math.abs(s-t)({...e,[t/n]:[t,n]}),{});function $h(e){return!p.array(e)&&(!p.string(e)||!e.includes(":"))?!1:(p.array(e)?e:e.split(":")).map(Number).every(p.number)}function xo(e){if(!p.array(e)||!e.every(p.number))return null;const[t,n]=e,s=(r,o)=>o===0?r:s(o,r%o),i=s(t,n);return[t/i,n/i]}function ec(e){const t=s=>$h(s)?s.split(":").map(Number):null;let n=t(e);if(n===null&&(n=t(this.config.ratio)),n===null&&!p.empty(this.embed)&&p.array(this.embed.ratio)&&({ratio:n}=this.embed),n===null&&this.isHTML5){const{videoWidth:s,videoHeight:i}=this.media;n=[s,i]}return xo(n)}function si(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,n=ec.call(this,e);if(!p.array(n))return{};const[s,i]=xo(n),r=Oh(`aspect-ratio: ${s}/${i}`),o=100/s*i;if(r?t.style.aspectRatio=`${s}/${i}`:t.style.paddingBottom=`${o}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const a=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),l=(a-o)/(a/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${l}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:o,ratio:n}}function Dh(e,t,n=.05){const s=e/t,i=Mh(Object.keys(af),s);return Math.abs(i-s)<=n?af[i]:[e,t]}function $w(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);return[e,t]}const ls={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(t=>{const n=t.getAttribute("type");return p.empty(n)?!0:nt.mime.call(this,n)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:ls.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,p.empty(this.config.ratio)||si.call(e),Object.defineProperty(e.media,"quality",{get(){const n=ls.getSources.call(e).find(s=>s.getAttribute("src")===e.source);return n&&Number(n.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&p.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const s=ls.getSources.call(e).find(c=>Number(c.getAttribute("size"))===t);if(!s)return;const{currentTime:i,paused:r,preload:o,readyState:a,playbackRate:l}=e.media;e.media.src=s.getAttribute("src"),(o!=="none"||a)&&(e.once("loadedmetadata",()=>{e.speed=l,e.currentTime=i,r||_n(e.play())}),e.media.load())}ue.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(Dn(ls.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}},Dw=!!window.document.documentMode,Fw=/Edge/.test(navigator.userAgent),Uw="WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),Bw=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,jw=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var mt={isIE:Dw,isEdge:Fw,isWebKit:Uw,isIPadOS:Bw,isIos:jw};function Hw(e){return`${e}-${Math.floor(Math.random()*1e4)}`}function bl(e,...t){return p.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(n,s)=>t[s].toString())}function zw(e,t){return e===0||t===0||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function Ji(e="",t="",n=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),n.toString())}function Fh(e=""){return e.toString().replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function Vw(e=""){let t=e.toString();return t=Ji(t,"-"," "),t=Ji(t,"_"," "),t=Fh(t),Ji(t," ","")}function Ww(e=""){let t=e.toString();return t=Vw(t),t.charAt(0).toLowerCase()+t.slice(1)}function qw(e){const t=document.createDocumentFragment(),n=document.createElement("div");return t.appendChild(n),n.innerHTML=e,t.firstChild.textContent}function Kw(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const lf={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},ft={get(e="",t={}){if(p.empty(e)||p.empty(t))return"";let n=Lh(t.i18n,e);if(p.empty(n))return Object.keys(lf).includes(e)?lf[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach(([i,r])=>{n=Ji(n,i,r)}),n}};class hr{constructor(t){Z(this,"get",n=>{if(!hr.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(p.empty(s))return null;const i=JSON.parse(s);return p.string(n)&&n.length?i[n]:i}),Z(this,"set",n=>{if(!hr.supported||!this.enabled||!p.object(n))return;let s=this.get();p.empty(s)&&(s={}),et(s,n);try{window.localStorage.setItem(this.key,JSON.stringify(s))}catch{}}),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const t="___test";return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch{return!1}}}function Tr(e,t="text",n=!1){return new Promise((s,i)=>{try{const r=new XMLHttpRequest;if(!("withCredentials"in r))return;n&&(r.withCredentials=!0),r.addEventListener("load",()=>{if(t==="text")try{s(JSON.parse(r.responseText))}catch{s(r.responseText)}else s(r.response)}),r.addEventListener("error",()=>{throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(r){i(r)}})}function Uh(e,t){if(!p.string(e))return;const n="cache",s=p.string(t);let i=!1;const r=()=>document.getElementById(t)!==null,o=(a,l)=>{a.innerHTML=l,!(s&&r())&&document.body.insertAdjacentElement("afterbegin",a)};if(!s||!r()){const a=hr.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),s&&l.setAttribute("id",t),a){const c=window.localStorage.getItem(`${n}-${t}`);if(i=c!==null,i){const u=JSON.parse(c);o(l,u.content)}}Tr(e).then(c=>{if(!p.empty(c)){if(a)try{window.localStorage.setItem(`${n}-${t}`,JSON.stringify({content:c}))}catch{}o(l,c)}}).catch(()=>{})}}const Bh=e=>Math.trunc(e/60/60%60,10),Gw=e=>Math.trunc(e/60%60,10),Yw=e=>Math.trunc(e%60,10);function Ko(e=0,t=!1,n=!1){if(!p.number(e))return Ko(void 0,t,n);const s=a=>`0${a}`.slice(-2);let i=Bh(e);const r=Gw(e),o=Yw(e);return t||i>0?i=`${i}:`:i="",`${n&&e>0?"-":""}${i}${s(r)}:${s(o)}`}const Y={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,n=e.host!==t||mt.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:n}},findElements(){try{return this.elements.controls=at.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:fr.call(this,this.config.selectors.buttons.play),pause:at.call(this,this.config.selectors.buttons.pause),restart:at.call(this,this.config.selectors.buttons.restart),rewind:at.call(this,this.config.selectors.buttons.rewind),fastForward:at.call(this,this.config.selectors.buttons.fastForward),mute:at.call(this,this.config.selectors.buttons.mute),pip:at.call(this,this.config.selectors.buttons.pip),airplay:at.call(this,this.config.selectors.buttons.airplay),settings:at.call(this,this.config.selectors.buttons.settings),captions:at.call(this,this.config.selectors.buttons.captions),fullscreen:at.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=at.call(this,this.config.selectors.progress),this.elements.inputs={seek:at.call(this,this.config.selectors.inputs.seek),volume:at.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:at.call(this,this.config.selectors.display.buffer),currentTime:at.call(this,this.config.selectors.display.currentTime),duration:at.call(this,this.config.selectors.display.duration)},p.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const n="http://www.w3.org/2000/svg",s=Y.getIconUrl.call(this),i=`${s.cors?"":s.url}#${this.config.iconPrefix}`,r=document.createElementNS(n,"svg");gl(r,et(t,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(n,"use"),a=`${i}-${e}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.appendChild(o),r},createLabel(e,t={}){const n=ft.get(e,this.config),s={...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")};return ce("span",s,n)},createBadge(e){if(p.empty(e))return null;const t=ce("span",{class:this.config.classNames.menu.value});return t.appendChild(ce("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const n=et({},t);let s=Ww(e);const i={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(o=>{Object.keys(n).includes(o)&&(i[o]=n[o],delete n[o])}),i.element==="button"&&!Object.keys(n).includes("type")&&(n.type="button"),Object.keys(n).includes("class")?n.class.split(" ").includes(this.config.classNames.control)||et(n,{class:`${n.class} ${this.config.classNames.control}`}):n.class=this.config.classNames.control,e){case"play":i.toggle=!0,i.label="play",i.labelPressed="pause",i.icon="play",i.iconPressed="pause";break;case"mute":i.toggle=!0,i.label="mute",i.labelPressed="unmute",i.icon="volume",i.iconPressed="muted";break;case"captions":i.toggle=!0,i.label="enableCaptions",i.labelPressed="disableCaptions",i.icon="captions-off",i.iconPressed="captions-on";break;case"fullscreen":i.toggle=!0,i.label="enterFullscreen",i.labelPressed="exitFullscreen",i.icon="enter-fullscreen",i.iconPressed="exit-fullscreen";break;case"play-large":n.class+=` ${this.config.classNames.control}--overlaid`,s="play",i.label="play",i.icon="play";break;default:p.empty(i.label)&&(i.label=s),p.empty(i.icon)&&(i.icon=e)}const r=ce(i.element);return i.toggle?(r.appendChild(Y.createIcon.call(this,i.iconPressed,{class:"icon--pressed"})),r.appendChild(Y.createIcon.call(this,i.icon,{class:"icon--not-pressed"})),r.appendChild(Y.createLabel.call(this,i.labelPressed,{class:"label--pressed"})),r.appendChild(Y.createLabel.call(this,i.label,{class:"label--not-pressed"}))):(r.appendChild(Y.createIcon.call(this,i.icon)),r.appendChild(Y.createLabel.call(this,i.label))),et(n,yn(this.config.selectors.buttons[s],n)),gl(r,n),s==="play"?(p.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(r)):this.elements.buttons[s]=r,r},createRange(e,t){const n=ce("input",et(yn(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":ft.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Y.updateRangeFill.call(this,n),bw.setup(n),n},createProgress(e,t){const n=ce("progress",et(yn(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if(e!=="volume"){n.appendChild(ce("span",null,"0"));const s={played:"played",buffer:"buffered"}[e],i=s?ft.get(s,this.config):"";n.textContent=`% ${i.toLowerCase()}`}return this.elements.display[e]=n,n},createTime(e,t){const n=yn(this.config.selectors.display[e],t),s=ce("div",et(n,{class:`${n.class?n.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":ft.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){Ae.call(this,e,"keydown keyup",n=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(n.key)||(n.preventDefault(),n.stopPropagation(),n.type==="keydown"))return;const s=Cs(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(n.key))Y.showMenuPanel.call(this,t,!0);else{let i;n.key!==" "&&(n.key==="ArrowDown"||s&&n.key==="ArrowRight"?(i=e.nextElementSibling,p.element(i)||(i=e.parentNode.firstElementChild)):(i=e.previousElementSibling,p.element(i)||(i=e.parentNode.lastElementChild)),Fa.call(this,i,!0))}},!1),Ae.call(this,e,"keyup",n=>{n.key==="Return"&&Y.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:n,title:s,badge:i=null,checked:r=!1}){const o=yn(this.config.selectors.inputs[n]),a=ce("button",et(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:e})),l=ce("span");l.innerHTML=s,p.element(i)&&l.appendChild(i),a.appendChild(l),Object.defineProperty(a,"checked",{enumerable:!0,get(){return a.getAttribute("aria-checked")==="true"},set(c){c&&Array.from(a.parentNode.children).filter(u=>Cs(u,'[role="menuitemradio"]')).forEach(u=>u.setAttribute("aria-checked","false")),a.setAttribute("aria-checked",c?"true":"false")}}),this.listeners.bind(a,"click keyup",c=>{if(!(p.keyboardEvent(c)&&c.key!==" ")){switch(c.preventDefault(),c.stopPropagation(),a.checked=!0,n){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e);break}Y.showMenuPanel.call(this,"home",p.keyboardEvent(c))}},n,!1),Y.bindMenuItemShortcuts.call(this,a,n),t.appendChild(a)},formatTime(e=0,t=!1){if(!p.number(e))return e;const n=Bh(this.duration)>0;return Ko(e,n,t)},updateTimeDisplay(e=null,t=0,n=!1){!p.element(e)||!p.number(t)||(e.textContent=Y.formatTime(t,n))},updateVolume(){this.supported.ui&&(p.element(this.elements.inputs.volume)&&Y.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),p.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,t=0){p.element(e)&&(e.value=t,Y.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!p.event(e))return;let t=0;const n=(s,i)=>{const r=p.number(i)?i:0,o=p.element(s)?s:this.elements.display.buffer;if(p.element(o)){o.value=r;const a=o.getElementsByTagName("span")[0];p.element(a)&&(a.childNodes[0].nodeValue=r)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=zw(this.currentTime,this.duration),e.type==="timeupdate"&&Y.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":n(this.elements.display.buffer,this.buffered*100);break}},updateRangeFill(e){const t=p.event(e)?e.target:e;if(!(!p.element(t)||t.getAttribute("type")!=="range")){if(Cs(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const n=Y.formatTime(this.currentTime),s=Y.formatTime(this.duration),i=ft.get("seekLabel",this.config);t.setAttribute("aria-valuetext",i.replace("{currentTime}",n).replace("{duration}",s))}else if(Cs(t,this.config.selectors.inputs.volume)){const n=t.value*100;t.setAttribute("aria-valuenow",n),t.setAttribute("aria-valuetext",`${n.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);!mt.isWebKit&&!mt.isIPadOS||t.style.setProperty("--value",`${t.value/t.max*100}%`)}},updateSeekTooltip(e){var t,n;if(!this.config.tooltips.seek||!p.element(this.elements.inputs.seek)||!p.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,i=`${this.config.classNames.tooltip}--visible`,r=u=>Le(s,i,u);if(this.touch){r(!1);return}let o=0;const a=this.elements.progress.getBoundingClientRect();if(p.event(e)){const u=e.pageX-e.clientX;o=100/a.width*(e.pageX-a.left-u)}else if(ko(s,i))o=Number.parseFloat(s.style.left,10);else return;o<0?o=0:o>100&&(o=100);const l=this.duration/100*o;s.textContent=Y.formatTime(l);const c=(t=this.config.markers)===null||t===void 0||(n=t.points)===null||n===void 0?void 0:n.find(({time:u})=>u===Math.round(l));c&&s.insertAdjacentHTML("afterbegin",`${c.label}
`),s.style.left=`${o}%`,p.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&r(e.type==="mouseenter")},timeUpdate(e){const t=!p.element(this.elements.display.duration)&&this.config.invertTime;Y.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),!(e&&e.type==="timeupdate"&&this.media.seeking)&&Y.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32){_s(this.elements.display.currentTime,!0),_s(this.elements.progress,!0);return}p.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=p.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Y.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Y.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Y.setMarkers.call(this),Y.updateSeekTooltip.call(this)},toggleMenuButton(e,t){_s(this.elements.settings.buttons[e],!t)},updateSetting(e,t,n){const s=this.elements.settings.panels[e];let i=null,r=t;if(e==="captions")i=this.currentTrack;else{if(i=p.empty(n)?this[e]:n,p.empty(i)&&(i=this.config[e].default),!p.empty(this.options[e])&&!this.options[e].includes(i)){this.debug.warn(`Unsupported value of '${i}' for ${e}`);return}if(!this.config[e].options.includes(i)){this.debug.warn(`Disabled value of '${i}' for ${e}`);return}}if(p.element(r)||(r=s&&s.querySelector('[role="menu"]')),!p.element(r))return;const o=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);o.innerHTML=Y.getLabel.call(this,e,i);const a=r&&r.querySelector(`[value="${i}"]`);p.element(a)&&(a.checked=!0)},getLabel(e,t){switch(e){case"speed":return t===1?ft.get("normal",this.config):`${t}×`;case"quality":if(p.number(t)){const n=ft.get(`qualityLabel.${t}`,this.config);return n.length?n:`${t}p`}return Fh(t);case"captions":return Se.getLabel.call(this);default:return null}},setQualityMenu(e){if(!p.element(this.elements.settings.panels.quality))return;const t="quality",n=this.elements.settings.panels.quality.querySelector('[role="menu"]');p.array(e)&&(this.options.quality=yl(e).filter(r=>this.config.quality.options.includes(r)));const s=!p.empty(this.options.quality)&&this.options.quality.length>1;if(Y.toggleMenuButton.call(this,t,s),io(n),Y.checkMenu.call(this),!s)return;const i=r=>{const o=ft.get(`qualityBadge.${r}`,this.config);return o.length?Y.createBadge.call(this,o):null};this.options.quality.sort((r,o)=>{const a=this.config.quality.options;return a.indexOf(r)>a.indexOf(o)?1:-1}).forEach(r=>{Y.createMenuItem.call(this,{value:r,list:n,type:t,title:Y.getLabel.call(this,"quality",r),badge:i(r)})}),Y.updateSetting.call(this,t,n)},setCaptionsMenu(){if(!p.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Se.getTracks.call(this),s=!!n.length;if(Y.toggleMenuButton.call(this,e,s),io(t),Y.checkMenu.call(this),!s)return;const i=n.map((r,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:Se.getLabel.call(this,r),badge:r.language&&Y.createBadge.call(this,r.language.toUpperCase()),list:t,type:"language"}));i.unshift({value:-1,checked:!this.captions.toggled,title:ft.get("disabled",this.config),list:t,type:"language"}),i.forEach(Y.createMenuItem.bind(this)),Y.updateSetting.call(this,e,t)},setSpeedMenu(){if(!p.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(s=>s>=this.minimumSpeed&&s<=this.maximumSpeed);const n=!p.empty(this.options.speed)&&this.options.speed.length>1;Y.toggleMenuButton.call(this,e,n),io(t),Y.checkMenu.call(this),n&&(this.options.speed.forEach(s=>{Y.createMenuItem.call(this,{value:s,list:t,type:e,title:Y.getLabel.call(this,"speed",s)})}),Y.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!p.empty(e)&&Object.values(e).some(n=>!n.hidden);_s(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let n=e;p.element(n)||(n=Object.values(this.elements.settings.panels).find(i=>!i.hidden));const s=n.querySelector('[role^="menuitem"]');Fa.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,n=this.elements.buttons.settings;if(!p.element(t)||!p.element(n))return;const{hidden:s}=t;let i=s;if(p.boolean(e))i=e;else if(p.keyboardEvent(e)&&e.key==="Escape")i=!1;else if(p.event(e)){const r=p.function(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(r);if(o||!o&&e.target!==n&&i)return}n.setAttribute("aria-expanded",i),_s(t,!i),Le(this.elements.container,this.config.classNames.menu.open,i),i&&p.keyboardEvent(e)?Y.focusFirstMenuItem.call(this,null,!0):!i&&!s&&Fa.call(this,n,p.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const n=t.scrollWidth,s=t.scrollHeight;return Dn(t),{width:n,height:s}},showMenuPanel(e="",t=!1){const n=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!p.element(n))return;const s=n.parentNode,i=Array.from(s.children).find(r=>!r.hidden);if(nt.transitions&&!nt.reducedMotion){s.style.width=`${i.scrollWidth}px`,s.style.height=`${i.scrollHeight}px`;const r=Y.getMenuSize.call(this,n),o=a=>{a.target!==s||!["width","height"].includes(a.propertyName)||(s.style.width="",s.style.height="",qo.call(this,s,ml,o))};Ae.call(this,s,ml,o),s.style.width=`${r.width}px`,s.style.height=`${r.height}px`}_s(i,!0),_s(n,!1),Y.focusFirstMenuItem.call(this,n,t)},setDownloadUrl(){const e=this.elements.buttons.download;p.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:n,createProgress:s,createRange:i,createTime:r,setQualityMenu:o,setSpeedMenu:a,showMenuPanel:l}=Y;this.elements.controls=null,p.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(n.call(this,"play-large"));const c=ce("div",yn(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return yl(p.array(this.config.controls)?this.config.controls:[]).forEach(d=>{if(d==="restart"&&c.appendChild(n.call(this,"restart",u)),d==="rewind"&&c.appendChild(n.call(this,"rewind",u)),d==="play"&&c.appendChild(n.call(this,"play",u)),d==="fast-forward"&&c.appendChild(n.call(this,"fast-forward",u)),d==="progress"){const f=ce("div",{class:`${u.class} plyr__progress__container`}),h=ce("div",yn(this.config.selectors.progress));if(h.appendChild(i.call(this,"seek",{id:`plyr-seek-${e.id}`})),h.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const b=ce("span",{class:this.config.classNames.tooltip},"00:00");h.appendChild(b),this.elements.display.seekTooltip=b}this.elements.progress=h,f.appendChild(this.elements.progress),c.appendChild(f)}if(d==="current-time"&&c.appendChild(r.call(this,"currentTime",u)),d==="duration"&&c.appendChild(r.call(this,"duration",u)),d==="mute"||d==="volume"){let{volume:f}=this.elements;if((!p.element(f)||!c.contains(f))&&(f=ce("div",et({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=f,c.appendChild(f)),d==="mute"&&f.appendChild(n.call(this,"mute")),d==="volume"&&!mt.isIos&&!mt.isIPadOS){const h={max:1,step:.05,value:this.config.volume};f.appendChild(i.call(this,"volume",et(h,{id:`plyr-volume-${e.id}`})))}}if(d==="captions"&&c.appendChild(n.call(this,"captions",u)),d==="settings"&&!p.empty(this.config.settings)){const f=ce("div",et({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));f.appendChild(n.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const h=ce("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),b=ce("div"),g=ce("div",{id:`plyr-settings-${e.id}-home`}),E=ce("div",{role:"menu"});g.appendChild(E),b.appendChild(g),this.elements.settings.panels.home=g,this.config.settings.forEach(x=>{const y=ce("button",et(yn(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,y,x),Ae.call(this,y,"click",()=>{l.call(this,x,!1)});const k=ce("span",null,ft.get(x,this.config)),w=ce("span",{class:this.config.classNames.menu.value});w.innerHTML=e[x],k.appendChild(w),y.appendChild(k),E.appendChild(y);const C=ce("div",{id:`plyr-settings-${e.id}-${x}`,hidden:""}),N=ce("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});N.appendChild(ce("span",{"aria-hidden":!0},ft.get(x,this.config))),N.appendChild(ce("span",{class:this.config.classNames.hidden},ft.get("menuBack",this.config))),Ae.call(this,C,"keydown",q=>{q.key==="ArrowLeft"&&(q.preventDefault(),q.stopPropagation(),l.call(this,"home",!0))},!1),Ae.call(this,N,"click",()=>{l.call(this,"home",!1)}),C.appendChild(N),C.appendChild(ce("div",{role:"menu"})),b.appendChild(C),this.elements.settings.buttons[x]=y,this.elements.settings.panels[x]=C}),h.appendChild(b),f.appendChild(h),c.appendChild(f),this.elements.settings.popup=h,this.elements.settings.menu=f}if(d==="pip"&&nt.pip&&c.appendChild(n.call(this,"pip",u)),d==="airplay"&&nt.airplay&&c.appendChild(n.call(this,"airplay",u)),d==="download"){const f=et({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(f.download="");const{download:h}=this.config.urls;!p.url(h)&&this.isEmbed&&et(f,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(n.call(this,"download",f))}d==="fullscreen"&&c.appendChild(n.call(this,"fullscreen",u))}),this.isHTML5&&o.call(this,ls.getQualityOptions.call(this)),a.call(this),c},inject(){if(this.config.loadSprite){const o=Y.getIconUrl.call(this);o.cors&&Uh(o.url,"sprite-plyr")}this.id=Math.floor(Math.random()*1e4);let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let n=!0;p.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),p.element(this.config.controls)||p.string(this.config.controls)?e=this.config.controls:(e=Y.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Se.getLabel.call(this)}),n=!1);const s=o=>{let a=o;return Object.entries(t).forEach(([l,c])=>{a=Ji(a,`{${l}}`,c)}),a};n&&p.string(this.config.controls)&&(e=s(e));let i;p.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),p.element(i)||(i=this.elements.container);const r=p.element(e)?"insertAdjacentElement":"insertAdjacentHTML";if(i[r]("afterbegin",e),p.element(this.elements.controls)||Y.findElements.call(this),!p.empty(this.elements.buttons)){const o=a=>{const l=this.config.classNames.controlPressed;a.setAttribute("aria-pressed","false"),Object.defineProperty(a,"pressed",{configurable:!0,enumerable:!0,get(){return ko(a,l)},set(c=!1){Le(a,l,c),a.setAttribute("aria-pressed",c?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(a=>{p.array(a)||p.nodeList(a)?Array.from(a).filter(Boolean).forEach(o):o(a)})}if(mt.isEdge&&Rh(i),this.config.tooltips.controls){const{classNames:o,selectors:a}=this.config,l=`${a.controls.wrapper} ${a.labels} .${o.hidden}`,c=fr.call(this,l);Array.from(c).forEach(u=>{Le(u,this.config.classNames.hidden,!1),Le(u,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const n=(e=this.config.markers)===null||e===void 0||(t=e.points)===null||t===void 0?void 0:t.filter(({time:l})=>l>0&&lLe(r,o,l);n.forEach(l=>{const c=ce("span",{class:this.config.classNames.marker},""),u=`${l.time/this.duration*100}%`;r&&(c.addEventListener("mouseenter",()=>{l.label||(r.style.left=u,r.innerHTML=l.label,a(!0))}),c.addEventListener("mouseleave",()=>{a(!1)})),c.addEventListener("click",()=>{this.currentTime=l.time}),c.style.left=u,i.appendChild(c)}),s.appendChild(i),this.config.tooltips.seek||(r=ce("span",{class:this.config.classNames.tooltip},""),s.appendChild(r)),this.elements.markers={points:i,tip:r},this.elements.progress.appendChild(s)}};function jh(e,t=!0){let n=e;if(t){const s=document.createElement("a");s.href=n,n=s.href}try{return new URL(n)}catch{return null}}function Hh(e){const t=new URLSearchParams;return p.object(e)&&Object.entries(e).forEach(([n,s])=>{t.set(n,s)}),t}const Se={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!nt.textTracks){p.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Y.setCaptionsMenu.call(this);return}if(p.element(this.elements.captions)||(this.elements.captions=ce("div",yn(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Rw(this.elements.captions,this.elements.wrapper)),mt.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(r=>{const o=r.getAttribute("src"),a=jh(o);a!==null&&a.hostname!==window.location.href.hostname&&["http:","https:"].includes(a.protocol)&&Tr(o,"blob").then(l=>{r.setAttribute("src",window.URL.createObjectURL(l))}).catch(()=>{Dn(r)})})}const e=navigator.languages||[navigator.language||navigator.userLanguage||"en"],t=yl(e.map(i=>i.split("-")[0]));let n=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();n==="auto"&&([n]=t);let s=this.storage.get("captions")||this.captions.active;if(p.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:t}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";Ae.call(this,this.media.textTracks,i,Se.update.bind(this))}setTimeout(Se.update.bind(this),0)},update(){const e=Se.getTracks.call(this,!0),{active:t,language:n,meta:s,currentTrackNode:i}=this.captions,r=!!e.find(o=>o.language===n);this.isHTML5&&this.isVideo&&e.filter(o=>!s.get(o)).forEach(o=>{this.debug.log("Track added",o),s.set(o,{default:o.mode==="showing"}),o.mode==="showing"&&(o.mode="hidden"),Ae.call(this,o,"cuechange",()=>Se.updateCues.call(this))}),(r&&this.language!==n||!e.includes(i))&&(Se.setLanguage.call(this,n),Se.toggle.call(this,t&&r)),this.elements&&Le(this.elements.container,this.config.classNames.captions.enabled,!p.empty(e)),p.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Y.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:n}=this.captions,s=this.config.classNames.captions.active,i=p.nullOrUndefined(e)?!n:e;if(i!==n){if(t||(this.captions.active=i,this.storage.set({captions:i})),!this.language&&i&&!t){const r=Se.getTracks.call(this),o=Se.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);this.captions.language=o.language,Se.set.call(this,r.indexOf(o));return}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=i),Le(this.elements.container,s,i),this.captions.toggled=i,Y.updateSetting.call(this,"captions"),ue.call(this,this.media,i?"captionsenabled":"captionsdisabled")}setTimeout(()=>{i&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const n=Se.getTracks.call(this);if(e===-1){Se.toggle.call(this,!1,t);return}if(!p.number(e)){this.debug.warn("Invalid caption argument",e);return}if(!(e in n)){this.debug.warn("Track not found",e);return}if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=n[e],{language:i}=s||{};this.captions.currentTrackNode=s,Y.updateSetting.call(this,"captions"),t||(this.captions.language=i,this.storage.set({language:i})),this.isVimeo&&this.embed.enableTextTrack(i,null,!1),ue.call(this,this.media,"languagechange")}Se.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Se.updateCues.call(this)},setLanguage(e,t=!0){if(!p.string(e)){this.debug.warn("Invalid language argument",e);return}const n=e.toLowerCase();this.captions.language=n;const s=Se.getTracks.call(this),i=Se.findTrack.call(this,[n]);Se.set.call(this,s.indexOf(i),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(n=>!this.isHTML5||e||this.captions.meta.has(n)).filter(n=>["captions","subtitles"].includes(n.kind))},findTrack(e,t=!1){const n=Se.getTracks.call(this),s=o=>Number((this.captions.meta.get(o)||{}).default),i=Array.from(n).sort((o,a)=>s(a)-s(o));let r;return e.every(o=>(r=i.find(a=>a.language===o),!r)),r||(t?i[0]:void 0)},getCurrentTrack(){return Se.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!p.track(t)&&nt.textTracks&&this.captions.toggled&&(t=Se.getCurrentTrack.call(this)),p.track(t)?p.empty(t.label)?p.empty(t.language)?ft.get("enabled",this.config):e.language.toUpperCase():t.label:ft.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!p.element(this.elements.captions)){this.debug.warn("No captions element to render to");return}if(!p.nullOrUndefined(e)&&!Array.isArray(e)){this.debug.warn("updateCues: Invalid input",e);return}let t=e;if(!t){const i=Se.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map(r=>r.getCueAsHTML()).map(Kw)}const n=t.map(i=>i.trim()).join(` `);if(n!==this.elements.captions.innerHTML){io(this.elements.captions);const i=ce("span",yn(this.config.selectors.caption));i.innerHTML=n,this.elements.captions.appendChild(i),ue.call(this,this.media,"cuechange")}}},zh={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Ua={active:"picture-in-picture",inactive:"inline"},os={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ba={audio:"audio",video:"video"};function Xw(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?os.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?os.vimeo:null}function ja(){}class Zw{constructor(t=!1){this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):ja}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):ja}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):ja}}class sn{constructor(t){Z(this,"onChange",()=>{if(!this.supported)return;const n=this.player.elements.buttons.fullscreen;p.element(n)&&(n.pressed=this.active);const s=this.target===this.player.media?this.target:this.player.elements.container;ue.call(this.player,s,this.active?"enterfullscreen":"exitfullscreen",!0)}),Z(this,"toggleFallback",(n=!1)=>{if(n){var s,i;this.scrollPosition={x:(s=window.scrollX)!==null&&s!==void 0?s:0,y:(i=window.scrollY)!==null&&i!==void 0?i:0}}else window.scrollTo(this.scrollPosition.x,this.scrollPosition.y);if(document.body.style.overflow=n?"hidden":"",Le(this.target,this.player.config.classNames.fullscreen.fallback,n),mt.isIos){let r=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";r||(r=document.createElement("meta"),r.setAttribute("name","viewport"));const a=p.string(r.content)&&r.content.includes(o);n?(this.cleanupViewport=!a,a||(r.content+=`,${o}`)):this.cleanupViewport&&(r.content=r.content.split(",").filter(l=>l.trim()!==o).join(","))}this.onChange()}),Z(this,"trapFocus",n=>{if(mt.isIos||mt.isIPadOS||!this.active||n.key!=="Tab")return;const s=document.activeElement,i=fr.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[r]=i,o=i[i.length-1];s===o&&!n.shiftKey?(r.focus(),n.preventDefault()):s===r&&n.shiftKey&&(o.focus(),n.preventDefault())}),Z(this,"update",()=>{if(this.supported){let n;this.forceFallback?n="Fallback (forced)":sn.nativeSupported?n="Native":n="Fallback",this.player.debug.log(`${n} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");Le(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),Z(this,"enter",()=>{this.supported&&(mt.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!sn.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?p.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),Z(this,"exit",()=>{if(this.supported){if(mt.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),_n(this.player.play());else if(!sn.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(!this.prefix)(document.cancelFullScreen||document.exitFullscreen).call(document);else if(!p.empty(this.prefix)){const n=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${n}${this.property}`]()}}}),Z(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=t,this.prefix=sn.prefix,this.property=sn.property,this.scrollPosition={x:0,y:0},this.forceFallback=t.config.fullscreen.fallback==="force",this.player.elements.fullscreen=t.config.fullscreen.container&&Lw(this.player.elements.container,t.config.fullscreen.container),Ae.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),Ae.call(this.player,this.player.elements.container,"dblclick",n=>{p.element(this.player.elements.controls)&&this.player.elements.controls.contains(n.target)||this.player.listeners.proxy(n,this.toggle,"fullscreen")}),Ae.call(this,this.player.elements.container,"keydown",n=>this.trapFocus(n)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return sn.nativeSupported&&!this.forceFallback}static get prefix(){if(p.function(document.exitFullscreen))return"";let t="";return["webkit","moz","ms"].some(s=>p.function(document[`${s}ExitFullscreen`])||p.function(document[`${s}CancelFullScreen`])?(t=s,!0):!1),t}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,sn.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||sn.nativeSupported||!mt.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!sn.nativeSupported||this.forceFallback)return ko(this.target,this.player.config.classNames.fullscreen.fallback);const t=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}get target(){var t;return mt.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(t=this.player.elements.fullscreen)!==null&&t!==void 0?t:this.player.elements.container}}function ro(e,t=1){return new Promise((n,s)=>{const i=new Image,r=()=>{delete i.onload,delete i.onerror,(i.naturalWidth>=t?n:s)(i)};Object.assign(i,{onload:r,onerror:r,src:e})})}const Me={addStyleHook(){Le(this.elements.container,this.config.selectors.container.replace(".",""),!0),Le(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui){this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),Me.toggleNativeControls.call(this,!0);return}p.element(this.elements.controls)||(Y.inject.call(this),this.listeners.controls()),Me.toggleNativeControls.call(this),this.isHTML5&&Se.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Y.updateVolume.call(this),Y.timeUpdate.call(this),Y.durationUpdate.call(this),Me.checkPlaying.call(this),Le(this.elements.container,this.config.classNames.pip.supported,nt.pip&&this.isHTML5&&this.isVideo),Le(this.elements.container,this.config.classNames.airplay.supported,nt.airplay&&this.isHTML5),Le(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{ue.call(this,this.media,"ready")},0),Me.setTitle.call(this),this.poster&&Me.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&Y.durationUpdate.call(this),this.config.mediaMetadata&&Y.setMediaMetadata.call(this)},setTitle(){let e=ft.get("play",this.config);if(p.string(this.config.title)&&!p.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const t=at.call(this,"iframe");if(!p.element(t))return;const n=p.empty(this.config.title)?"video":this.config.title,s=ft.get("frameTitle",this.config);t.setAttribute("title",s.replace("{title}",n))}},togglePoster(e){Le(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Ow.call(this).then(()=>ro(e)).catch(n=>{throw e===this.poster&&Me.togglePoster.call(this,!1),n}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Me.togglePoster.call(this,!0),e)))},checkPlaying(e){Le(this.elements.container,this.config.classNames.playing,this.playing),Le(this.elements.container,this.config.classNames.paused,this.paused),Le(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(t=>{Object.assign(t,{pressed:this.playing}),t.setAttribute("aria-label",ft.get(this.playing?"pause":"play",this.config))}),!(p.event(e)&&e.type==="timeupdate")&&Me.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{Le(this.elements.container,this.config.classNames.loading,this.loading),Me.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!p.empty(e)&&p.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),p.empty(this.media.style)&&this.media.removeAttribute("style")}};class Jw{constructor(t){Z(this,"firstTouch",()=>{const{player:n}=this,{elements:s}=n;n.touch=!0,Le(s.container,n.config.classNames.isTouch,!0)}),Z(this,"global",(n=!0)=>{const{player:s}=this;s.config.keyboard.global&&dr.call(s,window,"keydown keyup",this.handleKey,n,!1),dr.call(s,document.body,"click",this.toggleMenu,n),Ql.call(s,document.body,"touchstart",this.firstTouch)}),Z(this,"container",()=>{const{player:n}=this,{config:s,elements:i,timers:r}=n;!s.keyboard.global&&s.keyboard.focused&&Ae.call(n,i.container,"keydown keyup",this.handleKey,!1),Ae.call(n,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",l=>{const{controls:c}=i;c&&l.type==="enterfullscreen"&&(c.pressed=!1,c.hover=!1);const u=["touchstart","touchmove","mousemove"].includes(l.type);let d=0;u&&(Me.toggleControls.call(n,!0),d=n.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>Me.toggleControls.call(n,!1),d)});const o=()=>{if(!n.isVimeo||n.config.vimeo.premium)return;const l=i.wrapper,{active:c}=n.fullscreen,[u,d]=ec.call(n),f=Oh(`aspect-ratio: ${u} / ${d}`);if(!c){f?(l.style.width=null,l.style.height=null):(l.style.maxWidth=null,l.style.margin=null);return}const[h,b]=$w(),g=h/b>u/d;f?(l.style.width=g?"auto":"100%",l.style.height=g?"100%":"auto"):(l.style.maxWidth=g?`${b/d*u}px`:null,l.style.margin=g?"0 auto":null)},a=()=>{clearTimeout(r.resized),r.resized=setTimeout(o,50)};Ae.call(n,i.container,"enterfullscreen exitfullscreen",l=>{const{target:c}=n.fullscreen;if(c!==i.container||!n.isEmbed&&p.empty(n.config.ratio))return;o(),(l.type==="enterfullscreen"?Ae:qo).call(n,window,"resize",a)})}),Z(this,"media",()=>{const{player:n}=this,{elements:s}=n;if(Ae.call(n,n.media,"timeupdate seeking seeked",r=>Y.timeUpdate.call(n,r)),Ae.call(n,n.media,"durationchange loadeddata loadedmetadata",r=>Y.durationUpdate.call(n,r)),Ae.call(n,n.media,"ended",()=>{n.isHTML5&&n.isVideo&&n.config.resetOnEnd&&(n.restart(),n.pause())}),Ae.call(n,n.media,"progress playing seeking seeked",r=>Y.updateProgress.call(n,r)),Ae.call(n,n.media,"volumechange",r=>Y.updateVolume.call(n,r)),Ae.call(n,n.media,"playing play pause ended emptied timeupdate",r=>Me.checkPlaying.call(n,r)),Ae.call(n,n.media,"waiting canplay seeked playing",r=>Me.checkLoading.call(n,r)),n.supported.ui&&n.config.clickToPlay&&!n.isAudio){const r=at.call(n,`.${n.config.classNames.video}`);if(!p.element(r))return;Ae.call(n,s.container,"click",o=>{![s.container,r].includes(o.target)&&!r.contains(o.target)||n.touch&&n.config.hideControls||(n.ended?(this.proxy(o,n.restart,"restart"),this.proxy(o,()=>{_n(n.play())},"play")):this.proxy(o,()=>{_n(n.togglePlay())},"play"))})}n.supported.ui&&n.config.disableContextMenu&&Ae.call(n,s.wrapper,"contextmenu",r=>{r.preventDefault()},!1),Ae.call(n,n.media,"volumechange",()=>{n.storage.set({volume:n.volume,muted:n.muted})}),Ae.call(n,n.media,"ratechange",()=>{Y.updateSetting.call(n,"speed"),n.storage.set({speed:n.speed})}),Ae.call(n,n.media,"qualitychange",r=>{Y.updateSetting.call(n,"quality",null,r.detail.quality)}),Ae.call(n,n.media,"ready qualitychange",()=>{Y.setDownloadUrl.call(n)});const i=n.config.events.concat(["keyup","keydown"]).join(" ");Ae.call(n,n.media,i,r=>{let{detail:o={}}=r;r.type==="error"&&(o=n.media.error),ue.call(n,s.container,r.type,!0,o)})}),Z(this,"proxy",(n,s,i)=>{const{player:r}=this,o=r.config.listeners[i],a=p.function(o);let l=!0;a&&(l=o.call(r,n)),l!==!1&&p.function(s)&&s.call(r,n)}),Z(this,"bind",(n,s,i,r,o=!0)=>{const{player:a}=this,l=a.config.listeners[r],c=p.function(l);Ae.call(a,n,s,u=>this.proxy(u,i,r),o&&!c)}),Z(this,"controls",()=>{const{player:n}=this,{elements:s}=n,i=mt.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(r=>{this.bind(r,"click",()=>{_n(n.togglePlay())},"play")}),this.bind(s.buttons.restart,"click",n.restart,"restart"),this.bind(s.buttons.rewind,"click",()=>{n.lastSeekTime=Date.now(),n.rewind()},"rewind"),this.bind(s.buttons.fastForward,"click",()=>{n.lastSeekTime=Date.now(),n.forward()},"fastForward"),this.bind(s.buttons.mute,"click",()=>{n.muted=!n.muted},"mute"),this.bind(s.buttons.captions,"click",()=>n.toggleCaptions()),this.bind(s.buttons.download,"click",()=>{ue.call(n,n.media,"download")},"download"),this.bind(s.buttons.fullscreen,"click",()=>{n.fullscreen.toggle()},"fullscreen"),this.bind(s.buttons.pip,"click",()=>{n.pip="toggle"},"pip"),this.bind(s.buttons.airplay,"click",n.airplay,"airplay"),this.bind(s.buttons.settings,"click",r=>{r.stopPropagation(),r.preventDefault(),Y.toggleMenu.call(n,r)},null,!1),this.bind(s.buttons.settings,"keyup",r=>{if([" ","Enter"].includes(r.key)){if(r.key==="Enter"){Y.focusFirstMenuItem.call(n,null,!0);return}r.preventDefault(),r.stopPropagation(),Y.toggleMenu.call(n,r)}},null,!1),this.bind(s.settings.menu,"keydown",r=>{r.key==="Escape"&&Y.toggleMenu.call(n,r)}),this.bind(s.inputs.seek,"mousedown mousemove",r=>{const o=s.progress.getBoundingClientRect(),a=r.pageX-r.clientX,l=100/o.width*(r.pageX-o.left-a);r.currentTarget.setAttribute("seek-value",l)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",r=>{const o=r.currentTarget,a="play-on-seeked";if(p.keyboardEvent(r)&&!["ArrowLeft","ArrowRight"].includes(r.key))return;n.lastSeekTime=Date.now();const l=o.hasAttribute(a),c=["mouseup","touchend","keyup"].includes(r.type);l&&c?(o.removeAttribute(a),_n(n.play())):!c&&n.playing&&(o.setAttribute(a,""),n.pause())}),mt.isIos){const r=fr.call(n,'input[type="range"]');Array.from(r).forEach(o=>this.bind(o,i,a=>Rh(a.target)))}this.bind(s.inputs.seek,i,r=>{const o=r.currentTarget;let a=o.getAttribute("seek-value");p.empty(a)&&(a=o.value),o.removeAttribute("seek-value"),n.currentTime=a/o.max*n.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",r=>Y.updateSeekTooltip.call(n,r)),this.bind(s.progress,"mousemove touchmove",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.startMove(r)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:r}=n;r&&r.loaded&&r.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.startScrubbing(r)}),this.bind(s.progress,"mouseup touchend",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.endScrubbing(r)}),mt.isWebKit&&Array.from(fr.call(n,'input[type="range"]')).forEach(r=>{this.bind(r,"input",o=>Y.updateRangeFill.call(n,o.target))}),n.config.toggleInvert&&!p.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{n.currentTime!==0&&(n.config.invertTime=!n.config.invertTime,Y.timeUpdate.call(n))}),this.bind(s.inputs.volume,i,r=>{n.volume=r.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",r=>{s.controls.hover=!n.touch&&r.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(r=>!r.contains(s.container)).forEach(r=>{this.bind(r,"mouseenter mouseleave",o=>{s.controls&&(s.controls.hover=!n.touch&&o.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",r=>{s.controls.pressed=["mousedown","touchstart"].includes(r.type)}),this.bind(s.controls,"focusin",()=>{const{config:r,timers:o}=n;Le(s.controls,r.classNames.noTransition,!0),Me.toggleControls.call(n,!0),setTimeout(()=>{Le(s.controls,r.classNames.noTransition,!1)},0);const a=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>Me.toggleControls.call(n,!1),a)}),this.bind(s.inputs.volume,"wheel",r=>{const o=r.webkitDirectionInvertedFromDevice,[a,l]=[r.deltaX,-r.deltaY].map(d=>o?-d:d),c=Math.sign(Math.abs(a)>Math.abs(l)?a:l);n.increaseVolume(c/50);const{volume:u}=n.media;(c===1&&u<1||c===-1&&u>0)&&r.preventDefault()},"volume",!1)}),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(t){const{player:n}=this,{elements:s}=n,{key:i,type:r,altKey:o,ctrlKey:a,metaKey:l,shiftKey:c}=t,u=r==="keydown",d=u&&i===this.lastKey;if(o||a||l||c||!i)return;const f=h=>{n.currentTime=n.duration/10*h};if(u){const h=document.activeElement;if(p.element(h)){const{editable:g}=n.config.selectors,{seek:E}=s.inputs;if(h!==E&&Cs(h,g)||t.key===" "&&Cs(h,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(i)&&(t.preventDefault(),t.stopPropagation()),i){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d||f(Number.parseInt(i,10));break;case" ":case"k":d||_n(n.togglePlay());break;case"ArrowUp":n.increaseVolume(.1);break;case"ArrowDown":n.decreaseVolume(.1);break;case"m":d||(n.muted=!n.muted);break;case"ArrowRight":n.forward();break;case"ArrowLeft":n.rewind();break;case"f":n.fullscreen.toggle();break;case"c":d||n.toggleCaptions();break;case"l":n.loop=!n.loop;break}i==="Escape"&&!n.fullscreen.usingNative&&n.fullscreen.active&&n.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}toggleMenu(t){Y.toggleMenu.call(this.player,t)}}function Qw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oo={exports:{}},e0=oo.exports,cf;function t0(){return cf||(cf=1,(function(e,t){(function(n,s){e.exports=s()})(e0,function(){var n=function(){},s={},i={},r={};function o(f,h){f=f.push?f:[f];var b=[],g=f.length,E=g,x,y,k,w;for(x=function(C,N){N.length&&b.push(C),E--,E||h(b)};g--;){if(y=f[g],k=i[y],k){x(y,k);continue}w=r[y]=r[y]||[],w.push(x)}}function a(f,h){if(f){var b=r[f];if(i[f]=h,!!b)for(;b.length;)b[0](f,h),b.splice(0,1)}}function l(f,h){f.call&&(f={success:f}),h.length?(f.error||n)(h):(f.success||n)(f)}function c(f,h,b,g){var E=document,x=b.async,y=(b.numRetries||0)+1,k=b.before||n,w=f.replace(/[\?|#].*$/,""),C=f.replace(/^(css|img|module|nomodule)!/,""),N,q,U;if(g=g||0,/(^css!|\.css$)/.test(w))U=E.createElement("link"),U.rel="stylesheet",U.href=C,N="hideFocus"in U,N&&U.relList&&(N=0,U.rel="preload",U.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(w))U=E.createElement("img"),U.src=C;else if(U=E.createElement("script"),U.src=C,U.async=x===void 0?!0:x,q="noModule"in U,/^module!/.test(w)){if(!q)return h(f,"l");U.type="module"}else if(/^nomodule!/.test(w)&&q)return h(f,"l");U.onload=U.onerror=U.onbeforeload=function(M){var O=M.type[0];if(N)try{U.sheet.cssText.length||(O="e")}catch(j){j.code!=18&&(O="e")}if(O=="e"){if(g+=1,g{s0(e,{success:t,error:n})})}function i0(e){if(p.empty(e))return null;if(p.number(Number(e)))return e;const t=/^.*(vimeo.com\/|video\/)(\d+).*/,n=e.match(t);return n?n[2]:e}function r0(e){const t=/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/,n=e.match(t);return n&&n.length===5?n[4]:null}function Fi(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ue.call(this,this.media,e?"play":"pause"))}const vl={setup(){const e=this;Le(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,si.call(e),p.object(window.Vimeo)?vl.ready.call(e):tc(e.config.urls.vimeo.sdk).then(()=>{vl.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:n,referrerPolicy:s,...i}=t;let r=e.media.getAttribute("src"),o="";p.empty(r)?(r=e.media.getAttribute(e.config.attributes.embed.id),o=e.media.getAttribute(e.config.attributes.embed.hash)):o=r0(r);const a=o?{h:o}:{};n&&Object.assign(i,{controls:!1,sidedock:!1});const l=Hh({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...a,...i}),c=i0(r),u=ce("iframe"),d=bl(e.config.urls.vimeo.iframe,c,l);if(u.setAttribute("src",d),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),p.empty(s)||u.setAttribute("referrerPolicy",s),n||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=_o(u,e.media);else{const y=ce("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});y.appendChild(u),e.media=_o(y,e.media)}t.customControls||Tr(bl(e.config.urls.vimeo.api,d)).then(y=>{p.empty(y)||!y.thumbnail_url||Me.setPoster.call(e,y.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Fi.call(e,!0),e.embed.play()),e.media.pause=()=>(Fi.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:f}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return f},set(y){const{embed:k,media:w,paused:C,volume:N}=e,q=C&&!k.hasPlayed;w.seeking=!0,ue.call(e,w,"seeking"),Promise.resolve(q&&k.setVolume(0)).then(()=>k.setCurrentTime(y)).then(()=>q&&k.pause()).then(()=>q&&k.setVolume(N)).catch(()=>{})}});let h=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return h},set(y){e.embed.setPlaybackRate(y).then(()=>{h=y,ue.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:b}=e.config;Object.defineProperty(e.media,"volume",{get(){return b},set(y){e.embed.setVolume(y).then(()=>{b=y,ue.call(e,e.media,"volumechange")})}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get(){return g},set(y){const k=p.boolean(y)?y:!1;e.embed.setMuted(k?!0:e.config.muted).then(()=>{g=k,ue.call(e,e.media,"volumechange")})}});let{loop:E}=e.config;Object.defineProperty(e.media,"loop",{get(){return E},set(y){const k=p.boolean(y)?y:e.config.loop.active;e.embed.setLoop(k).then(()=>{E=k})}});let x;e.embed.getVideoUrl().then(y=>{x=y,Y.setDownloadUrl.call(e)}).catch(y=>{this.debug.warn(y)}),Object.defineProperty(e.media,"currentSrc",{get(){return x}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(y=>{const[k,w]=y;e.embed.ratio=Dh(k,w),si.call(this)}),e.embed.setAutopause(e.config.autopause).then(y=>{e.config.autopause=y}),e.embed.getVideoTitle().then(y=>{e.config.title=y,Me.setTitle.call(this)}),e.embed.getCurrentTime().then(y=>{f=y,ue.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(y=>{e.media.duration=y,ue.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(y=>{e.media.textTracks=y,Se.setup.call(e)}),e.embed.on("cuechange",({cues:y=[]})=>{const k=y.map(w=>qw(w.text));Se.updateCues.call(e,k)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(y=>{Fi.call(e,!y),y||ue.call(e,e.media,"playing")}),p.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{ue.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{ue.call(e,e.media,"playing")}),e.embed.on("play",()=>{Fi.call(e,!0),ue.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Fi.call(e,!1)}),e.embed.on("timeupdate",y=>{e.media.seeking=!1,f=y.seconds,ue.call(e,e.media,"timeupdate")}),e.embed.on("progress",y=>{e.media.buffered=y.percent,ue.call(e,e.media,"progress"),Number.parseInt(y.percent,10)===1&&ue.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(k=>{k!==e.media.duration&&(e.media.duration=k,ue.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,ue.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,ue.call(e,e.media,"ended")}),e.embed.on("error",y=>{e.media.error=y,ue.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>Me.build.call(e),0)}};function o0(e){if(p.empty(e))return null;const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,n=e.match(t);return n&&n[2]?n[2]:e}function Ui(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ue.call(this,this.media,e?"play":"pause"))}function a0(e){if(e.noCookie)return"https://www.youtube-nocookie.com";if(window.location.protocol==="http:")return"http://www.youtube.com"}const ao={setup(){if(Le(this.elements.wrapper,this.config.classNames.embed,!0),p.object(window.YT)&&p.function(window.YT.Player))ao.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{p.function(e)&&e(),ao.ready.call(this)},tc(this.config.urls.youtube.sdk).catch(t=>{this.debug.warn("YouTube API failed to load",t)})}},getTitle(e){const t=bl(this.config.urls.youtube.api,e);Tr(t).then(n=>{if(p.object(n)){const{title:s,height:i,width:r}=n;this.config.title=s,Me.setTitle.call(this),this.embed.ratio=Dh(r,i)}si.call(this)}).catch(()=>{si.call(this)})},ready(){const e=this,t=e.config.youtube,n=e.media&&e.media.getAttribute("id");if(!p.empty(n)&&n.startsWith("youtube-"))return;let s=e.media.getAttribute("src");p.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const i=o0(s),r=Hw(e.provider),o=ce("div",{id:r,"data-poster":t.customControls?e.poster:void 0});if(e.media=_o(o,e.media),t.customControls){const a=l=>`https://i.ytimg.com/vi/${i}/${l}default.jpg`;ro(a("maxres"),121).catch(()=>ro(a("sd"),121)).catch(()=>ro(a("hq"))).then(l=>Me.setPoster.call(e,l.src)).then(l=>{l.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:i,host:a0(t),playerVars:et({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(a){if(!e.media.error){const l=a.data,c={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[l]||"An unknown error occurred";e.media.error={code:l,message:c},ue.call(e,e.media,"error")}},onPlaybackRateChange(a){const l=a.target;e.media.playbackRate=l.getPlaybackRate(),ue.call(e,e.media,"ratechange")},onReady(a){if(p.function(e.media.play))return;const l=a.target;ao.getTitle.call(e,i),e.media.play=()=>{Ui.call(e,!0),l.playVideo()},e.media.pause=()=>{Ui.call(e,!1),l.pauseVideo()},e.media.stop=()=>{l.stopVideo()},e.media.duration=l.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(l.getCurrentTime())},set(f){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ue.call(e,e.media,"seeking"),l.seekTo(f)}}),Object.defineProperty(e.media,"playbackRate",{get(){return l.getPlaybackRate()},set(f){l.setPlaybackRate(f)}});let{volume:c}=e.config;Object.defineProperty(e.media,"volume",{get(){return c},set(f){c=f,l.setVolume(c*100),ue.call(e,e.media,"volumechange")}});let{muted:u}=e.config;Object.defineProperty(e.media,"muted",{get(){return u},set(f){const h=p.boolean(f)?f:u;u=h,l[h?"mute":"unMute"](),l.setVolume(c*100),ue.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get(){return l.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});const d=l.getAvailablePlaybackRates();e.options.speed=d.filter(f=>e.config.speed.options.includes(f)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ue.call(e,e.media,"timeupdate"),ue.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=l.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBufferedMe.build.call(e),50)},onStateChange(a){const l=a.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(a.data)&&(e.media.seeking=!1,ue.call(e,e.media,"seeked")),a.data){case-1:ue.call(e,e.media,"timeupdate"),e.media.buffered=l.getVideoLoadedFraction(),ue.call(e,e.media,"progress");break;case 0:Ui.call(e,!1),e.media.loop?(l.stopVideo(),l.playVideo()):ue.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Ui.call(e,!0),ue.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{ue.call(e,e.media,"timeupdate")},50),e.media.duration!==l.getDuration()&&(e.media.duration=l.getDuration(),ue.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Ui.call(e,!1);break;case 3:ue.call(e,e.media,"waiting");break}ue.call(e,e.elements.container,"statechange",!1,{code:a.data})}}})}},Vh={setup(){if(!this.media){this.debug.warn("No media element found!");return}Le(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Le(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Le(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=ce("div",{class:this.config.classNames.video}),Nh(this.media,this.elements.wrapper),this.elements.poster=ce("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?ls.setup.call(this):this.isYouTube?ao.setup.call(this):this.isVimeo&&vl.setup.call(this)}};function l0(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}class c0{constructor(t){Z(this,"load",()=>{this.enabled&&(!p.object(window.google)||!p.object(window.google.ima)?tc(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}):this.ready())}),Z(this,"ready",()=>{this.enabled||l0(this),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),Z(this,"setupIMA",()=>{this.elements.container=ce("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,n=>this.onAdsManagerLoaded(n),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,n=>this.onAdError(n),!1),this.requestAds()}),Z(this,"requestAds",()=>{const{container:n}=this.player.elements;try{const s=new google.ima.AdsRequest;s.adTagUrl=this.tagUrl,s.linearAdSlotWidth=n.offsetWidth,s.linearAdSlotHeight=n.offsetHeight,s.nonLinearAdSlotWidth=n.offsetWidth,s.nonLinearAdSlotHeight=n.offsetHeight,s.forceNonLinearFullSlot=!1,s.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(s)}catch(s){this.onAdError(s)}}),Z(this,"pollCountdown",(n=!1)=>{if(!n){clearInterval(this.countdownTimer),this.elements.container.removeAttribute("data-badge-text");return}const s=()=>{const i=Ko(Math.max(this.manager.getRemainingTime(),0)),r=`${ft.get("advertisement",this.player.config)} - ${i}`;this.elements.container.setAttribute("data-badge-text",r)};this.countdownTimer=setInterval(s,100)}),Z(this,"onAdsManagerLoaded",n=>{if(!this.enabled)return;const s=new google.ima.AdsRenderingSettings;s.restoreCustomPlaybackStateOnAdBreakComplete=!0,s.enablePreloading=!0,this.manager=n.getAdsManager(this.player,s),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,i=>this.onAdError(i)),Object.keys(google.ima.AdEvent.Type).forEach(i=>{this.manager.addEventListener(google.ima.AdEvent.Type[i],r=>this.onAdEvent(r))}),this.trigger("loaded")}),Z(this,"addCuePoints",()=>{p.empty(this.cuePoints)||this.cuePoints.forEach(n=>{if(n!==0&&n!==-1&&n{const{container:s}=this.player.elements,i=n.getAd(),r=n.getAdData();switch((a=>{ue.call(this.player,this.player.media,`ads${a.replace(/_/g,"").toLowerCase()}`)})(n.type),n.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=s.offsetWidth,i.height=s.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`);break}}),Z(this,"onAdError",n=>{this.cancel(),this.player.debug.warn("Ads error",n)}),Z(this,"listeners",()=>{const{container:n}=this.player.elements;let s;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{s=this.player.currentTime}),this.player.on("seeked",()=>{const i=this.player.currentTime;p.empty(this.cuePoints)||this.cuePoints.forEach((r,o)=>{s{this.manager&&this.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}),Z(this,"play",()=>{const{container:n}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(s){this.onAdError(s)}}).catch(()=>{})}),Z(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,_n(this.player.media.play())}),Z(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),Z(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),Z(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(n=>{this.on("loaded",n),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),Z(this,"trigger",(n,...s)=>{const i=this.events[n];p.array(i)&&i.forEach(r=>{p.function(r)&&r.apply(this,s)})}),Z(this,"on",(n,s)=>(p.array(this.events[n])||(this.events[n]=[]),this.events[n].push(s),this)),Z(this,"startSafetyTimer",(n,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},n)}),Z(this,"clearSafetyTimer",n=>{p.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${n}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((n,s)=>{this.on("loaded",n),this.on("error",s)}),this.load()}get enabled(){const{config:t}=this;return this.player.isHTML5&&this.player.isVideo&&t.enabled&&(!p.empty(t.publisherId)||p.url(t.tagUrl))}get tagUrl(){const{config:t}=this;if(p.url(t.tagUrl))return t.tagUrl;const n={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:t.publisherId};return`https://go.aniview.com/api/adserver6/vast/?${Hh(n)}`}}function Wh(e=0,t=0,n=255){return Math.min(Math.max(e,t),n)}function u0(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(s=>{const i={};s.split(/\r\n|\n|\r/).forEach(o=>{if(p.number(i.startTime)){if(!p.empty(o.trim())&&p.empty(i.text)){const a=o.trim().split("#xywh=");[i.text]=a,a[1]&&([i.x,i.y,i.w,i.h]=a[1].split(","))}}else{const a=o.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);a&&(i.startTime=Number(a[1]||0)*60*60+Number(a[2])*60+Number(a[3])+ +`0.${a[4]}`,i.endTime=Number(a[6]||0)*60*60+Number(a[7])*60+Number(a[8])+ +`0.${a[9]}`)}}),i.text&&t.push(i)}),t}function uf(e,t){const n=t.width/t.height,s={};return e>n?(s.width=t.width,s.height=1/e*t.width):(s.height=t.height,s.width=e*t.height),s}class wl{constructor(t){Z(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),Z(this,"getThumbnails",()=>new Promise(n=>{const{src:s}=this.player.config.previewThumbnails;if(p.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((r,o)=>r.height-o.height),this.player.debug.log("Preview thumbnails",this.thumbnails),n()};if(p.function(s))s(r=>{this.thumbnails=r,i()});else{const o=(p.string(s)?[s]:s).map(a=>this.getThumbnail(a));Promise.all(o).then(i)}})),Z(this,"getThumbnail",n=>new Promise(s=>{Tr(n,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const r={frames:u0(i),height:null,urlPrefix:""};!r.frames[0].text.startsWith("/")&&!r.frames[0].text.startsWith("http://")&&!r.frames[0].text.startsWith("https://")&&(r.urlPrefix=n.substring(0,n.lastIndexOf("/")+1));const o=new Image;o.onload=()=>{r.height=o.naturalHeight,r.width=o.naturalWidth,this.thumbnails.push(r),s()},o.src=r.urlPrefix+r.frames[0].text})})),Z(this,"startMove",n=>{if(this.loaded&&!(!p.event(n)||!["touchmove","mousemove"].includes(n.type))&&this.player.media.duration){if(n.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var s,i;const r=this.player.elements.progress.getBoundingClientRect(),o=100/r.width*(n.pageX-r.left);this.seekTime=this.player.media.duration*(o/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=n.pageX,this.elements.thumb.time.textContent=Ko(this.seekTime);const a=(s=this.player.config.markers)===null||s===void 0||(i=s.points)===null||i===void 0?void 0:i.find(({time:l})=>l===Math.round(this.seekTime));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}
`)}this.showImageAtCurrentTime()}}),Z(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),Z(this,"startScrubbing",n=>{(p.nullOrUndefined(n.button)||n.button===!1||n.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),Z(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ql.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),Z(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),Z(this,"render",()=>{this.elements.thumb.container=ce("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=ce("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const n=ce("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=ce("span",{},"00:00"),n.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(n),p.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=ce("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),Z(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),Z(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const n=this.thumbnails[0].frames.findIndex(r=>this.seekTime>=r.startTime&&this.seekTime<=r.endTime),s=n>=0;let i=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((r,o)=>{this.loadedImages.includes(r.frames[n].text)&&(i=o)}),n!==this.showingThumb&&(this.showingThumb=n,this.loadImage(i)))}),Z(this,"loadImage",(n=0)=>{const s=this.showingThumb,i=this.thumbnails[n],{urlPrefix:r}=i,o=i.frames[s],a=i.frames[s].text,l=r+a;if(!this.currentImageElement||this.currentImageElement.dataset.filename!==a){this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const c=new Image;c.src=l,c.dataset.index=s,c.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),c.onload=()=>this.showImage(c,o,n,s,a,!0),this.loadingImage=c,this.removeOldImages(c)}else this.showImage(this.currentImageElement,o,n,s,a,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement)}),Z(this,"showImage",(n,s,i,r,o,a=!0)=>{this.player.debug.log(`Showing thumb: ${o}. num: ${r}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(n,s),a&&(this.currentImageContainer.appendChild(n),this.currentImageElement=n,this.loadedImages.includes(o)||this.loadedImages.push(o)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(i,n,s,o))}),Z(this,"removeOldImages",n=>{Array.from(this.currentImageContainer.children).forEach(s=>{if(s.tagName.toLowerCase()!=="img")return;const i=this.usingSprites?500:1e3;if(s.dataset.index!==n.dataset.index&&!s.dataset.deleting){s.dataset.deleting=!0;const{currentImageContainer:r}=this;setTimeout(()=>{r.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},i)}})}),Z(this,"preloadNearby",(n,s=!0)=>new Promise(i=>{setTimeout(()=>{const r=this.thumbnails[0].frames[n].text;if(this.showingThumbFilename===r){let o;s?o=this.thumbnails[0].frames.slice(n):o=this.thumbnails[0].frames.slice(0,n).reverse();let a=!1;o.forEach(l=>{const c=l.text;if(c!==r&&!this.loadedImages.includes(c)){a=!0,this.player.debug.log(`Preloading thumb filename: ${c}`);const{urlPrefix:u}=this.thumbnails[0],d=u+c,f=new Image;f.src=d,f.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${c}`),this.loadedImages.includes(c)||this.loadedImages.push(c),i()}}}),a||i()}},300)})),Z(this,"getHigherQuality",(n,s,i,r)=>{if(n{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(n+1))},300)}}),Z(this,"toggleThumbContainer",(n=!1,s=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,n),!n&&s&&(this.showingThumb=null,this.showingThumbFilename=null)}),Z(this,"toggleScrubbingContainer",(n=!1)=>{const s=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(s,n),n||(this.showingThumb=null,this.showingThumbFilename=null)}),Z(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),Z(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:n}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(n.clientHeight>20&&n.clientWidth<20){const s=Math.floor(n.clientHeight*this.thumbAspectRatio);n.style.width=`${s}px`}else if(n.clientHeight<20&&n.clientWidth>20){const s=Math.floor(n.clientWidth/this.thumbAspectRatio);n.style.height=`${s}px`}}else{const s=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);n.style.height=`${this.thumbContainerHeight}px`,n.style.width=`${s}px`}this.setThumbContainerPos()}),Z(this,"setThumbContainerPos",()=>{const n=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,r=s.left-n.left+10,o=s.right-n.left-i.clientWidth-10,a=this.mousePosX-n.left-i.clientWidth/2,l=Wh(a,r,o);i.style.left=`${l}px`,i.style.setProperty("--preview-arrow-offset",`${a-l}px`)}),Z(this,"setScrubbingContainerSize",()=>{const{width:n,height:s}=uf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${n}px`,this.elements.scrubbing.container.style.height=`${s}px`}),Z(this,"setImageSizeAndOffset",(n,s)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/s.h;n.style.height=`${n.naturalHeight*i}px`,n.style.width=`${n.naturalWidth*i}px`,n.style.left=`-${s.x*i}px`,n.style.top=`-${s.y*i}px`}),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:t}=uf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return t}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(t){this.mouseDown?this.currentScrubbingImageElement=t:this.currentThumbnailImageElement=t}}const _l={insertElements(e,t){p.string(t)?rf(e,this.media,{src:t}):p.array(t)&&t.forEach(n=>{rf(e,this.media,n)})},change(e){if(!Lh(e,"sources.length")){this.debug.warn("Invalid source format");return}ls.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],Dn(this.media),this.media=null,p.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:n}=e,[{provider:s=os.html5,src:i}]=t,r=s==="html5"?n:"div",o=s==="html5"?{}:{src:i};Object.assign(this,{provider:s,type:n,supported:nt.check(n,s,this.config.playsinline),media:ce(r,o)}),this.elements.container.appendChild(this.media),p.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),p.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Me.addStyleHook.call(this),this.isHTML5&&_l.insertElements.call(this,"source",t),this.config.title=e.title,Vh.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&_l.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Me.build.call(this),this.isHTML5&&this.media.load(),p.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new wl(this))),this.fullscreen.update()},!0)}};class pr{constructor(t,n){if(Z(this,"play",()=>p.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>_n(this.media.play())),this.media.play()):null),Z(this,"pause",()=>!this.playing||!p.function(this.media.pause)?null:this.media.pause()),Z(this,"togglePlay",a=>(p.boolean(a)?a:!this.playing)?this.play():this.pause()),Z(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):p.function(this.media.stop)&&this.media.stop()}),Z(this,"restart",()=>{this.currentTime=0}),Z(this,"rewind",a=>{this.currentTime-=p.number(a)?a:this.config.seekTime}),Z(this,"forward",a=>{this.currentTime+=p.number(a)?a:this.config.seekTime}),Z(this,"increaseVolume",a=>{const l=this.media.muted?0:this.volume;this.volume=l+(p.number(a)?a:0)}),Z(this,"decreaseVolume",a=>{this.increaseVolume(-a)}),Z(this,"airplay",()=>{nt.airplay&&this.media.webkitShowPlaybackTargetPicker()}),Z(this,"toggleControls",a=>{if(this.supported.ui&&!this.isAudio){const l=ko(this.elements.container,this.config.classNames.hideControls),c=typeof a>"u"?void 0:!a,u=Le(this.elements.container,this.config.classNames.hideControls,c);if(u&&p.array(this.config.controls)&&this.config.controls.includes("settings")&&!p.empty(this.config.settings)&&Y.toggleMenu.call(this,!1),u!==l){const d=u?"controlshidden":"controlsshown";ue.call(this,this.media,d)}return!u}return!1}),Z(this,"on",(a,l)=>{Ae.call(this,this.elements.container,a,l)}),Z(this,"once",(a,l)=>{Ql.call(this,this.elements.container,a,l)}),Z(this,"off",(a,l)=>{qo(this.elements.container,a,l)}),Z(this,"destroy",(a,l=!1)=>{if(!this.ready)return;const c=()=>{document.body.style.overflow="",this.embed=null,l?(Object.keys(this.elements).length&&(Dn(this.elements.buttons.play),Dn(this.elements.captions),Dn(this.elements.controls),Dn(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),p.function(a)&&a()):(Mw.call(this),ls.cancelRequests.call(this),_o(this.elements.original,this.elements.container),ue.call(this,this.elements.original,"destroyed",!0),p.function(a)&&a.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Me.toggleNativeControls.call(this,!0),c()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&p.function(this.embed.destroy)&&this.embed.destroy(),c()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(c),setTimeout(c,200))}),Z(this,"supports",a=>nt.mime.call(this,a)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=nt.touch,this.media=t,p.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||p.nodeList(this.media)||p.array(this.media))&&(this.media=this.media[0]),this.config=et({},zh,pr.defaults,n||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Zw(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",nt),p.nullOrUndefined(this.media)||!p.element(this.media)){this.debug.error("Setup failed: no suitable element passed");return}if(this.media.plyr){this.debug.warn("Target already setup");return}if(!this.config.enabled){this.debug.error("Setup failed: disabled by config");return}if(!nt.check().api){this.debug.error("Setup failed: no support");return}const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const i=this.media.tagName.toLowerCase();let r=null,o=null;switch(i){case"div":if(r=this.media.querySelector("iframe"),p.element(r)){if(o=jh(r.getAttribute("src")),this.provider=Xw(o.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",o.search.length){const a=["1","true"];a.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),a.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=a.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(p.empty(this.provider)||!Object.values(os).includes(this.provider)){this.debug.error("Setup failed: Invalid provider");return}this.type=Ba.video;break;case"video":case"audio":this.type=i,this.provider=os.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:this.debug.error("Setup failed: unsupported type");return}if(this.supported=nt.check(this.type,this.provider),!this.supported.api){this.debug.error("Setup failed: no support");return}this.eventListeners=[],this.listeners=new Jw(this),this.storage=new hr(this),this.media.plyr=this,p.element(this.elements.container)||(this.elements.container=ce("div"),Nh(this.media,this.elements.container)),Me.migrateStyles.call(this),Me.addStyleHook.call(this),Vh.setup.call(this),this.config.debug&&Ae.call(this,this.elements.container,this.config.events.join(" "),a=>{this.debug.log(`event: ${a.type}`)}),this.fullscreen=new sn(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Me.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new c0(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>_n(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new wl(this))}get isHTML5(){return this.provider===os.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===os.youtube}get isVimeo(){return this.provider===os.vimeo}get isVideo(){return this.type===Ba.video}get isAudio(){return this.type===Ba.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(t){if(!this.duration)return;const n=p.number(t)&&t>0;this.media.currentTime=n?Math.min(t,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:t}=this.media;return p.number(t)?t:t&&t.length&&this.duration>0?t.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const t=Number.parseFloat(this.config.duration),n=(this.media||{}).duration,s=!p.number(n)||n===1/0?0:n;return t||s}set volume(t){let n=t;const s=1,i=0;p.string(n)&&(n=Number(n)),p.number(n)||(n=this.storage.get("volume")),p.number(n)||({volume:n}=this.config),n>s&&(n=s),n0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(t){let n=t;p.boolean(n)||(n=this.storage.get("muted")),p.boolean(n)||(n=this.config.muted),this.config.muted=n,this.media.muted=n}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||this.isAudio?!0:!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(t){let n=null;p.number(t)&&(n=t),p.number(n)||(n=this.storage.get("speed")),p.number(n)||(n=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:i}=this;n=Wh(n,s,i),this.config.speed.selected=n,setTimeout(()=>{this.media&&(this.media.playbackRate=n)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(t){const n=this.config.quality,s=this.options.quality;if(!s.length)return;let i=[!p.empty(t)&&Number(t),this.storage.get("quality"),n.selected,n.default].find(p.number),r=!0;if(!s.includes(i)){const o=Mh(s,i);this.debug.warn(`Unsupported quality option: ${i}, using ${o} instead`),i=o,r=!1}n.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}get quality(){return this.media.quality}set loop(t){const n=p.boolean(t)?t:this.config.loop.active;this.config.loop.active=n,this.media.loop=n}get loop(){return!!this.media.loop}set source(t){_l.change.call(this,t)}get source(){return this.media.currentSrc}get download(){const{download:t}=this.config.urls;return p.url(t)?t:this.source}set download(t){p.url(t)&&(this.config.urls.download=t,Y.setDownloadUrl.call(this))}set poster(t){if(!this.isVideo){this.debug.warn("Poster can only be set for video");return}Me.setPoster.call(this,t,!1).catch(()=>{})}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const t=xo(ec.call(this));return p.array(t)?t.join(":"):t}set ratio(t){if(!this.isVideo){this.debug.warn("Aspect ratio can only be set for video");return}if(!p.string(t)||!$h(t)){this.debug.error(`Invalid aspect ratio specified (${t})`);return}this.config.ratio=xo(t),si.call(this)}set autoplay(t){this.config.autoplay=p.boolean(t)?t:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(t){Se.toggle.call(this,t,!1)}set currentTrack(t){Se.set.call(this,t,!1),Se.setup.call(this)}get currentTrack(){const{toggled:t,currentTrack:n}=this.captions;return t?n:-1}set language(t){Se.setLanguage.call(this,t,!1)}get language(){return(Se.getCurrentTrack.call(this)||{}).language}set pip(t){if(!nt.pip)return;const n=p.boolean(t)?t:!this.pip;p.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(n?Ua.active:Ua.inactive),p.function(this.media.requestPictureInPicture)&&(!this.pip&&n?this.media.requestPictureInPicture():this.pip&&!n&&document.exitPictureInPicture())}get pip(){return nt.pip?p.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ua.active:null}setPreviewThumbnails(t){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,t),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new wl(this))}static supported(t,n){return nt.check(t,n)}static loadSprite(t,n){return Uh(t,n)}static setup(t,n={}){let s=null;return p.string(t)?s=Array.from(document.querySelectorAll(t)):p.nodeList(t)?s=Array.from(t):p.array(t)&&(s=t.filter(p.element)),p.empty(s)?null:s.map(i=>new pr(i,n))}}pr.defaults=Iw(zh);const $t=F(null),Jn=F(null),ks=F(!1),xs=F(!1),Rn=F(null),zs=F(0),Qn=F(0),ct=Wf([]),ut=F(-1);let We=null,es=null,pn=null;const f0=120*1e3,Wr=new Map,Ha=new Map;let ff=null;function d0(){const e=Oe(()=>!!$t.value),t=Oe(()=>Qn.value<=0?0:zs.value/Qn.value*100);async function n(w,C,N,q){const U=[];C&&U.push(C),C&&N&&U.push(`${C} ${N}`),N&&U.push(N),!C&&!N&&U.push(w);for(const M of U)try{const O=await fetch(`https://wavlake.com/api/v1/content/search?term=${encodeURIComponent(M)}`,{signal:q,headers:{Accept:"application/json"}});if(!O.ok)continue;const j=await O.json();if(!Array.isArray(j))continue;const z=j.filter(_e=>_e.type==="track"&&!!_e.mediaUrl);if(z.length===0)continue;const re=z[0];return{source:"wavlake",type:"stream",url:re.mediaUrl,title:re.title??re.name,artist:re.artist,coverUrl:re.albumArtUrl??re.artistArtUrl,duration:re.duration,trackId:re.id,albumTitle:re.albumTitle,wavlakeUrl:`https://wavlake.com/track/${re.id}`}}catch(O){if(O.name==="AbortError")return null}return null}async function s(w,C,N){const q=`${C??w}|${N??""}`,U=Wr.get(q);if(U!==void 0){if(U!==null)return U;const j=Ha.get(q);if(j&&Date.now()-j{});return}o(),pn=document.createElement("audio"),pn.src=w.url,pn.preload="auto",es.textContent="",es.appendChild(pn),We=new pr(pn,{controls:[],autoplay:!0,muted:!1}),We.on("ready",()=>{Promise.resolve(We.play()).catch(()=>{})}),We.on("timeupdate",()=>{zs.value=We.currentTime??0}),We.on("loadedmetadata",()=>{Qn.value=We.duration??0}),We.on("ended",()=>{ks.value=!1,ut.value>=0&&ut.value{ks.value=!0,xs.value=!1}),We.on("pause",()=>{ks.value=!1}),We.on("error",C=>{const N=pn?.error;console.error("[player] Audio error:",N?.code,N?.message),xs.value=!1,Rn.value="Audio failed to load"})}}function o(){We&&(We.destroy(),We=null),pn=null,es&&(es.textContent="")}async function a(w){if(Rn.value=null,$t.value?.id===w.id&&Jn.value){We&&(Promise.resolve(We.play()).catch(()=>{}),ks.value=!0);return}$t.value=w,xs.value=!0,zs.value=0,Qn.value=0;const C=w.sources?.find(U=>!!U.url&&(U.url.startsWith("/")||U.url.startsWith(window.location.origin)));if(C){xs.value=!1,Rn.value=null,Jn.value={source:"node",type:"stream",url:C.url,title:w.title,artist:w.artist,coverUrl:w.coverUrl,duration:w.duration},es&&r(Jn.value);return}const N=`${w.title} ${w.artist}`.trim(),q=await s(N,w.title,w.artist);if($t.value?.id===w.id){if(xs.value=!1,!q){Rn.value||(Rn.value="Not found on Wavlake");return}q.coverUrl&&$t.value&&!$t.value.coverUrl&&($t.value={...$t.value,coverUrl:q.coverUrl}),q.duration&&$t.value&&!$t.value.duration&&($t.value={...$t.value,duration:q.duration}),Rn.value=null,Jn.value=q,es&&r(q)}}function l(){We?.pause(),ks.value=!1}function c(){xs.value||We&&(ks.value?l():Promise.resolve(We.play()).catch(()=>{}))}function u(w){if(!We||!Qn.value)return;const C=w/100*Qn.value;We.currentTime=C,zs.value=C}function d(w){ct.value.find(N=>N.id===w.id)||(ct.value=[...ct.value,w])}function f(){if(ct.value.length===0)return;const w=ut.value+1;w=0&&(ut.value=w,a(ct.value[w]))}function b(w){const C=[...ct.value];C.splice(w,1),ct.value=C,wN.id===w.id);C===-1?(d(w),ut.value=ct.value.length-1):ut.value=C,await a(w)}Yt(ut,w=>{const C=w+1;if(Cut.valueut.value>0);return{currentSong:$t,playableSource:Jn,isPlaying:ks,isLoading:xs,error:Rn,currentTime:zs,duration:Qn,hasTrack:e,progress:t,queue:ct,currentIndex:ut,hasNext:y,hasPrevious:k,play:g,pause:l,toggle:c,seek:u,clear:E,clearQueue:x,addToQueue:d,playNext:f,playPrevious:h,removeFromQueue:b,setContainer:i}}const mr=new Map,qh="aiui-poster-cache",h0=new Set,qs=new Map,Kh="aiui-music-cover-cache",To=new Map,Gh="aiui-podcast-cover-cache";function p0(e,t){return`${e.toLowerCase().trim()}|${t.toLowerCase().trim()}`}function m0(e,t){return`${e.toLowerCase().trim()}|${(t??"").toLowerCase().trim()}`}function g0(){try{const e=sessionStorage.getItem(Kh);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>qs.set(n,s))}}catch{}}function za(){try{const e=[...qs.entries()].slice(-300);sessionStorage.setItem(Kh,JSON.stringify(Object.fromEntries(e)))}catch{}}g0();function Yh(e,t){return`${e.toLowerCase().trim()}|${t??""}`}function y0(){try{const e=sessionStorage.getItem(qh);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>mr.set(n,s))}}catch{}}function b0(){try{const e=[...mr.entries()].slice(-200);sessionStorage.setItem(qh,JSON.stringify(Object.fromEntries(e)))}catch{}}y0();function v0(){try{const e=sessionStorage.getItem(Gh);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>To.set(n,s))}}catch{}}function w0(){try{const e=[...To.entries()].slice(-200);sessionStorage.setItem(Gh,JSON.stringify(Object.fromEntries(e)))}catch{}}v0();function li(e,t,n,s,i){const o=` ${e} ${ii(t.length>18?t.slice(0,16)+"…":t)} ${n?`${ii(n.length>22?n.slice(0,20)+"…":n)}`:""} `;return`data:image/svg+xml,${encodeURIComponent(o)}`}function tk(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("PODCAST",e,t,n,30)}function nk(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("MUSIC",e,t,n,30)}function sk(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("NEWS",e,t,n,22)}function ik(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("WEBSITE",e,t,n,25)}function _0(e,t){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=` FILM ${ii(e.length>20?e.slice(0,18)+"…":e)} ${t?`${t}`:""} `;return`data:image/svg+xml,${encodeURIComponent(s)}`}function rk(e,t){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=` SERIES ${ii(e.length>20?e.slice(0,18)+"…":e)} ${t?`${t}`:""} `;return`data:image/svg+xml,${encodeURIComponent(s)}`}function ii(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}async function Xh(e,t,n){const s=`${e}:${Yh(t,n)}`,i=mr.get(s);if(i)return i;const r={posterUrl:null,backdropUrl:null};try{const o=new URLSearchParams({q:t.trim()});n&&n>0&&o.set("y",String(n));const a=await zo(`/api/tmdb/${e}?${o}`);if(!a.ok)return r;const l=await a.json(),c={posterUrl:l.posterUrl??null,backdropUrl:l.backdropUrl??null};return(c.posterUrl||c.backdropUrl)&&(mr.set(s,c),b0()),c}catch{return r}}async function Zh(e,t){return Xh("search",e,t)}async function ok(e,t,n){const s=e.target;if(s.dataset.fallback==="done")return;const i=s.src;h0.add(i);const r=Yh(t,n),o=mr.get(r);if(o?.posterUrl&&o.posterUrl!==i){s.dataset.fallback="tmdb",s.src=o.posterUrl;return}if(s.dataset.fallback!=="tmdb"){const{posterUrl:a}=await Zh(t,n);if(a&&a!==i){s.dataset.fallback="tmdb",s.src=a;return}}if(s.dataset.fallback!=="wiki"){const a=await ri(t,"film");if(a){s.dataset.fallback="wiki",s.src=a;return}}s.dataset.fallback="done",s.src=_0(t,n)}async function k0(e,t){return Xh("search-tv",e,t)}async function ak(e,t){const n=m0(e,t),s=To.get(n);if(s)return s;try{const i=t?`${e} ${t}`:e,r=await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(i.trim())}&media=podcast&limit=3`);if(!r.ok)return null;const l=(await r.json()).results?.[0]?.artworkUrl100;if(!l)return null;const c=l.replace(/100x100/g,"600x600");return To.set(n,c),w0(),c}catch{return null}}const Ao=new Map,Jh="aiui-book-cover-cache";function Qh(e,t){return`${e.toLowerCase().trim()}|${t.toLowerCase().trim()}`}function x0(){try{const e=sessionStorage.getItem(Jh);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>Ao.set(n,s))}}catch{}}function T0(){try{const e=[...Ao.entries()].slice(-200);sessionStorage.setItem(Jh,JSON.stringify(Object.fromEntries(e)))}catch{}}x0();function lk(e,t){const n=[...e+(t??"")].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=` BOOK ${ii(e.length>20?e.slice(0,18)+"…":e)} ${t?`${ii(t.length>24?t.slice(0,22)+"…":t)}`:""} `;return`data:image/svg+xml,${encodeURIComponent(s)}`}async function A0(e,t){const n=Qh(e,t),s=Ao.get(n);if(s)return s;try{const i=`${e} ${t}`.trim(),r=await fetch(`https://openlibrary.org/search.json?q=${encodeURIComponent(i)}&limit=1&fields=cover_i`);if(!r.ok)return null;const a=(await r.json()).docs?.[0]?.cover_i;if(!a)return null;const l=`https://covers.openlibrary.org/b/id/${a}-L.jpg`;return Ao.set(n,l),T0(),l}catch{return null}}function ck(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("PLACE",e,t,n,20)}function uk(e,t){const n=[...e].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return li("RECIPE",e,t,n,30)}async function fk(e,t){if(t){const s=await ri(e,t);if(s)return s}const n=await ri(e,"restaurant");return n||null}async function E0(e,t,n){const s=p0(t,e),i=qs.get(s);if(i)return i;try{const r="/aiui/",o=new URLSearchParams({q:e,title:e,artist:t}),a=await zo(`${r}api/music/search?${o}`);if(a.ok){const l=await a.json();if(l.coverUrl)return qs.set(s,l.coverUrl),za(),l.coverUrl}}catch{}try{const r=`${e} ${t}`.trim(),o=await fetch(`https://wavlake.com/api/v1/content/search?term=${encodeURIComponent(r)}`,{headers:{Accept:"application/json"}});if(o.ok){const a=await o.json();if(Array.isArray(a)){const l=a.find(u=>u.type==="track"),c=l?.albumArtUrl??l?.artistArtUrl;if(c)return qs.set(s,c),za(),c}}}catch{}try{const r=`${t} ${e}`.trim().replace(/\s+/g,"+"),o=await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(r)}&media=music&limit=3`);if(!o.ok)return null;const c=(await o.json()).results?.[0]?.artworkUrl100;if(!c)return null;const u=c.replace(/100x100/g,"600x600");return qs.set(s,u),za(),u}catch{return null}}const Zs=new Map;async function ri(e,t){const n=`${e.toLowerCase().trim()}|${(t??"").toLowerCase()}`;if(Zs.has(n))return Zs.get(n)??null;const s=async r=>{try{const o=encodeURIComponent(r.trim().replace(/\s+/g,"_")),a=await fetch(`https://en.wikipedia.org/api/rest_v1/page/summary/${o}`);if(!a.ok)return null;const l=await a.json();return l.originalimage?.source??l.thumbnail?.source??null}catch{return null}};let i=null;return t&&(i=await s(`${e} (${t})`)),i||(i=await s(e)),Zs.set(n,i),i}async function S0(e,t){const s=`gbooks:${Qh(e,t??"")}`;if(Zs.has(s))return Zs.get(s)??null;try{const i=t?`intitle:${e}+inauthor:${t}`:`intitle:${e}`,r=await fetch(`https://www.googleapis.com/books/v1/volumes?q=${encodeURIComponent(i)}&maxResults=1`);if(!r.ok)return null;const a=(await r.json()).items?.[0]?.volumeInfo?.imageLinks;let l=a?.thumbnail??a?.smallThumbnail??null;return l&&(l=l.replace(/^http:/,"https:").replace(/&edge=curl/g,""),l.includes("zoom=")||(l+="&zoom=2")),Zs.set(s,l),l}catch{return null}}async function dk(e,t){const n=await Zh(e,t);if(n.posterUrl||n.backdropUrl)return n;const s=await ri(e,"film");return s?{posterUrl:s,backdropUrl:null}:{posterUrl:null,backdropUrl:null}}async function hk(e,t){const n=await k0(e,t);if(n.posterUrl||n.backdropUrl)return n;const s=await ri(e,"TV series");return s?{posterUrl:s,backdropUrl:null}:{posterUrl:null,backdropUrl:null}}async function pk(e,t){const n=await A0(e,t??"");if(n)return n;const s=await S0(e,t);return s||await ri(e,"novel")}const C0={key:0,class:"flex flex-col"},P0={class:"flex items-center gap-3 px-3 py-2"},I0={class:"w-10 h-10 rounded-lg overflow-hidden shrink-0 flex items-center justify-center path-glass-icon"},R0=["src","alt"],L0={key:1,class:"text-base"},N0={class:"min-w-0 flex-1"},M0={class:"text-sm font-semibold truncate text-white/90"},O0={class:"text-xs truncate text-white/50"},$0=["disabled"],D0={key:0,class:"w-6 h-6 animate-spin text-white/90",fill:"none",viewBox:"0 0 24 24"},F0={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},U0={key:2,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},B0=["disabled"],j0={key:0,class:"text-xs text-red-400/60 px-3 pb-1 truncate"},H0={key:1,class:"flex items-center gap-4 px-4 py-3"},z0={class:"flex items-center gap-3 min-w-0 flex-1 max-w-[280px]"},V0={class:"w-12 h-12 rounded-lg overflow-hidden shrink-0 flex items-center justify-center path-glass-icon"},W0=["src","alt"],q0={key:1,class:"text-lg"},K0={class:"min-w-0"},G0={class:"text-sm font-semibold truncate text-white/90"},Y0={class:"text-xs truncate text-white/50"},X0={class:"flex flex-col gap-1 flex-1 max-w-xl mx-4"},Z0={class:"flex items-center gap-2"},J0=["disabled"],Q0={key:0,class:"w-6 h-6 animate-spin text-white/90",fill:"none",viewBox:"0 0 24 24"},e_={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},t_={key:2,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},n_=["disabled"],s_={class:"text-xs font-mono tabular-nums text-white/40"},i_={class:"text-xs font-mono tabular-nums text-white/40"},r_={key:0,class:"text-xs text-red-400/60 truncate"},o_={key:0,class:"text-xs font-mono tabular-nums shrink-0 text-white/30"},a_=ms({__name:"PlayerBar",props:{variant:{default:"fixed"},compact:{type:Boolean,default:!1}},setup(e){const t=e,{currentSong:n,hasTrack:s,isPlaying:i,isLoading:r,error:o,currentTime:a,duration:l,progress:c,queue:u,hasNext:d,hasPrevious:f,toggle:h,seek:b,clear:g,playNext:E,playPrevious:x,setContainer:y}=d0(),k=F(null),w=F(null),C=Oe(()=>{const M=n.value;return M?M.coverUrl||w.value:null});function N(M){return M.replace(/^(?:song|film|podcast|book|tv)_ext:/i,"").replace(/\|.*$/,"")}function q(M){const O=Math.floor(M/60),j=Math.floor(M%60);return`${O}:${j.toString().padStart(2,"0")}`}function U(M){const j=M.currentTarget.getBoundingClientRect(),z=Math.max(0,Math.min(100,(M.clientX-j.left)/j.width*100));b(z)}return Ls(async()=>{await Rs(),y(k.value)}),Yt(()=>k.value,M=>y(M),{flush:"post"}),Yt(n,M=>{w.value=null,M&&!M.coverUrl&&E0(M.title,M.artist).then(O=>{O&&(w.value=O)})},{immediate:!0}),(M,O)=>(be(),fs(yo,{name:"player-slide"},{default:nr(()=>[G(s)?(be(),xe("div",{key:0,class:st([t.variant==="fixed"?"fixed bottom-0 left-0 right-0 z-[999]":"w-full shrink-0","path-glass-card !rounded-none"])},[L("div",{ref_key:"plyrContainerRef",ref:k,class:"absolute left-[-9999px] w-[320px] h-[180px] overflow-hidden","aria-hidden":"true"},null,512),t.compact?(be(),xe("div",C0,[L("div",{class:"w-full h-1 cursor-pointer bg-white/10",onClick:U},[L("div",{class:"h-full bg-accent transition-all duration-150",style:us({width:`${G(c)}%`})},null,4)]),L("div",P0,[L("div",I0,[C.value?(be(),xe("img",{key:0,src:C.value,alt:G(n).title,class:"w-full h-full object-cover"},null,8,R0)):(be(),xe("span",L0,"🎵"))]),L("div",N0,[L("p",M0,dt(N(G(n).title)),1),L("p",O0,dt(G(n).artist),1)]),L("button",{class:st(["w-11 h-11 rounded-full flex items-center justify-center shrink-0 active:scale-95",G(f)?"text-white/70":"text-white/20"]),disabled:!G(f),"aria-label":"Previous track",onClick:O[0]||(O[0]=(...j)=>G(x)&&G(x)(...j))},[...O[8]||(O[8]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M6 6h2v12H6V6zm3.5 6l8.5 6V6l-8.5 6z"})],-1)])],10,$0),L("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 active:scale-95","aria-label":"Play or pause",onClick:O[1]||(O[1]=(...j)=>G(h)&&G(h)(...j))},[G(r)?(be(),xe("svg",D0,[...O[9]||(O[9]=[L("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),L("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):G(i)?(be(),xe("svg",F0,[...O[10]||(O[10]=[L("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(be(),xe("svg",U0,[...O[11]||(O[11]=[L("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),L("button",{class:st(["w-11 h-11 rounded-full flex items-center justify-center shrink-0 active:scale-95",G(d)?"text-white/70":"text-white/20"]),disabled:!G(d),"aria-label":"Next track",onClick:O[2]||(O[2]=(...j)=>G(E)&&G(E)(...j))},[...O[12]||(O[12]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M6 18l8.5-6L6 6v12zm10-12v12h2V6h-2z"})],-1)])],10,B0),L("button",{class:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0 active:scale-95 text-white/40","aria-label":"Close player",onClick:O[3]||(O[3]=(...j)=>G(g)&&G(g)(...j))},[...O[13]||(O[13]=[L("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),G(o)?(be(),xe("p",j0,dt(G(o)),1)):xt("",!0)])):(be(),xe("div",H0,[L("div",z0,[L("div",V0,[C.value?(be(),xe("img",{key:0,src:C.value,alt:G(n).title,class:"w-full h-full object-cover"},null,8,W0)):(be(),xe("span",q0,"🎵"))]),L("div",K0,[L("p",G0,dt(N(G(n).title)),1),L("p",Y0,dt(G(n).artist),1)])]),L("div",X0,[L("div",Z0,[L("button",{class:st(["min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center shrink-0 transition-all hover:scale-105 active:scale-95",G(f)?"text-white/70 hover:text-white/90":"text-white/20"]),disabled:!G(f),"aria-label":"Previous track",onClick:O[4]||(O[4]=(...j)=>G(x)&&G(x)(...j))},[...O[14]||(O[14]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M6 6h2v12H6V6zm3.5 6l8.5 6V6l-8.5 6z"})],-1)])],10,J0),L("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 transition-all hover:scale-105 active:scale-95","aria-label":"Play or pause",onClick:O[5]||(O[5]=(...j)=>G(h)&&G(h)(...j))},[G(r)?(be(),xe("svg",Q0,[...O[15]||(O[15]=[L("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),L("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):G(i)?(be(),xe("svg",e_,[...O[16]||(O[16]=[L("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(be(),xe("svg",t_,[...O[17]||(O[17]=[L("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),L("button",{class:st(["min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center shrink-0 transition-all hover:scale-105 active:scale-95",G(d)?"text-white/70 hover:text-white/90":"text-white/20"]),disabled:!G(d),"aria-label":"Next track",onClick:O[6]||(O[6]=(...j)=>G(E)&&G(E)(...j))},[...O[18]||(O[18]=[L("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[L("path",{d:"M6 18l8.5-6L6 6v12zm10-12v12h2V6h-2z"})],-1)])],10,n_),L("span",s_,dt(q(G(a))),1),L("div",{class:"flex-1 h-1.5 rounded-full cursor-pointer group bg-white/15",onClick:U},[L("div",{class:"h-full rounded-full transition-all duration-150 group-hover:h-2 bg-accent",style:us({width:`${G(c)}%`})},null,4)]),L("span",i_,dt(q(G(l))),1)]),G(o)?(be(),xe("p",r_,dt(G(o)),1)):xt("",!0)]),G(u).length>1?(be(),xe("span",o_,dt(G(u).length)+" songs",1)):xt("",!0),L("button",{class:"touch-target rounded-xl path-glass-button path-glass-button-sm shrink-0 transition-all hover:scale-105","aria-label":"Close player",onClick:O[7]||(O[7]=(...j)=>G(g)&&G(g)(...j)),title:"Close player"},[...O[19]||(O[19]=[L("svg",{class:"w-4 h-4 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]))],2)):xt("",!0)]),_:1}))}}),l_=Xl(a_,[["__scopeId","data-v-94cfd389"]]),c_={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},u_={class:"glass-card relative w-full max-w-sm p-6 space-y-5 animate-scale-in"},f_={class:"flex items-center gap-3"},d_={class:"text-base font-semibold text-white/96 leading-tight"},h_={class:"text-xs text-white/40 mt-0.5"},p_={class:"space-y-2.5"},m_=["placeholder"],g_={key:1,class:"text-xs text-red-400 px-1"},y_={class:"flex gap-2"},b_=["disabled"],v_=ms({__name:"PassphraseDialog",props:{visible:{type:Boolean},isCreating:{type:Boolean},error:{}},emits:["submit","skip"],setup(e,{emit:t}){const n=e,s=t,i=F(""),r=F(""),o=F(""),a=F(null),l=Oe(()=>!(!i.value.trim()||n.isCreating&&i.value!==r.value));function c(){if(!l.value){n.isCreating&&i.value!==r.value&&(o.value="Passphrases do not match");return}o.value="",s("submit",i.value)}function u(){s("skip")}return Yt(()=>n.visible,d=>{d&&Rs(()=>a.value?.focus())},{immediate:!0}),(d,f)=>(be(),fs(Ol,{to:"body"},[e.visible?(be(),xe("div",c_,[L("div",{class:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:Mn(u,["self"])}),L("div",u_,[L("div",f_,[f[2]||(f[2]=L("div",{class:"flex items-center justify-center w-10 h-10 rounded-xl bg-accent/15 border border-accent/30 shrink-0"},[L("svg",{class:"w-5 h-5 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[L("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})])],-1)),L("div",null,[L("h2",d_,dt(e.isCreating?"Create Passphrase":"Unlock AIUI"),1),L("p",h_,dt(e.isCreating?"Encrypts all your data locally":"Enter your passphrase to decrypt"),1)])]),L("div",p_,[hc(L("input",{ref_key:"inputRef",ref:a,"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),type:"password",placeholder:e.isCreating?"Create a passphrase…":"Enter passphrase…",class:"w-full px-4 py-3 rounded-xl bg-white/5 border border-white/10 text-white/90 placeholder:text-white/25 outline-none focus:border-white/30 focus:bg-white/8 transition-colors",style:{"font-size":"16px"},autocomplete:"current-password",onKeydown:Qc(c,["enter"])},null,40,m_),[[Xc,i.value]]),e.isCreating?hc((be(),xe("input",{key:0,"onUpdate:modelValue":f[1]||(f[1]=h=>r.value=h),type:"password",placeholder:"Confirm passphrase…",class:"w-full px-4 py-3 rounded-xl bg-white/5 border border-white/10 text-white/90 placeholder:text-white/25 outline-none focus:border-white/30 focus:bg-white/8 transition-colors",style:{"font-size":"16px"},autocomplete:"new-password",onKeydown:Qc(c,["enter"])},null,544)),[[Xc,r.value]]):xt("",!0),o.value||n.error?(be(),xe("p",g_,dt(o.value||n.error),1)):xt("",!0)]),L("div",y_,[L("button",{class:"glass-button glass-button-sm flex-1 rounded-xl text-sm text-white/50 hover:text-white/80 transition-colors",onClick:u}," Skip "),L("button",{class:st(["glass-button flex-1 h-11 rounded-xl text-sm font-medium text-white transition-opacity",{"opacity-40 cursor-not-allowed":!l.value}]),disabled:!l.value,onClick:c},dt(e.isCreating?"Create":"Unlock"),11,b_)]),f[3]||(f[3]=L("p",{class:"text-xs text-white/25 text-center"}," Data never leaves your device · AES-256-GCM ",-1))])])):xt("",!0)]))}}),w_=1e5,__=16,kl=12;async function k_(){return crypto.getRandomValues(new Uint8Array(__))}async function x_(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:w_,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function T_(e,t){const n=new TextEncoder,s=crypto.getRandomValues(new Uint8Array(kl));return{ciphertext:await crypto.subtle.encrypt({name:"AES-GCM",iv:s},t,n.encode(e)),iv:s}}async function A_(e,t,n){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},n,e);return new TextDecoder().decode(s)}async function E_(e,t){const{ciphertext:n,iv:s}=await T_(e,t),i=new Uint8Array(s.length+n.byteLength);return i.set(s),i.set(new Uint8Array(n),s.length),C_(i)}async function S_(e,t){const n=P_(e),s=n.slice(0,kl),i=n.slice(kl);return A_(i.buffer,s,t)}function C_(e){let t="";for(let n=0;n"u")}catch{return!1}}let nc=null;function I_(e,t){nc=e}function tp(){return nc}function df(){return nc!==null}const R_="aiui-vault",L_=1,hs="api-keys";function sc(){return new Promise((e,t)=>{const n=indexedDB.open(R_,L_);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(hs)||s.createObjectStore(hs,{keyPath:"provider"})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function hf(e,t){if(typeof indexedDB>"u")return;const n=await sc(),s=tp();if(!ep()||!s)throw new Error("Encryption required: cannot store API keys without an active session key. Please set a passphrase first.");const i=await E_(t,s),r={provider:e,value:i,encrypted:!0};return new Promise((o,a)=>{const l=n.transaction(hs,"readwrite");l.objectStore(hs).put(r),l.oncomplete=()=>o(),l.onerror=()=>a(l.error)})}async function N_(e){if(typeof indexedDB>"u")return null;const t=await sc();return new Promise((n,s)=>{const r=t.transaction(hs,"readonly").objectStore(hs).get(e);r.onsuccess=async()=>{const o=r.result;if(!o){n(null);return}if(o.encrypted){const a=tp();if(!a){n(null);return}try{const l=await S_(o.value,a);n(l)}catch{n(null)}}else n(o.value)},r.onerror=()=>s(r.error)})}async function M_(e){if(typeof indexedDB>"u")return;const t=await sc();return new Promise((n,s)=>{const i=t.transaction(hs,"readwrite");i.objectStore(hs).delete(e),i.oncomplete=()=>n(),i.onerror=()=>s(i.error)})}const Va="aiui-settings",qr={accentColor:"#F7931A",glassIntensity:"default",fontSize:"default",hiddenContentTabs:[],shortcuts:{"send-message":"Enter","new-line":"Shift+Enter",search:"Cmd+F","new-chat":"Cmd+N",settings:"Cmd+,","close-panel":"Escape"},notificationsEnabled:!1,autoArchiveDays:0,defaultModel:"",defaultPersonaId:"",defaultWebSearch:!1,defaultShowTokens:!1,useOwnApiKey:!1};let pf="";const O_=zl("settings",()=>{const e=F(r()),t=F(pf);async function n(y){if(t.value=y,!y)return await M_("claude").catch(()=>{}),"session";if(df())try{return await hf("claude",y),"encrypted"}catch{}return"session"}async function s(){if(t.value){await i();return}const y=await N_("claude").catch(()=>null);y&&(t.value=y)}async function i(){if(t.value&&df())try{await hf("claude",t.value)}catch{}}function r(){try{const y=localStorage.getItem(Va);if(y){const k=JSON.parse(y);return typeof k.claudeApiKey=="string"&&k.claudeApiKey&&(pf=k.claudeApiKey,delete k.claudeApiKey,localStorage.setItem(Va,JSON.stringify({...qr,...k}))),{...qr,...k}}}catch{}return{...qr}}function o(){localStorage.setItem(Va,JSON.stringify(e.value))}function a(){const y=document.documentElement;y.style.setProperty("--color-accent",e.value.accentColor);const k={subtle:{blur:"12px",opacity:"0.25"},default:{blur:"18px",opacity:"0.35"},strong:{blur:"28px",opacity:"0.50"}}[e.value.glassIntensity];y.style.setProperty("--glass-blur",k.blur),y.style.setProperty("--glass-opacity",k.opacity);const w={compact:"13px",default:"15px",large:"17px"};y.style.setProperty("--font-size-base",w[e.value.fontSize])}Yt(e,()=>{o(),a()},{deep:!0}),a();const l=Oe({get:()=>e.value.accentColor,set:y=>{e.value.accentColor=y}}),c=Oe({get:()=>e.value.glassIntensity,set:y=>{e.value.glassIntensity=y}}),u=Oe({get:()=>e.value.fontSize,set:y=>{e.value.fontSize=y}}),d=Oe({get:()=>e.value.hiddenContentTabs,set:y=>{e.value.hiddenContentTabs=y}}),f=Oe({get:()=>e.value.notificationsEnabled,set:y=>{e.value.notificationsEnabled=y}}),h=Oe({get:()=>e.value.autoArchiveDays,set:y=>{e.value.autoArchiveDays=y}});function b(y){return!e.value.hiddenContentTabs.includes(y)}function g(y){const k=e.value.hiddenContentTabs.indexOf(y);k>=0?e.value.hiddenContentTabs.splice(k,1):e.value.hiddenContentTabs.push(y)}function E(y,k){e.value.shortcuts[y]=k}function x(){e.value={...qr}}return{settings:e,claudeApiKey:t,setClaudeApiKey:n,initClaudeKey:s,persistClaudeKeyToVault:i,accentColor:l,glassIntensity:c,fontSize:u,hiddenContentTabs:d,notificationsEnabled:f,autoArchiveDays:h,isTabVisible:b,toggleTabVisibility:g,setShortcut:E,resetSettings:x,applyCssVars:a}}),Wa="aiui-crypto-salt",$_=ms({__name:"App",setup(e){const{currentTheme:t,initTheme:n,setTheme:s}=ql(),i=Jb(),r=!!window.__AIUI_EMBEDDED__,o=F(window.innerWidth),a=Oe(()=>o.value<1024),{viewportHeight:l}=Qb();function c(){o.value=window.innerWidth}const u=Oe(()=>a.value&&l.value>0?{height:`${l.value}px`,overflow:"hidden"}:{}),d=F(!1),f=F(!1),h=F("");async function b(g){h.value="";try{let E=localStorage.getItem(Wa),x;E?x=new Uint8Array(E.match(/.{2}/g).map(k=>parseInt(k,16))):(x=await k_(),E=Array.from(x).map(k=>k.toString(16).padStart(2,"0")).join(""),localStorage.setItem(Wa,E));const y=await x_(g,x);I_(y,x),await O_().initClaudeKey(),d.value=!1}catch(E){console.error("[AIUI] Passphrase error:",E),h.value="Encryption failed — check your passphrase or try skipping"}}return Ls(()=>{if(n(),r&&s("dark"),window.addEventListener("resize",c),i.init(),ep()&&!i.isEmbedded.value){const g=!!localStorage.getItem(Wa);f.value=!g,d.value=!0}}),$o(()=>{window.removeEventListener("resize",c),i.destroy()}),(g,E)=>(be(),xe("div",{class:st(["h-dvh flex flex-col",G(t)]),style:us(u.value)},[Fe(G(Qd)),Fe(Dv),Fe(nw),a.value?xt("",!0):(be(),fs(l_,{key:0})),Fe(v_,{visible:d.value,"is-creating":f.value,error:h.value,onSubmit:b,onSkip:E[0]||(E[0]=x=>d.value=!1)},null,8,["visible","is-creating","error"])],6))}}),mf=F(new Map),gf=F(new Map);function qa(e){if(mf.value.has(e.id)){console.warn(`Plugin "${e.id}" is already registered. Skipping.`);return}mf.value.set(e.id,e)}function yf(e){if(gf.value.has(e.id)){console.warn(`Renderer "${e.id}" is already registered. Skipping.`);return}gf.value.set(e.id,e)}async function D_(){const{claudeProvider:e}=await wn(async()=>{const{claudeProvider:r}=await import("./claude-provider-DbzPoW6j.js");return{claudeProvider:r}},[]);qa(e),await e.init({settings:{get:()=>{},set:()=>{}},events:{emit:()=>{},on:()=>()=>{}},logger:{info:console.info.bind(console,"[AIUI plugin]"),warn:console.warn.bind(console,"[AIUI plugin]"),error:console.error.bind(console,"[AIUI plugin]")}});const{filmRenderer:t}=await wn(async()=>{const{filmRenderer:r}=await import("./film-renderer-CWa3YMln.js");return{filmRenderer:r}},[]),{songRenderer:n}=await wn(async()=>{const{songRenderer:r}=await import("./song-renderer-C7kO7K9V.js");return{songRenderer:r}},[]);yf(t),yf(n);const{wikipediaPlugin:s}=await wn(async()=>{const{wikipediaPlugin:r}=await import("./wikipedia-BNDKhpH7.js");return{wikipediaPlugin:r}},[]),{openLibraryPlugin:i}=await wn(async()=>{const{openLibraryPlugin:r}=await import("./openlibrary-B8IPeH2e.js");return{openLibraryPlugin:r}},[]);qa(s),qa(i)}const bf="2";(async()=>{const e="aiui-cache-version",t=localStorage.getItem(e);if(t!==bf){if(localStorage.setItem(e,bf),"caches"in window){const n=await caches.keys();await Promise.all(n.map(s=>caches.delete(s)))}if("serviceWorker"in navigator){const n=await navigator.serviceWorker.getRegistrations();await Promise.all(n.map(s=>s.unregister()))}t!==null&&window.location.reload()}})();const F_=new URLSearchParams(window.location.search).has("embedded");window.__AIUI_EMBEDDED__=F_;const U_=Vy({history:xy("/aiui/"),routes:[{path:"/",name:"chat",component:()=>wn(()=>import("./ChatPage-AitDGZKH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))},{path:"/guide",name:"guide",component:()=>wn(()=>import("./GuidePage-DncbNAAY.js"),__vite__mapDeps([11,1,12]))},{path:"/widget-demo",name:"widget-demo",component:()=>wn(()=>import("./WidgetDemoPage-Mol6efr5.js"),__vite__mapDeps([13,2,1,3,4,14]))},{path:"/browse",name:"file-browser",component:()=>wn(()=>import("./BrowsePage-CfZ78QhW.js"),[])},{path:"/view/:nostrAddr",name:"conversation-viewer",component:()=>wn(()=>import("./ConversationViewerPage-PTutY4Lq.js"),__vite__mapDeps([15,3]))}]}),ic=Rg($_);ic.use(Mg());ic.use(U_);D_().catch(e=>{console.error("[AIUI] Failed to initialize plugins:",e)});ic.mount("#app");export{pk as $,Yt as A,yr as B,qe as C,Ls as D,Fe as E,zt as F,nr as G,Id as H,Z_ as I,z_ as J,fs as K,Fv as L,q_ as M,X_ as N,Xl as O,Ee as P,ep as Q,E_ as R,S_ as S,tp as T,zl as U,Ol as V,zo as W,yo as X,By as Y,lk as Z,wn as _,ms as a,rk as a0,hk as a1,ck as a2,fk as a3,tk as a4,ak as a5,Ia as a6,ik as a7,sk as a8,uk as a9,xv as aA,Qc as aa,Rs as ab,Oo as ac,Eu as ad,Db as ae,Tv as af,Ev as ag,Sv as ah,Qb as ai,K_ as aj,l_ as ak,Ht as al,Qt as am,Jb as an,O_ as ao,N_ as ap,gp as aq,B_ as ar,ok as as,ek as at,Q_ as au,Nu as av,J_ as aw,Y_ as ax,G_ as ay,dm as az,be as b,xe as c,H_ as d,L as e,W_ as f,V_ as g,us as h,xt as i,ql as j,Oe as k,_0 as l,dk as m,st as n,$o as o,j_ as p,d0 as q,F as r,Wf as s,dt as t,G as u,Xc as v,hc as w,nk as x,E0 as y,Mn as z};