hopwire 0.7.0 → 0.8.1

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.
@@ -0,0 +1,5 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),ee=e=>x(e).slice(8,-1),S=e=>x(e)===`[object Object]`,te=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,C=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=1e4,re=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>ne&&(t=Object.create(null),n=1),t[r]=e(r)):i})},ie=/-\w/g,w=re(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),ae=/\B([A-Z])/g,oe=re(e=>e.replace(ae,`-$1`).toLowerCase()),se=re(e=>e.charAt(0).toUpperCase()+e.slice(1)),ce=re(e=>e?`on${se(e)}`:``),le=(e,t)=>!Object.is(e,t),T=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ue=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},de=e=>{let t=parseFloat(e);return isNaN(t)?e:t},fe,pe=()=>fe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function me(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?ve(r):me(r);if(i)for(let e in i)t[e]=i[e]}return t}if(g(e)||v(e))return e}var he=/;(?![^(]*\))/g,ge=/:([^]+)/,_e=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ve(e){let t={};return e.replace(_e,e=>e.startsWith(`/*`)?``:e).split(he).forEach(e=>{if(e){let n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function E(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=E(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var ye=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,be=e(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=u(e,r),a=u(t,r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return Oe(e)===Oe(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=_(e),i=_(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=v(e),i=v(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}function Oe(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?x(e):String(e)}var ke=e=>!!(e&&e.__v_isRef===!0),D=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?ke(e)?D(e.value):JSON.stringify(e,Ae,2):String(e),Ae=(e,t)=>ke(t)?Ae(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[je(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>je(e))}:_(t)?je(t):v(t)&&!d(t)&&!S(t)?String(t):t,je=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,O,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&O&&(O.active?(this.parent=O,this.index=(O.scopes||(O.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=O;try{return O=this,e()}finally{O=t}}}on(){++this._on===1&&(this.prevScope=O,O=this)}off(){if(this._on>0&&--this._on===0){if(O===this)O=this.prevScope;else{let e=O;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Ne(){return O}function Pe(e,t=!1){O&&(O.active?O.cleanups.push(e):e())}var k,Fe=new WeakSet,Ie=class{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,O&&(O.active?O.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fe.has(this)&&(Fe.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Be(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$e(this),Ue(this);let e=k,t=Ye;k=this,Ye=!0;try{return this.fn()}finally{We(this),k=e,Ye=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)qe(e);this.deps=this.depsTail=void 0,$e(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fe.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ge(this)&&this.run()}get dirty(){return Ge(this)}},Le=0,Re,ze;function Be(e,t=!1){e.flags|=8,t?(e.next=ze,ze=e):(e.next=Re,Re=e)}function Ve(){Le++}function He(){if(--Le>0)return;if(ze){let e=ze;for(ze=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Re;){let t=Re;for(Re=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ue(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function We(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),qe(r),Je(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ge(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ke(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ke(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===et)||(e.globalVersion=et,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ge(e))))return;e.flags|=2;let t=e.dep,n=k,r=Ye;k=e,Ye=!0;try{Ue(e);let n=e.fn(e._value);(t.version===0||le(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{k=n,Ye=r,We(e),e.flags&=-3}}function qe(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)qe(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Je(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ye=!0,Xe=[];function Ze(){Xe.push(Ye),Ye=!1}function Qe(){let e=Xe.pop();Ye=e===void 0||e}function $e(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=k;k=void 0;try{t()}finally{k=e}}}var et=0,tt=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},nt=class{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}track(e){if(!k||!Ye||k===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==k)t=this.activeLink=new tt(k,this),k.deps?(t.prevDep=k.depsTail,k.depsTail.nextDep=t,k.depsTail=t):k.deps=k.depsTail=t,rt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=k.depsTail,t.nextDep=void 0,k.depsTail.nextDep=t,k.depsTail=t,k.deps===t&&(k.deps=e)}return t}trigger(e){this.version++,et++,this.notify(e)}notify(e){Ve();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{He()}}};function rt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)rt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var it=new WeakMap,at=Symbol(``),ot=Symbol(``),st=Symbol(``);function A(e,t,n){if(Ye&&k){let t=it.get(e);t||it.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new nt),r.map=t,r.key=n),r.track()}}function ct(e,t,n,r,i,a){let o=it.get(e);if(!o){et++;return}let s=e=>{e&&e.trigger()};if(Ve(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&te(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===st||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(st)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(at)),f(e)&&s(o.get(ot)));break;case`delete`:i||(s(o.get(at)),f(e)&&s(o.get(ot)));break;case`set`:f(e)&&s(o.get(at))}}He()}function lt(e){let t=j(e);return t===e||(A(t,`iterate`,st),Xt(e))?t:Yt(e)?Jt(e)?t.map(e=>en($t(e))):t.map(en):t.map($t)}function ut(e){return A(e=j(e),`iterate`,st),e}var dt=e=>en($t(e));function ft(e){return Yt(e)?Jt(e)?dt:en:$t}var pt={__proto__:null,[Symbol.iterator](){return mt(this,Symbol.iterator,ft(this))},concat(...e){return lt(this).concat(...e.map(e=>d(e)?lt(e):e))},entries(){let e=ft(this);return mt(this,`entries`,t=>(t[1]=e(t[1]),t))},every(e,t){return _t(this,`every`,e,t,void 0,arguments)},filter(e,t){return _t(this,`filter`,e,t,e=>e.map(ft(this)),arguments)},find(e,t){return _t(this,`find`,e,t,e=>ft(this)(e),arguments)},findIndex(e,t){return _t(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return _t(this,`findLast`,e,t,e=>ft(this)(e),arguments)},findLastIndex(e,t){return _t(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return _t(this,`forEach`,e,t,void 0,arguments)},includes(...e){return yt(this,`includes`,e)},indexOf(...e){return yt(this,`indexOf`,e)},join(e){return lt(this).join(e)},lastIndexOf(...e){return yt(this,`lastIndexOf`,e)},map(e,t){return _t(this,`map`,e,t,void 0,arguments)},pop(){return bt(this,`pop`)},push(...e){return bt(this,`push`,e)},reduce(e,...t){return vt(this,`reduce`,e,t)},reduceRight(e,...t){return vt(this,`reduceRight`,e,t)},shift(){return bt(this,`shift`)},some(e,t){return _t(this,`some`,e,t,void 0,arguments)},splice(...e){return bt(this,`splice`,e)},toReversed(){return lt(this).toReversed()},toSorted(e){return lt(this).toSorted(e)},toSpliced(...e){return lt(this).toSpliced(...e)},unshift(...e){return bt(this,`unshift`,e)},values(){return mt(this,`values`,ft(this))}};function mt(e,t,n){let r=ut(e),i=r[t],a=i.call(r);if(r!==e&&!Xt(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>ht(a.next(),n),i!==gt[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>ht(a._next(),n)}return a}function ht(e,t){return e.done||(e.value=t(e.value)),e}var gt=Array.prototype;function _t(e,t,n,r,i,a){let o=ut(e),s=o!==e&&!Xt(e),c=o[t];if(c!==gt[t]){let t=c.apply(e,a);return s?$t(t):t}let l=n;if(o!==e){if(s){let t=ft(e);l=function(r,i){return n.call(this,t(r),i,e)}}else n.length>2&&(l=function(t,r){return n.call(this,t,r,e)})}let u=c.call(o,l,r);return s&&i?i(u):u}function vt(e,t,n,r){let i=ut(e),a=i!==e&&!Xt(e),o=n,s=!1;if(i!==e){if(a){let t=ft(e);s=r.length===0,o=function(r,i,a){return s&&(s=!1,r=t(r)),n.call(this,r,t(i),a,e)}}else n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)})}let c=i[t](o,...r);return s?ft(e)(c):c}function yt(e,t,n){let r=j(e);A(r,`iterate`,st);let i=r[t](...n);return(i===-1||i===!1)&&Zt(n[0])?(n[0]=j(n[0]),r[t](...n)):i}function bt(e,t,n=[]){Ze(),Ve();let r=j(e)[t].apply(e,n);return He(),Qe(),r}var xt=e(`__proto__,__v_isRef,__isVue`),St=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function Ct(e){_(e)||(e=String(e));let t=j(this);return A(t,`has`,e),t.hasOwnProperty(e)}var wt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Ht:Vt:i?Bt:zt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=pt[t]))return e;if(t===`hasOwnProperty`)return Ct}let o=Reflect.get(e,t,M(e)?e:n);if((_(t)?St.has(t):xt(t))||(r||A(e,`get`,t),i))return o;if(M(o)){let e=a&&te(t)?o:o.value;return r&&v(e)?Kt(e):e}return v(o)?r?Kt(o):Wt(o):o}},Tt=class extends wt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&te(t);if(!this._isShallow){let e=Yt(i);if(!Xt(n)&&!Yt(n)&&(i=j(i),n=j(n)),!a&&M(i)&&!M(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:u(e,t),s=Reflect.set(e,t,n,M(e)?e:r);return e===j(r)&&s&&(o?le(n,i)&&ct(e,`set`,t,n,i):ct(e,`add`,t,n)),s}deleteProperty(e,t){let n=u(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ct(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return _(t)&&St.has(t)||A(e,`has`,t),n}ownKeys(e){return A(e,`iterate`,d(e)?`length`:at),Reflect.ownKeys(e)}},Et=class extends wt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Dt=new Tt,Ot=new Et,kt=new Tt(!0),At=e=>e,jt=e=>Reflect.getPrototypeOf(e);function Mt(e,t,n){return function(...r){let i=this.__v_raw,a=j(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?At:t?en:$t;return!t&&A(a,`iterate`,l?ot:at),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Nt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Pt(e,t){let n={get(n){let r=this.__v_raw,i=j(r),a=j(n);e||(le(n,a)&&A(i,`get`,n),A(i,`get`,a));let{has:o}=jt(i),s=t?At:e?en:$t;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&A(j(t),`iterate`,at),t.size},has(t){let n=this.__v_raw,r=j(n),i=j(t);return e||(le(t,i)&&A(r,`has`,t),A(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=j(a),s=t?At:e?en:$t;return!e&&A(o,`iterate`,at),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Nt(`add`),set:Nt(`set`),delete:Nt(`delete`),clear:Nt(`clear`)}:{add(e){let n=j(this),r=jt(n),i=j(e),a=!t&&!Xt(e)&&!Yt(e)?i:e;return r.has.call(n,a)||le(e,a)&&r.has.call(n,e)||le(i,a)&&r.has.call(n,i)||(n.add(a),ct(n,`add`,a,a)),this},set(e,n){t||Xt(n)||Yt(n)||(n=j(n));let r=j(this),{has:i,get:a}=jt(r),o=i.call(r,e);o||=(e=j(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?le(n,s)&&ct(r,`set`,e,n,s):ct(r,`add`,e,n),this},delete(e){let t=j(this),{has:n,get:r}=jt(t),i=n.call(t,e);i||=(e=j(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ct(t,`delete`,e,void 0,a),o},clear(){let e=j(this),t=e.size!==0,n=e.clear();return t&&ct(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Mt(r,e,t)}),n}function Ft(e,t){let n=Pt(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(u(n,i)&&i in r?n:r,i,a)}var It={get:Ft(!1,!1)},Lt={get:Ft(!1,!0)},Rt={get:Ft(!0,!1)},zt=new WeakMap,Bt=new WeakMap,Vt=new WeakMap,Ht=new WeakMap;function Ut(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Wt(e){return Yt(e)?e:qt(e,!1,Dt,It,zt)}function Gt(e){return qt(e,!1,kt,Lt,Bt)}function Kt(e){return qt(e,!0,Ot,Rt,Vt)}function qt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Ut(ee(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Jt(e){return Yt(e)?Jt(e.__v_raw):!!(e&&e.__v_isReactive)}function Yt(e){return!!(e&&e.__v_isReadonly)}function Xt(e){return!!(e&&e.__v_isShallow)}function Zt(e){return e?!!e.__v_raw:!1}function j(e){let t=e&&e.__v_raw;return t?j(t):e}function Qt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&ue(e,`__v_skip`,!0),e}var $t=e=>v(e)?Wt(e):e,en=e=>v(e)?Kt(e):e;function M(e){return e?e.__v_isRef===!0:!1}function N(e){return nn(e,!1)}function tn(e){return nn(e,!0)}function nn(e,t){return M(e)?e:new rn(e,t)}var rn=class{constructor(e,t){this.dep=new nt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:j(e),this._value=t?e:$t(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Xt(e)||Yt(e);e=n?e:j(e),le(e,t)&&(this._rawValue=e,this._value=n?e:$t(e),this.dep.trigger())}};function P(e){return M(e)?e.value:e}var an={get:(e,t,n)=>t===`__v_raw`?e:P(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return M(i)&&!M(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function on(e){return Jt(e)?e:new Proxy(e,an)}var sn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new nt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=et-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&k!==this)return Be(this,!0),!0}get value(){let e=this.dep.track();return Ke(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function cn(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new sn(r,i,n)}var ln={},un=new WeakMap,dn=void 0;function fn(e,t=!1,n=dn){if(n){let t=un.get(n);t||un.set(n,t=[]),t.push(e)}}function pn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f,onStop:p}=i,m=e=>o?e:Xt(e)||o===!1||o===0?mn(e,1):mn(e),g,_,v,y,b=!1,x=!1;if(M(e)?(_=()=>e.value,b=Xt(e)):Jt(e)?(_=()=>m(e),b=!0):d(e)?(x=!0,b=e.some(e=>Jt(e)||Xt(e)),_=()=>e.map(e=>{if(M(e))return e.value;if(Jt(e))return m(e);if(h(e))return f?f(e,2):e()})):_=h(e)?n?f?()=>f(e,2):e:()=>{if(v){Ze();try{v()}finally{Qe()}}let t=dn;dn=g;try{return f?f(e,3,[y]):e(y)}finally{dn=t}}:r,n&&o){let e=_,t=o===!0?1/0:o;_=()=>mn(e(),x?t+1:t)}let ee=Ne(),S=()=>{g.stop(),ee&&ee.active&&c(ee.effects,g)},te=!1;if(s&&n){let e=n;n=(...t)=>{te=!0;try{return e(...t)}finally{S()}}}let C=x?Array(e.length).fill(ln):ln,ne=e=>{if(!te&&g.flags&1&&(g.dirty||e)){if(n){let t=g.run();if(e||o||b||(x?t.some((e,t)=>le(e,C[t])):le(t,C))){let e=dn;Ze();try{v&&v(),dn=g;let e=[t,C===ln?void 0:x&&C[0]===ln?[]:C,y];C=t,f?f(n,3,e):n(...e)}finally{dn=e,Qe()}}}else g.run()}};return u&&u(ne),g=new Ie(_),g.scheduler=l?()=>l(ne,!1):ne,y=e=>fn(e,!1,g),v=g.onStop=()=>{let e=un.get(g);if(e){if(f)f(e,4);else for(let t of e)t();un.delete(g)}},p&&(g.onStop=()=>{v(),p()}),n?a?ne(!0):C=g.run():l?l(ne.bind(null,!0),!0):g.run(),S.pause=g.pause.bind(g),S.resume=g.resume.bind(g),S.stop=S,S}function mn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,M(e))mn(e.value,t,n);else if(d(e)){if(Jt(e)&&!Yt(e)&&!Xt(e)){let r=j(e);A(r,`iterate`,st);for(let e=0;e<r.length;e++){let i=r[e];mn(M(i)?i:$t(i),t,n)}}else for(let r=0;r<e.length;r++)mn(e[r],t,n)}else if(p(e)||f(e))e.forEach(e=>{mn(e,t,n)});else if(S(e)){for(let r in e)mn(e[r],t,n);let r=j(e);for(let i of Object.getOwnPropertySymbols(r))Object.prototype.propertyIsEnumerable.call(r,i)&&mn(e[i],t,n)}return e}function hn(e,t,n,r){try{return r?e(...r):e()}catch(e){_n(e,t,n)}}function gn(e,t,n,r){if(h(e)){let i=hn(e,t,n,r);return i&&y(i)&&i.catch(e=>{_n(e,t,n,void 0,!0)}),i}if(d(e)){let i=[];for(let a=0;a<e.length;a++)i.push(gn(e[a],t,n,r));return i}}function _n(e,n,r,i=!0,a=!1){let o=n?n.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:c}=n&&n.appContext.config||t;if(n){let t=n.parent,i=n.proxy,o=`https://vuejs.org/error-reference/#runtime-${r}`;for(;t;){let n=t.ec;if(n&&!t.isUnmounted&&(!a||t.scope.active)){for(let t=0;t<n.length;t++)if(n[t](e,i,o)===!1)return}t=t.parent}if(s){Ze(),hn(s,null,10,[e,i,o]),Qe();return}}vn(e,r,o,i,c)}function vn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var F=[],yn=-1,bn=[],xn=null,Sn=0,Cn=Promise.resolve(),wn=null;function Tn(e){let t=wn||Cn;return e?t.then(this?e.bind(this):e):t}function En(e){let t=yn+1,n=F.length;for(;t<n;){let r=t+n>>>1,i=F[r],a=Pn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Dn(e){if(!(e.flags&1)){let t=Pn(e),n=F[F.length-1];!n||!(e.flags&2)&&t>=Pn(n)?F.push(e):F.splice(En(t),0,e),e.flags|=1,On()}}function On(){wn||=Cn.then(Fn)}function kn(e){if(!d(e))xn&&e.id===-1?xn.splice(Sn+1,0,e):e.flags&1||(bn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)bn.push(e[t]);On()}function An(e,t,n,r=yn+1){for(;r<F.length;r++){let n=F[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;F.splice(r,1),r=e?r-1:yn,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function jn(e,t,n=0){if(bn.length){let e=bn,r=0;if(t){e=[];for(let i=0;i<bn.length;i++){let a=bn[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?bn[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>Pn(e)-Pn(t));if(bn.length=r,xn){for(let e=0;e<i.length;e++)xn.push(i[e]);return}for(xn=i,Sn=0;Sn<xn.length;Sn++){let e=xn[Sn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}xn=null,Sn=0}}var Mn=!1;function Nn(e,t){if(Mn){e();return}let n=t===void 0?void 0:new Set(bn);e(),Mn=!0;try{An(void 0,t),jn(void 0,n,t)}finally{Mn=!1}}var Pn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Fn(e){try{for(yn=0;yn<F.length;yn++){let e=F[yn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),hn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;yn<F.length;yn++){let e=F[yn];e&&(e.flags&=-2)}yn=-1,F.length=0,jn(e),wn=null,(F.length||bn.length)&&Fn(e)}}var I=null,In=null;function Ln(e){let t=I;return I=e,In=e&&e.type.__scopeId||null,t}function L(e,t=I,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&qi(-1);let i=Ln(t),a=Ui.length,o;try{o=e(...n)}finally{for(let e=Ui.length;e>a;e--)Gi();Ln(i),r._d&&qi(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function R(e,n){if(I===null)return e;let r=Ta(I),i=e.dirs||=[];for(let e=0;e<n.length;e++){let[a,o,s,c=t]=n[e];a&&(h(a)&&(a={mounted:a,updated:a}),a.deep&&mn(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function Rn(e,t,n,r){let i=e;if(r===`beforeMount`)e._mount=e;else if(r===`beforeUpdate`){let n=t&&t._mount;n&&(n._latest=e,e._mount=n)}else if(r===`mounted`){let t=e._latest;e._mount=e._latest=void 0,t&&(i=t,t._mount=void 0)}let a=i.dirs,o=t&&t.dirs;for(let c=0;c<a.length;c++){let l=a[c];o?l.oldValue=o[c].value:r===`mounted`&&l.oldValue!==void 0&&(l=s({},l,{oldValue:void 0}));let u=l.dir[r];u&&(Ze(),gn(u,n,8,[e.el,l,i,t]),Qe())}}function zn(e,t){if(Z){let n=Z.provides,r=Z.parent&&Z.parent.provides;r===n&&(n=Z.provides=Object.create(r)),n[e]=t}}function Bn(e,t,n=!1){let r=da();if(r||Yr){let i=Yr?Yr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&h(t)?t.call(r&&r.proxy):t}}var Vn=Symbol.for(`v-scx`),Hn=()=>Bn(Vn);function Un(e,t,n){return Wn(e,t,n)}function Wn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(_a){if(c===`sync`){let e=Hn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=Z,m;if(p&&Ne()!==p.scope){if(p.scope.active){let e=p.scope.run(()=>new Me);e.run(()=>Pe(()=>Promise.resolve().then(()=>{p=null,m&&(m.i=null)}))),u.onStop=()=>e.stop()}else p=null}u.call=(e,t,n)=>gn(e,p,t,n);let h=!1;c===`post`?u.scheduler=e=>{e.i=p,H(e,p&&p.suspense)}:c!==`sync`&&(h=!0,u.scheduler=(e,t)=>{t?e():Dn(e)}),u.augmentJob=e=>{m=e,n&&(e.flags|=4),h&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let g=pn(e,n,u);return _a&&(f?f.push(g):d&&g()),g}function Gn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Kn(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=ma(this),s=Wn(i,a.bind(r),n);return o(),s}function Kn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var qn=Symbol(`_vte`),Jn=e=>e.__isTeleport,Yn=Symbol(`_leaveCb`);function Xn(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Vi){t=n;break}}return t}function Zn(e){if(!sr(e))return Jn(e.type)&&e.children?Xn(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function Qn(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Qn(Jn(n.type)&&Zn(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&Qn(e,t.clone(e))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===U&&d(e.children)){let n=ni(e.children,!1);n&&Qn(n,t)}}function $n(e){if(e.component)return $n(e.component.subTree);if(e.type===U){let t=d(e.children)&&ni(e.children,!1);return t?$n(t):void 0}if(e.type!==Vi)return e}function z(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function er(){let e=da();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function tr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function nr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var rr=new WeakMap;function ir(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>ir(e,n&&(d(n)?n[t]:n),r,a,o));return}if(or(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&ir(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?Ta(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=j(v),b=v===t?i:e=>!nr(_,e)&&u(y,e),x=(e,t)=>!(t&&nr(_,t));if(m!=null&&m!==p){if(ar(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(M(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))hn(p,f,12,[l,_]);else{let t=g(p),n=M(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),rr.delete(e)};t.id=-1,rr.set(e,t),H(t,r)}else ar(e),i()}}}function ar(e){let t=rr.get(e);t&&(t.flags|=8,rr.delete(e))}pe().requestIdleCallback,pe().cancelIdleCallback;var or=e=>!!e.type.__asyncLoader,sr=e=>e.type.__isKeepAlive;function cr(e,t){ur(e,`a`,t)}function lr(e,t){ur(e,`da`,t)}function ur(e,t,n=Z){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(fr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)sr(e.parent.vnode)&&dr(r,t,n,e),e=e.parent}}function dr(e,t,n,r){let i=fr(t,e,r,!0),a=fr(`um`,()=>c(r[t],i),n);a.flags=16}function fr(e,t,n=Z,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ze();let i=ma(n),a=gn(t,n,e,r);return i(),Qe(),a};return r?i.unshift(a):i.push(a),a}}var pr=e=>(t,n=Z)=>{_a&&e!==`sp`||fr(e,(...e)=>t(...e),n)},mr=pr(`bm`),hr=pr(`m`),gr=pr(`bu`),_r=pr(`u`),vr=pr(`bum`),yr=pr(`um`),br=pr(`sp`),xr=pr(`rtg`),Sr=pr(`rtc`);function Cr(e,t=Z){fr(`ec`,e,t)}var wr=Symbol.for(`v-ndc`);function B(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Jt(e),r=!1,s=!1;n&&(r=!Xt(e),s=Yt(e),e=ut(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?en($t(e[n])):$t(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(!Number.isInteger(e)||e<0)i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(v(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Tr(e,t,n,r,i,a){if(n??={},I.ce||I.parent&&or(I.parent)&&I.parent.ce){let e=a!=null&&n.key==null?s({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),W(),K(U,null,[J(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let c=Ui.length;W();let l;try{let i=o&&Er(o(n)),s=n.key||a||i&&i.key;l=K(U,{key:(s&&!_(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Ui.length;e>c;e--)Gi();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function Er(e){return e.some(e=>!Yi(e)||!(e.type===Vi||e.type===U&&!Er(e.children)))?e:null}var Dr=e=>e?ga(e)?Ta(e):Dr(e.parent):null,Or=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Dr(e.parent),$root:e=>Dr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Lr(e),$forceUpdate:e=>e.f||=()=>{Dn(e.update)},$nextTick:e=>e.n||=Tn.bind(e.proxy),$watch:e=>Gn.bind(e)}),kr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),Ar={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(kr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else Mr&&(s[n]=0)}let d=Or[n],f,p;if(d)return n===`$attrs`&&A(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return kr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||kr(n,c)||u(o,c)||u(i,c)||u(Or,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function jr(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var Mr=!0;function Nr(e){let t=Lr(e),n=e.proxy,i=e.ctx;Mr=!1,t.beforeCreate&&Fr(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:ee,destroyed:S,unmounted:te,render:C,renderTracked:ne,renderTriggered:re,errorCaptured:ie,serverPrefetch:w,expose:ae,inheritAttrs:oe,components:se,directives:ce,filters:le}=t;if(u&&Pr(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=Wt(t))}if(Mr=!0,o)for(let e in o){let t=o[e],a=Q({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)Ir(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{zn(t,e[t])})}f&&Fr(f,e,`c`);function T(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(T(mr,p),T(hr,m),T(gr,g),T(_r,_),T(cr,y),T(lr,b),T(Cr,ie),T(Sr,ne),T(xr,re),T(vr,ee),T(yr,te),T(br,w),d(ae)){if(ae.length){let t=e.exposed||={};ae.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===r&&(e.render=C),oe!=null&&(e.inheritAttrs=oe),se&&(e.components=se),ce&&(e.directives=ce),w&&tr(e)}function Pr(e,t,n=r){d(e)&&(e=Hr(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?Bn(r.from||n,r.default,!0):Bn(r.from||n):Bn(r),M(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Fr(e,t,n){gn(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ir(e,t,n,r){let i=r.includes(`.`)?Kn(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Un(i,n)}else if(h(e))Un(i,e.bind(n));else if(v(e)){if(d(e))e.forEach(e=>Ir(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Un(i,r,e)}}}function Lr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Rr(c,e,o,!0)),Rr(c,t,o)),v(t)&&a.set(t,c),c}function Rr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Rr(e,a,n,!0),i&&i.forEach(t=>Rr(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=zr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var zr={data:Br,props:Wr,emits:Wr,methods:Ur,computed:Ur,beforeCreate:V,created:V,beforeMount:V,mounted:V,beforeUpdate:V,updated:V,beforeDestroy:V,beforeUnmount:V,destroyed:V,unmounted:V,activated:V,deactivated:V,errorCaptured:V,serverPrefetch:V,components:Ur,directives:Ur,watch:Gr,provide:Br,inject:Vr};function Br(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function Vr(e,t){return Ur(Hr(e),Hr(t))}function Hr(e){if(d(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function V(e,t){return e?[...new Set([].concat(e,t))]:t}function Ur(e,t){return e?s(Object.create(null),e,t):t}function Wr(e,t){return e?d(e)&&d(t)?[...new Set([...e,...t])]:s(Object.create(null),jr(e),jr(t??{})):t}function Gr(e,t){if(!e)return t;if(!t)return e;let n=s(Object.create(null),e);for(let r in t)n[r]=V(e[r],t[r]);return n}function Kr(){return{app:null,config:{isNativeTag:i,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}}var qr=0;function Jr(e,t){return function(n,r=null){h(n)||(n=s({},n)),r!=null&&!v(r)&&(r=null);let i=Kr(),a=new WeakSet,o=[],c=!1,l=i.app={_uid:qr++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Da,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&h(e.install)?(a.add(e),e.install(l,...t)):h(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,s){if(!c){let u=l._ceVNode||J(n,r);return u.appContext=i,s===!0?s=`svg`:s===!1&&(s=void 0),o&&t?t(u,a):e(u,a,s),c=!0,l._container=a,a.__vue_app__=l,Ta(u.component)}},onUnmount(e){o.push(e)},unmount(){c&&(gn(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=Yr;Yr=l;try{return e()}finally{Yr=t}}};return l}}var Yr=null,Xr=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${w(t)}Modifiers`]||e[`${oe(t)}Modifiers`];function Zr(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&Xr(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=a.map(de)));let c,l=i[c=ce(n)]||i[c=ce(w(n))];!l&&o&&(l=i[c=ce(oe(n))]),l&&gn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,gn(u,e,6,a)}}var Qr=new WeakMap;function $r(e,t,n=!1){let r=n?Qr:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=$r(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function ei(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,oe(t))||u(e,t))}function ti(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=Ln(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=na(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=na(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:ri(c)}}catch(t){Ui.length=0,_n(t,e,1),v=J(Vi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=ii(y,a)),b=ta(b,y,!1,!0))}return n.dirs&&(b=ta(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Qn(Jn(b.type)&&Zn(b)||b,n.transition),v=b,Ln(_),v}function ni(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Yi(r)){if(r.type!==Vi||r.children===`v-if`){if(n)return;n=r}}else return}return n}var ri=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},ii=(e,t)=>{let n={};for(let r in e)o(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function ai(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?oi(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(si(o,r,n)&&!ei(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||oi(r,o,l):!!o;return!1}function oi(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(!u(e,a)||si(t,e,a)&&!ei(n,a))return!0}return!1}function si(e,t,n){let r=e[n],i=t[n];return n===`style`&&v(r)&&v(i)?!Ee(r,i):r!==i}function ci({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var li={},ui=()=>Object.create(li),di=e=>Object.getPrototypeOf(e)===li;function fi(e,t,n,r=!1){let i={},a=ui();e.propsDefaults=Object.create(null),mi(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Gt(i):e.type.props?i:a,e.attrs=a}function pi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=j(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(ei(e.emitsOptions,o))continue;let d=t[o];if(c){if(u(a,o))d!==a[o]&&(a[o]=d,l=!0);else{let t=w(o);i[t]=hi(c,s,t,d,e,!1)}}else d!==a[o]&&(a[o]=d,l=!0)}}}else{mi(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(u(t,a)||(r=oe(a))!==a&&u(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=hi(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&u(t,e)||(delete a[e],l=!0)}l&&ct(e.attrs,`set`,``)}function mi(e,n,r,i){let[a,o]=e.propsOptions,s=!1,c;if(n)for(let t in n){if(C(t))continue;let l=n[t],d;a&&u(a,d=w(t))?!o||!o.includes(d)?r[d]=l:(c||={})[d]=l:ei(e.emitsOptions,t)||t in i&&l===i[t]||(i[t]=l,s=!0)}if(o){let n=j(r),i=c||t;for(let t=0;t<o.length;t++){let s=o[t];r[s]=hi(a,n,s,i[s],e,!u(i,s))}}return s}function hi(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=u(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&h(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=ma(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===oe(n))&&(r=!0))}return r}var gi=new WeakMap;function _i(e,r,i=!1){let a=i?gi:r.propsCache,o=a.get(e);if(o)return o;let c=e.props,l={},f=[],p=!1;if(!h(e)){let t=e=>{p=!0;let[t,n]=_i(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;e<c.length;e++){let n=w(c[e]);vi(n)&&(l[n]=t)}else if(c)for(let e in c){let t=w(e);if(vi(t)){let n=c[e],r=l[t]=d(n)||h(n)?{type:n}:s({},n),i=r.type,a=!1,o=!0;if(d(i))for(let e=0;e<i.length;++e){let t=i[e],n=h(t)&&t.name;if(n===`Boolean`){a=!0;break}n===`String`&&(o=!1)}else a=h(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||u(r,`default`))&&f.push(t)}}let m=[l,f];return v(e)&&a.set(e,m),m}function vi(e){return e[0]!==`$`&&!C(e)}var yi=e=>e===`_`||e===`_ctx`||e===`$stable`,bi=e=>d(e)?e.map(na):[na(e)],xi=(e,t,n)=>{if(t._n)return t;let r=L((...e)=>bi(t(...e)),n);return r._c=!1,r},Si=(e,t,n)=>{let r=e._ctx;for(let n in e){if(yi(n))continue;let i=e[n];if(h(i))t[n]=xi(n,i,r);else if(i!=null){let e=bi(i);t[n]=()=>e}}},Ci=(e,t)=>{let n=bi(t);e.slots.default=()=>n},wi=(e,t,n)=>{for(let r in t)(n||!yi(r))&&(e[r]=t[r])},Ti=(e,t,n)=>{let r=e.slots=ui();if(e.vnode.shapeFlag&32){let e=t._;e?(wi(r,t,n),n&&ue(r,`_`,e,!0)):Si(t,r)}else t&&Ci(e,t)},Ei=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:wi(a,n,r):(o=!n.$stable,Si(n,a)),s=n}else n&&(Ci(e,n),s={default:1});if(o)for(let e in a)!yi(e)&&s[e]==null&&delete a[e]},H=zi;function Di(e){return Oi(e)}function Oi(e,i){let a=pe();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,r,i=null,a=null,o=null,s=void 0,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Xi(e,t)&&(i=Se(e),ve(e,a,o,!0),e=null),t.patchFlag===-2&&(l=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===n&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:u,ref:d,shapeFlag:f}=t;switch(u){case Bi:y(e,t,r,i);break;case Vi:b(e,t,r,i);break;case Hi:e??x(t,r,i,s);break;case U:se(e,t,r,i,a,o,s,c,l);break;default:f&1?te(e,t,r,i,a,o,s,c,l):f&6?ce(e,t,r,i,a,o,s,c,l):(f&64||f&128)&&u.process(e,t,r,i,a,o,s,c,l,we)}d!=null&&a?ir(d,e&&e.ref,o,t||e,!t):d==null&&e&&e.ref!=null&&ir(e.ref,null,o,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},ee=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},S=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},te=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ne(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),w(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ne=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&ie(e.children,d,null,r,i,ki(e,a),s,u),_&&Rn(e,null,r,`created`),re(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!C(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&oa(f,r,e)}_&&Rn(e,null,r,`beforeMount`);let v=ji(i,g);v?g.beforeEnter(d):g&&!g.persisted&&(d[Ri]=!0),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&H(()=>{try{f&&oa(f,r,e),v&&g.enter(d),_&&Rn(e,null,r,`mounted`)}finally{}},i)},re=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||Li(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;re(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},ie=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ra(e[l]):na(e[l]);v(null,c,t,n,r,i,a,o,s)}},w=(e,n,r,i,a,o,s)=>{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&Ai(r,!1),(g=h.onVnodeBeforeUpdate)&&oa(g,r,n,e),f&&Rn(n,e,r,`beforeUpdate`),r&&Ai(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ae(e.dynamicChildren,d,l,r,i,ki(n,a),o):s||me(e,n,l,null,r,i,ki(n,a),o,!1),u>0){if(u&16)oe(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==n.children&&p(l,n.children)}else!s&&d==null&&oe(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&H(()=>{g&&oa(g,r,n,e),f&&Rn(n,e,r,`updated`)},i)},ae=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el||Ii(c),d=u&&(c.type===U||!Xi(c,l)||c.shapeFlag&198)?m(u):n;v(c,l,d,null,r,i,a,o,!0)}},oe=(e,n,r,i,a)=>{if(n!==r){if(n!==t)for(let t in n)!C(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(C(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},se=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),ie(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ae(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Mi(e,t,!0)):me(e,t,n,f,i,a,s,c,l)},ce=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):le(t,n,r,i,a,o,c):ue(e,t,c)},le=(e,t,n,r,i,a,o)=>{let s=e.component=ua(e,r,i);if(sr(e)&&(s.ctx.renderer=we),va(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,de,o,a),!e.el){let r=s.subTree=J(Vi);b(null,r,t,n),e.placeholder=r.el}}else de(s,e,t,n,i,a,o)},ue=(e,t,n)=>{let r=t.component=e.component;if(ai(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,fe(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},de=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Pi(e);if(n){t&&(t.el=c.el,fe(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?H(t,i):l())};t.flags=48,H(t,i)});return}}let u=t,d;Ai(e,!1),t?(t.el=c.el,fe(e,t,o)):t=c,n&&T(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&oa(d,s,t,c),Ai(e,!0);let f=ti(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el||Ii(p)),Se(p),e,i,a),t.el=f.el,u===null&&ci(e,f.el),r&&H(r,i),(d=t.props&&t.props.onVnodeUpdated)&&H(()=>oa(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=or(t);if(Ai(e,!1),l&&T(l),!m&&(o=c&&c.onVnodeBeforeMount)&&oa(o,d,t),Ai(e,!0),s&&Ee){let t=()=>{e.subTree=ti(e),Ee(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=ti(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&H(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;H(()=>oa(o,d,e),i)}(t.shapeFlag&256||d&&or(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&H(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ie(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Dn(u),Ai(e,!0),l()},fe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,pi(e,t.props,r,n),Ei(e,t.children,n),Ze(),An(e),Qe()},me=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){ge(l,d,n,r,i,a,o,s,c);return}if(f&256){he(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&xe(l,i,a),d!==l&&p(n,d)):u&16?m&16?ge(l,d,n,r,i,a,o,s,c):xe(l,i,a,!0):(u&8&&p(n,``),m&16&&ie(d,n,r,i,a,o,s,c))},he=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p=0;for(;p<f;p++){let n=t[p]=l?ra(t[p]):na(t[p]);v(e[p],n,r,null,a,o,s,c,l)}u>d?xe(e,a,o,!0,!1,f):ie(t,r,i,a,o,s,c,l,f)},ge=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?ra(t[u]):na(t[u]);if(Xi(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?ra(t[p]):na(t[p]);if(Xi(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?ra(t[u]):na(t[u]),r,n,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)ve(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?ra(t[u]):na(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,ee=0,S=Array(b);for(u=0;u<b;u++)S[u]=0;for(u=m;u<=f;u++){let n=e[u];if(y>=b){ve(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(S[_-h]===0&&Xi(n,t[_])){i=_;break}i===void 0?ve(n,a,o,!0):(S[i-h]=u+1,i>=ee?ee=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let te=x?Ni(S):n;for(_=te.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1<d?f.el||Ii(f):i;S[u]===0?v(null,n,r,p,a,o,s,c,l):x&&(_<0||u!==te[_]?_e(n,r,p,2):_--)}}},_e=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)_e(e.component.subTree,t,n,r);else if(d&128)e.suspense.move(t,n,r);else if(d&64)c.move(e,t,n,we);else if(c===U){o(a,t,n);for(let e=0;e<u.length;e++)_e(u[e],t,n,r);o(e.anchor,t,n)}else if(c===Hi)ee(e,t,n);else if(r!==2&&d&1&&l){if(r===0)l.persisted&&!a[Yn]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),H(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Yn];a._isLeaving&&a[Yn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},ve=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(Ze(),ir(s,null,n,e,!0),Qe()),p==null||e.ctx&&e.ctx!==t||(t.renderCache[p]=void 0),u&256&&t.ctx.deactivate(e))return;let h=u&1&&f,g=!or(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&oa(_,t,e),u&6)be(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Rn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,we,r):l&&!l.hasOnce&&(a!==U||d>0&&d&64)?xe(l,t,n,!1,!0):(a===U&&d&384||!i&&u&16)&&xe(c,t,n),r&&E(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&H(()=>{_&&oa(_,t,e),h&&Rn(e,null,t,`unmounted`),v&&(e.el=null)},n)},E=e=>{let{type:t,el:n,anchor:r,transition:i}=e,a=t===U;if(a&&!i){ye(n,r);return}if(t===Hi){S(e),i&&!i.persisted&&i.afterLeave&&i.afterLeave();return}let o=a?$n(e):e,c=()=>{a?m(n)&&ye(n,r):s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(o&&o.shapeFlag&1&&i&&!i.persisted){let{leave:e,delayLeave:t}=i,n=o.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},ye=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},be=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Fi(c),Fi(l),r&&T(r),i.stop(),a?(a.flags|=8,ve(o,e,t,n)):o&&(o.transition=e.vnode.transition,ve(o,e,t,n)),s&&H(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,H(u,t)},xe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)ve(e[o],t,n,r,i)},Se=e=>{if(e.shapeFlag&6)return Se(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[qn];return n?h(n):t},Ce=(e,t,n)=>{Nn(()=>{e==null?t._vnode&&ve(t._vnode,null,null,!0):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:la())},we={p:v,um:ve,m:_e,r:E,mt:le,mc:ie,pc:me,pbc:ae,n:Se,o:e},Te,Ee;return i&&([Te,Ee]=i(we)),{render:Ce,hydrate:Te,createApp:Jr(Ce,Te)}}function ki({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ai({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ji(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Mi(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ra(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Mi(t,a)),a.type===Bi&&(a.patchFlag===-1&&(a=i[e]=ra(a)),a.el=t.el),a.type===Vi&&!a.el&&(a.el=t.el)}}function Ni(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Pi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Pi(t)}function Fi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ii(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return Ii(t.subTree);let n=e.suspense;return n&&n.activeBranch?Ii(n.activeBranch):null}var Li=e=>e.__isSuspense,Ri=Symbol(`_deferredEnter`);function zi(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):kn(e)}var U=Symbol.for(`v-fgt`),Bi=Symbol.for(`v-txt`),Vi=Symbol.for(`v-cmt`),Hi=Symbol.for(`v-stc`),Ui=[],Wi=null;function W(e=!1){Ui.push(Wi=e?null:[])}function Gi(){Ui.pop(),Wi=Ui[Ui.length-1]||null}var Ki=1;function qi(e,t=!1){Ki+=e,e<0&&Wi&&t&&(Wi.hasOnce=!0)}function Ji(e){return e.dynamicChildren=Ki>0?Wi||n:null,Gi(),Ki>0&&Wi&&Wi.push(e),e}function G(e,t,n,r,i,a){return Ji(q(e,t,n,r,i,a,!0))}function K(e,t,n,r,i){return Ji(J(e,t,n,r,i,!0))}function Yi(e){return e?e.__v_isVNode===!0:!1}function Xi(e,t){return e.type===t.type&&e.key===t.key}var Zi=({key:e})=>e??null,Qi=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||M(e)||h(e)?{i:I,r:e,k:t,f:!!n}:e);function q(e,t=null,n=null,r=0,i=null,a=e===U?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zi(t),ref:t&&Qi(t),scopeId:In,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:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:I};return s?(ia(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),Ki>0&&!o&&Wi&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Wi.push(c),c}var J=$i;function $i(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==wr||(e=Vi),Yi(e)){let r=ta(e,t,!0);return n&&ia(r,n),Ki>0&&!a&&Wi&&(r.shapeFlag&6?Wi[Wi.indexOf(e)]=r:Wi.push(r)),r.patchFlag=-2,r}if(Ea(e)&&(e=e.__vccOpts),t){t=ea(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=E(e)),v(n)&&(Zt(n)&&!d(n)&&(n=s({},n)),t.style=me(n))}let o=g(e)?1:Li(e)?128:Jn(e)?64:v(e)?4:h(e)?2:0;return q(e,t,n,r,i,o,a,!0)}function ea(e){return e?Zt(e)?s({},e):di(e)?s({},e[Sa]||e):e:null}function ta(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?aa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Zi(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Qi(t)):[a,Qi(t)]:Qi(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==U?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ta(e.ssContent),ssFallback:e.ssFallback&&ta(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Qn(u,c.clone(u)),u}function Y(e=` `,t=0){return J(Bi,null,e,t)}function X(e=``,t=!1){return t?(W(),K(Vi,null,e)):J(Vi,null,e)}function na(e){return e==null||typeof e==`boolean`?J(Vi):d(e)?J(U,null,e.slice()):Yi(e)?ra(e):J(Bi,null,String(e))}function ra(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ta(e)}function ia(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ia(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!di(t)?t._ctx=I:r===3&&I&&(I.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(h(t)){if(r&65){ia(e,{default:t});return}t={default:t,_ctx:I},n=32}else t=String(t),r&64?(n=16,t=[Y(t)]):n=8;e.children=t,e.shapeFlag|=n}function aa(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=E([t.class,r.class]));else if(e===`style`)t.style=me([t.style,r.style]);else if(a(e)){let n=t[e],i=r[e];i&&n!==i&&!(d(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!o(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function oa(e,t,n,r=null){gn(e,t,7,[n,r])}var sa=Kr(),ca=0;function la(){return ca}function ua(e,n,r){let i=e.type,a=(n?n.appContext:e.appContext)||sa,o={uid:ca++,vnode:e,type:i,parent:n,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Me(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(a.provides),ids:n?n.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:_i(i,a),emitsOptions:$r(i,a),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,suspense:r,suspenseId:r?r.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 o.ctx={_:o},o.root=n?n.root:o,o.emit=Zr.bind(null,o),e.ce&&e.ce(o),o}var Z=null,da=()=>Z||I,fa,pa;{let e=pe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};fa=t(`__VUE_INSTANCE_SETTERS__`,e=>Z=e),pa=t(`__VUE_SSR_SETTERS__`,e=>_a=e)}var ma=e=>{let t=Z;return fa(e),e.scope.on(),()=>{e.scope.off(),fa(t)}},ha=()=>{Z&&Z.scope.off(),fa(null)};function ga(e){return e.vnode.shapeFlag&4}var _a=!1;function va(e,t=!1,n=!1){t&&pa(t);let{props:r,children:i}=e.vnode,a=ga(e);fi(e,r,a,t),Ti(e,i,n||t);let o=a?ya(e,t):void 0;return t&&pa(!1),o}function ya(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ar);let{setup:r}=n;if(r){Ze();let n=e.setupContext=r.length>1?wa(e):null,i=ma(e),a=hn(r,e,0,[e.props,n]),o=y(a);if(Qe(),i(),(o||e.sp)&&!or(e)&&tr(e),o){if(a.then(ha,ha),t)return a.then(n=>{pa(!0);try{ba(e,n,t)}finally{pa(!1)}}).catch(t=>{_n(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(`<!---->`)});e.asyncDep=a}else ba(e,a,t)}else xa(e,t)}function ba(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=on(t)),xa(e,n)}function xa(e,t,n){let i=e.type;e.render||=i.render||r;{let t=ma(e);Ze();try{Nr(e)}finally{Qe(),t()}}}var Sa=Symbol(),Ca={get(e,t){return A(e,`get`,``),t===Sa?e:e[t]}};function wa(e){return{attrs:new Proxy(e.attrs,Ca),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ta(e){return e.exposed?e.exposeProxy||=new Proxy(on(Qt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Or)return Or[n](e)},has(e,t){return t in e||t in Or}}):e.proxy}function Ea(e){return h(e)&&`__vccOpts`in e}var Q=(e,t)=>cn(e,t,_a),Da=`3.5.47`,Oa=void 0,ka=typeof window<`u`&&window.trustedTypes;if(ka)try{Oa=ka.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Aa=Oa?e=>Oa.createHTML(e):e=>e,ja=`http://www.w3.org/2000/svg`,Ma=`http://www.w3.org/1998/Math/MathML`,Na=typeof document<`u`?document:null,Pa=Na&&Na.createElement(`template`),Fa={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Na.createElementNS(ja,e):t===`mathml`?Na.createElementNS(Ma,e):n?Na.createElement(e,{is:n}):Na.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Na.createTextNode(e),createComment:e=>Na.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Na.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Pa.innerHTML=Aa(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Pa.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ia=Symbol(`_vtc`);function La(e,t,n){let r=e[Ia];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ra=Symbol(`_vod`),za=Symbol(`_vsh`),Ba=Symbol(``),Va=/(?:^|;)\s*display\s*:/;function Ha(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t){if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Wa(r,t,``)}else for(let e in t)n[e]??Wa(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Wa(r,i,``):Ja(e,i,!g(t)&&t?t[i]:void 0,o)||Wa(r,i,o)}}else if(i){if(t!==n){let e=r[Ba];e&&(n+=`;`+e),r.cssText=n,a=Va.test(n)}}else t&&e.removeAttribute(`style`);Ra in e&&(i&&t===n||(e[Ra]=a?r.display:``),e[za]&&(r.display=`none`))}var Ua=/\s*!important$/;function Wa(e,t,n){if(d(n))n.forEach(n=>Wa(e,t,n));else if(n??=``,t.startsWith(`--`))Ua.test(n)?e.setProperty(t,n.replace(Ua,``),`important`):e.setProperty(t,n);else{let r=qa(e,t);Ua.test(n)?e.setProperty(oe(r),n.replace(Ua,``),`important`):e[r]=n}}var Ga=[`Webkit`,`Moz`,`ms`],Ka={};function qa(e,t){let n=Ka[t];if(n)return n;let r=w(t);if(r!==`filter`&&r in e)return Ka[t]=r;r=se(r);for(let n=0;n<Ga.length;n++){let i=Ga[n]+r;if(i in e)return Ka[t]=i}return t}function Ja(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&g(r)&&n===r}var Ya=`http://www.w3.org/1999/xlink`;function Xa(e,t,n,r,i,a=be(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Ya,t.slice(6,t.length)):e.setAttributeNS(Ya,t,n):n==null||a&&!xe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:_(n)?String(n):n)}function Za(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Aa(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);r===i&&`_value`in e||(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=xe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Qa(e,t,n,r){e.addEventListener(t,n,r)}function $a(e,t,n,r){e.removeEventListener(t,n,r)}var eo=Symbol(`_vei`);function to(e,t,n,r,i=null){let a=e[eo]||(e[eo]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=io(t);r?Qa(e,n,a[t]=co(r,i),s):o&&($a(e,n,o,s),a[t]=void 0)}}var no=/(Once|Passive|Capture)$/,ro=/^on:?(?:Once|Passive|Capture)$/;function io(e){let t,n;for(;(n=e.match(no))&&!ro.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):oe(e.slice(2)),t]}var ao=0,oo=Promise.resolve(),so=()=>ao||=(oo.then(()=>ao=0),Date.now());function co(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&gn(e,t,5,a)}}else gn(r,t,5,[e])};return n.value=e,n.attached=so(),n}var lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,uo=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?La(e,r,c):t===`style`?Ha(e,n,r):a(t)?o(t)||to(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):fo(e,t,r,c))?(Za(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Xa(e,t,r,c,s,t!==`value`)):e._isVueCE&&(po(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Za(e,w(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Xa(e,t,r,c))};function fo(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&lo(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return lo(t)&&g(n)?!1:t in e}function po(e,t){let n=e._def.props;if(!n)return!1;let r=w(t);return Array.isArray(n)?n.some(e=>w(e)===r):Object.keys(n).some(e=>w(e)===r)}var mo=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>T(t,e):t};function ho(e){e.target.composing=!0}function go(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var _o=Symbol(`_assign`),vo=Symbol(`_initialValue`);function yo(e,t,n){return t&&(e=e.trim()),n&&(e=de(e)),e}var bo={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[vo]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[vo]=e.defaultValue.replace(/\r\n?/g,`
2
+ `))),e[_o]=mo(i);let a=r||i.props&&i.props.type===`number`;Qa(e,t?`change`:`input`,t=>{t.target.composing||e[_o](yo(e.value,n,a))}),(n||a)&&Qa(e,`change`,()=>{e.value=yo(e.value,n,a)}),t||(Qa(e,`compositionstart`,ho),Qa(e,`compositionend`,go),Qa(e,`change`,go))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[vo];delete e[vo],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[_o](yo(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[_o]=mo(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?de(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},xo={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[_o]=mo(n),Qa(e,`change`,()=>{e[_o](To(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[_o]=mo(r),t!==n&&(e.checked=Ee(t,r.props.value))}},So={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Qa(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?de(To(e)):To(e)),r=e.multiple,i=r?p(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?d(i)?t.slice():t:i];try{e[_o](i)}finally{Tn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[_o]=mo(r)},mounted(e,{value:t,modifiers:{number:n}}){wo(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[_o]=mo(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&Co(t,r[1],r[0])||wo(e,t,n)}};function Co(e,t,n){if(!n||d(e))return Ee(e,t);if(p(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function wo(e,t,n=!1){let r=e.multiple,i=d(t);if(!r||i||p(t)){for(let a=0,o=e.options.length;a<o;a++){let o=e.options[a],s=To(o);if(r){if(i){let e=typeof s;o.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(s)):De(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(de(s))}else if(Ee(To(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function To(e){return`_value`in e?e._value:e.value}var Eo=[`ctrl`,`shift`,`alt`,`meta`],Do={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Eo.some(n=>e[`${n}Key`]&&!t.includes(n))},Oo=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Do[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ko=s({patchProp:uo},Fa),Ao;function jo(){return Ao||=Di(ko)}var Mo=((...e)=>{let t=jo().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Po(e);if(!r)return;let i=t._component;h(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,No(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function No(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Po(e){return g(e)?document.querySelector(e):e}var Fo=`296 62 430 108`,Io=`300 62 124 110`,Lo=4.5,Ro=[`M336.89 111.56C337.43 111.4 339.26 111.03 340.5 110.5C341.74 109.97 343.04 108.72 345.17 108C347.29 107.28 351.42 105.97 354.67 105.67C357.92 105.37 363.86 105.65 366.83 106C369.81 106.35 372.7 107.42 374.5 108C376.3 108.58 377.61 109.56 378.83 109.83C380.06 110.11 381.87 110.21 382.67 109.83C383.47 109.46 383.87 108.21 384.17 107.33C384.47 106.46 384.64 104.72 384.67 104C384.69 103.28 385.33 103.22 384.33 102.5C383.33 101.78 379.93 100.34 378 99.17C376.07 97.99 373.1 95.97 371.5 94.67C369.9 93.37 368.68 92.3 367.33 90.5C365.98 88.7 363.4 84.77 362.5 82.67C361.6 80.57 361.46 77.5 361.33 76.5C361.21 75.5 361.09 76.08 361.67 76C362.24 75.92 363.79 75.72 365.17 76C366.54 76.28 368.93 76.98 370.83 77.83C372.73 78.68 375.86 80.32 377.83 81.67C379.81 83.02 382.35 85.21 384 86.83C385.65 88.46 387.58 90.85 388.83 92.5C390.08 94.15 390.43 96.71 392.33 97.83C394.23 98.96 399.38 99.22 401.5 100C403.63 100.78 405.18 101.95 406.5 103C407.82 104.05 409.23 105.58 410.33 107C411.43 108.42 413.33 110.95 413.83 112.5C414.33 114.05 414.09 116.13 413.67 117.33C413.24 118.53 411.93 119.78 411 120.5C410.07 121.22 408.73 121.87 407.5 122.17C406.27 122.47 404.31 122.28 402.83 122.5C401.36 122.72 399.81 122.4 397.67 123.67C395.52 124.93 389.89 129.84 388.52 130.93`,`M388.52 130.93C389.84 131.32 394.31 131.96 397.33 133.5C400.35 135.04 406.67 139.69 408.67 141.17C410.67 142.64 410.32 142.58 410.67 143.33C411.02 144.08 411.02 145.44 411 146.17C410.98 146.89 411 147.67 410.5 148.17C410 148.67 408.54 149.4 407.67 149.5C406.79 149.6 407.19 150.08 404.67 148.83C402.14 147.58 394.86 142.99 390.83 141.17C386.81 139.34 381.46 137.54 377.83 136.67C374.21 135.79 369.24 135.46 366.67 135.33C364.09 135.21 361.57 135.76 360.67 135.83`,`M331 120.88C330.77 122.84 330.2 131.76 329.5 134C328.8 136.24 327.63 135.48 326.33 135.83C325.03 136.18 321.88 136.16 320.83 136.33C319.78 136.51 320.86 134.7 319.33 137C317.81 139.3 312.07 149.12 310.67 151.67C309.27 154.22 310.05 153.32 310 154C309.95 154.68 310.08 155.59 310.33 156.17C310.58 156.74 311.19 157.51 311.67 157.83C312.14 158.16 312.85 158.31 313.5 158.33C314.15 158.36 315.43 158.22 316 158C316.57 157.78 316.58 157.86 317.33 156.83C318.08 155.81 319.82 152.74 321 151.17C322.18 149.59 323.29 147.16 325.17 146.33C327.04 145.51 331.23 146.02 333.5 145.67C335.77 145.32 338.76 144.53 340.33 144C341.91 143.47 342.95 142.82 344 142.17C345.05 141.52 346.18 140.94 347.33 139.67C348.48 138.39 350.72 135.57 351.67 133.67C352.62 131.77 353.34 128.4 353.67 127C353.99 125.6 353.81 124.73 353.83 124.33`,`M336.89 111.56C336.46 111.1 334.91 109.08 334 108.5C333.09 107.92 331.81 107.72 330.83 107.67C329.86 107.62 328.45 107.67 327.5 108.17C326.55 108.67 325.05 110.03 324.5 111C323.95 111.97 323.81 113.67 323.83 114.67C323.86 115.67 324.24 116.89 324.67 117.67C325.09 118.44 325.72 119.35 326.67 119.83C327.62 120.31 330.35 120.72 331 120.88`,`M336.89 111.56C336.73 112.02 336.52 113.42 335.83 114.67C335.15 115.91 333.06 118.9 332.33 119.83C331.61 120.76 331.2 120.72 331 120.88`],zo=`M454.72 144L447.01 144L447.01 94.02L454.72 94.02L454.72 115.44L475.72 115.44L475.72 94.02L483.43 94.02L483.43 144L475.72 144L475.72 122.44L454.72 122.44L454.72 144M510.56 145Q505.27 145 501.17 142.82Q497.06 140.64 494.71 136.57Q492.35 132.50 492.35 126.94L492.35 125.86Q492.35 120.30 494.71 116.26Q497.06 112.23 501.17 110.01Q505.27 107.80 510.56 107.80Q515.84 107.80 519.98 110.01Q524.12 112.23 526.48 116.26Q528.84 120.30 528.84 125.86L528.84 126.94Q528.84 132.50 526.48 136.57Q524.12 140.64 519.98 142.82Q515.84 145 510.56 145M510.56 138.43Q515.41 138.43 518.45 135.32Q521.48 132.22 521.48 126.72L521.48 126.08Q521.48 120.58 518.48 117.47Q515.48 114.37 510.56 114.37Q505.77 114.37 502.74 117.47Q499.71 120.58 499.71 126.08L499.71 126.72Q499.71 132.22 502.74 135.32Q505.77 138.43 510.56 138.43M545.33 158.28L537.98 158.28L537.98 108.80L545.19 108.80L545.19 113.87L546.33 113.87Q547.69 111.51 550.44 109.66Q553.18 107.80 558.32 107.80Q562.75 107.80 566.43 109.94Q570.11 112.08 572.35 116.12Q574.60 120.15 574.60 125.86L574.60 126.94Q574.60 132.65 572.39 136.68Q570.18 140.72 566.46 142.86Q562.75 145 558.32 145Q554.90 145 552.54 144.14Q550.19 143.29 548.76 141.97Q547.33 140.64 546.47 139.22L545.33 139.22L545.33 158.28M556.18 138.57Q561.04 138.57 564.11 135.50Q567.18 132.43 567.18 126.72L567.18 126.08Q567.18 120.44 564.07 117.37Q560.97 114.30 556.18 114.30Q551.47 114.30 548.36 117.37Q545.26 120.44 545.26 126.08L545.26 126.72Q545.26 132.43 548.36 135.50Q551.47 138.57 556.18 138.57M599.52 144L587.17 144L581.17 108.80L588.53 108.80L592.95 139.07L594.10 139.07L600.24 108.80L612.16 108.80L618.23 139.07L619.37 139.07L623.80 108.80L631.15 108.80L625.16 144L612.80 144L606.73 113.80L605.59 113.80L599.52 144M647.22 144L639.86 144L639.86 108.80L647.22 108.80L647.22 144M643.58 104.02Q641.43 104.02 639.97 102.62Q638.51 101.23 638.51 99.02Q638.51 96.80 639.97 95.41Q641.43 94.02 643.58 94.02Q645.79 94.02 647.22 95.41Q648.65 96.80 648.65 99.02Q648.65 101.23 647.22 102.62Q645.79 104.02 643.58 104.02M665.50 144L658.14 144L658.14 108.80L665.35 108.80L665.35 112.94L666.50 112.94Q667.35 110.73 669.24 109.69Q671.14 108.66 673.92 108.66L678.13 108.66L678.13 115.30L673.64 115.30Q670.07 115.30 667.78 117.26Q665.50 119.22 665.50 123.29L665.50 144M700.63 145Q695.27 145 691.27 142.75Q687.27 140.50 685.02 136.40Q682.77 132.29 682.77 126.86L682.77 126.01Q682.77 120.51 684.99 116.40Q687.20 112.30 691.16 110.05Q695.13 107.80 700.34 107.80Q705.41 107.80 709.23 110.05Q713.05 112.30 715.19 116.30Q717.33 120.30 717.33 125.65L717.33 128.43L690.27 128.43Q690.41 133.08 693.38 135.82Q696.34 138.57 700.77 138.57Q704.91 138.57 707.02 136.72Q709.12 134.86 710.26 132.43L716.33 135.57Q715.33 137.57 713.44 139.79Q711.55 142 708.48 143.50Q705.41 145 700.63 145M690.34 122.79L709.84 122.79Q709.55 118.80 706.98 116.55Q704.41 114.30 700.27 114.30Q696.13 114.30 693.52 116.55Q690.91 118.80 690.34 122.79`,Bo=[`id`],Vo=[`id`],Ho=[`fill`],Uo=[`mask`],Wo={class:`hwx-wire`},Go=[`cx`],Ko={class:`hwx-hop`},qo=[`stroke-width`],Jo=[`d`],Yo=z({__name:`HopLoader`,props:{active:{type:Boolean}},setup(e){let t=Array.from({length:9},(e,t)=>-128+t*64),n=er(),r=er();return(i,a)=>(W(),G(`svg`,{viewBox:`0 0 256 150`,"aria-hidden":`true`,focusable:`false`,class:E([`block h-auto`,e.active?`hwx-run`:void 0])},[q(`defs`,null,[q(`linearGradient`,{id:P(r),x1:`0`,x2:`1`,y1:`0`,y2:`0`},[...a[0]||=[q(`stop`,{offset:`0`,"stop-color":`#000`},null,-1),q(`stop`,{offset:`.22`,"stop-color":`#fff`},null,-1),q(`stop`,{offset:`.78`,"stop-color":`#fff`},null,-1),q(`stop`,{offset:`1`,"stop-color":`#000`},null,-1)]],8,Bo),q(`mask`,{id:P(n),maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`256`,height:`150`},[q(`rect`,{width:`256`,height:`150`,fill:`url(#${P(r)})`},null,8,Ho)],8,Vo)]),q(`g`,{mask:`url(#${P(n)})`},[q(`g`,Wo,[a[1]||=q(`line`,{class:`stroke-muted`,x1:`-192`,y1:`122`,x2:`448`,y2:`122`,"stroke-width":`1.5`},null,-1),(W(!0),G(U,null,B(P(t),e=>(W(),G(`circle`,{key:e,class:`fill-ground stroke-muted`,cx:e,cy:`122`,r:`3.4`,"stroke-width":`1.5`},null,8,Go))),128))]),a[2]||=q(`circle`,{class:`hwx-lit1 fill-hop-green`,cx:`128`,cy:`122`,r:`4.6`},null,-1),a[3]||=q(`circle`,{class:`hwx-lit2 fill-hop-green`,cx:`64`,cy:`122`,r:`4.6`},null,-1),a[4]||=q(`circle`,{class:`hwx-lit3 fill-hop-green`,cx:`0`,cy:`122`,r:`4.6`},null,-1)],8,Uo),a[5]||=q(`circle`,{class:`hwx-ring stroke-green-text`,cx:`128`,cy:`122`,r:`5`,fill:`none`,"stroke-width":`1.5`},null,-1),q(`g`,Ko,[q(`g`,{transform:`translate(-132.64 10.80) scale(0.72)`,class:`stroke-mark`,fill:`none`,"stroke-width":P(Lo),"stroke-linecap":`round`,"stroke-linejoin":`round`},[(W(!0),G(U,null,B(P(Ro),(e,t)=>(W(),G(`path`,{key:t,d:e},null,8,Jo))),128))],8,qo)])],2))}}),Xo={class:`flex h-full flex-col items-center justify-center gap-4 p-8 text-center`,role:`status`},Zo={class:`text-sm text-muted`},Qo=z({__name:`ConnectingState`,props:{connecting:{type:Boolean}},setup(e){return(t,n)=>(W(),G(`div`,Xo,[J(Yo,{class:`w-44`,active:e.connecting},null,8,[`active`]),q(`p`,Zo,D(e.connecting?`Connecting to the tunnel`:`Not connected to the tunnel`),1)]))}}),$o={connecting:`Connecting`,live:`Live`,reconnecting:`Reconnecting`,closed:`Disconnected`};function es(e,t){return e?`closed`:t?`reconnecting`:`connecting`}function ts(e){return e===`connecting`||e===`reconnecting`}function ns(){let e=N(!1),t;async function n(n){try{await navigator.clipboard.writeText(n)}catch{return}e.value=!0,clearTimeout(t),t=setTimeout(()=>{e.value=!1},1500)}return vr(()=>clearTimeout(t)),{copied:e,copy:n}}var rs=[`aria-label`],is={"aria-live":`polite`},as=z({__name:`CopyButton`,props:{text:{},label:{}},setup(e){let{copied:t,copy:n}=ns();return(r,i)=>(W(),G(`button`,{type:`button`,class:`shrink-0 cursor-pointer rounded-sm px-1.5 py-0.5 text-xs font-medium text-tag-fg transition-colors duration-150 ease-out hover:bg-ink/8 hover:text-ink`,"aria-label":e.label,onClick:i[0]||=t=>P(n)(e.text)},[q(`span`,is,D(P(t)?`Copied`:`Copy`),1)],8,rs))}}),os={class:`flex h-full items-center justify-center overflow-y-auto p-8`},ss={class:`w-full max-w-2xl`},cs={key:0,class:`mt-2 text-sm text-muted`},ls={class:`mt-4 flex items-start gap-2 rounded-md border border-hairline bg-well p-3`},us={class:`min-w-0 flex-1 text-xs leading-5 break-all text-ink`},ds={class:`mt-4 text-sm text-muted`},fs={class:`font-mono text-xs text-ink`},ps={class:`font-mono text-xs text-ink`},ms={key:2,class:`mt-2 text-sm text-muted`},hs=z({__name:`EmptyState`,props:{status:{},stream:{}},setup(e){let t=e,n=Q(()=>t.status?.services.find(e=>e.entryUrl!==null)??null),r=Q(()=>n.value===null?null:`curl -X POST ${n.value.entryUrl}/hello -H 'content-type: application/json' -d '{"hello":"hopwire"}'`);return(t,i)=>(W(),G(`div`,os,[q(`div`,ss,[J(Yo,{class:`mb-6 w-44`,active:P(ts)(e.stream)},null,8,[`active`]),i[5]||=q(`h2`,{class:`text-subheading`},`No requests yet`,-1),e.status?.watching?(W(),G(`p`,cs,` This inspector follows a shared traffic log. Requests show up here as soon as your teammate's tunnel receives them. `)):n.value&&r.value?(W(),G(U,{key:1},[i[4]||=q(`p`,{class:`mt-2 text-sm text-muted`},` Send a request to the entry point and it appears here right away, no reload needed: `,-1),q(`div`,ls,[q(`code`,us,[i[0]||=q(`span`,{class:`text-muted select-none`},`$ `,-1),Y(D(r.value),1)]),J(as,{text:r.value,label:`Copy curl command`},null,8,[`text`])]),q(`p`,ds,[i[1]||=Y(` Everything sent to `,-1),q(`span`,fs,D(n.value.entryUrl),1),i[2]||=Y(` is forwarded to `,-1),q(`span`,ps,D(n.value.target),1),i[3]||=Y(` and recorded in the traffic log. Point your webhook sender or client at the entry point instead of the service. `,-1)])],64)):(W(),G(`p`,ms,`Waiting for the tunnel.`))])]))}});function gs(e){return e.response.status===101}var _s=[[/^(emergency|alert|critical|crit|error|err|fatal)$/i,`error`],[/^(warning|warn)$/i,`warning`],[/^(notice|info)$/i,`info`],[/^(debug|trace)$/i,`debug`]];function vs(e){let t=e.slice(0,2048).split(`
3
+ `,1)[0]??``,n=/\.(EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG):/.exec(t)?.[1]??/"(?:level|level_name|severity)"\s*:\s*"([A-Za-z]+)"/.exec(t)?.[1]??/^\S*\s*\[?\b(FATAL|ERROR|ERR|WARN|WARNING|INFO|DEBUG|TRACE)\b\]?/.exec(t.replace(/^\[[^\]]*\]\s*/,``))?.[1];if(n===void 0)return null;for(let[e,t]of _s)if(e.test(n))return t;return null}var ys=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t}},bs=`api/`;async function xs(e,t){let n;try{n=await fetch(e,t)}catch{throw new ys(0,`unreachable`,`The tunnel does not answer. Is it still running?`)}if(!n.ok){let e=await n.json().catch(()=>null);throw new ys(n.status,typeof e?.error==`string`?e.error:`unknown`,typeof e?.message==`string`?e.message:`The inspector answered ${n.status}.`)}return await n.json()}function Ss(){return xs(`${bs}status`)}function Cs(e){let t=new URLSearchParams({origin:e.origin,limit:String(e.limit)});return e.before!==void 0&&t.set(`before`,String(e.before)),xs(`${bs}exchanges?${t.toString()}`)}async function ws(e,t){let n=[],r=null;for(;;){let i=new URLSearchParams({origin:e});r!==null&&i.set(`after`,String(r));let a=await xs(`${bs}ws-messages/${encodeURIComponent(t)}?${i.toString()}`);n.push(...a.blocks);let o=a.blocks.at(-1);if(!a.more||o===void 0)return n;r=o.seq}}function Ts(e){let t=new URLSearchParams;return e.exchangeId!==void 0&&t.set(`exchangeId`,e.exchangeId),e.origin!==void 0&&t.set(`origin`,e.origin),e.limit!==void 0&&t.set(`limit`,String(e.limit)),xs(`${bs}log-entries?${t.toString()}`)}function Es(e,t){let n=new URLSearchParams({origin:e.origin,index:String(e.index)});return xs(`${bs}replay/${encodeURIComponent(e.exchange.id)}?${n.toString()}`,{method:`POST`,...t===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(t)}})}function Ds(e){return e>=200&&e<300?`success`:e>=300&&e<400?`info`:e>=400&&e<500?`warning`:e>=500&&e<600?`danger`:`neutral`}var Os={success:`bg-ok-bg text-ok-fg`,info:`bg-info-bg text-info-fg`,warning:`bg-warn-bg text-warn-fg`,danger:`bg-err-bg text-err-fg`,neutral:`bg-tag-bg text-tag-fg`},ks={local:`local`,replay:`replay`,p2p_peer:`peer`,public_edge:`public`};function As(e){return ks[e]}function js(e){return e<1e3?`${e} ms`:`${(e/1e3).toFixed(e<1e4?2:1)} s`}function Ms(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} kB`:`${(e/1048576).toFixed(1)} MB`}function Ns(e,t){return t?`Binary body; the log keeps its first ${Ms(e)}. It is not shown.`:`Binary body of ${Ms(e)}. It is not shown, but it is replayed as captured.`}function Ps(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function Fs(e){return e.length<=20?e:`${e.slice(0,10)}...${e.slice(-6)}`}function Is(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Ls(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Rs(e){return Ls(new TextEncoder().encode(e))}function zs(e,t){let n=new TextDecoder(`utf-8`,{fatal:!0});for(let r=0;r<=(t?3:0)&&r<e.length;r++)try{let t=n.decode(e.subarray(0,e.length-r));return t.includes(`\0`)?null:t}catch{}return null}function Bs(e){let t=e.trim();if(t===``)return null;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}}function Vs(e,t=!1){if(e===``)return{kind:`empty`};let n=Is(e),r=zs(n,t);if(r===null)return{kind:`binary`,bytes:n.length};let i=Bs(r);return i!==null&&/^\s*[[{]/.test(r)?{kind:`json`,text:r,formatted:i,bytes:n.length}:{kind:`text`,text:r,bytes:n.length}}function Hs(e,t){return`${e}:${t}`}function Us(e,t){let n=new Map;for(let r of[...e,...t])n.set(r.seq,r);return[...n.values()].sort((e,t)=>e.seq-t.seq)}function Ws(e){return{messages:e.flatMap(e=>e.messages).map((e,t)=>({...e,position:t})),close:e.find(e=>e.close!==void 0)?.close??null}}function Gs(e){if(!e.binary){let t=Vs(e.dataBase64,e.truncated);if(t.kind===`json`)return{kind:`json`,text:t.text,formatted:t.formatted};if(t.kind===`text`)return{kind:`text`,text:t.text};if(t.kind===`empty`)return{kind:`text`,text:``}}let t=Is(e.dataBase64);return{kind:`binary`,hex:Array.from(t.subarray(0,256),e=>e.toString(16).padStart(2,`0`)).join(` `),more:t.length>256}}function Ks(e,t){let n=t.text.trim().toLowerCase();return e.filter(e=>{if(t.direction!==``&&e.direction!==t.direction)return!1;if(n===``)return!0;let r=Gs(e);return r.kind!==`binary`&&r.text.toLowerCase().includes(n)})}function qs(e){switch(e){case`client`:return`the client`;case`service`:return`the service`;case`hopwire`:return`Hopwire`}return e}function Js(e){return e.some(e=>e.direction===`in`&&e.truncated)?`A client message was captured only in part. Use Edit & Replay to replace or remove it.`:null}var Ys=0;function Xs(e=``){return Ys+=1,{key:Ys,binary:!1,text:e,dataBase64:``,length:0,truncated:!1}}function Zs(e,t,n){return{path:e,headers:t.map(([e,t])=>({name:e,value:t})),messages:n.filter(e=>e.direction===`in`).map(e=>{Ys+=1;let t=e.binary?null:Gs(e),n=t!==null&&t.kind!==`binary`;return{key:Ys,binary:!n,text:n?t.text:``,dataBase64:e.dataBase64,atMs:e.atMs,length:e.length,truncated:e.truncated}}),timing:`recorded`}}var Qs=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function $s(e){if(!/^\/\S*$/.test(e.path))return`The path must start with / and must not contain spaces.`;for(let t of e.headers)if(t.name.trim()!==``||t.value.trim()!==``){if(!Qs.test(t.name.trim()))return`"${t.name}" is not a valid header name.`;if(/[\r\n]/.test(t.value))return`The value of ${t.name.trim()} must be a single line.`}return e.messages.some(e=>e.binary&&e.truncated)?`A binary message was captured only in part and cannot be sent. Remove it to replay the rest.`:null}function ec(e){let t=e.messages.map(e=>({binary:e.binary,dataBase64:e.binary?e.dataBase64:Rs(e.text),...e.atMs===void 0?{}:{atMs:e.atMs}}));return{path:e.path,headers:e.headers.filter(e=>e.name.trim()!==``).map(e=>[e.name.trim(),e.value.trim()]),messages:t,timing:e.timing}}var tc=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`],nc=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function rc(e){let{request:t}=e,n=Vs(t.bodyBase64,t.bodyTruncated);return{method:t.method.toUpperCase(),path:t.path,headers:t.headers.map(([e,t])=>({name:e,value:t})),body:n.kind===`json`||n.kind===`text`?n.text:``,bodyEditable:n.kind!==`binary`}}function ic(e,t){if(!nc.test(e.method.trim()))return`Enter a method such as GET or POST.`;if(!/^\/\S*$/.test(e.path))return`The path must start with / and must not contain spaces.`;for(let t of e.headers)if(t.name.trim()!==``||t.value.trim()!==``){if(!nc.test(t.name.trim()))return`"${t.name}" is not a valid header name.`;if(/[\r\n]/.test(t.value))return`The value of ${t.name.trim()} must be a single line.`}return!e.bodyEditable&&t.request.bodyTruncated?`The stored body is binary and was truncated, so this request cannot be replayed.`:null}function ac(e){let t=e.headers.filter(e=>e.name.trim()!==``).map(e=>[e.name.trim(),e.value.trim()]);return{method:e.method.trim().toUpperCase(),path:e.path,headers:t,...e.bodyEditable?{bodyBase64:Rs(e.body)}:{}}}function oc(e,t){return e===null?`The inspector is not connected to the tunnel.`:e.watching?e.replayTarget===null?`Replay is off because this watch has no replay target. Start hopwire watch with --replay-target <url>.`:null:e.services.some(e=>e.name===t.serviceName)?null:`The service "${t.serviceName}" is not part of this tunnel, so there is nothing to replay to.`}function sc(e,t,n=[]){let r=oc(e,t);if(r!==null)return{replay:r,editAndReplay:r};if(gs(t))return{replay:Js(n),editAndReplay:null};let{request:i}=t;if(!i.bodyTruncated)return{replay:null,editAndReplay:null};if(Vs(i.bodyBase64,!0).kind===`binary`){let e=`The stored body is binary and was truncated, so this request cannot be replayed.`;return{replay:e,editAndReplay:e}}return{replay:`The stored body was truncated. Use Edit & Replay to supply the body.`,editAndReplay:null}}function cc(e,t){return e===null?null:e.watching?e.replayTarget:e.services.find(e=>e.name===t.serviceName)?.target??null}function lc(e){return e.replayTarget===null?e.watching?{text:`none: start hopwire watch with --replay-target <url>`,missing:!0}:e.services.length>1?{text:`the local target of each service`,missing:!1}:{text:`none`,missing:!0}:{text:e.replayTarget,missing:!1}}var uc=2e3;function dc(e){return e.flatMap(({origin:e,block:t})=>t.entries.map(n=>({key:`${e}:${t.serviceName}:${t.source}:${t.seq}:${n.readAt}:${n.length}:${n.text.slice(0,200)}`,origin:e,serviceName:t.serviceName,source:t.source,entry:n,level:vs(n.text)})))}function fc(e,t,n=uc){let r=new Map(e.map(e=>[e.key,e])),i=!1;for(let e of t)r.has(e.key)||(r.set(e.key,e),i=!0);if(!i)return e;let a=[...r.values()].sort((e,t)=>e.entry.readAt-t.entry.readAt);return a.length>n?a.slice(a.length-n):a}function pc(e){return e.reduce((e,{block:t})=>({entries:e.entries+(t.omitted?.entries??0),bytes:e.bytes+(t.omitted?.bytes??0)}),{entries:0,bytes:0})}function mc(e,t,n){return e.filter(e=>e.origin===t&&e.entry.exchangeIds.includes(n))}function hc(e,t){let n=t.text.trim().toLowerCase();return e.filter(e=>(t.source===``||e.source===t.source)&&(t.level===``||e.level===t.level)&&(n===``||e.entry.text.toLowerCase().includes(n)))}var gc=/^\s*(#\d+\s|at\s)/,_c=/[/\\](vendor|node_modules|site-packages)[/\\]/;function vc(e){return e.split(`
4
+ `).map(e=>({text:e,appFrame:gc.test(e)&&!_c.test(e)}))}var yc={error:`Error`,warning:`Warning`,info:`Info`,debug:`Debug`},bc={class:`space-y-2`,"aria-live":`polite`},xc=[`onClick`],Sc={class:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted`},Cc={class:`font-mono text-tag-fg`},wc={class:`tabular-nums`},Tc={key:1,class:`rounded-full bg-info-bg px-2 py-0.5 text-info-fg`},Ec={key:2,class:`text-warn-fg`},Dc={key:3,class:`text-warn-fg`},Oc={key:4},kc={key:0,class:`mt-2 rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},Ac={class:`mt-2 max-h-80 overflow-auto font-mono text-xs leading-5 break-words whitespace-pre-wrap text-muted`},jc=z({__name:`LogEntryList`,props:{items:{},exchangeId:{default:null},selectable:{type:Boolean,default:!1}},emits:[`select`],setup(e,{emit:t}){let n=t,r={error:`bg-err-bg text-err-fg`,warning:`bg-warn-bg text-warn-fg`,info:`bg-info-bg text-info-fg`,debug:`bg-tag-bg text-tag-fg`};function i(e,t){return e.entry.exchangeIds.filter(e=>e!==t).length}return(t,a)=>(W(),G(`ol`,bc,[(W(!0),G(U,null,B(e.items,t=>(W(),G(`li`,{key:t.key,class:E([`rounded-sm border border-hairline bg-surface p-3`,e.selectable&&t.entry.exchangeIds.length>0?`cursor-pointer hover:border-line-strong`:``]),onClick:r=>e.selectable&&t.entry.exchangeIds.length>0&&n(`select`,t)},[q(`div`,Sc,[t.level?(W(),G(`span`,{key:0,class:E([`rounded-sm px-1.5 py-0.5 font-medium`,r[t.level]])},D(P(yc)[t.level]),3)):X(``,!0),q(`span`,Cc,D(t.source),1),q(`span`,wc,D(P(Ps)(t.entry.readAt)),1),t.origin===`remote`?(W(),G(`span`,Tc,` watching `)):X(``,!0),t.entry.ambiguous&&e.exchangeId!==null?(W(),G(`span`,Ec,` also linked to `+D(i(t,e.exchangeId))+` other `+D(i(t,e.exchangeId)===1?`request`:`requests`),1)):t.entry.ambiguous?(W(),G(`span`,Dc,` logged while `+D(t.entry.exchangeIds.length)+` requests were in flight `,1)):e.selectable&&t.entry.exchangeIds.length===0?(W(),G(`span`,Oc,`not linked to a request`)):X(``,!0)]),t.entry.truncated?(W(),G(`p`,kc,` Truncated: the log keeps the first `+D(P(Ms)(16384))+` of this entry of `+D(P(Ms)(t.entry.length))+`. `,1)):X(``,!0),q(`pre`,Ac,[(W(!0),G(U,null,B(P(vc)(t.entry.text),(e,t)=>(W(),G(`span`,{key:t,class:E(e.appFrame||t===0?`text-ink`:``)},D(e.text)+D(`
5
+ `),3))),128))])],10,xc))),128))]))}}),Mc={class:`space-y-6`},Nc={key:0,class:`mt-2 text-sm text-muted`},Pc={key:1,class:`mt-2 w-full table-fixed border-collapse text-left font-mono text-xs`},Fc={scope:`row`,class:`w-2/5 py-1.5 pr-3 font-normal break-words text-muted`},Ic={class:`py-1.5 break-all text-ink`},Lc={class:`flex items-center gap-3`},Rc={key:0,class:`text-xs text-muted`},zc={key:0,class:`mt-2 rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},Bc={key:1,class:`mt-2 text-sm text-muted`},Vc={key:2,class:`mt-2 text-sm text-muted`},Hc={key:3,class:`mt-2 max-h-[60vh] overflow-auto rounded-sm border border-hairline bg-surface p-3 font-mono text-xs leading-5 break-words whitespace-pre-wrap text-ink`},Uc=z({__name:`MessageView`,props:{headers:{},bodyBase64:{},bodyTruncated:{type:Boolean}},setup(e){let t=e,n=Q(()=>Vs(t.bodyBase64,t.bodyTruncated)),r=Q(()=>n.value.kind===`json`?n.value.formatted:n.value.kind===`text`?n.value.text:null),i=Q(()=>{switch(n.value.kind){case`empty`:return``;case`json`:return`JSON, ${Ms(n.value.bytes)}`;case`text`:return`Text, ${Ms(n.value.bytes)}`;case`binary`:return`Binary, ${Ms(n.value.bytes)}`}return``});return(t,a)=>(W(),G(`div`,Mc,[q(`section`,null,[a[1]||=q(`h3`,{class:`text-xs font-medium tracking-wider text-muted uppercase`},`Headers`,-1),e.headers.length===0?(W(),G(`p`,Nc,`No headers.`)):(W(),G(`table`,Pc,[a[0]||=q(`thead`,{class:`sr-only`},[q(`tr`,null,[q(`th`,{scope:`col`},`Name`),q(`th`,{scope:`col`},`Value`)])],-1),q(`tbody`,null,[(W(!0),G(U,null,B(e.headers,(e,t)=>(W(),G(`tr`,{key:t,class:`border-b border-hairline align-top`},[q(`th`,Fc,D(e[0]),1),q(`td`,Ic,D(e[1]),1)]))),128))])]))]),q(`section`,null,[q(`div`,Lc,[a[2]||=q(`h3`,{class:`text-xs font-medium tracking-wider text-muted uppercase`},`Body`,-1),i.value?(W(),G(`span`,Rc,D(i.value),1)):X(``,!0),r.value===null?X(``,!0):(W(),K(as,{key:1,class:`ml-auto`,text:r.value,label:`Copy body`},null,8,[`text`]))]),e.bodyTruncated?(W(),G(`p`,zc,` Truncated: the log keeps only the first `+D(P(Ms)(n.value.kind===`empty`?0:n.value.bytes))+` of this body. The full body was forwarded. `,1)):X(``,!0),n.value.kind===`empty`?(W(),G(`p`,Bc,`No body.`)):n.value.kind===`binary`?(W(),G(`p`,Vc,D(P(Ns)(n.value.bytes,e.bodyTruncated)),1)):(W(),G(`pre`,Hc,D(r.value),1))])]))}}),Wc={class:`inline-flex shrink-0 rounded-sm bg-tag-bg px-1.5 py-0.5 font-mono text-xs font-medium text-tag-fg`},Gc=z({__name:`MethodBadge`,props:{method:{}},setup(e){return(t,n)=>(W(),G(`span`,Wc,D(e.method),1))}}),Kc=[`viewBox`],qc=[`stroke-width`],Jc=[`d`],Yc=z({__name:`MarkLoader`,setup(e){return(e,t)=>(W(),G(`svg`,{viewBox:P(Io),"aria-hidden":`true`,focusable:`false`,class:`block w-auto shrink-0`},[q(`g`,{class:`stroke-current`,fill:`none`,"stroke-width":P(Lo),"stroke-linecap":`round`,"stroke-linejoin":`round`},[(W(!0),G(U,null,B(P(Ro),(e,t)=>(W(),G(`path`,{key:t,d:e,pathLength:`1`,class:E(`hwl hwl-${t+1}`)},null,10,Jc))),128))],8,qc)],8,Kc))}}),Xc=[`type`,`disabled`,`aria-busy`],$=z({__name:`UiButton`,props:{variant:{default:`secondary`},type:{default:`button`},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(e){let t={primary:`border border-transparent bg-hop-green text-on-green hover:bg-ink hover:text-ground disabled:hover:bg-hop-green disabled:hover:text-on-green`,secondary:`border border-line-strong text-ink hover:border-ink disabled:hover:border-line-strong`,quiet:`border border-transparent text-muted hover:bg-ink/8 hover:text-ink disabled:hover:bg-transparent disabled:hover:text-muted`};return(n,r)=>(W(),G(`button`,{type:e.type,disabled:e.disabled||e.loading,"aria-busy":e.loading?`true`:void 0,class:E([`inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-60`,t[e.variant]])},[e.loading?(W(),K(Yc,{key:0,class:`h-4`})):X(``,!0),Tr(n.$slots,`default`)],10,Xc))}}),Zc={class:`flex gap-3`},Qc={class:`w-32 shrink-0`},$c=[`value`],el={class:`min-w-0 flex-1`},tl={class:`mt-1.5 space-y-1.5`},nl=[`onUpdate:modelValue`,`aria-label`],rl=[`onUpdate:modelValue`,`aria-label`],il={class:`mt-2 flex items-center gap-3`},al={class:`flex items-center gap-3`},ol={key:0,class:`mt-1.5 rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},sl={key:2,class:`mt-1.5 text-sm text-muted`},cl={class:`sticky bottom-0 -mx-4 space-y-3 border-t border-hairline bg-ground px-4 py-3`},ll={key:0,class:`rounded-sm bg-err-bg px-3 py-2 text-sm text-err-fg`,role:`alert`},ul={class:`flex items-center gap-3`},dl={key:0,class:`truncate text-xs text-muted`},fl={class:`font-mono`},pl=`w-full rounded-sm border border-line-strong bg-well px-2.5 py-1.5 font-mono text-xs text-ink placeholder:text-muted`,ml=z({__name:`ReplayEditor`,props:{exchange:{},target:{},sending:{type:Boolean},error:{}},emits:[`send`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=Wt(rc(n.exchange)),a=N(null),o=Q(()=>{let e=n.exchange.request.method.toUpperCase();return tc.includes(e)?[...tc]:[...tc,e]}),s=Q(()=>i.bodyEditable&&Bs(i.body)!==null);function c(){i.body=Bs(i.body)??i.body}function l(){i.headers.push({name:``,value:``})}function u(e){i.headers.splice(e,1)}function d(){a.value=ic(i,n.exchange),a.value===null&&r(`send`,ac(i))}return(t,n)=>(W(),G(`form`,{class:`space-y-6 px-4 pt-4`,"aria-label":`Edit and replay`,novalidate:``,onSubmit:Oo(d,[`prevent`])},[q(`div`,Zc,[q(`div`,Qc,[n[4]||=q(`label`,{class:`text-xs font-medium tracking-wider text-muted uppercase`,for:`replay-method`},` Method `,-1),R(q(`select`,{id:`replay-method`,"onUpdate:modelValue":n[0]||=e=>i.method=e,class:E([`mt-1.5`,pl])},[(W(!0),G(U,null,B(o.value,e=>(W(),G(`option`,{key:e,value:e},D(e),9,$c))),128))],512),[[So,i.method]])]),q(`div`,el,[n[5]||=q(`label`,{class:`text-xs font-medium tracking-wider text-muted uppercase`,for:`replay-path`},`Path`,-1),R(q(`input`,{id:`replay-path`,"onUpdate:modelValue":n[1]||=e=>i.path=e,type:`text`,autocomplete:`off`,spellcheck:`false`,class:E([`mt-1.5`,pl])},null,512),[[bo,i.path]])])]),q(`fieldset`,null,[n[9]||=q(`legend`,{class:`text-xs font-medium tracking-wider text-muted uppercase`},`Headers`,-1),q(`ul`,tl,[(W(!0),G(U,null,B(i.headers,(e,t)=>(W(),G(`li`,{key:t,class:`flex gap-1.5`},[R(q(`input`,{"onUpdate:modelValue":t=>e.name=t,type:`text`,autocomplete:`off`,spellcheck:`false`,placeholder:`Name`,"aria-label":`Header ${t+1} name`,class:E([`basis-2/5`,pl])},null,8,nl),[[bo,e.name]]),R(q(`input`,{"onUpdate:modelValue":t=>e.value=t,type:`text`,autocomplete:`off`,spellcheck:`false`,placeholder:`Value`,"aria-label":`Header ${t+1} value`,class:E([`basis-3/5`,pl])},null,8,rl),[[bo,e.value]]),J($,{variant:`quiet`,"aria-label":`Remove header ${e.name||t+1}`,onClick:e=>u(t)},{default:L(()=>[...n[6]||=[Y(` Remove `,-1)]]),_:1},8,[`aria-label`,`onClick`])]))),128))]),q(`div`,il,[J($,{onClick:l},{default:L(()=>[...n[7]||=[Y(`Add header`,-1)]]),_:1}),n[8]||=q(`span`,{class:`text-xs text-muted`},`Content-Length is set to match the body.`,-1)])]),q(`div`,null,[q(`div`,al,[n[11]||=q(`label`,{class:`text-xs font-medium tracking-wider text-muted uppercase`,for:`replay-body`},`Body`,-1),s.value?(W(),K($,{key:0,class:`ml-auto`,variant:`quiet`,onClick:c},{default:L(()=>[...n[10]||=[Y(`Format JSON`,-1)]]),_:1})):X(``,!0)]),e.exchange.request.bodyTruncated&&i.bodyEditable?(W(),G(`p`,ol,` The log holds only the first part of this body. What you send is exactly the text below. `)):X(``,!0),i.bodyEditable?R((W(),G(`textarea`,{key:1,id:`replay-body`,"onUpdate:modelValue":n[2]||=e=>i.body=e,rows:`12`,spellcheck:`false`,class:E([`mt-1.5 leading-5`,pl])},null,512)),[[bo,i.body]]):(W(),G(`p`,sl,` The body is binary and cannot be edited here. It is sent as captured. `))]),q(`div`,cl,[a.value||e.error?(W(),G(`p`,ll,D(a.value??e.error),1)):X(``,!0),q(`div`,ul,[J($,{type:`submit`,variant:`primary`,loading:e.sending},{default:L(()=>[Y(D(e.sending?`Sending`:`Send replay`),1)]),_:1},8,[`loading`]),J($,{disabled:e.sending,onClick:n[3]||=e=>r(`cancel`)},{default:L(()=>[...n[12]||=[Y(`Cancel`,-1)]]),_:1},8,[`disabled`]),e.target?(W(),G(`span`,dl,[n[13]||=Y(` Goes to `,-1),q(`span`,fl,D(e.target),1)])):X(``,!0)])])],32))}}),hl=z({__name:`StatusBadge`,props:{status:{}},setup(e){let t=e,n=Q(()=>Os[Ds(t.status)]);return(t,r)=>(W(),G(`span`,{class:E([`inline-flex shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-xs font-medium tabular-nums`,n.value])},D(e.status),3))}}),gl={class:`space-y-3`,"aria-label":`WebSocket messages`},_l={class:`flex gap-2`},vl=[`value`],yl={key:0,class:`rounded-sm bg-err-bg px-3 py-2 text-sm text-err-fg`,role:`alert`},bl={key:1,class:`text-sm text-muted`},xl={key:2,class:`text-sm text-muted`},Sl={key:3,class:`text-sm text-muted`},Cl={class:`space-y-2`,"aria-live":`polite`},wl=[`aria-label`],Tl={class:`flex items-center gap-3 text-xs text-muted`},El={class:`tabular-nums`},Dl={class:`tabular-nums`},Ol={key:0,class:`mt-2 rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},kl={class:`mt-2 max-h-80 overflow-auto font-mono text-xs leading-5 break-words whitespace-pre-wrap text-ink`},Al={key:4,class:`space-y-1 rounded-sm border border-hairline px-3 py-2 text-sm text-muted`,"aria-label":`Close of the WebSocket`},jl={key:0,class:`text-warn-fg`},Ml={key:5,class:`text-xs text-muted`},Nl=z({__name:`WsMessages`,props:{blocks:{},failure:{}},setup(e){let t=e,n=N(``),r=N(``),i=Q(()=>Ws(t.blocks??[])),a=Q(()=>Ks(i.value.messages,{text:n.value,direction:r.value}).map(e=>({message:e,view:Gs(e)}))),o=Q(()=>n.value.trim()!==``||r.value!==``),s=Q(()=>{let e=i.value.close;if(e===null)return``;let t=e.reason===``?``:` and reason "${e.reason}"`;return`Closed by ${qs(e.by)} with code ${e.code}${t}.`}),c=[{value:``,label:`Both directions`},{value:`in`,label:`Client to service`},{value:`out`,label:`Service to client`}];return(t,l)=>(W(),G(`section`,gl,[q(`div`,_l,[l[2]||=q(`label`,{class:`sr-only`,for:`ws-filter`},`Filter messages`,-1),R(q(`input`,{id:`ws-filter`,"onUpdate:modelValue":l[0]||=e=>n.value=e,type:`search`,placeholder:`Filter by text`,autocomplete:`off`,spellcheck:`false`,class:`min-w-0 flex-1 rounded-sm border border-line-strong bg-well px-2.5 py-1.5 text-sm text-ink placeholder:text-muted`},null,512),[[bo,n.value]]),l[3]||=q(`label`,{class:`sr-only`,for:`ws-direction`},`Filter by direction`,-1),R(q(`select`,{id:`ws-direction`,"onUpdate:modelValue":l[1]||=e=>r.value=e,class:`rounded-sm border border-line-strong bg-well px-2 py-1.5 text-sm text-ink`},[(W(),G(U,null,B(c,e=>q(`option`,{key:e.value,value:e.value},D(e.label),9,vl)),64))],512),[[So,r.value]])]),e.failure?(W(),G(`p`,yl,D(e.failure),1)):e.blocks===null?(W(),G(`p`,bl,`Loading messages.`)):i.value.messages.length===0&&i.value.close===null?(W(),G(`p`,xl,` No messages yet. New ones appear here as they pass. `)):a.value.length===0&&o.value?(W(),G(`p`,Sl,`No message matches the filter.`)):X(``,!0),q(`ol`,Cl,[(W(!0),G(U,null,B(a.value,({message:e,view:t})=>(W(),G(`li`,{key:e.position,class:`rounded-sm border border-hairline bg-surface p-3`,"aria-label":`Message ${e.position+1}, ${e.direction===`in`?`client to service`:`service to client`}`},[q(`div`,Tl,[q(`span`,{class:E([`font-mono font-medium`,e.direction===`in`?`text-cyan-text`:`text-green-text`]),"aria-hidden":`true`},D(e.direction===`in`?`Client → service`:`Service → client`),3),q(`span`,El,`+`+D(e.atMs)+` ms`,1),q(`span`,Dl,D(P(Ms)(e.length)),1),q(`span`,null,D(t.kind===`json`?`JSON`:t.kind===`text`?`Text`:`Binary`),1),t.kind===`binary`?(W(),K(as,{key:0,class:`ml-auto`,text:e.dataBase64,label:`Copy message as Base64`},null,8,[`text`])):(W(),K(as,{key:1,class:`ml-auto`,text:t.kind===`json`?t.formatted:t.text,label:`Copy message`},null,8,[`text`]))]),e.truncated?(W(),G(`p`,Ol,` Truncated: the log keeps the first `+D(P(Ms)(65536))+` of this message of `+D(P(Ms)(e.length))+`. The full message was carried. `,1)):X(``,!0),q(`pre`,kl,D(t.kind===`json`?t.formatted:t.kind===`text`?t.text:`${t.hex}${t.more?` ...`:``}`),1)],8,wl))),128))]),i.value.close?(W(),G(`div`,Al,[q(`p`,null,D(s.value),1),i.value.close.omittedMessages>0?(W(),G(`p`,jl,D(i.value.close.omittedMessages)+` `+D(i.value.close.omittedMessages===1?`message was`:`messages were`)+` not captured: the log keeps up to 2 MB or 10,000 messages per WebSocket. Every message was carried in full. `,1)):X(``,!0)])):e.blocks===null?X(``,!0):(W(),G(`p`,Ml,`Open. New messages appear here as they pass.`))]))}}),Pl={class:`mt-1.5 space-y-1.5`},Fl=[`onUpdate:modelValue`,`aria-label`],Il=[`onUpdate:modelValue`,`aria-label`],Ll={class:`mt-2 flex items-center gap-3`},Rl={key:0,class:`mt-1.5 text-sm text-muted`},zl={class:`mt-1.5 space-y-2`},Bl={class:`flex items-center gap-2 text-xs text-muted`},Vl={class:`font-medium text-ink`},Hl={key:0,class:`tabular-nums`},Ul={key:1},Wl={key:0,class:`mt-2 rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},Gl={key:1,class:`mt-2 text-sm text-muted`},Kl=[`onUpdate:modelValue`,`aria-label`],ql={class:`mt-1.5 space-y-1.5 text-sm text-ink`},Jl={class:`flex items-center gap-2`},Yl={class:`flex items-center gap-2`},Xl={class:`sticky bottom-0 -mx-4 space-y-3 border-t border-hairline bg-ground px-4 py-3`},Zl={key:0,class:`rounded-sm bg-err-bg px-3 py-2 text-sm text-err-fg`,role:`alert`},Ql={class:`flex items-center gap-3`},$l={key:0,class:`truncate text-xs text-muted`},eu={class:`font-mono`},tu=`w-full rounded-sm border border-line-strong bg-well px-2.5 py-1.5 font-mono text-xs text-ink placeholder:text-muted`,nu=`text-xs font-medium tracking-wider text-muted uppercase`,ru=z({__name:`WsReplayEditor`,props:{exchange:{},messages:{},target:{},sending:{type:Boolean},error:{}},emits:[`send`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=Wt(Zs(n.exchange.request.path,n.exchange.request.headers,n.messages)),a=N(null);function o(){i.headers.push({name:``,value:``})}function s(e){i.headers.splice(e,1)}function c(){i.messages.push(Xs())}function l(e){i.messages.splice(e,1)}function u(e,t){let[n]=i.messages.splice(e,1);n!==void 0&&i.messages.splice(e+t,0,n)}function d(){a.value=$s(i),a.value===null&&r(`send`,ec(i))}return(t,n)=>(W(),G(`form`,{class:`space-y-6 px-4 pt-4`,"aria-label":`Edit and replay the WebSocket`,novalidate:``,onSubmit:Oo(d,[`prevent`])},[q(`div`,null,[q(`label`,{class:E(nu),for:`ws-replay-path`},`Path`),R(q(`input`,{id:`ws-replay-path`,"onUpdate:modelValue":n[0]||=e=>i.path=e,type:`text`,autocomplete:`off`,spellcheck:`false`,class:E([`mt-1.5`,tu])},null,512),[[bo,i.path]])]),q(`fieldset`,null,[q(`legend`,{class:E(nu)},`Headers`),q(`ul`,Pl,[(W(!0),G(U,null,B(i.headers,(e,t)=>(W(),G(`li`,{key:t,class:`flex gap-1.5`},[R(q(`input`,{"onUpdate:modelValue":t=>e.name=t,type:`text`,autocomplete:`off`,spellcheck:`false`,placeholder:`Name`,"aria-label":`Header ${t+1} name`,class:E([`basis-2/5`,tu])},null,8,Fl),[[bo,e.name]]),R(q(`input`,{"onUpdate:modelValue":t=>e.value=t,type:`text`,autocomplete:`off`,spellcheck:`false`,placeholder:`Value`,"aria-label":`Header ${t+1} value`,class:E([`basis-3/5`,tu])},null,8,Il),[[bo,e.value]]),J($,{variant:`quiet`,"aria-label":`Remove header ${e.name||t+1}`,onClick:e=>s(t)},{default:L(()=>[...n[4]||=[Y(` Remove `,-1)]]),_:1},8,[`aria-label`,`onClick`])]))),128))]),q(`div`,Ll,[J($,{onClick:o},{default:L(()=>[...n[5]||=[Y(`Add header`,-1)]]),_:1}),n[6]||=q(`span`,{class:`text-xs text-muted`},`The handshake headers of the WebSocket are made anew.`,-1)])]),q(`fieldset`,null,[q(`legend`,{class:E(nu)},`Messages from the client`),i.messages.length===0?(W(),G(`p`,Rl,` No messages. The WebSocket opens, waits 5 s for the service and closes. `)):X(``,!0),q(`ol`,zl,[(W(!0),G(U,null,B(i.messages,(e,t)=>(W(),G(`li`,{key:e.key,class:`rounded-sm border border-hairline bg-surface p-3`},[q(`div`,Bl,[q(`span`,Vl,D(t+1),1),q(`span`,null,D(e.binary?`Binary`:`Text`),1),e.atMs===void 0?(W(),G(`span`,Ul,`Added`)):(W(),G(`span`,Hl,`+`+D(e.atMs)+` ms`,1)),J($,{class:`ml-auto`,variant:`quiet`,disabled:t===0,"aria-label":`Move message ${t+1} up`,onClick:e=>u(t,-1)},{default:L(()=>[...n[7]||=[Y(` Up `,-1)]]),_:1},8,[`disabled`,`aria-label`,`onClick`]),J($,{variant:`quiet`,disabled:t===i.messages.length-1,"aria-label":`Move message ${t+1} down`,onClick:e=>u(t,1)},{default:L(()=>[...n[8]||=[Y(` Down `,-1)]]),_:1},8,[`disabled`,`aria-label`,`onClick`]),J($,{variant:`quiet`,"aria-label":`Remove message ${t+1}`,onClick:e=>l(t)},{default:L(()=>[...n[9]||=[Y(` Remove `,-1)]]),_:1},8,[`aria-label`,`onClick`])]),e.truncated?(W(),G(`p`,Wl,[e.binary?(W(),G(U,{key:0},[Y(` Captured only in part (`+D(P(Ms)(e.length))+` in full), so it cannot be sent. Remove it to replay the rest. `,1)],64)):(W(),G(U,{key:1},[Y(` The log holds only the first part of this message. What you send is exactly the text below. `)],64))])):X(``,!0),e.binary&&!e.truncated?(W(),G(`p`,Gl,` Binary, `+D(P(Ms)(e.length))+`. It cannot be edited here and is sent as captured. `,1)):e.binary?X(``,!0):R((W(),G(`textarea`,{key:2,"onUpdate:modelValue":t=>e.text=t,rows:`3`,spellcheck:`false`,class:E([`mt-2 leading-5`,tu]),"aria-label":`Text of message ${t+1}`},null,8,Kl)),[[bo,e.text]])]))),128))]),J($,{class:`mt-2`,onClick:c},{default:L(()=>[...n[10]||=[Y(`Add text message`,-1)]]),_:1})]),q(`fieldset`,null,[q(`legend`,{class:E(nu)},`Timing`),q(`div`,ql,[q(`label`,Jl,[R(q(`input`,{"onUpdate:modelValue":n[1]||=e=>i.timing=e,type:`radio`,name:`ws-timing`,value:`recorded`},null,512),[[xo,i.timing]]),n[11]||=Y(` As recorded: the gaps between the messages, each at most 5 s `,-1)]),q(`label`,Yl,[R(q(`input`,{"onUpdate:modelValue":n[2]||=e=>i.timing=e,type:`radio`,name:`ws-timing`,value:`fast`},null,512),[[xo,i.timing]]),n[12]||=Y(` Fast: one message after the other `,-1)])]),n[13]||=q(`p`,{class:`mt-1.5 text-xs text-muted`},` After the last message the WebSocket stays open 5 s for the answers, then it is closed with 1000. `,-1)]),q(`div`,Xl,[a.value||e.error?(W(),G(`p`,Zl,D(a.value??e.error),1)):X(``,!0),q(`div`,Ql,[J($,{type:`submit`,variant:`primary`,loading:e.sending},{default:L(()=>[Y(D(e.sending?`Sending`:`Send replay`),1)]),_:1},8,[`loading`]),J($,{disabled:e.sending,onClick:n[3]||=e=>r(`cancel`)},{default:L(()=>[...n[14]||=[Y(`Cancel`,-1)]]),_:1},8,[`disabled`]),e.target?(W(),G(`span`,$l,[n[15]||=Y(` Goes to `,-1),q(`span`,eu,D(e.target),1)])):X(``,!0)])])],32))}}),iu={class:`flex h-full min-h-0 flex-col`,"aria-label":`Request details`},au={class:`border-b border-hairline p-4`},ou={class:`flex items-start gap-2`},su={class:`min-w-0 flex-1 font-mono text-sm leading-5 font-normal break-all text-ink`},cu={class:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted`},lu={class:`flex gap-1`},uu={class:`text-tag-fg tabular-nums`},du={class:`flex gap-1`},fu={class:`text-tag-fg tabular-nums`},pu={class:`flex gap-1`},mu={class:`text-tag-fg`},hu={class:`flex gap-1`},gu={class:`text-tag-fg`},_u={key:0,class:`flex gap-1`},vu={key:1,class:`flex gap-1`},yu={key:1,class:`font-mono text-tag-fg`},bu={key:0,class:`mt-3 flex flex-wrap items-center gap-2`},xu={key:0,class:`truncate text-xs text-muted`},Su={class:`font-mono`},Cu={key:1,class:`mt-2 text-sm text-warn-fg`,role:`note`},wu={key:2,class:`mt-2 rounded-sm bg-err-bg px-3 py-2 text-sm text-err-fg`,role:`alert`},Tu={key:0,class:`min-h-0 flex-1 overflow-y-auto`},Eu={class:`flex gap-1 border-b border-hairline px-4`,role:`tablist`,"aria-label":`Message`},Du=[`id`,`aria-selected`,`onClick`],Ou=[`aria-labelledby`],ku=z({__name:`ExchangeDetail`,props:{record:{},status:{},originalLoaded:{type:Boolean},replay:{},wsBlocks:{default:null},wsFailure:{default:null},logs:{default:()=>[]}},emits:[`select`,`load-messages`,`load-logs`],setup(e,{emit:t}){let n=e,r=t,i=N(`request`),a=N(!1),o=N(!1),s=N(null),c=Q(()=>n.record.exchange),l=Q(()=>gs(c.value)),u=Q(()=>[`request`,`response`,...l.value?[`messages`]:[],...n.logs.length>0?[`logs`]:[]]),d=N(!1);function f(e){return e===`logs`?`Logs ${n.logs.length}`:e}function p(e){i.value=e,d.value=!0}let m=Q(()=>Ws(n.wsBlocks??[]).messages),h=Q(()=>cc(n.status,c.value)),g=Q(()=>{let e=sc(n.status,c.value,m.value);if(l.value&&n.wsBlocks===null&&e.replay===null){let t=`The messages of this WebSocket are still loading.`;return{replay:t,editAndReplay:e.editAndReplay??t}}return e}),_=Q(()=>g.value.replay);Un(()=>[c.value.id,n.record.origin],()=>{a.value=!1,s.value=null,d.value=!1,u.value.includes(i.value)||(i.value=`request`),l.value&&r(`load-messages`,n.record),r(`load-logs`,n.record)},{immediate:!0}),Un(()=>[c.value.id,n.logs.length>0],([,e])=>{e&&!d.value&&c.value.response.status>=500?i.value=`logs`:!e&&i.value===`logs`&&(i.value=`request`)},{immediate:!0});async function v(e){o.value=!0,s.value=null;try{let t=await n.replay(n.record,e);a.value=!1,i.value=l.value&&gs(t)?`messages`:`response`,r(`select`,t.id)}catch(e){s.value=e instanceof ys?e.message:`The replay could not be sent.`}finally{o.value=!1}}function y(){s.value=null,a.value=!0}return(t,n)=>(W(),G(`article`,iu,[q(`header`,au,[q(`div`,ou,[J(Gc,{method:c.value.request.method},null,8,[`method`]),q(`h2`,su,D(c.value.request.path),1),J(hl,{status:c.value.response.status},null,8,[`status`])]),q(`dl`,cu,[q(`div`,lu,[n[4]||=q(`dt`,null,`Time`,-1),q(`dd`,uu,D(P(Ps)(c.value.timestamp)),1)]),q(`div`,du,[n[5]||=q(`dt`,null,`Duration`,-1),q(`dd`,fu,D(P(js)(c.value.response.durationMs)),1)]),q(`div`,pu,[n[6]||=q(`dt`,null,`Source`,-1),q(`dd`,mu,D(P(As)(c.value.source)),1)]),q(`div`,hu,[n[7]||=q(`dt`,null,`Service`,-1),q(`dd`,gu,D(c.value.serviceName),1)]),e.record.origin===`remote`?(W(),G(`div`,_u,[...n[8]||=[q(`dt`,null,`Origin`,-1),q(`dd`,{class:`text-tag-fg`},`remote log`,-1)]])):X(``,!0),c.value.replayOf?(W(),G(`div`,vu,[n[9]||=q(`dt`,null,`Replay of`,-1),q(`dd`,null,[e.originalLoaded?(W(),G(`button`,{key:0,type:`button`,class:`cursor-pointer rounded-sm font-mono text-ink underline decoration-line-strong underline-offset-2 transition-colors duration-150 ease-out hover:decoration-ink`,onClick:n[0]||=e=>r(`select`,c.value.replayOf)},D(c.value.replayOf.slice(0,8)),1)):(W(),G(`span`,yu,D(c.value.replayOf.slice(0,8)),1))])])):X(``,!0)]),a.value?X(``,!0):(W(),G(`div`,bu,[J($,{variant:`primary`,loading:o.value,disabled:_.value!==null,onClick:n[1]||=e=>v()},{default:L(()=>[Y(D(o.value?`Sending`:`Replay`),1)]),_:1},8,[`loading`,`disabled`]),J($,{disabled:o.value||g.value.editAndReplay!==null,onClick:y},{default:L(()=>[...n[10]||=[Y(` Edit & Replay `,-1)]]),_:1},8,[`disabled`]),h.value&&_.value===null?(W(),G(`span`,xu,[n[11]||=Y(` Goes to `,-1),q(`span`,Su,D(h.value),1)])):X(``,!0)])),!a.value&&_.value?(W(),G(`p`,Cu,D(_.value),1)):X(``,!0),!a.value&&s.value?(W(),G(`p`,wu,D(s.value),1)):X(``,!0)]),a.value?(W(),G(`div`,Tu,[l.value?(W(),K(ru,{key:`ws-${c.value.id}`,exchange:c.value,messages:m.value,target:h.value,sending:o.value,error:s.value,onSend:v,onCancel:n[2]||=e=>a.value=!1},null,8,[`exchange`,`messages`,`target`,`sending`,`error`])):(W(),K(ml,{key:c.value.id,exchange:c.value,target:h.value,sending:o.value,error:s.value,onSend:v,onCancel:n[3]||=e=>a.value=!1},null,8,[`exchange`,`target`,`sending`,`error`]))])):(W(),G(U,{key:1},[q(`div`,Eu,[(W(!0),G(U,null,B(u.value,e=>(W(),G(`button`,{id:`tab-${e}`,key:e,type:`button`,role:`tab`,"aria-selected":i.value===e,"aria-controls":`message-panel`,class:E([`-mb-px cursor-pointer border-b-2 px-3 py-2 text-sm font-medium capitalize transition-colors duration-150 ease-out focus-visible:-outline-offset-2`,i.value===e?`border-ink text-ink`:`border-transparent text-muted hover:text-ink`]),onClick:t=>p(e)},D(f(e)),11,Du))),128))]),q(`div`,{id:`message-panel`,class:`min-h-0 flex-1 overflow-y-auto p-4`,role:`tabpanel`,"aria-labelledby":`tab-${i.value}`},[i.value===`request`?(W(),K(Uc,{key:0,headers:c.value.request.headers,"body-base64":c.value.request.bodyBase64,"body-truncated":c.value.request.bodyTruncated},null,8,[`headers`,`body-base64`,`body-truncated`])):i.value===`messages`?(W(),K(Nl,{key:1,blocks:e.wsBlocks,failure:e.wsFailure},null,8,[`blocks`,`failure`])):i.value===`logs`?(W(),K(jc,{key:2,items:e.logs,"exchange-id":c.value.id},null,8,[`items`,`exchange-id`])):(W(),K(Uc,{key:3,headers:c.value.response.headers,"body-base64":c.value.response.bodyBase64,"body-truncated":c.value.response.bodyTruncated},null,8,[`headers`,`body-base64`,`body-truncated`]))],8,Ou)],64))]))}});function Au(e){return`${e.origin}:${e.index}`}function ju(e,t){let n=new Map;for(let t of e)n.set(Au(t),t);for(let e of t)n.set(Au(e),e);return[...n.values()].sort((e,t)=>t.exchange.timestamp-e.exchange.timestamp||t.index-e.index)}function Mu(e,t){let n=t.text.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(({exchange:e})=>{if(t.service!==``&&e.serviceName!==t.service)return!1;let r=`${e.request.method} ${e.request.path} ${e.response.status} ${e.serviceName} ${e.source}${gs(e)?` ws`:``}`.toLowerCase();return n.every(e=>r.includes(e))})}function Nu(e,t){return[...new Set([...t,...e.map(e=>e.exchange.serviceName)])].sort()}function Pu(e){return e?[`remote`,`own`]:[`own`]}function Fu(e,t){return e.reduce((e,n)=>n.origin===t&&(e===null||n.index<e)?n.index:e,null)}function Iu(e){let t=[];for(let n of[`remote`,`own`]){let r=Fu(e,n);r!==null&&r>0&&t.push({origin:n,before:r})}return t}var Lu={class:`flex h-full min-h-0 flex-col`},Ru={class:`flex gap-2 border-b border-hairline p-2`},zu=[`value`],Bu={key:0,class:`p-4 text-sm text-muted`},Vu={class:`min-h-0 flex-1 overflow-y-auto`,"aria-label":`Requests, newest first`},Hu=[`aria-current`,`onClick`],Uu={class:`flex items-center gap-2`},Wu=[`title`],Gu={class:`mt-1 flex items-center gap-2 text-xs text-muted`},Ku={class:`tabular-nums`},qu={class:`tabular-nums`},Ju={key:0,class:`rounded-sm bg-tag-bg px-1.5 py-px font-medium text-tag-fg`,title:`WebSocket handshake; its messages are in the Messages tab`},Yu={key:1,class:`rounded-sm bg-info-bg px-1.5 py-px font-medium text-info-fg`},Xu={key:2,class:`truncate`},Zu={key:0,class:`p-2 text-center`},Qu=z({__name:`ExchangeList`,props:{records:{},services:{},selectedKey:{},hasOlder:{type:Boolean},loadingOlder:{type:Boolean}},emits:[`select`,`load-older`],setup(e,{emit:t}){let n=e,r=t,i=N(``),a=N(``),o=Q(()=>n.services.length>1),s=Q(()=>Mu(n.records,{text:i.value,service:a.value})),c=Q(()=>i.value.trim()!==``||a.value!==``);return(t,n)=>(W(),G(`div`,Lu,[q(`div`,Ru,[n[5]||=q(`label`,{class:`sr-only`,for:`traffic-filter`},`Filter requests`,-1),R(q(`input`,{id:`traffic-filter`,"onUpdate:modelValue":n[0]||=e=>i.value=e,type:`search`,placeholder:`Filter by method, path or status`,autocomplete:`off`,spellcheck:`false`,class:`min-w-0 flex-1 rounded-sm border border-line-strong bg-well px-2.5 py-1.5 text-sm text-ink placeholder:text-muted`},null,512),[[bo,i.value]]),o.value?(W(),G(U,{key:0},[n[4]||=q(`label`,{class:`sr-only`,for:`traffic-service`},`Filter by service`,-1),R(q(`select`,{id:`traffic-service`,"onUpdate:modelValue":n[1]||=e=>a.value=e,class:`rounded-sm border border-line-strong bg-well px-2 py-1.5 text-sm text-ink`},[n[3]||=q(`option`,{value:``},`All services`,-1),(W(!0),G(U,null,B(e.services,e=>(W(),G(`option`,{key:e,value:e},D(e),9,zu))),128))],512),[[So,a.value]])],64)):X(``,!0)]),s.value.length===0?(W(),G(`p`,Bu,D(c.value?`No request matches the filter.`:`No requests yet.`),1)):X(``,!0),q(`ul`,Vu,[(W(!0),G(U,null,B(s.value,t=>(W(),G(`li`,{key:P(Au)(t)},[q(`button`,{type:`button`,class:E([`block w-full cursor-pointer border-b border-l-2 border-b-hairline px-3 py-2 text-left transition-colors duration-150 ease-out focus-visible:-outline-offset-2`,P(Au)(t)===e.selectedKey?`border-l-ink bg-surface`:`border-l-transparent hover:bg-surface/60`]),"aria-current":P(Au)(t)===e.selectedKey?`true`:void 0,onClick:e=>r(`select`,P(Au)(t))},[q(`span`,Uu,[J(Gc,{method:t.exchange.request.method},null,8,[`method`]),q(`span`,{class:`min-w-0 flex-1 truncate font-mono text-sm text-ink`,title:t.exchange.request.path},D(t.exchange.request.path),9,Wu),J(hl,{status:t.exchange.response.status},null,8,[`status`])]),q(`span`,Gu,[q(`span`,Ku,D(P(Ps)(t.exchange.timestamp)),1),q(`span`,qu,D(P(js)(t.exchange.response.durationMs)),1),q(`span`,{class:E([`rounded-sm px-1.5 py-px font-medium`,t.exchange.source===`replay`?`bg-warn-bg text-warn-fg`:`bg-tag-bg text-tag-fg`])},D(P(As)(t.exchange.source)),3),P(gs)(t.exchange)?(W(),G(`span`,Ju,` ws `)):X(``,!0),t.origin===`remote`?(W(),G(`span`,Yu,` remote `)):X(``,!0),o.value?(W(),G(`span`,Xu,D(t.exchange.serviceName),1)):X(``,!0)])],10,Hu)]))),128)),e.hasOlder?(W(),G(`li`,Zu,[J($,{variant:`quiet`,loading:e.loadingOlder,onClick:n[2]||=e=>r(`load-older`)},{default:L(()=>[Y(D(e.loadingOlder?`Loading`:`Load older requests`),1)]),_:1},8,[`loading`])])):X(``,!0)])]))}}),$u={class:`flex h-full min-h-0 flex-col`,"aria-label":`Application logs`},ed={class:`flex flex-wrap gap-2 border-b border-hairline px-4 py-2`},td=[`value`],nd=[`value`],rd={key:0,class:`rounded-sm bg-warn-bg px-3 py-2 text-sm text-warn-fg`,role:`note`},id={key:1,class:`text-sm text-muted`},ad={key:2,class:`text-sm text-muted`},od=z({__name:`LogPane`,props:{items:{},omitted:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=N(``),a=N(``),o=N(``),s=Q(()=>[...new Set(n.items.map(e=>e.source))].sort()),c=Q(()=>hc(n.items,{text:i.value,source:a.value,level:o.value})),l=Q(()=>i.value.trim()!==``||a.value!==``||o.value!==``),u=[`error`,`warning`,`info`,`debug`],d=N(null),f=!0;function p(){let e=d.value;e!==null&&(f=e.scrollHeight-e.scrollTop-e.clientHeight<40)}async function m(){await Tn(),f&&d.value!==null&&(d.value.scrollTop=d.value.scrollHeight)}return hr(m),Un(()=>c.value.length,m),(t,n)=>(W(),G(`section`,$u,[q(`div`,ed,[n[6]||=q(`label`,{class:`sr-only`,for:`log-filter`},`Filter log entries`,-1),R(q(`input`,{id:`log-filter`,"onUpdate:modelValue":n[0]||=e=>i.value=e,type:`search`,placeholder:`Filter by text`,autocomplete:`off`,spellcheck:`false`,class:`min-w-0 flex-1 rounded-sm border border-line-strong bg-well px-2.5 py-1.5 text-sm text-ink placeholder:text-muted`},null,512),[[bo,i.value]]),n[7]||=q(`label`,{class:`sr-only`,for:`log-source`},`Filter by file`,-1),R(q(`select`,{id:`log-source`,"onUpdate:modelValue":n[1]||=e=>a.value=e,class:`rounded-sm border border-line-strong bg-well px-2 py-1.5 text-sm text-ink`},[n[4]||=q(`option`,{value:``},`All files`,-1),(W(!0),G(U,null,B(s.value,e=>(W(),G(`option`,{key:e,value:e},D(e),9,td))),128))],512),[[So,a.value]]),n[8]||=q(`label`,{class:`sr-only`,for:`log-level`},`Filter by level`,-1),R(q(`select`,{id:`log-level`,"onUpdate:modelValue":n[2]||=e=>o.value=e,class:`rounded-sm border border-line-strong bg-well px-2 py-1.5 text-sm text-ink`},[n[5]||=q(`option`,{value:``},`All levels`,-1),(W(),G(U,null,B(u,e=>q(`option`,{key:e,value:e},D(P(yc)[e]),9,nd)),64))],512),[[So,o.value]])]),q(`div`,{ref_key:`scroller`,ref:d,class:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,onScroll:p},[e.omitted.entries>0?(W(),G(`p`,rd,D(e.omitted.entries)+` `+D(e.omitted.entries===1?`entry was`:`entries were`)+` (`+D(P(Ms)(e.omitted.bytes))+`) not captured: a log file is captured up to 200 entries per second and 10 MB per run. `,1)):X(``,!0),e.items.length===0?(W(),G(`p`,id,` No log entries yet. Start the tunnel with --log <path> (or logs: in hopwire.yaml) and new entries of the file appear here as they are written. `)):c.value.length===0&&l.value?(W(),G(`p`,ad,`No entry matches the filter.`)):X(``,!0),J(jc,{items:c.value,selectable:``,onSelect:n[3]||=e=>r(`select`,e)},null,8,[`items`])],544)]))}}),sd=`hopwire-inspector-theme`;function cd(){try{return localStorage.getItem(sd)===`light`?`light`:`dark`}catch{return`dark`}}var ld=N(cd());Un(ld,e=>{document.documentElement.classList.toggle(`dark`,e===`dark`);try{localStorage.setItem(sd,e)}catch{}},{immediate:!0});function ud(){function e(){ld.value=ld.value===`dark`?`light`:`dark`}return{theme:ld,toggleTheme:e}}var dd=[`viewBox`],fd=[`stroke-width`],pd=[`d`,`pathLength`],md=[`d`],hd=z({__name:`BrandLogo`,props:{animated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(W(),G(`svg`,{viewBox:P(Fo),role:`img`,"aria-label":`Hopwire`,class:`block w-auto`},[q(`g`,{class:`stroke-mark`,fill:`none`,"stroke-width":P(Lo),"stroke-linecap":`round`,"stroke-linejoin":`round`},[(W(!0),G(U,null,B(P(Ro),(t,n)=>(W(),G(`path`,{key:n,d:t,pathLength:e.animated?1:void 0,class:E(e.animated?`hwd-s hwd-s${n+1}`:void 0)},null,10,pd))),128))],8,fd),q(`g`,{class:E(e.animated?`hwd-w`:void 0)},[q(`path`,{class:`fill-ink`,d:P(zo)},null,8,md)],2)],8,dd))}}),gd={class:`flex flex-wrap items-center gap-x-5 gap-y-2 border-b border-hairline bg-surface px-4 py-2.5 text-sm`},_d={class:`flex items-center gap-2.5 font-normal`},vd={key:0,class:`inline-flex items-center gap-1.5 rounded-full bg-tag-bg px-2 py-0.5 text-xs font-medium text-tag-fg`},yd={key:1,class:`rounded-full bg-info-bg px-2 py-0.5 text-xs font-medium text-info-fg`},bd={key:2,class:`order-last flex w-full min-w-0 flex-wrap items-center gap-x-5 gap-y-1 lg:order-none lg:w-auto lg:flex-1`},xd={class:`truncate font-mono text-xs text-ink`},Sd={key:0,class:`flex items-center gap-1.5`},Cd=[`title`],wd={class:`flex items-center gap-1.5`},Td=[`title`],Ed={class:`flex min-w-0 items-center gap-1.5`},Dd={key:0,class:`truncate font-mono text-xs text-ink`},Od={class:`ml-auto flex items-center gap-3`},kd={class:`flex items-center gap-1.5 text-xs text-tag-fg`,role:`status`},Ad=z({__name:`StatusBar`,props:{status:{},stream:{},logCount:{default:0},logsOpen:{type:Boolean,default:!1}},emits:[`toggle-logs`],setup(e,{emit:t}){let n=e,r=t,{theme:i,toggleTheme:a}=ud(),o=Q(()=>n.status===null?null:lc(n.status));return(t,n)=>(W(),G(`header`,gd,[q(`h1`,_d,[J(hd,{class:`h-6`}),n[1]||=q(`span`,{class:`text-muted`},`Inspector`,-1)]),e.status?(W(),G(`span`,vd,[q(`span`,{class:E([`size-2 rounded-full border-[1.5px]`,e.status.mode===`public`?`border-link-blue bg-link-blue`:`border-cyan-text bg-wire-cyan`]),"aria-hidden":`true`},null,2),Y(` `+D(e.status.mode===`public`?`Public mode`:`Private mode`),1)])):X(``,!0),e.status?.watching?(W(),G(`span`,yd,` Watching a shared log `)):X(``,!0),e.status?(W(),G(`dl`,bd,[(W(!0),G(U,null,B(e.status.publicUrls,e=>(W(),G(`div`,{key:e,class:`flex min-w-0 items-center gap-1.5`},[n[2]||=q(`dt`,{class:`text-muted`},`Public URL`,-1),q(`dd`,xd,D(e),1),J(as,{text:e,label:`Copy public URL`},null,8,[`text`])]))),128)),e.status.peerKey?(W(),G(`div`,Sd,[n[3]||=q(`dt`,{class:`text-muted`},`Peer key`,-1),q(`dd`,{class:`font-mono text-xs text-ink`,title:e.status.peerKey},D(P(Fs)(e.status.peerKey)),9,Cd),J(as,{text:e.status.peerKey,label:`Copy peer key`},null,8,[`text`])])):X(``,!0),q(`div`,wd,[n[4]||=q(`dt`,{class:`text-muted`},`Log key`,-1),q(`dd`,{class:`font-mono text-xs text-ink`,title:e.status.logKey},D(P(Fs)(e.status.logKey)),9,Td),J(as,{text:e.status.logKey,label:`Copy log key`},null,8,[`text`])]),q(`div`,Ed,[n[5]||=q(`dt`,{class:`text-muted`},`Replay target`,-1),e.status.replayTarget?(W(),G(`dd`,Dd,D(e.status.replayTarget),1)):o.value?(W(),G(`dd`,{key:1,class:E([`text-xs`,o.value.missing?`text-warn-fg`:`text-tag-fg`])},D(o.value.text),3)):X(``,!0)])])):X(``,!0),q(`div`,Od,[q(`span`,kd,[P(ts)(e.stream)?(W(),K(Yc,{key:0,class:`h-3.5`})):(W(),G(`span`,{key:1,class:E([`size-2 rounded-full`,e.stream===`live`?`bg-hop-green`:`border-[1.5px] border-muted`]),"aria-hidden":`true`},null,2)),Y(` `+D(P($o)[e.stream]),1)]),e.logCount>0||e.logsOpen?(W(),K($,{key:0,variant:`quiet`,"aria-pressed":e.logsOpen,"aria-controls":`log-pane`,onClick:n[0]||=e=>r(`toggle-logs`)},{default:L(()=>[Y(D(e.logsOpen?`Hide logs`:`Logs ${e.logCount}`),1)]),_:1},8,[`aria-pressed`])):X(``,!0),J($,{variant:`quiet`,"aria-label":`Switch to ${P(i)===`dark`?`light`:`dark`} mode`,onClick:P(a)},{default:L(()=>[Y(D(P(i)===`dark`?`Light`:`Dark`),1)]),_:1},8,[`aria-label`,`onClick`])])]))}}),jd=100;function Md(){let e=N(null),t=tn([]),n=N(`connecting`),r=N(!1),i=N(!1),a=N(null),o=null,s=!1,c=tn(new Map),l=tn(new Map),u=tn([]),d=N({entries:0,bytes:0});function f(e){u.value=fc(u.value,dc(e));let t=pc(e);t.entries>0&&(d.value={entries:d.value.entries+t.entries,bytes:d.value.bytes+t.bytes})}async function p(e){try{let t=await Ts({exchangeId:e.exchange.id,origin:e.origin});u.value=fc(u.value,dc(t.blocks))}catch{}}async function m(){try{let e=await Ts({limit:500});u.value=fc(u.value,dc(e.blocks))}catch{}}function h(e,t){let n=new Map(c.value);n.set(e,t),c.value=n}async function g(e){let t=Hs(e.origin,e.exchange.id);c.value.has(t)||h(t,[]);try{let n=await ws(e.origin,e.exchange.id);if(h(t,Us(c.value.get(t)??[],n)),l.value.has(t)){let e=new Map(l.value);e.delete(t),l.value=e}}catch(e){let n=new Map(l.value);n.set(t,e instanceof ys?e.message:`The messages could not be loaded.`),l.value=n}}let _=Q(()=>Iu(t.value).length>0),v=Q(()=>a.value??(n.value===`closed`?`The connection to the tunnel is closed. Reload the page to connect again.`:null)),y=Q(()=>!r.value&&v.value===null);async function b(){r.value||(a.value=null);try{let n=await Ss(),i=(await Promise.all(Pu(n.watching).map(e=>Cs({origin:e,limit:jd})))).flat(),o=e.value===null||e.value.logKey===n.logKey;e.value=n,t.value=ju(o?t.value:[],i),r.value=!0,a.value=null,o||(c.value=new Map,u.value=[],d.value={entries:0,bytes:0}),m();for(let e of c.value.keys()){let n=t.value.find(t=>Hs(t.origin,t.exchange.id)===e);n!==void 0&&g(n)}}catch(e){a.value=e instanceof ys?e.message:`The traffic could not be loaded.`}}function x(){let e=new EventSource(`${bs}stream`);o=e,e.addEventListener(`open`,()=>{s=!0,n.value=`live`,b()}),e.addEventListener(`exchange`,e=>{let n=JSON.parse(e.data);t.value=ju(t.value,[n])}),e.addEventListener(`ws_messages`,e=>{let{origin:t,block:n}=JSON.parse(e.data),r=Hs(t,n.exchangeId),i=c.value.get(r);i!==void 0&&h(r,Us(i,[n]))}),e.addEventListener(`log_entries`,e=>{f([JSON.parse(e.data)])}),e.addEventListener(`error`,()=>{n.value=es(e.readyState===EventSource.CLOSED,s)})}function ee(){o?.close(),o=null,n.value=`closed`}async function S(){let e=Iu(t.value);if(!(e.length===0||i.value)){i.value=!0;try{let n=await Promise.all(e.map(e=>Cs({...e,limit:jd})));t.value=ju(t.value,n.flat())}catch(e){a.value=e instanceof ys?e.message:`Older requests could not be loaded.`}finally{i.value=!1}}}async function te(e,n){let r=await Es(e,n);return t.value.some(e=>e.exchange.id===r.id)||await b(),r}return{status:e,records:t,stream:n,connecting:y,loaded:r,loadingOlder:i,problem:v,hasOlder:_,start:x,stop:ee,loadOlder:S,replay:te,wsSessions:c,wsFailures:l,loadWsMessages:g,logs:u,logsOmitted:d,loadExchangeLogs:p}}function Nd(){let e=Md();return vr(e.stop),e}function Pd(e){let t=/^#exchange=([^&]+)$/.exec(e);if(t?.[1]===void 0)return null;try{return decodeURIComponent(t[1])}catch{return null}}var Fd={class:`flex h-dvh flex-col bg-ground text-ink`},Id={key:0,class:`border-b border-hairline bg-err-bg px-4 py-2 text-sm text-err-fg`,role:`alert`},Ld={class:`min-h-0 flex-1`},Rd={key:2,class:`flex h-full min-h-0 flex-col md:flex-row`},zd={class:`h-2/5 min-h-0 shrink-0 border-b border-hairline md:h-full md:w-2/5 md:max-w-xl md:min-w-80 md:border-r md:border-b-0`,"aria-label":`Traffic`},Bd={class:`min-h-0 min-w-0 flex-1`},Vd={key:1,class:`flex h-full items-center justify-center p-8 text-sm text-muted`},Hd={key:1,id:`log-pane`,class:`h-2/5 min-h-0 shrink-0 border-t border-hairline`};Mo(z({__name:`App`,setup(e){let{status:t,records:n,stream:r,connecting:i,loaded:a,loadingOlder:o,problem:s,hasOlder:c,start:l,loadOlder:u,replay:d,wsSessions:f,wsFailures:p,loadWsMessages:m,logs:h,logsOmitted:g,loadExchangeLogs:_}=Nd(),v=N(!1),y=N(null),b=Q(()=>n.value.find(e=>Au(e)===y.value)??null);function x(e){let t=n.value.find(t=>t.exchange.id===e);y.value=t===void 0?null:Au(t)}let ee=Q(()=>Nu(n.value,(t.value?.services??[]).map(e=>e.name))),S=Q(()=>b.value===null?null:Hs(b.value.origin,b.value.exchange.id)),te=Q(()=>S.value===null?null:f.value.get(S.value)??null),C=Q(()=>S.value===null?null:p.value.get(S.value)??null),ne=Q(()=>b.value===null?[]:mc(h.value,b.value.origin,b.value.exchange.id));function re(e){let t=n.value.find(t=>t.origin===e.origin&&e.entry.exchangeIds.includes(t.exchange.id));t!==void 0&&(y.value=Au(t))}let ie=Q(()=>{let e=b.value?.exchange.replayOf;return e!==void 0&&n.value.some(t=>t.exchange.id===e)}),w=N(Pd(window.location.hash));Un([n,w],()=>{let e=w.value;e!==null&&n.value.some(t=>t.exchange.id===e)&&(x(e),w.value=null)},{immediate:!0});let ae=()=>{w.value=Pd(window.location.hash)};return hr(()=>{window.addEventListener(`hashchange`,ae),l()}),vr(()=>window.removeEventListener(`hashchange`,ae)),(e,l)=>(W(),G(`div`,Fd,[J(Ad,{status:P(t),stream:P(r),"log-count":P(h).length,"logs-open":v.value,onToggleLogs:l[0]||=e=>v.value=!v.value},null,8,[`status`,`stream`,`log-count`,`logs-open`]),P(s)?(W(),G(`p`,Id,D(P(s)),1)):X(``,!0),q(`main`,Ld,[P(a)?P(n).length===0?(W(),K(hs,{key:1,status:P(t),stream:P(r)},null,8,[`status`,`stream`])):(W(),G(`div`,Rd,[q(`section`,zd,[J(Qu,{records:P(n),services:ee.value,"selected-key":y.value,"has-older":P(c),"loading-older":P(o),onSelect:l[1]||=e=>y.value=e,onLoadOlder:P(u)},null,8,[`records`,`services`,`selected-key`,`has-older`,`loading-older`,`onLoadOlder`])]),q(`section`,Bd,[b.value?(W(),K(ku,{key:0,record:b.value,status:P(t),"original-loaded":ie.value,replay:P(d),"ws-blocks":te.value,"ws-failure":C.value,logs:ne.value,onSelect:x,onLoadMessages:P(m),onLoadLogs:P(_)},null,8,[`record`,`status`,`original-loaded`,`replay`,`ws-blocks`,`ws-failure`,`logs`,`onLoadMessages`,`onLoadLogs`])):(W(),G(`div`,Vd,` Select a request to see its headers and body. `))])])):(W(),K(Qo,{key:0,connecting:P(i)},null,8,[`connecting`]))]),v.value?(W(),G(`div`,Hd,[J(od,{items:P(h),omitted:P(g),onSelect:re},null,8,[`items`,`omitted`])])):X(``,!0)]))}})).mount(`#app`);
@@ -7,7 +7,7 @@
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <title>Hopwire Inspector</title>
9
9
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
10
- <script type="module" crossorigin src="./assets/index-CdyIIKdA.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-TosvUM6Z.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="./assets/index-Du4-DCNN.css">
12
12
  </head>
13
13
  <body class="bg-ground font-sans text-ink antialiased">
package/dist/output.js CHANGED
@@ -21,6 +21,22 @@ export function relayLine(edgeUrl, problem) {
21
21
  ? `Relay on: teammates without a direct connection reach this machine through the edge at ${edgeUrl.origin}; the edge sees addresses, your organisation, keys and byte counts, never content`
22
22
  : `Relay not connected yet (${problem}); trying again, direct P2P works meanwhile`;
23
23
  }
24
+ /**
25
+ * The line of a sharer whose announcement no DHT node answered: the network drops the DHT's UDP, so teammates will not
26
+ * find this machine over P2P. What to do depends on what it already runs with.
27
+ */
28
+ export function dhtUnreachableLine(options) {
29
+ const found = 'Network no DHT node answered from this network (UDP blocked?), so teammates will not find this machine over P2P';
30
+ if (options.relay) {
31
+ return `${found}; they reach it through the relay`;
32
+ }
33
+ if (options.yaml === true) {
34
+ const set = options.team ? 'p2p.relay: true' : 'p2p.team: true and p2p.relay: true';
35
+ return `${found}. On the Team plan set ${set} in hopwire.yaml; without it, make the service public (public: true). hopwire doctor --network says more`;
36
+ }
37
+ const restart = options.team ? 'restart with --relay' : 'restart with --team --relay';
38
+ return `${found}. On the Team plan ${restart}; without it, use public mode (--public). hopwire doctor --network says more`;
39
+ }
24
40
  /** The line of watch or connect when the connection came through the relay. */
25
41
  export function relayedLine(edgeUrl) {
26
42
  return `Relay through the edge at ${edgeUrl.origin}: no direct connection came about; the edge sees addresses, your organisation, keys and byte counts, never content`;
@@ -144,6 +160,11 @@ export function printable(text) {
144
160
  return text.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu, (character) => `\\u{${(character.codePointAt(0) ?? 0).toString(16).padStart(4, '0')}}`);
145
161
  }
146
162
  /** Start and end of a key, enough to recognise it in a sentence. */
163
+ /**
164
+ * Appended when a teammate's key was not found on the DHT: the sharer's network may keep it off the DHT (UDP blocked),
165
+ * which only doctor on the sharing machine can tell, and the relay is the way then.
166
+ */
167
+ export const TEAMMATE_NETWORK_HINT = 'If it is, their network may block the DHT: ask your teammate to run hopwire doctor --network on the sharing machine. On the Team plan both sides then use --team --relay.';
147
168
  export function shortKey(key) {
148
169
  return `${key.slice(0, 8)}...${key.slice(-4)}`;
149
170
  }
package/dist/p2p.js CHANGED
@@ -316,7 +316,14 @@ export async function startSharing(options) {
316
316
  await close().catch(() => { });
317
317
  throw error;
318
318
  }
319
- return { peerKey: identity.publicKey.toString('hex'), relayProblem, close };
319
+ return { peerKey: identity.publicKey.toString('hex'), relayProblem, dhtReached: dhtAnswered(dht), close };
320
+ }
321
+ /**
322
+ * Whether any DHT node ever answered this node. HyperDHT considers itself bootstrapped and its server listening even
323
+ * when no node answered (a network that drops UDP), so this is the one sign that the DHT was reached.
324
+ */
325
+ export function dhtAnswered(dht) {
326
+ return dht.stats.requests.responses > 0;
320
327
  }
321
328
  /**
322
329
  * Keeps a teammate's stream from staying open without doing anything: it is destroyed when it has no request in
@@ -386,43 +393,109 @@ export class PeerConnectError extends Error {
386
393
  const SHARER_ANSWERS = ['unknown_service', 'service_required', 'bad_preface', 'busy'];
387
394
  /** How long `probeNetwork` waits for the DHT. */
388
395
  const PROBE_TIMEOUT_MS = 15_000;
396
+ /** How long `probeNetwork` waits for the connection to this machine itself; a failed hole punch takes about 11 seconds. */
397
+ const SAME_NETWORK_TIMEOUT_MS = 20_000;
389
398
  /**
390
- * What the DHT says about the network of this machine, for `hopwire doctor --network`: `open` (reachable from
391
- * outside as it is), `consistent` (one outside port, so hole punching has something to aim at), `randomized` (a new
392
- * outside port for every destination, a symmetric NAT) or `unreachable` (no answer from the DHT in time). The node
393
- * announces nothing and is destroyed before this resolves.
399
+ * What the DHT says about the network of this machine, for `hopwire doctor --network`.
400
+ *
401
+ * `nat`: `open` (reachable from outside as it is), `consistent` (one outside port, so hole punching has something to
402
+ * aim at), `randomized` (a new outside port for every destination, a symmetric NAT) or `unreachable` (no answer from
403
+ * the DHT in time).
404
+ *
405
+ * `sameNetwork`: a second node on this machine connects to the first one with the LAN shortcut off, so the
406
+ * connection has to go out through the outside address of this network and come back in, as it does between two
407
+ * machines on one network that cannot reach each other locally (guest and office Wi-Fi often keep devices apart).
408
+ * The first node announces a throwaway key for that; both nodes are destroyed before this resolves.
394
409
  */
395
410
  export async function probeNetwork(options) {
396
411
  options.signal?.throwIfAborted();
397
412
  const dht = new HyperDHT({ bootstrap: options.bootstrap });
398
- let timer;
413
+ let client;
399
414
  let stop;
415
+ const aborted = new Promise((_, reject) => {
416
+ stop = () => reject(options.signal?.reason);
417
+ options.signal?.addEventListener('abort', stop, { once: true });
418
+ });
419
+ try {
420
+ // Bootstrapped is not reached: HyperDHT also counts itself bootstrapped when no node ever answered (UDP dropped)
421
+ if (!(await Promise.race([within(dht.fullyBootstrapped(), PROBE_TIMEOUT_MS), aborted])) || !dhtAnswered(dht)) {
422
+ return { nat: 'unreachable', sameNetwork: 'unknown' };
423
+ }
424
+ const nat = !dht.firewalled ? 'open' : dht.randomized ? 'randomized' : 'consistent';
425
+ client = new HyperDHT({ bootstrap: options.bootstrap });
426
+ const sameNetwork = await Promise.race([connectToSelf(dht, client), aborted]);
427
+ return { nat, sameNetwork };
428
+ }
429
+ finally {
430
+ if (stop !== undefined) {
431
+ options.signal?.removeEventListener('abort', stop);
432
+ }
433
+ await Promise.all([
434
+ dht.destroy({ force: true }).catch(() => { }),
435
+ client?.destroy({ force: true }).catch(() => { }),
436
+ ]);
437
+ }
438
+ }
439
+ /** Resolves true once `work` resolves, false when `ms` passed first or it rejected. */
440
+ async function within(work, ms) {
441
+ let timer;
400
442
  try {
401
- const joined = await Promise.race([
402
- dht.fullyBootstrapped().then(() => true),
443
+ return await Promise.race([
444
+ work.then(() => true, () => false),
403
445
  new Promise((resolve) => {
404
- timer = setTimeout(() => resolve(false), PROBE_TIMEOUT_MS);
405
- }),
406
- new Promise((_, reject) => {
407
- stop = () => reject(options.signal?.reason);
408
- options.signal?.addEventListener('abort', stop, { once: true });
446
+ timer = setTimeout(() => resolve(false), ms);
409
447
  }),
410
448
  ]);
411
- if (!joined) {
412
- return 'unreachable';
413
- }
414
- if (!dht.firewalled) {
415
- return 'open';
416
- }
417
- return dht.randomized ? 'randomized' : 'consistent';
418
449
  }
419
450
  finally {
420
451
  clearTimeout(timer);
421
- if (stop !== undefined) {
422
- options.signal?.removeEventListener('abort', stop);
452
+ }
453
+ }
454
+ /** HyperDHT errors that mean the hole punch itself did not come about, as opposed to a lookup that found nobody. */
455
+ const HOLEPUNCH_FAILURES = new Set([
456
+ 'HOLEPUNCH_ABORTED',
457
+ 'HOLEPUNCH_PROBE_TIMEOUT',
458
+ 'HOLEPUNCH_DOUBLE_RANDOMIZED_NATS',
459
+ 'CANNOT_HOLEPUNCH',
460
+ 'REMOTE_NOT_HOLEPUNCHING',
461
+ 'REMOTE_NOT_HOLEPUNCHABLE',
462
+ 'HANDSHAKE_UNFINISHED',
463
+ 'PEER_CONNECTION_FAILED',
464
+ ]);
465
+ /** `server` listens on a throwaway key, `client` connects to it without the LAN shortcut. */
466
+ async function connectToSelf(server, client) {
467
+ const listener = server.createServer({}, (stream) => {
468
+ stream.on('error', () => { });
469
+ stream.end();
470
+ });
471
+ const keyPair = HyperDHT.keyPair();
472
+ let timer;
473
+ let stream;
474
+ try {
475
+ const ready = await within(Promise.all([listener.listen(keyPair), client.fullyBootstrapped()]), PROBE_TIMEOUT_MS);
476
+ if (!ready) {
477
+ return 'unknown';
423
478
  }
424
- await dht.destroy({ force: true }).catch(() => { });
479
+ const connecting = client.connect(keyPair.publicKey, { localConnection: false });
480
+ stream = connecting;
481
+ return await new Promise((resolve) => {
482
+ connecting.once('open', () => resolve('works'));
483
+ connecting.once('error', (error) => resolve(sameNetworkFailure(error)));
484
+ // A hole punch that neither opens nor fails in time did not come about
485
+ timer = setTimeout(() => resolve('fails'), SAME_NETWORK_TIMEOUT_MS);
486
+ });
425
487
  }
488
+ finally {
489
+ clearTimeout(timer);
490
+ stream?.on('error', () => { });
491
+ stream?.destroy();
492
+ await listener.close().catch(() => { });
493
+ }
494
+ }
495
+ /** What a failed connection to this machine itself says about the network. */
496
+ export function sameNetworkFailure(error) {
497
+ const code = typeof error === 'object' && error !== null && 'code' in error ? error.code : undefined;
498
+ return typeof code === 'string' && HOLEPUNCH_FAILURES.has(code) ? 'fails' : 'unknown';
426
499
  }
427
500
  /**
428
501
  * The connecting side of p2pConnect: every call of `open` is one stream to the peer key, end-to-end encrypted. Direct
package/dist/serve.js CHANGED
@@ -144,6 +144,7 @@ export async function startServing(options) {
144
144
  let peerKey = null;
145
145
  let team = null;
146
146
  let relay = null;
147
+ let dhtReached = null;
147
148
  if (options.share) {
148
149
  proceed();
149
150
  const identity = await loadOrCreateIdentity(options.dataDir);
@@ -185,6 +186,7 @@ export async function startServing(options) {
185
186
  });
186
187
  supervisor.add('p2p', () => sharing.close());
187
188
  peerKey = sharing.peerKey;
189
+ dhtReached = sharing.dhtReached;
188
190
  if (options.relay !== undefined) {
189
191
  relay = { edgeUrl: options.relay.edgeUrl, problem: sharing.relayProblem };
190
192
  }
@@ -309,6 +311,7 @@ export async function startServing(options) {
309
311
  peerKey,
310
312
  team,
311
313
  relay,
314
+ dhtReached,
312
315
  ended: endings.length > 0 ? Promise.race(endings) : new Promise(() => { }),
313
316
  close: supervisor.close,
314
317
  };