codexapp 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-A4ZTH1ru.css +1 -0
- package/dist/assets/index-CcJFYgVf.js +48 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +738 -692
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -3
- package/dist/assets/index-B5wuNFNF.css +0 -1
- package/dist/assets/index-BeRIcrmp.js +0 -1481
|
@@ -1,1481 +0,0 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
2
|
-
* @vue/shared v3.5.30
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function nr(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const st=Object.freeze({}),ko=Object.freeze([]),Bt=()=>{},pd=()=>!1,Ts=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),oi=t=>t.startsWith("onUpdate:"),St=Object.assign,ml=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Sp=Object.prototype.hasOwnProperty,Qe=(t,e)=>Sp.call(t,e),xe=Array.isArray,Qr=t=>Ss(t)==="[object Map]",md=t=>Ss(t)==="[object Set]",cc=t=>Ss(t)==="[object Date]",Ne=t=>typeof t=="function",bt=t=>typeof t=="string",pn=t=>typeof t=="symbol",Ye=t=>t!==null&&typeof t=="object",gl=t=>(Ye(t)||Ne(t))&&Ne(t.then)&&Ne(t.catch),gd=Object.prototype.toString,Ss=t=>gd.call(t),vl=t=>Ss(t).slice(8,-1),vd=t=>Ss(t)==="[object Object]",yl=t=>bt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,rs=nr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),kp=nr("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Ci=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Ip=/-\w/g,Nt=Ci(t=>t.replace(Ip,e=>e.slice(1).toUpperCase())),Ep=/\B([A-Z])/g,Qn=Ci(t=>t.replace(Ep,"-$1").toLowerCase()),ro=Ci(t=>t.charAt(0).toUpperCase()+t.slice(1)),Vr=Ci(t=>t?`on${ro(t)}`:""),Cn=(t,e)=>!Object.is(t,e),wo=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},si=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},bl=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Cp=t=>{const e=bt(t)?Number(t):NaN;return isNaN(e)?t:e};let uc;const ks=()=>uc||(uc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function oo(t){if(xe(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=bt(r)?Pp(r):oo(r);if(o)for(const i in o)e[i]=o[i]}return e}else if(bt(t)||Ye(t))return t}const Ap=/;(?![^(]*\))/g,Rp=/:([^]+)/,xp=/\/\*[^]*?\*\//g;function Pp(t){const e={};return t.replace(xp,"").split(Ap).forEach(n=>{if(n){const r=n.split(Rp);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function dt(t){let e="";if(bt(t))e=t;else if(xe(t))for(let n=0;n<t.length;n++){const r=dt(t[n]);r&&(e+=r+" ")}else if(Ye(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Op="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Mp="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Np="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Dp=nr(Op),Lp=nr(Mp),jp=nr(Np),Up="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fp=nr(Up);function yd(t){return!!t||t===""}function Bp(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=_l(t[r],e[r]);return n}function _l(t,e){if(t===e)return!0;let n=cc(t),r=cc(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=pn(t),r=pn(e),n||r)return t===e;if(n=xe(t),r=xe(e),n||r)return n&&r?Bp(t,e):!1;if(n=Ye(t),r=Ye(e),n||r){if(!n||!r)return!1;const o=Object.keys(t).length,i=Object.keys(e).length;if(o!==i)return!1;for(const s in t){const a=t.hasOwnProperty(s),l=e.hasOwnProperty(s);if(a&&!l||!a&&l||!_l(t[s],e[s]))return!1}}return String(t)===String(e)}const bd=t=>!!(t&&t.__v_isRef===!0),fe=t=>bt(t)?t:t==null?"":xe(t)||Ye(t)&&(t.toString===gd||!Ne(t.toString))?bd(t)?fe(t.value):JSON.stringify(t,_d,2):String(t),_d=(t,e)=>bd(e)?_d(t,e.value):Qr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,o],i)=>(n[qi(r,i)+" =>"]=o,n),{})}:md(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>qi(n))}:pn(e)?qi(e):Ye(e)&&!xe(e)&&!vd(e)?String(e):e,qi=(t,e="")=>{var n;return pn(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
|
|
6
|
-
* @vue/reactivity v3.5.30
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/function mn(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let Jt;class Hp{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Jt,!e&&Jt&&(this.index=(Jt.scopes||(Jt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Jt;try{return Jt=this,e()}finally{Jt=n}}else mn("cannot run an inactive effect scope.")}on(){++this._on===1&&(this.prevScope=Jt,Jt=this)}off(){this._on>0&&--this._on===0&&(Jt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function $p(){return Jt}let ot;const Gi=new WeakSet;class wd{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Jt&&Jt.active&&Jt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Gi.has(this)&&(Gi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Sd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dc(this),kd(this);const e=ot,n=dn;ot=this,dn=!0;try{return this.fn()}finally{ot!==this&&mn("Active effect was not restored correctly - this is likely a Vue internal bug."),Id(this),ot=e,dn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Sl(e);this.deps=this.depsTail=void 0,dc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Gi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Oa(this)&&this.run()}get dirty(){return Oa(this)}}let Td=0,os,ss;function Sd(t,e=!1){if(t.flags|=8,e){t.next=ss,ss=t;return}t.next=os,os=t}function wl(){Td++}function Tl(){if(--Td>0)return;if(ss){let e=ss;for(ss=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;os;){let e=os;for(os=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function kd(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Id(t){let e,n=t.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Sl(r),Vp(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}t.deps=e,t.depsTail=n}function Oa(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Ed(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Ed(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===ds)||(t.globalVersion=ds,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Oa(t))))return;t.flags|=2;const e=t.dep,n=ot,r=dn;ot=t,dn=!0;try{kd(t);const o=t.fn(t._value);(e.version===0||Cn(o,t._value))&&(t.flags|=128,t._value=o,e.version++)}catch(o){throw e.version++,o}finally{ot=n,dn=r,Id(t),t.flags&=-3}}function Sl(t,e=!1){const{dep:n,prevSub:r,nextSub:o}=t;if(r&&(r.nextSub=o,t.prevSub=void 0),o&&(o.prevSub=r,t.nextSub=void 0),n.subsHead===t&&(n.subsHead=o),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Sl(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Vp(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let dn=!0;const Cd=[];function gn(){Cd.push(dn),dn=!1}function vn(){const t=Cd.pop();dn=t===void 0?!0:t}function dc(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=ot;ot=void 0;try{e()}finally{ot=n}}}let ds=0;class Wp{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class kl{constructor(e){this.computed=e,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,this.subsHead=void 0}track(e){if(!ot||!dn||ot===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ot)n=this.activeLink=new Wp(ot,this),ot.deps?(n.prevDep=ot.depsTail,ot.depsTail.nextDep=n,ot.depsTail=n):ot.deps=ot.depsTail=n,Ad(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ot.depsTail,n.nextDep=void 0,ot.depsTail.nextDep=n,ot.depsTail=n,ot.deps===n&&(ot.deps=r)}return ot.onTrack&&ot.onTrack(St({effect:ot},e)),n}trigger(e){this.version++,ds++,this.notify(e)}notify(e){wl();try{for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(St({effect:n.sub},e));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Tl()}}}function Ad(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Ad(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subsHead===void 0&&(t.dep.subsHead=t),t.dep.subs=t}}const Ma=new WeakMap,Xr=Symbol("Object iterate"),Na=Symbol("Map keys iterate"),fs=Symbol("Array iterate");function Mt(t,e,n){if(dn&&ot){let r=Ma.get(t);r||Ma.set(t,r=new Map);let o=r.get(n);o||(r.set(n,o=new kl),o.map=r,o.key=n),o.track({target:t,type:e,key:n})}}function An(t,e,n,r,o,i){const s=Ma.get(t);if(!s){ds++;return}const a=l=>{l&&l.trigger({target:t,type:e,key:n,newValue:r,oldValue:o,oldTarget:i})};if(wl(),e==="clear")s.forEach(a);else{const l=xe(t),d=l&&yl(n);if(l&&n==="length"){const u=Number(r);s.forEach((c,h)=>{(h==="length"||h===fs||!pn(h)&&h>=u)&&a(c)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),d&&a(s.get(fs)),e){case"add":l?d&&a(s.get("length")):(a(s.get(Xr)),Qr(t)&&a(s.get(Na)));break;case"delete":l||(a(s.get(Xr)),Qr(t)&&a(s.get(Na)));break;case"set":Qr(t)&&a(s.get(Xr));break}}Tl()}function go(t){const e=We(t);return e===t?e:(Mt(e,"iterate",fs),Gt(t)?e:e.map(bn))}function Ai(t){return Mt(t=We(t),"iterate",fs),t}function En(t,e){return yn(t)?Oo(kr(t)?bn(e):e):bn(e)}const qp={__proto__:null,[Symbol.iterator](){return Ki(this,Symbol.iterator,t=>En(this,t))},concat(...t){return go(this).concat(...t.map(e=>xe(e)?go(e):e))},entries(){return Ki(this,"entries",t=>(t[1]=En(this,t[1]),t))},every(t,e){return Fn(this,"every",t,e,void 0,arguments)},filter(t,e){return Fn(this,"filter",t,e,n=>n.map(r=>En(this,r)),arguments)},find(t,e){return Fn(this,"find",t,e,n=>En(this,n),arguments)},findIndex(t,e){return Fn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Fn(this,"findLast",t,e,n=>En(this,n),arguments)},findLastIndex(t,e){return Fn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Fn(this,"forEach",t,e,void 0,arguments)},includes(...t){return zi(this,"includes",t)},indexOf(...t){return zi(this,"indexOf",t)},join(t){return go(this).join(t)},lastIndexOf(...t){return zi(this,"lastIndexOf",t)},map(t,e){return Fn(this,"map",t,e,void 0,arguments)},pop(){return Go(this,"pop")},push(...t){return Go(this,"push",t)},reduce(t,...e){return fc(this,"reduce",t,e)},reduceRight(t,...e){return fc(this,"reduceRight",t,e)},shift(){return Go(this,"shift")},some(t,e){return Fn(this,"some",t,e,void 0,arguments)},splice(...t){return Go(this,"splice",t)},toReversed(){return go(this).toReversed()},toSorted(t){return go(this).toSorted(t)},toSpliced(...t){return go(this).toSpliced(...t)},unshift(...t){return Go(this,"unshift",t)},values(){return Ki(this,"values",t=>En(this,t))}};function Ki(t,e,n){const r=Ai(t),o=r[e]();return r!==t&&!Gt(t)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const Gp=Array.prototype;function Fn(t,e,n,r,o,i){const s=Ai(t),a=s!==t&&!Gt(t),l=s[e];if(l!==Gp[e]){const c=l.apply(t,i);return a?bn(c):c}let d=n;s!==t&&(a?d=function(c,h){return n.call(this,En(t,c),h,t)}:n.length>2&&(d=function(c,h){return n.call(this,c,h,t)}));const u=l.call(s,d,r);return a&&o?o(u):u}function fc(t,e,n,r){const o=Ai(t),i=o!==t&&!Gt(t);let s=n,a=!1;o!==t&&(i?(a=r.length===0,s=function(d,u,c){return a&&(a=!1,d=En(t,d)),n.call(this,d,En(t,u),c,t)}):n.length>3&&(s=function(d,u,c){return n.call(this,d,u,c,t)}));const l=o[e](s,...r);return a?En(t,l):l}function zi(t,e,n){const r=We(t);Mt(r,"iterate",fs);const o=r[e](...n);return(o===-1||o===!1)&&ii(n[0])?(n[0]=We(n[0]),r[e](...n)):o}function Go(t,e,n=[]){gn(),wl();const r=We(t)[e].apply(t,n);return Tl(),vn(),r}const Kp=nr("__proto__,__v_isRef,__isVue"),Rd=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(pn));function zp(t){pn(t)||(t=String(t));const e=We(this);return Mt(e,"has",t),e.hasOwnProperty(t)}class xd{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?Ld:Dd:i?Nd:Md).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=xe(e);if(!o){let l;if(s&&(l=qp[n]))return l;if(n==="hasOwnProperty")return zp}const a=Reflect.get(e,n,xt(e)?e:r);if((pn(n)?Rd.has(n):Kp(n))||(o||Mt(e,"get",n),i))return a;if(xt(a)){const l=s&&yl(n)?a:a.value;return o&&Ye(l)?La(l):l}return Ye(a)?o?La(a):xi(a):a}}class Pd extends xd{constructor(e=!1){super(!1,e)}set(e,n,r,o){let i=e[n];const s=xe(e)&&yl(n);if(!this._isShallow){const d=yn(i);if(!Gt(r)&&!yn(r)&&(i=We(i),r=We(r)),!s&&xt(i)&&!xt(r))return d?(mn(`Set operation on key "${String(n)}" failed: target is readonly.`,e[n]),!0):(i.value=r,!0)}const a=s?Number(n)<e.length:Qe(e,n),l=Reflect.set(e,n,r,xt(e)?e:o);return e===We(o)&&(a?Cn(r,i)&&An(e,"set",n,r,i):An(e,"add",n,r)),l}deleteProperty(e,n){const r=Qe(e,n),o=e[n],i=Reflect.deleteProperty(e,n);return i&&r&&An(e,"delete",n,void 0,o),i}has(e,n){const r=Reflect.has(e,n);return(!pn(n)||!Rd.has(n))&&Mt(e,"has",n),r}ownKeys(e){return Mt(e,"iterate",xe(e)?"length":Xr),Reflect.ownKeys(e)}}class Od extends xd{constructor(e=!1){super(!0,e)}set(e,n){return mn(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return mn(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Jp=new Pd,Yp=new Od,Qp=new Pd(!0),Xp=new Od(!0),Da=t=>t,js=t=>Reflect.getPrototypeOf(t);function Zp(t,e,n){return function(...r){const o=this.__v_raw,i=We(o),s=Qr(i),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,d=o[t](...r),u=n?Da:e?Oo:bn;return!e&&Mt(i,"iterate",l?Na:Xr),St(Object.create(d),{next(){const{value:c,done:h}=d.next();return h?{value:c,done:h}:{value:a?[u(c[0]),u(c[1])]:u(c),done:h}}})}}function Us(t){return function(...e){{const n=e[0]?`on key "${e[0]}" `:"";mn(`${ro(t)} operation ${n}failed: target is readonly.`,We(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function em(t,e){const n={get(o){const i=this.__v_raw,s=We(i),a=We(o);t||(Cn(o,a)&&Mt(s,"get",o),Mt(s,"get",a));const{has:l}=js(s),d=e?Da:t?Oo:bn;if(l.call(s,o))return d(i.get(o));if(l.call(s,a))return d(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!t&&Mt(We(o),"iterate",Xr),o.size},has(o){const i=this.__v_raw,s=We(i),a=We(o);return t||(Cn(o,a)&&Mt(s,"has",o),Mt(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,l=We(a),d=e?Da:t?Oo:bn;return!t&&Mt(l,"iterate",Xr),a.forEach((u,c)=>o.call(i,d(u),d(c),s))}};return St(n,t?{add:Us("add"),set:Us("set"),delete:Us("delete"),clear:Us("clear")}:{add(o){const i=We(this),s=js(i),a=We(o),l=!e&&!Gt(o)&&!yn(o)?a:o;return s.has.call(i,l)||Cn(o,l)&&s.has.call(i,o)||Cn(a,l)&&s.has.call(i,a)||(i.add(l),An(i,"add",l,l)),this},set(o,i){!e&&!Gt(i)&&!yn(i)&&(i=We(i));const s=We(this),{has:a,get:l}=js(s);let d=a.call(s,o);d?hc(s,a,o):(o=We(o),d=a.call(s,o));const u=l.call(s,o);return s.set(o,i),d?Cn(i,u)&&An(s,"set",o,i,u):An(s,"add",o,i),this},delete(o){const i=We(this),{has:s,get:a}=js(i);let l=s.call(i,o);l?hc(i,s,o):(o=We(o),l=s.call(i,o));const d=a?a.call(i,o):void 0,u=i.delete(o);return l&&An(i,"delete",o,void 0,d),u},clear(){const o=We(this),i=o.size!==0,s=Qr(o)?new Map(o):new Set(o),a=o.clear();return i&&An(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Zp(o,t,e)}),n}function Ri(t,e){const n=em(t,e);return(r,o,i)=>o==="__v_isReactive"?!t:o==="__v_isReadonly"?t:o==="__v_raw"?r:Reflect.get(Qe(n,o)&&o in r?n:r,o,i)}const tm={get:Ri(!1,!1)},nm={get:Ri(!1,!0)},rm={get:Ri(!0,!1)},om={get:Ri(!0,!0)};function hc(t,e,n){const r=We(n);if(r!==n&&e.call(t,r)){const o=vl(t);mn(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Md=new WeakMap,Nd=new WeakMap,Dd=new WeakMap,Ld=new WeakMap;function sm(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function im(t){return t.__v_skip||!Object.isExtensible(t)?0:sm(vl(t))}function xi(t){return yn(t)?t:Pi(t,!1,Jp,tm,Md)}function jd(t){return Pi(t,!1,Qp,nm,Nd)}function La(t){return Pi(t,!0,Yp,rm,Dd)}function On(t){return Pi(t,!0,Xp,om,Ld)}function Pi(t,e,n,r,o){if(!Ye(t))return mn(`value cannot be made ${e?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=im(t);if(i===0)return t;const s=o.get(t);if(s)return s;const a=new Proxy(t,i===2?r:n);return o.set(t,a),a}function kr(t){return yn(t)?kr(t.__v_raw):!!(t&&t.__v_isReactive)}function yn(t){return!!(t&&t.__v_isReadonly)}function Gt(t){return!!(t&&t.__v_isShallow)}function ii(t){return t?!!t.__v_raw:!1}function We(t){const e=t&&t.__v_raw;return e?We(e):t}function am(t){return!Qe(t,"__v_skip")&&Object.isExtensible(t)&&si(t,"__v_skip",!0),t}const bn=t=>Ye(t)?xi(t):t,Oo=t=>Ye(t)?La(t):t;function xt(t){return t?t.__v_isRef===!0:!1}function D(t){return Ud(t,!1)}function lm(t){return Ud(t,!0)}function Ud(t,e){return xt(t)?t:new cm(t,e)}class cm{constructor(e,n){this.dep=new kl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:We(e),this._value=n?e:bn(e),this.__v_isShallow=n}get value(){return this.dep.track({target:this,type:"get",key:"value"}),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||Gt(e)||yn(e);e=r?e:We(e),Cn(e,n)&&(this._rawValue=e,this._value=r?e:bn(e),this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:n}))}}function zr(t){return xt(t)?t.value:t}const um={get:(t,e,n)=>e==="__v_raw"?t:zr(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const o=t[e];return xt(o)&&!xt(n)?(o.value=n,!0):Reflect.set(t,e,n,r)}};function Fd(t){return kr(t)?t:new Proxy(t,um)}class dm{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new kl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ot!==this)return Sd(this,!0),!0}get value(){const e=this.dep.track({target:this,type:"get",key:"value"});return Ed(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):mn("Write operation failed: computed value is readonly")}}function fm(t,e,n=!1){let r,o;return Ne(t)?r=t:(r=t.get,o=t.set),new dm(r,o,n)}const Fs={},ai=new WeakMap;let Wr;function hm(t,e=!1,n=Wr){if(n){let r=ai.get(n);r||ai.set(n,r=[]),r.push(t)}else e||mn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function pm(t,e,n=st){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:l}=n,d=U=>{(n.onWarn||mn)("Invalid watch source: ",U,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},u=U=>o?U:Gt(U)||o===!1||o===0?Gn(U,1):Gn(U);let c,h,b,E,C=!1,W=!1;if(xt(t)?(h=()=>t.value,C=Gt(t)):kr(t)?(h=()=>u(t),C=!0):xe(t)?(W=!0,C=t.some(U=>kr(U)||Gt(U)),h=()=>t.map(U=>{if(xt(U))return U.value;if(kr(U))return u(U);if(Ne(U))return l?l(U,2):U();d(U)})):Ne(t)?e?h=l?()=>l(t,2):t:h=()=>{if(b){gn();try{b()}finally{vn()}}const U=Wr;Wr=c;try{return l?l(t,3,[E]):t(E)}finally{Wr=U}}:(h=Bt,d(t)),e&&o){const U=h,Q=o===!0?1/0:o;h=()=>Gn(U(),Q)}const L=$p(),M=()=>{c.stop(),L&&L.active&&ml(L.effects,c)};if(i&&e){const U=e;e=(...Q)=>{U(...Q),M()}}let H=W?new Array(t.length).fill(Fs):Fs;const X=U=>{if(!(!(c.flags&1)||!c.dirty&&!U))if(e){const Q=c.run();if(o||C||(W?Q.some((re,me)=>Cn(re,H[me])):Cn(Q,H))){b&&b();const re=Wr;Wr=c;try{const me=[Q,H===Fs?void 0:W&&H[0]===Fs?[]:H,E];H=Q,l?l(e,3,me):e(...me)}finally{Wr=re}}}else c.run()};return a&&a(X),c=new wd(h),c.scheduler=s?()=>s(X,!1):X,E=U=>hm(U,!1,c),b=c.onStop=()=>{const U=ai.get(c);if(U){if(l)l(U,4);else for(const Q of U)Q();ai.delete(c)}},c.onTrack=n.onTrack,c.onTrigger=n.onTrigger,e?r?X(!0):H=c.run():s?s(X.bind(null,!0),!0):c.run(),M.pause=c.pause.bind(c),M.resume=c.resume.bind(c),M.stop=M,M}function Gn(t,e=1/0,n){if(e<=0||!Ye(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,xt(t))Gn(t.value,e,n);else if(xe(t))for(let r=0;r<t.length;r++)Gn(t[r],e,n);else if(md(t)||Qr(t))t.forEach(r=>{Gn(r,e,n)});else if(vd(t)){for(const r in t)Gn(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Gn(t[r],e,n)}return t}/**
|
|
10
|
-
* @vue/runtime-core v3.5.30
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/const Zr=[];function Gs(t){Zr.push(t)}function Ks(){Zr.pop()}let Ji=!1;function Z(t,...e){if(Ji)return;Ji=!0,gn();const n=Zr.length?Zr[Zr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=mm();if(r)Uo(r,n,11,[t+e.map(i=>{var s,a;return(a=(s=i.toString)==null?void 0:s.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,o.map(({vnode:i})=>`at <${xs(n,i.type)}>`).join(`
|
|
14
|
-
`),o]);else{const i=[`[Vue warn]: ${t}`,...e];o.length&&i.push(`
|
|
15
|
-
`,...gm(o)),console.warn(...i)}vn(),Ji=!1}function mm(){let t=Zr[Zr.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function gm(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[`
|
|
16
|
-
`],...vm(n))}),e}function vm({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,o=` at <${xs(t.component,t.type,r)}`,i=">"+n;return t.props?[o,...ym(t.props),i]:[o+i]}function ym(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...Bd(r,t[r]))}),n.length>3&&e.push(" ..."),e}function Bd(t,e,n){return bt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:xt(e)?(e=Bd(t,We(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):Ne(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=We(e),n?e:[`${t}=`,e])}function bm(t,e){t!==void 0&&(typeof t!="number"?Z(`${e} is not a valid number - got ${JSON.stringify(t)}.`):isNaN(t)&&Z(`${e} is NaN - the duration expression might be incorrect.`))}const Il={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Uo(t,e,n,r){try{return r?t(...r):t()}catch(o){Is(o,e,n)}}function _n(t,e,n,r){if(Ne(t)){const o=Uo(t,e,n,r);return o&&gl(o)&&o.catch(i=>{Is(i,e,n)}),o}if(xe(t)){const o=[];for(let i=0;i<t.length;i++)o.push(_n(t[i],e,n,r));return o}else Z(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof t}`)}function Is(t,e,n,r=!0){const o=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||st;if(e){let a=e.parent;const l=e.proxy,d=Il[n];for(;a;){const u=a.ec;if(u){for(let c=0;c<u.length;c++)if(u[c](t,l,d)===!1)return}a=a.parent}if(i){gn(),Uo(i,null,10,[t,l,d]),vn();return}}_m(t,n,o,r,s)}function _m(t,e,n,r=!0,o=!1){{const i=Il[e];if(n&&Gs(n),Z(`Unhandled error${i?` during execution of ${i}`:""}`),n&&Ks(),r)throw t;console.error(t)}}const Wt=[];let kn=-1;const Io=[];let yr=null,To=0;const Hd=Promise.resolve();let li=null;const wm=100;function en(t){const e=li||Hd;return t?e.then(this?t.bind(this):t):e}function Tm(t){let e=kn+1,n=Wt.length;for(;e<n;){const r=e+n>>>1,o=Wt[r],i=hs(o);i<t||i===t&&o.flags&2?e=r+1:n=r}return e}function Oi(t){if(!(t.flags&1)){const e=hs(t),n=Wt[Wt.length-1];!n||!(t.flags&2)&&e>=hs(n)?Wt.push(t):Wt.splice(Tm(e),0,t),t.flags|=1,$d()}}function $d(){li||(li=Hd.then(qd))}function Vd(t){xe(t)?Io.push(...t):yr&&t.id===-1?yr.splice(To+1,0,t):t.flags&1||(Io.push(t),t.flags|=1),$d()}function pc(t,e,n=kn+1){for(e=e||new Map;n<Wt.length;n++){const r=Wt[n];if(r&&r.flags&2){if(t&&r.id!==t.uid||El(e,r))continue;Wt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wd(t){if(Io.length){const e=[...new Set(Io)].sort((n,r)=>hs(n)-hs(r));if(Io.length=0,yr){yr.push(...e);return}for(yr=e,t=t||new Map,To=0;To<yr.length;To++){const n=yr[To];El(t,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}yr=null,To=0}}const hs=t=>t.id==null?t.flags&2?-1:1/0:t.id;function qd(t){t=t||new Map;const e=n=>El(t,n);try{for(kn=0;kn<Wt.length;kn++){const n=Wt[kn];if(n&&!(n.flags&8)){if(e(n))continue;n.flags&4&&(n.flags&=-2),Uo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;kn<Wt.length;kn++){const n=Wt[kn];n&&(n.flags&=-2)}kn=-1,Wt.length=0,Wd(t),li=null,(Wt.length||Io.length)&&qd(t)}}function El(t,e){const n=t.get(e)||0;if(n>wm){const r=e.i,o=r&&Nl(r.type);return Is(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return t.set(e,n+1),!1}let cn=!1;const zs=new Map;ks().__VUE_HMR_RUNTIME__={createRecord:Yi(Gd),rerender:Yi(Im),reload:Yi(Em)};const so=new Map;function Sm(t){const e=t.type.__hmrId;let n=so.get(e);n||(Gd(e,t.type),n=so.get(e)),n.instances.add(t)}function km(t){so.get(t.type.__hmrId).instances.delete(t)}function Gd(t,e){return so.has(t)?!1:(so.set(t,{initialDef:ci(e),instances:new Set}),!0)}function ci(t){return jf(t)?t.__vccOpts:t}function Im(t,e){const n=so.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(r=>{e&&(r.render=e,ci(r.type).render=e),r.renderCache=[],cn=!0,r.job.flags&8||r.update(),cn=!1}))}function Em(t,e){const n=so.get(t);if(!n)return;e=ci(e),mc(n.initialDef,e);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=ci(i.type);let a=zs.get(s);a||(s!==n.initialDef&&mc(s,e),zs.set(s,a=new Set)),a.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(a.add(i),i.ceReload(e.styles),a.delete(i)):i.parent?Oi(()=>{i.job.flags&8||(cn=!0,i.parent.update(),cn=!1,a.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}Vd(()=>{zs.clear()})}function mc(t,e){St(t,e);for(const n in t)n!=="__file"&&!(n in e)&&delete t[n]}function Yi(t){return(e,n)=>{try{return t(e,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Rn,ts=[],ja=!1;function Es(t,...e){Rn?Rn.emit(t,...e):ja||ts.push({event:t,args:e})}function Kd(t,e){var n,r;Rn=t,Rn?(Rn.enabled=!0,ts.forEach(({event:o,args:i})=>Rn.emit(o,...i)),ts=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Kd(i,e)}),setTimeout(()=>{Rn||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ja=!0,ts=[])},3e3)):(ja=!0,ts=[])}function Cm(t,e){Es("app:init",t,e,{Fragment:je,Text:As,Comment:It,Static:Qs})}function Am(t){Es("app:unmount",t)}const Rm=Cl("component:added"),zd=Cl("component:updated"),xm=Cl("component:removed"),Pm=t=>{Rn&&typeof Rn.cleanupBuffer=="function"&&!Rn.cleanupBuffer(t)&&xm(t)};function Cl(t){return e=>{Es(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}const Om=Jd("perf:start"),Mm=Jd("perf:end");function Jd(t){return(e,n,r)=>{Es(t,e.appContext.app,e.uid,e,n,r)}}function Nm(t,e,n){Es("component:emit",t.appContext.app,t,e,n)}let Rt=null,Yd=null;function ui(t){const e=Rt;return Rt=t,Yd=t&&t.type.__scopeId||null,e}function lt(t,e=Rt,n){if(!e||t._n)return t;const r=(...o)=>{r._d&&vi(-1);const i=ui(e);let s;try{s=t(...o)}finally{ui(i),r._d&&vi(1)}return zd(e),s};return r._n=!0,r._c=!0,r._d=!0,r}function Qd(t){kp(t)&&Z("Do not use built-in directive ids as custom directive id: "+t)}function Xn(t,e){if(Rt===null)return Z("withDirectives can only be used inside render functions."),t;const n=Li(Rt),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[i,s,a,l=st]=e[o];i&&(Ne(i)&&(i={mounted:i,updated:i}),i.deep&&Gn(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function Fr(t,e,n,r){const o=t.dirs,i=e&&e.dirs;for(let s=0;s<o.length;s++){const a=o[s];i&&(a.oldValue=i[s].value);let l=a.dir[r];l&&(gn(),_n(l,n,8,[t.el,a,t,e]),vn())}}function Js(t,e){if((!At||At.isMounted)&&Z("provide() can only be used inside setup()."),At){let n=At.provides;const r=At.parent&&At.parent.provides;r===n&&(n=At.provides=Object.create(r)),n[t]=e}}function fn(t,e,n=!1){const r=Fo();if(r||Co){let o=Co?Co._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&t in o)return o[t];if(arguments.length>1)return n&&Ne(e)?e.call(r&&r.proxy):e;Z(`injection "${String(t)}" not found.`)}else Z("inject() can only be used inside setup() or functional components.")}const Dm=Symbol.for("v-scx"),Lm=()=>{{const t=fn(Dm);return t||Z("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}};function jm(t,e){return Al(t,null,e)}function yt(t,e,n){return Ne(e)||Z("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Al(t,e,n)}function Al(t,e,n=st){const{immediate:r,deep:o,flush:i,once:s}=n;e||(r!==void 0&&Z('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Z('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Z('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=St({},n);a.onWarn=Z;const l=e&&r||!e&&i!=="post";let d;if(gs){if(i==="sync"){const b=Lm();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=Bt,b.resume=Bt,b.pause=Bt,b}}const u=At;a.call=(b,E,C)=>_n(b,u,E,C);let c=!1;i==="post"?a.scheduler=b=>{Ft(b,u&&u.suspense)}:i!=="sync"&&(c=!0,a.scheduler=(b,E)=>{E?b():Oi(b)}),a.augmentJob=b=>{e&&(b.flags|=4),c&&(b.flags|=2,u&&(b.id=u.uid,b.i=u))};const h=pm(t,e,a);return gs&&(d?d.push(h):l&&h()),h}function Um(t,e,n){const r=this.proxy,o=bt(t)?t.includes(".")?Xd(r,t):()=>r[t]:t.bind(r,r);let i;Ne(e)?i=e:(i=e.handler,n=e);const s=Rs(this),a=Al(o,i.bind(r),n);return s(),a}function Xd(t,e){const n=e.split(".");return()=>{let r=t;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Zd=Symbol("_vte"),ef=t=>t.__isTeleport,eo=t=>t&&(t.disabled||t.disabled===""),gc=t=>t&&(t.defer||t.defer===""),vc=t=>typeof SVGElement<"u"&&t instanceof SVGElement,yc=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Ua=(t,e)=>{const n=t&&t.to;if(bt(n))if(e){const r=e(n);return!r&&!eo(t)&&Z(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return Z("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return!n&&!eo(t)&&Z(`Invalid Teleport target: ${n}`),n},tf={name:"Teleport",__isTeleport:!0,process(t,e,n,r,o,i,s,a,l,d){const{mc:u,pc:c,pbc:h,o:{insert:b,querySelector:E,createText:C,createComment:W}}=d,L=eo(e.props);let{shapeFlag:M,children:H,dynamicChildren:X}=e;if(cn&&(l=!1,X=null),t==null){const U=e.el=W("teleport start"),Q=e.anchor=W("teleport end");b(U,n,r),b(Q,n,r);const re=(z,te)=>{M&16&&u(H,z,te,o,i,s,a,l)},me=()=>{const z=e.target=Ua(e.props,E),te=Fa(z,e,C,b);z?(s!=="svg"&&vc(z)?s="svg":s!=="mathml"&&yc(z)&&(s="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(z),L||(re(z,te),Ys(e,!1))):L||Z("Invalid Teleport target on mount:",z,`(${typeof z})`)};L&&(re(n,Q),Ys(e,!0)),gc(e.props)?(e.el.__isMounted=!1,Ft(()=>{me(),delete e.el.__isMounted},i)):me()}else{if(gc(e.props)&&t.el.__isMounted===!1){Ft(()=>{tf.process(t,e,n,r,o,i,s,a,l,d)},i);return}e.el=t.el,e.targetStart=t.targetStart;const U=e.anchor=t.anchor,Q=e.target=t.target,re=e.targetAnchor=t.targetAnchor,me=eo(t.props),z=me?n:Q,te=me?U:re;if(s==="svg"||vc(Q)?s="svg":(s==="mathml"||yc(Q))&&(s="mathml"),X?(h(t.dynamicChildren,X,z,o,i,s,a),gi(t,e,!1)):l||c(t,e,z,te,o,i,s,a,!1),L)me?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Bs(e,n,U,d,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const Ae=e.target=Ua(e.props,E);Ae?Bs(e,Ae,null,d,0):Z("Invalid Teleport target on update:",Q,`(${typeof Q})`)}else me&&Bs(e,Q,re,d,1);Ys(e,L)}},remove(t,e,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:l,targetStart:d,targetAnchor:u,target:c,props:h}=t;if(c&&(o(d),o(u)),i&&o(l),s&16){const b=i||!eo(h);for(let E=0;E<a.length;E++){const C=a[E];r(C,e,n,b,!!C.dynamicChildren)}}},move:Bs,hydrate:Fm};function Bs(t,e,n,{o:{insert:r},m:o},i=2){i===0&&r(t.targetAnchor,e,n);const{el:s,anchor:a,shapeFlag:l,children:d,props:u}=t,c=i===2;if(c&&r(s,e,n),(!c||eo(u))&&l&16)for(let h=0;h<d.length;h++)o(d[h],e,n,2);c&&r(a,e,n)}function Fm(t,e,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:d,createText:u}},c){function h(W,L){let M=L;for(;M;){if(M&&M.nodeType===8){if(M.data==="teleport start anchor")e.targetStart=M;else if(M.data==="teleport anchor"){e.targetAnchor=M,W._lpa=e.targetAnchor&&s(e.targetAnchor);break}}M=s(M)}}function b(W,L){L.anchor=c(s(W),L,a(W),n,r,o,i)}const E=e.target=Ua(e.props,l),C=eo(e.props);if(E){const W=E._lpa||E.firstChild;e.shapeFlag&16&&(C?(b(t,e),h(E,W),e.targetAnchor||Fa(E,e,u,d,a(t)===E?t:null)):(e.anchor=s(t),h(E,W),e.targetAnchor||Fa(E,e,u,d),c(W&&s(W),e,E,n,r,o,i))),Ys(e,C)}else C&&e.shapeFlag&16&&(b(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}const di=tf;function Ys(t,e){const n=t.ctx;if(n&&n.ut){let r,o;for(e?(r=t.el,o=t.anchor):(r=t.targetStart,o=t.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Fa(t,e,n,r,o=null){const i=e.targetStart=n(""),s=e.targetAnchor=n("");return i[Zd]=s,t&&(r(i,t,o),r(s,t,o)),s}const In=Symbol("_leaveCb"),Ko=Symbol("_enterCb");function Bm(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ar(()=>{t.isMounted=!0}),Rr(()=>{t.isUnmounting=!0}),t}const rn=[Function,Array],nf={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:rn,onEnter:rn,onAfterEnter:rn,onEnterCancelled:rn,onBeforeLeave:rn,onLeave:rn,onAfterLeave:rn,onLeaveCancelled:rn,onBeforeAppear:rn,onAppear:rn,onAfterAppear:rn,onAppearCancelled:rn},rf=t=>{const e=t.subTree;return e.component?rf(e.component):e},Hm={name:"BaseTransition",props:nf,setup(t,{slots:e}){const n=Fo(),r=Bm();return()=>{const o=e.default&&af(e.default(),!0);if(!o||!o.length)return;const i=of(o),s=We(t),{mode:a}=s;if(a&&a!=="in-out"&&a!=="out-in"&&a!=="default"&&Z(`invalid <transition> mode: ${a}`),r.isLeaving)return Qi(i);const l=bc(i);if(!l)return Qi(i);let d=Ba(l,s,r,n,c=>d=c);l.type!==It&&ps(l,d);let u=n.subTree&&bc(n.subTree);if(u&&u.type!==It&&!Gr(u,l)&&rf(n).type!==It){let c=Ba(u,s,r,n);if(ps(u,c),a==="out-in"&&l.type!==It)return r.isLeaving=!0,c.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete c.afterLeave,u=void 0},Qi(i);a==="in-out"&&l.type!==It?c.delayLeave=(h,b,E)=>{const C=sf(r,u);C[String(u.key)]=u,h[In]=()=>{b(),h[In]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{E(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function of(t){let e=t[0];if(t.length>1){let n=!1;for(const r of t)if(r.type!==It){if(n){Z("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}e=r,n=!0}}return e}const $m=Hm;function sf(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Ba(t,e,n,r,o){const{appear:i,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:c,onBeforeLeave:h,onLeave:b,onAfterLeave:E,onLeaveCancelled:C,onBeforeAppear:W,onAppear:L,onAfterAppear:M,onAppearCancelled:H}=e,X=String(t.key),U=sf(n,t),Q=(z,te)=>{z&&_n(z,r,9,te)},re=(z,te)=>{const Ae=te[1];Q(z,te),xe(z)?z.every(q=>q.length<=1)&&Ae():z.length<=1&&Ae()},me={mode:s,persisted:a,beforeEnter(z){let te=l;if(!n.isMounted)if(i)te=W||l;else return;z[In]&&z[In](!0);const Ae=U[X];Ae&&Gr(t,Ae)&&Ae.el[In]&&Ae.el[In](),Q(te,[z])},enter(z){if(U[X]===t)return;let te=d,Ae=u,q=c;if(!n.isMounted)if(i)te=L||d,Ae=M||u,q=H||c;else return;let ye=!1;z[Ko]=Ue=>{ye||(ye=!0,Ue?Q(q,[z]):Q(Ae,[z]),me.delayedLeave&&me.delayedLeave(),z[Ko]=void 0)};const Re=z[Ko].bind(null,!1);te?re(te,[z,Re]):Re()},leave(z,te){const Ae=String(t.key);if(z[Ko]&&z[Ko](!0),n.isUnmounting)return te();Q(h,[z]);let q=!1;z[In]=Re=>{q||(q=!0,te(),Re?Q(C,[z]):Q(E,[z]),z[In]=void 0,U[Ae]===t&&delete U[Ae])};const ye=z[In].bind(null,!1);U[Ae]=t,b?re(b,[z,ye]):ye()},clone(z){const te=Ba(z,e,n,r,o);return o&&o(te),te}};return me}function Qi(t){if(Cs(t))return t=Dn(t),t.children=null,t}function bc(t){if(!Cs(t))return ef(t.type)&&t.children?of(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&Ne(n.default))return n.default()}}function ps(t,e){t.shapeFlag&6&&t.component?(t.transition=e,ps(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function af(t,e=!1,n){let r=[],o=0;for(let i=0;i<t.length;i++){let s=t[i];const a=n==null?s.key:String(n)+String(s.key!=null?s.key:i);s.type===je?(s.patchFlag&128&&o++,r=r.concat(af(s.children,e,a))):(e||s.type!==It)&&r.push(a!=null?Dn(s,{key:a}):s)}if(o>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function jt(t,e){return Ne(t)?St({name:t.name},e,{setup:t}):t}function lf(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}const _c=new WeakSet;function wc(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const fi=new WeakMap;function is(t,e,n,r,o=!1){if(xe(t)){t.forEach((C,W)=>is(C,e&&(xe(e)?e[W]:e),n,r,o));return}if(Eo(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&is(t,e,n,r.component.subTree);return}const i=r.shapeFlag&4?Li(r.component):r.el,s=o?null:i,{i:a,r:l}=t;if(!a){Z("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const d=e&&e.r,u=a.refs===st?a.refs={}:a.refs,c=a.setupState,h=We(c),b=c===st?pd:C=>(Qe(h,C)&&!xt(h[C])&&Z(`Template ref "${C}" used on a non-ref value. It will not work in the production build.`),_c.has(h[C])||wc(u,C)?!1:Qe(h,C)),E=(C,W)=>!(_c.has(C)||W&&wc(u,W));if(d!=null&&d!==l){if(Tc(e),bt(d))u[d]=null,b(d)&&(c[d]=null);else if(xt(d)){const C=e;E(d,C.k)&&(d.value=null),C.k&&(u[C.k]=null)}}if(Ne(l))Uo(l,a,12,[s,u]);else{const C=bt(l),W=xt(l);if(C||W){const L=()=>{if(t.f){const M=C?b(l)?c[l]:u[l]:E(l)||!t.k?l.value:u[t.k];if(o)xe(M)&&ml(M,i);else if(xe(M))M.includes(i)||M.push(i);else if(C)u[l]=[i],b(l)&&(c[l]=u[l]);else{const H=[i];E(l,t.k)&&(l.value=H),t.k&&(u[t.k]=H)}}else C?(u[l]=s,b(l)&&(c[l]=s)):W?(E(l,t.k)&&(l.value=s),t.k&&(u[t.k]=s)):Z("Invalid template ref type:",l,`(${typeof l})`)};if(s){const M=()=>{L(),fi.delete(t)};M.id=-1,fi.set(t,M),Ft(M,n)}else Tc(t),L()}else Z("Invalid template ref type:",l,`(${typeof l})`)}}function Tc(t){const e=fi.get(t);e&&(e.flags|=8,fi.delete(t))}ks().requestIdleCallback;ks().cancelIdleCallback;const Eo=t=>!!t.type.__asyncLoader,Cs=t=>t.type.__isKeepAlive;function Vm(t,e){cf(t,"a",e)}function Wm(t,e){cf(t,"da",e)}function cf(t,e,n=At){const r=t.__wdc||(t.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return t()});if(Mi(e,r,n),n){let o=n.parent;for(;o&&o.parent;)Cs(o.parent.vnode)&&qm(r,e,n,o),o=o.parent}}function qm(t,e,n,r){const o=Mi(e,t,r,!0);Ni(()=>{ml(r[e],o)},n)}function Mi(t,e,n=At,r=!1){if(n){const o=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...s)=>{gn();const a=Rs(n),l=_n(e,n,t,s);return a(),vn(),l});return r?o.unshift(i):o.push(i),i}else{const o=Vr(Il[t].replace(/ hook$/,""));Z(`${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const rr=t=>(e,n=At)=>{(!gs||t==="sp")&&Mi(t,(...r)=>e(...r),n)},Gm=rr("bm"),Ar=rr("m"),Km=rr("bu"),zm=rr("u"),Rr=rr("bum"),Ni=rr("um"),Jm=rr("sp"),Ym=rr("rtg"),Qm=rr("rtc");function Xm(t,e=At){Mi("ec",t,e)}const Zm="components",uf=Symbol.for("v-ndc");function eg(t){return bt(t)?tg(Zm,t,!1)||t:t||uf}function tg(t,e,n=!0,r=!1){const o=Rt||At;if(o){const i=o.type;{const a=Nl(i,!1);if(a&&(a===e||a===Nt(e)||a===ro(Nt(e))))return i}const s=Sc(o[t]||i[t],e)||Sc(o.appContext[t],e);return!s&&r?i:(n&&!s&&Z(`Failed to resolve ${t.slice(0,-1)}: ${e}
|
|
17
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),s)}else Z(`resolve${ro(t.slice(0,-1))} can only be used in render() or setup().`)}function Sc(t,e){return t&&(t[e]||t[Nt(e)]||t[ro(Nt(e))])}function Tt(t,e,n,r){let o;const i=n,s=xe(t);if(s||bt(t)){const a=s&&kr(t);let l=!1,d=!1;a&&(l=!Gt(t),d=yn(t),t=Ai(t)),o=new Array(t.length);for(let u=0,c=t.length;u<c;u++)o[u]=e(l?d?Oo(bn(t[u])):bn(t[u]):t[u],u,void 0,i)}else if(typeof t=="number")if(!Number.isInteger(t)||t<0)Z(`The v-for range expects a positive integer value but got ${t}.`),o=[];else{o=new Array(t);for(let a=0;a<t;a++)o[a]=e(a+1,a,void 0,i)}else if(Ye(t))if(t[Symbol.iterator])o=Array.from(t,(a,l)=>e(a,l,void 0,i));else{const a=Object.keys(t);o=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];o[l]=e(t[u],u,l,i)}}else o=[];return o}function Mn(t,e,n={},r,o){if(Rt.ce||Rt.parent&&Eo(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return e!=="default"&&(n.name=e),T(),vt(je,null,[Ce("slot",n,r)],d?-2:64)}let i=t[e];i&&i.length>1&&(Z("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),i=()=>[]),i&&i._c&&(i._d=!1),T();const s=i&&df(i(n)),a=n.key||s&&s.key,l=vt(je,{key:(a&&!pn(a)?a:`_${e}`)+(!s&&r?"_fb":"")},s||[],s&&t._===1?64:-2);return i&&i._c&&(i._d=!0),l}function df(t){return t.some(e=>io(e)?!(e.type===It||e.type===je&&!df(e.children)):!0)?t:null}const Ha=t=>t?Nf(t)?Li(t):Ha(t.parent):null,to=St(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>On(t.props),$attrs:t=>On(t.attrs),$slots:t=>On(t.slots),$refs:t=>On(t.refs),$parent:t=>Ha(t.parent),$root:t=>Ha(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>pf(t),$forceUpdate:t=>t.f||(t.f=()=>{Oi(t.update)}),$nextTick:t=>t.n||(t.n=en.bind(t.proxy)),$watch:t=>Um.bind(t)}),Rl=t=>t==="_"||t==="$",Xi=(t,e)=>t!==st&&!t.__isScriptSetup&&Qe(t,e),ff={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:s,type:a,appContext:l}=t;if(e==="__isVue")return!0;if(e[0]!=="$"){const h=s[e];if(h!==void 0)switch(h){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return i[e]}else{if(Xi(r,e))return s[e]=1,r[e];if(o!==st&&Qe(o,e))return s[e]=2,o[e];if(Qe(i,e))return s[e]=3,i[e];if(n!==st&&Qe(n,e))return s[e]=4,n[e];$a&&(s[e]=0)}}const d=to[e];let u,c;if(d)return e==="$attrs"?(Mt(t.attrs,"get",""),pi()):e==="$slots"&&Mt(t,"get",e),d(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==st&&Qe(n,e))return s[e]=4,n[e];if(c=l.config.globalProperties,Qe(c,e))return c[e];Rt&&(!bt(e)||e.indexOf("__v")!==0)&&(o!==st&&Rl(e[0])&&Qe(o,e)?Z(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===Rt&&Z(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:t},e,n){const{data:r,setupState:o,ctx:i}=t;return Xi(o,e)?(o[e]=n,!0):o.__isScriptSetup&&Qe(o,e)?(Z(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==st&&Qe(r,e)?(r[e]=n,!0):Qe(t.props,e)?(Z(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in t?(Z(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(e in t.appContext.config.globalProperties?Object.defineProperty(i,e,{enumerable:!0,configurable:!0,value:n}):i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,props:i,type:s}},a){let l;return!!(n[a]||t!==st&&a[0]!=="$"&&Qe(t,a)||Xi(e,a)||Qe(i,a)||Qe(r,a)||Qe(to,a)||Qe(o.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Qe(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};ff.ownKeys=t=>(Z("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(t));function ng(t){const e={};return Object.defineProperty(e,"_",{configurable:!0,enumerable:!1,get:()=>t}),Object.keys(to).forEach(n=>{Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:()=>to[n](t),set:Bt})}),e}function rg(t){const{ctx:e,propsOptions:[n]}=t;n&&Object.keys(n).forEach(r=>{Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>t.props[r],set:Bt})})}function og(t){const{ctx:e,setupState:n}=t;Object.keys(We(n)).forEach(r=>{if(!n.__isScriptSetup){if(Rl(r[0])){Z(`setup() return property ${JSON.stringify(r)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>n[r],set:Bt})}})}function sg(){return ig("useSlots").slots}function ig(t){const e=Fo();return e||Z(`${t}() called without active instance.`),e.setupContext||(e.setupContext=Lf(e))}function kc(t){return xe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function ag(){const t=Object.create(null);return(e,n)=>{t[n]?Z(`${e} property "${n}" is already defined in ${t[n]}.`):t[n]=e}}let $a=!0;function lg(t){const e=pf(t),n=t.proxy,r=t.ctx;$a=!1,e.beforeCreate&&Ic(e.beforeCreate,t,"bc");const{data:o,computed:i,methods:s,watch:a,provide:l,inject:d,created:u,beforeMount:c,mounted:h,beforeUpdate:b,updated:E,activated:C,deactivated:W,beforeDestroy:L,beforeUnmount:M,destroyed:H,unmounted:X,render:U,renderTracked:Q,renderTriggered:re,errorCaptured:me,serverPrefetch:z,expose:te,inheritAttrs:Ae,components:q,directives:ye,filters:Re}=e,Ue=ag();{const[ae]=t.propsOptions;if(ae)for(const ke in ae)Ue("Props",ke)}if(d&&cg(d,r,Ue),s)for(const ae in s){const ke=s[ae];Ne(ke)?(Object.defineProperty(r,ae,{value:ke.bind(n),configurable:!0,enumerable:!0,writable:!0}),Ue("Methods",ae)):Z(`Method "${ae}" has type "${typeof ke}" in the component definition. Did you reference the function correctly?`)}if(o){Ne(o)||Z("The data option must be a function. Plain object usage is no longer supported.");const ae=o.call(n,n);if(gl(ae)&&Z("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!Ye(ae))Z("data() should return an object.");else{t.data=xi(ae);for(const ke in ae)Ue("Data",ke),Rl(ke[0])||Object.defineProperty(r,ke,{configurable:!0,enumerable:!0,get:()=>ae[ke],set:Bt})}}if($a=!0,i)for(const ae in i){const ke=i[ae],it=Ne(ke)?ke.bind(n,n):Ne(ke.get)?ke.get.bind(n,n):Bt;it===Bt&&Z(`Computed property "${ae}" has no getter.`);const Xe=!Ne(ke)&&Ne(ke.set)?ke.set.bind(n):()=>{Z(`Write operation failed: computed property "${ae}" is readonly.`)},ze=ce({get:it,set:Xe});Object.defineProperty(r,ae,{enumerable:!0,configurable:!0,get:()=>ze.value,set:at=>ze.value=at}),Ue("Computed",ae)}if(a)for(const ae in a)hf(a[ae],r,n,ae);if(l){const ae=Ne(l)?l.call(n):l;Reflect.ownKeys(ae).forEach(ke=>{Js(ke,ae[ke])})}u&&Ic(u,t,"c");function Ve(ae,ke){xe(ke)?ke.forEach(it=>ae(it.bind(n))):ke&&ae(ke.bind(n))}if(Ve(Gm,c),Ve(Ar,h),Ve(Km,b),Ve(zm,E),Ve(Vm,C),Ve(Wm,W),Ve(Xm,me),Ve(Qm,Q),Ve(Ym,re),Ve(Rr,M),Ve(Ni,X),Ve(Jm,z),xe(te))if(te.length){const ae=t.exposed||(t.exposed={});te.forEach(ke=>{Object.defineProperty(ae,ke,{get:()=>n[ke],set:it=>n[ke]=it,enumerable:!0})})}else t.exposed||(t.exposed={});U&&t.render===Bt&&(t.render=U),Ae!=null&&(t.inheritAttrs=Ae),q&&(t.components=q),ye&&(t.directives=ye),z&&lf(t)}function cg(t,e,n=Bt){xe(t)&&(t=Va(t));for(const r in t){const o=t[r];let i;Ye(o)?"default"in o?i=fn(o.from||r,o.default,!0):i=fn(o.from||r):i=fn(o),xt(i)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[r]=i,n("Inject",r)}}function Ic(t,e,n){_n(xe(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function hf(t,e,n,r){let o=r.includes(".")?Xd(n,r):()=>n[r];if(bt(t)){const i=e[t];Ne(i)?yt(o,i):Z(`Invalid watch handler specified by key "${t}"`,i)}else if(Ne(t))yt(o,t.bind(n));else if(Ye(t))if(xe(t))t.forEach(i=>hf(i,e,n,r));else{const i=Ne(t.handler)?t.handler.bind(n):e[t.handler];Ne(i)?yt(o,i,t):Z(`Invalid watch handler specified by key "${t.handler}"`,i)}else Z(`Invalid watch option: "${r}"`,t)}function pf(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=t.appContext,a=i.get(e);let l;return a?l=a:!o.length&&!n&&!r?l=e:(l={},o.length&&o.forEach(d=>hi(l,d,s,!0)),hi(l,e,s)),Ye(e)&&i.set(e,l),l}function hi(t,e,n,r=!1){const{mixins:o,extends:i}=e;i&&hi(t,i,n,!0),o&&o.forEach(s=>hi(t,s,n,!0));for(const s in e)if(r&&s==="expose")Z('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=ug[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const ug={data:Ec,props:Cc,emits:Cc,methods:ns,computed:ns,beforeCreate:$t,created:$t,beforeMount:$t,mounted:$t,beforeUpdate:$t,updated:$t,beforeDestroy:$t,beforeUnmount:$t,destroyed:$t,unmounted:$t,activated:$t,deactivated:$t,errorCaptured:$t,serverPrefetch:$t,components:ns,directives:ns,watch:fg,provide:Ec,inject:dg};function Ec(t,e){return e?t?function(){return St(Ne(t)?t.call(this,this):t,Ne(e)?e.call(this,this):e)}:e:t}function dg(t,e){return ns(Va(t),Va(e))}function Va(t){if(xe(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function $t(t,e){return t?[...new Set([].concat(t,e))]:e}function ns(t,e){return t?St(Object.create(null),t,e):e}function Cc(t,e){return t?xe(t)&&xe(e)?[...new Set([...t,...e])]:St(Object.create(null),kc(t),kc(e??{})):e}function fg(t,e){if(!t)return e;if(!e)return t;const n=St(Object.create(null),t);for(const r in e)n[r]=$t(t[r],e[r]);return n}function mf(){return{app:null,config:{isNativeTag:pd,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let hg=0;function pg(t,e){return function(r,o=null){Ne(r)||(r=St({},r)),o!=null&&!Ye(o)&&(Z("root props passed to app.mount() must be an object."),o=null);const i=mf(),s=new WeakSet,a=[];let l=!1;const d=i.app={_uid:hg++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:jc,get config(){return i.config},set config(u){Z("app.config cannot be replaced. Modify individual options instead.")},use(u,...c){return s.has(u)?Z("Plugin has already been applied to target app."):u&&Ne(u.install)?(s.add(u),u.install(d,...c)):Ne(u)?(s.add(u),u(d,...c)):Z('A plugin must either be a function or an object with an "install" function.'),d},mixin(u){return i.mixins.includes(u)?Z("Mixin has already been applied to target app"+(u.name?`: ${u.name}`:"")):i.mixins.push(u),d},component(u,c){return Ja(u,i.config),c?(i.components[u]&&Z(`Component "${u}" has already been registered in target app.`),i.components[u]=c,d):i.components[u]},directive(u,c){return Qd(u),c?(i.directives[u]&&Z(`Directive "${u}" has already been registered in target app.`),i.directives[u]=c,d):i.directives[u]},mount(u,c,h){if(l)Z("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{u.__vue_app__&&Z("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const b=d._ceVNode||Ce(r,o);return b.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),i.reload=()=>{const E=Dn(b);E.el=null,t(E,u,h)},t(b,u,h),l=!0,d._container=u,u.__vue_app__=d,d._instance=b.component,Cm(d,jc),Li(b.component)}},onUnmount(u){typeof u!="function"&&Z(`Expected function as first argument to app.onUnmount(), but got ${typeof u}`),a.push(u)},unmount(){l?(_n(a,d._instance,16),t(null,d._container),d._instance=null,Am(d),delete d._container.__vue_app__):Z("Cannot unmount an app that is not mounted.")},provide(u,c){return u in i.provides&&(Qe(i.provides,u)?Z(`App already provides property with key "${String(u)}". It will be overwritten with the new value.`):Z(`App already provides property with key "${String(u)}" inherited from its parent element. It will be overwritten with the new value.`)),i.provides[u]=c,d},runWithContext(u){const c=Co;Co=d;try{return u()}finally{Co=c}}};return d}}let Co=null;const mg=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Nt(e)}Modifiers`]||t[`${Qn(e)}Modifiers`];function gg(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||st;{const{emitsOptions:u,propsOptions:[c]}=t;if(u)if(!(e in u))(!c||!(Vr(Nt(e))in c))&&Z(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${Vr(Nt(e))}" prop.`);else{const h=u[e];Ne(h)&&(h(...n)||Z(`Invalid event arguments: event validation failed for event "${e}".`))}}let o=n;const i=e.startsWith("update:"),s=i&&mg(r,e.slice(7));s&&(s.trim&&(o=n.map(u=>bt(u)?u.trim():u)),s.number&&(o=n.map(bl))),Nm(t,e,o);{const u=e.toLowerCase();u!==e&&r[Vr(u)]&&Z(`Event "${u}" is emitted in component ${xs(t,t.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Qn(e)}" instead of "${e}".`)}let a,l=r[a=Vr(e)]||r[a=Vr(Nt(e))];!l&&i&&(l=r[a=Vr(Qn(e))]),l&&_n(l,t,6,o);const d=r[a+"Once"];if(d){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,_n(d,t,6,o)}}const vg=new WeakMap;function gf(t,e,n=!1){const r=n?vg:e.emitsCache,o=r.get(t);if(o!==void 0)return o;const i=t.emits;let s={},a=!1;if(!Ne(t)){const l=d=>{const u=gf(d,e,!0);u&&(a=!0,St(s,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(Ye(t)&&r.set(t,null),null):(xe(i)?i.forEach(l=>s[l]=null):St(s,i),Ye(t)&&r.set(t,s),s)}function Di(t,e){return!t||!Ts(e)?!1:(e=e.slice(2).replace(/Once$/,""),Qe(t,e[0].toLowerCase()+e.slice(1))||Qe(t,Qn(e))||Qe(t,e))}let Wa=!1;function pi(){Wa=!0}function Ac(t){const{type:e,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:s,attrs:a,emit:l,render:d,renderCache:u,props:c,data:h,setupState:b,ctx:E,inheritAttrs:C}=t,W=ui(t);let L,M;Wa=!1;try{if(n.shapeFlag&4){const U=o||r,Q=b.__isScriptSetup?new Proxy(U,{get(re,me,z){return Z(`Property '${String(me)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(re,me,z)}}):U;L=ln(d.call(Q,U,u,On(c),b,h,E)),M=a}else{const U=e;a===c&&pi(),L=ln(U.length>1?U(On(c),{get attrs(){return pi(),On(a)},slots:s,emit:l}):U(On(c),null)),M=e.props?a:yg(a)}}catch(U){as.length=0,Is(U,t,1),L=Ce(It)}let H=L,X;if(L.patchFlag>0&&L.patchFlag&2048&&([H,X]=vf(L)),M&&C!==!1){const U=Object.keys(M),{shapeFlag:Q}=H;if(U.length){if(Q&7)i&&U.some(oi)&&(M=bg(M,i)),H=Dn(H,M,!1,!0);else if(!Wa&&H.type!==It){const re=Object.keys(a),me=[],z=[];for(let te=0,Ae=re.length;te<Ae;te++){const q=re[te];Ts(q)?oi(q)||me.push(q[2].toLowerCase()+q.slice(3)):z.push(q)}z.length&&Z(`Extraneous non-props attributes (${z.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),me.length&&Z(`Extraneous non-emits event listeners (${me.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(Rc(H)||Z("Runtime directive used on component with non-element root node. The directives will not function as intended."),H=Dn(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(n.dirs):n.dirs),n.transition&&(Rc(H)||Z("Component inside <Transition> renders non-element root node that cannot be animated."),ps(H,n.transition)),X?X(H):L=H,ui(W),L}const vf=t=>{const e=t.children,n=t.dynamicChildren,r=xl(e,!1);if(r){if(r.patchFlag>0&&r.patchFlag&2048)return vf(r)}else return[t,void 0];const o=e.indexOf(r),i=n?n.indexOf(r):-1,s=a=>{e[o]=a,n&&(i>-1?n[i]=a:a.patchFlag>0&&(t.dynamicChildren=[...n,a]))};return[ln(r),s]};function xl(t,e=!0){let n;for(let r=0;r<t.length;r++){const o=t[r];if(io(o)){if(o.type!==It||o.children==="v-if"){if(n)return;if(n=o,e&&n.patchFlag>0&&n.patchFlag&2048)return xl(n.children)}}else return}return n}const yg=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ts(n))&&((e||(e={}))[n]=t[n]);return e},bg=(t,e)=>{const n={};for(const r in t)(!oi(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n},Rc=t=>t.shapeFlag&7||t.type===It;function _g(t,e,n){const{props:r,children:o,component:i}=t,{props:s,children:a,patchFlag:l}=e,d=i.emitsOptions;if((o||a)&&cn||e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?xc(r,s,d):!!s;if(l&8){const u=e.dynamicProps;for(let c=0;c<u.length;c++){const h=u[c];if(yf(s,r,h)&&!Di(d,h))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===s?!1:r?s?xc(r,s,d):!0:!!s;return!1}function xc(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(yf(e,t,i)&&!Di(n,i))return!0}return!1}function yf(t,e,n){const r=t[n],o=e[n];return n==="style"&&Ye(r)&&Ye(o)?!_l(r,o):r!==o}function wg({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const bf={},_f=()=>Object.create(bf),wf=t=>Object.getPrototypeOf(t)===bf;function Tg(t,e,n,r=!1){const o={},i=_f();t.propsDefaults=Object.create(null),Tf(t,e,o,i);for(const s in t.propsOptions[0])s in o||(o[s]=void 0);kf(e||{},o,t),n?t.props=r?o:jd(o):t.type.props?t.props=o:t.props=i,t.attrs=i}function Sg(t){for(;t;){if(t.type.__hmrId)return!0;t=t.parent}}function kg(t,e,n,r){const{props:o,attrs:i,vnode:{patchFlag:s}}=t,a=We(o),[l]=t.propsOptions;let d=!1;if(!Sg(t)&&(r||s>0)&&!(s&16)){if(s&8){const u=t.vnode.dynamicProps;for(let c=0;c<u.length;c++){let h=u[c];if(Di(t.emitsOptions,h))continue;const b=e[h];if(l)if(Qe(i,h))b!==i[h]&&(i[h]=b,d=!0);else{const E=Nt(h);o[E]=qa(l,a,E,b,t,!1)}else b!==i[h]&&(i[h]=b,d=!0)}}}else{Tf(t,e,o,i)&&(d=!0);let u;for(const c in a)(!e||!Qe(e,c)&&((u=Qn(c))===c||!Qe(e,u)))&&(l?n&&(n[c]!==void 0||n[u]!==void 0)&&(o[c]=qa(l,a,c,void 0,t,!0)):delete o[c]);if(i!==a)for(const c in i)(!e||!Qe(e,c))&&(delete i[c],d=!0)}d&&An(t.attrs,"set",""),kf(e||{},o,t)}function Tf(t,e,n,r){const[o,i]=t.propsOptions;let s=!1,a;if(e)for(let l in e){if(rs(l))continue;const d=e[l];let u;o&&Qe(o,u=Nt(l))?!i||!i.includes(u)?n[u]=d:(a||(a={}))[u]=d:Di(t.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,s=!0)}if(i){const l=We(n),d=a||st;for(let u=0;u<i.length;u++){const c=i[u];n[c]=qa(o,l,c,d[c],t,!Qe(d,c))}}return s}function qa(t,e,n,r,o,i){const s=t[n];if(s!=null){const a=Qe(s,"default");if(a&&r===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&Ne(l)){const{propsDefaults:d}=o;if(n in d)r=d[n];else{const u=Rs(o);r=d[n]=l.call(null,e),u()}}else r=l;o.ce&&o.ce._setProp(n,r)}s[0]&&(i&&!a?r=!1:s[1]&&(r===""||r===Qn(n))&&(r=!0))}return r}const Ig=new WeakMap;function Sf(t,e,n=!1){const r=n?Ig:e.propsCache,o=r.get(t);if(o)return o;const i=t.props,s={},a=[];let l=!1;if(!Ne(t)){const u=c=>{l=!0;const[h,b]=Sf(c,e,!0);St(s,h),b&&a.push(...b)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!l)return Ye(t)&&r.set(t,ko),ko;if(xe(i))for(let u=0;u<i.length;u++){bt(i[u])||Z("props must be strings when using array syntax.",i[u]);const c=Nt(i[u]);Pc(c)&&(s[c]=st)}else if(i){Ye(i)||Z("invalid props options",i);for(const u in i){const c=Nt(u);if(Pc(c)){const h=i[u],b=s[c]=xe(h)||Ne(h)?{type:h}:St({},h),E=b.type;let C=!1,W=!0;if(xe(E))for(let L=0;L<E.length;++L){const M=E[L],H=Ne(M)&&M.name;if(H==="Boolean"){C=!0;break}else H==="String"&&(W=!1)}else C=Ne(E)&&E.name==="Boolean";b[0]=C,b[1]=W,(C||Qe(b,"default"))&&a.push(c)}}}const d=[s,a];return Ye(t)&&r.set(t,d),d}function Pc(t){return t[0]!=="$"&&!rs(t)?!0:(Z(`Invalid prop name: "${t}" is a reserved property.`),!1)}function Eg(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function kf(t,e,n){const r=We(e),o=n.propsOptions[0],i=Object.keys(t).map(s=>Nt(s));for(const s in o){let a=o[s];a!=null&&Cg(s,r[s],a,On(r),!i.includes(s))}}function Cg(t,e,n,r,o){const{type:i,required:s,validator:a,skipCheck:l}=n;if(s&&o){Z('Missing required prop: "'+t+'"');return}if(!(e==null&&!s)){if(i!=null&&i!==!0&&!l){let d=!1;const u=xe(i)?i:[i],c=[];for(let h=0;h<u.length&&!d;h++){const{valid:b,expectedType:E}=Rg(e,u[h]);c.push(E||""),d=b}if(!d){Z(xg(t,e,c));return}}a&&!a(e,r)&&Z('Invalid prop: custom validator check failed for prop "'+t+'".')}}const Ag=nr("String,Number,Boolean,Function,Symbol,BigInt");function Rg(t,e){let n;const r=Eg(e);if(r==="null")n=t===null;else if(Ag(r)){const o=typeof t;n=o===r.toLowerCase(),!n&&o==="object"&&(n=t instanceof e)}else r==="Object"?n=Ye(t):r==="Array"?n=xe(t):n=t instanceof e;return{valid:n,expectedType:r}}function xg(t,e,n){if(n.length===0)return`Prop type [] for prop "${t}" won't match anything. Did you mean to use type Array instead?`;let r=`Invalid prop: type check failed for prop "${t}". Expected ${n.map(ro).join(" | ")}`;const o=n[0],i=vl(e),s=Oc(e,o),a=Oc(e,i);return n.length===1&&Mc(o)&&!Pg(o,i)&&(r+=` with value ${s}`),r+=`, got ${i} `,Mc(i)&&(r+=`with value ${a}.`),r}function Oc(t,e){return e==="String"?`"${t}"`:e==="Number"?`${Number(t)}`:`${t}`}function Mc(t){return["string","number","boolean"].some(n=>t.toLowerCase()===n)}function Pg(...t){return t.some(e=>e.toLowerCase()==="boolean")}const Pl=t=>t==="_"||t==="_ctx"||t==="$stable",Ol=t=>xe(t)?t.map(ln):[ln(t)],Og=(t,e,n)=>{if(e._n)return e;const r=lt((...o)=>(At&&!(n===null&&Rt)&&!(n&&n.root!==At.root)&&Z(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),Ol(e(...o))),n);return r._c=!1,r},If=(t,e,n)=>{const r=t._ctx;for(const o in t){if(Pl(o))continue;const i=t[o];if(Ne(i))e[o]=Og(o,i,r);else if(i!=null){Z(`Non-function value encountered for slot "${o}". Prefer function slots for better performance.`);const s=Ol(i);e[o]=()=>s}}},Ef=(t,e)=>{Cs(t.vnode)||Z("Non-function value encountered for default slot. Prefer function slots for better performance.");const n=Ol(e);t.slots.default=()=>n},Ga=(t,e,n)=>{for(const r in e)(n||!Pl(r))&&(t[r]=e[r])},Mg=(t,e,n)=>{const r=t.slots=_f();if(t.vnode.shapeFlag&32){const o=e._;o?(Ga(r,e,n),n&&si(r,"_",o,!0)):If(e,r)}else e&&Ef(t,e)},Ng=(t,e,n)=>{const{vnode:r,slots:o}=t;let i=!0,s=st;if(r.shapeFlag&32){const a=e._;a?cn?(Ga(o,e,n),An(t,"set","$slots")):n&&a===1?i=!1:Ga(o,e,n):(i=!e.$stable,If(e,o)),s=e}else e&&(Ef(t,e),s={default:1});if(i)for(const a in o)!Pl(a)&&s[a]==null&&delete o[a]};let zo,Vn;function vo(t,e){t.appContext.config.performance&&mi()&&Vn.mark(`vue-${e}-${t.uid}`),Om(t,e,mi()?Vn.now():Date.now())}function yo(t,e){if(t.appContext.config.performance&&mi()){const n=`vue-${e}-${t.uid}`,r=n+":end",o=`<${xs(t,t.type)}> ${e}`;Vn.mark(r),Vn.measure(o,n,r),Vn.clearMeasures(o),Vn.clearMarks(n),Vn.clearMarks(r)}Mm(t,e,mi()?Vn.now():Date.now())}function mi(){return zo!==void 0||(typeof window<"u"&&window.performance?(zo=!0,Vn=window.performance):zo=!1),zo}function Dg(){const t=[];if(t.length){const e=t.length>1;console.warn(`Feature flag${e?"s":""} ${t.join(", ")} ${e?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
18
|
-
|
|
19
|
-
For more details, see https://link.vuejs.org/feature-flags.`)}}const Ft=Bg;function Lg(t){return jg(t)}function jg(t,e){Dg();const n=ks();n.__VUE__=!0,Kd(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:o,patchProp:i,createElement:s,createText:a,createComment:l,setText:d,setElementText:u,parentNode:c,nextSibling:h,setScopeId:b=Bt,insertStaticContent:E}=t,C=(p,v,y,A=null,R=null,P=null,$=void 0,V=null,J=cn?!1:!!v.dynamicChildren)=>{if(p===v)return;p&&!Gr(p,v)&&(A=oe(p),Fe(p,R,P,!0),p=null),v.patchFlag===-2&&(J=!1,v.dynamicChildren=null);const{type:B,ref:pe,shapeFlag:ee}=v;switch(B){case As:W(p,v,y,A);break;case It:L(p,v,y,A);break;case Qs:p==null?M(v,y,A,$):H(p,v,y,$);break;case je:ye(p,v,y,A,R,P,$,V,J);break;default:ee&1?Q(p,v,y,A,R,P,$,V,J):ee&6?Re(p,v,y,A,R,P,$,V,J):ee&64||ee&128?B.process(p,v,y,A,R,P,$,V,J,be):Z("Invalid VNode type:",B,`(${typeof B})`)}pe!=null&&R?is(pe,p&&p.ref,P,v||p,!v):pe==null&&p&&p.ref!=null&&is(p.ref,null,P,p,!0)},W=(p,v,y,A)=>{if(p==null)r(v.el=a(v.children),y,A);else{const R=v.el=p.el;v.children!==p.children&&d(R,v.children)}},L=(p,v,y,A)=>{p==null?r(v.el=l(v.children||""),y,A):v.el=p.el},M=(p,v,y,A)=>{[p.el,p.anchor]=E(p.children,v,y,A,p.el,p.anchor)},H=(p,v,y,A)=>{if(v.children!==p.children){const R=h(p.anchor);U(p),[v.el,v.anchor]=E(v.children,y,R,A)}else v.el=p.el,v.anchor=p.anchor},X=({el:p,anchor:v},y,A)=>{let R;for(;p&&p!==v;)R=h(p),r(p,y,A),p=R;r(v,y,A)},U=({el:p,anchor:v})=>{let y;for(;p&&p!==v;)y=h(p),o(p),p=y;o(v)},Q=(p,v,y,A,R,P,$,V,J)=>{if(v.type==="svg"?$="svg":v.type==="math"&&($="mathml"),p==null)re(v,y,A,R,P,$,V,J);else{const B=p.el&&p.el._isVueCE?p.el:null;try{B&&B._beginPatch(),te(p,v,R,P,$,V,J)}finally{B&&B._endPatch()}}},re=(p,v,y,A,R,P,$,V)=>{let J,B;const{props:pe,shapeFlag:ee,transition:de,dirs:Ee}=p;if(J=p.el=s(p.type,P,pe&&pe.is,pe),ee&8?u(J,p.children):ee&16&&z(p.children,J,null,A,R,Zi(p,P),$,V),Ee&&Fr(p,null,A,"created"),me(J,p,p.scopeId,$,A),pe){for(const Me in pe)Me!=="value"&&!rs(Me)&&i(J,Me,null,pe[Me],P,A);"value"in pe&&i(J,"value",null,pe.value,P),(B=pe.onVnodeBeforeMount)&&Sn(B,A,p)}si(J,"__vnode",p,!0),si(J,"__vueParentComponent",A,!0),Ee&&Fr(p,null,A,"beforeMount");const Oe=Ug(R,de);Oe&&de.beforeEnter(J),r(J,v,y),((B=pe&&pe.onVnodeMounted)||Oe||Ee)&&Ft(()=>{B&&Sn(B,A,p),Oe&&de.enter(J),Ee&&Fr(p,null,A,"mounted")},R)},me=(p,v,y,A,R)=>{if(y&&b(p,y),A)for(let P=0;P<A.length;P++)b(p,A[P]);if(R){let P=R.subTree;if(P.patchFlag>0&&P.patchFlag&2048&&(P=xl(P.children)||P),v===P||Rf(P.type)&&(P.ssContent===v||P.ssFallback===v)){const $=R.vnode;me(p,$,$.scopeId,$.slotScopeIds,R.parent)}}},z=(p,v,y,A,R,P,$,V,J=0)=>{for(let B=J;B<p.length;B++){const pe=p[B]=V?Wn(p[B]):ln(p[B]);C(null,pe,v,y,A,R,P,$,V)}},te=(p,v,y,A,R,P,$)=>{const V=v.el=p.el;V.__vnode=v;let{patchFlag:J,dynamicChildren:B,dirs:pe}=v;J|=p.patchFlag&16;const ee=p.props||st,de=v.props||st;let Ee;if(y&&Br(y,!1),(Ee=de.onVnodeBeforeUpdate)&&Sn(Ee,y,v,p),pe&&Fr(v,p,y,"beforeUpdate"),y&&Br(y,!0),cn&&(J=0,$=!1,B=null),(ee.innerHTML&&de.innerHTML==null||ee.textContent&&de.textContent==null)&&u(V,""),B?(Ae(p.dynamicChildren,B,V,y,A,Zi(v,R),P),gi(p,v)):$||it(p,v,V,null,y,A,Zi(v,R),P,!1),J>0){if(J&16)q(V,ee,de,y,R);else if(J&2&&ee.class!==de.class&&i(V,"class",null,de.class,R),J&4&&i(V,"style",ee.style,de.style,R),J&8){const Oe=v.dynamicProps;for(let Me=0;Me<Oe.length;Me++){const Ke=Oe[Me],Ze=ee[Ke],pt=de[Ke];(pt!==Ze||Ke==="value")&&i(V,Ke,Ze,pt,R,y)}}J&1&&p.children!==v.children&&u(V,v.children)}else!$&&B==null&&q(V,ee,de,y,R);((Ee=de.onVnodeUpdated)||pe)&&Ft(()=>{Ee&&Sn(Ee,y,v,p),pe&&Fr(v,p,y,"updated")},A)},Ae=(p,v,y,A,R,P,$)=>{for(let V=0;V<v.length;V++){const J=p[V],B=v[V],pe=J.el&&(J.type===je||!Gr(J,B)||J.shapeFlag&198)?c(J.el):y;C(J,B,pe,null,A,R,P,$,!0)}},q=(p,v,y,A,R)=>{if(v!==y){if(v!==st)for(const P in v)!rs(P)&&!(P in y)&&i(p,P,v[P],null,R,A);for(const P in y){if(rs(P))continue;const $=y[P],V=v[P];$!==V&&P!=="value"&&i(p,P,V,$,R,A)}"value"in y&&i(p,"value",v.value,y.value,R)}},ye=(p,v,y,A,R,P,$,V,J)=>{const B=v.el=p?p.el:a(""),pe=v.anchor=p?p.anchor:a("");let{patchFlag:ee,dynamicChildren:de,slotScopeIds:Ee}=v;(cn||ee&2048)&&(ee=0,J=!1,de=null),Ee&&(V=V?V.concat(Ee):Ee),p==null?(r(B,y,A),r(pe,y,A),z(v.children||[],y,pe,R,P,$,V,J)):ee>0&&ee&64&&de&&p.dynamicChildren&&p.dynamicChildren.length===de.length?(Ae(p.dynamicChildren,de,y,R,P,$,V),gi(p,v)):it(p,v,y,pe,R,P,$,V,J)},Re=(p,v,y,A,R,P,$,V,J)=>{v.slotScopeIds=V,p==null?v.shapeFlag&512?R.ctx.activate(v,y,A,$,J):Ue(v,y,A,R,P,$,J):Ve(p,v,J)},Ue=(p,v,y,A,R,P,$)=>{const V=p.component=Kg(p,A,R);if(V.type.__hmrId&&Sm(V),Gs(p),vo(V,"mount"),Cs(p)&&(V.ctx.renderer=be),vo(V,"init"),Jg(V,!1,$),yo(V,"init"),cn&&(p.el=null),V.asyncDep){if(R&&R.registerDep(V,ae,$),!p.el){const J=V.subTree=Ce(It);L(null,J,v,y),p.placeholder=J.el}}else ae(V,p,v,y,R,P,$);Ks(),yo(V,"mount")},Ve=(p,v,y)=>{const A=v.component=p.component;if(_g(p,v,y))if(A.asyncDep&&!A.asyncResolved){Gs(v),ke(A,v,y),Ks();return}else A.next=v,A.update();else v.el=p.el,A.vnode=v},ae=(p,v,y,A,R,P,$)=>{const V=()=>{if(p.isMounted){let{next:ee,bu:de,u:Ee,parent:Oe,vnode:Me}=p;{const j=Cf(p);if(j){ee&&(ee.el=Me.el,ke(p,ee,$)),j.asyncDep.then(()=>{Ft(()=>{p.isUnmounted||B()},R)});return}}let Ke=ee,Ze;Gs(ee||p.vnode),Br(p,!1),ee?(ee.el=Me.el,ke(p,ee,$)):ee=Me,de&&wo(de),(Ze=ee.props&&ee.props.onVnodeBeforeUpdate)&&Sn(Ze,Oe,ee,Me),Br(p,!0),vo(p,"render");const pt=Ac(p);yo(p,"render");const ct=p.subTree;p.subTree=pt,vo(p,"patch"),C(ct,pt,c(ct.el),oe(ct),p,R,P),yo(p,"patch"),ee.el=pt.el,Ke===null&&wg(p,pt.el),Ee&&Ft(Ee,R),(Ze=ee.props&&ee.props.onVnodeUpdated)&&Ft(()=>Sn(Ze,Oe,ee,Me),R),zd(p),Ks()}else{let ee;const{el:de,props:Ee}=v,{bm:Oe,m:Me,parent:Ke,root:Ze,type:pt}=p,ct=Eo(v);Br(p,!1),Oe&&wo(Oe),!ct&&(ee=Ee&&Ee.onVnodeBeforeMount)&&Sn(ee,Ke,v),Br(p,!0);{Ze.ce&&Ze.ce._hasShadowRoot()&&Ze.ce._injectChildStyle(pt,p.parent?p.parent.type:void 0),vo(p,"render");const j=p.subTree=Ac(p);yo(p,"render"),vo(p,"patch"),C(null,j,y,A,p,R,P),yo(p,"patch"),v.el=j.el}if(Me&&Ft(Me,R),!ct&&(ee=Ee&&Ee.onVnodeMounted)){const j=v;Ft(()=>Sn(ee,Ke,j),R)}(v.shapeFlag&256||Ke&&Eo(Ke.vnode)&&Ke.vnode.shapeFlag&256)&&p.a&&Ft(p.a,R),p.isMounted=!0,Rm(p),v=y=A=null}};p.scope.on();const J=p.effect=new wd(V);p.scope.off();const B=p.update=J.run.bind(J),pe=p.job=J.runIfDirty.bind(J);pe.i=p,pe.id=p.uid,J.scheduler=()=>Oi(pe),Br(p,!0),J.onTrack=p.rtc?ee=>wo(p.rtc,ee):void 0,J.onTrigger=p.rtg?ee=>wo(p.rtg,ee):void 0,B()},ke=(p,v,y)=>{v.component=p;const A=p.vnode.props;p.vnode=v,p.next=null,kg(p,v.props,A,y),Ng(p,v.children,y),gn(),pc(p),vn()},it=(p,v,y,A,R,P,$,V,J=!1)=>{const B=p&&p.children,pe=p?p.shapeFlag:0,ee=v.children,{patchFlag:de,shapeFlag:Ee}=v;if(de>0){if(de&128){ze(B,ee,y,A,R,P,$,V,J);return}else if(de&256){Xe(B,ee,y,A,R,P,$,V,J);return}}Ee&8?(pe&16&&x(B,R,P),ee!==B&&u(y,ee)):pe&16?Ee&16?ze(B,ee,y,A,R,P,$,V,J):x(B,R,P,!0):(pe&8&&u(y,""),Ee&16&&z(ee,y,A,R,P,$,V,J))},Xe=(p,v,y,A,R,P,$,V,J)=>{p=p||ko,v=v||ko;const B=p.length,pe=v.length,ee=Math.min(B,pe);let de;for(de=0;de<ee;de++){const Ee=v[de]=J?Wn(v[de]):ln(v[de]);C(p[de],Ee,y,null,R,P,$,V,J)}B>pe?x(p,R,P,!0,!1,ee):z(v,y,A,R,P,$,V,J,ee)},ze=(p,v,y,A,R,P,$,V,J)=>{let B=0;const pe=v.length;let ee=p.length-1,de=pe-1;for(;B<=ee&&B<=de;){const Ee=p[B],Oe=v[B]=J?Wn(v[B]):ln(v[B]);if(Gr(Ee,Oe))C(Ee,Oe,y,null,R,P,$,V,J);else break;B++}for(;B<=ee&&B<=de;){const Ee=p[ee],Oe=v[de]=J?Wn(v[de]):ln(v[de]);if(Gr(Ee,Oe))C(Ee,Oe,y,null,R,P,$,V,J);else break;ee--,de--}if(B>ee){if(B<=de){const Ee=de+1,Oe=Ee<pe?v[Ee].el:A;for(;B<=de;)C(null,v[B]=J?Wn(v[B]):ln(v[B]),y,Oe,R,P,$,V,J),B++}}else if(B>de)for(;B<=ee;)Fe(p[B],R,P,!0),B++;else{const Ee=B,Oe=B,Me=new Map;for(B=Oe;B<=de;B++){const w=v[B]=J?Wn(v[B]):ln(v[B]);w.key!=null&&(Me.has(w.key)&&Z("Duplicate keys found during update:",JSON.stringify(w.key),"Make sure keys are unique."),Me.set(w.key,B))}let Ke,Ze=0;const pt=de-Oe+1;let ct=!1,j=0;const ne=new Array(pt);for(B=0;B<pt;B++)ne[B]=0;for(B=Ee;B<=ee;B++){const w=p[B];if(Ze>=pt){Fe(w,R,P,!0);continue}let N;if(w.key!=null)N=Me.get(w.key);else for(Ke=Oe;Ke<=de;Ke++)if(ne[Ke-Oe]===0&&Gr(w,v[Ke])){N=Ke;break}N===void 0?Fe(w,R,P,!0):(ne[N-Oe]=B+1,N>=j?j=N:ct=!0,C(w,v[N],y,null,R,P,$,V,J),Ze++)}const we=ct?Fg(ne):ko;for(Ke=we.length-1,B=pt-1;B>=0;B--){const w=Oe+B,N=v[w],le=v[w+1],_e=w+1<pe?le.el||Af(le):A;ne[B]===0?C(null,N,y,_e,R,P,$,V,J):ct&&(Ke<0||B!==we[Ke]?at(N,y,_e,2):Ke--)}}},at=(p,v,y,A,R=null)=>{const{el:P,type:$,transition:V,children:J,shapeFlag:B}=p;if(B&6){at(p.component.subTree,v,y,A);return}if(B&128){p.suspense.move(v,y,A);return}if(B&64){$.move(p,v,y,be);return}if($===je){r(P,v,y);for(let ee=0;ee<J.length;ee++)at(J[ee],v,y,A);r(p.anchor,v,y);return}if($===Qs){X(p,v,y);return}if(A!==2&&B&1&&V)if(A===0)V.beforeEnter(P),r(P,v,y),Ft(()=>V.enter(P),R);else{const{leave:ee,delayLeave:de,afterLeave:Ee}=V,Oe=()=>{p.ctx.isUnmounted?o(P):r(P,v,y)},Me=()=>{P._isLeaving&&P[In](!0),ee(P,()=>{Oe(),Ee&&Ee()})};de?de(P,Oe,Me):Me()}else r(P,v,y)},Fe=(p,v,y,A=!1,R=!1)=>{const{type:P,props:$,ref:V,children:J,dynamicChildren:B,shapeFlag:pe,patchFlag:ee,dirs:de,cacheIndex:Ee}=p;if(ee===-2&&(R=!1),V!=null&&(gn(),is(V,null,y,p,!0),vn()),Ee!=null&&(v.renderCache[Ee]=void 0),pe&256){v.ctx.deactivate(p);return}const Oe=pe&1&&de,Me=!Eo(p);let Ke;if(Me&&(Ke=$&&$.onVnodeBeforeUnmount)&&Sn(Ke,v,p),pe&6)nt(p.component,y,A);else{if(pe&128){p.suspense.unmount(y,A);return}Oe&&Fr(p,null,v,"beforeUnmount"),pe&64?p.type.remove(p,v,y,be,A):B&&!B.hasOnce&&(P!==je||ee>0&&ee&64)?x(B,v,y,!1,!0):(P===je&&ee&384||!R&&pe&16)&&x(J,v,y),A&&ft(p)}(Me&&(Ke=$&&$.onVnodeUnmounted)||Oe)&&Ft(()=>{Ke&&Sn(Ke,v,p),Oe&&Fr(p,null,v,"unmounted")},y)},ft=p=>{const{type:v,el:y,anchor:A,transition:R}=p;if(v===je){p.patchFlag>0&&p.patchFlag&2048&&R&&!R.persisted?p.children.forEach($=>{$.type===It?o($.el):ft($)}):ht(y,A);return}if(v===Qs){U(p);return}const P=()=>{o(y),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(p.shapeFlag&1&&R&&!R.persisted){const{leave:$,delayLeave:V}=R,J=()=>$(y,P);V?V(p.el,P,J):J()}else P()},ht=(p,v)=>{let y;for(;p!==v;)y=h(p),o(p),p=y;o(v)},nt=(p,v,y)=>{p.type.__hmrId&&km(p);const{bum:A,scope:R,job:P,subTree:$,um:V,m:J,a:B}=p;Nc(J),Nc(B),A&&wo(A),R.stop(),P&&(P.flags|=8,Fe($,p,v,y)),V&&Ft(V,v),Ft(()=>{p.isUnmounted=!0},v),Pm(p)},x=(p,v,y,A=!1,R=!1,P=0)=>{for(let $=P;$<p.length;$++)Fe(p[$],v,y,A,R)},oe=p=>{if(p.shapeFlag&6)return oe(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const v=h(p.anchor||p.el),y=v&&v[Zd];return y?h(y):v};let Y=!1;const ue=(p,v,y)=>{let A;p==null?v._vnode&&(Fe(v._vnode,null,null,!0),A=v._vnode.component):C(v._vnode||null,p,v,null,null,null,y),v._vnode=p,Y||(Y=!0,pc(A),Wd(),Y=!1)},be={p:C,um:Fe,m:at,r:ft,mt:Ue,mc:z,pc:it,pbc:Ae,n:oe,o:t};return{render:ue,hydrate:void 0,createApp:pg(ue)}}function Zi({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Br({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Ug(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function gi(t,e,n=!1){const r=t.children,o=e.children;if(xe(r)&&xe(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=Wn(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&gi(s,a)),a.type===As&&(a.patchFlag===-1&&(a=o[i]=Wn(a)),a.el=s.el),a.type===It&&!a.el&&(a.el=s.el),a.el&&(a.el.__vnode=a)}}function Fg(t){const e=t.slice(),n=[0];let r,o,i,s,a;const l=t.length;for(r=0;r<l;r++){const d=t[r];if(d!==0){if(o=n[n.length-1],t[o]<d){e[r]=o,n.push(r);continue}for(i=0,s=n.length-1;i<s;)a=i+s>>1,t[n[a]]<d?i=a+1:s=a;d<t[n[i]]&&(i>0&&(e[r]=n[i-1]),n[i]=r)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=e[s];return n}function Cf(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Cf(e)}function Nc(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function Af(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?Af(e.subTree):null}const Rf=t=>t.__isSuspense;function Bg(t,e){e&&e.pendingBranch?xe(t)?e.effects.push(...t):e.effects.push(t):Vd(t)}const je=Symbol.for("v-fgt"),As=Symbol.for("v-txt"),It=Symbol.for("v-cmt"),Qs=Symbol.for("v-stc"),as=[];let Zt=null;function T(t=!1){as.push(Zt=t?null:[])}function Hg(){as.pop(),Zt=as[as.length-1]||null}let ms=1;function vi(t,e=!1){ms+=t,t<0&&Zt&&e&&(Zt.hasOnce=!0)}function xf(t){return t.dynamicChildren=ms>0?Zt||ko:null,Hg(),ms>0&&Zt&&Zt.push(t),t}function I(t,e,n,r,o,i){return xf(g(t,e,n,r,o,i,!0))}function vt(t,e,n,r,o){return xf(Ce(t,e,n,r,o,!0))}function io(t){return t?t.__v_isVNode===!0:!1}function Gr(t,e){if(e.shapeFlag&6&&t.component){const n=zs.get(e.type);if(n&&n.has(t.component))return t.shapeFlag&=-257,e.shapeFlag&=-513,!1}return t.type===e.type&&t.key===e.key}const $g=(...t)=>Vg(...t),Pf=({key:t})=>t??null,Xs=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?bt(t)||xt(t)||Ne(t)?{i:Rt,r:t,k:e,f:!!n}:t:null);function g(t,e=null,n=null,r=0,o=null,i=t===je?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Pf(e),ref:e&&Xs(e),scopeId:Yd,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:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Rt};return a?(Ml(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=bt(n)?8:16),l.key!==l.key&&Z("VNode created with invalid key (NaN). VNode type:",l.type),ms>0&&!s&&Zt&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&Zt.push(l),l}const Ce=$g;function Vg(t,e=null,n=null,r=0,o=null,i=!1){if((!t||t===uf)&&(t||Z(`Invalid vnode type when creating vnode: ${t}.`),t=It),io(t)){const a=Dn(t,e,!0);return n&&Ml(a,n),ms>0&&!i&&Zt&&(a.shapeFlag&6?Zt[Zt.indexOf(t)]=a:Zt.push(a)),a.patchFlag=-2,a}if(jf(t)&&(t=t.__vccOpts),e){e=Wg(e);let{class:a,style:l}=e;a&&!bt(a)&&(e.class=dt(a)),Ye(l)&&(ii(l)&&!xe(l)&&(l=St({},l)),e.style=oo(l))}const s=bt(t)?1:Rf(t)?128:ef(t)?64:Ye(t)?4:Ne(t)?2:0;return s&4&&ii(t)&&(t=We(t),Z("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
20
|
-
Component that was made reactive: `,t)),g(t,e,n,r,o,s,i,!0)}function Wg(t){return t?ii(t)||wf(t)?St({},t):t:null}function Dn(t,e,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:l}=t,d=e?Mf(o||{},e):o,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&Pf(d),ref:e&&e.ref?n&&i?xe(i)?i.concat(Xs(e)):[i,Xs(e)]:Xs(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:s===-1&&xe(a)?a.map(Of):a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==je?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Dn(t.ssContent),ssFallback:t.ssFallback&&Dn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&ps(u,l.clone(u)),u}function Of(t){const e=Dn(t);return xe(t.children)&&(e.children=t.children.map(Of)),e}function Ka(t=" ",e=0){return Ce(As,null,t,e)}function ie(t="",e=!1){return e?(T(),vt(It,null,t)):Ce(It,null,t)}function ln(t){return t==null||typeof t=="boolean"?Ce(It):xe(t)?Ce(je,null,t.slice()):io(t)?Wn(t):Ce(As,null,String(t))}function Wn(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Dn(t)}function Ml(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(xe(e))n=16;else if(typeof e=="object")if(r&65){const o=e.default;o&&(o._c&&(o._d=!1),Ml(t,o()),o._c&&(o._d=!0));return}else{n=32;const o=e._;!o&&!wf(e)?e._ctx=Rt:o===3&&Rt&&(Rt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Ne(e)?(e={default:e,_ctx:Rt},n=32):(e=String(e),r&64?(n=16,e=[Ka(e)]):n=8);t.children=e,t.shapeFlag|=n}function Mf(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const o in r)if(o==="class")e.class!==r.class&&(e.class=dt([e.class,r.class]));else if(o==="style")e.style=oo([e.style,r.style]);else if(Ts(o)){const i=e[o],s=r[o];s&&i!==s&&!(xe(i)&&i.includes(s))&&(e[o]=i?[].concat(i,s):s)}else o!==""&&(e[o]=r[o])}return e}function Sn(t,e,n,r=null){_n(t,e,7,[n,r])}const qg=mf();let Gg=0;function Kg(t,e,n){const r=t.type,o=(e?e.appContext:t.appContext)||qg,i={uid:Gg++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Hp(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Sf(r,o),emitsOptions:gf(r,o),emit:null,emitted:null,propsDefaults:st,inheritAttrs:r.inheritAttrs,ctx:st,data:st,props:st,attrs:st,slots:st,refs:st,setupState:st,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx=ng(i),i.root=e?e.root:i,i.emit=gg.bind(null,i),t.ce&&t.ce(i),i}let At=null;const Fo=()=>At||Rt;let yi,za;{const t=ks(),e=(n,r)=>{let o;return(o=t[n])||(o=t[n]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};yi=e("__VUE_INSTANCE_SETTERS__",n=>At=n),za=e("__VUE_SSR_SETTERS__",n=>gs=n)}const Rs=t=>{const e=At;return yi(t),t.scope.on(),()=>{t.scope.off(),yi(e)}},Dc=()=>{At&&At.scope.off(),yi(null)},zg=nr("slot,component");function Ja(t,{isNativeTag:e}){(zg(t)||e(t))&&Z("Do not use built-in or reserved HTML elements as component id: "+t)}function Nf(t){return t.vnode.shapeFlag&4}let gs=!1;function Jg(t,e=!1,n=!1){e&&za(e);const{props:r,children:o}=t.vnode,i=Nf(t);Tg(t,r,i,e),Mg(t,o,n||e);const s=i?Yg(t,e):void 0;return e&&za(!1),s}function Yg(t,e){const n=t.type;{if(n.name&&Ja(n.name,t.appContext.config),n.components){const o=Object.keys(n.components);for(let i=0;i<o.length;i++)Ja(o[i],t.appContext.config)}if(n.directives){const o=Object.keys(n.directives);for(let i=0;i<o.length;i++)Qd(o[i])}n.compilerOptions&&Qg()&&Z('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,ff),rg(t);const{setup:r}=n;if(r){gn();const o=t.setupContext=r.length>1?Lf(t):null,i=Rs(t),s=Uo(r,t,0,[On(t.props),o]),a=gl(s);if(vn(),i(),(a||t.sp)&&!Eo(t)&&lf(t),a){if(s.then(Dc,Dc),e)return s.then(l=>{Lc(t,l,e)}).catch(l=>{Is(l,t,0)});if(t.asyncDep=s,!t.suspense){const l=xs(t,n);Z(`Component <${l}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else Lc(t,s,e)}else Df(t,e)}function Lc(t,e,n){Ne(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ye(e)?(io(e)&&Z("setup() should not return VNodes directly - return a render function instead."),t.devtoolsRawSetupState=e,t.setupState=Fd(e),og(t)):e!==void 0&&Z(`setup() should return an object. Received: ${e===null?"null":typeof e}`),Df(t,n)}const Qg=()=>!0;function Df(t,e,n){const r=t.type;t.render||(t.render=r.render||Bt);{const o=Rs(t);gn();try{lg(t)}finally{vn(),o()}}!r.render&&t.render===Bt&&!e&&(r.template?Z('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):Z("Component is missing template or render function: ",r))}const Xg={get(t,e){return pi(),Mt(t,"get",""),t[e]},set(){return Z("setupContext.attrs is readonly."),!1},deleteProperty(){return Z("setupContext.attrs is readonly."),!1}};function Zg(t){return new Proxy(t.slots,{get(e,n){return Mt(t,"get","$slots"),e[n]}})}function Lf(t){const e=n=>{if(t.exposed&&Z("expose() should be called only once per setup()."),n!=null){let r=typeof n;r==="object"&&(xe(n)?r="array":xt(n)&&(r="ref")),r!=="object"&&Z(`expose() should be passed a plain object, received ${r}.`)}t.exposed=n||{}};{let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(t.attrs,Xg))},get slots(){return r||(r=Zg(t))},get emit(){return(o,...i)=>t.emit(o,...i)},expose:e})}}function Li(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Fd(am(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in to)return to[n](t)},has(e,n){return n in e||n in to}})):t.proxy}const ev=/(?:^|[-_])\w/g,tv=t=>t.replace(ev,e=>e.toUpperCase()).replace(/[-_]/g,"");function Nl(t,e=!0){return Ne(t)?t.displayName||t.name:t.name||e&&t.__name}function xs(t,e,n=!1){let r=Nl(e);if(!r&&e.__file){const o=e.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&t){const o=i=>{for(const s in i)if(i[s]===e)return s};r=o(t.components)||t.parent&&o(t.parent.type.components)||o(t.appContext.components)}return r?tv(r):n?"App":"Anonymous"}function jf(t){return Ne(t)&&"__vccOpts"in t}const ce=(t,e)=>{const n=fm(t,e,gs);{const r=Fo();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Dl(t,e,n){try{vi(-1);const r=arguments.length;return r===2?Ye(e)&&!xe(e)?io(e)?Ce(t,null,[e]):Ce(t,e):Ce(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&io(n)&&(n=[n]),Ce(t,e,n))}finally{vi(1)}}function nv(){if(typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(c){if(!Ye(c))return null;if(c.__isVue)return["div",t,"VueInstance"];if(xt(c)){gn();const h=c.value;return vn(),["div",{},["span",t,u(c)],"<",a(h),">"]}else{if(kr(c))return["div",{},["span",t,Gt(c)?"ShallowReactive":"Reactive"],"<",a(c),`>${yn(c)?" (readonly)":""}`];if(yn(c))return["div",{},["span",t,Gt(c)?"ShallowReadonly":"Readonly"],"<",a(c),">"]}return null},hasBody(c){return c&&c.__isVue},body(c){if(c&&c.__isVue)return["div",{},...i(c.$)]}};function i(c){const h=[];c.type.props&&c.props&&h.push(s("props",We(c.props))),c.setupState!==st&&h.push(s("setup",c.setupState)),c.data!==st&&h.push(s("data",We(c.data)));const b=l(c,"computed");b&&h.push(s("computed",b));const E=l(c,"inject");return E&&h.push(s("injected",E)),h.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:c}]]),h}function s(c,h){return h=St({},h),Object.keys(h).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},c],["div",{style:"padding-left:1.25em"},...Object.keys(h).map(b=>["div",{},["span",r,b+": "],a(h[b],!1)])]]:["span",{}]}function a(c,h=!0){return typeof c=="number"?["span",e,c]:typeof c=="string"?["span",n,JSON.stringify(c)]:typeof c=="boolean"?["span",r,c]:Ye(c)?["object",{object:h?We(c):c}]:["span",n,String(c)]}function l(c,h){const b=c.type;if(Ne(b))return;const E={};for(const C in c.ctx)d(b,C,h)&&(E[C]=c.ctx[C]);return E}function d(c,h,b){const E=c[b];if(xe(E)&&E.includes(h)||Ye(E)&&h in E||c.extends&&d(c.extends,h,b)||c.mixins&&c.mixins.some(C=>d(C,h,b)))return!0}function u(c){return Gt(c)?"ShallowRef":c.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const jc="3.5.30",Jn=Z;/**
|
|
21
|
-
* @vue/runtime-dom v3.5.30
|
|
22
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
23
|
-
* @license MIT
|
|
24
|
-
**/let Ya;const Uc=typeof window<"u"&&window.trustedTypes;if(Uc)try{Ya=Uc.createPolicy("vue",{createHTML:t=>t})}catch(t){Jn(`Error creating trusted types policy: ${t}`)}const Uf=Ya?t=>Ya.createHTML(t):t=>t,rv="http://www.w3.org/2000/svg",ov="http://www.w3.org/1998/Math/MathML",$n=typeof document<"u"?document:null,Fc=$n&&$n.createElement("template"),sv={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const o=e==="svg"?$n.createElementNS(rv,t):e==="mathml"?$n.createElementNS(ov,t):n?$n.createElement(t,{is:n}):$n.createElement(t);return t==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:t=>$n.createTextNode(t),createComment:t=>$n.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>$n.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,o,i){const s=n?n.previousSibling:e.lastChild;if(o&&(o===i||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Fc.innerHTML=Uf(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=Fc.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},pr="transition",Jo="animation",vs=Symbol("_vtc"),Ff={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},iv=St({},nf,Ff),av=t=>(t.displayName="Transition",t.props=iv,t),Bf=av((t,{slots:e})=>Dl($m,lv(t),e)),Hr=(t,e=[])=>{xe(t)?t.forEach(n=>n(...e)):t&&t(...e)},Bc=t=>t?xe(t)?t.some(e=>e.length>1):t.length>1:!1;function lv(t){const e={};for(const q in t)q in Ff||(e[q]=t[q]);if(t.css===!1)return e;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:d=s,appearToClass:u=a,leaveFromClass:c=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=t,E=cv(o),C=E&&E[0],W=E&&E[1],{onBeforeEnter:L,onEnter:M,onEnterCancelled:H,onLeave:X,onLeaveCancelled:U,onBeforeAppear:Q=L,onAppear:re=M,onAppearCancelled:me=H}=e,z=(q,ye,Re,Ue)=>{q._enterCancelled=Ue,$r(q,ye?u:a),$r(q,ye?d:s),Re&&Re()},te=(q,ye)=>{q._isLeaving=!1,$r(q,c),$r(q,b),$r(q,h),ye&&ye()},Ae=q=>(ye,Re)=>{const Ue=q?re:M,Ve=()=>z(ye,q,Re);Hr(Ue,[ye,Ve]),Hc(()=>{$r(ye,q?l:i),Bn(ye,q?u:a),Bc(Ue)||$c(ye,r,C,Ve)})};return St(e,{onBeforeEnter(q){Hr(L,[q]),Bn(q,i),Bn(q,s)},onBeforeAppear(q){Hr(Q,[q]),Bn(q,l),Bn(q,d)},onEnter:Ae(!1),onAppear:Ae(!0),onLeave(q,ye){q._isLeaving=!0;const Re=()=>te(q,ye);Bn(q,c),q._enterCancelled?(Bn(q,h),qc(q)):(qc(q),Bn(q,h)),Hc(()=>{q._isLeaving&&($r(q,c),Bn(q,b),Bc(X)||$c(q,r,W,Re))}),Hr(X,[q,Re])},onEnterCancelled(q){z(q,!1,void 0,!0),Hr(H,[q])},onAppearCancelled(q){z(q,!0,void 0,!0),Hr(me,[q])},onLeaveCancelled(q){te(q),Hr(U,[q])}})}function cv(t){if(t==null)return null;if(Ye(t))return[ea(t.enter),ea(t.leave)];{const e=ea(t);return[e,e]}}function ea(t){const e=Cp(t);return bm(e,"<transition> explicit duration"),e}function Bn(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[vs]||(t[vs]=new Set)).add(e)}function $r(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[vs];n&&(n.delete(e),n.size||(t[vs]=void 0))}function Hc(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let uv=0;function $c(t,e,n,r){const o=t._endId=++uv,i=()=>{o===t._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=dv(t,e);if(!s)return r();const d=s+"end";let u=0;const c=()=>{t.removeEventListener(d,h),i()},h=b=>{b.target===t&&++u>=l&&c()};setTimeout(()=>{u<l&&c()},a+1),t.addEventListener(d,h)}function dv(t,e){const n=window.getComputedStyle(t),r=E=>(n[E]||"").split(", "),o=r(`${pr}Delay`),i=r(`${pr}Duration`),s=Vc(o,i),a=r(`${Jo}Delay`),l=r(`${Jo}Duration`),d=Vc(a,l);let u=null,c=0,h=0;e===pr?s>0&&(u=pr,c=s,h=i.length):e===Jo?d>0&&(u=Jo,c=d,h=l.length):(c=Math.max(s,d),u=c>0?s>d?pr:Jo:null,h=u?u===pr?i.length:l.length:0);const b=u===pr&&/\b(?:transform|all)(?:,|$)/.test(r(`${pr}Property`).toString());return{type:u,timeout:c,propCount:h,hasTransform:b}}function Vc(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>Wc(n)+Wc(t[r])))}function Wc(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function qc(t){return(t?t.ownerDocument:document).body.offsetHeight}function fv(t,e,n){const r=t[vs];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Gc=Symbol("_vod"),hv=Symbol("_vsh"),pv=Symbol("CSS_VAR_TEXT"),mv=/(?:^|;)\s*display\s*:/;function gv(t,e,n){const r=t.style,o=bt(n);let i=!1;if(n&&!o){if(e)if(bt(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&Zs(r,a,"")}else for(const s in e)n[s]==null&&Zs(r,s,"");for(const s in n)s==="display"&&(i=!0),Zs(r,s,n[s])}else if(o){if(e!==n){const s=r[pv];s&&(n+=";"+s),r.cssText=n,i=mv.test(n)}}else e&&t.removeAttribute("style");Gc in t&&(t[Gc]=i?r.display:"",t[hv]&&(r.display="none"))}const vv=/[^\\];\s*$/,Kc=/\s*!important$/;function Zs(t,e,n){if(xe(n))n.forEach(r=>Zs(t,e,r));else if(n==null&&(n=""),vv.test(n)&&Jn(`Unexpected semicolon at the end of '${e}' style value: '${n}'`),e.startsWith("--"))t.setProperty(e,n);else{const r=yv(t,e);Kc.test(n)?t.setProperty(Qn(r),n.replace(Kc,""),"important"):t[r]=n}}const zc=["Webkit","Moz","ms"],ta={};function yv(t,e){const n=ta[e];if(n)return n;let r=Nt(e);if(r!=="filter"&&r in t)return ta[e]=r;r=ro(r);for(let o=0;o<zc.length;o++){const i=zc[o]+r;if(i in t)return ta[e]=i}return e}const Jc="http://www.w3.org/1999/xlink";function Yc(t,e,n,r,o,i=Fp(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Jc,e.slice(6,e.length)):t.setAttributeNS(Jc,e,n):n==null||i&&!yd(n)?t.removeAttribute(e):t.setAttribute(e,i?"":pn(n)?String(n):n)}function Qc(t,e,n,r,o){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?Uf(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let s=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=yd(n):n==null&&a==="string"?(n="",s=!0):a==="number"&&(n=0,s=!0)}try{t[e]=n}catch(a){s||Jn(`Failed setting prop "${e}" on <${i.toLowerCase()}>: value ${n} is invalid.`,a)}s&&t.removeAttribute(o||e)}function So(t,e,n,r){t.addEventListener(e,n,r)}function bv(t,e,n,r){t.removeEventListener(e,n,r)}const Xc=Symbol("_vei");function _v(t,e,n,r,o=null){const i=t[Xc]||(t[Xc]={}),s=i[e];if(r&&s)s.value=eu(r,e);else{const[a,l]=wv(e);if(r){const d=i[e]=kv(eu(r,e),o);So(t,a,d,l)}else s&&(bv(t,a,s,l),i[e]=void 0)}}const Zc=/(?:Once|Passive|Capture)$/;function wv(t){let e;if(Zc.test(t)){e={};let r;for(;r=t.match(Zc);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Qn(t.slice(2)),e]}let na=0;const Tv=Promise.resolve(),Sv=()=>na||(Tv.then(()=>na=0),na=Date.now());function kv(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_n(Iv(r,n.value),e,5,[r])};return n.value=t,n.attached=Sv(),n}function eu(t,e){return Ne(t)||xe(t)?t:(Jn(`Wrong type passed as event handler to ${e} - did you forget @ or : in front of your prop?
|
|
25
|
-
Expected function or array of functions, received type ${typeof t}.`),Bt)}function Iv(t,e){if(xe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>o=>!o._stopped&&r&&r(o))}else return e}const tu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ev=(t,e,n,r,o,i)=>{const s=o==="svg";e==="class"?fv(t,r,s):e==="style"?gv(t,n,r):Ts(e)?oi(e)||_v(t,e,n,r,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Cv(t,e,r,s))?(Qc(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Yc(t,e,r,s,i,e!=="value")):t._isVueCE&&(Av(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!bt(r)))?Qc(t,Nt(e),r,i,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Yc(t,e,r,s))};function Cv(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&tu(e)&&Ne(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=t.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return tu(e)&&bt(n)?!1:e in t}function Av(t,e){const n=t._def.props;if(!n)return!1;const r=Nt(e);return Array.isArray(n)?n.some(o=>Nt(o)===r):Object.keys(n).some(o=>Nt(o)===r)}const nu=t=>{const e=t.props["onUpdate:modelValue"]||!1;return xe(e)?n=>wo(e,n):e};function Rv(t){t.target.composing=!0}function ru(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const ra=Symbol("_assign");function ou(t,e,n){return e&&(t=t.trim()),n&&(t=bl(t)),t}const Zn={created(t,{modifiers:{lazy:e,trim:n,number:r}},o){t[ra]=nu(o);const i=r||o.props&&o.props.type==="number";So(t,e?"change":"input",s=>{s.target.composing||t[ra](ou(t.value,n,i))}),(n||i)&&So(t,"change",()=>{t.value=ou(t.value,n,i)}),e||(So(t,"compositionstart",Rv),So(t,"compositionend",ru),So(t,"change",ru))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(t[ra]=nu(s),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?bl(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(r&&e===n||o&&t.value.trim()===l)||(t.value=l))}},xv=["ctrl","shift","alt","meta"],Pv={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>xv.some(n=>t[`${n}Key`]&&!e.includes(n))},Je=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=((o,...i)=>{for(let s=0;s<e.length;s++){const a=Pv[e[s]];if(a&&a(o,e))return}return t(o,...i)}))},Ov={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},qt=(t,e)=>{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const i=Qn(o.key);if(e.some(s=>s===i||Ov[s]===i))return t(o)}))},Mv=St({patchProp:Ev},sv);let su;function Nv(){return su||(su=Lg(Mv))}const Dv=((...t)=>{const e=Nv().createApp(...t);jv(e),Uv(e);const{mount:n}=e;return e.mount=r=>{const o=Fv(r);if(!o)return;const i=e._component;!Ne(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const s=n(o,!1,Lv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},e});function Lv(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function jv(t){Object.defineProperty(t.config,"isNativeTag",{value:e=>Dp(e)||Lp(e)||jp(e),writable:!1})}function Uv(t){{const e=t.config.isCustomElement;Object.defineProperty(t.config,"isCustomElement",{get(){return e},set(){Jn("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=t.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,"compilerOptions",{get(){return Jn(r),n},set(){Jn(r)}})}}function Fv(t){if(bt(t)){const e=document.querySelector(t);return e||Jn(`Failed to mount app: mount target selector "${t}" returned null.`),e}return window.ShadowRoot&&t instanceof window.ShadowRoot&&t.mode==="closed"&&Jn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),t}/**
|
|
26
|
-
* vue v3.5.30
|
|
27
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
28
|
-
* @license MIT
|
|
29
|
-
**/function Bv(){nv()}Bv();function Hv(){return Hf().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Hf(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const $v=typeof Proxy=="function",Vv="devtools-plugin:setup",Wv="plugin:settings:set";let bo,Qa;function qv(){var t;return bo!==void 0||(typeof window<"u"&&window.performance?(bo=!0,Qa=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(bo=!0,Qa=globalThis.perf_hooks.performance):bo=!1),bo}function Gv(){return qv()?Qa.now():Date.now()}class Kv{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${e.id}`;let i=Object.assign({},r);try{const s=localStorage.getItem(o),a=JSON.parse(s);Object.assign(i,a)}catch{}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}i=s},now(){return Gv()}},n&&n.on(Wv,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(d=>{this.targetQueue.push({method:a,args:l,resolve:d})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function zv(t,e){const n=t,r=Hf(),o=Hv(),i=$v&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(Vv,t,e);else{const s=i?new Kv(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/*!
|
|
30
|
-
* vue-router v4.6.4
|
|
31
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
32
|
-
* @license MIT
|
|
33
|
-
*/const qn=typeof document<"u";function $f(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function Jv(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&$f(t.default)}const rt=Object.assign;function oa(t,e){const n={};for(const r in e){const o=e[r];n[r]=tn(o)?o.map(t):t(o)}return n}const ls=()=>{},tn=Array.isArray;function iu(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}function qe(t){const e=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+t].concat(e))}const Vf=/#/g,Yv=/&/g,Qv=/\//g,Xv=/=/g,Zv=/\?/g,Wf=/\+/g,ey=/%5B/g,ty=/%5D/g,qf=/%5E/g,ny=/%60/g,Gf=/%7B/g,ry=/%7C/g,Kf=/%7D/g,oy=/%20/g;function Ll(t){return t==null?"":encodeURI(""+t).replace(ry,"|").replace(ey,"[").replace(ty,"]")}function sy(t){return Ll(t).replace(Gf,"{").replace(Kf,"}").replace(qf,"^")}function Xa(t){return Ll(t).replace(Wf,"%2B").replace(oy,"+").replace(Vf,"%23").replace(Yv,"%26").replace(ny,"`").replace(Gf,"{").replace(Kf,"}").replace(qf,"^")}function iy(t){return Xa(t).replace(Xv,"%3D")}function ay(t){return Ll(t).replace(Vf,"%23").replace(Zv,"%3F")}function ly(t){return ay(t).replace(Qv,"%2F")}function Mo(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{qe(`Error decoding "${t}". Using original value`)}return""+t}const cy=/\/$/,uy=t=>t.replace(cy,"");function sa(t,e,n="/"){let r,o={},i="",s="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=e.slice(0,l),i=e.slice(l,a>0?a:e.length),o=t(i.slice(1))),a>=0&&(r=r||e.slice(0,a),s=e.slice(a,e.length)),r=hy(r??e,n),{fullPath:r+i+s,path:r,query:o,hash:Mo(s)}}function dy(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function au(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function lu(t,e,n){const r=e.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Cr(e.matched[r],n.matched[o])&&zf(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Cr(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function zf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!fy(t[n],e[n]))return!1;return!0}function fy(t,e){return tn(t)?cu(t,e):tn(e)?cu(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function cu(t,e){return tn(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function hy(t,e){if(t.startsWith("/"))return t;if(!e.startsWith("/"))return qe(`Cannot resolve a relative location without an absolute path. Trying to resolve "${t}" from "${e}". It should look like "/${e}".`),t;if(!t)return e;const n=e.split("/"),r=t.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let i=n.length-1,s,a;for(s=0;s<r.length;s++)if(a=r[s],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(s).join("/")}const mr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Za=(function(t){return t.pop="pop",t.push="push",t})({}),ia=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function py(t){if(!t)if(qn){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),uy(t)}const my=/^[^#]+#/;function gy(t,e){return t.replace(my,"#")+e}function vy(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const ji=()=>({left:window.scrollX,top:window.scrollY});function yy(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#");if(typeof t.el=="string"&&(!r||!document.getElementById(t.el.slice(1))))try{const i=document.querySelector(t.el);if(r&&i){qe(`The selector "${t.el}" should be passed as "el: document.querySelector('${t.el}')" because it starts with "#".`);return}}catch{qe(`The selector "${t.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}const o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o){qe(`Couldn't find element using selector "${t.el}" returned by scrollBehavior.`);return}e=vy(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function uu(t,e){return(history.state?history.state.position-e:-1)+t}const el=new Map;function by(t,e){el.set(t,e)}function _y(t){const e=el.get(t);return el.delete(t),e}function bi(t){return typeof t=="string"||t&&typeof t=="object"}function Jf(t){return typeof t=="string"||typeof t=="symbol"}let kt=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const Yf=Symbol("navigation failure"),wy={[kt.MATCHER_NOT_FOUND]({location:t,currentLocation:e}){return`No match for
|
|
34
|
-
${JSON.stringify(t)}${e?`
|
|
35
|
-
while being at
|
|
36
|
-
`+JSON.stringify(e):""}`},[kt.NAVIGATION_GUARD_REDIRECT]({from:t,to:e}){return`Redirected from "${t.fullPath}" to "${Sy(e)}" via a navigation guard.`},[kt.NAVIGATION_ABORTED]({from:t,to:e}){return`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`},[kt.NAVIGATION_CANCELLED]({from:t,to:e}){return`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`},[kt.NAVIGATION_DUPLICATED]({from:t,to:e}){return`Avoided redundant navigation to current location: "${t.fullPath}".`}};function No(t,e){return rt(new Error(wy[t](e)),{type:t,[Yf]:!0},e)}function Hn(t,e){return t instanceof Error&&Yf in t&&(e==null||!!(t.type&e))}const Ty=["params","query","hash"];function Sy(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of Ty)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function ky(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<n.length;++r){const o=n[r].replace(Wf," "),i=o.indexOf("="),s=Mo(i<0?o:o.slice(0,i)),a=i<0?null:Mo(o.slice(i+1));if(s in e){let l=e[s];tn(l)||(l=e[s]=[l]),l.push(a)}else e[s]=a}return e}function du(t){let e="";for(let n in t){const r=t[n];if(n=iy(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(tn(r)?r.map(o=>o&&Xa(o)):[r&&Xa(r)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+n,o!=null&&(e+="="+o))})}return e}function Iy(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=tn(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return e}const Ey=Symbol("router view location matched"),fu=Symbol("router view depth"),Ui=Symbol("router"),jl=Symbol("route location"),tl=Symbol("router view location");function Yo(){let t=[];function e(r){return t.push(r),()=>{const o=t.indexOf(r);o>-1&&t.splice(o,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function br(t,e,n,r,o,i=s=>s()){const s=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const d=h=>{h===!1?l(No(kt.NAVIGATION_ABORTED,{from:n,to:e})):h instanceof Error?l(h):bi(h)?l(No(kt.NAVIGATION_GUARD_REDIRECT,{from:e,to:h})):(s&&r.enterCallbacks[o]===s&&typeof h=="function"&&s.push(h),a())},u=i(()=>t.call(r&&r.instances[o],e,n,Cy(d,e,n)));let c=Promise.resolve(u);if(t.length<3&&(c=c.then(d)),t.length>2){const h=`The "next" callback was never called inside of ${t.name?'"'+t.name+'"':""}:
|
|
37
|
-
${t.toString()}
|
|
38
|
-
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof u=="object"&&"then"in u)c=c.then(b=>d._called?b:(qe(h),Promise.reject(new Error("Invalid navigation guard"))));else if(u!==void 0&&!d._called){qe(h),l(new Error("Invalid navigation guard"));return}}c.catch(h=>l(h))})}function Cy(t,e,n){let r=0;return function(){r++===1&&qe(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${e.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),t._called=!0,r===1&&t.apply(null,arguments)}}function aa(t,e,n,r,o=i=>i()){const i=[];for(const s of t){!s.components&&s.children&&!s.children.length&&qe(`Record with path "${s.path}" is either missing a "component(s)" or "children" property.`);for(const a in s.components){let l=s.components[a];{if(!l||typeof l!="object"&&typeof l!="function")throw qe(`Component "${a}" in record with path "${s.path}" is not a valid component. Received "${String(l)}".`),new Error("Invalid route component");if("then"in l){qe(`Component "${a}" in record with path "${s.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);const d=l;l=()=>d}else l.__asyncLoader&&!l.__warnedDefineAsync&&(l.__warnedDefineAsync=!0,qe(`Component "${a}" in record with path "${s.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(e!=="beforeRouteEnter"&&!s.instances[a]))if($f(l)){const d=(l.__vccOpts||l)[e];d&&i.push(br(d,n,r,s,a,o))}else{let d=l();"catch"in d||(qe(`Component "${a}" in record with path "${s.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),d=Promise.resolve(d)),i.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${s.path}"`);const c=Jv(u)?u.default:u;s.mods[a]=u,s.components[a]=c;const h=(c.__vccOpts||c)[e];return h&&br(h,n,r,s,a,o)()}))}}}return i}function Ay(t,e){const n=[],r=[],o=[],i=Math.max(e.matched.length,t.matched.length);for(let s=0;s<i;s++){const a=e.matched[s];a&&(t.matched.find(d=>Cr(d,a))?r.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(d=>Cr(d,l))||o.push(l))}return[n,r,o]}function Qo(t,e){const n=rt({},t,{matched:t.matched.map(r=>Fy(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:t.fullPath,tooltip:e,value:n}}}function Hs(t){return{_custom:{display:t}}}let Ry=0;function xy(t,e,n){if(e.__hasDevtools)return;e.__hasDevtools=!0;const r=Ry++;zv({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:t},o=>{typeof o.now!="function"&&qe("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),o.on.inspectComponent((u,c)=>{u.instanceData&&u.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Qo(e.currentRoute.value,"Current Route")})}),o.on.visitComponentTree(({treeNode:u,componentInstance:c})=>{if(c.__vrv_devtools){const h=c.__vrv_devtools;u.tags.push({label:(h.name?`${h.name.toString()}: `:"")+h.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:Qf})}tn(c.__vrl_devtools)&&(c.__devtoolsApi=o,c.__vrl_devtools.forEach(h=>{let b=h.route.path,E=eh,C="",W=0;h.error?(b=h.error,E=Dy,W=Ly):h.isExactActive?(E=Zf,C="This is exactly active"):h.isActive&&(E=Xf,C="This link is active"),u.tags.push({label:b,textColor:W,tooltip:C,backgroundColor:E})}))}),yt(e.currentRoute,()=>{l(),o.notifyComponentUpdate(),o.sendInspectorTree(a),o.sendInspectorState(a)});const i="router:navigations:"+r;o.addTimelineLayer({id:i,label:`Router${r?" "+r:""} Navigations`,color:4237508}),e.onError((u,c)=>{o.addTimelineEvent({layerId:i,event:{title:"Error during Navigation",subtitle:c.fullPath,logType:"error",time:o.now(),data:{error:u},groupId:c.meta.__navigationId}})});let s=0;e.beforeEach((u,c)=>{const h={guard:Hs("beforeEach"),from:Qo(c,"Current Location during this navigation"),to:Qo(u,"Target location")};Object.defineProperty(u.meta,"__navigationId",{value:s++}),o.addTimelineEvent({layerId:i,event:{time:o.now(),title:"Start of navigation",subtitle:u.fullPath,data:h,groupId:u.meta.__navigationId}})}),e.afterEach((u,c,h)=>{const b={guard:Hs("afterEach")};h?(b.failure={_custom:{type:Error,readOnly:!0,display:h?h.message:"",tooltip:"Navigation Failure",value:h}},b.status=Hs("❌")):b.status=Hs("✅"),b.from=Qo(c,"Current Location during this navigation"),b.to=Qo(u,"Target location"),o.addTimelineEvent({layerId:i,event:{title:"End of navigation",subtitle:u.fullPath,time:o.now(),data:b,logType:h?"warning":"default",groupId:u.meta.__navigationId}})});const a="router-inspector:"+r;o.addInspector({id:a,label:"Routes"+(r?" "+r:""),icon:"book",treeFilterPlaceholder:"Search routes"});function l(){if(!d)return;const u=d;let c=n.getRoutes().filter(h=>!h.parent||!h.parent.record.components);c.forEach(rh),u.filter&&(c=c.filter(h=>nl(h,u.filter.toLowerCase()))),c.forEach(h=>nh(h,e.currentRoute.value)),u.rootNodes=c.map(th)}let d;o.on.getInspectorTree(u=>{d=u,u.app===t&&u.inspectorId===a&&l()}),o.on.getInspectorState(u=>{if(u.app===t&&u.inspectorId===a){const c=n.getRoutes().find(h=>h.record.__vd_id===u.nodeId);c&&(u.state={options:Oy(c)})}}),o.sendInspectorTree(a),o.sendInspectorState(a)})}function Py(t){return t.optional?t.repeatable?"*":"?":t.repeatable?"+":""}function Oy(t){const{record:e}=t,n=[{editable:!1,key:"path",value:e.path}];return e.name!=null&&n.push({editable:!1,key:"name",value:e.name}),n.push({editable:!1,key:"regexp",value:t.re}),t.keys.length&&n.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:t.keys.map(r=>`${r.name}${Py(r)}`).join(" "),tooltip:"Param keys",value:t.keys}}}),e.redirect!=null&&n.push({editable:!1,key:"redirect",value:e.redirect}),t.alias.length&&n.push({editable:!1,key:"aliases",value:t.alias.map(r=>r.record.path)}),Object.keys(t.record.meta).length&&n.push({editable:!1,key:"meta",value:t.record.meta}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:t.score.map(r=>r.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:t.score}}}),n}const Qf=15485081,Xf=2450411,Zf=8702998,My=2282478,eh=16486972,Ny=6710886,Dy=16704226,Ly=12131356;function th(t){const e=[],{record:n}=t;n.name!=null&&e.push({label:String(n.name),textColor:0,backgroundColor:My}),n.aliasOf&&e.push({label:"alias",textColor:0,backgroundColor:eh}),t.__vd_match&&e.push({label:"matches",textColor:0,backgroundColor:Qf}),t.__vd_exactActive&&e.push({label:"exact",textColor:0,backgroundColor:Zf}),t.__vd_active&&e.push({label:"active",textColor:0,backgroundColor:Xf}),n.redirect&&e.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:Ny});let r=n.__vd_id;return r==null&&(r=String(jy++),n.__vd_id=r),{id:r,label:n.path,tags:e,children:t.children.map(th)}}let jy=0;const Uy=/^\/(.*)\/([a-z]*)$/;function nh(t,e){const n=e.matched.length&&Cr(e.matched[e.matched.length-1],t.record);t.__vd_exactActive=t.__vd_active=n,n||(t.__vd_active=e.matched.some(r=>Cr(r,t.record))),t.children.forEach(r=>nh(r,e))}function rh(t){t.__vd_match=!1,t.children.forEach(rh)}function nl(t,e){const n=String(t.re).match(Uy);if(t.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,""),n[2]).test(e))return t.children.forEach(i=>nl(i,e)),t.record.path!=="/"||e==="/"?(t.__vd_match=t.re.test(e),!0):!1;const r=t.record.path.toLowerCase(),o=Mo(r);return!e.startsWith("/")&&(o.includes(e)||r.includes(e))||o.startsWith(e)||r.startsWith(e)||t.record.name&&String(t.record.name).includes(e)?!0:t.children.some(i=>nl(i,e))}function Fy(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}/*!
|
|
39
|
-
* vue-router v4.6.4
|
|
40
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
41
|
-
* @license MIT
|
|
42
|
-
*/let By=()=>location.protocol+"//"+location.host;function oh(t,e){const{pathname:n,search:r,hash:o}=e,i=t.indexOf("#");if(i>-1){let s=o.includes(t.slice(i))?t.slice(i).length:1,a=o.slice(s);return a[0]!=="/"&&(a="/"+a),au(a,"")}return au(n,t)+r+o}function Hy(t,e,n,r){let o=[],i=[],s=null;const a=({state:h})=>{const b=oh(t,location),E=n.value,C=e.value;let W=0;if(h){if(n.value=b,e.value=h,s&&s===E){s=null;return}W=C?h.position-C.position:0}else r(b);o.forEach(L=>{L(n.value,E,{delta:W,type:Za.pop,direction:W?W>0?ia.forward:ia.back:ia.unknown})})};function l(){s=n.value}function d(h){o.push(h);const b=()=>{const E=o.indexOf(h);E>-1&&o.splice(E,1)};return i.push(b),b}function u(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(rt({},h.state,{scroll:ji()}),"")}}function c(){for(const h of i)h();i=[],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:d,destroy:c}}function hu(t,e,n,r=!1,o=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:o?ji():null}}function $y(t){const{history:e,location:n}=window,r={value:oh(t,n)},o={value:e.state};o.value||i(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function i(l,d,u){const c=t.indexOf("#"),h=c>-1?(n.host&&document.querySelector("base")?t:t.slice(c))+l:By()+t+l;try{e[u?"replaceState":"pushState"](d,"",h),o.value=d}catch(b){qe("Error with push/replace State",b),n[u?"replace":"assign"](h)}}function s(l,d){i(l,rt({},e.state,hu(o.value.back,l,o.value.forward,!0),d,{position:o.value.position}),!0),r.value=l}function a(l,d){const u=rt({},o.value,e.state,{forward:l,scroll:ji()});e.state||qe(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
|
|
43
|
-
|
|
44
|
-
history.replaceState(history.state, '', url)
|
|
45
|
-
|
|
46
|
-
You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),i(u.current,u,!0),i(l,rt({},hu(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:o,push:a,replace:s}}function Vy(t){t=py(t);const e=$y(t),n=Hy(t,e.state,e.location,e.replace);function r(i,s=!0){s||n.pauseListeners(),history.go(i)}const o=rt({location:"",base:t,go:r,createHref:gy.bind(null,t)},e,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>e.state.value}),o}function Wy(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),!t.endsWith("#/")&&!t.endsWith("#")&&qe(`A hash base must end with a "#":
|
|
47
|
-
"${t}" should be "${t.replace(/#.*$/,"#")}".`),Vy(t)}let Jr=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var Pt=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(Pt||{});const qy={type:Jr.Static,value:""},Gy=/[a-zA-Z0-9_]/;function Ky(t){if(!t)return[[]];if(t==="/")return[[qy]];if(!t.startsWith("/"))throw new Error(`Route paths should start with a "/": "${t}" should be "/${t}".`);function e(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=Pt.Static,r=n;const o=[];let i;function s(){i&&o.push(i),i=[]}let a=0,l,d="",u="";function c(){d&&(n===Pt.Static?i.push({type:Jr.Static,value:d}):n===Pt.Param||n===Pt.ParamRegExp||n===Pt.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Jr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),d="")}function h(){d+=l}for(;a<t.length;){if(l=t[a++],l==="\\"&&n!==Pt.ParamRegExp){r=n,n=Pt.EscapeNext;continue}switch(n){case Pt.Static:l==="/"?(d&&c(),s()):l===":"?(c(),n=Pt.Param):h();break;case Pt.EscapeNext:h(),n=r;break;case Pt.Param:l==="("?n=Pt.ParamRegExp:Gy.test(l)?h():(c(),n=Pt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Pt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Pt.ParamRegExpEnd:u+=l;break;case Pt.ParamRegExpEnd:c(),n=Pt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===Pt.ParamRegExp&&e(`Unfinished custom RegExp for param "${d}"`),c(),s(),o}const pu="[^/]+?",zy={sensitive:!1,strict:!1,start:!0,end:!0};var Vt=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(Vt||{});const Jy=/[.+*?^${}()[\]/\\]/g;function Yy(t,e){const n=rt({},zy,e),r=[];let o=n.start?"^":"";const i=[];for(const d of t){const u=d.length?[]:[Vt.Root];n.strict&&!d.length&&(o+="/");for(let c=0;c<d.length;c++){const h=d[c];let b=Vt.Segment+(n.sensitive?Vt.BonusCaseSensitive:0);if(h.type===Jr.Static)c||(o+="/"),o+=h.value.replace(Jy,"\\$&"),b+=Vt.Static;else if(h.type===Jr.Param){const{value:E,repeatable:C,optional:W,regexp:L}=h;i.push({name:E,repeatable:C,optional:W});const M=L||pu;if(M!==pu){b+=Vt.BonusCustomRegExp;try{`${M}`}catch(X){throw new Error(`Invalid custom RegExp for param "${E}" (${M}): `+X.message)}}let H=C?`((?:${M})(?:/(?:${M}))*)`:`(${M})`;c||(H=W&&d.length<2?`(?:/${H})`:"/"+H),W&&(H+="?"),o+=H,b+=Vt.Dynamic,W&&(b+=Vt.BonusOptional),C&&(b+=Vt.BonusRepeatable),M===".*"&&(b+=Vt.BonusWildcard)}u.push(b)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Vt.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const s=new RegExp(o,n.sensitive?"":"i");function a(d){const u=d.match(s),c={};if(!u)return null;for(let h=1;h<u.length;h++){const b=u[h]||"",E=i[h-1];c[E.name]=b&&E.repeatable?b.split("/"):b}return c}function l(d){let u="",c=!1;for(const h of t){(!c||!u.endsWith("/"))&&(u+="/"),c=!1;for(const b of h)if(b.type===Jr.Static)u+=b.value;else if(b.type===Jr.Param){const{value:E,repeatable:C,optional:W}=b,L=E in d?d[E]:"";if(tn(L)&&!C)throw new Error(`Provided param "${E}" is an array but it is not repeatable (* or + modifiers)`);const M=tn(L)?L.join("/"):L;if(!M)if(W)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):c=!0);else throw new Error(`Missing required param "${E}"`);u+=M}}return u||"/"}return{re:s,score:r,keys:i,parse:a,stringify:l}}function Qy(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===Vt.Static+Vt.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===Vt.Static+Vt.Segment?1:-1:0}function sh(t,e){let n=0;const r=t.score,o=e.score;for(;n<r.length&&n<o.length;){const i=Qy(r[n],o[n]);if(i)return i;n++}if(Math.abs(o.length-r.length)===1){if(mu(r))return 1;if(mu(o))return-1}return o.length-r.length}function mu(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const Xy={strict:!1,end:!0,sensitive:!1};function Zy(t,e,n){const r=Yy(Ky(t.path),n);{const i=new Set;for(const s of r.keys)i.has(s.name)&&qe(`Found duplicated params with name "${s.name}" for path "${t.path}". Only the last one will be available on "$route.params".`),i.add(s.name)}const o=rt(r,{record:t,parent:e,children:[],alias:[]});return e&&!o.record.aliasOf==!e.record.aliasOf&&e.children.push(o),o}function eb(t,e){const n=[],r=new Map;e=iu(Xy,e);function o(c){return r.get(c)}function i(c,h,b){const E=!b,C=vu(c);ob(C,h),C.aliasOf=b&&b.record;const W=iu(e,c),L=[C];if("alias"in c){const X=typeof c.alias=="string"?[c.alias]:c.alias;for(const U of X)L.push(vu(rt({},C,{components:b?b.record.components:C.components,path:U,aliasOf:b?b.record:C})))}let M,H;for(const X of L){const{path:U}=X;if(h&&U[0]!=="/"){const Q=h.record.path,re=Q[Q.length-1]==="/"?"":"/";X.path=h.record.path+(U&&re+U)}if(X.path==="*")throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
|
|
48
|
-
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(M=Zy(X,h,W),h&&U[0]==="/"&&ib(M,h),b?(b.alias.push(M),rb(b,M)):(H=H||M,H!==M&&H.alias.push(M),E&&c.name&&!yu(M)&&(sb(c,h),s(c.name))),ih(M)&&l(M),C.children){const Q=C.children;for(let re=0;re<Q.length;re++)i(Q[re],M,b&&b.children[re])}b=b||M}return H?()=>{s(H)}:ls}function s(c){if(Jf(c)){const h=r.get(c);h&&(r.delete(c),n.splice(n.indexOf(h),1),h.children.forEach(s),h.alias.forEach(s))}else{const h=n.indexOf(c);h>-1&&(n.splice(h,1),c.record.name&&r.delete(c.record.name),c.children.forEach(s),c.alias.forEach(s))}}function a(){return n}function l(c){const h=ab(c,n);n.splice(h,0,c),c.record.name&&!yu(c)&&r.set(c.record.name,c)}function d(c,h){let b,E={},C,W;if("name"in c&&c.name){if(b=r.get(c.name),!b)throw No(kt.MATCHER_NOT_FOUND,{location:c});{const H=Object.keys(c.params||{}).filter(X=>!b.keys.find(U=>U.name===X));H.length&&qe(`Discarded invalid param(s) "${H.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}W=b.record.name,E=rt(gu(h.params,b.keys.filter(H=>!H.optional).concat(b.parent?b.parent.keys.filter(H=>H.optional):[]).map(H=>H.name)),c.params&&gu(c.params,b.keys.map(H=>H.name))),C=b.stringify(E)}else if(c.path!=null)C=c.path,C.startsWith("/")||qe(`The Matcher cannot resolve relative paths but received "${C}". Unless you directly called \`matcher.resolve("${C}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),b=n.find(H=>H.re.test(C)),b&&(E=b.parse(C),W=b.record.name);else{if(b=h.name?r.get(h.name):n.find(H=>H.re.test(h.path)),!b)throw No(kt.MATCHER_NOT_FOUND,{location:c,currentLocation:h});W=b.record.name,E=rt({},h.params,c.params),C=b.stringify(E)}const L=[];let M=b;for(;M;)L.unshift(M.record),M=M.parent;return{name:W,path:C,params:E,matched:L,meta:nb(L)}}t.forEach(c=>i(c));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:d,removeRoute:s,clearRoutes:u,getRoutes:a,getRecordMatcher:o}}function gu(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function vu(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:tb(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function tb(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function yu(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function nb(t){return t.reduce((e,n)=>rt(e,n.meta),{})}function rl(t,e){return t.name===e.name&&t.optional===e.optional&&t.repeatable===e.repeatable}function rb(t,e){for(const n of t.keys)if(!n.optional&&!e.keys.find(rl.bind(null,n)))return qe(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);for(const n of e.keys)if(!n.optional&&!t.keys.find(rl.bind(null,n)))return qe(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`)}function ob(t,e){e&&e.record.name&&!t.name&&!t.path&&qe(`The route named "${String(e.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)}function sb(t,e){for(let n=e;n;n=n.parent)if(n.record.name===t.name)throw new Error(`A route named "${String(t.name)}" has been added as a ${e===n?"child":"descendant"} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`)}function ib(t,e){for(const n of e.keys)if(!t.keys.find(rl.bind(null,n)))return qe(`Absolute path "${t.record.path}" must have the exact same param named "${n.name}" as its parent "${e.record.path}".`)}function ab(t,e){let n=0,r=e.length;for(;n!==r;){const i=n+r>>1;sh(t,e[i])<0?r=i:n=i+1}const o=lb(t);return o&&(r=e.lastIndexOf(o,r-1),r<0&&qe(`Finding ancestor route "${o.record.path}" failed for "${t.record.path}"`)),r}function lb(t){let e=t;for(;e=e.parent;)if(ih(e)&&sh(t,e)===0)return e}function ih({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function bu(t){const e=fn(Ui),n=fn(jl);let r=!1,o=null;const i=ce(()=>{const u=zr(t.to);return(!r||u!==o)&&(bi(u)||(r?qe(`Invalid value for prop "to" in useLink()
|
|
49
|
-
- to:`,u,`
|
|
50
|
-
- previous to:`,o,`
|
|
51
|
-
- props:`,t):qe(`Invalid value for prop "to" in useLink()
|
|
52
|
-
- to:`,u,`
|
|
53
|
-
- props:`,t)),o=u,r=!0),e.resolve(u)}),s=ce(()=>{const{matched:u}=i.value,{length:c}=u,h=u[c-1],b=n.matched;if(!h||!b.length)return-1;const E=b.findIndex(Cr.bind(null,h));if(E>-1)return E;const C=_u(u[c-2]);return c>1&&_u(h)===C&&b[b.length-1].path!==C?b.findIndex(Cr.bind(null,u[c-2])):E}),a=ce(()=>s.value>-1&&hb(n.params,i.value.params)),l=ce(()=>s.value>-1&&s.value===n.matched.length-1&&zf(n.params,i.value.params));function d(u={}){if(fb(u)){const c=e[zr(t.replace)?"replace":"push"](zr(t.to)).catch(ls);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}if(qn){const u=Fo();if(u){const c={route:i.value,isActive:a.value,isExactActive:l.value,error:null};u.__vrl_devtools=u.__vrl_devtools||[],u.__vrl_devtools.push(c),jm(()=>{c.route=i.value,c.isActive=a.value,c.isExactActive=l.value,c.error=bi(zr(t.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:i,href:ce(()=>i.value.href),isActive:a,isExactActive:l,navigate:d}}function cb(t){return t.length===1?t[0]:t}const ub=jt({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:bu,setup(t,{slots:e}){const n=xi(bu(t)),{options:r}=fn(Ui),o=ce(()=>({[wu(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[wu(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&cb(e.default(n));return t.custom?i:Dl("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},i)}}}),db=ub;function fb(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function hb(t,e){for(const n in e){const r=e[n],o=t[n];if(typeof r=="string"){if(r!==o)return!1}else if(!tn(o)||o.length!==r.length||r.some((i,s)=>i.valueOf()!==o[s].valueOf()))return!1}return!0}function _u(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const wu=(t,e,n)=>t??e??n,pb=jt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){gb();const r=fn(tl),o=ce(()=>t.route||r.value),i=fn(fu,0),s=ce(()=>{let d=zr(i);const{matched:u}=o.value;let c;for(;(c=u[d])&&!c.components;)d++;return d}),a=ce(()=>o.value.matched[s.value]);Js(fu,ce(()=>s.value+1)),Js(Ey,a),Js(tl,o);const l=D();return yt(()=>[l.value,a.value,t.name],([d,u,c],[h,b,E])=>{u&&(u.instances[c]=d,b&&b!==u&&d&&d===h&&(u.leaveGuards.size||(u.leaveGuards=b.leaveGuards),u.updateGuards.size||(u.updateGuards=b.updateGuards))),d&&u&&(!b||!Cr(u,b)||!h)&&(u.enterCallbacks[c]||[]).forEach(C=>C(d))},{flush:"post"}),()=>{const d=o.value,u=t.name,c=a.value,h=c&&c.components[u];if(!h)return Tu(n.default,{Component:h,route:d});const b=c.props[u],E=b?b===!0?d.params:typeof b=="function"?b(d):b:null,W=Dl(h,rt({},E,e,{onVnodeUnmounted:L=>{L.component.isUnmounted&&(c.instances[u]=null)},ref:l}));if(qn&&W.ref){const L={depth:s.value,name:c.name,path:c.path,meta:c.meta};(tn(W.ref)?W.ref.map(M=>M.i):[W.ref.i]).forEach(M=>{M.__vrv_devtools=L})}return Tu(n.default,{Component:W,route:d})||W}}});function Tu(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const mb=pb;function gb(){const t=Fo(),e=t.parent&&t.parent.type.name,n=t.parent&&t.parent.subTree&&t.parent.subTree.type;if(e&&(e==="KeepAlive"||e.includes("Transition"))&&typeof n=="object"&&n.name==="RouterView"){const r=e==="KeepAlive"?"keep-alive":"transition";qe(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
|
|
54
|
-
Use slot props instead:
|
|
55
|
-
|
|
56
|
-
<router-view v-slot="{ Component }">
|
|
57
|
-
<${r}>
|
|
58
|
-
<component :is="Component" />
|
|
59
|
-
</${r}>
|
|
60
|
-
</router-view>`)}}function vb(t){const e=eb(t.routes,t),n=t.parseQuery||ky,r=t.stringifyQuery||du,o=t.history;if(!o)throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');const i=Yo(),s=Yo(),a=Yo(),l=lm(mr);let d=mr;qn&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=oa.bind(null,x=>""+x),c=oa.bind(null,ly),h=oa.bind(null,Mo);function b(x,oe){let Y,ue;return Jf(x)?(Y=e.getRecordMatcher(x),Y||qe(`Parent route "${String(x)}" not found when adding child route`,oe),ue=oe):ue=x,e.addRoute(ue,Y)}function E(x){const oe=e.getRecordMatcher(x);oe?e.removeRoute(oe):qe(`Cannot remove non-existent route "${String(x)}"`)}function C(){return e.getRoutes().map(x=>x.record)}function W(x){return!!e.getRecordMatcher(x)}function L(x,oe){if(oe=rt({},oe||l.value),typeof x=="string"){const v=sa(n,x,oe.path),y=e.resolve({path:v.path},oe),A=o.createHref(v.fullPath);return A.startsWith("//")?qe(`Location "${x}" resolved to "${A}". A resolved location cannot start with multiple slashes.`):y.matched.length||qe(`No match found for location with path "${x}"`),rt(v,y,{params:h(y.params),hash:Mo(v.hash),redirectedFrom:void 0,href:A})}if(!bi(x))return qe(`router.resolve() was passed an invalid location. This will fail in production.
|
|
61
|
-
- Location:`,x),L({});let Y;if(x.path!=null)"params"in x&&!("name"in x)&&Object.keys(x.params).length&&qe(`Path "${x.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),Y=rt({},x,{path:sa(n,x.path,oe.path).path});else{const v=rt({},x.params);for(const y in v)v[y]==null&&delete v[y];Y=rt({},x,{params:c(v)}),oe.params=c(oe.params)}const ue=e.resolve(Y,oe),be=x.hash||"";be&&!be.startsWith("#")&&qe(`A \`hash\` should always start with the character "#". Replace "${be}" with "#${be}".`),ue.params=u(h(ue.params));const Ge=dy(r,rt({},x,{hash:sy(be),path:ue.path})),p=o.createHref(Ge);return p.startsWith("//")?qe(`Location "${x}" resolved to "${p}". A resolved location cannot start with multiple slashes.`):ue.matched.length||qe(`No match found for location with path "${x.path!=null?x.path:x}"`),rt({fullPath:Ge,hash:be,query:r===du?Iy(x.query):x.query||{}},ue,{redirectedFrom:void 0,href:p})}function M(x){return typeof x=="string"?sa(n,x,l.value.path):rt({},x)}function H(x,oe){if(d!==x)return No(kt.NAVIGATION_CANCELLED,{from:oe,to:x})}function X(x){return re(x)}function U(x){return X(rt(M(x),{replace:!0}))}function Q(x,oe){const Y=x.matched[x.matched.length-1];if(Y&&Y.redirect){const{redirect:ue}=Y;let be=typeof ue=="function"?ue(x,oe):ue;if(typeof be=="string"&&(be=be.includes("?")||be.includes("#")?be=M(be):{path:be},be.params={}),be.path==null&&!("name"in be))throw qe(`Invalid redirect found:
|
|
62
|
-
${JSON.stringify(be,null,2)}
|
|
63
|
-
when navigating to "${x.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return rt({query:x.query,hash:x.hash,params:be.path!=null?{}:x.params},be)}}function re(x,oe){const Y=d=L(x),ue=l.value,be=x.state,Ge=x.force,p=x.replace===!0,v=Q(Y,ue);if(v)return re(rt(M(v),{state:typeof v=="object"?rt({},be,v.state):be,force:Ge,replace:p}),oe||Y);const y=Y;y.redirectedFrom=oe;let A;return!Ge&&lu(r,ue,Y)&&(A=No(kt.NAVIGATION_DUPLICATED,{to:y,from:ue}),ze(ue,ue,!0,!1)),(A?Promise.resolve(A):te(y,ue)).catch(R=>Hn(R)?Hn(R,kt.NAVIGATION_GUARD_REDIRECT)?R:Xe(R):ke(R,y,ue)).then(R=>{if(R){if(Hn(R,kt.NAVIGATION_GUARD_REDIRECT))return lu(r,L(R.to),y)&&oe&&(oe._count=oe._count?oe._count+1:1)>30?(qe(`Detected a possibly infinite redirection in a navigation guard when going from "${ue.fullPath}" to "${y.fullPath}". Aborting to avoid a Stack Overflow.
|
|
64
|
-
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):re(rt({replace:p},M(R.to),{state:typeof R.to=="object"?rt({},be,R.to.state):be,force:Ge}),oe||y)}else R=q(y,ue,!0,p,be);return Ae(y,ue,R),R})}function me(x,oe){const Y=H(x,oe);return Y?Promise.reject(Y):Promise.resolve()}function z(x){const oe=ft.values().next().value;return oe&&typeof oe.runWithContext=="function"?oe.runWithContext(x):x()}function te(x,oe){let Y;const[ue,be,Ge]=Ay(x,oe);Y=aa(ue.reverse(),"beforeRouteLeave",x,oe);for(const v of ue)v.leaveGuards.forEach(y=>{Y.push(br(y,x,oe))});const p=me.bind(null,x,oe);return Y.push(p),nt(Y).then(()=>{Y=[];for(const v of i.list())Y.push(br(v,x,oe));return Y.push(p),nt(Y)}).then(()=>{Y=aa(be,"beforeRouteUpdate",x,oe);for(const v of be)v.updateGuards.forEach(y=>{Y.push(br(y,x,oe))});return Y.push(p),nt(Y)}).then(()=>{Y=[];for(const v of Ge)if(v.beforeEnter)if(tn(v.beforeEnter))for(const y of v.beforeEnter)Y.push(br(y,x,oe));else Y.push(br(v.beforeEnter,x,oe));return Y.push(p),nt(Y)}).then(()=>(x.matched.forEach(v=>v.enterCallbacks={}),Y=aa(Ge,"beforeRouteEnter",x,oe,z),Y.push(p),nt(Y))).then(()=>{Y=[];for(const v of s.list())Y.push(br(v,x,oe));return Y.push(p),nt(Y)}).catch(v=>Hn(v,kt.NAVIGATION_CANCELLED)?v:Promise.reject(v))}function Ae(x,oe,Y){a.list().forEach(ue=>z(()=>ue(x,oe,Y)))}function q(x,oe,Y,ue,be){const Ge=H(x,oe);if(Ge)return Ge;const p=oe===mr,v=qn?history.state:{};Y&&(ue||p?o.replace(x.fullPath,rt({scroll:p&&v&&v.scroll},be)):o.push(x.fullPath,be)),l.value=x,ze(x,oe,Y,p),Xe()}let ye;function Re(){ye||(ye=o.listen((x,oe,Y)=>{if(!ht.listening)return;const ue=L(x),be=Q(ue,ht.currentRoute.value);if(be){re(rt(be,{replace:!0,force:!0}),ue).catch(ls);return}d=ue;const Ge=l.value;qn&&by(uu(Ge.fullPath,Y.delta),ji()),te(ue,Ge).catch(p=>Hn(p,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?p:Hn(p,kt.NAVIGATION_GUARD_REDIRECT)?(re(rt(M(p.to),{force:!0}),ue).then(v=>{Hn(v,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!Y.delta&&Y.type===Za.pop&&o.go(-1,!1)}).catch(ls),Promise.reject()):(Y.delta&&o.go(-Y.delta,!1),ke(p,ue,Ge))).then(p=>{p=p||q(ue,Ge,!1),p&&(Y.delta&&!Hn(p,kt.NAVIGATION_CANCELLED)?o.go(-Y.delta,!1):Y.type===Za.pop&&Hn(p,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),Ae(ue,Ge,p)}).catch(ls)}))}let Ue=Yo(),Ve=Yo(),ae;function ke(x,oe,Y){Xe(x);const ue=Ve.list();return ue.length?ue.forEach(be=>be(x,oe,Y)):(qe("uncaught error during route navigation:"),console.error(x)),Promise.reject(x)}function it(){return ae&&l.value!==mr?Promise.resolve():new Promise((x,oe)=>{Ue.add([x,oe])})}function Xe(x){return ae||(ae=!x,Re(),Ue.list().forEach(([oe,Y])=>x?Y(x):oe()),Ue.reset()),x}function ze(x,oe,Y,ue){const{scrollBehavior:be}=t;if(!qn||!be)return Promise.resolve();const Ge=!Y&&_y(uu(x.fullPath,0))||(ue||!Y)&&history.state&&history.state.scroll||null;return en().then(()=>be(x,oe,Ge)).then(p=>p&&yy(p)).catch(p=>ke(p,x,oe))}const at=x=>o.go(x);let Fe;const ft=new Set,ht={currentRoute:l,listening:!0,addRoute:b,removeRoute:E,clearRoutes:e.clearRoutes,hasRoute:W,getRoutes:C,resolve:L,options:t,push:X,replace:U,go:at,back:()=>at(-1),forward:()=>at(1),beforeEach:i.add,beforeResolve:s.add,afterEach:a.add,onError:Ve.add,isReady:it,install(x){x.component("RouterLink",db),x.component("RouterView",mb),x.config.globalProperties.$router=ht,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>zr(l)}),qn&&!Fe&&l.value===mr&&(Fe=!0,X(o.location).catch(ue=>{qe("Unexpected error when starting the router:",ue)}));const oe={};for(const ue in mr)Object.defineProperty(oe,ue,{get:()=>l.value[ue],enumerable:!0});x.provide(Ui,ht),x.provide(jl,jd(oe)),x.provide(tl,l);const Y=x.unmount;ft.add(x),x.unmount=function(){ft.delete(x),ft.size<1&&(d=mr,ye&&ye(),ye=null,l.value=mr,Fe=!1,ae=!1),Y()},qn&&xy(x,ht,e)}};function nt(x){return x.reduce((oe,Y)=>oe.then(()=>z(Y)),Promise.resolve())}return ht}function yb(){return fn(Ui)}function bb(t){return fn(jl)}const Su=768;function ah(){const t=D(typeof window<"u"?window.innerWidth<Su:!1);let e=null;function n(r){t.value=r.matches}return Ar(()=>{e=window.matchMedia(`(max-width: ${Su-1}px)`),t.value=e.matches,e.addEventListener("change",n)}),Ni(()=>{e==null||e.removeEventListener("change",n)}),{isMobile:t}}const la="codex-web-local.sidebar-width.v1",ku=260,Iu=620,ca=320,_b=jt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,required:!1,default:!1}},emits:["close-sidebar"],setup(t,{expose:e}){e();const n=t,{isMobile:r}=ah();function o(c){return Math.min(Iu,Math.max(ku,c))}function i(){if(typeof window>"u")return ca;const c=window.localStorage.getItem(la),h=Number(c);return Number.isFinite(h)?o(h):ca}const s=D(i()),a=ce(()=>r.value||n.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${s.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function l(c){typeof window>"u"||window.localStorage.setItem(la,String(c))}function d(c){c.preventDefault();const h=c.clientX,b=s.value,E=W=>{const L=W.clientX-h;s.value=o(b+L)},C=()=>{l(s.value),window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",C)};window.addEventListener("mousemove",E),window.addEventListener("mouseup",C)}const u={props:n,isMobile:r,SIDEBAR_WIDTH_KEY:la,MIN_SIDEBAR_WIDTH:ku,MAX_SIDEBAR_WIDTH:Iu,DEFAULT_SIDEBAR_WIDTH:ca,clampSidebarWidth:o,loadSidebarWidth:i,sidebarWidth:s,layoutStyle:a,saveSidebarWidth:l,onResizeHandleMouseDown:d};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),tt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},wb={key:0,class:"desktop-sidebar"},Tb={class:"desktop-main"};function Sb(t,e,n,r,o,i){return T(),I("div",{class:dt(["desktop-layout",{"is-mobile":r.isMobile}]),style:oo(r.layoutStyle)},[r.isMobile?(T(),vt(di,{key:0,to:"body"},[Ce(Bf,{name:"drawer"},{default:lt(()=>[n.isSidebarCollapsed?ie("v-if",!0):(T(),I("div",{key:0,class:"mobile-drawer-backdrop",onClick:e[1]||(e[1]=s=>t.$emit("close-sidebar"))},[g("aside",{class:"mobile-drawer",onClick:e[0]||(e[0]=Je(()=>{},["stop"]))},[Mn(t.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ie("v-if",!0),r.isMobile?ie("v-if",!0):(T(),I(je,{key:1},[n.isSidebarCollapsed?ie("v-if",!0):(T(),I("aside",wb,[Mn(t.$slots,"sidebar",{},void 0)])),n.isSidebarCollapsed?ie("v-if",!0):(T(),I("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:r.onResizeHandleMouseDown},null,32))],64)),g("section",Tb,[Mn(t.$slots,"content",{},void 0)])],6)}const kb=tt(_b,[["render",Sb],["__scopeId","data-v-d3551ba8"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/layout/DesktopLayout.vue"]]),Ib={},Eb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cb(t,e){return T(),I("svg",Eb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Ul=tt(Ib,[["render",Cb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerChevronDown.vue"]]),Ab={},Rb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xb(t,e){return T(),I("svg",Rb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const lh=tt(Ab,[["render",xb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerChevronRight.vue"]]),Pb={},Ob={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Mb(t,e){return T(),I("svg",Ob,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Nb=tt(Pb,[["render",Mb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerDots.vue"]]),Db={},Lb={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function jb(t,e){return T(),I("svg",Lb,[ie(" Icon from Tabler Icons by Paweł Kuna - https://github.com/tabler/tabler-icons/blob/master/LICENSE "),e[0]||(e[0]=g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1))])}const Fl=tt(Db,[["render",jb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerFilePencil.vue"]]),Ub={},Fb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Bb(t,e){return T(),I("svg",Fb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Hb=tt(Ub,[["render",Bb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerFolder.vue"]]),$b={},Vb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wb(t,e){return T(),I("svg",Vb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const qb=tt($b,[["render",Wb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerFolderOpen.vue"]]),Gb={},Kb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zb(t,e){return T(),I("svg",Kb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Jb=tt(Gb,[["render",zb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerGitFork.vue"]]),Yb={},Qb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xb(t,e){return T(),I("svg",Qb,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Zb=tt(Yb,[["render",Xb],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerPin.vue"]]),e_=jt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{type:String,required:!1,default:"div"},forceRightHover:{type:Boolean,required:!1,default:!1}},setup(t,{expose:e}){e();const n=t,r=sg(),o=ce(()=>!!r.left),i=ce(()=>!!r.right),s=ce(()=>!!r["right-hover"]),a=ce(()=>i.value||s.value),l={props:n,slots:r,hasLeft:o,hasRightDefault:i,hasRightHover:s,hasRight:a};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}}),t_={key:0,class:"sidebar-menu-row-left"},n_={class:"sidebar-menu-row-main"},r_={key:1,class:"sidebar-menu-row-right"},o_={key:0,class:"sidebar-menu-row-right-default"},s_={key:1,class:"sidebar-menu-row-right-hover"};function i_(t,e,n,r,o,i){return T(),vt(eg(r.props.as),Mf({class:"sidebar-menu-row","data-has-left":r.hasLeft,"data-has-right":r.hasRight,"data-has-right-hover":r.hasRightHover,"data-force-right-hover":r.props.forceRightHover},t.$attrs),{default:lt(()=>[r.hasLeft?(T(),I("span",t_,[Mn(t.$slots,"left",{},void 0,!0)])):ie("v-if",!0),g("span",n_,[Mn(t.$slots,"default",{},void 0,!0)]),r.hasRight?(T(),I("span",r_,[r.hasRightDefault?(T(),I("span",o_,[Mn(t.$slots,"right",{},void 0,!0)])):ie("v-if",!0),r.hasRightHover?(T(),I("span",s_,[Mn(t.$slots,"right-hover",{},void 0,!0)])):ie("v-if",!0)])):ie("v-if",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"])}const a_=tt(e_,[["render",i_],["__scopeId","data-v-df896d4f"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/sidebar/SidebarMenuRow.vue"]]),Eu=4,ua=6,da="codex-web-local.thread-view-mode.v1",fa="codex-web-local.collapsed-projects.v1",l_=jt({__name:"SidebarThreadTree",props:{groups:{type:Array,required:!0},projectDisplayNameById:{type:Object,required:!0},selectedThreadId:{type:String,required:!0},isLoading:{type:Boolean,required:!0},searchQuery:{type:String,required:!0}},emits:["select","archive","start-new-thread","rename-project","rename-thread","remove-project","reorder-project"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D({}),s=D({}),a=D([]),l=D(""),d=D(""),u=D("actions"),c=D(""),h=D(!1),b=D(""),E=D(""),C=D(null),W=D(!1),L=D(""),M=D(""),H=D(null),X=D(null),U=D(null);let Q=null,re=null;const me=D(""),z=D({}),te=new Map,Ae=new Map,q=new Map,ye=new WeakMap,Re=D(null),Ue=D(!1),Ve=D(it()),ae=typeof window<"u"?new ResizeObserver(S=>{for(const F of S){const se=F.target,Se=ye.get(se);Se&&sr(Se,se)}}):null;function ke(){if(typeof window>"u")return{};try{const S=window.localStorage.getItem(fa);if(!S)return{};const F=JSON.parse(S);return!F||typeof F!="object"||Array.isArray(F)?{}:F}catch{return{}}}function it(){return typeof window>"u"?"project":window.localStorage.getItem(da)==="chronological"?"chronological":"project"}s.value=ke(),yt(s,S=>{typeof window>"u"||window.localStorage.setItem(fa,JSON.stringify(S))},{deep:!0}),yt(Ve,S=>{typeof window>"u"||window.localStorage.setItem(da,S)});const Xe=ce(()=>r.searchQuery.trim().toLowerCase()),ze=ce(()=>Xe.value.length>0);function at(S){if(!ze.value)return!0;const F=Xe.value;return S.title.toLowerCase().includes(F)||S.preview.toLowerCase().includes(F)}const Fe=ce(()=>ze.value?r.groups.map(S=>({...S,threads:S.threads.filter(at)})).filter(S=>S.threads.length>0):r.groups),ft=ce(()=>Ve.value==="chronological"),ht=ce(()=>{const S=Fe.value,F=[];for(const se of S)for(const Se of se.threads)p(Se.id)||F.push(Se);return F.sort((se,Se)=>{const Be=new Date(se.updatedAtIso||se.createdAtIso).getTime();return new Date(Se.updatedAtIso||Se.createdAtIso).getTime()-Be})}),nt=ce(()=>{const S=new Map;for(const F of r.groups)for(const se of F.threads)S.set(se.id,se);return S}),x=ce(()=>a.value.map(S=>nt.value.get(S)??null).filter(S=>S!==null).filter(at)),oe=ce(()=>{const S=U.value;if(!S||S.dropTargetIndexFull===null||r.groups.length===0)return null;const F=Math.max(0,Math.min(S.dropTargetIndexFull,r.groups.length)),se=F>S.fromIndex?F-1:F,Se=Math.max(0,Math.min(se,r.groups.length-1));return Se===S.fromIndex?null:Se}),Y=ce(()=>{const F=(ze.value?Fe.value:r.groups).map(Ht=>Ht.projectName),se=U.value,Se=oe.value;if(!se||Se===null)return F;const Be=[...F],[wt]=Be.splice(se.fromIndex,1);return wt?(Be.splice(Se,0,wt),Be):F}),ue=ce(()=>{const S={};let F=0;for(const se of Y.value)S[se]=F,F+=Et(se);return S}),be=ce(()=>{let S=0;for(const F of Y.value)S+=Et(F);return{height:`${Math.max(0,S)}px`}});function Ge(S){const F=new Date(S).getTime();if(Number.isNaN(F))return"n/a";const se=Math.abs(Date.now()-F);if(se<6e4)return"now";const Se=Math.floor(se/6e4);if(Se<60)return`${Se}m`;const Be=Math.floor(Se/60);return Be<24?`${Be}h`:`${Math.floor(Be/24)}d`}function p(S){return a.value.includes(S)}function v(S){if(p(S)){a.value=a.value.filter(F=>F!==S);return}a.value=[S,...a.value]}function y(S){o("select",S)}function A(S){return`start new thread ${Me(S)}`}function R(S){o("start-new-thread",S)}function P(S){d.value===S&&V()}function $(S){return d.value===S}function V(){d.value=""}function J(S){if(d.value===S){V();return}d.value=S}function B(S,F){b.value=S,E.value=F,h.value=!0,V(),en(()=>{var se,Se;(se=C.value)==null||se.focus(),(Se=C.value)==null||Se.select()})}function pe(){h.value=!1,b.value="",E.value=""}function ee(){const S=b.value,F=E.value.trim();!S||!F||(o("rename-thread",{threadId:S,title:F}),pe())}function de(S,F){L.value=S,M.value=F,W.value=!0,V()}function Ee(){W.value=!1,L.value="",M.value=""}function Oe(){const S=L.value;S&&(a.value=a.value.filter(F=>F!==S),o("archive",S),Ee())}function Me(S){return r.projectDisplayNameById[S]??S}function Ke(S){return l.value===S}function Ze(){l.value="",u.value="actions",c.value=""}function pt(){Ue.value=!Ue.value}function ct(S){Ve.value=S,Ue.value=!1}function j(S){if(l.value===S){Ze();return}l.value=S,u.value="actions",c.value=Me(S)}function ne(S){l.value=S,u.value="rename",c.value=Me(S)}function we(S){o("rename-project",{projectName:S,displayName:c.value})}function w(S){o("remove-project",S),Ze()}function N(S,F){if(!S.altKey||S.key!=="ArrowUp"&&S.key!=="ArrowDown")return;const se=r.groups.findIndex(wt=>wt.projectName===F);if(se<0)return;const Se=S.key==="ArrowUp"?-1:1,Be=Math.max(0,Math.min(se+Se,r.groups.length-1));Be!==se&&(S.preventDefault(),o("reorder-project",{projectName:F,toIndex:Be}))}function le(S){return i.value[S]===!0}function _e(S){return s.value[S]===!0}function De(S){i.value={...i.value,[S]:!le(S)}}function mt(S){if(me.value===S){me.value="";return}s.value={...s.value,[S]:!_e(S)}}function Et(S){const F=z.value[S]??0,se=U.value,Be=((se==null?void 0:se.projectName)===S?se.groupHeight:null)??F,wt=_e(S)?0:ua;return Math.max(0,Be+wt)}function Ot(S,F){const se=F instanceof HTMLElement?F:F&&"$el"in F&&F.$el instanceof HTMLElement?F.$el:null;if(se){Ae.set(S,se);return}Ae.delete(S)}function gt(S,F){const se=F instanceof HTMLElement?F:F&&"$el"in F&&F.$el instanceof HTMLElement?F.$el:null;if(se){q.set(S,se);return}q.delete(S)}function Te(S){const F=l.value;if(!F)return!1;const se=Ae.get(F);if(!se)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(se))return!0;const Be=S.target;return Be instanceof Node?se.contains(Be):!1}function Ie(S){const F=d.value;if(!F)return!1;const se=q.get(F);if(!se)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(se))return!0;const Be=S.target;return Be instanceof Node?se.contains(Be):!1}function nn(S){if(Ue.value){const F=Re.value,se=typeof S.composedPath=="function"?S.composedPath():[];!!F&&(se.includes(F)||S.target instanceof Node&&F.contains(S.target))||(Ue.value=!1)}l.value&&(Te(S)||Ze(),d.value&&(Ie(S)||V()))}function Dt(S){l.value&&!Te(S)&&Ze(),d.value&&!Ie(S)&&V()}function Pr(){Ue.value&&(Ue.value=!1),l.value&&Ze(),d.value&&V()}function lo(){window.addEventListener("pointerdown",nn,{capture:!0}),window.addEventListener("focusin",Dt,{capture:!0}),window.addEventListener("blur",Pr)}function or(){window.removeEventListener("pointerdown",nn,{capture:!0}),window.removeEventListener("focusin",Dt,{capture:!0}),window.removeEventListener("blur",Pr)}function sr(S,F){const se=F.getBoundingClientRect().height;if(!Number.isFinite(se)||se<=0)return;const Se=z.value[S];Se!==void 0&&Math.abs(Se-se)<.5||(z.value={...z.value,[S]:se})}function sn(S,F){const se=te.get(S);se&&se!==F&&ae&&ae.unobserve(se);const Se=F instanceof HTMLElement?F:F&&"$el"in F&&F.$el instanceof HTMLElement?F.$el:null;if(Se){te.set(S,Se),ye.set(Se,S),sr(S,Se),ae==null||ae.observe(Se);return}se&&(ae==null||ae.unobserve(se)),te.delete(S)}function Or(S,F){if(S.button!==0||X.value||U.value)return;const se=r.groups.findIndex(Ht=>Ht.projectName===F),Se=te.get(F);if(se<0||!Se)return;const Be=Se.getBoundingClientRect(),wt=_e(F)?0:ua;X.value={projectName:F,fromIndex:se,startClientX:S.clientX,startClientY:S.clientY,pointerOffsetY:S.clientY-Be.top,groupLeft:Be.left,groupWidth:Be.width,groupHeight:Be.height,groupOuterHeight:Be.height+wt},S.preventDefault(),Mr()}function Mr(){window.addEventListener("mousemove",Nr),window.addEventListener("mouseup",ir),window.addEventListener("keydown",wn)}function co(){window.removeEventListener("mousemove",Nr),window.removeEventListener("mouseup",ir),window.removeEventListener("keydown",wn)}function Nr(S){Q={clientX:S.clientX,clientY:S.clientY},ar()}function ir(S){lr({clientX:S.clientX,clientY:S.clientY});const F=U.value;if(F&&oe.value!==null){const se=r.groups.findIndex(Se=>Se.projectName===F.projectName);if(se>=0){const Se=oe.value;Se!==se&&o("reorder-project",{projectName:F.projectName,toIndex:Se})}}Qt()}function wn(S){S.key==="Escape"&&(!X.value&&!U.value||(S.preventDefault(),Qt()))}function Qt(){re!==null&&(window.cancelAnimationFrame(re),re=null),Q=null,X.value=null,U.value=null,me.value="",co()}function ar(){re===null&&(re=window.requestAnimationFrame(()=>{if(re=null,!Q)return;const S=Q;Q=null,lr(S)}))}function lr(S){const F=X.value;if(!U.value&&F){const se=S.clientX-F.startClientX,Se=S.clientY-F.startClientY;if(Math.hypot(se,Se)<Eu)return;Ze(),me.value=F.projectName,U.value={projectName:F.projectName,fromIndex:F.fromIndex,pointerOffsetY:F.pointerOffsetY,groupLeft:F.groupLeft,groupWidth:F.groupWidth,groupHeight:F.groupHeight,groupOuterHeight:F.groupOuterHeight,ghostTop:S.clientY-F.pointerOffsetY,dropTargetIndexFull:null}}U.value&&cr(S)}function cr(S){const F=U.value;if(!F)return;if(F.ghostTop=S.clientY-F.pointerOffsetY,!ur(S)){F.dropTargetIndexFull=null;return}const se=S.clientY,Se=H.value;if(!Se){F.dropTargetIndexFull=null;return}const Be=Se.getBoundingClientRect(),wt=new Map(r.groups.map((Xt,O)=>[Xt.projectName,O])),Ht=r.groups.map(Xt=>Xt.projectName).filter(Xt=>Xt!==F.projectName);let fr=0,Lr=r.groups.length;for(const Xt of Ht){const O=wt.get(Xt);if(O===void 0)continue;const ve=Et(Xt),He=Be.top+fr+ve/2;if(se<He){Lr=O;break}fr+=ve}F.dropTargetIndexFull=Lr}function ur(S){const F=H.value;if(!F)return!1;const se=F.getBoundingClientRect(),Se=S.clientX>=se.left&&S.clientX<=se.right,Be=S.clientY>=se.top-32&&S.clientY<=se.bottom+32;return Se&&Be}function uo(S){var F;return((F=U.value)==null?void 0:F.projectName)===S}function Vo(S){const F=U.value,se=ue.value[S]??0,Se=l.value===S;return!F||F.projectName!==S?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Se?"40":"1",transform:`translate3d(0, ${se}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${F.groupLeft}px`,width:`${F.groupWidth}px`,height:`${F.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${F.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(S){return S.threads.filter(F=>!p(F.id))}function Wo(S){if(ze.value)return jn(S);if(_e(S.projectName))return[];const F=jn(S);return le(S.projectName)?F:F.slice(0,10)}function qo(S){return ze.value?!1:!_e(S.projectName)&&jn(S).length>10}function dr(S){return jn(S).length>0}function fo(S){return S.inProgress?"working":S.unread?"unread":"idle"}yt(()=>r.groups.map(S=>S.projectName),S=>{var Be,wt;const F=((Be=U.value)==null?void 0:Be.projectName)??((wt=X.value)==null?void 0:wt.projectName)??"";F&&!r.groups.some(Ht=>Ht.projectName===F)&&Qt();const se=new Set(S),Se=Object.fromEntries(Object.entries(z.value).filter(([Ht])=>se.has(Ht)));Object.keys(Se).length!==Object.keys(z.value).length&&(z.value=Se)});const Dr=ce(()=>Ue.value||l.value!=="");yt(Dr,S=>{if(S){lo();return}or()}),Rr(()=>{for(const S of te.values())ae==null||ae.unobserve(S);te.clear(),Ae.clear(),or(),Qt()});const ho={props:r,emit:o,DRAG_START_THRESHOLD_PX:Eu,PROJECT_GROUP_EXPANDED_GAP_PX:ua,expandedProjects:i,collapsedProjects:s,pinnedThreadIds:a,openProjectMenuId:l,openThreadMenuId:d,projectMenuMode:u,projectRenameDraft:c,renameThreadDialogVisible:h,renameThreadDialogThreadId:b,renameThreadDraft:E,renameThreadInputRef:C,deleteThreadDialogVisible:W,deleteThreadDialogThreadId:L,deleteThreadTitle:M,groupsContainerRef:H,pendingProjectDrag:X,activeProjectDrag:U,get pendingDragPointerSample(){return Q},set pendingDragPointerSample(S){Q=S},get dragPointerRafId(){return re},set dragPointerRafId(S){re=S},suppressNextProjectToggleId:me,measuredHeightByProject:z,projectGroupElementByName:te,projectMenuWrapElementByName:Ae,threadMenuWrapElementById:q,projectNameByElement:ye,organizeMenuWrapRef:Re,isOrganizeMenuOpen:Ue,THREAD_VIEW_MODE_STORAGE_KEY:da,threadViewMode:Ve,projectGroupResizeObserver:ae,COLLAPSED_STORAGE_KEY:fa,loadCollapsedState:ke,loadThreadViewMode:it,normalizedSearchQuery:Xe,isSearchActive:ze,threadMatchesSearch:at,filteredGroups:Fe,isChronologicalView:ft,globalThreads:ht,threadById:nt,pinnedThreads:x,projectedDropProjectIndex:oe,layoutProjectOrder:Y,layoutTopByProject:ue,groupsContainerStyle:be,formatRelative:Ge,isPinned:p,togglePin:v,onSelect:y,getNewThreadButtonAriaLabel:A,onStartNewThread:R,onThreadRowLeave:P,isThreadMenuOpen:$,closeThreadMenu:V,toggleThreadMenu:J,openRenameThreadDialog:B,closeRenameThreadDialog:pe,submitRenameThread:ee,openDeleteThreadDialog:de,closeDeleteThreadDialog:Ee,submitDeleteThread:Oe,getProjectDisplayName:Me,isProjectMenuOpen:Ke,closeProjectMenu:Ze,toggleOrganizeMenu:pt,setThreadViewMode:ct,toggleProjectMenu:j,openRenameProjectMenu:ne,onProjectNameInput:we,onRemoveProject:w,onProjectHeaderKeyDown:N,isExpanded:le,isCollapsed:_e,toggleProjectExpansion:De,toggleProjectCollapse:mt,getProjectOuterHeight:Et,setProjectMenuWrapRef:Ot,setThreadMenuWrapRef:gt,isEventInsideOpenProjectMenu:Te,isEventInsideOpenThreadMenu:Ie,onProjectMenuPointerDown:nn,onProjectMenuFocusIn:Dt,onWindowBlurForProjectMenu:Pr,bindProjectMenuDismissListeners:lo,unbindProjectMenuDismissListeners:or,updateMeasuredProjectHeight:sr,setProjectGroupRef:sn,onProjectHandleMouseDown:Or,bindProjectDragListeners:Mr,unbindProjectDragListeners:co,onProjectDragMouseMove:Nr,onProjectDragMouseUp:ir,onProjectDragKeyDown:wn,resetProjectDragState:Qt,scheduleProjectDragPointerFrame:ar,processProjectDragPointerSample:lr,updateProjectDropTarget:cr,isPointerInProjectDropZone:ur,isDraggingProject:uo,projectGroupStyle:Vo,projectThreads:jn,visibleThreads:Wo,hasHiddenThreads:qo,hasThreads:dr,getThreadState:fo,hasOpenDismissableMenu:Dr,IconTablerChevronDown:Ul,IconTablerChevronRight:lh,IconTablerDots:Nb,IconTablerFilePencil:Fl,IconTablerFolder:Hb,IconTablerFolderOpen:qb,IconTablerGitFork:Jb,IconTablerPin:Zb,SidebarMenuRow:a_};return Object.defineProperty(ho,"__isScriptSetup",{enumerable:!1,value:!0}),ho}}),c_={class:"thread-tree-root"},u_={key:0,class:"pinned-section"},d_={class:"thread-list"},f_={class:"thread-left-stack"},h_=["data-state"],p_=["onClick"],m_=["onClick"],g_={class:"thread-row-title-wrap"},v_={class:"thread-row-title"},y_={class:"thread-row-time"},b_=["onClick"],__=["onClick"],w_=["onClick"],T_={ref:"organizeMenuWrapRef",class:"organize-menu-wrap"},S_=["aria-expanded"],k_=["data-active"],I_={key:0},E_=["data-active"],C_={key:0},A_={key:1,class:"thread-tree-no-results"},R_={key:2,class:"thread-tree-loading"},x_={key:3,class:"thread-list thread-list-global"},P_={class:"thread-left-stack"},O_=["data-state"],M_=["onClick"],N_=["onClick"],D_={class:"thread-row-title-wrap"},L_={class:"thread-row-title"},j_={class:"thread-row-time"},U_=["onClick"],F_=["onClick"],B_=["onClick"],H_=["data-project-name","data-expanded","data-dragging"],$_={class:"project-icon-stack"},V_={class:"project-icon-folder"},W_={class:"project-icon-chevron"},q_=["data-dragging-handle","onMousedown"],G_={class:"project-title"},K_={class:"project-hover-controls"},z_=["onClick"],J_=["onClick"],Y_=["onClick"],Q_=["onInput"],X_=["aria-label","title","onClick"],Z_={key:0,class:"thread-list"},ew={class:"thread-left-stack"},tw=["data-state"],nw=["onClick"],rw=["onClick"],ow={class:"thread-row-title-wrap"},sw={class:"thread-row-title"},iw={class:"thread-row-time"},aw=["onClick"],lw=["onClick"],cw=["onClick"],uw=["onClick"],dw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},fw=["onKeydown"],hw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},pw={class:"rename-thread-subtitle"};function mw(t,e,n,r,o,i){return T(),I("section",c_,[r.pinnedThreads.length>0?(T(),I("section",u_,[g("ul",d_,[(T(!0),I(je,null,Tt(r.pinnedThreads,s=>(T(),I("li",{key:s.id,class:"thread-row-item"},[Ce(r.SidebarMenuRow,{class:"thread-row","data-active":s.id===n.selectedThreadId,"data-pinned":r.isPinned(s.id),onMouseleave:a=>r.onThreadRowLeave(s.id)},{left:lt(()=>[g("span",f_,[s.inProgress||s.unread?(T(),I("span",{key:0,class:"thread-status-indicator","data-state":r.getThreadState(s)},null,8,h_)):ie("v-if",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:a=>r.togglePin(s.id)},[Ce(r.IconTablerPin,{class:"thread-icon"})],8,p_)])]),right:lt(()=>[g("span",y_,fe(r.formatRelative(s.createdAtIso||s.updatedAtIso)),1)]),"right-hover":lt(()=>[g("div",{ref_for:!0,ref:a=>r.setThreadMenuWrapRef(s.id,a),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(a=>r.toggleThreadMenu(s.id),["stop"])},[Ce(r.IconTablerDots,{class:"thread-icon"})],8,b_),r.isThreadMenuOpen(s.id)?(T(),I("div",{key:0,class:"thread-menu-panel",onClick:e[0]||(e[0]=Je(()=>{},["stop"]))},[g("button",{class:"thread-menu-item",type:"button",onClick:a=>r.openRenameThreadDialog(s.id,s.title)}," Rename thread ",8,__),g("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:a=>r.openDeleteThreadDialog(s.id,s.title)}," Delete thread ",8,w_)])):ie("v-if",!0)],512)]),default:lt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:a=>r.onSelect(s.id)},[g("span",g_,[g("span",v_,fe(s.title),1),s.hasWorktree?(T(),vt(r.IconTablerGitFork,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("v-if",!0)])],8,m_)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ie("v-if",!0),Ce(r.SidebarMenuRow,{as:"header",class:"thread-tree-header-row"},{right:lt(()=>[g("div",T_,[g("button",{class:"organize-menu-trigger",type:"button","aria-expanded":r.isOrganizeMenuOpen,"aria-label":"Organize threads",title:"Organize threads",onClick:r.toggleOrganizeMenu},[Ce(r.IconTablerDots,{class:"thread-icon"})],8,S_),r.isOrganizeMenuOpen?(T(),I("div",{key:0,class:"organize-menu-panel",onClick:e[3]||(e[3]=Je(()=>{},["stop"]))},[e[11]||(e[11]=g("p",{class:"organize-menu-title"},"Organize",-1)),g("button",{class:"organize-menu-item","data-active":r.threadViewMode==="project",type:"button",onClick:e[1]||(e[1]=s=>r.setThreadViewMode("project"))},[e[9]||(e[9]=g("span",null,"By project",-1)),r.threadViewMode==="project"?(T(),I("span",I_,"✓")):ie("v-if",!0)],8,k_),g("button",{class:"organize-menu-item","data-active":r.threadViewMode==="chronological",type:"button",onClick:e[2]||(e[2]=s=>r.setThreadViewMode("chronological"))},[e[10]||(e[10]=g("span",null,"Chronological list",-1)),r.threadViewMode==="chronological"?(T(),I("span",C_,"✓")):ie("v-if",!0)],8,E_)])):ie("v-if",!0)],512)]),default:lt(()=>[e[12]||(e[12]=g("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),r.isSearchActive&&r.filteredGroups.length===0?(T(),I("p",A_,"No matching threads")):n.isLoading&&n.groups.length===0?(T(),I("p",R_,"Loading threads...")):r.isChronologicalView?(T(),I("ul",x_,[(T(!0),I(je,null,Tt(r.globalThreads,s=>(T(),I("li",{key:s.id,class:"thread-row-item"},[Ce(r.SidebarMenuRow,{class:"thread-row","data-active":s.id===n.selectedThreadId,"data-pinned":r.isPinned(s.id),onMouseleave:a=>r.onThreadRowLeave(s.id)},{left:lt(()=>[g("span",P_,[s.inProgress||s.unread?(T(),I("span",{key:0,class:"thread-status-indicator","data-state":r.getThreadState(s)},null,8,O_)):ie("v-if",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:a=>r.togglePin(s.id)},[Ce(r.IconTablerPin,{class:"thread-icon"})],8,M_)])]),right:lt(()=>[g("span",j_,fe(r.formatRelative(s.createdAtIso||s.updatedAtIso)),1)]),"right-hover":lt(()=>[g("div",{ref_for:!0,ref:a=>r.setThreadMenuWrapRef(s.id,a),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(a=>r.toggleThreadMenu(s.id),["stop"])},[Ce(r.IconTablerDots,{class:"thread-icon"})],8,U_),r.isThreadMenuOpen(s.id)?(T(),I("div",{key:0,class:"thread-menu-panel",onClick:e[4]||(e[4]=Je(()=>{},["stop"]))},[g("button",{class:"thread-menu-item",type:"button",onClick:a=>r.openRenameThreadDialog(s.id,s.title)}," Rename thread ",8,F_),g("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:a=>r.openDeleteThreadDialog(s.id,s.title)}," Delete thread ",8,B_)])):ie("v-if",!0)],512)]),default:lt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:a=>r.onSelect(s.id)},[g("span",D_,[g("span",L_,fe(s.title),1),s.hasWorktree?(T(),vt(r.IconTablerGitFork,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("v-if",!0)])],8,N_)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(T(),I("div",{key:4,ref:"groupsContainerRef",class:"thread-tree-groups",style:oo(r.groupsContainerStyle)},[(T(!0),I(je,null,Tt(r.filteredGroups,s=>(T(),I("article",{key:s.projectName,ref_for:!0,ref:a=>r.setProjectGroupRef(s.projectName,a),class:"project-group","data-project-name":s.projectName,"data-expanded":!r.isCollapsed(s.projectName),"data-dragging":r.isDraggingProject(s.projectName),style:oo(r.projectGroupStyle(s.projectName))},[Ce(r.SidebarMenuRow,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:a=>r.toggleProjectCollapse(s.projectName),onKeydown:[a=>r.onProjectHeaderKeyDown(a,s.projectName),qt(Je(a=>r.toggleProjectCollapse(s.projectName),["prevent"]),["enter"]),qt(Je(a=>r.toggleProjectCollapse(s.projectName),["prevent"]),["space"])]},{left:lt(()=>[g("span",$_,[g("span",V_,[r.isCollapsed(s.projectName)?(T(),vt(r.IconTablerFolder,{key:0,class:"thread-icon"})):(T(),vt(r.IconTablerFolderOpen,{key:1,class:"thread-icon"}))]),g("span",W_,[r.isCollapsed(s.projectName)?(T(),vt(r.IconTablerChevronRight,{key:0,class:"thread-icon"})):(T(),vt(r.IconTablerChevronDown,{key:1,class:"thread-icon"}))])])]),right:lt(()=>[g("div",K_,[g("div",{ref_for:!0,ref:a=>r.setProjectMenuWrapRef(s.projectName,a),class:"project-menu-wrap"},[g("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Je(a=>r.toggleProjectMenu(s.projectName),["stop"])},[Ce(r.IconTablerDots,{class:"thread-icon"})],8,z_),r.isProjectMenuOpen(s.projectName)?(T(),I("div",{key:0,class:"project-menu-panel",onClick:e[6]||(e[6]=Je(()=>{},["stop"]))},[r.projectMenuMode==="actions"?(T(),I(je,{key:0},[g("button",{class:"project-menu-item",type:"button",onClick:a=>r.openRenameProjectMenu(s.projectName)}," Edit name ",8,J_),g("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:a=>r.onRemoveProject(s.projectName)}," Remove ",8,Y_)],64)):(T(),I(je,{key:1},[e[13]||(e[13]=g("label",{class:"project-menu-label"},"Project name",-1)),Xn(g("input",{"onUpdate:modelValue":e[5]||(e[5]=a=>r.projectRenameDraft=a),class:"project-menu-input",type:"text",onInput:a=>r.onProjectNameInput(s.projectName)},null,40,Q_),[[Zn,r.projectRenameDraft]])],64))])):ie("v-if",!0)],512),g("button",{class:"thread-start-button",type:"button","aria-label":r.getNewThreadButtonAriaLabel(s.projectName),title:r.getNewThreadButtonAriaLabel(s.projectName),onClick:Je(a=>r.onStartNewThread(s.projectName),["stop"])},[Ce(r.IconTablerFilePencil,{class:"thread-icon"})],8,X_)])]),default:lt(()=>[g("span",{class:"project-main-button","data-dragging-handle":r.isDraggingProject(s.projectName),onMousedown:Je(a=>r.onProjectHandleMouseDown(a,s.projectName),["left"])},[g("span",G_,fe(r.getProjectDisplayName(s.projectName)),1)],40,q_)]),_:2},1032,["onClick","onKeydown"]),r.hasThreads(s)?(T(),I("ul",Z_,[(T(!0),I(je,null,Tt(r.visibleThreads(s),a=>(T(),I("li",{key:a.id,class:"thread-row-item"},[Ce(r.SidebarMenuRow,{class:"thread-row","data-active":a.id===n.selectedThreadId,"data-pinned":r.isPinned(a.id),onMouseleave:l=>r.onThreadRowLeave(a.id)},{left:lt(()=>[g("span",ew,[a.inProgress||a.unread?(T(),I("span",{key:0,class:"thread-status-indicator","data-state":r.getThreadState(a)},null,8,tw)):ie("v-if",!0),g("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:l=>r.togglePin(a.id)},[Ce(r.IconTablerPin,{class:"thread-icon"})],8,nw)])]),right:lt(()=>[g("span",iw,fe(r.formatRelative(a.createdAtIso||a.updatedAtIso)),1)]),"right-hover":lt(()=>[g("div",{ref_for:!0,ref:l=>r.setThreadMenuWrapRef(a.id,l),class:"thread-menu-wrap"},[g("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(l=>r.toggleThreadMenu(a.id),["stop"])},[Ce(r.IconTablerDots,{class:"thread-icon"})],8,aw),r.isThreadMenuOpen(a.id)?(T(),I("div",{key:0,class:"thread-menu-panel",onClick:e[7]||(e[7]=Je(()=>{},["stop"]))},[g("button",{class:"thread-menu-item",type:"button",onClick:l=>r.openRenameThreadDialog(a.id,a.title)}," Rename thread ",8,lw),g("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:l=>r.openDeleteThreadDialog(a.id,a.title)}," Delete thread ",8,cw)])):ie("v-if",!0)],512)]),default:lt(()=>[g("button",{class:"thread-main-button",type:"button",onClick:l=>r.onSelect(a.id)},[g("span",ow,[g("span",sw,fe(a.title),1),a.hasWorktree?(T(),vt(r.IconTablerGitFork,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("v-if",!0)])],8,rw)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(T(),vt(r.SidebarMenuRow,{key:1,as:"p",class:"project-empty-row"},{left:lt(()=>[...e[14]||(e[14]=[g("span",{class:"project-empty-spacer"},null,-1)])]),default:lt(()=>[e[15]||(e[15]=g("span",{class:"project-empty"},"No threads",-1))]),_:1})),r.hasHiddenThreads(s)?(T(),vt(r.SidebarMenuRow,{key:2,class:"thread-show-more-row"},{left:lt(()=>[...e[16]||(e[16]=[g("span",{class:"thread-show-more-spacer"},null,-1)])]),default:lt(()=>[g("button",{class:"thread-show-more-button",type:"button",onClick:a=>r.toggleProjectExpansion(s.projectName)},fe(r.isExpanded(s.projectName)?"Show less":"Show more"),9,uw)]),_:2},1024)):ie("v-if",!0)],12,H_))),128))],4)),(T(),vt(di,{to:"body"},[r.renameThreadDialogVisible?(T(),I("div",{key:0,class:"rename-thread-overlay",onClick:Je(r.closeRenameThreadDialog,["self"])},[g("div",dw,[e[17]||(e[17]=g("h3",{class:"rename-thread-title"},"Rename thread",-1)),e[18]||(e[18]=g("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Xn(g("input",{ref:"renameThreadInputRef","onUpdate:modelValue":e[8]||(e[8]=s=>r.renameThreadDraft=s),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[qt(Je(r.submitRenameThread,["prevent"]),["enter"]),qt(Je(r.closeRenameThreadDialog,["prevent"]),["esc"])]},null,40,fw),[[Zn,r.renameThreadDraft]]),g("div",{class:"rename-thread-actions"},[g("button",{class:"rename-thread-button",type:"button",onClick:r.closeRenameThreadDialog},"Cancel"),g("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:r.submitRenameThread},"Save")])])])):ie("v-if",!0)])),(T(),vt(di,{to:"body"},[r.deleteThreadDialogVisible?(T(),I("div",{key:0,class:"rename-thread-overlay",onClick:Je(r.closeDeleteThreadDialog,["self"])},[g("div",hw,[e[19]||(e[19]=g("h3",{class:"rename-thread-title"},"Delete thread?",-1)),g("p",pw,' This will archive the thread "'+fe(r.deleteThreadTitle)+'". You can find it later in archived threads. ',1),g("div",{class:"rename-thread-actions"},[g("button",{class:"rename-thread-button",type:"button",onClick:r.closeDeleteThreadDialog},"Cancel"),g("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:r.submitDeleteThread},"Delete")])])])):ie("v-if",!0)]))])}const gw=tt(l_,[["render",mw],["__scopeId","data-v-17a063d1"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/sidebar/SidebarThreadTree.vue"]]),vw=jt({__name:"ContentHeader",props:{title:{type:String,required:!0}},setup(t,{expose:e}){e();const n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),yw={class:"content-header"},bw={class:"content-leading"},_w={class:"content-title"},ww={class:"content-actions"};function Tw(t,e,n,r,o,i){return T(),I("header",yw,[g("div",bw,[Mn(t.$slots,"leading",{},void 0)]),g("h1",_w,fe(n.title),1),g("div",ww,[Mn(t.$slots,"actions",{},void 0)])])}const Sw=tt(vw,[["render",Tw],["__scopeId","data-v-f188062e"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ContentHeader.vue"]]),kw={},Iw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ew(t,e){return T(),I("svg",Iw,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Bl=tt(kw,[["render",Ew],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerX.vue"]]),Cw={},Aw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Rw(t,e){return T(),I("svg",Aw,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const xw=tt(Cw,[["render",Rw],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerArrowBackUp.vue"]]),Cu=16,Pw=jt({__name:"ThreadConversation",props:{messages:{type:Array,required:!0},pendingRequests:{type:Array,required:!0},liveOverlay:{type:[Object,null],required:!0},isLoading:{type:Boolean,required:!0},activeThreadId:{type:String,required:!0},scrollState:{type:[Object,null],required:!0},isTurnInProgress:{type:Boolean,required:!1},isRollingBack:{type:Boolean,required:!1}},emits:["updateScrollState","respondServerRequest","rollback"],setup(t,{expose:e,emit:n}){e();const r=D(new Set),o=D(new Set),i=D(new Set),s=D({});function a(w){return w.messageType==="commandExecution"&&!!w.commandExecution}function l(w){var N;return((N=w.commandExecution)==null?void 0:N.status)==="inProgress"||o.value.has(w.id)?!0:r.value.has(w.id)}function d(w){return o.value.has(w.id)}function u(w){var le;if(((le=w.commandExecution)==null?void 0:le.status)==="inProgress")return;const N=new Set(r.value);N.has(w.id)?N.delete(w.id):N.add(w.id),r.value=N}function c(w){const N=new Set(i.value);N.has(w.id)?N.delete(w.id):N.add(w.id),i.value=N}function h(w){return i.value.has(w.id)}function b(w){const N=w.commandExecution;if(!N)return"";switch(N.status){case"inProgress":return"⟳ Running";case"completed":return N.exitCode===0?"✓ Completed":`✗ Exit ${N.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function E(w){var le,_e;const N=(le=w.commandExecution)==null?void 0:le.status;return N==="inProgress"?"cmd-status-running":N==="completed"&&((_e=w.commandExecution)==null?void 0:_e.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function C(w){const N=new Set(o.value);N.add(w),o.value=N,setTimeout(()=>{const le=new Set(o.value);le.delete(w),o.value=le},1e3)}function W(w,N){const le=[];for(let _e=N-1;_e>=0;_e--){const De=w[_e];if(De.messageType==="commandExecution")le.unshift(De);else if(De.role==="user"||De.messageType==="worked")break}return le}const L=t,M=n,H=D(null),X=D(null),U=D(null),Q=D(""),re=D({}),me=D({});let z=0,te=0,Ae=0;const q=new WeakSet,ye=D(new Set);function Re(w){if(!w||/\s/u.test(w)||w.endsWith("/")||w.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(w))return!1;const N=w.startsWith("/"),le=/^[A-Za-z]:[\\/]/u.test(w),_e=w.startsWith("./")||w.startsWith("../")||w.startsWith("~/"),De=w.includes("/")||w.includes("\\");return N||le||_e||De}function Ue(w){return w.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||w}function Ve(w){if(!w)return null;let N=w,le=null;const _e=N.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(_e)N=_e[1],le=Number(_e[2]);else{const De=N.match(/^(.*):(\d+)(?::\d+)?$/u);De&&(N=De[1],le=Number(De[2]))}return Re(N)?{path:N,line:le}:null}function ae(w){if(!w.includes("`"))return[{kind:"text",value:w}];const N=[];let le=0,_e=0;for(;le<w.length;){if(w[le]!=="`"){le+=1;continue}let De=1;for(;le+De<w.length&&w[le+De]==="`";)De+=1;const mt="`".repeat(De);let Et=le+De,Ot=-1;for(;Et<w.length;){const Te=w.indexOf(mt,Et);if(Te<0)break;const Ie=Te>0&&w[Te-1]==="`",nn=Te+De<w.length&&w[Te+De]==="`",Dt=w.slice(le+De,Te).includes(`
|
|
65
|
-
`);if(!Ie&&!nn&&!Dt){Ot=Te;break}Et=Te+1}if(Ot<0){le+=De;continue}le>_e&&N.push({kind:"text",value:w.slice(_e,le)});const gt=w.slice(le+De,Ot);if(gt.length>0){const Te=Ve(gt);if(Te){const Ie=Ue(Te.path),nn=Te.line?`${Ie} (line ${String(Te.line)})`:Ie;N.push({kind:"file",value:gt,displayName:nn})}else N.push({kind:"code",value:gt})}else N.push({kind:"text",value:`${mt}${mt}`});le=Ot+De,_e=le}return _e<w.length&&N.push({kind:"text",value:w.slice(_e)}),N}function ke(w){const N=w.trim();if(!N)return"";if(N.startsWith("data:")||N.startsWith("blob:")||N.startsWith("http://")||N.startsWith("https://")||N.startsWith("/codex-local-image?"))return N;if(N.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(N)}`;const le=N.startsWith("/"),_e=/^[A-Za-z]:[\\/]/u.test(N);return le||_e?`/codex-local-image?path=${encodeURIComponent(N)}`:N}function it(w){if(!w.includes(")return[{kind:"text",value:w}];const N=[],le=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let _e=0;for(const De of w.matchAll(le)){const[mt,Et,Ot]=De;if(typeof De.index!="number")continue;const gt=De.index,Te=gt+mt.length,Ie=ke(Ot.trim());Ie&&(gt>_e&&N.push({kind:"text",value:w.slice(_e,gt)}),N.push({kind:"image",url:Ie,alt:Et.trim(),markdown:mt}),_e=Te)}return _e<w.length&&N.push({kind:"text",value:w.slice(_e)}),N.length>0?N:[{kind:"text",value:w}]}function Xe(w){return w!==null&&typeof w=="object"&&!Array.isArray(w)?w:null}function ze(w){const N=new Date(w);return Number.isNaN(N.getTime())?w:N.toLocaleTimeString()}function at(w){const N=Xe(w.params),le=N==null?void 0:N.reason;return typeof le=="string"?le.trim():""}function Fe(w,N){return`${String(w)}:${N}`}function ft(w){const N=Xe(w.params),le=Array.isArray(N==null?void 0:N.questions)?N.questions:[],_e=[];for(const De of le){const mt=Xe(De);if(!mt)continue;const Et=typeof mt.id=="string"?mt.id:"";if(!Et)continue;const Ot=Array.isArray(mt.options)?mt.options.map(gt=>Xe(gt)).map(gt=>gt==null?void 0:gt.label).filter(gt=>typeof gt=="string"&>.length>0):[];_e.push({id:Et,header:typeof mt.header=="string"?mt.header:"",question:typeof mt.question=="string"?mt.question:"",isOther:mt.isOther===!0,options:Ot})}return _e}function ht(w,N,le){const _e=Fe(w,N),De=re.value[_e];return typeof De=="string"&&De.length>0?De:le}function nt(w,N){const le=Fe(w,N);return me.value[le]??""}function x(w,N,le){const _e=le.target;if(!(_e instanceof HTMLSelectElement))return;const De=Fe(w,N);re.value={...re.value,[De]:_e.value}}function oe(w,N,le){const _e=le.target;if(!(_e instanceof HTMLInputElement))return;const De=Fe(w,N);me.value={...me.value,[De]:_e.value}}function Y(w,N){M("respondServerRequest",{id:w,result:{decision:N}})}function ue(w){const N=ft(w),le={};for(const _e of N){const De=ht(w.id,_e.id,_e.options[0]||""),mt=nt(w.id,_e.id).trim(),Et=[De,mt].map(Ot=>Ot.trim()).filter(Ot=>Ot.length>0);le[_e.id]={answers:Et}}M("respondServerRequest",{id:w.id,result:{answers:le}})}function be(w){M("respondServerRequest",{id:w,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Ge(w){M("respondServerRequest",{id:w,result:{success:!0,contentItems:[]}})}function p(w){M("respondServerRequest",{id:w,result:{}})}function v(w){M("respondServerRequest",{id:w,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function y(w){return!(w.role!=="user"&&w.role!=="assistant"||typeof w.turnIndex!="number"||L.isTurnInProgress||L.isRollingBack)}function A(w){y(w)&&M("rollback",{turnIndex:w.turnIndex})}function R(){const w=H.value,N=X.value;!w||!N||(w.scrollTop=w.scrollHeight,N.scrollIntoView({block:"end"}))}function P(w){return w.scrollHeight-(w.scrollTop+w.clientHeight)<=Cu}function $(w){if(!L.activeThreadId)return;const N=Math.max(w.scrollHeight-w.clientHeight,0),le=N>0?Math.min(Math.max(w.scrollTop/N,0),1):1;M("updateScrollState",{threadId:L.activeThreadId,state:{scrollTop:w.scrollTop,isAtBottom:P(w),scrollRatio:le}})}function V(){const w=H.value;if(!w)return;const N=L.scrollState;if(!N||N.isAtBottom){J();return}const le=Math.max(w.scrollHeight-w.clientHeight,0),_e=typeof N.scrollRatio=="number"?N.scrollRatio*le:N.scrollTop;w.scrollTop=Math.min(Math.max(_e,0),le),$(w)}function J(){const w=H.value;w&&(R(),$(w))}function B(){const w=L.scrollState;return!w||w.isAtBottom===!0}function pe(){if(!B()){Ae=0,te=0;return}if(J(),Ae-=1,Ae<=0){te=0;return}te=requestAnimationFrame(pe)}function ee(w=6){B()&&(te&&(cancelAnimationFrame(te),te=0),Ae=Math.max(w,1),te=requestAnimationFrame(pe))}function de(){ee(3)}function Ee(){if(!B())return;const w=H.value;if(!w)return;const N=w.querySelectorAll("img.message-image-preview");for(const le of N)le.complete||q.has(le)||(q.add(le),le.addEventListener("load",de,{once:!0}),le.addEventListener("error",de,{once:!0}))}async function Oe(){await en(),z&&cancelAnimationFrame(z),z=requestAnimationFrame(()=>{z=0,V(),Ee(),ee()})}yt(()=>L.messages,async w=>{if(!L.isLoading){for(const N of w){if(N.messageType!=="commandExecution"||!N.commandExecution)continue;const le=s.value[N.id],_e=N.commandExecution.status;le==="inProgress"&&_e!=="inProgress"&&C(N.id),s.value[N.id]=_e}await Oe()}}),yt(()=>L.liveOverlay,async w=>{w&&(await en(),J(),ee(8))},{deep:!0}),yt(()=>L.isLoading,async w=>{w||await Oe()}),yt(()=>L.activeThreadId,()=>{Q.value="",ye.value=new Set},{flush:"post"});function Me(){const w=H.value;!w||L.isLoading||$(w)}function Ke(w){Q.value=ke(w)}function Ze(w,N){return`${w}:${String(N)}`}function pt(w,N){const le=new Set(ye.value);le.add(Ze(w,N)),ye.value=le}function ct(w,N){return ye.value.has(Ze(w,N))}function j(){Q.value=""}function ne(){const w=U.value;w&&(w.scrollTop=w.scrollHeight)}yt(()=>{var w;return(w=L.liveOverlay)==null?void 0:w.reasoningText},async w=>{w&&(await en(),ne())}),Rr(()=>{z&&cancelAnimationFrame(z),te&&cancelAnimationFrame(te)});const we={expandedCommandIds:r,collapsingCommandIds:o,expandedWorkedIds:i,prevCommandStatuses:s,isCommandMessage:a,isCommandExpanded:l,isCommandCollapsing:d,toggleCommandExpand:u,toggleWorkedExpand:c,isWorkedExpanded:h,commandStatusLabel:b,commandStatusClass:E,scheduleCollapse:C,getCommandsForWorked:W,props:L,emit:M,conversationListRef:H,bottomAnchorRef:X,liveOverlayReasoningRef:U,modalImageUrl:Q,toolQuestionAnswers:re,toolQuestionOtherAnswers:me,BOTTOM_THRESHOLD_PX:Cu,get scrollRestoreFrame(){return z},set scrollRestoreFrame(w){z=w},get bottomLockFrame(){return te},set bottomLockFrame(w){te=w},get bottomLockFramesLeft(){return Ae},set bottomLockFramesLeft(w){Ae=w},trackedPendingImages:q,failedMarkdownImageKeys:ye,isFilePath:Re,getBasename:Ue,parseFileReference:Ve,parseInlineSegments:ae,toRenderableImageUrl:ke,parseMessageBlocks:it,asRecord:Xe,formatIsoTime:ze,readRequestReason:at,toolQuestionKey:Fe,readToolQuestions:ft,readQuestionAnswer:ht,readQuestionOtherAnswer:nt,onQuestionAnswerChange:x,onQuestionOtherAnswerInput:oe,onRespondApproval:Y,onRespondToolRequestUserInput:ue,onRespondToolCallFailure:be,onRespondToolCallSuccess:Ge,onRespondEmptyResult:p,onRejectUnknownRequest:v,canRollbackMessage:y,onRollback:A,scrollToBottom:R,isAtBottom:P,emitScrollState:$,applySavedScrollState:V,enforceBottomState:J,shouldLockToBottom:B,runBottomLockFrame:pe,scheduleBottomLock:ee,onPendingImageSettled:de,bindPendingImageHandlers:Ee,scheduleScrollRestore:Oe,onConversationScroll:Me,openImageModal:Ke,markdownImageKey:Ze,onMarkdownImageError:pt,isMarkdownImageFailed:ct,closeImageModal:j,alignLiveOverlayReasoningToBottom:ne,IconTablerX:Bl,IconTablerArrowBackUp:xw};return Object.defineProperty(we,"__isScriptSetup",{enumerable:!1,value:!0}),we}}),Ow={class:"conversation-root"},Mw={key:0,class:"conversation-loading"},Nw={key:1,class:"conversation-empty"},Dw={class:"message-row"},Lw={class:"message-stack"},jw={class:"request-card"},Uw={class:"request-title"},Fw={class:"request-meta"},Bw={key:0,class:"request-reason"},Hw={key:1,class:"request-actions"},$w=["onClick"],Vw=["onClick"],Ww=["onClick"],qw=["onClick"],Gw={key:2,class:"request-actions"},Kw=["onClick"],zw=["onClick"],Jw=["onClick"],Yw=["onClick"],Qw={key:3,class:"request-user-input"},Xw={class:"request-question-title"},Zw={key:0,class:"request-question-text"},eT=["value","onChange"],tT=["value"],nT=["value","onInput"],rT=["onClick"],oT={key:4,class:"request-actions"},sT=["onClick"],iT=["onClick"],aT={key:5,class:"request-actions"},lT=["onClick"],cT=["onClick"],uT=["data-role","data-message-type"],dT={key:0,class:"message-row","data-role":"system"},fT={class:"message-stack","data-role":"system"},hT=["onClick"],pT={class:"cmd-label"},mT={class:"cmd-status"},gT={class:"cmd-output-inner"},vT={class:"cmd-output"},yT=["data-role","data-message-type"],bT=["data-role"],_T=["data-role"],wT=["data-role"],TT=["onClick"],ST=["src"],kT={key:1,class:"message-file-attachments"},IT=["title"],ET=["data-role"],CT={key:0,class:"worked-separator-wrap","aria-live":"polite"},AT=["onClick"],RT={class:"worked-separator-text"},xT={key:0,class:"worked-details"},PT=["onClick"],OT={class:"cmd-label"},MT={class:"cmd-status"},NT={class:"cmd-output-inner"},DT={class:"cmd-output"},LT={key:1,class:"message-text-flow"},jT={key:0,class:"message-text"},UT={key:0},FT={key:2,class:"message-inline-code"},BT={key:1,class:"message-text"},HT=["onClick"],$T=["src","alt","onError"],VT=["onClick"],WT={key:0,class:"conversation-item conversation-item-overlay"},qT={class:"message-row"},GT={class:"message-stack"},KT={class:"live-overlay-inline","aria-live":"polite"},zT={class:"live-overlay-label"},JT={key:1,class:"live-overlay-error"},YT={ref:"bottomAnchorRef",class:"conversation-bottom-anchor"},QT=["src"];function XT(t,e,n,r,o,i){return T(),I("section",Ow,[n.isLoading?(T(),I("p",Mw,"Loading messages...")):n.messages.length===0&&n.pendingRequests.length===0&&!n.liveOverlay?(T(),I("p",Nw," No messages in this thread yet. ")):(T(),I("ul",{key:2,ref:"conversationListRef",class:"conversation-list",onScroll:r.onConversationScroll},[(T(!0),I(je,null,Tt(n.pendingRequests,s=>(T(),I("li",{key:`server-request:${s.id}`,class:"conversation-item conversation-item-request"},[g("div",Dw,[g("div",Lw,[g("article",jw,[g("p",Uw,fe(s.method),1),g("p",Fw,"Request #"+fe(s.id)+" · "+fe(r.formatIsoTime(s.receivedAtIso)),1),r.readRequestReason(s)?(T(),I("p",Bw,fe(r.readRequestReason(s)),1)):ie("v-if",!0),s.method==="item/commandExecution/requestApproval"?(T(),I("section",Hw,[g("button",{type:"button",class:"request-button request-button-primary",onClick:a=>r.onRespondApproval(s.id,"accept")},"Accept",8,$w),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"acceptForSession")},"Accept for Session",8,Vw),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"decline")},"Decline",8,Ww),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"cancel")},"Cancel",8,qw)])):s.method==="item/fileChange/requestApproval"?(T(),I("section",Gw,[g("button",{type:"button",class:"request-button request-button-primary",onClick:a=>r.onRespondApproval(s.id,"accept")},"Accept",8,Kw),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"acceptForSession")},"Accept for Session",8,zw),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"decline")},"Decline",8,Jw),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondApproval(s.id,"cancel")},"Cancel",8,Yw)])):s.method==="item/tool/requestUserInput"?(T(),I("section",Qw,[(T(!0),I(je,null,Tt(r.readToolQuestions(s),a=>(T(),I("div",{key:`${s.id}:${a.id}`,class:"request-question"},[g("p",Xw,fe(a.header||a.question),1),a.header&&a.question?(T(),I("p",Zw,fe(a.question),1)):ie("v-if",!0),g("select",{class:"request-select",value:r.readQuestionAnswer(s.id,a.id,a.options[0]||""),onChange:l=>r.onQuestionAnswerChange(s.id,a.id,l)},[(T(!0),I(je,null,Tt(a.options,l=>(T(),I("option",{key:`${s.id}:${a.id}:${l}`,value:l},fe(l),9,tT))),128))],40,eT),a.isOther?(T(),I("input",{key:1,class:"request-input",type:"text",value:r.readQuestionOtherAnswer(s.id,a.id),placeholder:"Other answer",onInput:l=>r.onQuestionOtherAnswerInput(s.id,a.id,l)},null,40,nT)):ie("v-if",!0)]))),128)),g("button",{type:"button",class:"request-button request-button-primary",onClick:a=>r.onRespondToolRequestUserInput(s)}," Submit Answers ",8,rT)])):s.method==="item/tool/call"?(T(),I("section",oT,[g("button",{type:"button",class:"request-button request-button-primary",onClick:a=>r.onRespondToolCallFailure(s.id)},"Fail Tool Call",8,sT),g("button",{type:"button",class:"request-button",onClick:a=>r.onRespondToolCallSuccess(s.id)},"Success (Empty)",8,iT)])):(T(),I("section",aT,[g("button",{type:"button",class:"request-button request-button-primary",onClick:a=>r.onRespondEmptyResult(s.id)},"Return Empty Result",8,lT),g("button",{type:"button",class:"request-button",onClick:a=>r.onRejectUnknownRequest(s.id)},"Reject Request",8,cT)]))])])])]))),128)),(T(!0),I(je,null,Tt(n.messages,s=>{var a,l;return T(),I("li",{key:s.id,class:dt(["conversation-item",{"conversation-item-rollbackable":r.canRollbackMessage(s)}]),"data-role":s.role,"data-message-type":s.messageType||""},[r.isCommandMessage(s)?(T(),I("div",dT,[g("div",fT,[g("button",{type:"button",class:dt(["cmd-row",[r.commandStatusClass(s),{"cmd-expanded":r.isCommandExpanded(s)}]]),onClick:d=>r.toggleCommandExpand(s)},[g("span",{class:dt(["cmd-chevron",{"cmd-chevron-open":r.isCommandExpanded(s)}])},"▶",2),g("code",pT,fe(((a=s.commandExecution)==null?void 0:a.command)||"(command)"),1),g("span",mT,fe(r.commandStatusLabel(s)),1)],10,hT),g("div",{class:dt(["cmd-output-wrap",{"cmd-output-visible":r.isCommandExpanded(s),"cmd-output-collapsing":r.isCommandCollapsing(s)}])},[g("div",gT,[g("pre",vT,fe(((l=s.commandExecution)==null?void 0:l.aggregatedOutput)||"(no output)"),1)])],2)])])):(T(),I("div",{key:1,class:"message-row","data-role":s.role,"data-message-type":s.messageType||""},[g("div",{class:"message-stack","data-role":s.role},[g("article",{class:"message-body","data-role":s.role},[s.images&&s.images.length>0?(T(),I("ul",{key:0,class:"message-image-list","data-role":s.role},[(T(!0),I(je,null,Tt(s.images,d=>(T(),I("li",{key:d,class:"message-image-item"},[g("button",{class:"message-image-button",type:"button",onClick:u=>r.openImageModal(d)},[g("img",{class:"message-image-preview",src:r.toRenderableImageUrl(d),alt:"Message image preview",loading:"lazy"},null,8,ST)],8,TT)]))),128))],8,wT)):ie("v-if",!0),s.fileAttachments&&s.fileAttachments.length>0?(T(),I("div",kT,[(T(!0),I(je,null,Tt(s.fileAttachments,d=>(T(),I("span",{key:d.path,class:"message-file-chip"},[e[2]||(e[2]=g("span",{class:"message-file-chip-icon"},"📄",-1)),g("span",{class:"message-file-chip-name",title:d.path},fe(d.label),9,IT)]))),128))])):ie("v-if",!0),s.text.length>0?(T(),I("article",{key:2,class:"message-card","data-role":s.role},[s.messageType==="worked"?(T(),I("div",CT,[g("button",{type:"button",class:"worked-separator",onClick:d=>r.toggleWorkedExpand(s)},[e[3]||(e[3]=g("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),g("span",{class:dt(["worked-chevron",{"worked-chevron-open":r.isWorkedExpanded(s)}])},"▶",2),g("p",RT,fe(s.text),1),e[4]||(e[4]=g("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,AT),r.isWorkedExpanded(s)?(T(),I("div",xT,[(T(!0),I(je,null,Tt(r.getCommandsForWorked(n.messages,n.messages.indexOf(s)),d=>{var u,c;return T(),I("div",{key:`worked-cmd-${d.id}`,class:"worked-cmd-item"},[g("button",{type:"button",class:dt(["cmd-row",[r.commandStatusClass(d),{"cmd-expanded":r.isCommandExpanded(d)}]]),onClick:h=>r.toggleCommandExpand(d)},[g("span",{class:dt(["cmd-chevron",{"cmd-chevron-open":r.isCommandExpanded(d)}])},"▶",2),g("code",OT,fe(((u=d.commandExecution)==null?void 0:u.command)||"(command)"),1),g("span",MT,fe(r.commandStatusLabel(d)),1)],10,PT),g("div",{class:dt(["cmd-output-wrap",{"cmd-output-visible":r.isCommandExpanded(d),"cmd-output-collapsing":r.isCommandCollapsing(d)}])},[g("div",NT,[g("pre",DT,fe(((c=d.commandExecution)==null?void 0:c.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ie("v-if",!0)])):(T(),I("div",LT,[(T(!0),I(je,null,Tt(r.parseMessageBlocks(s.text),(d,u)=>(T(),I(je,{key:`block-${u}`},[d.kind==="text"?(T(),I("p",jT,[(T(!0),I(je,null,Tt(r.parseInlineSegments(d.value),(c,h)=>(T(),I(je,{key:`seg-${u}-${h}`},[c.kind==="text"?(T(),I("span",UT,fe(c.value),1)):c.kind==="file"?(T(),I("a",{key:1,class:"message-file-link",href:"#",onClick:e[0]||(e[0]=Je(()=>{},["prevent"]))},fe(c.displayName),1)):(T(),I("code",FT,fe(c.value),1))],64))),128))])):r.isMarkdownImageFailed(s.id,u)?(T(),I("p",BT,fe(d.markdown),1)):(T(),I("button",{key:2,class:"message-image-button",type:"button",onClick:c=>r.openImageModal(d.url)},[g("img",{class:"message-image-preview message-markdown-image",src:d.url,alt:d.alt||"Embedded message image",loading:"lazy",onError:c=>r.onMarkdownImageError(s.id,u)},null,40,$T)],8,HT))],64))),128))]))],8,ET)):ie("v-if",!0)],8,_T),r.canRollbackMessage(s)?(T(),I("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:d=>r.onRollback(s)},[Ce(r.IconTablerArrowBackUp,{class:"rollback-icon"}),e[5]||(e[5]=g("span",{class:"rollback-label"},"Rollback",-1))],8,VT)):ie("v-if",!0)],8,bT)],8,yT))],10,uT)}),128)),n.liveOverlay?(T(),I("li",WT,[g("div",qT,[g("div",GT,[g("article",KT,[g("p",zT,fe(n.liveOverlay.activityLabel),1),n.liveOverlay.reasoningText?(T(),I("p",{key:0,class:"live-overlay-reasoning",ref:"liveOverlayReasoningRef"},fe(n.liveOverlay.reasoningText),513)):ie("v-if",!0),n.liveOverlay.errorText?(T(),I("p",JT,fe(n.liveOverlay.errorText),1)):ie("v-if",!0)])])])])):ie("v-if",!0),g("li",YT,null,512)],544)),r.modalImageUrl.length>0?(T(),I("div",{key:3,class:"image-modal-backdrop",onClick:r.closeImageModal},[g("div",{class:"image-modal-content",onClick:e[1]||(e[1]=Je(()=>{},["stop"]))},[g("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:r.closeImageModal},[Ce(r.IconTablerX,{class:"icon-svg"})]),g("img",{class:"image-modal-image",src:r.modalImageUrl,alt:"Expanded message image"},null,8,QT)])])):ie("v-if",!0)])}const ZT=tt(Pw,[["render",XT],["__scopeId","data-v-13269e6e"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ThreadConversation.vue"]]);function eS(t){var u;const e=D("idle"),n=D(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,o=null,i=[];async function s(){var c;if(!(e.value!=="idle"||!n.value))try{o=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),i=[],r=new MediaRecorder(o),r.ondataavailable=h=>{h.data.size>0&&i.push(h.data)},r.onstop=()=>{var E;const h=i,b=(r==null?void 0:r.mimeType)||((E=h[0])==null?void 0:E.type)||"audio/webm";d(),e.value="idle",l(h,b)},r.start(),e.value="recording"}catch(h){d(),(c=t.onError)==null||c.call(t,h)}}function a(){e.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(c,h){var E;if(c.length===0)return;const b=new Blob(c,{type:h});try{const C=h.split(/[/;]/)[1]??"webm",W=`----codex-transcribe-${crypto.randomUUID()}`,L=new Uint8Array(await b.arrayBuffer()),M=new TextEncoder,H=[];H.push(M.encode(`--${W}\r
|
|
66
|
-
`)),H.push(M.encode(`Content-Disposition: form-data; name="file"; filename="codex.${C}"\r
|
|
67
|
-
`)),H.push(M.encode(`Content-Type: ${h}\r
|
|
68
|
-
\r
|
|
69
|
-
`)),H.push(L),H.push(M.encode(`\r
|
|
70
|
-
--${W}--\r
|
|
71
|
-
`));let X=0;for(const te of H)X+=te.byteLength;const U=new Uint8Array(X);let Q=0;for(const te of H)U.set(te,Q),Q+=te.byteLength;const re=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${W}`},body:U});if(!re.ok)throw new Error(`Transcription failed: ${re.status}`);const z=((await re.json()).text??"").trim();z.length>0&&t.onTranscript(z)}catch(C){(E=t.onError)==null||E.call(t,C)}finally{e.value!=="recording"&&(e.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),o&&(o.getTracks().forEach(c=>c.stop()),o=null),i=[]}return Rr(d),{state:e,isSupported:n,startRecording:s,stopRecording:a}}function Au(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:null}class Yn extends Error{constructor(e,n){super(e),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Hl(t,e){const n=Au(t);if(!n)return e;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=Au(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:e}function Bo(t,e,n){return t instanceof Yn?t:t instanceof Error?new Yn(t.message||e,{code:"unknown_error",method:n}):new Yn(e,{code:"unknown_error",method:n})}function ch(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:null}async function tS(t,e){const n={method:t,params:e??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(s){throw new Yn(s instanceof Error?s.message:`RPC ${t} failed before request was sent`,{code:"network_error",method:t})}let o=null;try{o=await r.json()}catch{o=null}if(!r.ok)throw new Yn(Hl(o,`RPC ${t} failed with HTTP ${r.status}`),{code:"http_error",method:t,status:r.status});const i=o;if(!i||typeof i!="object"||!("result"in i))throw new Yn(`RPC ${t} returned malformed envelope`,{code:"invalid_response",method:t,status:r.status});return i.result}function Ru(t){const e=ch(t);if(!e||typeof e.method!="string"||e.method.length===0)return null;const n=typeof e.atIso=="string"&&e.atIso.length>0?e.atIso:new Date().toISOString();return{method:e.method,params:e.params??null,atIso:n}}function nS(t){if(typeof window>"u")return()=>{};let e=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const o=new EventSource("/codex-api/events");o.onmessage=i=>{try{const s=JSON.parse(i.data),a=Ru(s);a&&t(a)}catch{}},e=()=>o.close()};if(typeof WebSocket<"u"){const o=window.location.protocol==="https:"?"wss:":"ws:",i=new WebSocket(`${o}//${window.location.host}/codex-api/ws`);let s=!1,a=window.setTimeout(()=>{s||n||(i.close(),r())},2500);i.onopen=()=>{s=!0,a!==null&&(window.clearTimeout(a),a=null)},i.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Ru(d);u&&t(u)}catch{}},i.onerror=()=>{!s&&!n&&r()},i.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!s&&!n&&r()},e=()=>i.close()}else r();return()=>{n=!0,e==null||e()}}async function rS(t){let e;try{e=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(r){throw new Yn(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await e.json()}catch{n=null}if(!e.ok)throw new Yn(Hl(n,`Server request reply failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/respond",status:e.status})}async function oS(){const t=await fetch("/codex-api/server-requests/pending");let e=null;try{e=await t.json()}catch{e=null}if(!t.ok)throw new Yn(Hl(e,`Pending server requests failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/pending",status:t.status});const n=ch(e),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function xu(t){return new Date(t*1e3).toISOString()}function sS(t){return t.split("/").filter(Boolean).at(-1)||t||"unknown-project"}function iS(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}const aS=/^##\s+(.+?):\s+(.+?)\s*$/,lS=/^#\s*files mentioned by the user\s*:?\s*$/i;function cS(t){var o,i;const e=t.split(`
|
|
72
|
-
`).findIndex(s=>lS.test(s.trim()));if(e<0)return[];const n=t.split(`
|
|
73
|
-
`).slice(e+1),r=[];for(const s of n){const a=s.trim();if(!a)continue;const l=a.match(aS);if(!l)break;const d=(o=l[1])==null?void 0:o.trim(),u=(i=l[2])==null?void 0:i.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function uS(t){const e=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(t.matchAll(e));if(n.length===0)return t.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return t.trim();const o=r.index+r[0].length;return t.slice(o).trim()}function dS(t,e){if(!Array.isArray(e))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],o=[];for(const[a,l]of e.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&o.push({id:`${t}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:iS(l),isUnhandled:!0});const i=n.join(`
|
|
74
|
-
`),s=cS(i);return{text:uS(i),images:r,fileAttachments:s,rawBlocks:o}}function fS(t){if(t.type==="agentMessage")return[{id:t.id,role:"assistant",text:t.text,messageType:t.type}];if(t.type==="userMessage"){const e=dS(t.id,t.content),n=[];return(e.text.length>0||e.images.length>0||e.fileAttachments.length>0)&&n.push({id:t.id,role:"user",text:e.text,images:e.images,fileAttachments:e.fileAttachments.length>0?e.fileAttachments:void 0,messageType:t.type}),n.push(...e.rawBlocks),n.length===0?[]:n}if(t.type==="reasoning")return[];if(t.type==="commandExecution"){const e=t,n=hS(e.status),r=typeof e.command=="string"?e.command:"",o=typeof e.cwd=="string"?e.cwd:null,i=typeof e.aggregatedOutput=="string"?e.aggregatedOutput:"",s=typeof e.exitCode=="number"?e.exitCode:null;return[{id:t.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:o,status:n,aggregatedOutput:i,exitCode:s}}]}return[]}function hS(t){return t==="completed"||t==="failed"||t==="declined"||t==="interrupted"?t:t==="inProgress"||t==="in_progress"?"inProgress":"completed"}function pS(t){const e=[t.preview];for(const n of e)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function mS(t){const e=pS(t);return e.length>0?e:"Untitled thread"}function uh(t){return(t==null?void 0:t.status)==="inProgress"}function gS(t){const e=t;if(e.inProgress===!0||e.status==="inProgress"||e.turnStatus==="inProgress")return!0;const r=(Array.isArray(t.turns)?t.turns:[]).at(-1);return uh(r)}function vS(t){const e=t,n=typeof e.cwd=="string"?e.cwd:t.cwd,r=e.isWorktree===!0||e.worktree===!0||e.worktreeId!==void 0||e.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:t.id,title:mS(t),projectName:sS(t.cwd),cwd:t.cwd,hasWorktree:r,createdAtIso:xu(t.createdAt),updatedAtIso:xu(t.updatedAt),preview:t.preview,unread:!1,inProgress:gS(t)}}function yS(t){const e=new Map;for(const n of t){const r=e.get(n.projectName);r?r.push(n):e.set(n.projectName,[n])}return Array.from(e.entries()).map(([n,r])=>({projectName:n,threads:r.sort((o,i)=>new Date(i.updatedAtIso).getTime()-new Date(o.updatedAtIso).getTime())})).sort((n,r)=>{var s,a;const o=new Date(((s=n.threads[0])==null?void 0:s.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-o})}function bS(t){const e=t.data.map(vS);return yS(e)}function dh(t){const e=Array.isArray(t.thread.turns)?t.thread.turns:[],n=[];for(let r=0;r<e.length;r++){const o=e[r],i=Array.isArray(o.items)?o.items:[];for(const s of i)for(const a of fS(s))n.push({...a,turnIndex:r})}return n}function _S(t){const e=Array.isArray(t.thread.turns)?t.thread.turns:[];return uh(e.at(-1))}async function Yt(t,e){try{return await tS(t,e)}catch(n){throw Bo(n,`RPC ${t} failed`,t)}}function wS(t){return typeof t=="string"&&["none","minimal","low","medium","high","xhigh"].includes(t)?t:""}async function TS(){const t=await Yt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return bS(t)}async function SS(t){const e=await Yt("thread/read",{threadId:t,includeTurns:!0});return{messages:dh(e),inProgress:_S(e)}}async function kS(){try{return await TS()}catch(t){throw Bo(t,"Failed to load thread groups","thread/list")}}async function IS(t){try{return await SS(t)}catch(e){throw Bo(e,`Failed to load thread ${t}`,"thread/read")}}function ES(t){return nS(t)}async function CS(t,e){await rS({id:t,...e})}async function AS(){return oS()}async function ha(t){await Yt("thread/resume",{threadId:t})}async function RS(t){await Yt("thread/archive",{threadId:t})}async function xS(t,e){await Yt("thread/name/set",{threadId:t,name:e})}async function Pu(t,e){const n=await Yt("thread/rollback",{threadId:t,numTurns:e});return dh(n)}function PS(t){if(!t||typeof t!="object")return"";const n=t.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function Ou(t,e){try{const n={};typeof t=="string"&&t.trim().length>0&&(n.cwd=t.trim()),typeof e=="string"&&e.trim().length>0&&(n.model=e.trim());const r=await Yt("thread/start",n),o=PS(r);if(!o)throw new Error("thread/start did not return a thread id");return o}catch(n){throw Bo(n,"Failed to start a new thread","thread/start")}}function OS(t,e){if(e.length===0)return t;let n=`# Files mentioned by the user:
|
|
75
|
-
`;for(const r of e)n+=`
|
|
76
|
-
## ${r.label}: ${r.path}
|
|
77
|
-
`;return`${n}
|
|
78
|
-
## My request for Codex:
|
|
79
|
-
|
|
80
|
-
${t}
|
|
81
|
-
`}async function pa(t,e,n=[],r,o,i,s=[]){try{const l=[{type:"text",text:OS(e,s)}];for(const c of n){const h=c.trim();h&&l.push({type:"image",url:h,image_url:h})}if(i)for(const c of i)l.push({type:"skill",name:c.name,path:c.path});const d=s.map(c=>({label:c.label,path:c.path,fsPath:c.fsPath})),u={threadId:t,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof o=="string"&&o.length>0&&(u.effort=o),await Yt("turn/start",u)}catch(a){throw Bo(a,`Failed to start turn for thread ${t}`,"turn/start")}}async function MS(t,e){const n=t.trim(),r=(e==null?void 0:e.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await Yt("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Bo(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function NS(t){await Yt("setDefaultModel",{model:t})}async function DS(){const t=await Yt("model/list",{}),e=[];for(const n of t.data){const r=n.id||n.model;!r||e.includes(r)||e.push(r)}return e}async function LS(){const t=await Yt("config/read",{}),e=t.config.model??"",n=wS(t.config.model_reasoning_effort);return{model:e,reasoningEffort:n}}function jS(t){const e=t&&typeof t=="object"&&!Array.isArray(t)?t:{},n=i=>{if(!Array.isArray(i))return[];const s=[];for(const a of i)typeof a=="string"&&a.length>0&&!s.includes(a)&&s.push(a);return s},r=e.labels,o={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[i,s]of Object.entries(r))typeof i=="string"&&i.length>0&&typeof s=="string"&&(o[i]=s);return{order:n(e.order),labels:o,active:n(e.active)}}async function Mu(){const t=await fetch("/codex-api/workspace-roots-state"),e=await t.json();if(!t.ok)throw new Error("Failed to load workspace roots state");const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{};return jS(n.data)}async function Nu(){const t=await fetch("/codex-api/home-directory"),e=await t.json();if(!t.ok)throw new Error("Failed to load home directory");const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function US(t){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw new Error("Failed to save workspace roots state")}async function FS(t,e){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,createIfMissing:(e==null?void 0:e.createIfMissing)===!0,label:(e==null?void 0:e.label)??""})}),r=await n.json();if(!n.ok){const a=$l(r,"Failed to open project root");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},i=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return typeof i.path=="string"?i.path.trim():""}async function BS(t){const e=new URLSearchParams({basePath:t}),n=await fetch(`/codex-api/project-root-suggestion?${e.toString()}`),r=await n.json();if(!n.ok){const s=$l(r,"Failed to suggest project name");throw new Error(s)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},i=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return{name:typeof i.name=="string"?i.name.trim():"",path:typeof i.path=="string"?i.path.trim():""}}async function HS(t,e,n=20){const r=t.trim();if(!r)return[];const o=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:e.trim(),limit:n})}),i=await o.json();if(!o.ok){const d=$l(i,"Failed to search files");throw new Error(d)}const s=i&&typeof i=="object"&&!Array.isArray(i)?i:{},a=Array.isArray(s.data)?s.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const c=d.path,h=typeof c=="string"?c.trim():"";h&&l.push({path:h})}return l}function $l(t,e){const r=(t&&typeof t=="object"&&!Array.isArray(t)?t:{}).error;return typeof r=="string"&&r.trim().length>0?r:e}async function $S(){try{const t=await fetch("/codex-api/thread-titles");return t.ok?(await t.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function ma(t,e){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t,title:e})})}catch{}}async function VS(t,e){var n;try{return((n=(await Yt("generate-thread-title",{prompt:t,cwd:e})).title)==null?void 0:n.trim())??""}catch{return""}}async function WS(t){try{const e={};t&&t.length>0&&(e.cwds=t);const n=await Yt("skills/list",e),r=[],o=new Set;for(const i of n.data)for(const s of i.skills)!s.name||o.has(s.path)||(o.add(s.path),r.push({name:s.name,description:s.shortDescription||s.description||"",path:s.path,scope:s.scope,enabled:s.enabled}));return r}catch{return[]}}async function qS(t){try{const e=new FormData;e.append("file",t);const n=await fetch("/codex-api/upload-file",{method:"POST",body:e});return n.ok?(await n.json()).path??null:null}catch{return null}}const GS={},KS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zS(t,e){return T(),I("svg",KS,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const JS=tt(GS,[["render",zS],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerArrowUp.vue"]]),YS={},QS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function XS(t,e){return T(),I("svg",QS,[...e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const ZS=tt(YS,[["render",XS],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerMicrophone.vue"]]),ek={},tk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nk(t,e){return T(),I("svg",tk,[...e[0]||(e[0]=[g("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const rk=tt(ek,[["render",nk],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerPlayerStopFilled.vue"]]),ok=jt({__name:"ComposerDropdown",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1},openDirection:{type:String,required:!1},enableSearch:{type:Boolean,required:!1},searchPlaceholder:{type:String,required:!1},showAddAction:{type:Boolean,required:!1},addActionLabel:{type:String,required:!1},defaultAddValue:{type:String,required:!1},addPlaceholder:{type:String,required:!1}},emits:["update:modelValue","add"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D(null),s=D(null),a=D(null),l=D(!1),d=D(""),u=D(!1),c=D(""),h=ce(()=>{var ye;const q=r.options.find(Re=>Re.value===r.modelValue);return q?q.label:((ye=r.placeholder)==null?void 0:ye.trim())||""}),b=ce(()=>r.openDirection??"down"),E=ce(()=>r.enableSearch===!0),C=ce(()=>r.showAddAction===!0),W=ce(()=>{var q;return((q=r.searchPlaceholder)==null?void 0:q.trim())||"Quick search projects"}),L=ce(()=>{var q;return((q=r.addActionLabel)==null?void 0:q.trim())||"Add new project"}),M=ce(()=>{var q;return((q=r.addPlaceholder)==null?void 0:q.trim())||"Project name or absolute path"}),H=ce(()=>{const q=d.value.trim().toLowerCase();return q?r.options.filter(ye=>ye.label.toLowerCase().includes(q)||ye.value.toLowerCase().includes(q)):r.options});function X(){r.disabled||(l.value=!l.value)}function U(q){o("update:modelValue",q),l.value=!1,d.value=""}function Q(){var q;u.value=!0,c.value=((q=r.defaultAddValue)==null?void 0:q.trim())||"",en(()=>{var ye;return(ye=a.value)==null?void 0:ye.focus()})}function re(){if(d.value.length>0){d.value="";return}l.value=!1}function me(){const q=c.value.trim();q&&(o("add",q),u.value=!1,c.value="",l.value=!1,d.value="")}function z(){u.value=!1,c.value="",l.value=!1,d.value=""}function te(q){if(!l.value)return;const ye=i.value;if(!ye)return;const Re=q.target;Re instanceof Node&&(ye.contains(Re)||(l.value=!1,d.value="",u.value=!1,c.value=""))}yt(l,q=>{if(!q){u.value=!1,c.value="";return}E.value&&en(()=>{var ye;return(ye=s.value)==null?void 0:ye.focus()})}),Ar(()=>{window.addEventListener("pointerdown",te)}),Rr(()=>{window.removeEventListener("pointerdown",te)});const Ae={props:r,emit:o,rootRef:i,searchInputRef:s,addInputRef:a,isOpen:l,searchQuery:d,isAdding:u,addDraft:c,selectedLabel:h,openDirection:b,enableSearch:E,showAddAction:C,searchPlaceholderText:W,addActionLabelText:L,addPlaceholderText:M,filteredOptions:H,onToggle:X,onSelect:U,onStartAdd:Q,onEscapeSearch:re,onConfirmAdd:me,onCancelAdd:z,onDocumentPointerDown:te,IconTablerChevronDown:Ul};return Object.defineProperty(Ae,"__isScriptSetup",{enumerable:!1,value:!0}),Ae}}),sk={ref:"rootRef",class:"composer-dropdown"},ik=["disabled"],ak={class:"composer-dropdown-value"},lk={class:"composer-dropdown-menu"},ck={key:0,class:"composer-dropdown-search-wrap"},uk=["placeholder","onKeydown"],dk={class:"composer-dropdown-options",role:"listbox"},fk=["onClick"],hk={key:0,class:"composer-dropdown-empty"},pk={key:1,class:"composer-dropdown-add-wrap"},mk=["placeholder","onKeydown"];function gk(t,e,n,r,o,i){return T(),I("div",sk,[g("button",{class:"composer-dropdown-trigger",type:"button",disabled:n.disabled,onClick:r.onToggle},[g("span",ak,fe(r.selectedLabel),1),Ce(r.IconTablerChevronDown,{class:"composer-dropdown-chevron"})],8,ik),r.isOpen?(T(),I("div",{key:0,class:dt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":r.openDirection==="up","composer-dropdown-menu-wrap-down":r.openDirection==="down"}])},[g("div",lk,[r.enableSearch?(T(),I("div",ck,[Xn(g("input",{ref:"searchInputRef","onUpdate:modelValue":e[0]||(e[0]=s=>r.searchQuery=s),class:"composer-dropdown-search-input",type:"text",placeholder:r.searchPlaceholderText,onKeydown:qt(Je(r.onEscapeSearch,["prevent"]),["esc"])},null,40,uk),[[Zn,r.searchQuery]])])):ie("v-if",!0),g("ul",dk,[(T(!0),I(je,null,Tt(r.filteredOptions,s=>(T(),I("li",{key:s.value},[g("button",{class:dt(["composer-dropdown-option",{"is-selected":s.value===n.modelValue}]),type:"button",onClick:a=>r.onSelect(s.value)},fe(s.label),11,fk)]))),128)),r.filteredOptions.length===0?(T(),I("li",hk," No matching projects ")):ie("v-if",!0)]),r.showAddAction?(T(),I("div",pk,[r.isAdding?(T(),I(je,{key:0},[Xn(g("input",{ref:"addInputRef","onUpdate:modelValue":e[1]||(e[1]=s=>r.addDraft=s),class:"composer-dropdown-add-input",type:"text",placeholder:r.addPlaceholderText,onKeydown:[qt(Je(r.onConfirmAdd,["prevent"]),["enter"]),qt(Je(r.onCancelAdd,["prevent"]),["esc"])]},null,40,mk),[[Zn,r.addDraft]]),g("div",{class:"composer-dropdown-add-actions"},[g("button",{type:"button",class:"composer-dropdown-add-btn",onClick:r.onConfirmAdd},"Open"),g("button",{type:"button",class:"composer-dropdown-add-btn",onClick:r.onCancelAdd},"Cancel")])],64)):(T(),I("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:r.onStartAdd},fe(r.addActionLabelText),1))])):ie("v-if",!0)])],2)):ie("v-if",!0)],512)}const fh=tt(ok,[["render",gk],["__scopeId","data-v-be169669"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ComposerDropdown.vue"]]),vk=jt({__name:"ComposerSearchDropdown",props:{options:{type:Array,required:!0},selectedValues:{type:Array,required:!0},placeholder:{type:String,required:!1},searchPlaceholder:{type:String,required:!1},disabled:{type:Boolean,required:!1},openDirection:{type:String,required:!1}},emits:["toggle"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D(null),s=D(null),a=D(!1),l=D(""),d=D(0),u=ce(()=>r.openDirection??"down"),c=ce(()=>new Set(r.selectedValues)),h=ce(()=>{if(r.selectedValues.length===0)return r.placeholder||"Select...";if(r.selectedValues.length===1){const X=r.options.find(U=>U.value===r.selectedValues[0]);return(X==null?void 0:X.label)||r.placeholder||"Select..."}return`${r.selectedValues.length} selected`}),b=ce(()=>{const X=l.value.toLowerCase().trim();return X?r.options.filter(U=>{var Q;return U.label.toLowerCase().includes(X)||(((Q=U.description)==null?void 0:Q.toLowerCase().includes(X))??!1)}):r.options});function E(){r.disabled||(a.value=!a.value,a.value&&(l.value="",d.value=0,en(()=>{var X;return(X=s.value)==null?void 0:X.focus()})))}function C(X){o("toggle",X.value,!c.value.has(X.value))}function W(X){b.value.length!==0&&(d.value=(d.value+X+b.value.length)%b.value.length)}function L(){const X=b.value[d.value];X&&C(X)}function M(X){if(!a.value)return;const U=i.value;if(!U)return;const Q=X.target;Q instanceof Node&&(U.contains(Q)||(a.value=!1))}yt(l,()=>{d.value=0}),Ar(()=>window.addEventListener("pointerdown",M)),Rr(()=>window.removeEventListener("pointerdown",M));const H={props:r,emit:o,rootRef:i,searchRef:s,isOpen:a,searchQuery:l,highlightIdx:d,openDirection:u,selected:c,displayLabel:h,filtered:b,onToggle:E,onSelect:C,moveHighlight:W,selectHighlighted:L,onDocumentPointerDown:M,IconTablerChevronDown:Ul};return Object.defineProperty(H,"__isScriptSetup",{enumerable:!1,value:!0}),H}}),yk={ref:"rootRef",class:"search-dropdown"},bk=["disabled"],_k={class:"search-dropdown-value"},wk={class:"search-dropdown-search-wrap"},Tk=["placeholder","onKeydown"],Sk={key:0,class:"search-dropdown-list",role:"listbox"},kk=["onClick","onPointerenter"],Ik={class:"search-dropdown-option-check"},Ek={class:"search-dropdown-option-label"},Ck={key:0,class:"search-dropdown-option-desc"},Ak={key:1,class:"search-dropdown-empty"};function Rk(t,e,n,r,o,i){return T(),I("div",yk,[g("button",{class:"search-dropdown-trigger",type:"button",disabled:n.disabled,onClick:r.onToggle},[g("span",_k,fe(r.displayLabel),1),Ce(r.IconTablerChevronDown,{class:"search-dropdown-chevron"})],8,bk),r.isOpen?(T(),I("div",{key:0,class:dt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":r.openDirection==="up","search-dropdown-menu-wrap-down":r.openDirection==="down"}])},[g("div",wk,[Xn(g("input",{ref:"searchRef","onUpdate:modelValue":e[0]||(e[0]=s=>r.searchQuery=s),class:"search-dropdown-search",type:"text",placeholder:n.searchPlaceholder,onKeydown:[e[1]||(e[1]=qt(Je(s=>r.isOpen=!1,["prevent"]),["escape"])),qt(Je(r.selectHighlighted,["prevent"]),["enter"]),e[2]||(e[2]=qt(Je(s=>r.moveHighlight(1),["prevent"]),["arrow-down"])),e[3]||(e[3]=qt(Je(s=>r.moveHighlight(-1),["prevent"]),["arrow-up"]))]},null,40,Tk),[[Zn,r.searchQuery]])]),r.filtered.length>0?(T(),I("ul",Sk,[(T(!0),I(je,null,Tt(r.filtered,(s,a)=>(T(),I("li",{key:s.value},[g("button",{class:dt(["search-dropdown-option",{"is-selected":r.selected.has(s.value),"is-highlighted":a===r.highlightIdx}]),type:"button",onClick:l=>r.onSelect(s),onPointerenter:l=>r.highlightIdx=a},[g("span",Ik,fe(r.selected.has(s.value)?"✓":""),1),g("span",Ek,fe(s.label),1),s.description?(T(),I("span",Ck,fe(s.description),1)):ie("v-if",!0)],42,kk)]))),128))])):(T(),I("div",Ak,"No results"))],2)):ie("v-if",!0)],512)}const xk=tt(vk,[["render",Rk],["__scopeId","data-v-ea5ef418"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ComposerSearchDropdown.vue"]]),Pk=jt({__name:"ComposerSkillPicker",props:{skills:{type:Array,required:!0},visible:{type:Boolean,required:!0},anchorBottom:{type:Number,required:!1},anchorLeft:{type:Number,required:!1}},emits:["select","close"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D(null),s=D(null),a=D(""),l=D(0),d=ce(()=>{const E=a.value.toLowerCase().trim();return E?r.skills.filter(C=>C.name.toLowerCase().includes(E)||C.description.toLowerCase().includes(E)):r.skills}),u=ce(()=>{const E={};return r.anchorBottom!=null&&(E.bottom=`${r.anchorBottom}px`),r.anchorLeft!=null&&(E.left=`${r.anchorLeft}px`),E});function c(E){d.value.length!==0&&(l.value=(l.value+E+d.value.length)%d.value.length)}function h(){const E=d.value[l.value];E&&o("select",E)}yt(()=>r.visible,E=>{E&&(a.value="",l.value=0,en(()=>{var C;return(C=s.value)==null?void 0:C.focus()}))}),yt(a,()=>{l.value=0});const b={props:r,emit:o,rootRef:i,searchInputRef:s,query:a,highlightIndex:l,filtered:d,positionStyle:u,moveHighlight:c,selectHighlighted:h};return Object.defineProperty(b,"__isScriptSetup",{enumerable:!1,value:!0}),b}}),Ok={class:"skill-picker-header"},Mk=["onKeydown"],Nk={key:0,class:"skill-picker-list",role:"listbox"},Dk=["onClick","onPointerenter"],Lk={class:"skill-picker-name"},jk={key:0,class:"skill-picker-desc"},Uk={key:1,class:"skill-picker-empty"};function Fk(t,e,n,r,o,i){return n.visible?(T(),I("div",{key:0,ref:"rootRef",class:"skill-picker",style:oo(r.positionStyle)},[g("div",Ok,[Xn(g("input",{ref:"searchInputRef","onUpdate:modelValue":e[0]||(e[0]=s=>r.query=s),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[e[1]||(e[1]=qt(Je(s=>t.$emit("close"),["prevent"]),["escape"])),qt(Je(r.selectHighlighted,["prevent"]),["enter"]),e[2]||(e[2]=qt(Je(s=>r.moveHighlight(1),["prevent"]),["arrow-down"])),e[3]||(e[3]=qt(Je(s=>r.moveHighlight(-1),["prevent"]),["arrow-up"]))]},null,40,Mk),[[Zn,r.query]])]),r.filtered.length>0?(T(),I("ul",Nk,[(T(!0),I(je,null,Tt(r.filtered,(s,a)=>(T(),I("li",{key:s.path},[g("button",{class:dt(["skill-picker-item",{"is-highlighted":a===r.highlightIndex}]),type:"button",onClick:l=>t.$emit("select",s),onPointerenter:l=>r.highlightIndex=a},[g("span",Lk,fe(s.name),1),s.description?(T(),I("span",jk,fe(s.description),1)):ie("v-if",!0)],42,Dk)]))),128))])):(T(),I("div",Uk,"No skills found"))],4)):ie("v-if",!0)}const Bk=tt(Pk,[["render",Fk],["__scopeId","data-v-d50a74cc"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ComposerSkillPicker.vue"]]),Hk=jt({__name:"ThreadComposer",props:{activeThreadId:{type:String,required:!0},cwd:{type:String,required:!1},models:{type:Array,required:!0},selectedModel:{type:String,required:!0},selectedReasoningEffort:{type:String,required:!0},skills:{type:Array,required:!1},isTurnInProgress:{type:Boolean,required:!1},isInterruptingTurn:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},hasQueueAbove:{type:Boolean,required:!1},sendWithEnter:{type:Boolean,required:!1},inProgressSubmitMode:{type:String,required:!1}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D(""),s=D([]),a=D([]),l=D([]),{state:d,isSupported:u,startRecording:c,stopRecording:h}=eS({onTranscript:j=>{i.value=i.value?`${i.value}
|
|
82
|
-
${j}`:j}}),b=D(null),E=D(null),C=D(null),W=D(null),L=D(!1),M=D(!1),H=D(null),X=D(""),U=D([]),Q=D(!1),re=D(0);let me=0,z=null;const te=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Ae=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],q=ce(()=>r.models.map(j=>({value:j,label:j}))),ye=ce(()=>r.skills??[]),Re=ce(()=>a.value.map(j=>j.path)),Ue=ce(()=>(r.skills??[]).map(j=>({value:j.path,label:j.name,description:j.description}))),Ve=ce(()=>r.disabled||!r.activeThreadId?!1:i.value.trim().length>0||s.value.length>0||l.value.length>0),ae=ce(()=>r.disabled||!r.activeThreadId),ke=ce(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),it=ce(()=>r.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function Xe(j="steer"){var we;const ne=i.value.trim();if(Ve.value){if(o("submit",{text:ne,imageUrls:s.value.map(w=>w.url),fileAttachments:[...l.value],skills:a.value.map(w=>({name:w.name,path:w.path})),mode:j}),i.value="",s.value=[],a.value=[],l.value=[],L.value=!1,M.value=!1,$(),te){(we=W.value)==null||we.blur();return}en(()=>{var w;return(w=W.value)==null?void 0:w.focus()})}}function ze(){o("interrupt")}function at(j){o("update:selected-model",j)}function Fe(j){o("update:selected-reasoning-effort",j)}function ft(){ae.value||(L.value=!L.value)}function ht(){var j;(j=E.value)==null||j.click()}function nt(){var j;(j=C.value)==null||j.click()}function x(j){s.value=s.value.filter(ne=>ne.id!==j)}function oe(j){a.value=a.value.filter(ne=>ne.path!==j)}function Y(j){l.value=l.value.filter(ne=>ne.fsPath!==j)}function ue(j){const ne=j.replace(/\\/g,"/");if(l.value.some(N=>N.fsPath===ne))return;const we=ne.split("/").filter(Boolean),w=we[we.length-1]??ne;l.value=[...l.value,{label:w,path:ne,fsPath:ne}]}function be(j){return j.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(j.name)}function Ge(j){if(!(!j||j.length===0))for(const ne of Array.from(j))if(be(ne)){const we=new FileReader;we.onload=()=>{typeof we.result=="string"&&s.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:ne.name,url:we.result})},we.readAsDataURL(ne)}else qS(ne).then(we=>{we&&ue(we)}).catch(()=>{})}function p(j){j&&(j.value="")}function v(j){const ne=j.target;Ge((ne==null?void 0:ne.files)??null),p(ne),L.value=!1}function y(j){const ne=j.target;Ge((ne==null?void 0:ne.files)??null),p(ne),L.value=!1}function A(){const ne=i.value.startsWith("/");ne!==M.value&&(M.value=ne),V()}function R(j){if(Q.value){if(j.key==="Escape"){j.preventDefault(),$();return}if(j.key==="ArrowDown"){j.preventDefault(),U.value.length>0&&(re.value=(re.value+1)%U.value.length);return}if(j.key==="ArrowUp"){if(j.preventDefault(),U.value.length>0){const we=U.value.length;re.value=(re.value+we-1)%we}return}if(j.key==="Enter"||j.key==="Tab"){j.preventDefault();const we=U.value[re.value];we?B(we):$();return}}if(r.sendWithEnter!==!1?j.key==="Enter"&&!j.shiftKey:j.key==="Enter"&&(j.metaKey||j.ctrlKey)){j.preventDefault(),Xe(r.isTurnInProgress?ke.value:"steer");return}if(M.value){if(j.key==="Escape"){j.preventDefault(),P();return}if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();return}}}function P(){var j;M.value=!1,(j=W.value)==null||j.focus()}function $(){Q.value=!1,H.value=null,X.value="",U.value=[],re.value=0}function V(){const j=W.value;if(!j){$();return}const ne=j.selectionStart??i.value.length,w=i.value.slice(0,ne).match(/(^|\s)(@[^\s@]*)$/);if(!w){$();return}const N=w[2]??"",le=N.length,_e=ne-le;H.value=_e,X.value=N.slice(1),Q.value=!0,J()}async function J(){if(!Q.value)return;const j=(r.cwd??"").trim();if(!j){U.value=[];return}z&&clearTimeout(z);const ne=++me;z=setTimeout(async()=>{try{const we=await HS(j,X.value,20);if(!Q.value||ne!==me)return;U.value=we,re.value=0}catch{if(!Q.value||ne!==me)return;U.value=[]}},120)}function B(j){const ne=W.value,we=H.value;if(we!==null&&ne){const w=ne.selectionStart??i.value.length;i.value=`${i.value.slice(0,we)}${i.value.slice(w)}`.trimEnd()}ue(j.path),$(),en(()=>ne==null?void 0:ne.focus())}function pe(j){const ne=j.lastIndexOf("/");return ne<0?j:j.slice(ne+1)}function ee(j){const ne=j.lastIndexOf("/");return ne<=0?"":j.slice(0,ne)}function de(j){const ne=pe(j),we=ne.lastIndexOf(".");return we<=0?"":ne.slice(we+1).toLowerCase()}function Ee(j){const ne=de(j);return ne==="ts"?"TS":ne==="tsx"?"TSX":ne==="js"?"JS":ne==="jsx"?"JSX":ne==="json"?"{}":""}function Oe(j){const ne=de(j);return ne.startsWith("ts")?"ts":ne.startsWith("js")?"js":ne==="json"?"json":"default"}function Me(j){const ne=de(j);return ne==="md"||ne==="mdx"}function Ke(j){var ne;a.value.some(we=>we.path===j.path)||(a.value=[...a.value,j]),i.value=i.value.startsWith("/")?"":i.value,M.value=!1,(ne=W.value)==null||ne.focus()}function Ze(j,ne){if(ne){const we=(r.skills??[]).find(w=>w.path===j);we&&!a.value.some(w=>w.path===j)&&(a.value=[...a.value,we])}else a.value=a.value.filter(we=>we.path!==j)}function pt(j){if(!L.value)return;const ne=b.value;if(!ne)return;const we=j.target;!we||ne.contains(we)||(L.value=!1)}Ar(()=>{document.addEventListener("click",pt)}),Rr(()=>{document.removeEventListener("click",pt),z&&clearTimeout(z)}),yt(()=>r.activeThreadId,()=>{i.value="",s.value=[],a.value=[],l.value=[],L.value=!1,M.value=!1,$()}),yt(()=>r.cwd,()=>{Q.value&&J()});const ct={props:r,emit:o,draft:i,selectedImages:s,selectedSkills:a,fileAttachments:l,dictationState:d,isDictationSupported:u,startRecording:c,stopRecording:h,attachMenuRootRef:b,photoLibraryInputRef:E,cameraCaptureInputRef:C,inputRef:W,isAttachMenuOpen:L,isSlashMenuOpen:M,mentionStartIndex:H,mentionQuery:X,fileMentionSuggestions:U,isFileMentionOpen:Q,fileMentionHighlightedIndex:re,get fileMentionSearchToken(){return me},set fileMentionSearchToken(j){me=j},get fileMentionDebounceTimer(){return z},set fileMentionDebounceTimer(j){z=j},isAndroid:te,reasoningOptions:Ae,modelOptions:q,skillOptions:ye,selectedSkillPaths:Re,skillDropdownOptions:Ue,canSubmit:Ve,isInteractionDisabled:ae,inProgressMode:ke,placeholderText:it,onSubmit:Xe,onInterrupt:ze,onModelSelect:at,onReasoningEffortSelect:Fe,toggleAttachMenu:ft,triggerPhotoLibrary:ht,triggerCameraCapture:nt,removeImage:x,removeSkill:oe,removeFileAttachment:Y,addFileAttachment:ue,isImageFile:be,addFiles:Ge,clearInputValue:p,onPhotoLibraryChange:v,onCameraCaptureChange:y,onInputChange:A,onInputKeydown:R,closeSlashMenu:P,closeFileMention:$,updateFileMentionState:V,queueFileMentionSearch:J,applyFileMention:B,getMentionFileName:pe,getMentionDirName:ee,getFileExtension:de,getMentionBadgeText:Ee,getMentionBadgeClass:Oe,isMarkdownFile:Me,onSlashSkillSelect:Ke,onSkillDropdownToggle:Ze,onDocumentClick:pt,IconTablerArrowUp:JS,IconTablerFilePencil:Fl,IconTablerMicrophone:ZS,IconTablerPlayerStopFilled:rk,ComposerDropdown:fh,ComposerSearchDropdown:xk,ComposerSkillPicker:Bk};return Object.defineProperty(ct,"__isScriptSetup",{enumerable:!1,value:!0}),ct}}),$k={key:0,class:"thread-composer-attachments"},Vk=["src","alt"],Wk=["aria-label","disabled","onClick"],qk={key:1,class:"thread-composer-file-chips"},Gk=["title"],Kk=["aria-label","disabled","onClick"],zk={key:2,class:"thread-composer-skill-chips"},Jk={class:"thread-composer-skill-chip-name"},Yk=["aria-label","onClick"],Qk={class:"thread-composer-input-wrap"},Xk={key:0,class:"thread-composer-file-mentions"},Zk=["onMousedown"],eI={key:1,class:"thread-composer-file-mention-icon-markdown"},tI={class:"thread-composer-file-mention-text"},nI={class:"thread-composer-file-mention-name"},rI={key:0,class:"thread-composer-file-mention-dir"},oI={key:1,class:"thread-composer-file-mention-empty"},sI=["placeholder","disabled"],iI={class:"thread-composer-controls"},aI={ref:"attachMenuRootRef",class:"thread-composer-attach"},lI=["disabled"],cI={key:0,class:"thread-composer-attach-menu"},uI=["disabled"],dI=["disabled"],fI={class:"thread-composer-actions"},hI=["aria-label","title","disabled"],pI=["disabled"],mI=["aria-label","title","disabled"],gI=["disabled"],vI=["disabled"];function yI(t,e,n,r,o,i){return T(),I("form",{class:"thread-composer",onSubmit:e[7]||(e[7]=Je(s=>r.onSubmit("steer"),["prevent"]))},[g("div",{class:dt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":n.hasQueueAbove}])},[r.selectedImages.length>0?(T(),I("div",$k,[(T(!0),I(je,null,Tt(r.selectedImages,s=>(T(),I("div",{key:s.id,class:"thread-composer-attachment"},[g("img",{class:"thread-composer-attachment-image",src:s.url,alt:s.name||"Selected image"},null,8,Vk),g("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${s.name||"image"}`,disabled:r.isInteractionDisabled,onClick:a=>r.removeImage(s.id)}," x ",8,Wk)]))),128))])):ie("v-if",!0),r.fileAttachments.length>0?(T(),I("div",qk,[(T(!0),I(je,null,Tt(r.fileAttachments,s=>(T(),I("span",{key:s.fsPath,class:"thread-composer-file-chip"},[Ce(r.IconTablerFilePencil,{class:"thread-composer-file-chip-icon"}),g("span",{class:"thread-composer-file-chip-name",title:s.fsPath},fe(s.label),9,Gk),g("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${s.label}`,disabled:r.isInteractionDisabled,onClick:a=>r.removeFileAttachment(s.fsPath)},"×",8,Kk)]))),128))])):ie("v-if",!0),r.selectedSkills.length>0?(T(),I("div",zk,[(T(!0),I(je,null,Tt(r.selectedSkills,s=>(T(),I("span",{key:s.path,class:"thread-composer-skill-chip"},[g("span",Jk,fe(s.name),1),g("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${s.name}`,onClick:a=>r.removeSkill(s.path)},"×",8,Yk)]))),128))])):ie("v-if",!0),g("div",Qk,[r.isFileMentionOpen?(T(),I("div",Xk,[r.fileMentionSuggestions.length>0?(T(!0),I(je,{key:0},Tt(r.fileMentionSuggestions,(s,a)=>(T(),I("button",{key:s.path,class:dt(["thread-composer-file-mention-row",{"is-active":a===r.fileMentionHighlightedIndex}]),type:"button",onMousedown:Je(l=>r.applyFileMention(s),["prevent"])},[r.getMentionBadgeText(s.path)?(T(),I("span",{key:0,class:dt(["thread-composer-file-mention-icon-badge",`is-${r.getMentionBadgeClass(s.path)}`])},fe(r.getMentionBadgeText(s.path)),3)):r.isMarkdownFile(s.path)?(T(),I("span",eI,"↓")):(T(),vt(r.IconTablerFilePencil,{key:2,class:"thread-composer-file-mention-icon-file"})),g("span",tI,[g("span",nI,fe(r.getMentionFileName(s.path)),1),r.getMentionDirName(s.path)?(T(),I("span",rI,fe(r.getMentionDirName(s.path)),1)):ie("v-if",!0)])],42,Zk))),128)):(T(),I("div",oI,"No matching files"))])):ie("v-if",!0),Xn(g("textarea",{ref:"inputRef","onUpdate:modelValue":e[0]||(e[0]=s=>r.draft=s),class:"thread-composer-input",placeholder:r.placeholderText,disabled:r.isInteractionDisabled,onInput:r.onInputChange,onKeydown:r.onInputKeydown},null,40,sI),[[Zn,r.draft]]),Ce(r.ComposerSkillPicker,{skills:r.skillOptions,visible:r.isSlashMenuOpen,"anchor-bottom":44,"anchor-left":0,onSelect:r.onSlashSkillSelect,onClose:r.closeSlashMenu},null,8,["skills","visible"])]),g("div",iI,[g("div",aI,[g("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:r.isInteractionDisabled,onClick:r.toggleAttachMenu}," + ",8,lI),r.isAttachMenuOpen?(T(),I("div",cI,[g("button",{class:"thread-composer-attach-item",type:"button",disabled:r.isInteractionDisabled,onClick:r.triggerPhotoLibrary}," Add photos & files ",8,uI),g("button",{class:"thread-composer-attach-item",type:"button",disabled:r.isInteractionDisabled,onClick:r.triggerCameraCapture}," Take photo ",8,dI)])):ie("v-if",!0)],512),Ce(r.ComposerDropdown,{class:"thread-composer-control","model-value":n.selectedModel,options:r.modelOptions,placeholder:"Model","open-direction":"up",disabled:n.disabled||!n.activeThreadId||n.models.length===0||n.isTurnInProgress,"onUpdate:modelValue":r.onModelSelect},null,8,["model-value","options","disabled"]),Ce(r.ComposerSearchDropdown,{class:"thread-composer-control",options:r.skillDropdownOptions,"selected-values":r.selectedSkillPaths,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:n.disabled||!n.activeThreadId||n.isTurnInProgress,onToggle:r.onSkillDropdownToggle},null,8,["options","selected-values","disabled"]),Ce(r.ComposerDropdown,{class:"thread-composer-control","model-value":n.selectedReasoningEffort,options:r.reasoningOptions,placeholder:"Thinking","open-direction":"up",disabled:n.disabled||!n.activeThreadId||n.isTurnInProgress,"onUpdate:modelValue":r.onReasoningEffortSelect},null,8,["model-value","disabled"]),g("div",fI,[r.isDictationSupported&&!n.isTurnInProgress?(T(),I("button",{key:0,class:dt(["thread-composer-mic",{"thread-composer-mic--active":r.dictationState!=="idle"}]),type:"button","aria-label":r.dictationState==="recording"?"Stop dictation":"Hold to dictate",title:r.dictationState==="recording"?"Release to transcribe":"Hold to dictate",disabled:r.isInteractionDisabled,onMousedown:e[1]||(e[1]=Je((...s)=>r.startRecording&&r.startRecording(...s),["prevent"])),onMouseup:e[2]||(e[2]=(...s)=>r.stopRecording&&r.stopRecording(...s)),onMouseleave:e[3]||(e[3]=s=>r.dictationState==="recording"&&r.stopRecording()),onTouchstart:e[4]||(e[4]=Je((...s)=>r.startRecording&&r.startRecording(...s),["prevent"])),onTouchend:e[5]||(e[5]=(...s)=>r.stopRecording&&r.stopRecording(...s))},[Ce(r.IconTablerMicrophone,{class:"thread-composer-mic-icon"})],42,hI)):ie("v-if",!0),n.isTurnInProgress?(T(),I("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:n.disabled||!n.activeThreadId||n.isInterruptingTurn,onClick:r.onInterrupt},[Ce(r.IconTablerPlayerStopFilled,{class:"thread-composer-stop-icon"})],8,pI)):ie("v-if",!0),g("button",{class:dt(["thread-composer-submit",{"thread-composer-submit--queue":n.isTurnInProgress&&r.inProgressMode==="queue"}]),type:"button","aria-label":n.isTurnInProgress&&r.inProgressMode==="queue"?"Queue message":"Send message",title:n.isTurnInProgress?`Send as ${r.inProgressMode}`:"Send",disabled:!r.canSubmit,onClick:e[6]||(e[6]=s=>r.onSubmit(n.isTurnInProgress?r.inProgressMode:"steer"))},[Ce(r.IconTablerArrowUp,{class:"thread-composer-submit-icon"})],10,mI)])])],2),g("input",{ref:"photoLibraryInputRef",class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:r.isInteractionDisabled,onChange:r.onPhotoLibraryChange},null,40,gI),g("input",{ref:"cameraCaptureInputRef",class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:r.isInteractionDisabled,onChange:r.onCameraCaptureChange},null,40,vI)],32)}const bI=tt(Hk,[["render",yI],["__scopeId","data-v-7f2f3b8f"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/ThreadComposer.vue"]]),_I=jt({__name:"QueuedMessages",props:{messages:{type:Array,required:!0}},emits:["steer","delete"],setup(t,{expose:e}){e();const n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),wI={key:0,class:"queued-messages"},TI={class:"queued-messages-inner"},SI={class:"queued-row-text"},kI={class:"queued-row-actions"},II=["onClick"],EI=["onClick"];function CI(t,e,n,r,o,i){return n.messages.length>0?(T(),I("div",wI,[g("div",TI,[(T(!0),I(je,null,Tt(n.messages,s=>(T(),I("div",{key:s.id,class:"queued-row"},[e[1]||(e[1]=g("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),g("span",SI,fe(s.text),1),g("div",kI,[g("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:a=>t.$emit("steer",s.id)},"Steer",8,II),g("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:a=>t.$emit("delete",s.id)},[...e[0]||(e[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,EI)])]))),128))])])):ie("v-if",!0)}const AI=tt(_I,[["render",CI],["__scopeId","data-v-16e8dd7b"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/QueuedMessages.vue"]]),RI=()=>{};var Du={};/**
|
|
83
|
-
* @license
|
|
84
|
-
* Copyright 2017 Google LLC
|
|
85
|
-
*
|
|
86
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
87
|
-
* you may not use this file except in compliance with the License.
|
|
88
|
-
* You may obtain a copy of the License at
|
|
89
|
-
*
|
|
90
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
91
|
-
*
|
|
92
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
93
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
94
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
95
|
-
* See the License for the specific language governing permissions and
|
|
96
|
-
* limitations under the License.
|
|
97
|
-
*/const hh=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=o&63|128):(o&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(o=65536+((o&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=o&63|128):(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=o&63|128)}return e},xI=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n++];if(o<128)e[r++]=String.fromCharCode(o);else if(o>191&&o<224){const i=t[n++];e[r++]=String.fromCharCode((o&31)<<6|i&63)}else if(o>239&&o<365){const i=t[n++],s=t[n++],a=t[n++],l=((o&7)<<18|(i&63)<<12|(s&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const i=t[n++],s=t[n++];e[r++]=String.fromCharCode((o&15)<<12|(i&63)<<6|s&63)}}return e.join("")},ph={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let o=0;o<t.length;o+=3){const i=t[o],s=o+1<t.length,a=s?t[o+1]:0,l=o+2<t.length,d=l?t[o+2]:0,u=i>>2,c=(i&3)<<4|a>>4;let h=(a&15)<<2|d>>6,b=d&63;l||(b=64,s||(h=64)),r.push(n[u],n[c],n[h],n[b])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(hh(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):xI(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let o=0;o<t.length;){const i=n[t.charAt(o++)],a=o<t.length?n[t.charAt(o)]:0;++o;const d=o<t.length?n[t.charAt(o)]:64;++o;const c=o<t.length?n[t.charAt(o)]:64;if(++o,i==null||a==null||d==null||c==null)throw new PI;const h=i<<2|a>>4;if(r.push(h),d!==64){const b=a<<4&240|d>>2;if(r.push(b),c!==64){const E=d<<6&192|c;r.push(E)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class PI extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const OI=function(t){const e=hh(t);return ph.encodeByteArray(e,!0)},mh=function(t){return OI(t).replace(/\./g,"")},gh=function(t){try{return ph.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
|
|
98
|
-
* @license
|
|
99
|
-
* Copyright 2022 Google LLC
|
|
100
|
-
*
|
|
101
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
102
|
-
* you may not use this file except in compliance with the License.
|
|
103
|
-
* You may obtain a copy of the License at
|
|
104
|
-
*
|
|
105
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
106
|
-
*
|
|
107
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
108
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
109
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
110
|
-
* See the License for the specific language governing permissions and
|
|
111
|
-
* limitations under the License.
|
|
112
|
-
*/function MI(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
|
|
113
|
-
* @license
|
|
114
|
-
* Copyright 2022 Google LLC
|
|
115
|
-
*
|
|
116
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
117
|
-
* you may not use this file except in compliance with the License.
|
|
118
|
-
* You may obtain a copy of the License at
|
|
119
|
-
*
|
|
120
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
121
|
-
*
|
|
122
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
123
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
124
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
125
|
-
* See the License for the specific language governing permissions and
|
|
126
|
-
* limitations under the License.
|
|
127
|
-
*/const NI=()=>MI().__FIREBASE_DEFAULTS__,DI=()=>{if(typeof process>"u"||typeof Du>"u")return;const t=Du.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},LI=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&gh(t[1]);return e&&JSON.parse(e)},Vl=()=>{try{return RI()||NI()||DI()||LI()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},jI=t=>{var e,n;return(n=(e=Vl())==null?void 0:e.emulatorHosts)==null?void 0:n[t]},vh=()=>{var t;return(t=Vl())==null?void 0:t.config},yh=t=>{var e;return(e=Vl())==null?void 0:e[`_${t}`]};/**
|
|
128
|
-
* @license
|
|
129
|
-
* Copyright 2017 Google LLC
|
|
130
|
-
*
|
|
131
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
132
|
-
* you may not use this file except in compliance with the License.
|
|
133
|
-
* You may obtain a copy of the License at
|
|
134
|
-
*
|
|
135
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
136
|
-
*
|
|
137
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
138
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
139
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
140
|
-
* See the License for the specific language governing permissions and
|
|
141
|
-
* limitations under the License.
|
|
142
|
-
*/class UI{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/**
|
|
143
|
-
* @license
|
|
144
|
-
* Copyright 2025 Google LLC
|
|
145
|
-
*
|
|
146
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
147
|
-
* you may not use this file except in compliance with the License.
|
|
148
|
-
* You may obtain a copy of the License at
|
|
149
|
-
*
|
|
150
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
151
|
-
*
|
|
152
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
153
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
154
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
155
|
-
* See the License for the specific language governing permissions and
|
|
156
|
-
* limitations under the License.
|
|
157
|
-
*/function Fi(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function FI(t){return(await fetch(t,{credentials:"include"})).ok}const cs={};function BI(){const t={prod:[],emulator:[]};for(const e of Object.keys(cs))cs[e]?t.emulator.push(e):t.prod.push(e);return t}function HI(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let Lu=!1;function $I(t,e){if(typeof window>"u"||typeof document>"u"||!Fi(window.location.host)||cs[t]===e||cs[t]||Lu)return;cs[t]=e;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",i=BI().prod.length>0;function s(){const h=document.getElementById(r);h&&h.remove()}function a(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function l(h,b){h.setAttribute("width","24"),h.setAttribute("id",b),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function d(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" ×",h.onclick=()=>{Lu=!0,s()},h}function u(h,b){h.setAttribute("id",b),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function c(){const h=HI(r),b=n("text"),E=document.getElementById(b)||document.createElement("span"),C=n("learnmore"),W=document.getElementById(C)||document.createElement("a"),L=n("preprendIcon"),M=document.getElementById(L)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const H=h.element;a(H),u(W,C);const X=d();l(M,L),H.append(M,E,W,X),document.body.appendChild(H)}i?(E.innerText="Preview backend disconnected.",M.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
158
|
-
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
159
|
-
</g>
|
|
160
|
-
<defs>
|
|
161
|
-
<clipPath id="clip0_6013_33858">
|
|
162
|
-
<rect width="24" height="24" fill="white"/>
|
|
163
|
-
</clipPath>
|
|
164
|
-
</defs>`):(M.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
165
|
-
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
166
|
-
</g>
|
|
167
|
-
<defs>
|
|
168
|
-
<clipPath id="clip0_6083_34804">
|
|
169
|
-
<rect width="24" height="24" fill="white"/>
|
|
170
|
-
</clipPath>
|
|
171
|
-
</defs>`,E.innerText="Preview backend running in this workspace."),E.setAttribute("id",b)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",c):c()}/**
|
|
172
|
-
* @license
|
|
173
|
-
* Copyright 2017 Google LLC
|
|
174
|
-
*
|
|
175
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
176
|
-
* you may not use this file except in compliance with the License.
|
|
177
|
-
* You may obtain a copy of the License at
|
|
178
|
-
*
|
|
179
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
-
*
|
|
181
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
182
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
183
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
184
|
-
* See the License for the specific language governing permissions and
|
|
185
|
-
* limitations under the License.
|
|
186
|
-
*/function Kt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function VI(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Kt())}function WI(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function qI(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function GI(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function KI(){const t=Kt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function zI(){try{return typeof indexedDB=="object"}catch{return!1}}function JI(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(r);o.onsuccess=()=>{o.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},o.onupgradeneeded=()=>{n=!1},o.onerror=()=>{var i;e(((i=o.error)==null?void 0:i.message)||"")}}catch(n){e(n)}})}/**
|
|
187
|
-
* @license
|
|
188
|
-
* Copyright 2017 Google LLC
|
|
189
|
-
*
|
|
190
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
-
* you may not use this file except in compliance with the License.
|
|
192
|
-
* You may obtain a copy of the License at
|
|
193
|
-
*
|
|
194
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
-
*
|
|
196
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
197
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
-
* See the License for the specific language governing permissions and
|
|
200
|
-
* limitations under the License.
|
|
201
|
-
*/const YI="FirebaseError";class xr extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=YI,Object.setPrototypeOf(this,xr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ps.prototype.create)}}class Ps{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},o=`${this.service}/${e}`,i=this.errors[e],s=i?QI(i,r):"Error",a=`${this.serviceName}: ${s} (${o}).`;return new xr(o,a,r)}}function QI(t,e){return t.replace(XI,(n,r)=>{const o=e[r];return o!=null?String(o):`<${r}?>`})}const XI=/\{\$([^}]+)}/g;function ZI(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Do(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const o of n){if(!r.includes(o))return!1;const i=t[o],s=e[o];if(ju(i)&&ju(s)){if(!Do(i,s))return!1}else if(i!==s)return!1}for(const o of r)if(!n.includes(o))return!1;return!0}function ju(t){return t!==null&&typeof t=="object"}/**
|
|
202
|
-
* @license
|
|
203
|
-
* Copyright 2017 Google LLC
|
|
204
|
-
*
|
|
205
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
206
|
-
* you may not use this file except in compliance with the License.
|
|
207
|
-
* You may obtain a copy of the License at
|
|
208
|
-
*
|
|
209
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
210
|
-
*
|
|
211
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
212
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
213
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
214
|
-
* See the License for the specific language governing permissions and
|
|
215
|
-
* limitations under the License.
|
|
216
|
-
*/function Os(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(o=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(o))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function e0(t,e){const n=new t0(t,e);return n.subscribe.bind(n)}class t0{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let o;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");n0(e,["next","error","complete"])?o=e:o={next:e,error:n,complete:r},o.next===void 0&&(o.next=ga),o.error===void 0&&(o.error=ga),o.complete===void 0&&(o.complete=ga);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),i}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function n0(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function ga(){}/**
|
|
217
|
-
* @license
|
|
218
|
-
* Copyright 2021 Google LLC
|
|
219
|
-
*
|
|
220
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
221
|
-
* you may not use this file except in compliance with the License.
|
|
222
|
-
* You may obtain a copy of the License at
|
|
223
|
-
*
|
|
224
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
225
|
-
*
|
|
226
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
227
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
228
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
229
|
-
* See the License for the specific language governing permissions and
|
|
230
|
-
* limitations under the License.
|
|
231
|
-
*/function Ho(t){return t&&t._delegate?t._delegate:t}class Lo{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
|
|
232
|
-
* @license
|
|
233
|
-
* Copyright 2019 Google LLC
|
|
234
|
-
*
|
|
235
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
236
|
-
* you may not use this file except in compliance with the License.
|
|
237
|
-
* You may obtain a copy of the License at
|
|
238
|
-
*
|
|
239
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
240
|
-
*
|
|
241
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
242
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
243
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
244
|
-
* See the License for the specific language governing permissions and
|
|
245
|
-
* limitations under the License.
|
|
246
|
-
*/const qr="[DEFAULT]";/**
|
|
247
|
-
* @license
|
|
248
|
-
* Copyright 2019 Google LLC
|
|
249
|
-
*
|
|
250
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
251
|
-
* you may not use this file except in compliance with the License.
|
|
252
|
-
* You may obtain a copy of the License at
|
|
253
|
-
*
|
|
254
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
255
|
-
*
|
|
256
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
257
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
258
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
259
|
-
* See the License for the specific language governing permissions and
|
|
260
|
-
* limitations under the License.
|
|
261
|
-
*/class r0{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new UI;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:n});o&&r.resolve(o)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(o){if(r)return null;throw o}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(s0(e))try{this.getOrInitializeService({instanceIdentifier:qr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:o});r.resolve(i)}catch{}}}}clearInstance(e=qr){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=qr){return this.instances.has(e)}getOptions(e=qr){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,s]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(i);r===a&&s.resolve(o)}return o}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),o=this.onInitCallbacks.get(r)??new Set;o.add(e),this.onInitCallbacks.set(r,o);const i=this.instances.get(r);return i&&e(i,r),()=>{o.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const o of r)try{o(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:o0(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=qr){return this.component?this.component.multipleInstances?e:qr:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function o0(t){return t===qr?void 0:t}function s0(t){return t.instantiationMode==="EAGER"}/**
|
|
262
|
-
* @license
|
|
263
|
-
* Copyright 2019 Google LLC
|
|
264
|
-
*
|
|
265
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
266
|
-
* you may not use this file except in compliance with the License.
|
|
267
|
-
* You may obtain a copy of the License at
|
|
268
|
-
*
|
|
269
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
270
|
-
*
|
|
271
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
272
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
273
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
274
|
-
* See the License for the specific language governing permissions and
|
|
275
|
-
* limitations under the License.
|
|
276
|
-
*/class i0{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new r0(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
277
|
-
* @license
|
|
278
|
-
* Copyright 2017 Google LLC
|
|
279
|
-
*
|
|
280
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
281
|
-
* you may not use this file except in compliance with the License.
|
|
282
|
-
* You may obtain a copy of the License at
|
|
283
|
-
*
|
|
284
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
285
|
-
*
|
|
286
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
287
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
288
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
289
|
-
* See the License for the specific language governing permissions and
|
|
290
|
-
* limitations under the License.
|
|
291
|
-
*/var ut;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(ut||(ut={}));const a0={debug:ut.DEBUG,verbose:ut.VERBOSE,info:ut.INFO,warn:ut.WARN,error:ut.ERROR,silent:ut.SILENT},l0=ut.INFO,c0={[ut.DEBUG]:"log",[ut.VERBOSE]:"log",[ut.INFO]:"info",[ut.WARN]:"warn",[ut.ERROR]:"error"},u0=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),o=c0[e];if(o)console[o](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class bh{constructor(e){this.name=e,this._logLevel=l0,this._logHandler=u0,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ut))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?a0[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ut.DEBUG,...e),this._logHandler(this,ut.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ut.VERBOSE,...e),this._logHandler(this,ut.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ut.INFO,...e),this._logHandler(this,ut.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ut.WARN,...e),this._logHandler(this,ut.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ut.ERROR,...e),this._logHandler(this,ut.ERROR,...e)}}const d0=(t,e)=>e.some(n=>t instanceof n);let Uu,Fu;function f0(){return Uu||(Uu=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function h0(){return Fu||(Fu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const _h=new WeakMap,ol=new WeakMap,wh=new WeakMap,va=new WeakMap,Wl=new WeakMap;function p0(t){const e=new Promise((n,r)=>{const o=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{n(Ir(t.result)),o()},s=()=>{r(t.error),o()};t.addEventListener("success",i),t.addEventListener("error",s)});return e.then(n=>{n instanceof IDBCursor&&_h.set(n,t)}).catch(()=>{}),Wl.set(e,t),e}function m0(t){if(ol.has(t))return;const e=new Promise((n,r)=>{const o=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{n(),o()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});ol.set(t,e)}let sl={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return ol.get(t);if(e==="objectStoreNames")return t.objectStoreNames||wh.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ir(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function g0(t){sl=t(sl)}function v0(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(ya(this),e,...n);return wh.set(r,e.sort?e.sort():[e]),Ir(r)}:h0().includes(t)?function(...e){return t.apply(ya(this),e),Ir(_h.get(this))}:function(...e){return Ir(t.apply(ya(this),e))}}function y0(t){return typeof t=="function"?v0(t):(t instanceof IDBTransaction&&m0(t),d0(t,f0())?new Proxy(t,sl):t)}function Ir(t){if(t instanceof IDBRequest)return p0(t);if(va.has(t))return va.get(t);const e=y0(t);return e!==t&&(va.set(t,e),Wl.set(e,t)),e}const ya=t=>Wl.get(t);function b0(t,e,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(t,e),a=Ir(s);return r&&s.addEventListener("upgradeneeded",l=>{r(Ir(s.result),l.oldVersion,l.newVersion,Ir(s.transaction),l)}),n&&s.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{i&&l.addEventListener("close",()=>i()),o&&l.addEventListener("versionchange",d=>o(d.oldVersion,d.newVersion,d))}).catch(()=>{}),a}const _0=["get","getKey","getAll","getAllKeys","count"],w0=["put","add","delete","clear"],ba=new Map;function Bu(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(ba.get(e))return ba.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,o=w0.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||_0.includes(n)))return;const i=async function(s,...a){const l=this.transaction(s,o?"readwrite":"readonly");let d=l.store;return r&&(d=d.index(a.shift())),(await Promise.all([d[n](...a),o&&l.done]))[0]};return ba.set(e,i),i}g0(t=>({...t,get:(e,n,r)=>Bu(e,n)||t.get(e,n,r),has:(e,n)=>!!Bu(e,n)||t.has(e,n)}));/**
|
|
292
|
-
* @license
|
|
293
|
-
* Copyright 2019 Google LLC
|
|
294
|
-
*
|
|
295
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
296
|
-
* you may not use this file except in compliance with the License.
|
|
297
|
-
* You may obtain a copy of the License at
|
|
298
|
-
*
|
|
299
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
300
|
-
*
|
|
301
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
303
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
-
* See the License for the specific language governing permissions and
|
|
305
|
-
* limitations under the License.
|
|
306
|
-
*/class T0{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(S0(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function S0(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const il="@firebase/app",Hu="0.14.9";/**
|
|
307
|
-
* @license
|
|
308
|
-
* Copyright 2019 Google LLC
|
|
309
|
-
*
|
|
310
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
311
|
-
* you may not use this file except in compliance with the License.
|
|
312
|
-
* You may obtain a copy of the License at
|
|
313
|
-
*
|
|
314
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
315
|
-
*
|
|
316
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
317
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
318
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
319
|
-
* See the License for the specific language governing permissions and
|
|
320
|
-
* limitations under the License.
|
|
321
|
-
*/const er=new bh("@firebase/app"),k0="@firebase/app-compat",I0="@firebase/analytics-compat",E0="@firebase/analytics",C0="@firebase/app-check-compat",A0="@firebase/app-check",R0="@firebase/auth",x0="@firebase/auth-compat",P0="@firebase/database",O0="@firebase/data-connect",M0="@firebase/database-compat",N0="@firebase/functions",D0="@firebase/functions-compat",L0="@firebase/installations",j0="@firebase/installations-compat",U0="@firebase/messaging",F0="@firebase/messaging-compat",B0="@firebase/performance",H0="@firebase/performance-compat",$0="@firebase/remote-config",V0="@firebase/remote-config-compat",W0="@firebase/storage",q0="@firebase/storage-compat",G0="@firebase/firestore",K0="@firebase/ai",z0="@firebase/firestore-compat",J0="firebase",Y0="12.10.0";/**
|
|
322
|
-
* @license
|
|
323
|
-
* Copyright 2019 Google LLC
|
|
324
|
-
*
|
|
325
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
326
|
-
* you may not use this file except in compliance with the License.
|
|
327
|
-
* You may obtain a copy of the License at
|
|
328
|
-
*
|
|
329
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
330
|
-
*
|
|
331
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
332
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
333
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
334
|
-
* See the License for the specific language governing permissions and
|
|
335
|
-
* limitations under the License.
|
|
336
|
-
*/const al="[DEFAULT]",Q0={[il]:"fire-core",[k0]:"fire-core-compat",[E0]:"fire-analytics",[I0]:"fire-analytics-compat",[A0]:"fire-app-check",[C0]:"fire-app-check-compat",[R0]:"fire-auth",[x0]:"fire-auth-compat",[P0]:"fire-rtdb",[O0]:"fire-data-connect",[M0]:"fire-rtdb-compat",[N0]:"fire-fn",[D0]:"fire-fn-compat",[L0]:"fire-iid",[j0]:"fire-iid-compat",[U0]:"fire-fcm",[F0]:"fire-fcm-compat",[B0]:"fire-perf",[H0]:"fire-perf-compat",[$0]:"fire-rc",[V0]:"fire-rc-compat",[W0]:"fire-gcs",[q0]:"fire-gcs-compat",[G0]:"fire-fst",[z0]:"fire-fst-compat",[K0]:"fire-vertex","fire-js":"fire-js",[J0]:"fire-js-all"};/**
|
|
337
|
-
* @license
|
|
338
|
-
* Copyright 2019 Google LLC
|
|
339
|
-
*
|
|
340
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
341
|
-
* you may not use this file except in compliance with the License.
|
|
342
|
-
* You may obtain a copy of the License at
|
|
343
|
-
*
|
|
344
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
345
|
-
*
|
|
346
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
347
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
348
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
349
|
-
* See the License for the specific language governing permissions and
|
|
350
|
-
* limitations under the License.
|
|
351
|
-
*/const ys=new Map,X0=new Map,ll=new Map;function $u(t,e){try{t.container.addComponent(e)}catch(n){er.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function bs(t){const e=t.name;if(ll.has(e))return er.debug(`There were multiple attempts to register component ${e}.`),!1;ll.set(e,t);for(const n of ys.values())$u(n,t);for(const n of X0.values())$u(n,t);return!0}function Th(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function xn(t){return t==null?!1:t.settings!==void 0}/**
|
|
352
|
-
* @license
|
|
353
|
-
* Copyright 2019 Google LLC
|
|
354
|
-
*
|
|
355
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
356
|
-
* you may not use this file except in compliance with the License.
|
|
357
|
-
* You may obtain a copy of the License at
|
|
358
|
-
*
|
|
359
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
360
|
-
*
|
|
361
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
362
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
363
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
364
|
-
* See the License for the specific language governing permissions and
|
|
365
|
-
* limitations under the License.
|
|
366
|
-
*/const Z0={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Er=new Ps("app","Firebase",Z0);/**
|
|
367
|
-
* @license
|
|
368
|
-
* Copyright 2019 Google LLC
|
|
369
|
-
*
|
|
370
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
371
|
-
* you may not use this file except in compliance with the License.
|
|
372
|
-
* You may obtain a copy of the License at
|
|
373
|
-
*
|
|
374
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
375
|
-
*
|
|
376
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
377
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
378
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
379
|
-
* See the License for the specific language governing permissions and
|
|
380
|
-
* limitations under the License.
|
|
381
|
-
*/class e1{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Lo("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Er.create("app-deleted",{appName:this._name})}}/**
|
|
382
|
-
* @license
|
|
383
|
-
* Copyright 2019 Google LLC
|
|
384
|
-
*
|
|
385
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
386
|
-
* you may not use this file except in compliance with the License.
|
|
387
|
-
* You may obtain a copy of the License at
|
|
388
|
-
*
|
|
389
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
390
|
-
*
|
|
391
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
392
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
393
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
394
|
-
* See the License for the specific language governing permissions and
|
|
395
|
-
* limitations under the License.
|
|
396
|
-
*/const Ms=Y0;function Sh(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:al,automaticDataCollectionEnabled:!0,...e},o=r.name;if(typeof o!="string"||!o)throw Er.create("bad-app-name",{appName:String(o)});if(n||(n=vh()),!n)throw Er.create("no-options");const i=ys.get(o);if(i){if(Do(n,i.options)&&Do(r,i.config))return i;throw Er.create("duplicate-app",{appName:o})}const s=new i0(o);for(const l of ll.values())s.addComponent(l);const a=new e1(n,r,s);return ys.set(o,a),a}function kh(t=al){const e=ys.get(t);if(!e&&t===al&&vh())return Sh();if(!e)throw Er.create("no-app",{appName:t});return e}function t1(){return Array.from(ys.values())}function Ao(t,e,n){let r=Q0[t]??t;n&&(r+=`-${n}`);const o=r.match(/\s|\//),i=e.match(/\s|\//);if(o||i){const s=[`Unable to register library "${r}" with version "${e}":`];o&&s.push(`library name "${r}" contains illegal characters (whitespace or "/")`),o&&i&&s.push("and"),i&&s.push(`version name "${e}" contains illegal characters (whitespace or "/")`),er.warn(s.join(" "));return}bs(new Lo(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/**
|
|
397
|
-
* @license
|
|
398
|
-
* Copyright 2021 Google LLC
|
|
399
|
-
*
|
|
400
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
401
|
-
* you may not use this file except in compliance with the License.
|
|
402
|
-
* You may obtain a copy of the License at
|
|
403
|
-
*
|
|
404
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
405
|
-
*
|
|
406
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
407
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
408
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
409
|
-
* See the License for the specific language governing permissions and
|
|
410
|
-
* limitations under the License.
|
|
411
|
-
*/const n1="firebase-heartbeat-database",r1=1,_s="firebase-heartbeat-store";let _a=null;function Ih(){return _a||(_a=b0(n1,r1,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(_s)}catch(n){console.warn(n)}}}}).catch(t=>{throw Er.create("idb-open",{originalErrorMessage:t.message})})),_a}async function o1(t){try{const n=(await Ih()).transaction(_s),r=await n.objectStore(_s).get(Eh(t));return await n.done,r}catch(e){if(e instanceof xr)er.warn(e.message);else{const n=Er.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});er.warn(n.message)}}}async function Vu(t,e){try{const r=(await Ih()).transaction(_s,"readwrite");await r.objectStore(_s).put(e,Eh(t)),await r.done}catch(n){if(n instanceof xr)er.warn(n.message);else{const r=Er.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});er.warn(r.message)}}}function Eh(t){return`${t.name}!${t.options.appId}`}/**
|
|
412
|
-
* @license
|
|
413
|
-
* Copyright 2021 Google LLC
|
|
414
|
-
*
|
|
415
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
416
|
-
* you may not use this file except in compliance with the License.
|
|
417
|
-
* You may obtain a copy of the License at
|
|
418
|
-
*
|
|
419
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
420
|
-
*
|
|
421
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
422
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
423
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
424
|
-
* See the License for the specific language governing permissions and
|
|
425
|
-
* limitations under the License.
|
|
426
|
-
*/const s1=1024,i1=30;class a1{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new c1(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=Wu();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(s=>s.date===i))return;if(this._heartbeatsCache.heartbeats.push({date:i,agent:o}),this._heartbeatsCache.heartbeats.length>i1){const s=u1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){er.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Wu(),{heartbeatsToSend:r,unsentEntries:o}=l1(this._heartbeatsCache.heartbeats),i=mh(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(n){return er.warn(n),""}}}function Wu(){return new Date().toISOString().substring(0,10)}function l1(t,e=s1){const n=[];let r=t.slice();for(const o of t){const i=n.find(s=>s.agent===o.agent);if(i){if(i.dates.push(o.date),qu(n)>e){i.dates.pop();break}}else if(n.push({agent:o.agent,dates:[o.date]}),qu(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class c1{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return zI()?JI().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await o1(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Vu(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Vu(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function qu(t){return mh(JSON.stringify({version:2,heartbeats:t})).length}function u1(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}/**
|
|
427
|
-
* @license
|
|
428
|
-
* Copyright 2019 Google LLC
|
|
429
|
-
*
|
|
430
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
431
|
-
* you may not use this file except in compliance with the License.
|
|
432
|
-
* You may obtain a copy of the License at
|
|
433
|
-
*
|
|
434
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
435
|
-
*
|
|
436
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
437
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
438
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
439
|
-
* See the License for the specific language governing permissions and
|
|
440
|
-
* limitations under the License.
|
|
441
|
-
*/function d1(t){bs(new Lo("platform-logger",e=>new T0(e),"PRIVATE")),bs(new Lo("heartbeat",e=>new a1(e),"PRIVATE")),Ao(il,Hu,t),Ao(il,Hu,"esm2020"),Ao("fire-js","")}d1("");var f1="firebase",h1="12.10.0";/**
|
|
442
|
-
* @license
|
|
443
|
-
* Copyright 2020 Google LLC
|
|
444
|
-
*
|
|
445
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
446
|
-
* you may not use this file except in compliance with the License.
|
|
447
|
-
* You may obtain a copy of the License at
|
|
448
|
-
*
|
|
449
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
450
|
-
*
|
|
451
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
452
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
453
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
454
|
-
* See the License for the specific language governing permissions and
|
|
455
|
-
* limitations under the License.
|
|
456
|
-
*/Ao(f1,h1,"app");function Ch(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const p1=Ch,Ah=new Ps("auth","Firebase",Ch());/**
|
|
457
|
-
* @license
|
|
458
|
-
* Copyright 2020 Google LLC
|
|
459
|
-
*
|
|
460
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
461
|
-
* you may not use this file except in compliance with the License.
|
|
462
|
-
* You may obtain a copy of the License at
|
|
463
|
-
*
|
|
464
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
465
|
-
*
|
|
466
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
467
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
468
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
469
|
-
* See the License for the specific language governing permissions and
|
|
470
|
-
* limitations under the License.
|
|
471
|
-
*/const _i=new bh("@firebase/auth");function m1(t,...e){_i.logLevel<=ut.WARN&&_i.warn(`Auth (${Ms}): ${t}`,...e)}function ei(t,...e){_i.logLevel<=ut.ERROR&&_i.error(`Auth (${Ms}): ${t}`,...e)}/**
|
|
472
|
-
* @license
|
|
473
|
-
* Copyright 2020 Google LLC
|
|
474
|
-
*
|
|
475
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
476
|
-
* you may not use this file except in compliance with the License.
|
|
477
|
-
* You may obtain a copy of the License at
|
|
478
|
-
*
|
|
479
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
480
|
-
*
|
|
481
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
482
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
483
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
484
|
-
* See the License for the specific language governing permissions and
|
|
485
|
-
* limitations under the License.
|
|
486
|
-
*/function Ln(t,...e){throw Gl(t,...e)}function hn(t,...e){return Gl(t,...e)}function ql(t,e,n){const r={...p1(),[e]:n};return new Ps("auth","Firebase",r).create(e,{appName:t.name})}function no(t){return ql(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function g1(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&Ln(t,"argument-error"),ql(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Gl(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return Ah.create(t,...e)}function Le(t,e,...n){if(!t)throw Gl(e,...n)}function Kn(t){const e="INTERNAL ASSERTION FAILED: "+t;throw ei(e),new Error(e)}function tr(t,e){t||Kn(e)}/**
|
|
487
|
-
* @license
|
|
488
|
-
* Copyright 2020 Google LLC
|
|
489
|
-
*
|
|
490
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
491
|
-
* you may not use this file except in compliance with the License.
|
|
492
|
-
* You may obtain a copy of the License at
|
|
493
|
-
*
|
|
494
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
495
|
-
*
|
|
496
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
497
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
498
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
499
|
-
* See the License for the specific language governing permissions and
|
|
500
|
-
* limitations under the License.
|
|
501
|
-
*/function cl(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.href)||""}function v1(){return Gu()==="http:"||Gu()==="https:"}function Gu(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.protocol)||null}/**
|
|
502
|
-
* @license
|
|
503
|
-
* Copyright 2020 Google LLC
|
|
504
|
-
*
|
|
505
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
506
|
-
* you may not use this file except in compliance with the License.
|
|
507
|
-
* You may obtain a copy of the License at
|
|
508
|
-
*
|
|
509
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
510
|
-
*
|
|
511
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
512
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
513
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
514
|
-
* See the License for the specific language governing permissions and
|
|
515
|
-
* limitations under the License.
|
|
516
|
-
*/function y1(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(v1()||qI()||"connection"in navigator)?navigator.onLine:!0}function b1(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
|
|
517
|
-
* @license
|
|
518
|
-
* Copyright 2020 Google LLC
|
|
519
|
-
*
|
|
520
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
521
|
-
* you may not use this file except in compliance with the License.
|
|
522
|
-
* You may obtain a copy of the License at
|
|
523
|
-
*
|
|
524
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
525
|
-
*
|
|
526
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
527
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
528
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
529
|
-
* See the License for the specific language governing permissions and
|
|
530
|
-
* limitations under the License.
|
|
531
|
-
*/class Ns{constructor(e,n){this.shortDelay=e,this.longDelay=n,tr(n>e,"Short delay should be less than long delay!"),this.isMobile=VI()||GI()}get(){return y1()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
532
|
-
* @license
|
|
533
|
-
* Copyright 2020 Google LLC
|
|
534
|
-
*
|
|
535
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
536
|
-
* you may not use this file except in compliance with the License.
|
|
537
|
-
* You may obtain a copy of the License at
|
|
538
|
-
*
|
|
539
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
540
|
-
*
|
|
541
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
542
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
543
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
544
|
-
* See the License for the specific language governing permissions and
|
|
545
|
-
* limitations under the License.
|
|
546
|
-
*/function Kl(t,e){tr(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
|
|
547
|
-
* @license
|
|
548
|
-
* Copyright 2020 Google LLC
|
|
549
|
-
*
|
|
550
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
551
|
-
* you may not use this file except in compliance with the License.
|
|
552
|
-
* You may obtain a copy of the License at
|
|
553
|
-
*
|
|
554
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
555
|
-
*
|
|
556
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
557
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
558
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
559
|
-
* See the License for the specific language governing permissions and
|
|
560
|
-
* limitations under the License.
|
|
561
|
-
*/class Rh{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Kn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Kn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Kn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
562
|
-
* @license
|
|
563
|
-
* Copyright 2020 Google LLC
|
|
564
|
-
*
|
|
565
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
566
|
-
* you may not use this file except in compliance with the License.
|
|
567
|
-
* You may obtain a copy of the License at
|
|
568
|
-
*
|
|
569
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
570
|
-
*
|
|
571
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
572
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
573
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
574
|
-
* See the License for the specific language governing permissions and
|
|
575
|
-
* limitations under the License.
|
|
576
|
-
*/const _1={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
|
|
577
|
-
* @license
|
|
578
|
-
* Copyright 2020 Google LLC
|
|
579
|
-
*
|
|
580
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
581
|
-
* you may not use this file except in compliance with the License.
|
|
582
|
-
* You may obtain a copy of the License at
|
|
583
|
-
*
|
|
584
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
585
|
-
*
|
|
586
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
587
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
588
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
589
|
-
* See the License for the specific language governing permissions and
|
|
590
|
-
* limitations under the License.
|
|
591
|
-
*/const w1=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],T1=new Ns(3e4,6e4);function zl(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function $o(t,e,n,r,o={}){return xh(t,o,async()=>{let i={},s={};r&&(e==="GET"?s=r:i={body:JSON.stringify(r)});const a=Os({key:t.config.apiKey,...s}).slice(1),l=await t._getAdditionalHeaders();l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode);const d={method:e,headers:l,...i};return WI()||(d.referrerPolicy="no-referrer"),t.emulatorConfig&&Fi(t.emulatorConfig.host)&&(d.credentials="include"),Rh.fetch()(await Ph(t,t.config.apiHost,n,a),d)})}async function xh(t,e,n){t._canInitEmulator=!1;const r={..._1,...e};try{const o=new k1(t),i=await Promise.race([n(),o.promise]);o.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw $s(t,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const a=i.ok?s.errorMessage:s.error.message,[l,d]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw $s(t,"credential-already-in-use",s);if(l==="EMAIL_EXISTS")throw $s(t,"email-already-in-use",s);if(l==="USER_DISABLED")throw $s(t,"user-disabled",s);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw ql(t,u,d);Ln(t,u)}}catch(o){if(o instanceof xr)throw o;Ln(t,"network-request-failed",{message:String(o)})}}async function S1(t,e,n,r,o={}){const i=await $o(t,e,n,r,o);return"mfaPendingCredential"in i&&Ln(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function Ph(t,e,n,r){const o=`${e}${n}?${r}`,i=t,s=i.config.emulator?Kl(t.config,o):`${t.config.apiScheme}://${o}`;return w1.includes(n)&&(await i._persistenceManagerAvailable,i._getPersistenceType()==="COOKIE")?i._getPersistence()._getFinalTarget(s).toString():s}class k1{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(hn(this.auth,"network-request-failed")),T1.get())})}}function $s(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const o=hn(t,e,r);return o.customData._tokenResponse=n,o}/**
|
|
592
|
-
* @license
|
|
593
|
-
* Copyright 2020 Google LLC
|
|
594
|
-
*
|
|
595
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
596
|
-
* you may not use this file except in compliance with the License.
|
|
597
|
-
* You may obtain a copy of the License at
|
|
598
|
-
*
|
|
599
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
600
|
-
*
|
|
601
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
602
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
603
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
604
|
-
* See the License for the specific language governing permissions and
|
|
605
|
-
* limitations under the License.
|
|
606
|
-
*/async function I1(t,e){return $o(t,"POST","/v1/accounts:delete",e)}async function wi(t,e){return $o(t,"POST","/v1/accounts:lookup",e)}/**
|
|
607
|
-
* @license
|
|
608
|
-
* Copyright 2020 Google LLC
|
|
609
|
-
*
|
|
610
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
611
|
-
* you may not use this file except in compliance with the License.
|
|
612
|
-
* You may obtain a copy of the License at
|
|
613
|
-
*
|
|
614
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
615
|
-
*
|
|
616
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
617
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
618
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
619
|
-
* See the License for the specific language governing permissions and
|
|
620
|
-
* limitations under the License.
|
|
621
|
-
*/function us(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function E1(t,e=!1){const n=Ho(t),r=await n.getIdToken(e),o=Jl(r);Le(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");const i=typeof o.firebase=="object"?o.firebase:void 0,s=i==null?void 0:i.sign_in_provider;return{claims:o,token:r,authTime:us(wa(o.auth_time)),issuedAtTime:us(wa(o.iat)),expirationTime:us(wa(o.exp)),signInProvider:s||null,signInSecondFactor:(i==null?void 0:i.sign_in_second_factor)||null}}function wa(t){return Number(t)*1e3}function Jl(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return ei("JWT malformed, contained fewer than 3 sections"),null;try{const o=gh(n);return o?JSON.parse(o):(ei("Failed to decode base64 JWT payload"),null)}catch(o){return ei("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function Ku(t){const e=Jl(t);return Le(e,"internal-error"),Le(typeof e.exp<"u","internal-error"),Le(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
|
|
622
|
-
* @license
|
|
623
|
-
* Copyright 2020 Google LLC
|
|
624
|
-
*
|
|
625
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
626
|
-
* you may not use this file except in compliance with the License.
|
|
627
|
-
* You may obtain a copy of the License at
|
|
628
|
-
*
|
|
629
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
630
|
-
*
|
|
631
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
632
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
633
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
634
|
-
* See the License for the specific language governing permissions and
|
|
635
|
-
* limitations under the License.
|
|
636
|
-
*/async function ws(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof xr&&C1(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function C1({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
|
|
637
|
-
* @license
|
|
638
|
-
* Copyright 2020 Google LLC
|
|
639
|
-
*
|
|
640
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
641
|
-
* you may not use this file except in compliance with the License.
|
|
642
|
-
* You may obtain a copy of the License at
|
|
643
|
-
*
|
|
644
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
645
|
-
*
|
|
646
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
647
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
648
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
649
|
-
* See the License for the specific language governing permissions and
|
|
650
|
-
* limitations under the License.
|
|
651
|
-
*/class A1{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
|
|
652
|
-
* @license
|
|
653
|
-
* Copyright 2020 Google LLC
|
|
654
|
-
*
|
|
655
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
656
|
-
* you may not use this file except in compliance with the License.
|
|
657
|
-
* You may obtain a copy of the License at
|
|
658
|
-
*
|
|
659
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
660
|
-
*
|
|
661
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
662
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
663
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
664
|
-
* See the License for the specific language governing permissions and
|
|
665
|
-
* limitations under the License.
|
|
666
|
-
*/class ul{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=us(this.lastLoginAt),this.creationTime=us(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
667
|
-
* @license
|
|
668
|
-
* Copyright 2019 Google LLC
|
|
669
|
-
*
|
|
670
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
671
|
-
* you may not use this file except in compliance with the License.
|
|
672
|
-
* You may obtain a copy of the License at
|
|
673
|
-
*
|
|
674
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
675
|
-
*
|
|
676
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
677
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
678
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
679
|
-
* See the License for the specific language governing permissions and
|
|
680
|
-
* limitations under the License.
|
|
681
|
-
*/async function Ti(t){var c;const e=t.auth,n=await t.getIdToken(),r=await ws(t,wi(e,{idToken:n}));Le(r==null?void 0:r.users.length,e,"internal-error");const o=r.users[0];t._notifyReloadListener(o);const i=(c=o.providerUserInfo)!=null&&c.length?Oh(o.providerUserInfo):[],s=x1(t.providerData,i),a=t.isAnonymous,l=!(t.email&&o.passwordHash)&&!(s!=null&&s.length),d=a?l:!1,u={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new ul(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(t,u)}async function R1(t){const e=Ho(t);await Ti(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function x1(t,e){return[...t.filter(r=>!e.some(o=>o.providerId===r.providerId)),...e]}function Oh(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
|
|
682
|
-
* @license
|
|
683
|
-
* Copyright 2020 Google LLC
|
|
684
|
-
*
|
|
685
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
686
|
-
* you may not use this file except in compliance with the License.
|
|
687
|
-
* You may obtain a copy of the License at
|
|
688
|
-
*
|
|
689
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
690
|
-
*
|
|
691
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
692
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
693
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
694
|
-
* See the License for the specific language governing permissions and
|
|
695
|
-
* limitations under the License.
|
|
696
|
-
*/async function P1(t,e){const n=await xh(t,{},async()=>{const r=Os({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:i}=t.config,s=await Ph(t,o,"/v1/token",`key=${i}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return t.emulatorConfig&&Fi(t.emulatorConfig.host)&&(l.credentials="include"),Rh.fetch()(s,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function O1(t,e){return $o(t,"POST","/v2/accounts:revokeToken",zl(t,e))}/**
|
|
697
|
-
* @license
|
|
698
|
-
* Copyright 2020 Google LLC
|
|
699
|
-
*
|
|
700
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
701
|
-
* you may not use this file except in compliance with the License.
|
|
702
|
-
* You may obtain a copy of the License at
|
|
703
|
-
*
|
|
704
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
705
|
-
*
|
|
706
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
707
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
708
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
709
|
-
* See the License for the specific language governing permissions and
|
|
710
|
-
* limitations under the License.
|
|
711
|
-
*/class Ro{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Le(e.idToken,"internal-error"),Le(typeof e.idToken<"u","internal-error"),Le(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Ku(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){Le(e.length!==0,"internal-error");const n=Ku(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Le(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:o,expiresIn:i}=await P1(e,n);this.updateTokensAndExpiration(r,o,Number(i))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:o,expirationTime:i}=n,s=new Ro;return r&&(Le(typeof r=="string","internal-error",{appName:e}),s.refreshToken=r),o&&(Le(typeof o=="string","internal-error",{appName:e}),s.accessToken=o),i&&(Le(typeof i=="number","internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Ro,this.toJSON())}_performRefresh(){return Kn("not implemented")}}/**
|
|
712
|
-
* @license
|
|
713
|
-
* Copyright 2020 Google LLC
|
|
714
|
-
*
|
|
715
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
716
|
-
* you may not use this file except in compliance with the License.
|
|
717
|
-
* You may obtain a copy of the License at
|
|
718
|
-
*
|
|
719
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
720
|
-
*
|
|
721
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
722
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
723
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
724
|
-
* See the License for the specific language governing permissions and
|
|
725
|
-
* limitations under the License.
|
|
726
|
-
*/function gr(t,e){Le(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class un{constructor({uid:e,auth:n,stsTokenManager:r,...o}){this.providerId="firebase",this.proactiveRefresh=new A1(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new ul(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const n=await ws(this,this.stsTokenManager.getToken(this.auth,e));return Le(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return E1(this,e)}reload(){return R1(this)}_assign(e){this!==e&&(Le(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new un({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){Le(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Ti(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(xn(this.auth.app))return Promise.reject(no(this.auth));const e=await this.getIdToken();return await ws(this,I1(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,o=n.email??void 0,i=n.phoneNumber??void 0,s=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,d=n.createdAt??void 0,u=n.lastLoginAt??void 0,{uid:c,emailVerified:h,isAnonymous:b,providerData:E,stsTokenManager:C}=n;Le(c&&C,e,"internal-error");const W=Ro.fromJSON(this.name,C);Le(typeof c=="string",e,"internal-error"),gr(r,e.name),gr(o,e.name),Le(typeof h=="boolean",e,"internal-error"),Le(typeof b=="boolean",e,"internal-error"),gr(i,e.name),gr(s,e.name),gr(a,e.name),gr(l,e.name),gr(d,e.name),gr(u,e.name);const L=new un({uid:c,auth:e,email:o,emailVerified:h,displayName:r,isAnonymous:b,photoURL:s,phoneNumber:i,tenantId:a,stsTokenManager:W,createdAt:d,lastLoginAt:u});return E&&Array.isArray(E)&&(L.providerData=E.map(M=>({...M}))),l&&(L._redirectEventId=l),L}static async _fromIdTokenResponse(e,n,r=!1){const o=new Ro;o.updateFromServerResponse(n);const i=new un({uid:n.localId,auth:e,stsTokenManager:o,isAnonymous:r});return await Ti(i),i}static async _fromGetAccountInfoResponse(e,n,r){const o=n.users[0];Le(o.localId!==void 0,"internal-error");const i=o.providerUserInfo!==void 0?Oh(o.providerUserInfo):[],s=!(o.email&&o.passwordHash)&&!(i!=null&&i.length),a=new Ro;a.updateFromIdToken(r);const l=new un({uid:o.localId,auth:e,stsTokenManager:a,isAnonymous:s}),d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:i,metadata:new ul(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(i!=null&&i.length)};return Object.assign(l,d),l}}/**
|
|
727
|
-
* @license
|
|
728
|
-
* Copyright 2020 Google LLC
|
|
729
|
-
*
|
|
730
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
731
|
-
* you may not use this file except in compliance with the License.
|
|
732
|
-
* You may obtain a copy of the License at
|
|
733
|
-
*
|
|
734
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
735
|
-
*
|
|
736
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
737
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
738
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
739
|
-
* See the License for the specific language governing permissions and
|
|
740
|
-
* limitations under the License.
|
|
741
|
-
*/const zu=new Map;function zn(t){tr(t instanceof Function,"Expected a class definition");let e=zu.get(t);return e?(tr(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,zu.set(t,e),e)}/**
|
|
742
|
-
* @license
|
|
743
|
-
* Copyright 2019 Google LLC
|
|
744
|
-
*
|
|
745
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
746
|
-
* you may not use this file except in compliance with the License.
|
|
747
|
-
* You may obtain a copy of the License at
|
|
748
|
-
*
|
|
749
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
750
|
-
*
|
|
751
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
752
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
753
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
754
|
-
* See the License for the specific language governing permissions and
|
|
755
|
-
* limitations under the License.
|
|
756
|
-
*/class Mh{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}Mh.type="NONE";const Ju=Mh;/**
|
|
757
|
-
* @license
|
|
758
|
-
* Copyright 2019 Google LLC
|
|
759
|
-
*
|
|
760
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
761
|
-
* you may not use this file except in compliance with the License.
|
|
762
|
-
* You may obtain a copy of the License at
|
|
763
|
-
*
|
|
764
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
765
|
-
*
|
|
766
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
767
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
768
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
769
|
-
* See the License for the specific language governing permissions and
|
|
770
|
-
* limitations under the License.
|
|
771
|
-
*/function ti(t,e,n){return`firebase:${t}:${e}:${n}`}class xo{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:o,name:i}=this.auth;this.fullUserKey=ti(this.userKey,o.apiKey,i),this.fullPersistenceKey=ti("persistence",o.apiKey,i),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await wi(this.auth,{idToken:e}).catch(()=>{});return n?un._fromGetAccountInfoResponse(this.auth,n,e):null}return un._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new xo(zn(Ju),e,r);const o=(await Promise.all(n.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let i=o[0]||zn(Ju);const s=ti(r,e.config.apiKey,e.name);let a=null;for(const d of n)try{const u=await d._get(s);if(u){let c;if(typeof u=="string"){const h=await wi(e,{idToken:u}).catch(()=>{});if(!h)break;c=await un._fromGetAccountInfoResponse(e,h,u)}else c=un._fromJSON(e,u);d!==i&&(a=c),i=d;break}}catch{}const l=o.filter(d=>d._shouldAllowMigration);return!i._shouldAllowMigration||!l.length?new xo(i,e,r):(i=l[0],a&&await i._set(s,a.toJSON()),await Promise.all(n.map(async d=>{if(d!==i)try{await d._remove(s)}catch{}})),new xo(i,e,r))}}/**
|
|
772
|
-
* @license
|
|
773
|
-
* Copyright 2020 Google LLC
|
|
774
|
-
*
|
|
775
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
776
|
-
* you may not use this file except in compliance with the License.
|
|
777
|
-
* You may obtain a copy of the License at
|
|
778
|
-
*
|
|
779
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
780
|
-
*
|
|
781
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
782
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
783
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
784
|
-
* See the License for the specific language governing permissions and
|
|
785
|
-
* limitations under the License.
|
|
786
|
-
*/function Yu(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(jh(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Nh(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Fh(e))return"Blackberry";if(Bh(e))return"Webos";if(Dh(e))return"Safari";if((e.includes("chrome/")||Lh(e))&&!e.includes("edge/"))return"Chrome";if(Uh(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Nh(t=Kt()){return/firefox\//i.test(t)}function Dh(t=Kt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Lh(t=Kt()){return/crios\//i.test(t)}function jh(t=Kt()){return/iemobile/i.test(t)}function Uh(t=Kt()){return/android/i.test(t)}function Fh(t=Kt()){return/blackberry/i.test(t)}function Bh(t=Kt()){return/webos/i.test(t)}function Yl(t=Kt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function M1(t=Kt()){var e;return Yl(t)&&!!((e=window.navigator)!=null&&e.standalone)}function N1(){return KI()&&document.documentMode===10}function Hh(t=Kt()){return Yl(t)||Uh(t)||Bh(t)||Fh(t)||/windows phone/i.test(t)||jh(t)}/**
|
|
787
|
-
* @license
|
|
788
|
-
* Copyright 2020 Google LLC
|
|
789
|
-
*
|
|
790
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
791
|
-
* you may not use this file except in compliance with the License.
|
|
792
|
-
* You may obtain a copy of the License at
|
|
793
|
-
*
|
|
794
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
795
|
-
*
|
|
796
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
797
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
798
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
799
|
-
* See the License for the specific language governing permissions and
|
|
800
|
-
* limitations under the License.
|
|
801
|
-
*/function $h(t,e=[]){let n;switch(t){case"Browser":n=Yu(Kt());break;case"Worker":n=`${Yu(Kt())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ms}/${r}`}/**
|
|
802
|
-
* @license
|
|
803
|
-
* Copyright 2022 Google LLC
|
|
804
|
-
*
|
|
805
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
806
|
-
* you may not use this file except in compliance with the License.
|
|
807
|
-
* You may obtain a copy of the License at
|
|
808
|
-
*
|
|
809
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
810
|
-
*
|
|
811
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
812
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
813
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
814
|
-
* See the License for the specific language governing permissions and
|
|
815
|
-
* limitations under the License.
|
|
816
|
-
*/class D1{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=i=>new Promise((s,a)=>{try{const l=e(i);s(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const o of n)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
|
|
817
|
-
* @license
|
|
818
|
-
* Copyright 2023 Google LLC
|
|
819
|
-
*
|
|
820
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
821
|
-
* you may not use this file except in compliance with the License.
|
|
822
|
-
* You may obtain a copy of the License at
|
|
823
|
-
*
|
|
824
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
825
|
-
*
|
|
826
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
827
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
828
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
829
|
-
* See the License for the specific language governing permissions and
|
|
830
|
-
* limitations under the License.
|
|
831
|
-
*/async function L1(t,e={}){return $o(t,"GET","/v2/passwordPolicy",zl(t,e))}/**
|
|
832
|
-
* @license
|
|
833
|
-
* Copyright 2023 Google LLC
|
|
834
|
-
*
|
|
835
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
836
|
-
* you may not use this file except in compliance with the License.
|
|
837
|
-
* You may obtain a copy of the License at
|
|
838
|
-
*
|
|
839
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
840
|
-
*
|
|
841
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
842
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
843
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
844
|
-
* See the License for the specific language governing permissions and
|
|
845
|
-
* limitations under the License.
|
|
846
|
-
*/const j1=6;class U1{constructor(e){var r;const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??j1,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),o&&(n.meetsMaxPasswordLength=e.length<=o)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let o=0;o<e.length;o++)r=e.charAt(o),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,o,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}/**
|
|
847
|
-
* @license
|
|
848
|
-
* Copyright 2020 Google LLC
|
|
849
|
-
*
|
|
850
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
851
|
-
* you may not use this file except in compliance with the License.
|
|
852
|
-
* You may obtain a copy of the License at
|
|
853
|
-
*
|
|
854
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
855
|
-
*
|
|
856
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
857
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
858
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
859
|
-
* See the License for the specific language governing permissions and
|
|
860
|
-
* limitations under the License.
|
|
861
|
-
*/class F1{constructor(e,n,r,o){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Qu(this),this.idTokenSubscription=new Qu(this),this.beforeStateQueue=new D1(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Ah,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(i=>this._resolvePersistenceManagerAvailable=i)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=zn(n)),this._initializationPromise=this.queue(async()=>{var r,o,i;if(!this._deleted&&(this.persistenceManager=await xo.create(this,e),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)==null?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await wi(this,{idToken:e}),r=await un._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var i;if(xn(this.app)){const s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const s=(i=this.redirectUser)==null?void 0:i._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(e);(!s||s===a)&&(l!=null&&l.user)&&(r=l.user,o=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Le(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Ti(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=b1()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(xn(this.app))return Promise.reject(no(this));const n=e?Ho(e):null;return n&&Le(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Le(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return xn(this.app)?Promise.reject(no(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return xn(this.app)?Promise.reject(no(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(zn(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await L1(this),n=new U1(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Ps("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await O1(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&zn(e)||this._popupRedirectResolver;Le(n,this,"argument-error"),this.redirectPersistenceManager=await xo.create(this,[zn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,o){if(this._deleted)return()=>{};const i=typeof n=="function"?n:n.next.bind(n);let s=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Le(a,this,"internal-error"),a.then(()=>{s||i(this.currentUser)}),typeof n=="function"){const l=e.addObserver(n,r,o);return()=>{s=!0,l()}}else{const l=e.addObserver(n);return()=>{s=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Le(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=$h(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var n;if(xn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return e!=null&&e.error&&m1(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function Bi(t){return Ho(t)}class Qu{constructor(e){this.auth=e,this.observer=null,this.addObserver=e0(n=>this.observer=n)}get next(){return Le(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
862
|
-
* @license
|
|
863
|
-
* Copyright 2020 Google LLC
|
|
864
|
-
*
|
|
865
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
866
|
-
* you may not use this file except in compliance with the License.
|
|
867
|
-
* You may obtain a copy of the License at
|
|
868
|
-
*
|
|
869
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
870
|
-
*
|
|
871
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
872
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
873
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
874
|
-
* See the License for the specific language governing permissions and
|
|
875
|
-
* limitations under the License.
|
|
876
|
-
*/let Ql={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function B1(t){Ql=t}function H1(t){return Ql.loadJS(t)}function $1(){return Ql.gapiScript}function V1(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/**
|
|
877
|
-
* @license
|
|
878
|
-
* Copyright 2020 Google LLC
|
|
879
|
-
*
|
|
880
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
881
|
-
* you may not use this file except in compliance with the License.
|
|
882
|
-
* You may obtain a copy of the License at
|
|
883
|
-
*
|
|
884
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
885
|
-
*
|
|
886
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
887
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
888
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
889
|
-
* See the License for the specific language governing permissions and
|
|
890
|
-
* limitations under the License.
|
|
891
|
-
*/function W1(t,e){const n=Th(t,"auth");if(n.isInitialized()){const o=n.getImmediate(),i=n.getOptions();if(Do(i,e??{}))return o;Ln(o,"already-initialized")}return n.initialize({options:e})}function q1(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(zn);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function G1(t,e,n){const r=Bi(t);Le(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const o=!1,i=Vh(e),{host:s,port:a}=K1(e),l=a===null?"":`:${a}`,d={url:`${i}//${s}${l}/`},u=Object.freeze({host:s,port:a,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!r._canInitEmulator){Le(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Le(Do(d,r.config.emulator)&&Do(u,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=u,r.settings.appVerificationDisabledForTesting=!0,Fi(s)?(FI(`${i}//${s}${l}`),$I("Auth",!0)):z1()}function Vh(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function K1(t){const e=Vh(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(r);if(o){const i=o[1];return{host:i,port:Xu(r.substr(i.length+1))}}else{const[i,s]=r.split(":");return{host:i,port:Xu(s)}}}function Xu(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function z1(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
|
|
892
|
-
* @license
|
|
893
|
-
* Copyright 2020 Google LLC
|
|
894
|
-
*
|
|
895
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
896
|
-
* you may not use this file except in compliance with the License.
|
|
897
|
-
* You may obtain a copy of the License at
|
|
898
|
-
*
|
|
899
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
900
|
-
*
|
|
901
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
902
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
903
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
904
|
-
* See the License for the specific language governing permissions and
|
|
905
|
-
* limitations under the License.
|
|
906
|
-
*/class Wh{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Kn("not implemented")}_getIdTokenResponse(e){return Kn("not implemented")}_linkToIdToken(e,n){return Kn("not implemented")}_getReauthenticationResolver(e){return Kn("not implemented")}}/**
|
|
907
|
-
* @license
|
|
908
|
-
* Copyright 2020 Google LLC
|
|
909
|
-
*
|
|
910
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
911
|
-
* you may not use this file except in compliance with the License.
|
|
912
|
-
* You may obtain a copy of the License at
|
|
913
|
-
*
|
|
914
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
915
|
-
*
|
|
916
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
917
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
918
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
919
|
-
* See the License for the specific language governing permissions and
|
|
920
|
-
* limitations under the License.
|
|
921
|
-
*/async function Po(t,e){return S1(t,"POST","/v1/accounts:signInWithIdp",zl(t,e))}/**
|
|
922
|
-
* @license
|
|
923
|
-
* Copyright 2020 Google LLC
|
|
924
|
-
*
|
|
925
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
926
|
-
* you may not use this file except in compliance with the License.
|
|
927
|
-
* You may obtain a copy of the License at
|
|
928
|
-
*
|
|
929
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
930
|
-
*
|
|
931
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
932
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
933
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
934
|
-
* See the License for the specific language governing permissions and
|
|
935
|
-
* limitations under the License.
|
|
936
|
-
*/const J1="http://localhost";class ao extends Wh{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new ao(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Ln("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:o,...i}=n;if(!r||!o)return null;const s=new ao(r,o);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){const n=this.buildRequest();return Po(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Po(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Po(e,n)}buildRequest(){const e={requestUri:J1,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Os(n)}return e}}/**
|
|
937
|
-
* @license
|
|
938
|
-
* Copyright 2020 Google LLC
|
|
939
|
-
*
|
|
940
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
941
|
-
* you may not use this file except in compliance with the License.
|
|
942
|
-
* You may obtain a copy of the License at
|
|
943
|
-
*
|
|
944
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
945
|
-
*
|
|
946
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
947
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
948
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
949
|
-
* See the License for the specific language governing permissions and
|
|
950
|
-
* limitations under the License.
|
|
951
|
-
*/class Xl{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
|
|
952
|
-
* @license
|
|
953
|
-
* Copyright 2019 Google LLC
|
|
954
|
-
*
|
|
955
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
956
|
-
* you may not use this file except in compliance with the License.
|
|
957
|
-
* You may obtain a copy of the License at
|
|
958
|
-
*
|
|
959
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
960
|
-
*
|
|
961
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
962
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
963
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
964
|
-
* See the License for the specific language governing permissions and
|
|
965
|
-
* limitations under the License.
|
|
966
|
-
*/class Ds extends Xl{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
|
|
967
|
-
* @license
|
|
968
|
-
* Copyright 2020 Google LLC
|
|
969
|
-
*
|
|
970
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
971
|
-
* you may not use this file except in compliance with the License.
|
|
972
|
-
* You may obtain a copy of the License at
|
|
973
|
-
*
|
|
974
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
975
|
-
*
|
|
976
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
977
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
978
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
979
|
-
* See the License for the specific language governing permissions and
|
|
980
|
-
* limitations under the License.
|
|
981
|
-
*/class wr extends Ds{constructor(){super("facebook.com")}static credential(e){return ao._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return wr.credentialFromTaggedObject(e)}static credentialFromError(e){return wr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return wr.credential(e.oauthAccessToken)}catch{return null}}}wr.FACEBOOK_SIGN_IN_METHOD="facebook.com";wr.PROVIDER_ID="facebook.com";/**
|
|
982
|
-
* @license
|
|
983
|
-
* Copyright 2020 Google LLC
|
|
984
|
-
*
|
|
985
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
986
|
-
* you may not use this file except in compliance with the License.
|
|
987
|
-
* You may obtain a copy of the License at
|
|
988
|
-
*
|
|
989
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
990
|
-
*
|
|
991
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
992
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
993
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
994
|
-
* See the License for the specific language governing permissions and
|
|
995
|
-
* limitations under the License.
|
|
996
|
-
*/class Tr extends Ds{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return ao._fromParams({providerId:Tr.PROVIDER_ID,signInMethod:Tr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Tr.credentialFromTaggedObject(e)}static credentialFromError(e){return Tr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Tr.credential(n,r)}catch{return null}}}Tr.GOOGLE_SIGN_IN_METHOD="google.com";Tr.PROVIDER_ID="google.com";/**
|
|
997
|
-
* @license
|
|
998
|
-
* Copyright 2020 Google LLC
|
|
999
|
-
*
|
|
1000
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1001
|
-
* you may not use this file except in compliance with the License.
|
|
1002
|
-
* You may obtain a copy of the License at
|
|
1003
|
-
*
|
|
1004
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1005
|
-
*
|
|
1006
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1007
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1008
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1009
|
-
* See the License for the specific language governing permissions and
|
|
1010
|
-
* limitations under the License.
|
|
1011
|
-
*/class Pn extends Ds{constructor(){super("github.com")}static credential(e){return ao._fromParams({providerId:Pn.PROVIDER_ID,signInMethod:Pn.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Pn.credentialFromTaggedObject(e)}static credentialFromError(e){return Pn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Pn.credential(e.oauthAccessToken)}catch{return null}}}Pn.GITHUB_SIGN_IN_METHOD="github.com";Pn.PROVIDER_ID="github.com";/**
|
|
1012
|
-
* @license
|
|
1013
|
-
* Copyright 2020 Google LLC
|
|
1014
|
-
*
|
|
1015
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1016
|
-
* you may not use this file except in compliance with the License.
|
|
1017
|
-
* You may obtain a copy of the License at
|
|
1018
|
-
*
|
|
1019
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1020
|
-
*
|
|
1021
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1022
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1023
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1024
|
-
* See the License for the specific language governing permissions and
|
|
1025
|
-
* limitations under the License.
|
|
1026
|
-
*/class Sr extends Ds{constructor(){super("twitter.com")}static credential(e,n){return ao._fromParams({providerId:Sr.PROVIDER_ID,signInMethod:Sr.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Sr.credentialFromTaggedObject(e)}static credentialFromError(e){return Sr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Sr.credential(n,r)}catch{return null}}}Sr.TWITTER_SIGN_IN_METHOD="twitter.com";Sr.PROVIDER_ID="twitter.com";/**
|
|
1027
|
-
* @license
|
|
1028
|
-
* Copyright 2020 Google LLC
|
|
1029
|
-
*
|
|
1030
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1031
|
-
* you may not use this file except in compliance with the License.
|
|
1032
|
-
* You may obtain a copy of the License at
|
|
1033
|
-
*
|
|
1034
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1035
|
-
*
|
|
1036
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1037
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1038
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1039
|
-
* See the License for the specific language governing permissions and
|
|
1040
|
-
* limitations under the License.
|
|
1041
|
-
*/class jo{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,o=!1){const i=await un._fromIdTokenResponse(e,r,o),s=Zu(r);return new jo({user:i,providerId:s,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const o=Zu(r);return new jo({user:e,providerId:o,_tokenResponse:r,operationType:n})}}function Zu(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
|
|
1042
|
-
* @license
|
|
1043
|
-
* Copyright 2020 Google LLC
|
|
1044
|
-
*
|
|
1045
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1046
|
-
* you may not use this file except in compliance with the License.
|
|
1047
|
-
* You may obtain a copy of the License at
|
|
1048
|
-
*
|
|
1049
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1050
|
-
*
|
|
1051
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1052
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1053
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1054
|
-
* See the License for the specific language governing permissions and
|
|
1055
|
-
* limitations under the License.
|
|
1056
|
-
*/class Si extends xr{constructor(e,n,r,o){super(n.code,n.message),this.operationType=r,this.user=o,Object.setPrototypeOf(this,Si.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,o){return new Si(e,n,r,o)}}function qh(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?Si._fromErrorAndOperation(t,i,e,r):i})}async function Y1(t,e,n=!1){const r=await ws(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return jo._forOperation(t,"link",r)}/**
|
|
1057
|
-
* @license
|
|
1058
|
-
* Copyright 2019 Google LLC
|
|
1059
|
-
*
|
|
1060
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1061
|
-
* you may not use this file except in compliance with the License.
|
|
1062
|
-
* You may obtain a copy of the License at
|
|
1063
|
-
*
|
|
1064
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1065
|
-
*
|
|
1066
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1067
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1068
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1069
|
-
* See the License for the specific language governing permissions and
|
|
1070
|
-
* limitations under the License.
|
|
1071
|
-
*/async function Q1(t,e,n=!1){const{auth:r}=t;if(xn(r.app))return Promise.reject(no(r));const o="reauthenticate";try{const i=await ws(t,qh(r,o,e,t),n);Le(i.idToken,r,"internal-error");const s=Jl(i.idToken);Le(s,r,"internal-error");const{sub:a}=s;return Le(t.uid===a,r,"user-mismatch"),jo._forOperation(t,o,i)}catch(i){throw(i==null?void 0:i.code)==="auth/user-not-found"&&Ln(r,"user-mismatch"),i}}/**
|
|
1072
|
-
* @license
|
|
1073
|
-
* Copyright 2020 Google LLC
|
|
1074
|
-
*
|
|
1075
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1076
|
-
* you may not use this file except in compliance with the License.
|
|
1077
|
-
* You may obtain a copy of the License at
|
|
1078
|
-
*
|
|
1079
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1080
|
-
*
|
|
1081
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1082
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1083
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1084
|
-
* See the License for the specific language governing permissions and
|
|
1085
|
-
* limitations under the License.
|
|
1086
|
-
*/async function X1(t,e,n=!1){if(xn(t.app))return Promise.reject(no(t));const r="signIn",o=await qh(t,r,e),i=await jo._fromIdTokenResponse(t,r,o);return n||await t._updateCurrentUser(i.user),i}function Z1(t,e,n,r){return Ho(t).onIdTokenChanged(e,n,r)}function eE(t,e,n){return Ho(t).beforeAuthStateChanged(e,n)}const ki="__sak";/**
|
|
1087
|
-
* @license
|
|
1088
|
-
* Copyright 2019 Google LLC
|
|
1089
|
-
*
|
|
1090
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1091
|
-
* you may not use this file except in compliance with the License.
|
|
1092
|
-
* You may obtain a copy of the License at
|
|
1093
|
-
*
|
|
1094
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1095
|
-
*
|
|
1096
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1097
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1098
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1099
|
-
* See the License for the specific language governing permissions and
|
|
1100
|
-
* limitations under the License.
|
|
1101
|
-
*/class Gh{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(ki,"1"),this.storage.removeItem(ki),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
|
|
1102
|
-
* @license
|
|
1103
|
-
* Copyright 2020 Google LLC
|
|
1104
|
-
*
|
|
1105
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1106
|
-
* you may not use this file except in compliance with the License.
|
|
1107
|
-
* You may obtain a copy of the License at
|
|
1108
|
-
*
|
|
1109
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1110
|
-
*
|
|
1111
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1112
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1113
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1114
|
-
* See the License for the specific language governing permissions and
|
|
1115
|
-
* limitations under the License.
|
|
1116
|
-
*/const tE=1e3,nE=10;class Kh extends Gh{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Hh(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),o=this.localCache[n];r!==o&&e(n,o,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((s,a,l)=>{this.notifyListeners(s,l)});return}const r=e.key;n?this.detachListener():this.stopPolling();const o=()=>{const s=this.storage.getItem(r);!n&&this.localCache[r]===s||this.notifyListeners(r,s)},i=this.storage.getItem(r);N1()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(o,nE):o()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const o of Array.from(r))o(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},tE)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}Kh.type="LOCAL";const rE=Kh;/**
|
|
1117
|
-
* @license
|
|
1118
|
-
* Copyright 2020 Google LLC
|
|
1119
|
-
*
|
|
1120
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1121
|
-
* you may not use this file except in compliance with the License.
|
|
1122
|
-
* You may obtain a copy of the License at
|
|
1123
|
-
*
|
|
1124
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1125
|
-
*
|
|
1126
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1127
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1128
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1129
|
-
* See the License for the specific language governing permissions and
|
|
1130
|
-
* limitations under the License.
|
|
1131
|
-
*/class zh extends Gh{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}zh.type="SESSION";const Jh=zh;/**
|
|
1132
|
-
* @license
|
|
1133
|
-
* Copyright 2019 Google LLC
|
|
1134
|
-
*
|
|
1135
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1136
|
-
* you may not use this file except in compliance with the License.
|
|
1137
|
-
* You may obtain a copy of the License at
|
|
1138
|
-
*
|
|
1139
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1140
|
-
*
|
|
1141
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1142
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1143
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1144
|
-
* See the License for the specific language governing permissions and
|
|
1145
|
-
* limitations under the License.
|
|
1146
|
-
*/function oE(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
|
|
1147
|
-
* @license
|
|
1148
|
-
* Copyright 2019 Google LLC
|
|
1149
|
-
*
|
|
1150
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1151
|
-
* you may not use this file except in compliance with the License.
|
|
1152
|
-
* You may obtain a copy of the License at
|
|
1153
|
-
*
|
|
1154
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1155
|
-
*
|
|
1156
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1157
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1158
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1159
|
-
* See the License for the specific language governing permissions and
|
|
1160
|
-
* limitations under the License.
|
|
1161
|
-
*/class Hi{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(o=>o.isListeningto(e));if(n)return n;const r=new Hi(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:o,data:i}=n.data,s=this.handlersMap[o];if(!(s!=null&&s.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:o});const a=Array.from(s).map(async d=>d(n.origin,i)),l=await oE(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:o,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Hi.receivers=[];/**
|
|
1162
|
-
* @license
|
|
1163
|
-
* Copyright 2020 Google LLC
|
|
1164
|
-
*
|
|
1165
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1166
|
-
* you may not use this file except in compliance with the License.
|
|
1167
|
-
* You may obtain a copy of the License at
|
|
1168
|
-
*
|
|
1169
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1170
|
-
*
|
|
1171
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1172
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1173
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1174
|
-
* See the License for the specific language governing permissions and
|
|
1175
|
-
* limitations under the License.
|
|
1176
|
-
*/function Zl(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}/**
|
|
1177
|
-
* @license
|
|
1178
|
-
* Copyright 2019 Google LLC
|
|
1179
|
-
*
|
|
1180
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1181
|
-
* you may not use this file except in compliance with the License.
|
|
1182
|
-
* You may obtain a copy of the License at
|
|
1183
|
-
*
|
|
1184
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1185
|
-
*
|
|
1186
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1187
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1188
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1189
|
-
* See the License for the specific language governing permissions and
|
|
1190
|
-
* limitations under the License.
|
|
1191
|
-
*/class sE{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let i,s;return new Promise((a,l)=>{const d=Zl("",20);o.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},r);s={messageChannel:o,onMessage(c){const h=c;if(h.data.eventId===d)switch(h.data.status){case"ack":clearTimeout(u),i=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),a(h.data.response);break;default:clearTimeout(u),clearTimeout(i),l(new Error("invalid_response"));break}}},this.handlers.add(s),o.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:d,data:n},[o.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}/**
|
|
1192
|
-
* @license
|
|
1193
|
-
* Copyright 2020 Google LLC
|
|
1194
|
-
*
|
|
1195
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1196
|
-
* you may not use this file except in compliance with the License.
|
|
1197
|
-
* You may obtain a copy of the License at
|
|
1198
|
-
*
|
|
1199
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1200
|
-
*
|
|
1201
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1202
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1203
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1204
|
-
* See the License for the specific language governing permissions and
|
|
1205
|
-
* limitations under the License.
|
|
1206
|
-
*/function Nn(){return window}function iE(t){Nn().location.href=t}/**
|
|
1207
|
-
* @license
|
|
1208
|
-
* Copyright 2020 Google LLC.
|
|
1209
|
-
*
|
|
1210
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1211
|
-
* you may not use this file except in compliance with the License.
|
|
1212
|
-
* You may obtain a copy of the License at
|
|
1213
|
-
*
|
|
1214
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1215
|
-
*
|
|
1216
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1217
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1218
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1219
|
-
* See the License for the specific language governing permissions and
|
|
1220
|
-
* limitations under the License.
|
|
1221
|
-
*/function Yh(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function aE(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function lE(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)==null?void 0:t.controller)||null}function cE(){return Yh()?self:null}/**
|
|
1222
|
-
* @license
|
|
1223
|
-
* Copyright 2019 Google LLC
|
|
1224
|
-
*
|
|
1225
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1226
|
-
* you may not use this file except in compliance with the License.
|
|
1227
|
-
* You may obtain a copy of the License at
|
|
1228
|
-
*
|
|
1229
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1230
|
-
*
|
|
1231
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1232
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1233
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1234
|
-
* See the License for the specific language governing permissions and
|
|
1235
|
-
* limitations under the License.
|
|
1236
|
-
*/const Qh="firebaseLocalStorageDb",uE=1,Ii="firebaseLocalStorage",Xh="fbase_key";class Ls{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function $i(t,e){return t.transaction([Ii],e?"readwrite":"readonly").objectStore(Ii)}function dE(){const t=indexedDB.deleteDatabase(Qh);return new Ls(t).toPromise()}function dl(){const t=indexedDB.open(Qh,uE);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Ii,{keyPath:Xh})}catch(o){n(o)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Ii)?e(r):(r.close(),await dE(),e(await dl()))})})}async function ed(t,e,n){const r=$i(t,!0).put({[Xh]:e,value:n});return new Ls(r).toPromise()}async function fE(t,e){const n=$i(t,!1).get(e),r=await new Ls(n).toPromise();return r===void 0?null:r.value}function td(t,e){const n=$i(t,!0).delete(e);return new Ls(n).toPromise()}const hE=800,pE=3;class Zh{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await dl(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>pE)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Yh()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Hi._getInstance(cE()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await aE(),!this.activeServiceWorker)return;this.sender=new sE(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(n=e[0])!=null&&n.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||lE()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await dl();return await ed(e,ki,"1"),await td(e,ki),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>ed(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>fE(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>td(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(o=>{const i=$i(o,!1).getAll();return new Ls(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:o,value:i}of e)r.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(i)&&(this.notifyListeners(o,i),n.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!r.has(o)&&(this.notifyListeners(o,null),n.push(o));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const o of Array.from(r))o(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),hE)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Zh.type="LOCAL";const mE=Zh;new Ns(3e4,6e4);/**
|
|
1237
|
-
* @license
|
|
1238
|
-
* Copyright 2021 Google LLC
|
|
1239
|
-
*
|
|
1240
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1241
|
-
* you may not use this file except in compliance with the License.
|
|
1242
|
-
* You may obtain a copy of the License at
|
|
1243
|
-
*
|
|
1244
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1245
|
-
*
|
|
1246
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1247
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1248
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1249
|
-
* See the License for the specific language governing permissions and
|
|
1250
|
-
* limitations under the License.
|
|
1251
|
-
*/function ep(t,e){return e?zn(e):(Le(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
|
|
1252
|
-
* @license
|
|
1253
|
-
* Copyright 2019 Google LLC
|
|
1254
|
-
*
|
|
1255
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1256
|
-
* you may not use this file except in compliance with the License.
|
|
1257
|
-
* You may obtain a copy of the License at
|
|
1258
|
-
*
|
|
1259
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1260
|
-
*
|
|
1261
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1262
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1263
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1264
|
-
* See the License for the specific language governing permissions and
|
|
1265
|
-
* limitations under the License.
|
|
1266
|
-
*/class ec extends Wh{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Po(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Po(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Po(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function gE(t){return X1(t.auth,new ec(t),t.bypassAuthState)}function vE(t){const{auth:e,user:n}=t;return Le(n,e,"internal-error"),Q1(n,new ec(t),t.bypassAuthState)}async function yE(t){const{auth:e,user:n}=t;return Le(n,e,"internal-error"),Y1(n,new ec(t),t.bypassAuthState)}/**
|
|
1267
|
-
* @license
|
|
1268
|
-
* Copyright 2020 Google LLC
|
|
1269
|
-
*
|
|
1270
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1271
|
-
* you may not use this file except in compliance with the License.
|
|
1272
|
-
* You may obtain a copy of the License at
|
|
1273
|
-
*
|
|
1274
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1275
|
-
*
|
|
1276
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1277
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1278
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1279
|
-
* See the License for the specific language governing permissions and
|
|
1280
|
-
* limitations under the License.
|
|
1281
|
-
*/class tp{constructor(e,n,r,o,i=!1){this.auth=e,this.resolver=r,this.user=o,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:o,tenantId:i,error:s,type:a}=e;if(s){this.reject(s);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(d){this.reject(d)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return gE;case"linkViaPopup":case"linkViaRedirect":return yE;case"reauthViaPopup":case"reauthViaRedirect":return vE;default:Ln(this.auth,"internal-error")}}resolve(e){tr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){tr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
|
|
1282
|
-
* @license
|
|
1283
|
-
* Copyright 2020 Google LLC
|
|
1284
|
-
*
|
|
1285
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1286
|
-
* you may not use this file except in compliance with the License.
|
|
1287
|
-
* You may obtain a copy of the License at
|
|
1288
|
-
*
|
|
1289
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1290
|
-
*
|
|
1291
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1292
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1293
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1294
|
-
* See the License for the specific language governing permissions and
|
|
1295
|
-
* limitations under the License.
|
|
1296
|
-
*/const bE=new Ns(2e3,1e4);async function _E(t,e,n){if(xn(t.app))return Promise.reject(hn(t,"operation-not-supported-in-this-environment"));const r=Bi(t);g1(t,e,Xl);const o=ep(r,n);return new Yr(r,"signInViaPopup",e,o).executeNotNull()}class Yr extends tp{constructor(e,n,r,o,i){super(e,n,o,i),this.provider=r,this.authWindow=null,this.pollId=null,Yr.currentPopupAction&&Yr.currentPopupAction.cancel(),Yr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Le(e,this.auth,"internal-error"),e}async onExecution(){tr(this.filter.length===1,"Popup operations only handle one event");const e=Zl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(hn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(hn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Yr.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(hn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,bE.get())};e()}}Yr.currentPopupAction=null;/**
|
|
1297
|
-
* @license
|
|
1298
|
-
* Copyright 2020 Google LLC
|
|
1299
|
-
*
|
|
1300
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1301
|
-
* you may not use this file except in compliance with the License.
|
|
1302
|
-
* You may obtain a copy of the License at
|
|
1303
|
-
*
|
|
1304
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1305
|
-
*
|
|
1306
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1307
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1308
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1309
|
-
* See the License for the specific language governing permissions and
|
|
1310
|
-
* limitations under the License.
|
|
1311
|
-
*/const wE="pendingRedirect",ni=new Map;class TE extends tp{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=ni.get(this.auth._key());if(!e){try{const r=await SE(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}ni.set(this.auth._key(),e)}return this.bypassAuthState||ni.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function SE(t,e){const n=EE(e),r=IE(t);if(!await r._isAvailable())return!1;const o=await r._get(n)==="true";return await r._remove(n),o}function kE(t,e){ni.set(t._key(),e)}function IE(t){return zn(t._redirectPersistence)}function EE(t){return ti(wE,t.config.apiKey,t.name)}async function CE(t,e,n=!1){if(xn(t.app))return Promise.reject(no(t));const r=Bi(t),o=ep(r,e),s=await new TE(r,o,n).execute();return s&&!n&&(delete s.user._redirectEventId,await r._persistUserIfCurrent(s.user),await r._setRedirectUser(null,e)),s}/**
|
|
1312
|
-
* @license
|
|
1313
|
-
* Copyright 2020 Google LLC
|
|
1314
|
-
*
|
|
1315
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1316
|
-
* you may not use this file except in compliance with the License.
|
|
1317
|
-
* You may obtain a copy of the License at
|
|
1318
|
-
*
|
|
1319
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1320
|
-
*
|
|
1321
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1322
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1323
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1324
|
-
* See the License for the specific language governing permissions and
|
|
1325
|
-
* limitations under the License.
|
|
1326
|
-
*/const AE=600*1e3;class RE{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!xE(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!np(e)){const o=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(hn(this.auth,o))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=AE&&this.cachedEventUids.clear(),this.cachedEventUids.has(nd(e))}saveEventToCache(e){this.cachedEventUids.add(nd(e)),this.lastProcessedEventTime=Date.now()}}function nd(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function np({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function xE(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return np(t);default:return!1}}/**
|
|
1327
|
-
* @license
|
|
1328
|
-
* Copyright 2020 Google LLC
|
|
1329
|
-
*
|
|
1330
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1331
|
-
* you may not use this file except in compliance with the License.
|
|
1332
|
-
* You may obtain a copy of the License at
|
|
1333
|
-
*
|
|
1334
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1335
|
-
*
|
|
1336
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1337
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1338
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1339
|
-
* See the License for the specific language governing permissions and
|
|
1340
|
-
* limitations under the License.
|
|
1341
|
-
*/async function PE(t,e={}){return $o(t,"GET","/v1/projects",e)}/**
|
|
1342
|
-
* @license
|
|
1343
|
-
* Copyright 2020 Google LLC
|
|
1344
|
-
*
|
|
1345
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1346
|
-
* you may not use this file except in compliance with the License.
|
|
1347
|
-
* You may obtain a copy of the License at
|
|
1348
|
-
*
|
|
1349
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1350
|
-
*
|
|
1351
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1352
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1353
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1354
|
-
* See the License for the specific language governing permissions and
|
|
1355
|
-
* limitations under the License.
|
|
1356
|
-
*/const OE=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ME=/^https?/;async function NE(t){if(t.config.emulator)return;const{authorizedDomains:e}=await PE(t);for(const n of e)try{if(DE(n))return}catch{}Ln(t,"unauthorized-domain")}function DE(t){const e=cl(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const s=new URL(t);return s.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&s.hostname===r}if(!ME.test(n))return!1;if(OE.test(t))return r===t;const o=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(r)}/**
|
|
1357
|
-
* @license
|
|
1358
|
-
* Copyright 2020 Google LLC.
|
|
1359
|
-
*
|
|
1360
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1361
|
-
* you may not use this file except in compliance with the License.
|
|
1362
|
-
* You may obtain a copy of the License at
|
|
1363
|
-
*
|
|
1364
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1365
|
-
*
|
|
1366
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1367
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1368
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1369
|
-
* See the License for the specific language governing permissions and
|
|
1370
|
-
* limitations under the License.
|
|
1371
|
-
*/const LE=new Ns(3e4,6e4);function rd(){const t=Nn().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function jE(t){return new Promise((e,n)=>{var o,i,s;function r(){rd(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{rd(),n(hn(t,"network-request-failed"))},timeout:LE.get()})}if((i=(o=Nn().gapi)==null?void 0:o.iframes)!=null&&i.Iframe)e(gapi.iframes.getContext());else if((s=Nn().gapi)!=null&&s.load)r();else{const a=V1("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(hn(t,"network-request-failed"))},H1(`${$1()}?onload=${a}`).catch(l=>n(l))}}).catch(e=>{throw ri=null,e})}let ri=null;function UE(t){return ri=ri||jE(t),ri}/**
|
|
1372
|
-
* @license
|
|
1373
|
-
* Copyright 2020 Google LLC.
|
|
1374
|
-
*
|
|
1375
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1376
|
-
* you may not use this file except in compliance with the License.
|
|
1377
|
-
* You may obtain a copy of the License at
|
|
1378
|
-
*
|
|
1379
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1380
|
-
*
|
|
1381
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1382
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1383
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1384
|
-
* See the License for the specific language governing permissions and
|
|
1385
|
-
* limitations under the License.
|
|
1386
|
-
*/const FE=new Ns(5e3,15e3),BE="__/auth/iframe",HE="emulator/auth/iframe",$E={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},VE=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function WE(t){const e=t.config;Le(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Kl(e,HE):`https://${t.config.authDomain}/${BE}`,r={apiKey:e.apiKey,appName:t.name,v:Ms},o=VE.get(t.config.apiHost);o&&(r.eid=o);const i=t._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${Os(r).slice(1)}`}async function qE(t){const e=await UE(t),n=Nn().gapi;return Le(n,t,"internal-error"),e.open({where:document.body,url:WE(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:$E,dontclear:!0},r=>new Promise(async(o,i)=>{await r.restyle({setHideOnLeave:!1});const s=hn(t,"network-request-failed"),a=Nn().setTimeout(()=>{i(s)},FE.get());function l(){Nn().clearTimeout(a),o(r)}r.ping(l).then(l,()=>{i(s)})}))}/**
|
|
1387
|
-
* @license
|
|
1388
|
-
* Copyright 2020 Google LLC.
|
|
1389
|
-
*
|
|
1390
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1391
|
-
* you may not use this file except in compliance with the License.
|
|
1392
|
-
* You may obtain a copy of the License at
|
|
1393
|
-
*
|
|
1394
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1395
|
-
*
|
|
1396
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1397
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1398
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1399
|
-
* See the License for the specific language governing permissions and
|
|
1400
|
-
* limitations under the License.
|
|
1401
|
-
*/const GE={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},KE=500,zE=600,JE="_blank",YE="http://localhost";class od{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function QE(t,e,n,r=KE,o=zE){const i=Math.max((window.screen.availHeight-o)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...GE,width:r.toString(),height:o.toString(),top:i,left:s},d=Kt().toLowerCase();n&&(a=Lh(d)?JE:n),Nh(d)&&(e=e||YE,l.scrollbars="yes");const u=Object.entries(l).reduce((h,[b,E])=>`${h}${b}=${E},`,"");if(M1(d)&&a!=="_self")return XE(e||"",a),new od(null);const c=window.open(e||"",a,u);Le(c,t,"popup-blocked");try{c.focus()}catch{}return new od(c)}function XE(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
|
|
1402
|
-
* @license
|
|
1403
|
-
* Copyright 2021 Google LLC
|
|
1404
|
-
*
|
|
1405
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1406
|
-
* you may not use this file except in compliance with the License.
|
|
1407
|
-
* You may obtain a copy of the License at
|
|
1408
|
-
*
|
|
1409
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1410
|
-
*
|
|
1411
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1412
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1413
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1414
|
-
* See the License for the specific language governing permissions and
|
|
1415
|
-
* limitations under the License.
|
|
1416
|
-
*/const ZE="__/auth/handler",eC="emulator/auth/handler",tC=encodeURIComponent("fac");async function sd(t,e,n,r,o,i){Le(t.config.authDomain,t,"auth-domain-config-required"),Le(t.config.apiKey,t,"invalid-api-key");const s={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Ms,eventId:o};if(e instanceof Xl){e.setDefaultLanguage(t.languageCode),s.providerId=e.providerId||"",ZI(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,c]of Object.entries({}))s[u]=c}if(e instanceof Ds){const u=e.getScopes().filter(c=>c!=="");u.length>0&&(s.scopes=u.join(","))}t.tenantId&&(s.tid=t.tenantId);const a=s;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await t._getAppCheckToken(),d=l?`#${tC}=${encodeURIComponent(l)}`:"";return`${nC(t)}?${Os(a).slice(1)}${d}`}function nC({config:t}){return t.emulator?Kl(t,eC):`https://${t.authDomain}/${ZE}`}/**
|
|
1417
|
-
* @license
|
|
1418
|
-
* Copyright 2020 Google LLC
|
|
1419
|
-
*
|
|
1420
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1421
|
-
* you may not use this file except in compliance with the License.
|
|
1422
|
-
* You may obtain a copy of the License at
|
|
1423
|
-
*
|
|
1424
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1425
|
-
*
|
|
1426
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1427
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1428
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1429
|
-
* See the License for the specific language governing permissions and
|
|
1430
|
-
* limitations under the License.
|
|
1431
|
-
*/const Ta="webStorageSupport";class rC{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Jh,this._completeRedirectFn=CE,this._overrideRedirectResult=kE}async _openPopup(e,n,r,o){var s;tr((s=this.eventManagers[e._key()])==null?void 0:s.manager,"_initialize() not called before _openPopup()");const i=await sd(e,n,r,cl(),o);return QE(e,i,Zl())}async _openRedirect(e,n,r,o){await this._originValidation(e);const i=await sd(e,n,r,cl(),o);return iE(i),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:o,promise:i}=this.eventManagers[n];return o?Promise.resolve(o):(tr(i,"If manager is not set, promise should be"),i)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await qE(e),r=new RE(e);return n.register("authEvent",o=>(Le(o==null?void 0:o.authEvent,e,"invalid-auth-event"),{status:r.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Ta,{type:Ta},o=>{var s;const i=(s=o==null?void 0:o[0])==null?void 0:s[Ta];i!==void 0&&n(!!i),Ln(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=NE(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return Hh()||Dh()||Yl()}}const oC=rC;var id="@firebase/auth",ad="1.12.1";/**
|
|
1432
|
-
* @license
|
|
1433
|
-
* Copyright 2020 Google LLC
|
|
1434
|
-
*
|
|
1435
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1436
|
-
* you may not use this file except in compliance with the License.
|
|
1437
|
-
* You may obtain a copy of the License at
|
|
1438
|
-
*
|
|
1439
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1440
|
-
*
|
|
1441
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1442
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1443
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1444
|
-
* See the License for the specific language governing permissions and
|
|
1445
|
-
* limitations under the License.
|
|
1446
|
-
*/class sC{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Le(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1447
|
-
* @license
|
|
1448
|
-
* Copyright 2020 Google LLC
|
|
1449
|
-
*
|
|
1450
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1451
|
-
* you may not use this file except in compliance with the License.
|
|
1452
|
-
* You may obtain a copy of the License at
|
|
1453
|
-
*
|
|
1454
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1455
|
-
*
|
|
1456
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1457
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1458
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1459
|
-
* See the License for the specific language governing permissions and
|
|
1460
|
-
* limitations under the License.
|
|
1461
|
-
*/function iC(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function aC(t){bs(new Lo("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),o=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;Le(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:s,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:$h(t)},d=new F1(r,o,i,l);return q1(d,n),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),bs(new Lo("auth-internal",e=>{const n=Bi(e.getProvider("auth").getImmediate());return(r=>new sC(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ao(id,ad,iC(t)),Ao(id,ad,"esm2020")}/**
|
|
1462
|
-
* @license
|
|
1463
|
-
* Copyright 2021 Google LLC
|
|
1464
|
-
*
|
|
1465
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1466
|
-
* you may not use this file except in compliance with the License.
|
|
1467
|
-
* You may obtain a copy of the License at
|
|
1468
|
-
*
|
|
1469
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1470
|
-
*
|
|
1471
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1472
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1473
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1474
|
-
* See the License for the specific language governing permissions and
|
|
1475
|
-
* limitations under the License.
|
|
1476
|
-
*/const lC=300,cC=yh("authIdTokenMaxAge")||lC;let ld=null;const uC=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>cC)return;const o=n==null?void 0:n.token;ld!==o&&(ld=o,await fetch(t,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function dC(t=kh()){const e=Th(t,"auth");if(e.isInitialized())return e.getImmediate();const n=W1(t,{popupRedirectResolver:oC,persistence:[mE,rE,Jh]}),r=yh("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(r,location.origin);if(location.origin===i.origin){const s=uC(i.toString());eE(n,s,()=>s(n.currentUser)),Z1(n,a=>s(a))}}const o=jI("auth");return o&&G1(n,`http://${o}`),n}function fC(){var t;return((t=document.getElementsByTagName("head"))==null?void 0:t[0])??document}B1({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=o=>{const i=hn("internal-error");i.customData=o,n(i)},r.type="text/javascript",r.charset="UTF-8",fC().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});aC("Browser");const hC={},pC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function mC(t,e){return T(),I("svg",pC,[...e[0]||(e[0]=[g("circle",{cx:"11",cy:"11",r:"8"},null,-1),g("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const rp=tt(hC,[["render",mC],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerSearch.vue"]]),gC=jt({__name:"SkillCard",props:{skill:{type:Object,required:!0}},emits:["select"],setup(t,{expose:e}){e();const n=t,r=ce(()=>{const s=n.skill.publishedAt;if(!s)return"";const a=new Date(s),d=Date.now()-s;return d<36e5?`${Math.floor(d/6e4)}m ago`:d<864e5?`${Math.floor(d/36e5)}h ago`:d<2592e6?`${Math.floor(d/864e5)}d ago`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function o(s){const a=s.target;a.style.display="none"}const i={props:n,publishedLabel:r,onAvatarError:o};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),vC={class:"skill-card-top"},yC=["src","alt"],bC={key:1,class:"skill-card-avatar-fallback"},_C={class:"skill-card-info"},wC={class:"skill-card-header"},TC={class:"skill-card-name"},SC={key:0,class:"skill-card-badge-disabled"},kC={key:1,class:"skill-card-badge"},IC={class:"skill-card-owner"},EC={key:0,class:"skill-card-desc"},CC={key:1,class:"skill-card-date"};function AC(t,e,n,r,o,i){return T(),I("button",{class:dt(["skill-card",{"is-disabled":n.skill.installed&&n.skill.enabled===!1}]),type:"button",onClick:e[0]||(e[0]=s=>t.$emit("select",n.skill))},[g("div",vC,[n.skill.avatarUrl?(T(),I("img",{key:0,class:"skill-card-avatar",src:n.skill.avatarUrl,alt:n.skill.owner,loading:"lazy",onError:r.onAvatarError},null,40,yC)):(T(),I("div",bC,fe(n.skill.owner.charAt(0)),1)),g("div",_C,[g("div",wC,[g("span",TC,fe(n.skill.displayName||n.skill.name),1),n.skill.installed&&n.skill.enabled===!1?(T(),I("span",SC,"Disabled")):n.skill.installed?(T(),I("span",kC,"Installed")):ie("v-if",!0)]),g("span",IC,fe(n.skill.owner),1)])]),n.skill.description?(T(),I("p",EC,fe(n.skill.description),1)):ie("v-if",!0),r.publishedLabel?(T(),I("span",CC,fe(r.publishedLabel),1)):ie("v-if",!0)],2)}const RC=tt(gC,[["render",AC],["__scopeId","data-v-d39739c5"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/SkillCard.vue"]]),xC=jt({__name:"SkillDetailModal",props:{skill:{type:Object,required:!0},visible:{type:Boolean,required:!0},isInstalling:{type:Boolean,required:!1},isUninstalling:{type:Boolean,required:!1}},emits:["close","install","uninstall","toggle-enabled"],setup(t,{expose:e,emit:n}){e();const r=t,o=n,i=D(null),s=D(""),a=D(!1),l=ce(()=>i.value??r.skill.enabled??!0),d=ce(()=>r.isInstalling===!0||r.isUninstalling===!0),u=ce(()=>{const L=s.value;if(!L)return"";const M=L.replace(/^---[\s\S]*?---\s*/,"");return c(M)});function c(L){return L.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function h(){if(!(!r.skill.owner||!r.skill.name)){a.value=!0,s.value="";try{const L=new URLSearchParams({owner:r.skill.owner,name:r.skill.name}),M=await fetch(`/codex-api/skills-hub/readme?${L}`);if(!M.ok)return;const H=await M.json();s.value=H.content??""}catch{}finally{a.value=!1}}}yt(()=>r.visible,L=>{L&&(i.value=null,s.value="",h())});function b(){o("install",r.skill)}function E(){o("uninstall",r.skill)}function C(){const L=!l.value;i.value=L,o("toggle-enabled",r.skill,L)}const W={props:r,emit:o,localEnabled:i,readmeContent:s,isLoadingReadme:a,effectiveEnabled:l,isActing:d,renderedReadme:u,simpleMarkdown:c,fetchReadme:h,onInstall:b,onUninstall:E,onToggleEnabled:C,IconTablerX:Bl};return Object.defineProperty(W,"__isScriptSetup",{enumerable:!1,value:!0}),W}}),PC={class:"sdm-panel"},OC={class:"sdm-header"},MC={class:"sdm-title-area"},NC=["src","alt"],DC={class:"sdm-title-col"},LC={class:"sdm-title-row"},jC={class:"sdm-title"},UC={key:0,class:"sdm-badge-disabled"},FC={class:"sdm-owner"},BC={class:"sdm-body"},HC={key:0,class:"sdm-desc"},$C={key:1,class:"sdm-readme-loading"},VC=["innerHTML"],WC=["href"],qC={class:"sdm-footer"},GC={class:"sdm-footer-actions"},KC=["disabled"],zC=["disabled"],JC=["disabled"];function YC(t,e,n,r,o,i){return T(),vt(di,{to:"body"},[n.visible?(T(),I("div",{key:0,class:"sdm-overlay",onClick:e[1]||(e[1]=Je(s=>t.$emit("close"),["self"]))},[g("div",PC,[g("div",OC,[g("div",MC,[n.skill.avatarUrl?(T(),I("img",{key:0,class:"sdm-avatar",src:n.skill.avatarUrl,alt:n.skill.owner,loading:"lazy"},null,8,NC)):ie("v-if",!0),g("div",DC,[g("div",LC,[g("h3",jC,fe(n.skill.displayName||n.skill.name),1),n.skill.installed&&!r.effectiveEnabled?(T(),I("span",UC,"Disabled")):ie("v-if",!0)]),g("span",FC,fe(n.skill.owner),1)])]),g("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:e[0]||(e[0]=s=>t.$emit("close"))},[Ce(r.IconTablerX,{class:"sdm-close-icon"})])]),g("div",BC,[n.skill.description?(T(),I("p",HC,fe(n.skill.description),1)):ie("v-if",!0),r.isLoadingReadme?(T(),I("div",$C,"Loading skill contents...")):r.readmeContent?(T(),I("div",{key:2,class:"sdm-readme",innerHTML:r.renderedReadme},null,8,VC)):ie("v-if",!0),g("a",{class:"sdm-link",href:n.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,WC)]),g("div",qC,[g("div",GC,[n.skill.installed?(T(),I("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:r.isActing,onClick:r.onUninstall},fe(r.props.isUninstalling?"Uninstalling...":"Uninstall"),9,KC)):(T(),I("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:r.isActing,onClick:r.onInstall},fe(r.props.isInstalling?"Installing...":"Install"),9,zC)),n.skill.installed?(T(),I("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:r.isActing,onClick:r.onToggleEnabled},fe(r.effectiveEnabled?"Disable":"Enable"),9,JC)):ie("v-if",!0)])])])])):ie("v-if",!0)])}const QC=tt(xC,[["render",YC],["__scopeId","data-v-b5b72316"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/SkillDetailModal.vue"]]),Xo="codex-web-local.skills-hub.cache.v1",XC=jt({__name:"SkillsHub",emits:["skills-changed"],setup(t,{expose:e,emit:n}){e();const r={name:"",owner:"",description:"",url:"",installed:!1},o=D(null),i=D(""),s=D("date"),a=D([]),l=D([]),d=D(0),u=D(!1),c=D(""),h=D(!0),b=D(!1),E=D(r),C=D(null),W=D(""),L=D(!1),M=D(!1),H=D(null),X=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}});let U=null,Q=null;const re=n,me=ce(()=>s.value==="date"?"Newest":"A-Z"),z=ce(()=>{var y;return((y=C.value)==null?void 0:y.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),te=ce(()=>`${E.value.owner}/${E.value.name}`),Ae=ce(()=>L.value&&W.value===te.value),q=ce(()=>M.value&&W.value===te.value),ye=ce(()=>{const y=i.value.toLowerCase().trim();return y?l.value.filter(A=>A.name.toLowerCase().includes(y)||A.owner.toLowerCase().includes(y)||(A.displayName??"").toLowerCase().includes(y)):l.value});function Re(y,A="success"){C.value={text:y,type:A},Q&&clearTimeout(Q),Q=setTimeout(()=>{C.value=null},3e3)}function Ue(){s.value=s.value==="date"?"name":"date",ze(i.value)}function Ve(y){return`${s.value}::${y.trim().toLowerCase()}`}function ae(y){var A;if(typeof window>"u")return null;try{const R=window.localStorage.getItem(Xo);return R?((A=JSON.parse(R).byKey)==null?void 0:A[y])??null:null}catch{return null}}function ke(y,A){if(!(typeof window>"u"))try{const R=window.localStorage.getItem(Xo),$=(R?JSON.parse(R):{}).byKey??{};$[y]=A,window.localStorage.setItem(Xo,JSON.stringify({byKey:$}))}catch{}}function it(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Xo)}catch{}}function Xe(y){const A=y.installed??[];l.value=A;const R=new Set(A.map(P=>P.name));a.value=y.data.map(P=>{if(P.installed||R.has(P.name)){const $=A.find(V=>V.name===P.name);return{...P,installed:!0,path:($==null?void 0:$.path)??P.path,enabled:($==null?void 0:$.enabled)??P.enabled}}return P}).filter(P=>!P.installed),d.value=y.total}async function ze(y){const A=Ve(y),R=ae(A);R&&Xe(R),u.value=!R,c.value="";try{const P=new URLSearchParams;y.trim()&&P.set("q",y.trim()),P.set("limit","100"),P.set("sort",s.value);const $=await fetch(`/codex-api/skills-hub?${P}`);if(!$.ok)throw new Error(`HTTP ${$.status}`);const V=await $.json();Xe(V),ke(A,V)}catch(P){c.value=P instanceof Error?P.message:"Failed to load skills"}finally{u.value=!1}}function at(){U&&clearTimeout(U),U=setTimeout(()=>ze(i.value),300)}function Fe(y){E.value=y,b.value=!0}async function ft(y){W.value=`${y.owner}/${y.name}`,L.value=!0;try{const R=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:y.owner,name:y.name})})).json();if(!R.ok)throw new Error(R.error||"Install failed");const P={...y,installed:!0,path:R.path,enabled:!0};l.value=[...l.value,P],a.value=a.value.filter($=>$.name!==y.name),E.value=P,Re(`${y.displayName||y.name} skill installed`),b.value=!1,it(),re("skills-changed")}catch(A){Re(A instanceof Error?A.message:"Failed to install skill","error")}finally{L.value=!1}}async function ht(y){W.value=`${y.owner}/${y.name}`,M.value=!0;try{const R=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y.name,path:y.path})})).json();if(!R.ok)throw new Error(R.error||"Uninstall failed");l.value=l.value.filter(P=>P.name!==y.name),y.owner!=="local"&&(a.value=[...a.value,{...y,installed:!1,path:void 0,enabled:void 0}]),Re(`${y.displayName||y.name} skill uninstalled`),b.value=!1,it(),re("skills-changed")}catch(A){Re(A instanceof Error?A.message:"Failed to uninstall skill","error")}finally{M.value=!1}}async function nt(y,A){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:y.path,enabled:A}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),Re(`${y.displayName||y.name} skill ${A?"enabled":"disabled"}`),await ze(i.value)}catch(R){Re(R instanceof Error?R.message:"Failed to update skill","error")}}async function x(){try{const y=await fetch("/codex-api/skills-sync/status");if(!y.ok)return;const A=await y.json();A.data&&(X.value=A.data)}catch{}}async function oe(){try{const y=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),A=await y.json();if(!y.ok||!A.data)throw new Error("Failed to start GitHub login");H.value=A.data;const R=30,P=Math.max((A.data.interval??5)*1e3,3e3);let $=!1;for(let V=0;V<R;V++){await new Promise(pe=>setTimeout(pe,P));const J=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:A.data.device_code})}),B=await J.json();if(!J.ok)throw new Error(B.error||"Failed to complete GitHub login");if(B.ok){$=!0;break}if(!B.pending)throw new Error(B.error||"Failed to complete GitHub login")}if(!$)throw new Error("GitHub login timed out. Please retry.");H.value=null,await x(),Re("GitHub login successful")}catch(y){Re(y instanceof Error?y.message:"Failed GitHub login","error")}}const Y={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};async function ue(){try{const y=t1().length>0?kh():Sh(Y),A=dC(y),R=new Pn;R.addScope("repo");const P=await _E(A,R),$=Pn.credentialFromResult(P),V=($==null?void 0:$.accessToken)??"";if(!V)throw new Error("GitHub access token missing from Firebase login");const J=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:V})}),B=await J.json();if(!J.ok||!B.ok)throw new Error(B.error||"Failed to login with GitHub token");await x(),Re("GitHub login successful")}catch(y){const A=y instanceof Error?y.message:"Failed Firebase GitHub login";Re(A,"error")}}async function be(){try{const y=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),A=await y.json();if(!y.ok||!A.ok)throw new Error(A.error||"Failed to pull synced skills");await ze(i.value),re("skills-changed"),Re("Pulled skills from private sync repo")}catch(y){Re(y instanceof Error?y.message:"Failed to pull sync","error")}}async function Ge(){try{const y=await fetch("/codex-api/skills-sync/push",{method:"POST"}),A=await y.json();if(!y.ok||!A.ok)throw new Error(A.error||"Failed to push synced skills");Re("Pushed skills to private sync repo")}catch(y){Re(y instanceof Error?y.message:"Failed to push sync","error")}}async function p(){try{const y=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),A=await y.json();if(!y.ok||!A.ok)throw new Error(A.error||"Failed to logout GitHub");await x(),Re("Logged out from GitHub")}catch(y){Re(y instanceof Error?y.message:"Failed to logout GitHub","error")}}Ar(()=>{ze(""),x()});const v={EMPTY_SKILL:r,SKILLS_HUB_CACHE_KEY:Xo,searchRef:o,query:i,sortMode:s,browseSkills:a,installedSkills:l,totalCount:d,isLoading:u,error:c,isInstalledOpen:h,isDetailOpen:b,detailSkill:E,toast:C,actionSkillKey:W,isInstallActionInFlight:L,isUninstallActionInFlight:M,deviceLogin:H,syncStatus:X,get debounceTimer(){return U},set debounceTimer(y){U=y},get toastTimer(){return Q},set toastTimer(y){Q=y},emit:re,sortLabel:me,toastClass:z,currentDetailSkillKey:te,isDetailInstalling:Ae,isDetailUninstalling:q,filteredInstalled:ye,showToast:Re,toggleSort:Ue,cacheKey:Ve,readCache:ae,writeCache:ke,clearCache:it,applySkillsPayload:Xe,fetchSkills:ze,onSearchInput:at,openDetail:Fe,handleInstall:ft,handleUninstall:ht,handleToggleEnabled:nt,loadSyncStatus:x,startGithubLogin:oe,firebaseConfig:Y,startGithubFirebaseLogin:ue,pullSkillsSync:be,pushSkillsSync:Ge,logoutGithub:p,IconTablerSearch:rp,IconTablerChevronRight:lh,SkillCard:RC,SkillDetailModal:QC};return Object.defineProperty(v,"__isScriptSetup",{enumerable:!1,value:!0}),v}}),ZC={class:"skills-hub"},eA={class:"skills-hub-toolbar"},tA={class:"skills-hub-search-wrap"},nA={key:0,class:"skills-hub-count"},rA={class:"skills-sync-panel"},oA={class:"skills-sync-header"},sA={key:0,class:"skills-sync-badge"},iA={key:1,class:"skills-sync-badge"},aA={key:2,class:"skills-sync-badge"},lA={class:"skills-sync-meta"},cA={key:0,class:"skills-sync-error"},uA={key:1,class:"skills-sync-device"},dA=["href"],fA={class:"skills-sync-actions"},hA=["disabled"],pA=["disabled"],mA={key:1,class:"skills-hub-section"},gA={class:"skills-hub-section-title"},vA={key:0,class:"skills-hub-grid"},yA={class:"skills-hub-section"},bA={key:0,class:"skills-hub-loading"},_A={key:1,class:"skills-hub-error"},wA={key:0,class:"skills-hub-grid"},TA={key:1,class:"skills-hub-empty"};function SA(t,e,n,r,o,i){return T(),I("div",ZC,[e[6]||(e[6]=g("div",{class:"skills-hub-header"},[g("h2",{class:"skills-hub-title"},"Skills Hub"),g("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),g("div",eA,[g("div",tA,[Ce(r.IconTablerSearch,{class:"skills-hub-search-icon"}),Xn(g("input",{ref:"searchRef","onUpdate:modelValue":e[0]||(e[0]=s=>r.query=s),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:r.onSearchInput},null,544),[[Zn,r.query]]),r.totalCount>0?(T(),I("span",nA,fe(r.totalCount)+" skills",1)):ie("v-if",!0)]),g("button",{class:"skills-hub-sort",type:"button",onClick:r.toggleSort},fe(r.sortLabel),1)]),g("div",rA,[g("div",oA,[e[3]||(e[3]=g("strong",null,"Skills Sync (GitHub)",-1)),r.syncStatus.configured?(T(),I("span",sA,"Connected: "+fe(r.syncStatus.repoOwner)+"/"+fe(r.syncStatus.repoName),1)):r.syncStatus.loggedIn?(T(),I("span",iA,"Logged in as "+fe(r.syncStatus.githubUsername),1)):(T(),I("span",aA,"Not connected"))]),g("div",lA,[g("span",null,"Startup: "+fe(r.syncStatus.startup.mode),1),g("span",null,"Branch: "+fe(r.syncStatus.startup.branch),1),g("span",null,"Action: "+fe(r.syncStatus.startup.lastAction),1)]),r.syncStatus.startup.lastError?(T(),I("div",cA,fe(r.syncStatus.startup.lastError),1)):ie("v-if",!0),r.deviceLogin?(T(),I("div",uA,[g("span",null,[e[4]||(e[4]=Ka("Open ",-1)),g("a",{href:r.deviceLogin.verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,dA),e[5]||(e[5]=Ka(" and enter code:",-1))]),g("code",null,fe(r.deviceLogin.user_code),1)])):ie("v-if",!0),g("div",fA,[r.syncStatus.loggedIn?ie("v-if",!0):(T(),I("button",{key:0,class:"skills-hub-sort",type:"button",onClick:r.startGithubFirebaseLogin},"Login with GitHub")),r.syncStatus.loggedIn?ie("v-if",!0):(T(),I("button",{key:1,class:"skills-hub-sort",type:"button",onClick:r.startGithubLogin},"Device Login")),r.syncStatus.loggedIn?(T(),I("button",{key:2,class:"skills-hub-sort",type:"button",onClick:r.logoutGithub},"Logout GitHub")):ie("v-if",!0),g("button",{class:"skills-hub-sort",type:"button",onClick:r.pullSkillsSync,disabled:!r.syncStatus.configured},"Pull",8,hA),g("button",{class:"skills-hub-sort",type:"button",onClick:r.pushSkillsSync,disabled:!r.syncStatus.configured},"Push",8,pA)])]),r.toast?(T(),I("div",{key:0,class:dt(["skills-hub-toast",r.toastClass])},fe(r.toast.text),3)):ie("v-if",!0),r.filteredInstalled.length>0?(T(),I("div",mA,[g("button",{class:"skills-hub-section-toggle",type:"button",onClick:e[1]||(e[1]=s=>r.isInstalledOpen=!r.isInstalledOpen)},[g("span",gA,"Installed ("+fe(r.filteredInstalled.length)+")",1),Ce(r.IconTablerChevronRight,{class:dt(["skills-hub-section-chevron",{"is-open":r.isInstalledOpen}])},null,8,["class"])]),r.isInstalledOpen?(T(),I("div",vA,[(T(!0),I(je,null,Tt(r.filteredInstalled,s=>(T(),vt(r.SkillCard,{key:s.name,skill:s,onSelect:a=>r.openDetail(a)},null,8,["skill","onSelect"]))),128))])):ie("v-if",!0)])):ie("v-if",!0),g("div",yA,[r.isLoading?(T(),I("div",bA,"Loading skills...")):r.error?(T(),I("div",_A,fe(r.error),1)):(T(),I(je,{key:2},[r.browseSkills.length>0?(T(),I("div",wA,[(T(!0),I(je,null,Tt(r.browseSkills,s=>(T(),vt(r.SkillCard,{key:s.url,skill:s,onSelect:a=>r.openDetail(a)},null,8,["skill","onSelect"]))),128))])):r.query.trim()?(T(),I("div",TA,'No skills found for "'+fe(r.query)+'"',1)):ie("v-if",!0)],64))]),Ce(r.SkillDetailModal,{skill:r.detailSkill,visible:r.isDetailOpen,"is-installing":r.isDetailInstalling,"is-uninstalling":r.isDetailUninstalling,onClose:e[2]||(e[2]=s=>r.isDetailOpen=!1),onInstall:r.handleInstall,onUninstall:r.handleUninstall,onToggleEnabled:r.handleToggleEnabled},null,8,["skill","visible","is-installing","is-uninstalling"])])}const kA=tt(XC,[["render",SA],["__scopeId","data-v-134f016f"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/content/SkillsHub.vue"]]),IA={},EA={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function CA(t,e){return T(),I("svg",EA,[...e[0]||(e[0]=[g("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),g("path",{d:"M9 4l0 16"},null,-1)])])}const AA=tt(IA,[["render",CA],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerLayoutSidebar.vue"]]),RA={},xA={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function PA(t,e){return T(),I("svg",xA,[...e[0]||(e[0]=[g("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const OA=tt(RA,[["render",PA],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerLayoutSidebarFilled.vue"]]),MA={},NA={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function DA(t,e){return T(),I("svg",NA,[...e[0]||(e[0]=[g("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),g("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const LA=tt(MA,[["render",DA],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerRefresh.vue"]]),jA=jt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean,required:!0},isAutoRefreshEnabled:{type:Boolean,required:!0},autoRefreshButtonLabel:{type:String,required:!0},showNewThreadButton:{type:Boolean,required:!1}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(t,{expose:e}){e();const n={IconTablerFilePencil:Fl,IconTablerLayoutSidebar:AA,IconTablerLayoutSidebarFilled:OA,IconTablerRefresh:LA};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),UA={class:"sidebar-thread-controls"},FA=["aria-label","title"],BA=["aria-pressed","aria-label","title"];function HA(t,e,n,r,o,i){return T(),I("div",UA,[g("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":n.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:n.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:e[0]||(e[0]=s=>t.$emit("toggle-sidebar"))},[n.isSidebarCollapsed?(T(),vt(r.IconTablerLayoutSidebarFilled,{key:0,class:"sidebar-thread-controls-icon"})):(T(),vt(r.IconTablerLayoutSidebar,{key:1,class:"sidebar-thread-controls-icon"}))],8,FA),g("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":n.isAutoRefreshEnabled,"aria-label":n.autoRefreshButtonLabel,title:n.autoRefreshButtonLabel,onClick:e[1]||(e[1]=s=>t.$emit("toggle-auto-refresh"))},[Ce(r.IconTablerRefresh,{class:"sidebar-thread-controls-icon"})],8,BA),Mn(t.$slots,"default",{},void 0),n.showNewThreadButton?(T(),I("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:e[2]||(e[2]=s=>t.$emit("start-new-thread"))},[Ce(r.IconTablerFilePencil,{class:"sidebar-thread-controls-icon"})])):ie("v-if",!0)])}const $A=tt(jA,[["render",HA],["__scopeId","data-v-cbf326a2"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/sidebar/SidebarThreadControls.vue"]]),VA={},WA={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function qA(t,e){return T(),I("svg",WA,[ie(" Icon from Tabler Icons by Paweł Kuna - https://github.com/tabler/tabler-icons/blob/master/LICENSE "),e[0]||(e[0]=g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[g("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),g("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1))])}const GA=tt(VA,[["render",qA],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/components/icons/IconTablerSettings.vue"]]);function _r(t){return t.flatMap(e=>e.threads)}const op="codex-web-local.thread-read-state.v1",sp="codex-web-local.thread-scroll-state.v1",fl="codex-web-local.selected-thread-id.v1",ip="codex-web-local.project-order.v1",ap="codex-web-local.project-display-name.v1",lp="codex-web-local.auto-refresh-enabled.v1",Sa=220,Zo=4e3,cd=["none","minimal","low","medium","high","xhigh"],es="__global__",on="gpt-5.2-codex";function KA(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem(op);if(!t)return{};const e=JSON.parse(t);return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function ud(t){typeof window>"u"||window.localStorage.setItem(op,JSON.stringify(t))}function zA(){return typeof window>"u"?!1:window.localStorage.getItem(lp)==="1"}function dd(t){typeof window>"u"||window.localStorage.setItem(lp,t?"1":"0")}function cp(t,e,n){return Math.min(Math.max(t,e),n)}function JA(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;if(typeof e.scrollTop!="number"||!Number.isFinite(e.scrollTop)||typeof e.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,e.scrollTop),isAtBottom:e.isAtBottom};return typeof e.scrollRatio=="number"&&Number.isFinite(e.scrollRatio)&&(n.scrollRatio=cp(e.scrollRatio,0,1)),n}function YA(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem(sp);if(!t)return{};const e=JSON.parse(t);if(!e||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[r,o]of Object.entries(e)){if(!r)continue;const i=JA(o);i&&(n[r]=i)}return n}catch{return{}}}function fd(t){typeof window>"u"||window.localStorage.setItem(sp,JSON.stringify(t))}function QA(){return typeof window>"u"?"":window.localStorage.getItem(fl)??""}function XA(t){if(!(typeof window>"u")){if(!t){window.localStorage.removeItem(fl);return}window.localStorage.setItem(fl,t)}}function ZA(){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(ip);if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return[];const n=[];for(const r of e)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function _o(t){typeof window>"u"||window.localStorage.setItem(ip,JSON.stringify(t))}function eR(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem(ap);if(!t)return{};const e=JSON.parse(t);if(!e||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[r,o]of Object.entries(e))typeof r=="string"&&r.length>0&&typeof o=="string"&&(n[r]=o);return n}catch{return{}}}function ka(t){typeof window>"u"||window.localStorage.setItem(ap,JSON.stringify(t))}function Vs(t,e){const n=[];for(const r of t)n.includes(r)||n.push(r);for(const r of e)n.includes(r.projectName)||n.push(r.projectName);return Kr(t,n)?t:n}function Ia(t,e){const n=new Map(t.map(o=>[o.projectName,o])),r=e.map(o=>n.get(o)??{projectName:o,threads:[]});for(const o of t)e.includes(o.projectName)||r.push(o);return r}function Kr(t,e){const n=Array.isArray(t)?t:[],r=Array.isArray(e)?e:[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1)if(n[o]!==r[o])return!1;return!0}function tR(t,e,n){if(e<0||e>=t.length||n<0||n>=t.length||e===n)return t;const r=[...t],[o]=r.splice(e,1);return r.splice(n,0,o),r}function nR(t,e){return!t&&!e?!0:!t||!e?!1:t.status===e.status&&t.aggregatedOutput===e.aggregatedOutput&&t.exitCode===e.exitCode}function Ws(t){if(!(t instanceof Error))return!1;const e=t.message.toLowerCase();return e.includes("not supported when using codex with a chatgpt account")||e.includes("model is not supported")}function hl(t,e){return t.id===e.id&&t.role===e.role&&t.text===e.text&&Kr(t.images,e.images)&&t.messageType===e.messageType&&t.rawPayload===e.rawPayload&&t.isUnhandled===e.isUnhandled&&nR(t.commandExecution,e.commandExecution)&&t.turnIndex===e.turnIndex}function Ei(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0}function rR(t,e,n={}){const r=new Map(t.map(u=>[u.id,u])),o=new Map(e.map(u=>[u.id,u])),i=e.map(u=>{const c=r.get(u.id);return c&&hl(c,u)?c:u});if(n.preserveMissing!==!0)return Ei(t,i)?t:i;const s=t.map(u=>{const c=o.get(u.id);return!c||hl(u,c)?u:c}),a=new Set(t.map(u=>u.id)),l=i.filter(u=>!a.has(u.id)),d=[...s,...l];return Ei(t,d)?t:d}function pl(t){return t.replace(/\s+/gu," ").trim()}function oR(t,e){const n=new Set(e.filter(o=>o.role==="assistant").map(o=>pl(o.text)).filter(o=>o.length>0));if(n.size===0)return t;const r=t.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;const i=pl(o.text);return i.length===0?!1:!n.has(i)});return r.length===t.length?t:r}function hd(t,e){const n=t.findIndex(i=>i.id===e.id);if(n<0)return[...t,e];const r=t[n];if(hl(r,e))return t;const o=[...t];return o.splice(n,1,e),o}const up="worked";function vr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:e}function sR(t){if(!Number.isFinite(t)||t<=0)return"<1s";const e=Math.max(1,Math.round(t/1e3)),n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=e%60,i=[];n>0&&i.push(`${n}h`),(r>0||n>0)&&i.push(`${r}m`);const s=o>0||i.length===0?o:0;return i.push(`${s}s`),i.join(" ")}function iR(t,e){return!t&&!e?!0:!t||!e?!1:t.turnId===e.turnId&&t.durationMs===e.durationMs}function aR(t,e){if(!t&&!e)return!0;if(!t||!e||t.label!==e.label||t.details.length!==e.details.length)return!1;for(let n=0;n<t.details.length;n+=1)if(t.details[n]!==e.details[n])return!1;return!0}function lR(t){return{id:`turn-summary:${t.turnId}`,role:"system",text:`Worked for ${sR(t.durationMs)}`,messageType:up}}function cR(t){for(let e=t.length-1;e>=0;e-=1)if(t[e].role==="assistant")return e;return-1}function uR(t,e){const n=lR(e),r=t.filter(s=>s.messageType!==up),o=cR(r);if(o<0)return[...r,n];const i=[...r];return i.splice(o,0,n),i}function Lt(t,e){if(!(e in t))return t;const n={...t};return delete n[e],n}function dR(t,e){return t.id===e.id&&t.title===e.title&&t.projectName===e.projectName&&t.cwd===e.cwd&&t.createdAtIso===e.createdAtIso&&t.updatedAtIso===e.updatedAtIso&&t.preview===e.preview&&t.unread===e.unread&&t.inProgress===e.inProgress}function fR(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0}function hR(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0}function Ut(t,e){const n=Object.entries(t).filter(([r])=>e.has(r));return n.length===Object.keys(t).length?t:Object.fromEntries(n)}function qs(t,e){const n=new Map(t.map(o=>[o.projectName,o])),r=e.map(o=>{const i=n.get(o.projectName),s=new Map((i==null?void 0:i.threads.map(l=>[l.id,l]))??[]),a=o.threads.map(l=>{const d=s.get(l.id);return d&&dR(d,l)?d:l});return i&&i.projectName===o.projectName&&fR(i.threads,a)?i:{projectName:o.projectName,threads:a}});return hR(t,r)?t:r}function pR(t,e,n){const r=new Set(_r(e).map(a=>a.id)),o=_r(t).filter(a=>n[a.id]===!0&&!r.has(a.id));if(o.length===0)return e;const i=new Map(e.map(a=>[a.projectName,a])),s=e.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of o){if(i.get(a.projectName)){const d=s.findIndex(u=>u.projectName===a.projectName);d>=0&&(s[d]={projectName:s[d].projectName,threads:[a,...s[d].threads]});continue}s.push({projectName:a.projectName,threads:[a]})}return s}function mR(t){return t.split("/").filter(Boolean).at(-1)||t||"unknown-project"}function Ea(t){const e=t.replace(/\\/gu,"/");return e.split("/").filter(Boolean).at(-1)||e}function gR(t){const e=t.split(`
|
|
1477
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return e?e.slice(0,80):"Untitled thread"}function vR(){const t=D([]),e=D([]),n=D(QA()),r=D({}),o=D({}),i=D({}),s=D({}),a=D({}),l=D({}),d=D({}),u=D([]),c=D(""),h=D("medium"),b=D(KA()),E=D(YA()),C=D(ZA()),W=D(eR()),L=D({}),M=D({}),H=D({}),X=D({}),U=D({}),Q=D({}),re=D({}),me=D({}),z=D({}),te=D({}),Ae=D([]),q=D(!1),ye=D(!1),Re=D(!1),Ue=D(!1),Ve=D(!1),ae=D(""),ke=D(!1),it=D(!1),Xe=D(zA()),ze=D(Math.floor(Zo/1e3));let at=null,Fe=null,ft=null,ht=null,nt=!1;const x=new Set;let oe=!1,Y=!1;const ue=new Map,be=new Set,Ge=ce(()=>_r(t.value)),p=ce(()=>Ge.value.find(f=>f.id===n.value)??null),v=ce(()=>E.value[n.value]??null),y=ce(()=>{const f=[],m=n.value;return m&&Array.isArray(me.value[m])&&f.push(...me.value[m]),Array.isArray(me.value[es])&&f.push(...me.value[es]),f.sort((_,k)=>_.receivedAtIso.localeCompare(k.receivedAtIso))}),A=ce(()=>{var K;const f=n.value;if(!f)return null;const m=U.value[f],_=(i.value[f]??"").trim(),k=(((K=Q.value[f])==null?void 0:K.message)??"").trim();return!m&&!_&&!k?null:{activityLabel:(m==null?void 0:m.label)||"Thinking",activityDetails:(m==null?void 0:m.details)??[],reasoningText:_,errorText:k}}),R=ce(()=>{const f=n.value;if(!f)return[];const m=r.value[f]??[],_=o.value[f]??[],k=s.value[f]??[],K=[...m,...k,..._],G=X.value[f];return G?uR(K,G):K});function P(f){n.value!==f&&(n.value=f,XA(f),Y=!1)}function $(f){c.value=f.trim()}async function V(){c.value=on,u.value.includes(on)||(u.value=[...u.value,on]);try{await NS(on)}catch{}}function J(f,m){z.value={...z.value,[f]:m}}function B(f){z.value[f]&&(z.value=Lt(z.value,f))}async function pe(f){if(be.has(f))return;const m=z.value[f];if(!(!m||m.fallbackRetried)){be.add(f),J(f,{...m,fallbackRetried:!0});try{await V();try{const _=await Pu(f,1);_e(f,_),De(f,[]),gt(f),s.value[f]&&(s.value=Lt(s.value,f))}catch{}w(f,null),ae.value="",ct(f,null),we(f,{label:"Thinking",details:de(on,m.effort)}),j(f,!0),H.value[f]!==!0&&await ha(f),await pa(f,m.text,m.imageUrls,on,m.effort||void 0,m.skills.length>0?m.skills:void 0,m.fileAttachments),H.value={...H.value,[f]:!0},x.add(f),nt=!0,await jr()}catch(_){const k=_ instanceof Error?_.message:"Unknown application error";w(f,k),ae.value=k,j(f,!1),we(f,null)}finally{be.delete(f)}}}function ee(f){f&&!cd.includes(f)||(h.value=f)}function de(f,m){const _=f.trim()||"default",k=m||"default";return[`Model: ${_}`,`Thinking: ${k}`]}async function Ee(){try{const[f,m]=await Promise.all([DS(),LS()]);u.value=f,c.value.length>0&&f.includes(c.value)||(m.model&&f.includes(m.model)?c.value=m.model:f.length>0?c.value=f[0]:c.value=""),m.reasoningEffort&&cd.includes(m.reasoningEffort)&&(h.value=m.reasoningEffort)}catch{}}function Oe(f){const m=te.value;return Object.keys(m).length===0?f:f.map(_=>({projectName:_.projectName,threads:_.threads.map(k=>{const K=m[k.id];return K?{...k,title:K}:k})}))}function Me(){const m=Oe(e.value).map(_=>({projectName:_.projectName,threads:_.threads.map(k=>{const K=a.value[k.id]===!0,G=n.value===k.id,ge=b.value[k.id],Pe=d.value[k.id]===!0,he=!G&&!K&&(Pe||ge!==k.updatedAtIso);return{...k,inProgress:K,unread:he}})}));t.value=qs(t.value,m)}function Ke(f,m,_){const k=new Date().toISOString(),K=m.trim(),G=mR(K),ge={id:f,title:gR(_),projectName:G,cwd:K,hasWorktree:K.includes("/.codex/worktrees/")||K.includes("/.git/worktrees/"),createdAtIso:k,updatedAtIso:k,preview:_,unread:!1,inProgress:!1},Pe=e.value.findIndex(et=>et.projectName===G);if(Pe>=0){const _t=e.value[Pe].threads.filter(hr=>hr.id!==f),mo={projectName:G,threads:[ge,..._t]},Un=[...e.value];Un.splice(Pe,1,mo),e.value=Un}else e.value=[{projectName:G,threads:[ge]},...e.value];const he=Vs(C.value,e.value);Kr(C.value,he)||(C.value=he,_o(C.value)),Me()}function Ze(f){const m=new Set(f.map(G=>G.id)),_=Ut(b.value,m);_!==b.value&&(b.value=_,ud(_));const k=Ut(E.value,m);k!==E.value&&(E.value=k,fd(k)),M.value=Ut(M.value,m),L.value=Ut(L.value,m),H.value=Ut(H.value,m),r.value=Ut(r.value,m),o.value=Ut(o.value,m),i.value=Ut(i.value,m),s.value=Ut(s.value,m),X.value=Ut(X.value,m),U.value=Ut(U.value,m),Q.value=Ut(Q.value,m),re.value=Ut(re.value,m),d.value=Ut(d.value,m),a.value=Ut(a.value,m);const K={};for(const[G,ge]of Object.entries(me.value))(G===es||m.has(G))&&(K[G]=ge);me.value=K}function pt(f){const m=_r(e.value).find(_=>_.id===f);m&&(b.value={...b.value,[f]:m.updatedAtIso},ud(b.value),d.value[f]&&(d.value=Lt(d.value,f)),Me())}function ct(f,m){if(!f)return;const _=X.value[f];if(m){if(iR(_,m))return;X.value={...X.value,[f]:m}}else _&&(X.value=Lt(X.value,f))}function j(f,m){!f||a.value[f]===!0===m||(m?a.value={...a.value,[f]:!0}:a.value=Lt(a.value,f),Me())}function ne(f){f&&f!==n.value&&d.value[f]!==!0&&(d.value={...d.value,[f]:!0},Me())}function we(f,m){if(!f)return;const _=U.value[f];if(!m){_&&(U.value=Lt(U.value,f));return}const k=Mr(m.label)||"Thinking",K=m.details.map(Pe=>Mr(Pe)).filter(Pe=>Pe.length>0&&Pe!==k),G=Array.from(new Set([...(_==null?void 0:_.details)??[],...K])).slice(-3),ge={label:k,details:G};aR(_,ge)||(U.value={...U.value,[f]:ge})}function w(f,m){if(!f)return;const _=Q.value[f],k=m?pl(m):"";if(!k){_&&(Q.value=Lt(Q.value,f));return}(_==null?void 0:_.message)!==k&&(Q.value={...Q.value,[f]:{message:k}})}function N(f){const m=_r(e.value).find(_=>_.id===f);return(m==null?void 0:m.updatedAtIso)??""}function le(f,m){if(!f)return;const _={scrollTop:Math.max(0,m.scrollTop),isAtBottom:m.isAtBottom===!0};typeof m.scrollRatio=="number"&&Number.isFinite(m.scrollRatio)&&(_.scrollRatio=cp(m.scrollRatio,0,1));const k=E.value[f];k&&k.scrollTop===_.scrollTop&&k.isAtBottom===_.isAtBottom&&k.scrollRatio===_.scrollRatio||(E.value={...E.value,[f]:_},fd(E.value))}function _e(f,m){const _=r.value[f]??[];Ei(_,m)||(r.value={...r.value,[f]:m})}function De(f,m){const _=o.value[f]??[];Ei(_,m)||(o.value={...o.value,[f]:m})}function mt(f,m){const _=o.value[f]??[],k=hd(_,m);De(f,k)}function Et(f,m){if(!f)return;const _=m.trim(),k=i.value[f]??"";if(_.length===0){if(!k)return;i.value=Lt(i.value,f);return}k!==_&&(i.value={...i.value,[f]:_})}function Ot(f,m){if(!f)return;const _=i.value[f]??"";Et(f,`${_}${m}`)}function gt(f){f&&f in i.value&&(i.value=Lt(i.value,f))}function Te(f){return f!==null&&typeof f=="object"&&!Array.isArray(f)?f:null}function Ie(f){return typeof f=="string"?f:""}function nn(f){return typeof f=="number"&&Number.isFinite(f)?f:null}function Dt(f){const m=Te(f.params);if(!m)return"";const _=Ie(m.threadId);if(_)return _;const k=Ie(m.thread_id);if(k)return k;const K=Ie(m.conversationId);if(K)return K;const G=Ie(m.conversation_id);if(G)return G;const ge=Te(m.thread),Pe=Ie(ge==null?void 0:ge.id);if(Pe)return Pe;const he=Te(m.turn),et=Ie(he==null?void 0:he.threadId);if(et)return et;const _t=Ie(he==null?void 0:he.thread_id);return _t||""}function Pr(f){if(f.method!=="turn/completed")return"";const m=Te(f.params),_=Te(m==null?void 0:m.turn);if(!_||_.status!=="failed")return"";const k=Te(_.error);return Ie(k==null?void 0:k.message)}function lo(f){var _;if(f.method!=="error")return"";const m=Te(f.params);return Ie(m==null?void 0:m.message)||Ie((_=Te(m==null?void 0:m.error))==null?void 0:_.message)}function or(f){const m=Te(f);if(!m)return null;const _=m.id,k=Ie(m.method),K=m.params;if(typeof _!="number"||!Number.isInteger(_)||!k)return null;const G=Te(K),ge=Ie(G==null?void 0:G.threadId)||es,Pe=Ie(G==null?void 0:G.turnId),he=Ie(G==null?void 0:G.itemId),et=Ie(m.receivedAtIso)||new Date().toISOString();return{id:_,method:k,threadId:ge,turnId:Pe,itemId:he,receivedAtIso:et,params:K??null}}function sr(f){const m=f.threadId||es,_=me.value[m]??[],k=_.findIndex(G=>G.id===f.id),K=[..._];k>=0?K.splice(k,1,f):K.push(f),me.value={...me.value,[m]:K.sort((G,ge)=>G.receivedAtIso.localeCompare(ge.receivedAtIso))}}function sn(f){const m={};for(const[_,k]of Object.entries(me.value)){const K=k.filter(G=>G.id!==f);K.length>0&&(m[_]=K)}me.value=m}function Or(f){if(f.method==="server/request"){const m=or(f.params);return m&&sr(m),!0}if(f.method==="server/request/resolved"){const m=Te(f.params),_=m==null?void 0:m.id;return typeof _=="number"&&Number.isInteger(_)&&sn(_),!0}return!1}function Mr(f){return f.replace(/\s+/gu," ").trim()}function co(f){const m=Dt(f);if(!m)return null;if(f.method==="turn/started")return{threadId:m,activity:{label:"Thinking",details:[]}};if(f.method==="item/started"){const _=Te(f.params),k=Te(_==null?void 0:_.item),K=Ie(k==null?void 0:k.type).toLowerCase();if(K==="reasoning")return{threadId:m,activity:{label:"Thinking",details:[]}};if(K==="agentmessage")return{threadId:m,activity:{label:"Writing response",details:[]}};if(K==="commandexecution"){const G=Ie(k==null?void 0:k.command);return{threadId:m,activity:{label:"Running command",details:G?[G]:[]}}}}return f.method==="item/commandExecution/outputDelta"?{threadId:m,activity:{label:"Running command",details:[]}}:f.method==="item/reasoning/summaryTextDelta"||f.method==="item/reasoning/summaryPartAdded"?{threadId:m,activity:{label:"Thinking",details:[]}}:f.method==="item/agentMessage/delta"?{threadId:m,activity:{label:"Writing response",details:[]}}:null}function Nr(f){if(f.method!=="turn/started")return null;const m=Te(f.params);if(!m)return null;const _=Dt(f);if(!_)return null;const k=Te(m.turn),K=Ie(k==null?void 0:k.id)||Ie(m.turnId)||`${_}:unknown`;if(!K)return null;const G=vr(Ie(k==null?void 0:k.startedAt))??vr(Ie(m.startedAt))??vr(f.atIso)??Date.now();return{threadId:_,turnId:K,startedAtMs:G}}function ir(f){if(f.method!=="turn/completed")return null;const m=Te(f.params);if(!m)return null;const _=Dt(f);if(!_)return null;const k=Te(m.turn),K=Ie(k==null?void 0:k.id)||Ie(m.turnId)||`${_}:unknown`;if(!K)return null;const G=vr(Ie(k==null?void 0:k.completedAt))??vr(Ie(m.completedAt))??vr(f.atIso)??Date.now(),ge=vr(Ie(k==null?void 0:k.startedAt))??vr(Ie(m.startedAt))??void 0;return{threadId:_,turnId:K,completedAtMs:G,startedAtMs:ge}}function wn(f){return`${f}:live-reasoning`}function Qt(f){const m=Te(f.params);if(!m)return"";if(f.method==="item/started"){const _=Te(m.item);return!_||_.type!=="reasoning"?"":Ie(_.id)}return""}function ar(f){const m=Te(f.params);if(!m)return null;if(f.method==="item/reasoning/summaryTextDelta"){const _=Ie(m.itemId),k=Ie(m.delta);return!_||!k?null:{messageId:wn(_),delta:k}}return null}function lr(f){const m=Te(f.params);if(!m)return"";if(f.method==="item/reasoning/summaryPartAdded"){const _=Ie(m.itemId);return _?wn(_):""}return""}function cr(f){const m=Te(f.params);if(!m)return"";if(f.method==="item/completed"){const _=Te(m.item);return!_||_.type!=="reasoning"?"":wn(Ie(_.id))}return""}function ur(f){const m=Te(f.params);if(!m)return"";if(f.method==="item/started"){const _=Te(m.item);return!_||_.type!=="agentMessage"?"":Ie(_.id)}return""}function uo(f){const m=Te(f.params);if(!m)return null;if(f.method==="item/agentMessage/delta"){const _=Ie(m.itemId),k=Ie(m.delta);return!_||!k?null:{messageId:_,delta:k}}return null}function Vo(f){const m=Te(f.params);if(!m)return null;if(f.method==="item/completed"){const _=Te(m.item);if(!_||_.type!=="agentMessage")return null;const k=Ie(_.id),K=Ie(_.text);return!k||!K?null:{id:k,role:"assistant",text:K,messageType:"agentMessage.live"}}return null}function jn(f){if(f.method!=="item/started")return null;const m=Te(f.params),_=Te(m==null?void 0:m.item);if(!_||_.type!=="commandExecution")return null;const k=Ie(_.id),K=Ie(_.command);if(!k)return null;const G=typeof _.cwd=="string"?_.cwd:null;return{id:k,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:G,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Wo(f){if(f.method!=="item/commandExecution/outputDelta")return null;const m=Te(f.params);if(!m)return null;const _=Ie(m.itemId),k=Ie(m.delta);return!_||!k?null:{itemId:_,delta:k}}function qo(f){if(f.method!=="item/completed")return null;const m=Te(f.params),_=Te(m==null?void 0:m.item);if(!_||_.type!=="commandExecution")return null;const k=Ie(_.id),K=Ie(_.command);if(!k)return null;const G=typeof _.cwd=="string"?_.cwd:null,ge=Ie(_.status),Pe=ge==="failed"?"failed":ge==="declined"?"declined":ge==="interrupted"?"interrupted":"completed",he=typeof _.aggregatedOutput=="string"?_.aggregatedOutput:"",et=typeof _.exitCode=="number"?_.exitCode:null;return{id:k,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:G,status:Pe,aggregatedOutput:he,exitCode:et}}}function dr(f,m){const _=s.value[f]??[],k=hd(_,m);k!==_&&(s.value={...s.value,[f]:k})}function fo(f,m){const _=s.value[f];if(!_||_.length===0)return;const k=new Set(m.map(G=>G.id)),K=_.filter(G=>!k.has(G.id));K.length!==_.length&&(K.length===0?s.value=Lt(s.value,f):s.value={...s.value,[f]:K})}function Dr(f){if(f.method==="item/agentMessage/delta")return!0;const m=Te(f.params);if(!m)return!1;if(f.method==="item/completed"){const _=Te(m.item);return(_==null?void 0:_.type)==="agentMessage"}return!1}function ho(f){var sc,ic,ac,lc;if(Or(f))return;if(f.method==="thread/name/updated"){const $e=Te(f.params),Tn=Ie($e==null?void 0:$e.threadId),Ur=Ie($e==null?void 0:$e.threadName);Tn&&Ur&&(te.value={...te.value,[Tn]:Ur},Me(),ma(Tn,Ur))}const m=co(f);m&&we(m.threadId,m.activity);const _=Nr(f);_&&(ue.set(_.turnId,_),re.value={...re.value,[_.threadId]:_.turnId},ct(_.threadId,null),w(_.threadId,null),j(_.threadId,!0),d.value[_.threadId]&&(d.value=Lt(d.value,_.threadId)));const k=ir(f),K=Pr(f),ge=!!((k==null?void 0:k.threadId)??Dt(f))&&!!K&&c.value!==on&&Ws(new Error(K));if(k){const $e=ue.get(k.turnId);$e&&ue.delete(k.turnId);const Tn=nn((sc=Te(f.params))==null?void 0:sc.durationMs)??nn((ac=Te((ic=Te(f.params))==null?void 0:ic.turn))==null?void 0:ac.durationMs)??(typeof k.startedAtMs=="number"?k.completedAtMs-k.startedAtMs:null)??($e?k.completedAtMs-$e.startedAtMs:null),Ur=typeof Tn=="number"?Math.max(0,Tn):0;ct(k.threadId,{turnId:k.turnId,durationMs:Ur}),re.value[k.threadId]&&(re.value=Lt(re.value,k.threadId)),j(k.threadId,!1),we(k.threadId,null),ne(k.threadId),ge||(B(k.threadId),zt(k.threadId))}if(K){const $e=(k==null?void 0:k.threadId)||Dt(f);$e&&w($e,K),ae.value=K,$e&&ge&&pe($e)}else k&&w(k.threadId,null);const Pe=lo(f);if(Pe){const $e=Dt(f);$e&&w($e,Pe),ae.value=Pe,c.value!==on&&Ws(new Error(Pe))&&($e?pe($e):V())}const he=Dt(f);if(!he||he!==n.value)return;ur(f);const et=uo(f);if(et){const $e=(o.value[he]??[]).find(Ur=>Ur.id===et.messageId),Tn=`${($e==null?void 0:$e.text)??""}${et.delta}`;mt(he,{id:et.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const _t=Vo(f);_t&&mt(he,_t),Qt(f);const mo=ar(f);if(mo&&Ot(he,mo.delta),lr(f)){const $e=i.value[he]??"";$e.trim().length>0&&!$e.endsWith(`
|
|
1478
|
-
|
|
1479
|
-
`)&&Et(he,`${$e}
|
|
1480
|
-
|
|
1481
|
-
`)}cr(f);const hr=jn(f);hr&&(dr(he,hr),we(he,{label:"Running command",details:[((lc=hr.commandExecution)==null?void 0:lc.command)??""]}));const Wi=Wo(f);if(Wi){const $e=(s.value[he]??[]).find(Tn=>Tn.id===Wi.itemId);$e!=null&&$e.commandExecution&&dr(he,{...$e,commandExecution:{...$e.commandExecution,aggregatedOutput:`${$e.commandExecution.aggregatedOutput}${Wi.delta}`}})}const oc=qo(f);if(oc&&dr(he,oc),Dr(f)&&(Y&&n.value&&le(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),gt(he)),f.method==="turn/completed"){Y=!1,gt(he),s.value[he]&&(s.value=Lt(s.value,he));const $e=Dt(f);$e&&(j($e,!1),we($e,null),ne($e),ge||(B($e),zt($e)))}}function S(f){const m=Dt(f);m&&x.add(m);const _=f.method;(_.startsWith("thread/")||_.startsWith("turn/")||_.startsWith("item/"))&&(nt=!0),!(Fe!==null||typeof window>"u")&&(Fe=window.setTimeout(()=>{Fe=null,jr()},Sa))}async function F(f){if(!oe){oe=!0;try{const m=await Mu(),_=[];for(const k of m.order){const K=Ea(k);_.includes(K)||_.push(K)}if(_.length>0){const k=Vs(_,f);Kr(C.value,k)||(C.value=k,_o(C.value))}if(Object.keys(m.labels).length>0){const k={...W.value};let K=!1;for(const[G,ge]of Object.entries(m.labels)){const Pe=Ea(G);k[Pe]!==ge&&(k[Pe]=ge,K=!0)}K&&(W.value=k,ka(k))}}catch{}}}async function se(){if(!(Object.keys(te.value).length>0))try{const f=await $S();Object.keys(f.titles).length>0&&(te.value=f.titles)}catch{}}async function Se(f,m,_){if(te.value[f])return;const k=m.trim();if(!k)return;const K=k.length>300?k.slice(0,300):k;try{const G=await VS(K,_);if(!G||te.value[f])return;te.value={...te.value,[f]:G},Me(),ma(f,G)}catch{}}async function Be(){var f;it.value||(q.value=!0);try{const[m]=await Promise.all([kS(),se()]);await F(m);const _=Vs(C.value,m);Kr(C.value,_)||(C.value=_,_o(C.value));const k=Ia(m,C.value),K=pR(e.value,k,a.value);e.value=qs(e.value,K),a.value=Ut(a.value,new Set(_r(e.value).map(Pe=>Pe.id))),Me(),it.value=!0;const G=_r(t.value);Ze(G),G.some(Pe=>Pe.id===n.value)||P(((f=G[0])==null?void 0:f.id)??"")}finally{q.value=!1}}async function wt(f,m={}){if(!f)return;const _=M.value[f]===!0,k=m.silent!==!0&&!_;k&&(ye.value=!0);try{H.value[f]!==!0&&(await ha(f),H.value={...H.value,[f]:!0});const{messages:K,inProgress:G}=await IS(f),ge=r.value[f]??[],Pe=rR(ge,K,{preserveMissing:m.silent===!0});_e(f,Pe);const he=o.value[f]??[],et=oR(he,K);De(f,et),fo(f,K),M.value={...M.value,[f]:!0};const _t=N(f);_t&&(L.value={...L.value,[f]:_t}),j(f,G),pt(f)}finally{k&&(ye.value=!1)}}async function Ht(){try{const f=e.value.flatMap(m=>m.threads.map(_=>_.cwd)).filter(Boolean);Ae.value=await WS(f.length>0?[...new Set(f)]:void 0)}catch{}}async function fr(){ae.value="";try{await Be(),await Promise.all([Ee(),Ht()]),await wt(n.value)}catch(f){ae.value=f instanceof Error?f.message:"Unknown application error"}}async function Lr(f){P(f);try{await wt(f)}catch(m){ae.value=m instanceof Error?m.message:"Unknown application error"}}async function Xt(f){try{await RS(f),await Be(),n.value===f&&await wt(n.value)}catch(m){ae.value=m instanceof Error?m.message:"Unknown application error"}}async function O(f,m){const _=m.trim();if(!(!f||!_))try{await xS(f,_),te.value={...te.value,[f]:_},Me(),ma(f,_)}catch(k){ae.value=k instanceof Error?k.message:"Unknown application error"}}async function ve(f,m=[],_=[],k="steer",K=[]){const G=n.value,ge=f.trim();if(!G||!ge&&m.length===0&&K.length===0)return;const Pe=a.value[G]===!0;if(Pe&&k==="queue"){const he=l.value[G]??[],et=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[G]:[...he,{id:et,text:ge,imageUrls:m,skills:_,fileAttachments:K}]};return}if(Pe){Y=!0,Ct(G,ge,m,_,K).catch(he=>{const et=he instanceof Error?he.message:"Unknown application error";w(G,et),ae.value=et});return}ae.value="",Y=!0,ct(G,null),we(G,{label:"Thinking",details:de(c.value,h.value)}),w(G,null),j(G,!0);try{await Ct(G,ge,m,_,K)}catch(he){Y=!1,j(G,!1),we(G,null);const et=he instanceof Error?he.message:"Unknown application error";throw w(G,et),ae.value=et,he}}async function He(f,m,_=[],k=[],K=[]){const G=f.trim(),ge=m.trim(),Pe=c.value.trim();if(!G&&_.length===0&&K.length===0)return"";Re.value=!0,ae.value="";let he="";try{try{he=await Ou(ge||void 0,Pe||void 0)}catch(Un){if(Pe&&Pe!==on&&Ws(Un))await V(),he=await Ou(ge||void 0,on);else throw Un}if(!he)return"";Ke(he,ge,G||"[Image]"),H.value={...H.value,[he]:!0},P(he),Y=!0,ct(he,null),we(he,{label:"Thinking",details:de(c.value,h.value)}),w(he,null),j(he,!0);const et=he,_t=ge||null,mo=G;return Ct(he,G,_,k,K).catch(Un=>{Y=!1,j(he,!1),we(he,null);const hr=Un instanceof Error?Un.message:"Unknown application error";w(he,hr),ae.value=hr}).finally(()=>{Re.value=!1}),Se(et,mo,_t),he}catch(et){Y=!1,he&&(j(he,!1),we(he,null));const _t=et instanceof Error?et.message:"Unknown application error";throw he&&w(he,_t),ae.value=_t,Re.value=!1,et}}async function Ct(f,m,_=[],k=[],K=[]){const G=c.value.trim(),ge=h.value,Pe=m.trim(),he=k.map(_t=>({name:_t.name,path:_t.path})),et=K.map(_t=>({..._t}));J(f,{text:Pe,imageUrls:[..._],skills:he,fileAttachments:et,effort:ge,fallbackRetried:!1});try{H.value[f]!==!0&&await ha(f);try{await pa(f,m,_,G||void 0,ge||void 0,k.length>0?k:void 0,K)}catch(_t){if(G&&G!==on&&Ws(_t))await V(),J(f,{text:Pe,imageUrls:[..._],skills:he,fileAttachments:et,effort:ge,fallbackRetried:!0}),await pa(f,m,_,on,ge||void 0,k.length>0?k:void 0,K);else throw _t}H.value={...H.value,[f]:!0},x.add(f),nt=!0,await jr()}catch(_t){throw _t}}async function zt(f){const m=l.value[f];if(!m||m.length===0)return;const[_,...k]=m;l.value=k.length>0?{...l.value,[f]:k}:Lt(l.value,f),Re.value=!0,ae.value="",Y=!0,ct(f,null),we(f,{label:"Thinking",details:de(c.value,h.value)}),w(f,null),j(f,!0);try{await Ct(f,_.text,_.imageUrls,_.skills,_.fileAttachments)}catch{j(f,!1),we(f,null)}finally{Re.value=!1}}async function an(){const f=n.value;if(!f||a.value[f]!==!0)return;const m=re.value[f];Ue.value=!0,ae.value="";try{await MS(f,m),j(f,!1),we(f,null),w(f,null),re.value[f]&&(re.value=Lt(re.value,f)),x.add(f),nt=!0,await jr()}catch(_){const k=_ instanceof Error?_.message:"Failed to interrupt active turn";w(f,k),ae.value=k}finally{Ue.value=!1}}async function po(f){const m=n.value;if(!m||Ve.value)return;const k=(r.value[m]??[]).reduce((G,ge)=>typeof ge.turnIndex=="number"&&ge.turnIndex>G?ge.turnIndex:G,-1);if(k<0||f>k)return;const K=k-f+1;if(!(K<1)){Ve.value=!0,ae.value="";try{const G=await Pu(m,K);_e(m,G),De(m,[]),gt(m),s.value[m]&&(s.value=Lt(s.value,m)),ct(m,null),we(m,null),w(m,null),nt=!0,await jr()}catch(G){ae.value=G instanceof Error?G.message:"Failed to rollback thread"}finally{Ve.value=!1}}}function dp(f,m){f.length===0||(W.value[f]??"")===m||(W.value={...W.value,[f]:m},ka(W.value))}function fp(f){var K;if(f.length===0)return;const m=C.value.filter(G=>G!==f);if(Kr(C.value,m)||(C.value=m,_o(C.value)),e.value=e.value.filter(G=>G.projectName!==f),W.value[f]!==void 0){const G={...W.value};delete G[f],W.value=G,ka(G)}Me();const _=_r(t.value);Ze(_),_.some(G=>G.id===n.value)||P(((K=_[0])==null?void 0:K.id)??""),Vi()}function hp(f,m){if(f.length===0||e.value.length===0)return;const _=e.value.map(he=>he.projectName),k=_.indexOf(f);if(k===-1)return;const K=Math.max(0,Math.min(m,_.length-1)),G=tR(_,k,K);if(G===_)return;const ge=Vs(G,e.value);C.value=ge,_o(C.value);const Pe=Ia(e.value,C.value);e.value=qs(e.value,Pe),Me(),Vi()}function pp(f){const m=f.trim();if(!m)return;const _=[m,...C.value.filter(K=>K!==m)];if(Kr(C.value,_))return;C.value=_,_o(C.value);const k=Ia(e.value,C.value);e.value=qs(e.value,k),Me(),Vi()}async function Vi(){var f,m;try{const _=await Mu(),k=new Map;for(const ge of _.order){const Pe=Ea(ge);k.has(Pe)||k.set(Pe,ge)}for(const ge of e.value){const Pe=((m=(f=ge.threads[0])==null?void 0:f.cwd)==null?void 0:m.trim())??"";Pe&&k.set(ge.projectName,Pe)}const K=[];for(const ge of C.value){const Pe=k.get(ge);Pe&&!K.includes(Pe)&&K.push(Pe)}for(const ge of _.order)K.includes(ge)||K.push(ge);const G=_.active.filter(ge=>K.includes(ge));G.length===0&&K.length>0&&G.push(K[0]),await US({order:K,labels:_.labels,active:G})}catch{}}async function mp(){if(!ke.value){ke.value=!0;try{if(await Be(),!n.value)return;const f=n.value,m=N(f),_=L.value[f]??"",k=m.length>0&&m!==_;(a.value[f]===!0||k)&&await wt(f,{silent:!0})}catch{}finally{ke.value=!1}}}async function jr(){if(ke.value){typeof window<"u"&&Fe===null&&(Fe=window.setTimeout(()=>{Fe=null,jr()},Sa));return}ke.value=!0;const f=nt,m=new Set(x);nt=!1,x.clear();try{f&&await Be();const _=n.value;if(!_)return;const k=m.has(_),K=a.value[_]===!0,G=N(_),ge=L.value[_]??"",Pe=G.length>0&&G!==ge;(k||K||Pe||f)&&await wt(_,{silent:!0})}catch{}finally{ke.value=!1,(nt||x.size>0)&&typeof window<"u"&&Fe===null&&(Fe=window.setTimeout(()=>{Fe=null,jr()},Sa))}}function gp(){typeof window>"u"||at||(Xe.value&&nc(),vp(),at=ES(f=>{ho(f),S(f)}))}async function vp(){try{const f=await AS();for(const m of f){const _=or(m);_&&sr(_)}}catch{}}async function yp(f){try{await CS(f.id,{result:f.result,error:f.error}),sn(f.id)}catch(m){ae.value=m instanceof Error?m.message:"Failed to reply to server request"}}function tc(f={}){const m=f.updatePreference??!0;ft!==null&&typeof window<"u"&&(window.clearInterval(ft),ft=null),ht!==null&&typeof window<"u"&&(window.clearInterval(ht),ht=null),m&&(Xe.value=!1,dd(!1)),ze.value=Math.floor(Zo/1e3)}function nc(){typeof window>"u"||ft!==null||ht!==null||(Xe.value=!0,dd(!0),ze.value=Math.floor(Zo/1e3),ft=window.setInterval(()=>{ze.value=Math.floor(Zo/1e3),mp()},Zo),ht=window.setInterval(()=>{ze.value=Math.max(0,ze.value-1)},1e3))}function bp(){if(Xe.value){tc();return}nc()}function _p(){tc({updatePreference:!1}),at&&(at(),at=null),nt=!1,x.clear(),ue.clear(),Fe!==null&&typeof window<"u"&&(window.clearTimeout(Fe),Fe=null),Y=!1,r.value={},o.value={},i.value={},s.value={},U.value={},X.value={},Q.value={},re.value={},l.value={}}const wp=ce(()=>{const f=n.value;return f?l.value[f]??[]:[]});function rc(f){const m=n.value;if(!m)return;const _=l.value[m];if(!_)return;const k=_.filter(K=>K.id!==f);l.value=k.length>0?{...l.value,[m]:k}:Lt(l.value,m)}function Tp(f){const m=n.value;if(!m)return;const _=l.value[m];if(!_)return;const k=_.find(K=>K.id===f);k&&(rc(f),ve(k.text,k.imageUrls,k.skills,"steer",k.fileAttachments))}return{projectGroups:t,projectDisplayNameById:W,selectedThread:p,selectedThreadScrollState:v,selectedThreadServerRequests:y,selectedLiveOverlay:A,selectedThreadId:n,availableModelIds:u,selectedModelId:c,selectedReasoningEffort:h,installedSkills:Ae,messages:R,isLoadingThreads:q,isLoadingMessages:ye,isSendingMessage:Re,isInterruptingTurn:Ue,isAutoRefreshEnabled:Xe,autoRefreshSecondsLeft:ze,error:ae,refreshAll:fr,refreshSkills:Ht,selectThread:Lr,setThreadScrollState:le,archiveThreadById:Xt,renameThreadById:O,sendMessageToSelectedThread:ve,sendMessageToNewThread:He,interruptSelectedThreadTurn:an,rollbackSelectedThread:po,isRollingBack:Ve,selectedThreadQueuedMessages:wp,removeQueuedMessage:rc,steerQueuedMessage:Tp,setSelectedModelId:$,setSelectedReasoningEffort:ee,respondToPendingServerRequest:yp,renameProject:dp,removeProject:fp,reorderProject:hp,pinProjectToTop:pp,toggleAutoRefreshTimer:bp,startPolling:gp,stopPolling:_p}}const Ca="codex-web-local.sidebar-collapsed.v1",Aa="codex-web-local.send-with-enter.v1",Ra="codex-web-local.in-progress-send-mode.v1",xa="codex-web-local.dark-mode.v1",yR=jt({__name:"App",setup(t,{expose:e}){e();const n="1781",{projectGroups:r,projectDisplayNameById:o,selectedThread:i,selectedThreadScrollState:s,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:c,selectedReasoningEffort:h,installedSkills:b,messages:E,isLoadingThreads:C,isLoadingMessages:W,isSendingMessage:L,isInterruptingTurn:M,isAutoRefreshEnabled:H,autoRefreshSecondsLeft:X,refreshAll:U,refreshSkills:Q,selectThread:re,setThreadScrollState:me,archiveThreadById:z,renameThreadById:te,sendMessageToSelectedThread:Ae,sendMessageToNewThread:q,interruptSelectedThreadTurn:ye,rollbackSelectedThread:Re,isRollingBack:Ue,selectedThreadQueuedMessages:Ve,removeQueuedMessage:ae,steerQueuedMessage:ke,setSelectedModelId:it,setSelectedReasoningEffort:Xe,respondToPendingServerRequest:ze,renameProject:at,removeProject:Fe,reorderProject:ft,pinProjectToTop:ht,toggleAutoRefreshTimer:nt,startPolling:x,stopPolling:oe}=vR(),Y=bb(),ue=yb(),{isMobile:be}=ah(),Ge=D(!1),p=D(!1),v=D(""),y=D(Se()),A=D(""),R=D(!1),P=D(null),$=D("New Project (1)"),V=D(""),J=D(!1),B=D(dr(Aa,!0)),pe=D(Dr()),ee=D(fo()),de=ce(()=>{const O=Y.params.threadId;return typeof O=="string"?O:""}),Ee=ce(()=>{const O=new Set;for(const ve of r.value)for(const He of ve.threads)O.add(He.id);return O}),Oe=ce(()=>Y.name==="home"),Me=ce(()=>Y.name==="skills"),Ke=ce(()=>{var O;return Me.value?"Skills":Oe.value?"New thread":((O=i.value)==null?void 0:O.title)??"Choose a thread"}),Ze=ce(()=>H.value?`Auto refresh in ${String(X.value)}s`:"Enable 4s refresh"),pt=ce(()=>E.value.filter(O=>{const ve=wt(O.messageType,O.role);return ve==="worked"?!0:!(ve==="turnActivity.live"||ve==="turnError.live"||ve==="agentReasoning.live")})),ct=ce(()=>l.value),j=ce(()=>Oe.value?"__new-thread__":d.value),ne=ce(()=>{var O,ve;return Oe.value?v.value.trim():((ve=(O=i.value)==null?void 0:O.cwd)==null?void 0:ve.trim())??""}),we=ce(()=>{var O;return!Oe.value&&((O=i.value)==null?void 0:O.inProgress)===!0}),w=ce(()=>{var Ct,zt;const O=[],ve=new Set;for(const an of r.value){const po=((zt=(Ct=an.threads[0])==null?void 0:Ct.cwd)==null?void 0:zt.trim())??"";!po||ve.has(po)||(ve.add(po),O.push({value:po,label:o.value[an.projectName]??an.projectName}))}const He=v.value.trim();return He&&!ve.has(He)&&O.unshift({value:He,label:ur(He)}),O}),N=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Ar(()=>{window.addEventListener("keydown",Or),se(),N==null||N.addEventListener("change",se),Ht(),lr(),Qt()}),Ni(()=>{window.removeEventListener("keydown",Or),N==null||N.removeEventListener("change",se),oe()});function le(){Q()}function _e(){R.value=!R.value,R.value?en(()=>{var O;return(O=P.value)==null?void 0:O.focus()}):A.value=""}function De(){var O;A.value="",(O=P.value)==null||O.focus()}function mt(O){O.key==="Escape"&&(R.value=!1,A.value="")}function Et(O){O&&(Y.name==="thread"&&de.value===O||(ue.push({name:"thread",params:{threadId:O}}),be.value&&sn(!0)))}function Ot(O){z(O)}function gt(O){var Ct,zt;const ve=r.value.find(an=>an.projectName===O),He=((zt=(Ct=ve==null?void 0:ve.threads[0])==null?void 0:Ct.cwd)==null?void 0:zt.trim())??"";He&&(v.value=He),be.value&&sn(!0),!Oe.value&&ue.push({name:"home"})}function Te(){var ve,He;const O=((He=(ve=i.value)==null?void 0:ve.cwd)==null?void 0:He.trim())??"";O&&(v.value=O),be.value&&sn(!0),!Oe.value&&ue.push({name:"home"})}function Ie(O){at(O.projectName,O.displayName)}function nn(O){te(O.threadId,O.title)}function Dt(O){Fe(O)}function Pr(O){ft(O.projectName,O.toIndex)}function lo(O){me(O.threadId,O.state)}function or(O){ze(O)}function sr(){nt()}function sn(O){y.value!==O&&(y.value=O,Be(O))}function Or(O){O.defaultPrevented||!O.ctrlKey&&!O.metaKey||O.shiftKey||O.altKey||O.key.toLowerCase()==="b"&&(O.preventDefault(),sn(!y.value))}function Mr(O){const ve=O.text;if(Oe.value){Lr(ve,O.imageUrls,O.skills,O.fileAttachments);return}Ae(ve,O.imageUrls,O.skills,O.mode,O.fileAttachments)}function co(O){v.value=O.trim()}async function Nr(O){const ve=O.trim();if(!ve)return;const He=wn(ve),Ct=await ir(),zt=He?ve:uo(Ct,ve);if(zt)try{const an=await FS(zt,{createIfMissing:!He,label:He?"":ve});an&&(v.value=an,ht(ur(an)),Qt())}catch{}}async function ir(){const O=ar();if(O)return O;try{const ve=await Nu();if(ve)return V.value=ve,ve}catch{}return""}function wn(O){return O?O.startsWith("~/")||O.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(O):!1}async function Qt(){const O=ar();if(!O){$.value="New Project (1)";return}try{const ve=await BS(O);$.value=ve.name||"New Project (1)"}catch{$.value="New Project (1)"}}function ar(){var He,Ct;const O=v.value.trim();if(O)return cr(O);const ve=((Ct=(He=w.value[0])==null?void 0:He.value)==null?void 0:Ct.trim())??"";return ve?cr(ve):V.value.trim()}async function lr(){try{V.value=await Nu()}catch{V.value=""}}function cr(O){const ve=O.trim().replace(/\/+$/,"");if(!ve)return"";const He=ve.lastIndexOf("/");return He<=0?"":ve.slice(0,He)}function ur(O){const ve=O.trim().replace(/\/+$/,"");if(!ve)return"";const He=ve.lastIndexOf("/");return He<0?ve:ve.slice(He+1)}function uo(O,ve){const He=O.trim().replace(/\/+$/,""),Ct=ve.trim().replace(/^\/+/,"");return!He||!Ct?"":`${He}/${Ct}`}function Vo(O){it(O)}function jn(O){Xe(O)}function Wo(){ye()}function qo(O){Re(O.turnIndex)}function dr(O,ve){if(typeof window>"u")return ve;const He=window.localStorage.getItem(O);return He===null?ve:He==="1"}function fo(){if(typeof window>"u")return"system";const O=window.localStorage.getItem(xa);return O==="light"||O==="dark"?O:"system"}function Dr(){return typeof window>"u"?"queue":window.localStorage.getItem(Ra)==="steer"?"steer":"queue"}function ho(){B.value=!B.value,window.localStorage.setItem(Aa,B.value?"1":"0")}function S(){pe.value=pe.value==="steer"?"queue":"steer",window.localStorage.setItem(Ra,pe.value)}function F(){const O=["system","light","dark"],ve=O.indexOf(ee.value);ee.value=O[(ve+1)%O.length],window.localStorage.setItem(xa,ee.value),se()}function se(){const O=document.documentElement;if(ee.value==="dark")O.classList.add("dark");else if(ee.value==="light")O.classList.remove("dark");else{const ve=window.matchMedia("(prefers-color-scheme: dark)").matches;O.classList.toggle("dark",ve)}}function Se(){return typeof window>"u"?!1:window.localStorage.getItem(Ca)==="1"}function Be(O){typeof window>"u"||window.localStorage.setItem(Ca,O?"1":"0")}function wt(O,ve){const He=(O??"").trim();return He.length>0?He:ve.trim()||"message"}async function Ht(){await U(),p.value=!0,await fr(),x()}async function fr(){if(!Ge.value){Ge.value=!0;try{if(Y.name==="home"||Y.name==="skills"){d.value!==""&&await re("");return}if(Y.name==="thread"){const O=de.value;if(!O)return;if(!Ee.value.has(O)){await ue.replace({name:"home"});return}d.value!==O&&await re(O);return}}finally{Ge.value=!1}}}yt(()=>[Y.name,de.value,C.value,Ee.value.has(de.value),d.value],async()=>{p.value&&await fr()}),yt(()=>d.value,async O=>{if(p.value&&!Ge.value&&!(Oe.value||Me.value)){if(!O){Y.name!=="home"&&await ue.replace({name:"home"});return}Y.name==="thread"&&de.value===O||await ue.replace({name:"thread",params:{threadId:O}})}}),yt(()=>w.value,O=>{if(O.length===0){v.value="";return}O.some(He=>He.value===v.value)||(v.value=O[0].value),Qt()},{immediate:!0}),yt(()=>v.value,()=>{Qt()}),yt(be,O=>{O&&!y.value&&sn(!0)});async function Lr(O,ve=[],He=[],Ct=[]){try{const zt=await q(O,v.value,ve,He,Ct);if(!zt)return;await ue.replace({name:"thread",params:{threadId:zt}})}catch{}}const Xt={SIDEBAR_COLLAPSED_STORAGE_KEY:Ca,worktreeName:n,projectGroups:r,projectDisplayNameById:o,selectedThread:i,selectedThreadScrollState:s,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:c,selectedReasoningEffort:h,installedSkills:b,messages:E,isLoadingThreads:C,isLoadingMessages:W,isSendingMessage:L,isInterruptingTurn:M,isAutoRefreshEnabled:H,autoRefreshSecondsLeft:X,refreshAll:U,refreshSkills:Q,selectThread:re,setThreadScrollState:me,archiveThreadById:z,renameThreadById:te,sendMessageToSelectedThread:Ae,sendMessageToNewThread:q,interruptSelectedThreadTurn:ye,rollbackSelectedThread:Re,isRollingBack:Ue,selectedThreadQueuedMessages:Ve,removeQueuedMessage:ae,steerQueuedMessage:ke,setSelectedModelId:it,setSelectedReasoningEffort:Xe,respondToPendingServerRequest:ze,renameProject:at,removeProject:Fe,reorderProject:ft,pinProjectToTop:ht,toggleAutoRefreshTimer:nt,startPolling:x,stopPolling:oe,route:Y,router:ue,isMobile:be,isRouteSyncInProgress:Ge,hasInitialized:p,newThreadCwd:v,isSidebarCollapsed:y,sidebarSearchQuery:A,isSidebarSearchVisible:R,sidebarSearchInputRef:P,defaultNewProjectName:$,homeDirectory:V,isSettingsOpen:J,SEND_WITH_ENTER_KEY:Aa,IN_PROGRESS_SEND_MODE_KEY:Ra,DARK_MODE_KEY:xa,sendWithEnter:B,inProgressSendMode:pe,darkMode:ee,routeThreadId:de,knownThreadIdSet:Ee,isHomeRoute:Oe,isSkillsRoute:Me,contentTitle:Ke,autoRefreshButtonLabel:Ze,filteredMessages:pt,liveOverlay:ct,composerThreadContextId:j,composerCwd:ne,isSelectedThreadInProgress:we,newThreadFolderOptions:w,darkModeMediaQuery:N,onSkillsChanged:le,toggleSidebarSearch:_e,clearSidebarSearch:De,onSidebarSearchKeydown:mt,onSelectThread:Et,onArchiveThread:Ot,onStartNewThread:gt,onStartNewThreadFromToolbar:Te,onRenameProject:Ie,onRenameThread:nn,onRemoveProject:Dt,onReorderProject:Pr,onUpdateThreadScrollState:lo,onRespondServerRequest:or,onToggleAutoRefreshTimer:sr,setSidebarCollapsed:sn,onWindowKeyDown:Or,onSubmitThreadMessage:Mr,onSelectNewThreadFolder:co,onAddNewProject:Nr,resolveProjectBaseDirectory:ir,looksLikePath:wn,refreshDefaultProjectName:Qt,getProjectBaseDirectory:ar,loadHomeDirectory:lr,getPathParent:cr,getPathLeafName:ur,joinPath:uo,onSelectModel:Vo,onSelectReasoningEffort:jn,onInterruptTurn:Wo,onRollback:qo,loadBoolPref:dr,loadDarkModePref:fo,loadInProgressSendModePref:Dr,toggleSendWithEnter:ho,cycleInProgressSendMode:S,cycleDarkMode:F,applyDarkMode:se,loadSidebarCollapsed:Se,saveSidebarCollapsed:Be,normalizeMessageType:wt,initialize:Ht,syncThreadSelectionWithRoute:fr,submitFirstMessageForNewThread:Lr,DesktopLayout:kb,SidebarThreadTree:gw,ContentHeader:Sw,ThreadConversation:ZT,ThreadComposer:bI,QueuedMessages:AI,ComposerDropdown:fh,SkillsHub:kA,SidebarThreadControls:$A,IconTablerSearch:rp,IconTablerSettings:GA,IconTablerX:Bl};return Object.defineProperty(Xt,"__isScriptSetup",{enumerable:!1,value:!0}),Xt}}),bR={class:"sidebar-root"},_R={class:"sidebar-scrollable"},wR=["aria-pressed"],TR={key:1,class:"sidebar-search-bar"},SR={key:0,class:"sidebar-settings-area"},kR={key:0,class:"sidebar-settings-panel"},IR={class:"sidebar-settings-value"},ER={class:"sidebar-settings-value"},CR={class:"content-root"},AR={class:"content-body"},RR={key:1,class:"content-grid"},xR={class:"new-thread-empty"},PR={key:2,class:"content-grid"},OR={class:"content-thread"},MR={class:"composer-with-queue"},NR={class:"build-badge","aria-label":"Worktree name"};function DR(t,e,n,r,o,i){return T(),I(je,null,[Ce(r.DesktopLayout,{"is-sidebar-collapsed":r.isSidebarCollapsed,onCloseSidebar:e[5]||(e[5]=s=>r.setSidebarCollapsed(!0))},{sidebar:lt(()=>[g("section",bR,[g("div",_R,[r.isSidebarCollapsed?ie("v-if",!0):(T(),vt(r.SidebarThreadControls,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":r.isSidebarCollapsed,"is-auto-refresh-enabled":r.isAutoRefreshEnabled,"auto-refresh-button-label":r.autoRefreshButtonLabel,"show-new-thread-button":!0,onToggleSidebar:e[0]||(e[0]=s=>r.setSidebarCollapsed(!r.isSidebarCollapsed)),onToggleAutoRefresh:r.onToggleAutoRefreshTimer,onStartNewThread:r.onStartNewThreadFromToolbar},{default:lt(()=>[g("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":r.isSidebarSearchVisible,"aria-label":"Search threads",title:"Search threads",onClick:r.toggleSidebarSearch},[Ce(r.IconTablerSearch,{class:"sidebar-search-toggle-icon"})],8,wR)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!r.isSidebarCollapsed&&r.isSidebarSearchVisible?(T(),I("div",TR,[Ce(r.IconTablerSearch,{class:"sidebar-search-bar-icon"}),Xn(g("input",{ref:"sidebarSearchInputRef","onUpdate:modelValue":e[1]||(e[1]=s=>r.sidebarSearchQuery=s),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:r.onSidebarSearchKeydown},null,544),[[Zn,r.sidebarSearchQuery]]),r.sidebarSearchQuery.length>0?(T(),I("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:r.clearSidebarSearch},[Ce(r.IconTablerX,{class:"sidebar-search-clear-icon"})])):ie("v-if",!0)])):ie("v-if",!0),r.isSidebarCollapsed?ie("v-if",!0):(T(),I("button",{key:2,class:dt(["sidebar-skills-link",{"is-active":r.isSkillsRoute}]),type:"button",onClick:e[2]||(e[2]=s=>{r.router.push({name:"skills"}),r.isMobile&&r.setSidebarCollapsed(!0)})}," Skills Hub ",2)),r.isSidebarCollapsed?ie("v-if",!0):(T(),vt(r.SidebarThreadTree,{key:3,groups:r.projectGroups,"project-display-name-by-id":r.projectDisplayNameById,"selected-thread-id":r.selectedThreadId,"is-loading":r.isLoadingThreads,"search-query":r.sidebarSearchQuery,onSelect:r.onSelectThread,onArchive:r.onArchiveThread,onStartNewThread:r.onStartNewThread,onRenameProject:r.onRenameProject,onRenameThread:r.onRenameThread,onRemoveProject:r.onRemoveProject,onReorderProject:r.onReorderProject},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))]),r.isSidebarCollapsed?ie("v-if",!0):(T(),I("div",SR,[Ce(Bf,{name:"settings-panel"},{default:lt(()=>[r.isSettingsOpen?(T(),I("div",kR,[g("button",{class:"sidebar-settings-row",type:"button",onClick:r.toggleSendWithEnter},[e[6]||(e[6]=g("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),g("span",{class:dt(["sidebar-settings-toggle",{"is-on":!r.sendWithEnter}])},null,2)]),g("button",{class:"sidebar-settings-row",type:"button",onClick:r.cycleInProgressSendMode},[e[7]||(e[7]=g("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),g("span",IR,fe(r.inProgressSendMode==="steer"?"Steer":"Queue"),1)]),g("button",{class:"sidebar-settings-row",type:"button",onClick:r.cycleDarkMode},[e[8]||(e[8]=g("span",{class:"sidebar-settings-label"},"Appearance",-1)),g("span",ER,fe(r.darkMode==="system"?"System":r.darkMode==="dark"?"Dark":"Light"),1)])])):ie("v-if",!0)]),_:1}),g("button",{class:"sidebar-settings-button",type:"button",onClick:e[3]||(e[3]=s=>r.isSettingsOpen=!r.isSettingsOpen)},[Ce(r.IconTablerSettings,{class:"sidebar-settings-icon"}),e[9]||(e[9]=g("span",null,"Settings",-1))])]))])]),content:lt(()=>[g("section",CR,[Ce(r.ContentHeader,{title:r.contentTitle},{leading:lt(()=>[r.isSidebarCollapsed||r.isMobile?(T(),vt(r.SidebarThreadControls,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":r.isSidebarCollapsed,"is-auto-refresh-enabled":r.isAutoRefreshEnabled,"auto-refresh-button-label":r.autoRefreshButtonLabel,"show-new-thread-button":!0,onToggleSidebar:e[4]||(e[4]=s=>r.setSidebarCollapsed(!r.isSidebarCollapsed)),onToggleAutoRefresh:r.onToggleAutoRefreshTimer,onStartNewThread:r.onStartNewThreadFromToolbar},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ie("v-if",!0)]),_:1},8,["title"]),g("section",AR,[r.isSkillsRoute?(T(),vt(r.SkillsHub,{key:0,onSkillsChanged:r.onSkillsChanged})):r.isHomeRoute?(T(),I("div",RR,[g("div",xR,[e[10]||(e[10]=g("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(r.ComposerDropdown,{class:"new-thread-folder-dropdown","model-value":r.newThreadCwd,options:r.newThreadFolderOptions,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":r.defaultNewProjectName,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":r.onSelectNewThreadFolder,onAdd:r.onAddNewProject},null,8,["model-value","options","default-add-value"])]),Ce(r.ThreadComposer,{"active-thread-id":r.composerThreadContextId,cwd:r.composerCwd,models:r.availableModelIds,"selected-model":r.selectedModelId,"selected-reasoning-effort":r.selectedReasoningEffort,skills:r.installedSkills,"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":r.sendWithEnter,"in-progress-submit-mode":r.inProgressSendMode,onSubmit:r.onSubmitThreadMessage,"onUpdate:selectedModel":r.onSelectModel,"onUpdate:selectedReasoningEffort":r.onSelectReasoningEffort},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(T(),I("div",PR,[g("div",OR,[Ce(r.ThreadConversation,{messages:r.filteredMessages,"is-loading":r.isLoadingMessages,"active-thread-id":r.composerThreadContextId,"scroll-state":r.selectedThreadScrollState,"live-overlay":r.liveOverlay,"pending-requests":r.selectedThreadServerRequests,"is-turn-in-progress":r.isSelectedThreadInProgress,"is-rolling-back":r.isRollingBack,onUpdateScrollState:r.onUpdateThreadScrollState,onRespondServerRequest:r.onRespondServerRequest,onRollback:r.onRollback},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),g("div",MR,[Ce(r.QueuedMessages,{messages:r.selectedThreadQueuedMessages,onSteer:r.steerQueuedMessage,onDelete:r.removeQueuedMessage},null,8,["messages","onSteer","onDelete"]),Ce(r.ThreadComposer,{"active-thread-id":r.composerThreadContextId,cwd:r.composerCwd,models:r.availableModelIds,"selected-model":r.selectedModelId,"selected-reasoning-effort":r.selectedReasoningEffort,skills:r.installedSkills,"is-turn-in-progress":r.isSelectedThreadInProgress,"is-interrupting-turn":r.isInterruptingTurn,"has-queue-above":r.selectedThreadQueuedMessages.length>0,"send-with-enter":r.sendWithEnter,"in-progress-submit-mode":r.inProgressSendMode,onSubmit:r.onSubmitThreadMessage,"onUpdate:selectedModel":r.onSelectModel,"onUpdate:selectedReasoningEffort":r.onSelectReasoningEffort,onInterrupt:r.onInterruptTurn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),g("div",NR," WT "+fe(r.worktreeName),1)],64)}const LR=tt(yR,[["render",DR],["__scopeId","data-v-7a7a37b1"],["__file","/Users/igor/.codex/worktrees/1781/codex-web-local/src/App.vue"]]),Pa={render:()=>null},jR=vb({history:Wy(),routes:[{path:"/",name:"home",component:Pa},{path:"/thread/:threadId",name:"thread",component:Pa},{path:"/skills",name:"skills",component:Pa},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Dv(LR).use(jR).mount("#app");
|