@vite-hub/comments 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +0 -1
- package/dist/{client-files-lC6X7XyS.js → client-files-CMPJEd21.js} +0 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -5
- package/dist/database.js +1 -1
- package/dist/{define-C-LUOouq.js → define-hs9Z38io.js} +0 -1
- package/dist/hosted/hosted-comments/frame.js +4 -4
- package/dist/hosted/hosted-comments/tools.js +59 -56
- package/dist/{index-d6NsDxu9.d.ts → index-CbXek64X.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -6
- package/dist/{install-BueV_fJY.js → install--HecUN5c.js} +2 -19
- package/dist/{install-F-_O7zDr.d.ts → install-C3CW6Vvw.d.ts} +4 -4
- package/dist/{migrate-oseJAYbm.js → migrate-cxoJK4JQ.js} +0 -18
- package/dist/{operations-jaihyWw2.d.ts → operations-D0EO1pzL.d.ts} +3 -7
- package/dist/{operations-0llC5kKO.js → operations-DHXmbtb3.js} +3 -30
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +2 -2
- package/dist/overlay/client-BszZKIf8.js +4 -0
- package/dist/overlay/overlay.js +38 -35
- package/dist/page/loader.js +14 -11
- package/dist/{page-CDhmXO-y.js → page-CJz1K67L.js} +1 -1
- package/dist/{page-BgvzzsJb.d.ts → page-DRM1j84-.d.ts} +1 -1
- package/dist/{path-8yqMd8zR.js → path-sv8kjq3i.js} +0 -4
- package/dist/{plugin-DGUqlc3C.js → plugin-DczA2K-y.js} +3 -3
- package/dist/realtime.d.ts +5 -5
- package/dist/realtime.js +2 -2
- package/dist/{rpc-kkxzQ3Qy.js → rpc-51X1TWKb.js} +1 -1
- package/dist/{rpc-D-eqtyfh.d.ts → rpc-DZB3yU0z.d.ts} +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/runtime/auth.d.ts +1 -1
- package/dist/runtime/console.js +2 -2
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +8 -30
- package/dist/server.d.ts +7 -7
- package/dist/server.js +6 -6
- package/dist/{service-DaMq8TBw.js → service-DFMwCr60.js} +2 -12
- package/dist/{service-CMVA_Ryv.d.ts → service-qaMuJ7UX.d.ts} +2 -2
- package/dist/{session-B7GDrqsK.js → session-1SI3_wLJ.js} +11 -30
- package/dist/{session-EzQqBeE8.d.ts → session-CK3Rnjto.d.ts} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +0 -1
- package/dist/{tokens-Bx4lZ0yt.js → tokens-WRh__ppm.js} +0 -1
- package/dist/{types-BX3vH18p.d.ts → types-BmzTyGt-.d.ts} +4 -0
- package/dist/{types-qzJKgWYS.d.ts → types-VSVs4jIw.d.ts} +1 -1
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +2 -33
- package/package.json +7 -7
- package/dist/overlay/client-ZBsUybIe.js +0 -4
|
@@ -5,29 +5,29 @@ button[aria-pressed=true],button[aria-expanded=true]{background:var(--vitehub-pi
|
|
|
5
5
|
button:focus-visible{outline:2px solid var(--vitehub-pill-on);outline-offset:1px}
|
|
6
6
|
button svg{width:14px;height:14px;flex:none}
|
|
7
7
|
@media(any-pointer:coarse){button{min-width:44px;height:44px}}
|
|
8
|
-
@media(prefers-reduced-motion:reduce){button{transition:none}}`,_=`data-vitehub-pill`,v=`data-vitehub-page-tools`,`${JSON.stringify([u,...d])}`,y=`vitehub.page-tools.session`}));function x(){return rt?.matches??!1}function S(){let e=x();if(e!==it){it=e;for(let t of nt)t(e)}}function C(){rt||typeof matchMedia!=`function`||(rt=matchMedia(`(prefers-reduced-motion: reduce)`),rt.addEventListener?.(`change`,S),it=x())}function w(){return C(),x()}function T(e){return C(),nt.add(e),()=>nt.delete(e)}function E(){return ft}function D(e){let t=Math.min(.032,dt?(e-dt)/1e3:.016)/ft;dt=e;let n=Array.from(ot),r=Array.from(st);for(let[e,r]of n)if(ot.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&O(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&O(e)}e.frame(e.value,e.velocity)}for(let e of r)st.has(e)&&e(t)===!1&&st.delete(e);ot.size||st.size?ut=requestAnimationFrame(D):(ut=0,dt=0)}function O(e){e.value=e.target,e.velocity=0,e.tween=void 0,ot.delete(e)}function k(e){ot.set(e,++ct),ut||=requestAnimationFrame(D)}function A(e){let t=t=>e(t);return st.add(t),ut||=requestAnimationFrame(D),()=>{st.delete(t)}}function ee(e){if(!e)return;let t=Array.from(ot);for(let[e,n]of t)ot.get(e)!==n||e.tween||(O(e),e.frame(e.value,0))}function j(e,t,n=at.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return ot.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&w())return i.set(e);t.tween===void 0&&!lt&&(lt=!0,T(ee)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},k(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,ot.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,ot.delete(r)}};return i}function M(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function N(){let e=Reflect.get(globalThis,_t);if(e&&e!==vt&&typeof e==`object`&&`define`in e&&`install`in e)return e}function te(e){vt=e,Reflect.get(globalThis,_t)||Reflect.set(globalThis,_t,e)}function P(e){let t=[...ht.values()];ht.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function F(e,t=w){let n={effect:e,isReduced:t};ht.set(e.name,n);for(let e of gt)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(ht.get(e.name)===n){ht.delete(e.name);for(let e of gt)e()}}}function I(){return[...ht.values()].map(e=>e.effect)}function ne(){return[...ht.values()]}function re(e){return gt.add(e),()=>gt.delete(e)}function L(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}function ie(e,t){if(Et.has(t))return!1;try{return e.matches(t)}catch{return Et.add(t),!1}}function ae(e){let t=e;for(;;){for(let e of yt.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&yt.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function R(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&ie(e,t));return r===-1||r<=n||!ae(e[r])?void 0:e[r]}function oe(e,t,n){se(e,!0);let r=Tt(t),i=[];for(let{effect:a,isReduced:o}of ne()){if(!a.press||o())continue;let s=R(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>ce(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(xt.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,fe,{capture:!0,passive:!0}))}function se(e,t=!1){let n=xt.get(e);if(n){xt.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();le()}}function ce(e,t,n=!1){let r=xt.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||xt.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),le())}function le(){[...xt.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,fe,{capture:!0})}function ue(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(St={event:e,path:t}),oe(e.pointerId,e,t)}function de(e){St?.event.pointerId===e.pointerId&&(St=void 0),se(e.pointerId,e.type===`pointercancel`)}function fe(e){for(let{press:t}of xt.get(e.pointerId)??[])t.move?.(e)}function pe(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||oe(`key`,e,t)}function me(e){(e.key===` `||e.key===`Enter`)&&se(`key`)}function he(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)ie(e,t.selector)&&!M(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function ge(e){if(!St||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=ne().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=St,i=xt.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&ce(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!ae(e)||M(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),xt.set(n.pointerId,i),document.addEventListener(`pointermove`,fe,{capture:!0,passive:!0}))}function _e(e){let t=[...new Set(e)],n=I(),r=new Map;he(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){ge(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&ie(t,r.selector)&&!M(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=ie(t,e.selector);if(Et.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)M(t)||e.enter(t)}}}function ve(e,t){let n=I().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...mt,...I().some(e=>e.name===`divider`)?[pt]:[]],attributeOldValue:!0,childList:n||I().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function ye(e,t){let n=I();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function be(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,ue,e),document.addEventListener(`pointerup`,de,e),document.addEventListener(`pointercancel`,de,e),document.addEventListener(`keydown`,pe,e),document.addEventListener(`keyup`,me,e),Ct=[()=>{document.removeEventListener(`pointerdown`,ue,e),document.removeEventListener(`pointerup`,de,e),document.removeEventListener(`pointercancel`,de,e),document.removeEventListener(`keydown`,pe,e),document.removeEventListener(`keyup`,me,e),St=void 0;for(let e of xt.keys())se(e,!0)},T(e=>{if(e){St=void 0;for(let e of xt.keys())se(e,!0)}})]}function xe(e,t){if(typeof document>`u`)return()=>{};let n=N();return n?(P(n),n.install(e,t.effects,w)):(te(Dt),Se(e,t.effects))}function Se(e,t,n=w){let r=new Set(I().map(e=>e.name));for(let e of t)r.has(e.name)||F(e,n);if(!bt){be();let e=new MutationObserver((e,t)=>_e(e.concat(t.takeRecords())));bt=e,Ct.push(re(()=>{for(let[t,{watchers:n}]of yt)ve(t,e),ye(t,n)}))}let i=yt.get(e);if(i)i.installs++;else{let t=new Map;ve(e,bt),yt.set(e,{installs:1,watchers:t}),ye(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=yt.get(e);if(!t||--t.installs>0)return;yt.delete(e);let n=bt,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(yt.size){for(let e of yt.keys())ve(e,n);r.length&&queueMicrotask(()=>{if(bt!==n)return;let e=[...yt.keys()];_e(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{bt=void 0;for(let e of Ct)e();Ct=[]}}}function Ce(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}function we(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??Ot,c=w(),l=0;return{stop:A(n=>{l+=n;let u=!c&&w()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function Te(e,t,n=Ot,r=0){let i=()=>{},a=new Promise(e=>i=e),o=we(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}function Ee(){let e=Reflect.get(globalThis,Pt);return e===`opt-in`||e===`all`?e:`buttons`}function De(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function Oe(e){let t=Ee();return t===`buttons`?e.matches(Nt)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function ke(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(Mt);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!Oe(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:Lt(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(Mt)?{target:r,amount:.15}:{target:e,amount:Lt(e)}}function Ae(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function je(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}function Me(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}function Ne(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function Pe(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(Wt))}function Fe(e,t={}){let n=t.items??Pe,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){L(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;L(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:j(0,n,at.snappy),y:j(0,n,at.snappy),grow:j(1,n,zt),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),L(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:at.snappy,velocity:n})}function f(t,n,r){if(!Ne(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=Me(t);o.setAttribute(Wt,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),L(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),w()){let e=Te(.15,e=>L(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=Gt(r.getBoundingClientRect()),t=Gt(n),i=Te(Ht,n=>{L(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},Ut);s.stop=i.stop,i.done.then(c);return}let l=j(1,e=>{L(o,{scale:(Vt+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},Bt);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=Gt(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=M(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=Gt(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!Ne(a.rect)&&!Ne(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!Ne(n)||t.movesOnly)return;let o=l(e),s=_[i];if(w())o.from={x:0,y:0,scale:1};else if(s){let e=Gt(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:Vt};o.grow.set(0),o.grow.to(1,w()?{tween:.15}:{preset:zt})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}function Ie(e,t){let n=e.parentElement;n&&!t.aborted&&(Kt.set(e,n),t.addEventListener(`abort`,()=>{Kt.delete(e),Be(e),Kt.size||(qt?.stop(),qt=void 0)},{once:!0}),qt??=Le(),qt.refresh())}function Le(){let e=new AbortController,t=new Set([document]),n=new Set,r=document.createElement(`div`);r.popover=`manual`,r.style.cssText=`all:initial!important;display:block!important;position:fixed!important;inset:0 auto auto 0!important;width:2px!important;height:2px!important;opacity:0!important`;let i=(e=!1)=>{let t=Re(n,r)??ze();for(let[n,r]of Kt){if(!n.parentElement)continue;let i=t??r;i.isConnected&&(n.parentElement!==i&&(Be(n),i.append(n)),t?typeof n.showPopover==`function`&&(e||!n.matches(`:popover-open`))&&(Be(n),n.popover=`manual`,n.showPopover()):Be(n))}},a=new MutationObserver(e=>{let c=!1,l=!1;for(let t of e){t.target instanceof HTMLDialogElement&&t.type===`attributes`&&(c=!0,t.target.matches(`:modal`)&&(l=!0));for(let e of t.addedNodes)e instanceof Element&&e.isConnected&&e!==r&&!(e instanceof HTMLElement&&Kt.has(e))&&s(e)&&(c=!0)}for(let e of n)e.isConnected||(n.delete(e),c=!0);let u=!1;for(let e of t)e instanceof ShadowRoot&&!e.host.isConnected&&(t.delete(e),u=!0);if(u){a.disconnect();for(let e of t)o(e)}(c||[...Kt.keys()].some(e=>!e.isConnected&&e.parentElement))&&i(l)});function o(e){a.observe(e,{attributes:!0,attributeFilter:[`open`],childList:!0,subtree:!0})}function s(e){let t=!1,r=e=>{e instanceof HTMLDialogElement&&!n.has(e)&&(n.add(e),t=!0),e.shadowRoot&&c(e.shadowRoot)&&(t=!0)};e instanceof Element&&r(e);for(let t of e.querySelectorAll(`*`))r(t);return t}function c(e){return!t.has(e)&&(t.add(e),o(e),s(e))}return o(document),document.addEventListener(`focusin`,t=>{let n=!1;for(let e of t.composedPath())e instanceof ShadowRoot&&e.mode===`open`&&c(e)&&(n=!0);n&&queueMicrotask(()=>{e.signal.aborted||i()})},{signal:e.signal}),document.addEventListener(`fullscreenchange`,()=>i(!0),{signal:e.signal}),{refresh(){s(document.documentElement),i()},stop(){a.disconnect(),e.abort()}}}function Re(e,t){let n=[...e].filter(e=>e.isConnected&&e.matches(`:modal`));return n.length<2||typeof t.showPopover!=`function`?n[0]:n.find(e=>{let n=e.getRootNode();e.append(t),t.showPopover();let r=(n instanceof ShadowRoot?n:document).elementFromPoint(1,1);return t.hidePopover(),t.remove(),r===t})}function ze(){let e=document.fullscreenElement;for(;e?.shadowRoot?.fullscreenElement&&e.shadowRoot.fullscreenElement!==e;)e=e.shadowRoot.fullscreenElement;return e}function Be(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.removeAttribute(`popover`))}function Ve(e,t,n){let r=(1-n).toFixed(4),i=n.toFixed(4);return $t(e.map(([e,n],a)=>[`calc(${e} * ${r} + ${t[a][0]} * ${i})`,`calc(${n} * ${r} + ${t[a][1]} * ${i})`]))}function He(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[t,i]of Object.entries({viewBox:e,"aria-hidden":`true`,...n}))r.setAttribute(t,i);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`d`,t),r.append(i),r}function Ue(){let e=He(`0 0 20 18`,en,{class:`pill-hexagon`}),t=e.querySelector(`path`);return t.setAttribute(`stroke-width`,`2`),t.setAttribute(`vector-effect`,`non-scaling-stroke`),e}function We(e){return sn.some(t=>t===e)}function Ge(e){let t=typeof e==`object`&&e?Reflect.get(e,`edge`):void 0,n=typeof e==`object`&&e?Reflect.get(e,`at`):void 0;return We(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function z(e){try{return Ge(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function Ke(e,t,n,r){let i=Math.min(70,r/4),a=Math.atan2(t-r/2,e-n/2),o=Math.atan2(i-r/2,-n/2),s=Math.atan2(i-r/2,n/2),c=Math.atan2(r/2-i,n/2),l=Math.atan2(r/2-i,-n/2);return a>=o&&a<=s?`top`:a>s&&a<c?`right`:a>=c&&a<=l?`bottom`:`left`}function qe(e,t,n,r,i){let a=i-n-r-t,o=a>0?Math.min(100,Math.max(0,(e-n-t/2)/a*100)):50;return o<2?0:o>98?100:Math.abs(o-50)<3?50:Math.round(o*10)/10}function Je(e,t,n,r={top:0,right:0,bottom:0,left:0},i=0){let a=e.width-Math.max(16,r.left)-Math.max(16,r.right),o=e.width>640?Math.max(12,r.top)+40:r.top,s=t=>e.height-o-Math.max(Math.max(16,r.bottom)+t,i)-8;return a-t.width-8>=300?{fit:`beside`,width:a-t.width-8,height:s(n?54:38)}:s(t.height)>=240?{fit:`above`,width:a,height:s(t.height)}:{fit:`fold`,width:a,height:s(n?54:38)}}function Ye(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function Xe(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?Qt:Zt,o=()=>n.querySelector(`svg`),s={x:0,y:0},c=1,l=!1,u,d=[],f=()=>{if(e.toggleAttribute(`folding`,l||p.active),!l&&!p.active&&!m.active&&!h.active){L(t,{"clip-path":null}),L(e,{translate:null}),L(n,{translate:null});let r=o();r&&L(r,{scale:null});for(let e of d)e();d=[],i();return}let r=e.hasAttribute(`collapsed`),u=p.value;L(t,{"clip-path":l||p.active?Ve(Yt,a(),u):null}),L(e,{translate:`${m.value.toFixed(2)}px ${h.value.toFixed(2)}px`});let f=r?s:{x:0,y:0};L(n,{translate:`${(s.x*u-f.x).toFixed(2)}px ${(s.y*u-f.y).toFixed(2)}px`});let g=o();g&&L(g,{scale:((1+(c-1)*u)/(r?c:1)).toFixed(4)})},p=j(0,f,at.snappy),m=j(0,f,at.snappy),h=j(0,f,at.snappy),g=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-m.value,y:e.top+e.height/2-h.value}},_=()=>{s={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(c=Ye(o()))};return{get moving(){return l||p.active||m.active||h.active},move(t,n=0){r();let i=new Promise(e=>d.push(e)),a=g(),o=e.hasAttribute(`collapsed`);_(),t(),_();let s=g(),c=e.hasAttribute(`collapsed`);clearTimeout(u),l=!0;for(let[e,t]of[[m,a.x-s.x+m.value],[h,a.y-s.y+h.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}p.active||p.set(+!!o);let f=()=>{l=!1,m.to(0,{preset:at.snappy}),h.to(0,{preset:at.snappy}),p.to(+!!c,{preset:at.snappy})};return n>0&&!w()?u=setTimeout(f,n*E()):f(),i}}}function Ze(e){let{signal:t}=e,n=document.createElement(e.name);n.style.viewTransitionName=e.name,e.fold===`mark`&&n.setAttribute(`fold`,`mark`);let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=on;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label),e.fold!==`mark`&&a.append(Ue());let o=document.createElement(`button`);o.className=`mark`,o.dataset.motionPress=``,o.append(e.mark);let s=e.initial?.collapsed===!0,c=t=>{t&&a.scrollTo(0,0),n.toggleAttribute(`collapsed`,t),t&&e.fold!==`mark`?o.dataset.motionPressTarget=`[role=toolbar]`:delete o.dataset.motionPressTarget,o.setAttribute(`aria-expanded`,String(!t)),o.setAttribute(`aria-label`,`${t?`Show`:`Hide`} ${e.label}`),o.title=`${o.getAttribute(`aria-label`)}. Drag to move.`},l=()=>e.markOnly?.active()===!0,u=e.markOnly?.opened===!0,d=()=>l()?!u:tt(e.storage.collapsed)??s;c(d());let f=e=>{let t=v,r=e&&n.contains(document.activeElement);y=void 0,e&&t.edge!==`bottom`&&b(_)&&(y=t),te.move(()=>{c(e),O(_)},e&&!n.hasAttribute(`collapsed`)?40:0).then(()=>{y&&(y=void 0,n.hasAttribute(`collapsed`)&&O(_))}),r&&o.focus({preventScroll:!0})};o.addEventListener(`click`,()=>{if(k())return;let t=!n.hasAttribute(`collapsed`);if(w=!1,f(t),!t&&E()&&e.windows?.hide(),l())u=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let p=e.exit,m;p&&(m=document.createElement(`button`),m.className=`exit`,m.dataset.motionPress=``,m.setAttribute(`aria-label`,p.label),m.title=p.label,m.append(He(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),p.menu||m.addEventListener(`click`,e=>p.press(e.detail===0))),a.append(o,...m?[m]:[]);let h=document.createElement(`slot`);h.name=`tab`,h.className=`tabs`;let g=document.createElement(`span`);g.className=`page-bar`,r.append(i,h,a,g),m&&p?.menu&&r.append(...p.menu(m));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,m??null)}let _=z(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},v=_,y,b=e=>l()&&!n.hasAttribute(`dragging`)&&e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:void 0,x=()=>v.edge===`left`||v.edge===`right`,S=matchMedia(`(any-pointer: coarse)`),C={width:0,height:0},w=!1,T=()=>{let e=getComputedStyle(n),t=t=>Number.parseFloat(e.getPropertyValue(`--safe-${t}`))||0,r=Number.parseFloat(getComputedStyle(g).height)||0;return Je({width:innerWidth,height:innerHeight},C,S.matches,{top:t(`top`),right:t(`right`),bottom:t(`bottom`),left:t(`left`)},r)},E=()=>e.windows?.shown()===!0&&b(_)!==void 0&&T().fit===`fold`,D=()=>{let e=!d()&&E();e===w||n.hasAttribute(`dragging`)||(w=e,f(d()||w))},O=t=>{_=t;let r=n.hasAttribute(`collapsed`),i=b(t);v=i?r?y??i:{edge:i.at===0?`left`:`right`,at:100}:t,n.setAttribute(`edge`,v.edge),a.setAttribute(`aria-orientation`,v.edge===`left`||v.edge===`right`?`vertical`:`horizontal`),n.style.setProperty(`--at`,String(v.at));let s=et(n),c=r?x()?s.width:s.height:x()?a.offsetWidth:a.offsetHeight;i&&!r&&(C={width:a.offsetWidth,height:a.offsetHeight});let l=i&&!r&&T().fit===`beside`?{beside:C.width+8}:{thickness:a.offsetHeight};e.onPlace?.(i?{...i,collapsed:!1,...l}:{...v,collapsed:r,thickness:c}),o.style.setProperty(`--vitehub-mark-x`,`${a.clientWidth/2-o.offsetLeft-o.offsetWidth/2}px`),o.style.setProperty(`--vitehub-mark-y`,`${a.clientHeight/2-o.offsetTop-o.offsetHeight/2}px`)},k=$e({host:n,handle:o,dock:()=>_,shape:e=>{let t=n.hasAttribute(`collapsed`),r=t?e?n.offsetHeight:n.offsetWidth:e?a.offsetHeight:a.offsetWidth;return{size:r,lead:t?r/2:e?o.offsetTop+o.offsetHeight/2:o.offsetLeft+o.offsetWidth/2,part:t?e?et(n).height:et(n).width:r,margin:t?2:16}},place:O,drop:()=>{te.move(()=>O(_)).then(D);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:_.edge,at:_.at}))}catch{}},signal:t}),A=Fe(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...m?[m]:[]],movesOnly:!0}),ee={width:0,height:0},M={top:0,right:0,bottom:0,left:0},N=j(0,(e,t)=>{L(a,{"clip-path":t===0&&e===0?null:`inset(${[M.top,M.right,M.bottom,M.left].map(t=>`${(t*e).toFixed(2)}px`).join(` `)} round 12px)`})},at.snappy),te=Xe(n,a,o,()=>N.stop(),()=>A.measure());cn.set(n,te);let P=[xe(n,Jt),xe(r,Jt)];if(t.aborted){for(let e of P)e();return n}let F=new ResizeObserver(e=>{if(O(_),D(),!e.some(e=>e.target===a))return;let t=ee;if(ee={width:a.offsetWidth,height:a.offsetHeight},n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||te.moving)return;if(!t.width)return A.measure();A.play(),A.measure();let r={x:ee.width-t.width,y:ee.height-t.height},i={x:x()?v.edge===`right`?r.x:0:r.x*v.at/100,y:x()?r.y*v.at/100:v.edge===`bottom`?r.y:0};M={top:Math.max(0,i.y),right:Math.max(0,r.x-i.x),bottom:Math.max(0,r.y-i.y),left:Math.max(0,i.x)},(M.top||M.right||M.bottom||M.left)&&(N.set(1),N.to(0,{preset:at.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),F.disconnect(),N.stop(),A.destroy();for(let e of P)e()},{once:!0}),(e.parent??document.documentElement).append(n),Ie(n,t),O(_),t.aborted||(F.observe(a),F.observe(g),addEventListener(`resize`,()=>{O(_),D()},{signal:t}),e.windows?.watch(D,t),e.markOnly?.watch(()=>{u=!1,w=!1,f(d())},t)),n}async function Qe(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=cn.get(e);if(!t?.offsetWidth||!n){e.setAttribute(`collapsed`,``);return}Object.assign(t.style,{width:`${t.offsetWidth}px`,height:`${t.offsetHeight}px`});let r=n.move(()=>e.setAttribute(`collapsed`,``),40);await Promise.race([r,new Promise(e=>setTimeout(e,600*E()))])}function $e(e){let{host:t,handle:n}=e,r,i=!1;return n.style.touchAction=`none`,n.addEventListener(`pointerdown`,a=>{if(a.button!==0||r!==void 0)return;r=a.pointerId,i=!1;let o=n.getBoundingClientRect(),s={x:a.clientX-o.left-o.width/2,y:a.clientY-o.top-o.height/2};n.setPointerCapture(a.pointerId);let c=n=>{if(n.pointerId!==a.pointerId||!i&&Math.hypot(n.clientX-a.clientX,n.clientY-a.clientY)<4)return;i=!0,t.setAttribute(`dragging`,``);let r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=n.clientX-s.x,l=n.clientY-s.y,u=Ke(c,l,r,o);u!==t.getAttribute(`edge`)&&e.place({edge:u,at:e.dock().at});let d=u===`left`||u===`right`,{size:f,lead:p,part:m,margin:h}=e.shape(d),g=(d?l:c)-p+f/2,_=getComputedStyle(t),v=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-top`:`--safe-left`))||0),y=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-bottom`:`--safe-right`))||0);e.place({edge:u,at:qe(g,m,v,y,d?o:r)})};n.addEventListener(`pointermove`,c);let l=o=>{o.pointerId===a.pointerId&&(n.removeEventListener(`pointermove`,c),n.removeEventListener(`lostpointercapture`,l),r=void 0,i&&(t.removeAttribute(`dragging`),e.drop(),setTimeout(()=>{i=!1})))};n.addEventListener(`lostpointercapture`,l)},{signal:e.signal}),()=>i}function et(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||24;return{width:t*10/9,height:t}}function tt(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}var nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln=t((()=>{b(),nt=new Set,it=!1,at={snappy:{stiffness:520,damping:34},glide:{stiffness:800,damping:57},soft:{stiffness:380,damping:20}},ot=new Map,st=new Set,ct=0,lt=!1,ut=0,dt=0,ft=1,pt=`data-resize-handle-active`,mt=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],ht=new Map,gt=new Set,_t=Symbol.for(`vite-hub.motion.layer`),yt=new Map,xt=new Map,Ct=[],wt=Symbol.for(`vite-hub.motion.effect-presses`),Tt=e=>{let t=Reflect.get(e,wt);if(t)return t;let n=new Map;return Reflect.set(e,wt,n),n},Et=new Set,Dt={define:F,install:Se},Ot=e=>e,kt={stiffness:900,damping:40},At={stiffness:380,damping:14},jt=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`].map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,Mt=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,Nt=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,Pt=Symbol.for(`vite-hub.motion.press-mode`),Ft=new WeakMap,It=e=>e>=40?.03:e>=32?.04:.05,Lt=e=>Math.min(It(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight)),Rt={name:`press`,selector:jt,press(e,t){if(!(`pointerId`in t))return;let n=ke(e,De(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(Ae(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),je(o,t,i)))return;let s=Ft.get(r);if(!s){let e={amount:i,spring:j(0,t=>{L(r,{scale:t?String(1-e.amount*t):null})},kt)};s=e,Ft.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:kt});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{je(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:At})},cancel:u}}},zt={stiffness:380,damping:26},Bt={stiffness:260,damping:28},Vt=.9,Ht=.32,Ut=Ce(.5,0,.75,0),Wt=`data-motion-ghost`,Gt=e=>({x:e.left+e.width/2,y:e.top+e.height/2}),Kt=new Map,Jt={effects:[Rt]},Yt=[[`0px`,`6px`],[`6px`,`0px`],[`calc(100% - 6px)`,`0px`],[`100%`,`6px`],[`100%`,`50%`],[`100%`,`50%`],[`100%`,`calc(100% - 6px)`],[`calc(100% - 6px)`,`100%`],[`6px`,`100%`],[`0px`,`calc(100% - 6px)`],[`0px`,`50%`],[`0px`,`50%`]],Xt=e=>e.map(([e,t])=>[`calc(50% + var(--vitehub-hex-w) * ${e})`,`calc(50% + var(--vitehub-hex-h) * ${t})`]),Zt=Xt([[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]]),Qt=Xt([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),$t=e=>`polygon(${e.map(([e,t])=>`${e} ${t}`).join(`,`)})`,en=`M19.734 8.156 15.576.844A1.66 1.66 0 0 0 14.135 0H5.819C5.226 0 4.677.32 4.38.844L.222 8.156a1.71 1.71 0 0 0 0 1.688l4.158 7.312c.297.523.846.844 1.439.844h8.316c.593 0 1.142-.32 1.438-.844l4.158-7.312c.3-.523.3-1.165.003-1.688Z`,tn=$t(Yt),nn=$t(Zt),rn=$t(Qt),an=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,on=`:host{all:initial;position:fixed;z-index:2147483001;pointer-events:none;filter:drop-shadow(0 8px 24px rgb(0 0 0/25%));color-scheme:dark;font:500 12px/1 ui-sans-serif,system-ui,sans-serif;color:#d4d4d4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--vitehub-pill-text:#d4d4d4;--vitehub-pill-strong:#fafafa;--vitehub-pill-muted:#a3a3a3;--vitehub-pill-hover:rgb(255 255 255/8%);--vitehub-pill-on:#fafafa;--vitehub-pill-on-text:#0a0a0a;--vitehub-pill-line:rgb(255 255 255/12%);--vitehub-pill-surface:#111;--vitehub-pill-flow:row;--vitehub-hex-h:24px;--vitehub-hex-w:calc(var(--vitehub-hex-h) * 10 / 9);--vitehub-pill-fade:opacity 160ms ease-out 80ms,visibility 0s;--vitehub-pill-fade-end:opacity 160ms ease-out 120ms,visibility 0s;--at:50;--margin:16px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
|
|
8
|
+
@media(prefers-reduced-motion:reduce){button{transition:none}}`,_=`data-vitehub-pill`,v=`data-vitehub-page-tools`,`${JSON.stringify([u,...d])}`,y=`vitehub.page-tools.session`}));function x(){return nt?.matches??!1}function S(){let e=x();if(e!==rt){rt=e;for(let t of tt)t(e)}}function C(){nt||typeof matchMedia!=`function`||(nt=matchMedia(`(prefers-reduced-motion: reduce)`),nt.addEventListener?.(`change`,S),rt=x())}function w(){return C(),x()}function T(e){return C(),tt.add(e),()=>tt.delete(e)}function E(){return dt}function D(e){let t=Math.min(.032,ut?(e-ut)/1e3:.016)/dt;ut=e;let n=Array.from(at),r=Array.from(ot);for(let[e,r]of n)if(at.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&O(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&O(e)}e.frame(e.value,e.velocity)}for(let e of r)ot.has(e)&&e(t)===!1&&ot.delete(e);at.size||ot.size?lt=requestAnimationFrame(D):(lt=0,ut=0)}function O(e){e.value=e.target,e.velocity=0,e.tween=void 0,at.delete(e)}function k(e){at.set(e,++st),lt||=requestAnimationFrame(D)}function A(e){let t=t=>e(t);return ot.add(t),lt||=requestAnimationFrame(D),()=>{ot.delete(t)}}function ee(e){if(!e)return;let t=Array.from(at);for(let[e,n]of t)at.get(e)!==n||e.tween||(O(e),e.frame(e.value,0))}function j(e,t,n=it.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return at.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&w())return i.set(e);t.tween===void 0&&!ct&&(ct=!0,T(ee)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},k(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,at.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,at.delete(r)}};return i}function M(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function N(){let e=Reflect.get(globalThis,gt);if(e&&e!==_t&&typeof e==`object`&&`define`in e&&`install`in e)return e}function te(e){_t=e,Reflect.get(globalThis,gt)||Reflect.set(globalThis,gt,e)}function P(e){let t=[...mt.values()];mt.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function F(e,t=w){let n={effect:e,isReduced:t};mt.set(e.name,n);for(let e of ht)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(mt.get(e.name)===n){mt.delete(e.name);for(let e of ht)e()}}}function I(){return[...mt.values()].map(e=>e.effect)}function ne(){return[...mt.values()]}function re(e){return ht.add(e),()=>ht.delete(e)}function L(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}function R(e,t){if(Tt.has(t))return!1;try{return e.matches(t)}catch{return Tt.add(t),!1}}function ie(e){let t=e;for(;;){for(let e of vt.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&vt.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function z(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&R(e,t));return r===-1||r<=n||!ie(e[r])?void 0:e[r]}function ae(e,t,n){oe(e,!0);let r=wt(t),i=[];for(let{effect:a,isReduced:o}of ne()){if(!a.press||o())continue;let s=z(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>se(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(bt.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,de,{capture:!0,passive:!0}))}function oe(e,t=!1){let n=bt.get(e);if(n){bt.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();ce()}}function se(e,t,n=!1){let r=bt.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||bt.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),ce())}function ce(){[...bt.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,de,{capture:!0})}function le(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(xt={event:e,path:t}),ae(e.pointerId,e,t)}function ue(e){xt?.event.pointerId===e.pointerId&&(xt=void 0),oe(e.pointerId,e.type===`pointercancel`)}function de(e){for(let{press:t}of bt.get(e.pointerId)??[])t.move?.(e)}function fe(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||ae(`key`,e,t)}function pe(e){(e.key===` `||e.key===`Enter`)&&oe(`key`)}function me(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)R(e,t.selector)&&!M(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function he(e){if(!xt||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=ne().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=xt,i=bt.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&se(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!ie(e)||M(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),bt.set(n.pointerId,i),document.addEventListener(`pointermove`,de,{capture:!0,passive:!0}))}function ge(e){let t=[...new Set(e)],n=I(),r=new Map;me(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){he(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&R(t,r.selector)&&!M(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=R(t,e.selector);if(Tt.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)M(t)||e.enter(t)}}}function _e(e,t){let n=I().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...pt,...I().some(e=>e.name===`divider`)?[ft]:[]],attributeOldValue:!0,childList:n||I().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function ve(e,t){let n=I();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function ye(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,le,e),document.addEventListener(`pointerup`,ue,e),document.addEventListener(`pointercancel`,ue,e),document.addEventListener(`keydown`,fe,e),document.addEventListener(`keyup`,pe,e),St=[()=>{document.removeEventListener(`pointerdown`,le,e),document.removeEventListener(`pointerup`,ue,e),document.removeEventListener(`pointercancel`,ue,e),document.removeEventListener(`keydown`,fe,e),document.removeEventListener(`keyup`,pe,e),xt=void 0;for(let e of bt.keys())oe(e,!0)},T(e=>{if(e){xt=void 0;for(let e of bt.keys())oe(e,!0)}})]}function be(e,t){if(typeof document>`u`)return()=>{};let n=N();return n?(P(n),n.install(e,t.effects,w)):(te(Et),xe(e,t.effects))}function xe(e,t,n=w){let r=new Set(I().map(e=>e.name));for(let e of t)r.has(e.name)||F(e,n);if(!yt){ye();let e=new MutationObserver((e,t)=>ge(e.concat(t.takeRecords())));yt=e,St.push(re(()=>{for(let[t,{watchers:n}]of vt)_e(t,e),ve(t,n)}))}let i=vt.get(e);if(i)i.installs++;else{let t=new Map;_e(e,yt),vt.set(e,{installs:1,watchers:t}),ve(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=vt.get(e);if(!t||--t.installs>0)return;vt.delete(e);let n=yt,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(vt.size){for(let e of vt.keys())_e(e,n);r.length&&queueMicrotask(()=>{if(yt!==n)return;let e=[...vt.keys()];ge(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{yt=void 0;for(let e of St)e();St=[]}}}function Se(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}function Ce(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??Dt,c=w(),l=0;return{stop:A(n=>{l+=n;let u=!c&&w()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function we(e,t,n=Dt,r=0){let i=()=>{},a=new Promise(e=>i=e),o=Ce(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}function Te(){let e=Reflect.get(globalThis,Nt);return e===`opt-in`||e===`all`?e:`buttons`}function Ee(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function De(e){let t=Te();return t===`buttons`?e.matches(Mt)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function Oe(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(jt);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!De(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:It(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(jt)?{target:r,amount:.15}:{target:e,amount:It(e)}}function ke(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function Ae(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}function je(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}function Me(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function Ne(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(Ut))}function Pe(e,t={}){let n=t.items??Ne,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){L(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;L(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:j(0,n,it.snappy),y:j(0,n,it.snappy),grow:j(1,n,Rt),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),L(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:it.snappy,velocity:n})}function f(t,n,r){if(!Me(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=je(t);o.setAttribute(Ut,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),L(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),w()){let e=we(.15,e=>L(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=Wt(r.getBoundingClientRect()),t=Wt(n),i=we(Vt,n=>{L(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},Ht);s.stop=i.stop,i.done.then(c);return}let l=j(1,e=>{L(o,{scale:(Bt+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},zt);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=Wt(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=M(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=Wt(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!Me(a.rect)&&!Me(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!Me(n)||t.movesOnly)return;let o=l(e),s=_[i];if(w())o.from={x:0,y:0,scale:1};else if(s){let e=Wt(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:Bt};o.grow.set(0),o.grow.to(1,w()?{tween:.15}:{preset:Rt})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}function Fe(e,t){let n=e.parentElement;n&&!t.aborted&&(Gt.set(e,n),t.addEventListener(`abort`,()=>{Gt.delete(e),ze(e),Gt.size||(Kt?.stop(),Kt=void 0)},{once:!0}),Kt??=Ie(),Kt.refresh())}function Ie(){let e=new AbortController,t=new Set([document]),n=new Set,r=document.createElement(`div`);r.popover=`manual`,r.style.cssText=`all:initial!important;display:block!important;position:fixed!important;inset:0 auto auto 0!important;width:2px!important;height:2px!important;opacity:0!important`;let i=(e=!1)=>{let t=Le(n,r)??Re();for(let[n,r]of Gt){if(!n.parentElement)continue;let i=t??r;i.isConnected&&(n.parentElement!==i&&(ze(n),i.append(n)),t?typeof n.showPopover==`function`&&(e||!n.matches(`:popover-open`))&&(ze(n),n.popover=`manual`,n.showPopover()):ze(n))}},a=new MutationObserver(e=>{let c=!1,l=!1;for(let t of e){t.target instanceof HTMLDialogElement&&t.type===`attributes`&&(c=!0,t.target.matches(`:modal`)&&(l=!0));for(let e of t.addedNodes)e instanceof Element&&e.isConnected&&e!==r&&!(e instanceof HTMLElement&&Gt.has(e))&&s(e)&&(c=!0)}for(let e of n)e.isConnected||(n.delete(e),c=!0);let u=!1;for(let e of t)e instanceof ShadowRoot&&!e.host.isConnected&&(t.delete(e),u=!0);if(u){a.disconnect();for(let e of t)o(e)}(c||[...Gt.keys()].some(e=>!e.isConnected&&e.parentElement))&&i(l)});function o(e){a.observe(e,{attributes:!0,attributeFilter:[`open`],childList:!0,subtree:!0})}function s(e){let t=!1,r=e=>{e instanceof HTMLDialogElement&&!n.has(e)&&(n.add(e),t=!0),e.shadowRoot&&c(e.shadowRoot)&&(t=!0)};e instanceof Element&&r(e);for(let t of e.querySelectorAll(`*`))r(t);return t}function c(e){return!t.has(e)&&(t.add(e),o(e),s(e))}return o(document),document.addEventListener(`focusin`,t=>{let n=!1;for(let e of t.composedPath())e instanceof ShadowRoot&&e.mode===`open`&&c(e)&&(n=!0);n&&queueMicrotask(()=>{e.signal.aborted||i()})},{signal:e.signal}),document.addEventListener(`fullscreenchange`,()=>i(!0),{signal:e.signal}),{refresh(){s(document.documentElement),i()},stop(){a.disconnect(),e.abort()}}}function Le(e,t){let n=[...e].filter(e=>e.isConnected&&e.matches(`:modal`));return n.length<2||typeof t.showPopover!=`function`?n[0]:n.find(e=>{let n=e.getRootNode();e.append(t),t.showPopover();let r=(n instanceof ShadowRoot?n:document).elementFromPoint(1,1);return t.hidePopover(),t.remove(),r===t})}function Re(){let e=document.fullscreenElement;for(;e?.shadowRoot?.fullscreenElement&&e.shadowRoot.fullscreenElement!==e;)e=e.shadowRoot.fullscreenElement;return e}function ze(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.removeAttribute(`popover`))}function Be(e,t,n){let r=(1-n).toFixed(4),i=n.toFixed(4);return Qt(e.map(([e,n],a)=>[`calc(${e} * ${r} + ${t[a][0]} * ${i})`,`calc(${n} * ${r} + ${t[a][1]} * ${i})`]))}function Ve(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[t,i]of Object.entries({viewBox:e,"aria-hidden":`true`,...n}))r.setAttribute(t,i);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`d`,t),r.append(i),r}function He(){let e=Ve(`0 0 20 18`,$t,{class:`pill-hexagon`}),t=e.querySelector(`path`);return t.setAttribute(`stroke-width`,`2`),t.setAttribute(`vector-effect`,`non-scaling-stroke`),e}function Ue(e){return on.some(t=>t===e)}function We(e){let t=typeof e==`object`&&e?Reflect.get(e,`edge`):void 0,n=typeof e==`object`&&e?Reflect.get(e,`at`):void 0;return Ue(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function B(e){try{return We(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function Ge(e,t,n,r){let i=Math.min(70,r/4),a=Math.atan2(t-r/2,e-n/2),o=Math.atan2(i-r/2,-n/2),s=Math.atan2(i-r/2,n/2),c=Math.atan2(r/2-i,n/2),l=Math.atan2(r/2-i,-n/2);return a>=o&&a<=s?`top`:a>s&&a<c?`right`:a>=c&&a<=l?`bottom`:`left`}function Ke(e,t,n,r,i){let a=i-n-r-t,o=a>0?Math.min(100,Math.max(0,(e-n-t/2)/a*100)):50;return o<2?0:o>98?100:Math.abs(o-50)<3?50:Math.round(o*10)/10}function qe(e,t,n,r={top:0,right:0,bottom:0,left:0},i=0){let a=e.width-Math.max(16,r.left)-Math.max(16,r.right),o=e.width>640?Math.max(12,r.top)+40:r.top,s=t=>e.height-o-Math.max(Math.max(16,r.bottom)+t,i)-8;return a-t.width-8>=300?{fit:`beside`,width:a-t.width-8,height:s(n?54:38)}:s(t.height)>=240?{fit:`above`,width:a,height:s(t.height)}:{fit:`fold`,width:a,height:s(n?54:38)}}function Je(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function Ye(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?Zt:Xt,o=()=>n.querySelector(`svg`),s={x:0,y:0},c=1,l=!1,u,d=[],f=()=>{if(e.toggleAttribute(`folding`,l||p.active),!l&&!p.active&&!m.active&&!h.active){L(t,{"clip-path":null}),L(e,{translate:null}),L(n,{translate:null});let r=o();r&&L(r,{scale:null});for(let e of d)e();d=[],i();return}let r=e.hasAttribute(`collapsed`),u=p.value;L(t,{"clip-path":l||p.active?Be(Jt,a(),u):null}),L(e,{translate:`${m.value.toFixed(2)}px ${h.value.toFixed(2)}px`});let f=r?s:{x:0,y:0};L(n,{translate:`${(s.x*u-f.x).toFixed(2)}px ${(s.y*u-f.y).toFixed(2)}px`});let g=o();g&&L(g,{scale:((1+(c-1)*u)/(r?c:1)).toFixed(4)})},p=j(0,f,it.snappy),m=j(0,f,it.snappy),h=j(0,f,it.snappy),g=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-m.value,y:e.top+e.height/2-h.value}},_=()=>{s={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(c=Je(o()))};return{get moving(){return l||p.active||m.active||h.active},move(t,n=0){r();let i=new Promise(e=>d.push(e)),a=g(),o=e.hasAttribute(`collapsed`);_(),t(),_();let s=g(),c=e.hasAttribute(`collapsed`);clearTimeout(u),l=!0;for(let[e,t]of[[m,a.x-s.x+m.value],[h,a.y-s.y+h.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}p.active||p.set(+!!o);let f=()=>{l=!1,m.to(0,{preset:it.snappy}),h.to(0,{preset:it.snappy}),p.to(+!!c,{preset:it.snappy})};return n>0&&!w()?u=setTimeout(f,n*E()):f(),i}}}function Xe(e){let{signal:t}=e,n=document.createElement(e.name);n.style.viewTransitionName=e.name,e.fold===`mark`&&n.setAttribute(`fold`,`mark`);let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=an;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label),e.fold!==`mark`&&a.append(He());let o=document.createElement(`button`);o.className=`mark`,o.dataset.motionPress=``,o.append(e.mark);let s=e.initial?.collapsed===!0,c=t=>{t&&a.scrollTo(0,0),n.toggleAttribute(`collapsed`,t),t&&e.fold!==`mark`?o.dataset.motionPressTarget=`[role=toolbar]`:delete o.dataset.motionPressTarget,o.setAttribute(`aria-expanded`,String(!t)),o.setAttribute(`aria-label`,`${t?`Show`:`Hide`} ${e.label}`),o.title=`${o.getAttribute(`aria-label`)}. Drag to move.`},l=()=>e.markOnly?.active()===!0,u=e.markOnly?.opened===!0,d=()=>l()?!u:et(e.storage.collapsed)??s;c(d());let f=e=>{let t=v,r=e&&n.contains(document.activeElement);y=void 0,e&&t.edge!==`bottom`&&b(_)&&(y=t),te.move(()=>{c(e),O(_)},e&&!n.hasAttribute(`collapsed`)?40:0).then(()=>{y&&(y=void 0,n.hasAttribute(`collapsed`)&&O(_))}),r&&o.focus({preventScroll:!0})};o.addEventListener(`click`,()=>{if(k())return;let t=!n.hasAttribute(`collapsed`);if(w=!1,f(t),!t&&E()&&e.windows?.hide(),l())u=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let p=e.exit,m;p&&(m=document.createElement(`button`),m.className=`exit`,m.dataset.motionPress=``,m.setAttribute(`aria-label`,p.label),m.title=p.label,m.append(Ve(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),p.menu||m.addEventListener(`click`,e=>p.press(e.detail===0))),a.append(o,...m?[m]:[]);let h=document.createElement(`slot`);h.name=`tab`,h.className=`tabs`;let g=document.createElement(`span`);g.className=`page-bar`,r.append(i,h,a,g),m&&p?.menu&&r.append(...p.menu(m));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,m??null)}let _=B(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},v=_,y,b=e=>l()&&!n.hasAttribute(`dragging`)&&e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:void 0,x=()=>v.edge===`left`||v.edge===`right`,S=matchMedia(`(any-pointer: coarse)`),C={width:0,height:0},w=!1,T=()=>{let e=getComputedStyle(n),t=t=>Number.parseFloat(e.getPropertyValue(`--safe-${t}`))||0,r=Number.parseFloat(getComputedStyle(g).height)||0;return qe({width:innerWidth,height:innerHeight},C,S.matches,{top:t(`top`),right:t(`right`),bottom:t(`bottom`),left:t(`left`)},r)},E=()=>e.windows?.shown()===!0&&b(_)!==void 0&&T().fit===`fold`,D=()=>{let e=!d()&&E();e===w||n.hasAttribute(`dragging`)||(w=e,f(d()||w))},O=t=>{_=t;let r=n.hasAttribute(`collapsed`),i=b(t);v=i?r?y??i:{edge:i.at===0?`left`:`right`,at:100}:t,n.setAttribute(`edge`,v.edge),a.setAttribute(`aria-orientation`,v.edge===`left`||v.edge===`right`?`vertical`:`horizontal`),n.style.setProperty(`--at`,String(v.at));let s=$e(n),c=r?x()?s.width:s.height:x()?a.offsetWidth:a.offsetHeight;i&&!r&&(C={width:a.offsetWidth,height:a.offsetHeight});let l=i&&!r&&T().fit===`beside`?{beside:C.width+8}:{thickness:a.offsetHeight};e.onPlace?.(i?{...i,collapsed:!1,...l}:{...v,collapsed:r,thickness:c}),o.style.setProperty(`--vitehub-mark-x`,`${a.clientWidth/2-o.offsetLeft-o.offsetWidth/2}px`),o.style.setProperty(`--vitehub-mark-y`,`${a.clientHeight/2-o.offsetTop-o.offsetHeight/2}px`)},k=Qe({host:n,handle:o,dock:()=>_,shape:e=>{let t=n.hasAttribute(`collapsed`),r=t?e?n.offsetHeight:n.offsetWidth:e?a.offsetHeight:a.offsetWidth;return{size:r,lead:t?r/2:e?o.offsetTop+o.offsetHeight/2:o.offsetLeft+o.offsetWidth/2,part:t?e?$e(n).height:$e(n).width:r,margin:t?2:16}},place:O,drop:()=>{te.move(()=>O(_)).then(D);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:_.edge,at:_.at}))}catch{}},signal:t}),A=Pe(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...m?[m]:[]],movesOnly:!0}),ee={width:0,height:0},M={top:0,right:0,bottom:0,left:0},N=j(0,(e,t)=>{L(a,{"clip-path":t===0&&e===0?null:`inset(${[M.top,M.right,M.bottom,M.left].map(t=>`${(t*e).toFixed(2)}px`).join(` `)} round 12px)`})},it.snappy),te=Ye(n,a,o,()=>N.stop(),()=>A.measure());sn.set(n,te);let P=[be(n,qt),be(r,qt)];if(t.aborted){for(let e of P)e();return n}let F=new ResizeObserver(e=>{if(O(_),D(),!e.some(e=>e.target===a))return;let t=ee;if(ee={width:a.offsetWidth,height:a.offsetHeight},n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||te.moving)return;if(!t.width)return A.measure();A.play(),A.measure();let r={x:ee.width-t.width,y:ee.height-t.height},i={x:x()?v.edge===`right`?r.x:0:r.x*v.at/100,y:x()?r.y*v.at/100:v.edge===`bottom`?r.y:0};M={top:Math.max(0,i.y),right:Math.max(0,r.x-i.x),bottom:Math.max(0,r.y-i.y),left:Math.max(0,i.x)},(M.top||M.right||M.bottom||M.left)&&(N.set(1),N.to(0,{preset:it.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),F.disconnect(),N.stop(),A.destroy();for(let e of P)e()},{once:!0}),(e.parent??document.documentElement).append(n),Fe(n,t),O(_),t.aborted||(F.observe(a),F.observe(g),addEventListener(`resize`,()=>{O(_),D()},{signal:t}),e.windows?.watch(D,t),e.markOnly?.watch(()=>{u=!1,w=!1,f(d())},t)),n}async function Ze(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=sn.get(e);if(!t?.offsetWidth||!n){e.setAttribute(`collapsed`,``);return}Object.assign(t.style,{width:`${t.offsetWidth}px`,height:`${t.offsetHeight}px`});let r=n.move(()=>e.setAttribute(`collapsed`,``),40);await Promise.race([r,new Promise(e=>setTimeout(e,600*E()))])}function Qe(e){let{host:t,handle:n}=e,r,i=!1;return n.style.touchAction=`none`,n.addEventListener(`pointerdown`,a=>{if(a.button!==0||r!==void 0)return;r=a.pointerId,i=!1;let o=n.getBoundingClientRect(),s={x:a.clientX-o.left-o.width/2,y:a.clientY-o.top-o.height/2};n.setPointerCapture(a.pointerId);let c=n=>{if(n.pointerId!==a.pointerId||!i&&Math.hypot(n.clientX-a.clientX,n.clientY-a.clientY)<4)return;i=!0,t.setAttribute(`dragging`,``);let r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=n.clientX-s.x,l=n.clientY-s.y,u=Ge(c,l,r,o);u!==t.getAttribute(`edge`)&&e.place({edge:u,at:e.dock().at});let d=u===`left`||u===`right`,{size:f,lead:p,part:m,margin:h}=e.shape(d),g=(d?l:c)-p+f/2,_=getComputedStyle(t),v=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-top`:`--safe-left`))||0),y=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-bottom`:`--safe-right`))||0);e.place({edge:u,at:Ke(g,m,v,y,d?o:r)})};n.addEventListener(`pointermove`,c);let l=o=>{o.pointerId===a.pointerId&&(n.removeEventListener(`pointermove`,c),n.removeEventListener(`lostpointercapture`,l),r=void 0,i&&(t.removeAttribute(`dragging`),e.drop(),setTimeout(()=>{i=!1})))};n.addEventListener(`lostpointercapture`,l)},{signal:e.signal}),()=>i}function $e(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||20;return{width:t*10/9,height:t}}function et(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}var tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn=t((()=>{b(),tt=new Set,rt=!1,it={snappy:{stiffness:520,damping:34},glide:{stiffness:800,damping:57},soft:{stiffness:380,damping:20}},at=new Map,ot=new Set,st=0,ct=!1,lt=0,ut=0,dt=1,ft=`data-resize-handle-active`,pt=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],mt=new Map,ht=new Set,gt=Symbol.for(`vite-hub.motion.layer`),vt=new Map,bt=new Map,St=[],Ct=Symbol.for(`vite-hub.motion.effect-presses`),wt=e=>{let t=Reflect.get(e,Ct);if(t)return t;let n=new Map;return Reflect.set(e,Ct,n),n},Tt=new Set,Et={define:F,install:xe},Dt=e=>e,Ot={stiffness:900,damping:40},kt={stiffness:380,damping:14},At=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`].map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,jt=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,Mt=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,Nt=Symbol.for(`vite-hub.motion.press-mode`),Pt=new WeakMap,Ft=e=>e>=40?.03:e>=32?.04:.05,It=e=>Math.min(Ft(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight)),Lt={name:`press`,selector:At,press(e,t){if(!(`pointerId`in t))return;let n=Oe(e,Ee(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(ke(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),Ae(o,t,i)))return;let s=Pt.get(r);if(!s){let e={amount:i,spring:j(0,t=>{L(r,{scale:t?String(1-e.amount*t):null})},Ot)};s=e,Pt.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:Ot});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{Ae(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:kt})},cancel:u}}},Rt={stiffness:380,damping:26},zt={stiffness:260,damping:28},Bt=.9,Vt=.32,Ht=Se(.5,0,.75,0),Ut=`data-motion-ghost`,Wt=e=>({x:e.left+e.width/2,y:e.top+e.height/2}),Gt=new Map,qt={effects:[Lt]},Jt=[[`0px`,`6px`],[`6px`,`0px`],[`calc(100% - 6px)`,`0px`],[`100%`,`6px`],[`100%`,`50%`],[`100%`,`50%`],[`100%`,`calc(100% - 6px)`],[`calc(100% - 6px)`,`100%`],[`6px`,`100%`],[`0px`,`calc(100% - 6px)`],[`0px`,`50%`],[`0px`,`50%`]],Yt=e=>e.map(([e,t])=>[`calc(50% + var(--vitehub-hex-w) * ${e})`,`calc(50% + var(--vitehub-hex-h) * ${t})`]),Xt=Yt([[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]]),Zt=Yt([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),Qt=e=>`polygon(${e.map(([e,t])=>`${e} ${t}`).join(`,`)})`,$t=`M19.734 8.156 15.576.844A1.66 1.66 0 0 0 14.135 0H5.819C5.226 0 4.677.32 4.38.844L.222 8.156a1.71 1.71 0 0 0 0 1.688l4.158 7.312c.297.523.846.844 1.439.844h8.316c.593 0 1.142-.32 1.438-.844l4.158-7.312c.3-.523.3-1.165.003-1.688Z`,en=Qt(Jt),tn=Qt(Xt),nn=Qt(Zt),rn=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,an=`:host{all:initial;position:fixed;z-index:2147483001;pointer-events:none;filter:drop-shadow(0 8px 24px rgb(0 0 0/25%));color-scheme:dark;font:500 12px/1 ui-sans-serif,system-ui,sans-serif;color:#d4d4d4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--vitehub-pill-text:#d4d4d4;--vitehub-pill-strong:#fafafa;--vitehub-pill-muted:#a3a3a3;--vitehub-pill-hover:rgb(255 255 255/8%);--vitehub-pill-on:#fafafa;--vitehub-pill-on-text:#0a0a0a;--vitehub-pill-line:rgb(255 255 255/12%);--vitehub-pill-surface:#111;--vitehub-pill-flow:row;--vitehub-hex-h:20px;--vitehub-hex-w:calc(var(--vitehub-hex-h) * 10 / 9);--vitehub-pill-fade:opacity 160ms ease-out 80ms,visibility 0s;--vitehub-pill-fade-end:opacity 160ms ease-out 120ms,visibility 0s;--at:50;--margin:16px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
|
|
9
9
|
:host([collapsed]){--margin:2px;--vitehub-pill-fade:opacity 80ms ease-out,visibility 0s 80ms;--vitehub-pill-fade-end:opacity 40ms ease-out,visibility 0s 40ms}
|
|
10
|
-
:host(:is([edge=top],[edge=bottom])){left:${
|
|
11
|
-
:host(:is([edge=left],[edge=right])){top:${
|
|
10
|
+
:host(:is([edge=top],[edge=bottom])){left:${rn(`0px`)};width:max-content;--start:max(var(--margin),var(--safe-left));--end:max(var(--margin),var(--safe-right));--x:calc(var(--at) * -1%)}
|
|
11
|
+
:host(:is([edge=left],[edge=right])){top:${rn(`0px`)};--start:max(var(--margin),var(--safe-top));--end:max(var(--margin),var(--safe-bottom));--y:calc(var(--at) * -1%);--vitehub-pill-flow:column;--vitehub-pill-justify:flex-start}
|
|
12
12
|
:host([edge=bottom]){bottom:max(16px,var(--safe-bottom))}
|
|
13
13
|
:host([edge=top]){top:max(16px,var(--safe-top))}
|
|
14
14
|
:host([edge=right]){right:max(16px,var(--safe-right))}
|
|
15
15
|
:host([edge=left]){left:max(16px,var(--safe-left))}
|
|
16
|
-
:host([collapsed]:is([edge=top],[edge=bottom])){left:${
|
|
17
|
-
:host([collapsed]:is([edge=left],[edge=right])){top:${
|
|
16
|
+
:host([collapsed]:is([edge=top],[edge=bottom])){left:${rn(`var(--vitehub-hex-w)`)};--x:-50%}
|
|
17
|
+
:host([collapsed]:is([edge=left],[edge=right])){top:${rn(`var(--vitehub-hex-h)`)};--y:-50%}
|
|
18
18
|
:host([collapsed][edge=bottom]){bottom:calc(max(2px,var(--safe-bottom)) + var(--vitehub-hex-h) / 2);--y:50%}
|
|
19
19
|
:host([collapsed][edge=top]){top:calc(max(2px,var(--safe-top)) + var(--vitehub-hex-h) / 2);--y:-50%}
|
|
20
20
|
:host([collapsed][edge=right]){right:calc(max(2px,var(--safe-right)) + var(--vitehub-hex-w) / 2);--x:50%}
|
|
21
21
|
:host([collapsed][edge=left]){left:calc(max(2px,var(--safe-left)) + var(--vitehub-hex-w) / 2);--x:-50%}
|
|
22
22
|
:host{transform:translate(var(--x,0),var(--y,0))}
|
|
23
23
|
:host([dragging]){transition:none;cursor:grabbing;user-select:none;-webkit-user-select:none}
|
|
24
|
-
div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path:${
|
|
24
|
+
div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path:${en};transition:background-color 150ms ease-out}
|
|
25
25
|
:host(:is([edge=left],[edge=right])) div{display:grid;grid-template-columns:auto 1fr;align-items:stretch;gap:8px 2px}
|
|
26
|
-
:host([collapsed]) div{clip-path:${
|
|
26
|
+
:host([collapsed]) div{clip-path:${tn};background-color:rgb(32 32 32/94%)}
|
|
27
27
|
@media(hover:hover){:host([collapsed]) div:hover{background-color:rgb(52 52 52/94%)}}
|
|
28
|
-
:host([collapsed]:not([folding],[fold=mark])) div{clip-path:${
|
|
28
|
+
:host([collapsed]:not([folding],[fold=mark])) div{clip-path:${nn};background-color:transparent;border-color:transparent}
|
|
29
29
|
.pill-hexagon{display:none;position:absolute;left:50%;top:50%;translate:-50% -50%;width:var(--vitehub-hex-w);height:var(--vitehub-hex-h);pointer-events:none;fill:rgb(32 32 32/94%)}
|
|
30
|
-
.pill-hexagon path{clip-path:path("${
|
|
30
|
+
.pill-hexagon path{clip-path:path("${$t}") view-box;stroke:#9e9e9e}
|
|
31
31
|
:host([collapsed]:not([folding],[fold=mark])) .pill-hexagon{display:block}
|
|
32
32
|
@media(hover:hover){div:hover>.pill-hexagon{fill:rgb(52 52 52/94%)}}
|
|
33
33
|
:host([dragging]) div{transition:none}
|
|
@@ -66,22 +66,25 @@ button{flex-shrink:0;padding:0;justify-content:center}
|
|
|
66
66
|
:host([fold=mark]){transition:filter 240ms ease-out}
|
|
67
67
|
:host([fold=mark][collapsed]){filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
|
|
68
68
|
:host([fold=mark]:not([dragging])) div{transition:background-color 120ms ease-out,border-color 120ms ease-out}
|
|
69
|
-
:host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${
|
|
69
|
+
:host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${nn};background-color:transparent;border-color:transparent}
|
|
70
70
|
:host([fold=mark]) .mark{transition:background-color 150ms ease-out,color 150ms ease-out}
|
|
71
71
|
:host([fold=mark]) .mark svg{transition:none}
|
|
72
72
|
:host([fold=mark][collapsed]) .mark svg{opacity:1;transform:scale(1.5)}
|
|
73
73
|
@media(any-pointer:coarse){:host{--vitehub-hex-h:40px}:host([fold=mark][collapsed]) .mark svg{transform:scale(2.5)}}
|
|
74
|
-
@media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([fold=mark]) :is(div,.mark){transition:none}}`,
|
|
75
|
-
[role
|
|
76
|
-
[role
|
|
77
|
-
[role
|
|
78
|
-
[role
|
|
79
|
-
[role
|
|
80
|
-
[role
|
|
74
|
+
@media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([fold=mark]) :is(div,.mark){transition:none}}`,on=[`top`,`right`,`bottom`,`left`],sn=new WeakMap}));function ln(e){return e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]??``).join(``).toLocaleUpperCase()}function un(e){let t=document.createElement(`span`);if(t.className=`avatar`,t.setAttribute(`aria-hidden`,`true`),t.textContent=ln(e.name),e.image){let n=document.createElement(`img`);n.alt=``,n.referrerPolicy=`no-referrer`,n.src=e.image,n.addEventListener(`load`,()=>t.replaceChildren(n),{once:!0})}return t}function dn(e,t){let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,e&&n.insertAdjacentHTML(`beforeend`,e);let r=document.createElement(`span`);return r.textContent=t,n.append(r),{item:n,label:r}}function fn(){let e=new URL(location.href);for(let t of[u,...d])e.searchParams.delete(t);return e}function pn(e){let{account:t,bar:n,pill:r=n.parentElement,signal:i}=e,a=n.attachShadow({mode:`open`});i.addEventListener(`abort`,be(a,qt),{once:!0});let o=document.createElement(`style`);o.textContent=vn;let s=document.createElement(`div`);s.id=`account-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,t?.name??`More`);let c=document.createElement(`button`);c.type=`button`,c.className=`who`,c.dataset.motionPress=``,c.title=t?`More. Signed in as ${t.email?`${t.name} (${t.email})`:t.name}`:`More`,c.setAttribute(`aria-label`,t?`More. Signed in as ${t.name}`:`More`),c.setAttribute(`aria-haspopup`,`menu`),c.setAttribute(`aria-expanded`,`false`),c.setAttribute(`aria-controls`,s.id),c.setAttribute(`popovertarget`,s.id),c.append(yn(bn));let l=[];if(t){let e=document.createElement(`div`);e.className=`me`,e.setAttribute(`role`,`none`);let n=document.createElement(`div`),r=document.createElement(`b`);if(r.textContent=t.name,n.append(r),t.email){let e=document.createElement(`small`);e.textContent=t.email,n.append(e)}e.append(un(t),n),l.push(e)}let u=t?dn(Cn,`Sign out of ${location.host}`):void 0;a.append(o,c,s);let d=!1,f=!1,p=()=>{f=!1;let r=e.items().filter(e=>e.length>0);n.hidden=!t&&r.length===0;let a=[...l];for(let[e,t]of r.entries()){e>0&&a.push(Object.assign(document.createElement(`hr`),{role:`separator`}));for(let e of t){let{item:t}=dn(``,e.label);if(e.icon&&t.prepend(yn(e.icon)),t.dataset.item=e.id,e.keys&&t.setAttribute(`aria-keyshortcuts`,e.keys),e.checked!==void 0&&(t.setAttribute(`role`,`menuitemcheckbox`),t.setAttribute(`aria-checked`,String(e.checked))),e.checked||e.keys){let n=document.createElement(`span`);n.className=`end`,e.checked&&n.append(yn(xn)),e.keys&&n.append(Object.assign(document.createElement(`kbd`),{textContent:e.keys})),t.append(n)}t.addEventListener(`click`,()=>{d&&s.hidePopover(),e.press()},{signal:i}),a.push(t)}}u&&a.push(u.item),s.replaceChildren(...a),c.toggleAttribute(`data-on`,r.some(e=>e.some(e=>e.checked)))};return p(),hn({menu:s,button:c,pill:r,beforeOpen:p,signal:i}),t&&u&&gn(t,u,i),s.addEventListener(`beforetoggle`,e=>{d=e.newState===`open`,!d&&f&&p()},{signal:i}),{update:()=>{d?f=!0:p()}}}function mn(e){let{account:t,button:n,turnOff:r,canExit:i,signal:a}=e,o=document.createElement(`style`);o.textContent=_n;let s=document.createElement(`vitehub-menu`);s.id=`exit-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,`Turn off tools or sign out`);let c=dn(Sn,r.label),l=dn(Cn,`Sign out of ${location.host}`);s.append(c.item,l.item);let u=`Turn off tools or sign out`;n.setAttribute(`aria-label`,u),n.title=u,n.setAttribute(`aria-haspopup`,`menu`),n.setAttribute(`aria-expanded`,`false`),n.setAttribute(`aria-controls`,s.id),n.setAttribute(`popovertarget`,s.id);let d=n.getRootNode();return hn({menu:s,button:n,pill:d instanceof ShadowRoot&&d.host instanceof HTMLElement?d.host:null,signal:a}),c.item.addEventListener(`click`,e=>{s.hidePopover(),r.press(e.detail===0)},{signal:a}),gn(t,l,a,i),[o,s]}function hn(e){let{menu:t,button:n,pill:r,signal:i}=e,a=()=>{n.getAttribute(`aria-expanded`)===`true`&&t.hidePopover()},o=()=>{let e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e.activeElement:null},s=()=>[...t.querySelectorAll(`[role^=menuitem]`)].filter(e=>!e.hidden),c=()=>r?.getAttribute(`edge`)??`bottom`,l=e=>{let i=document.documentElement.clientWidth,a=document.documentElement.clientHeight,o=(r??n).getBoundingClientRect(),s=n.getBoundingClientRect(),c={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`},l,u=i-16;if(e===`bottom`||e===`top`)c.right=`${Math.max(8,i-s.right)}px`,l=e===`bottom`?a-o.top+8:o.bottom+8,c[e]=`${l}px`;else{let t=s.top<a/2?`top`:`bottom`;l=Math.max(8,t===`top`?s.top:a-s.bottom),c[t]=`${l}px`;let n=e===`left`?`left`:`right`,r=n===`left`?o.right+8:i-o.left+8;c[n]=`${r}px`,u=i-r-8}Object.assign(t.style,c),t.style.maxHeight=`${Math.max(0,a-l-8)}px`,t.style.setProperty(`--menu-width`,`${Math.max(0,u)}px`)},u=e=>{if(e!==`bottom`&&e!==`top`)return;let r=document.documentElement.clientWidth,i=n.getBoundingClientRect(),a=t.getBoundingClientRect().width;t.style.right=`auto`,t.style.left=`${Math.max(8,Math.min(i.right-a,r-a-8))}px`};if(t.addEventListener(`beforetoggle`,r=>{if(r.newState===`closed`){t.contains(o())&&n.focus({preventScroll:!0});return}e.beforeOpen?.();let i=c();l(i),requestAnimationFrame(()=>u(i))},{signal:i}),t.addEventListener(`toggle`,e=>{let r=e.newState===`open`;n.setAttribute(`aria-expanded`,String(r)),r&&(t.scrollTop=0,s()[0]?.focus({preventScroll:!0}))},{signal:i}),window.addEventListener(`resize`,()=>{if(n.getAttribute(`aria-expanded`)!==`true`)return;let e=c();l(e),u(e)},{signal:i}),t.addEventListener(`keydown`,e=>{let t=s(),n=t.findIndex(e=>e===o()),r=e.key===`ArrowDown`?n+1:e.key===`ArrowUp`?n-1:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;r===void 0?e.key===`Escape`?e.stopPropagation():e.key===`Tab`&&a():(e.preventDefault(),t[(r+t.length)%t.length]?.focus())},{signal:i}),r){let e=new MutationObserver(e=>{e.some(e=>e.oldValue!==r.getAttribute(e.attributeName??``))&&a()});e.observe(r,{attributes:!0,attributeOldValue:!0,attributeFilter:[`collapsed`,`dragging`,`edge`]}),i.addEventListener(`abort`,()=>e.disconnect(),{once:!0})}i.addEventListener(`abort`,a,{once:!0})}function gn(e,t,n,r){t.item.addEventListener(`click`,async()=>{if(t.item.getAttribute(`aria-disabled`)===`true`||r?.()===!1)return;t.item.setAttribute(`aria-disabled`,`true`),t.label.textContent=`Signing out…`;let n=await fetch(e.signOut,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(e=>e);if(!(n instanceof Response)||!n.ok){console.error(`[vitehub] The sign-out failed. The session stays.`,n instanceof Response?`The sign-out answered ${n.status}.`:n),t.item.removeAttribute(`aria-disabled`),t.label.textContent=`Could not sign out. Try again`;return}let i=fn();i.href===location.href?location.reload():location.replace(i)},{signal:n})}var _n,vn,yn,bn,xn,Sn,Cn,wn=t((()=>{cn(),b(),_n=`[role=menu]{position:fixed;inset:auto;box-sizing:border-box;width:max-content;min-width:min(220px,var(--menu-width));max-width:min(300px,var(--menu-width));margin:0;padding:6px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:#171717;color:var(--vitehub-pill-text);font:500 13px/1.3 ui-sans-serif,system-ui,sans-serif;box-shadow:0 16px 40px rgb(0 0 0/30%);color-scheme:dark;pointer-events:auto}
|
|
75
|
+
[role^=menuitem]{display:flex;width:100%;height:32px;justify-content:flex-start;gap:8px;font-size:13px}
|
|
76
|
+
[role^=menuitem] svg{width:15px;height:15px;flex:none;color:var(--vitehub-pill-muted)}
|
|
77
|
+
[role^=menuitem] span{overflow:hidden;text-overflow:ellipsis}
|
|
78
|
+
[role^=menuitem][hidden]{display:none}
|
|
79
|
+
[role^=menuitem][aria-disabled=true]{cursor:progress}
|
|
80
|
+
[role^=menuitem] .end{display:flex;align-items:center;gap:6px;margin-left:auto;padding-left:16px}
|
|
81
|
+
[role^=menuitem] .end svg{color:var(--vitehub-pill-strong)}
|
|
82
|
+
[role^=menuitem] kbd{box-sizing:border-box;display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:4px;background:rgb(255 255 255/8%);font:500 11px/1 ui-sans-serif,system-ui,sans-serif;color:var(--vitehub-pill-muted)}
|
|
81
83
|
[role=menu] hr{height:1px;margin:4px 0;border:0;background:var(--vitehub-pill-line)}
|
|
82
|
-
@media(any-pointer:coarse){[role
|
|
83
|
-
${
|
|
84
|
-
.who{align-self:flex-start;width:28px;padding:0;justify-content:center}
|
|
84
|
+
@media(any-pointer:coarse){[role^=menuitem]{height:44px}}`,vn=`${g}
|
|
85
|
+
${_n}
|
|
86
|
+
.who{position:relative;align-self:flex-start;width:28px;padding:0;justify-content:center}
|
|
87
|
+
.who[data-on]::after{content:"";position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:50%;background:var(--vitehub-pill-strong)}
|
|
85
88
|
.avatar{box-sizing:border-box;display:grid;place-items:center;width:32px;height:32px;flex:none;overflow:hidden;border-radius:50%;background:#404040;color:var(--vitehub-pill-strong);font-size:12px;font-weight:600;line-height:1}
|
|
86
89
|
.avatar img{display:block;width:100%;height:100%;object-fit:cover}
|
|
87
90
|
.me{display:flex;align-items:center;gap:10px;margin-bottom:4px;padding:8px 8px 10px;border-bottom:1px solid var(--vitehub-pill-line)}
|
|
@@ -89,7 +92,7 @@ ${vn}
|
|
|
89
92
|
.me b,.me small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
90
93
|
.me b{color:var(--vitehub-pill-strong);font-weight:500}
|
|
91
94
|
.me small{margin-top:2px;color:var(--vitehub-pill-muted);font-size:12px}
|
|
92
|
-
`,bn=e=>He(`0 0 24 24`,e,{fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),xn=`M5 12h.01M12 12h.01M19 12h.01`,Sn=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49M14.084 14.158a3 3 0 0 1-4.242-4.242M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143M2 2l20 20"/></svg>`,Cn=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>`}));function Tn(e,...t){return typeof e==`function`?e(...t):e}function En(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function Dn(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:An(n)}),{docsBase:i}=e;for(let a of Object.keys(e.codes)){let o=e.codes[a],s=o.docs===!1?void 0:o.docs||En(i,a),c=(e={},r={})=>{let i=new kn({code:a,why:Tn(o.why,e),fix:Tn(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:Tn(o.data,e)},c);i[n]=1;for(let e of t)e(i,r);return i};c.is=e=>r.is(e)&&e.code===a,r[a]=c}return r}var On,kn,An,jn=t((()=>{On=Error.captureStackTrace,kn=class e extends Error{get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.docs=t.docs,this.fix=t.fix,this.sources=t.sources,this.data=t.data,On?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,data:this.data,stack:this.stack}}},An=e=>t=>t instanceof kn&&e in t}));wn(),jn();var Mn=Dn({docsBase:`https://vitehub.dev/docs/development/diagnostics`,codes:{INTERNAL_INVARIANT_FAILED:{why:({what:e})=>`ViteHub reached a state that it does not expect: ${e}`,fix:`This is a ViteHub bug. Open an issue at https://github.com/vite-hub/vitehub/issues with this error message and its stack trace.`}}});function Nn(e){return Mn.INTERNAL_INVARIANT_FAILED({what:e})}function Pn(e,t){if(!e)throw Nn(t)}ln(),b();function Fn(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function In(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function Ln(e,t){return window.setTimeout(t,e*E())}var Rn={stiffness:480,damping:36},zn={stiffness:380,damping:26},Bn={stiffness:440,damping:32},Vn=30,Hn=40,Un={widenAfter:120,labelAfterRise:70,labelIn:.24,sinkAfter:90,goneAfter:520},Wn={widenAfter:60,labelAfterRise:40,labelIn:.18,sinkAfter:50,goneAfter:320},Gn=.15,Kn=.14,qn=.15,Jn=new WeakMap,Yn=new Set,Xn=new Set,Zn;function Qn(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function $n(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}var er=`[data-motion-appear]`;function tr(e){if(e.matches(er))return e;if(e.matches(`[role=tooltip]`))return Qn(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&Qn(t)?e:null}function nr(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function rr(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=$n(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function ir(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);L(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function ar(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function or(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}var sr=e=>e===`top`||e===`bottom`;function cr(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function lr(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Qn(t))}function ur(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Qn(t)).map(e=>e.textContent??``).join(``)}function dr(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}var fr=e=>`${Math.round(e*100)/100}px`;function pr(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(fr).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(fr).join(` `)})`);L(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${fr(u)} ${fr(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of lr(e))L(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${fr((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;L(e.old.element,{scale:h,opacity:String(t),filter:`blur(${fr((1-t)*5)})`})}}function mr(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function hr(e){if(!mr(e)){e.old?.element.remove(),e.old=void 0,L(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of lr(e))L(t,{scale:null,opacity:null,filter:null});e.done?.()}}function gr(e,t,n){let r=getComputedStyle(e),i=ar(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:or(i,t,n),trigger:n,mode:dr(e)||e.matches(er)?`clip`:`scale`,handoff:!e.matches(er),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{pr(a),hr(a)};return a.x=j(t.left+t.width/2,o,Rn),a.y=j(t.top+t.height/2,o,Rn),a.width=j(t.width,o,Bn),a.label=j(1,o),a.fade=j(1,o),a}function _r(e){return e.handoff?Un:Wn}function vr(e,t,n){let r=Ln(t,()=>{e.timers.delete(r),n(),hr(e)});e.timers.add(r)}function yr(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function br(e){yr(e),Xn.delete(e),Zn===e&&(Zn=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function xr(e){if(e){for(let e of Xn)br(e);for(let e of Yn){let t=Jn.get(e)?.box;t&&(yr(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,hr(t))}}}function Sr(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:sr(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function Cr(e){return sr(e.side)?e.y:e.x}function wr(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=j(n,()=>{pr(e),hr(e)});e.old={element:r,spring:i},i.to(0,{tween:Gn})}function Tr(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):lr(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function Er(e,t){let n=t.trigger?.getBoundingClientRect(),r=ir(e),i=gr(e,r,n);t.box=i,t.text=ur(i),t.label=Tr(i),L(e,{opacity:null});let a=i.handoff&&Zn&&Sr(Zn,i)?Zn:void 0;if(a&&(Zn=void 0),w()){a&&Dr(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:qn});return}if(a){let e=Tr(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;br(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),wr(i,e,n),i.x.to(r.left+r.width/2,{preset:Rn,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:Rn,velocity:t.y[1]}),i.width.to(r.width,{preset:Bn,velocity:t.width[1]}),vr(i,Hn,()=>i.label.to(1,{tween:Un.labelIn})),i.holding=!1,pr(i);return}Cr(i).set(cr(i)),i.width.set(Math.min(Vn,r.width)),i.label.set(0),pr(i),Cr(i).to(sr(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:zn});let o=_r(i);vr(i,o.widenAfter,()=>{i.width.to(r.width,{preset:Bn}),vr(i,o.labelAfterRise,()=>i.label.to(1,{tween:o.labelIn}))}),i.holding=!1}function Dr(e,t){if(Xn.add(e),e.holding=!1,t){e.done=()=>br(e),e.fade.to(0,{tween:qn});return}e.handoff&&(Zn=e),e.old&&e.old.spring.to(0,{tween:Kn}),e.label.to(0,{tween:Kn}),e.width.to(Math.min(Vn,e.rest.width),{preset:Bn});let n=_r(e);vr(e,n.sinkAfter,()=>{Zn===e&&(Zn=void 0),Cr(e).to(cr(e),{preset:zn})}),vr(e,n.goneAfter,()=>br(e))}function Or(e,t){if(!t.open)return;t.open=!1,Yn.delete(e),t.stopWatch?.(),t.stopWatch=void 0,Yn.size||zr();let n=t.box;if(t.box=void 0,L(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Fn(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;yr(n),n.old?.element.remove(),L(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of lr(n))L(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=kr(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(L(c,{scale:null}),In(c,n.rest));let l=gr(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:j(s,()=>pr(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);pr(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});Dr(l,w())}function kr(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function Ar(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return Ar(e,t,n,r-1);n()})}function jr(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):Or(e,t)});return n(),()=>r.disconnect()}function Mr(e){let t=Jn.get(e);if(t?.open)return;let n=rr(e);if(n&&M(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},Jn.set(e,t),Yn.add(e),Rr(),L(e,{opacity:`0`}),t.stopWatch=jr(e,t);let i=t;Ar(e,t,()=>Er(e,i))}var Nr=0;function Pr(){Nr=0;for(let e of Yn){let t=Jn.get(e),n=t?.box;if(!t||!n)continue;let r=ir(e),i=ur(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!mr(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=rr(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=Tr(n),n.rest=r,n.side=ar(e,r,c),n.edge=or(n.side,r,c),w()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:Rn}),n.y.to(r.top+r.height/2,{preset:Rn}),n.width.to(r.width,{preset:Bn}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),wr(n,s,n.label.value),n.label.set(0),vr(n,Hn,()=>n.label.to(1,{tween:_r(n).labelIn}))))}}function Fr(){Nr||=requestAnimationFrame(Pr)}var Ir=!1,Lr;function Rr(){Lr??=T(xr),Ir||(Ir=!0,document.addEventListener(`pointerover`,Fr,{capture:!0,passive:!0}),document.addEventListener(`focusin`,Fr,{capture:!0,passive:!0}))}function zr(){Ir=!1,cancelAnimationFrame(Nr),Nr=0,document.removeEventListener(`pointerover`,Fr,{capture:!0}),document.removeEventListener(`focusin`,Fr,{capture:!0})}var Br={enter(e){tr(e)===e&&nr(e)&&Mr(e)},state(e){if(tr(e)!==e)return;let t=Jn.get(e);nr(e)?Mr(e):t&&Or(e,t)}};({...Br});var Vr={name:`appear`,selector:er,...Br},Hr=`
|
|
95
|
+
`,yn=e=>Ve(`0 0 24 24`,e,{fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),bn=`M5 12h.01M12 12h.01M19 12h.01`,xn=`M20 6 9 17l-5-5`,Sn=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49M14.084 14.158a3 3 0 0 1-4.242-4.242M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143M2 2l20 20"/></svg>`,Cn=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>`}));function Tn(e,...t){return typeof e==`function`?e(...t):e}function En(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function Dn(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:An(n)}),{docsBase:i}=e;for(let a of Object.keys(e.codes)){let o=e.codes[a],s=o.docs===!1?void 0:o.docs||En(i,a),c=(e={},r={})=>{let i=new kn({code:a,why:Tn(o.why,e),fix:Tn(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:Tn(o.data,e)},c);i[n]=1;for(let e of t)e(i,r);return i};c.is=e=>r.is(e)&&e.code===a,r[a]=c}return r}var On,kn,An,jn=t((()=>{On=Error.captureStackTrace,kn=class e extends Error{get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.docs=t.docs,this.fix=t.fix,this.sources=t.sources,this.data=t.data,On?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,data:this.data,stack:this.stack}}},An=e=>t=>t instanceof kn&&e in t}));wn(),jn();var Mn=Dn({docsBase:`https://vitehub.dev/docs/development/diagnostics`,codes:{INTERNAL_INVARIANT_FAILED:{why:({what:e})=>`ViteHub reached a state that it does not expect: ${e}`,fix:`This is a ViteHub bug. Open an issue at https://github.com/vite-hub/vitehub/issues with this error message and its stack trace.`}}});function Nn(e){return Mn.INTERNAL_INVARIANT_FAILED({what:e})}function Pn(e,t){if(!e)throw Nn(t)}cn(),b();function Fn(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function In(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function Ln(e,t){return window.setTimeout(t,e*E())}var Rn={stiffness:480,damping:36},zn={stiffness:380,damping:26},Bn={stiffness:440,damping:32},Vn=30,Hn=40,Un={widenAfter:120,labelAfterRise:70,labelIn:.24,sinkAfter:90,goneAfter:520},Wn={widenAfter:60,labelAfterRise:40,labelIn:.18,sinkAfter:50,goneAfter:320},Gn=.15,Kn=.14,qn=.15,Jn=new WeakMap,Yn=new Set,Xn=new Set,Zn;function Qn(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function $n(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}var er=`[data-motion-appear]`;function tr(e){if(e.matches(er))return e;if(e.matches(`[role=tooltip]`))return Qn(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&Qn(t)?e:null}function nr(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function rr(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=$n(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function ir(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);L(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function ar(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function or(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}var sr=e=>e===`top`||e===`bottom`;function cr(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function lr(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Qn(t))}function ur(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Qn(t)).map(e=>e.textContent??``).join(``)}function dr(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}var fr=e=>`${Math.round(e*100)/100}px`;function pr(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(fr).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(fr).join(` `)})`);L(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${fr(u)} ${fr(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of lr(e))L(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${fr((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;L(e.old.element,{scale:h,opacity:String(t),filter:`blur(${fr((1-t)*5)})`})}}function mr(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function hr(e){if(!mr(e)){e.old?.element.remove(),e.old=void 0,L(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of lr(e))L(t,{scale:null,opacity:null,filter:null});e.done?.()}}function gr(e,t,n){let r=getComputedStyle(e),i=ar(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:or(i,t,n),trigger:n,mode:dr(e)||e.matches(er)?`clip`:`scale`,handoff:!e.matches(er),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{pr(a),hr(a)};return a.x=j(t.left+t.width/2,o,Rn),a.y=j(t.top+t.height/2,o,Rn),a.width=j(t.width,o,Bn),a.label=j(1,o),a.fade=j(1,o),a}function _r(e){return e.handoff?Un:Wn}function vr(e,t,n){let r=Ln(t,()=>{e.timers.delete(r),n(),hr(e)});e.timers.add(r)}function yr(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function br(e){yr(e),Xn.delete(e),Zn===e&&(Zn=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function xr(e){if(e){for(let e of Xn)br(e);for(let e of Yn){let t=Jn.get(e)?.box;t&&(yr(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,hr(t))}}}function Sr(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:sr(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function Cr(e){return sr(e.side)?e.y:e.x}function wr(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=j(n,()=>{pr(e),hr(e)});e.old={element:r,spring:i},i.to(0,{tween:Gn})}function Tr(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):lr(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function Er(e,t){let n=t.trigger?.getBoundingClientRect(),r=ir(e),i=gr(e,r,n);t.box=i,t.text=ur(i),t.label=Tr(i),L(e,{opacity:null});let a=i.handoff&&Zn&&Sr(Zn,i)?Zn:void 0;if(a&&(Zn=void 0),w()){a&&Dr(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:qn});return}if(a){let e=Tr(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;br(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),wr(i,e,n),i.x.to(r.left+r.width/2,{preset:Rn,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:Rn,velocity:t.y[1]}),i.width.to(r.width,{preset:Bn,velocity:t.width[1]}),vr(i,Hn,()=>i.label.to(1,{tween:Un.labelIn})),i.holding=!1,pr(i);return}Cr(i).set(cr(i)),i.width.set(Math.min(Vn,r.width)),i.label.set(0),pr(i),Cr(i).to(sr(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:zn});let o=_r(i);vr(i,o.widenAfter,()=>{i.width.to(r.width,{preset:Bn}),vr(i,o.labelAfterRise,()=>i.label.to(1,{tween:o.labelIn}))}),i.holding=!1}function Dr(e,t){if(Xn.add(e),e.holding=!1,t){e.done=()=>br(e),e.fade.to(0,{tween:qn});return}e.handoff&&(Zn=e),e.old&&e.old.spring.to(0,{tween:Kn}),e.label.to(0,{tween:Kn}),e.width.to(Math.min(Vn,e.rest.width),{preset:Bn});let n=_r(e);vr(e,n.sinkAfter,()=>{Zn===e&&(Zn=void 0),Cr(e).to(cr(e),{preset:zn})}),vr(e,n.goneAfter,()=>br(e))}function Or(e,t){if(!t.open)return;t.open=!1,Yn.delete(e),t.stopWatch?.(),t.stopWatch=void 0,Yn.size||zr();let n=t.box;if(t.box=void 0,L(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Fn(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;yr(n),n.old?.element.remove(),L(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of lr(n))L(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=kr(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(L(c,{scale:null}),In(c,n.rest));let l=gr(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:j(s,()=>pr(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);pr(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});Dr(l,w())}function kr(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function Ar(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return Ar(e,t,n,r-1);n()})}function jr(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):Or(e,t)});return n(),()=>r.disconnect()}function Mr(e){let t=Jn.get(e);if(t?.open)return;let n=rr(e);if(n&&M(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},Jn.set(e,t),Yn.add(e),Rr(),L(e,{opacity:`0`}),t.stopWatch=jr(e,t);let i=t;Ar(e,t,()=>Er(e,i))}var Nr=0;function Pr(){Nr=0;for(let e of Yn){let t=Jn.get(e),n=t?.box;if(!t||!n)continue;let r=ir(e),i=ur(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!mr(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=rr(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=Tr(n),n.rest=r,n.side=ar(e,r,c),n.edge=or(n.side,r,c),w()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:Rn}),n.y.to(r.top+r.height/2,{preset:Rn}),n.width.to(r.width,{preset:Bn}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),wr(n,s,n.label.value),n.label.set(0),vr(n,Hn,()=>n.label.to(1,{tween:_r(n).labelIn}))))}}function Fr(){Nr||=requestAnimationFrame(Pr)}var Ir=!1,Lr;function Rr(){Lr??=T(xr),Ir||(Ir=!0,document.addEventListener(`pointerover`,Fr,{capture:!0,passive:!0}),document.addEventListener(`focusin`,Fr,{capture:!0,passive:!0}))}function zr(){Ir=!1,cancelAnimationFrame(Nr),Nr=0,document.removeEventListener(`pointerover`,Fr,{capture:!0}),document.removeEventListener(`focusin`,Fr,{capture:!0})}var Br={enter(e){tr(e)===e&&nr(e)&&Mr(e)},state(e){if(tr(e)!==e)return;let t=Jn.get(e);nr(e)?Mr(e):t&&Or(e,t)}};({...Br});var Vr={name:`appear`,selector:er,...Br},Hr=`
|
|
93
96
|
:host{all:initial;--surface:light-dark(#fff,#0a0a0a);--text:light-dark(#18181b,#fafafa);--muted:light-dark(#71717a,#a1a1aa);--line:light-dark(rgb(0 0 0/8%),rgb(255 255 255/9%));--hover:light-dark(rgb(0 0 0/5%),rgb(255 255 255/7%));--focus:light-dark(#18181b,#fafafa);--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--at:50;--margin:16px;--start:calc(max(var(--margin),var(--safe-left)) + var(--beside-start,0px));--end:calc(max(var(--margin),var(--safe-right)) + var(--beside-end,0px));--far:calc(max(12px,var(--safe-top)) + 40px);--along:calc(var(--start) + (100% - var(--start) - var(--end)) * var(--at) / 100);--shift:calc(var(--at) * -1%);--dock:calc(max(max(var(--margin),var(--safe-bottom)) + var(--thickness,38px),var(--vitehub-page-bar,0px)) + 8px);--width:calc(100vw - var(--start) - var(--end));--height:calc(100dvh - var(--dock) - var(--far));position:fixed;inset:0;z-index:2147483000;pointer-events:none;color:var(--text);font:400 .875rem/1.5 system-ui,sans-serif;color-scheme:light dark}
|
|
94
97
|
:host([collapsed]){--margin:2px}
|
|
95
98
|
:host([edge=top]){--dock:calc(max(var(--margin),var(--safe-top)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-bottom))}
|
|
@@ -121,7 +124,7 @@ header :is(button,a):focus-visible{outline:2px solid var(--focus);outline-offset
|
|
|
121
124
|
.body{flex:1;min-height:0;overflow:auto;position:relative}iframe{display:block;border:0;width:100%;height:100%;background:var(--surface)}
|
|
122
125
|
@media(max-width:640px){:host(:is([edge=left],[edge=right])){--start:max(var(--margin),var(--safe-top))}:host([edge]) .window,:host([edge]) .window.expanded{inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);translate:none;width:auto!important;height:auto!important;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:0}:host([edge=bottom]) :is(.window,.window.expanded){bottom:var(--dock)}:host([edge=top]) :is(.window,.window.expanded){top:var(--dock)}:host([edge=right]) :is(.window,.window.expanded){right:var(--dock)}:host([edge=left]) :is(.window,.window.expanded){left:var(--dock)}:host(:is([edge=top],[edge=bottom])) :is(.window,.window.expanded){left:var(--start);right:var(--end)}:host(:is([edge=left],[edge=right])) :is(.window,.window.expanded){top:var(--start);bottom:var(--end)}.grip{display:none}header :is(button,a){width:44px;height:44px}.expand{display:none}}
|
|
123
126
|
@media(forced-colors:active){.window{border:1px solid CanvasText}header :is(button,a):focus-visible{outline-color:Highlight}}
|
|
124
|
-
`,Ur={edge:`bottom`,at:50},Wr=new Map,Gr=new Set,Kr=!1,qr=0;function Jr(){Kr||(Kr=!0,queueMicrotask(()=>{Kr=!1;for(let e of Gr)e()}))}function Yr(){return[...Wr.keys()].some(e=>!e.hidden)}function Xr(){for(let[e,t]of Wr)e.hidden||t()}function Zr(e,t){Gr.add(e),t.addEventListener(`abort`,()=>Gr.delete(e),{once:!0})}function Qr(e){e.setAttribute(`edge`,Ur.edge),e.toggleAttribute(`collapsed`,!!Ur.collapsed),e.style.setProperty(`--at`,String(Ur.at)),Ur.thickness?e.style.setProperty(`--thickness`,`${Ur.thickness}px`):e.style.removeProperty(`--thickness`);for(let[t,n]of[[`start`,0],[`end`,100]])Ur.beside&&Ur.at===n?e.style.setProperty(`--beside-${t}`,`${Ur.beside}px`):e.style.removeProperty(`--beside-${t}`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=$r(t)===0}function $r(e){return(e===`top`||e===`bottom`)==(Ur.edge===`top`||Ur.edge===`bottom`)?1:e===`top`||e===`left`?Ur.at/100:1-Ur.at/100}function ei(e){Ur=e;for(let e of Wr.keys())Qr(e)}function ti(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,n]of Object.entries({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))t.setAttribute(e,n);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,e),t.append(n),t}function ni(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=Hr;let i=document.createElement(`section`);i.className=`window`,i.setAttribute(`role`,`dialog`),i.setAttribute(`aria-labelledby`,`title`),i.tabIndex=-1;let a=document.createElement(`header`),o=document.createElement(`h2`);o.id=`title`,o.textContent=e.title;let s=document.createElement(`div`);s.className=`body`;let c=(e,t,n)=>{let r=document.createElement(`button`);return r.className=e,r.type=`button`,r.setAttribute(`aria-label`,t),r.title=t,r.append(ti(n)),r},l=c(`expand`,`Expand window`,`M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5`),u=c(`hide`,`Minimize window`,`M5 12h14`),d=document.createElement(`a`);d.className=`tab`,d.target=`_blank`,d.rel=`noopener`,d.setAttribute(`aria-label`,`Open in new tab`),d.title=`Open in new tab`,d.append(ti(`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`));let f=()=>{let t=e.href?.();d.hidden=!t,t?d.href=t:d.removeAttribute(`href`)};for(let e of[`pointerenter`,`pointerdown`,`focus`,`click`,`contextmenu`])d.addEventListener(e,f);f(),a.append(o,...e.href?[d]:[],...e.expand===!1?[]:[l],u);let p=document.createElement(`div`);p.className=`frame`,p.append(a,s);let m=[`top`,`right`,`bottom`,`left`].map(e=>{let t=document.createElement(`div`);return t.className=`grip ${e}`,t.addEventListener(`pointerdown`,n=>{if(n.button!==0)return;let r=$r(e);if(r===0)return;n.preventDefault(),t.setPointerCapture(n.pointerId);let a=e===`top`||e===`bottom`,o=a?i.offsetHeight:i.offsetWidth,s=t=>{let s=a?t.clientY-n.clientY:t.clientX-n.clientX,c=o+(e===`top`||e===`left`?-s:s)/r;a?i.style.height=`${Math.max(240,c)}px`:i.style.width=`${Math.max(300,c)}px`};t.addEventListener(`pointermove`,s),t.addEventListener(`lostpointercapture`,()=>t.removeEventListener(`pointermove`,s),{once:!0})}),t});i.append(p,...m),n.append(r,i);let h=`vitehub-window:${e.id}`;try{let e=JSON.parse(localStorage.getItem(h)??`null`);e&&typeof e==`object`&&`width`in e&&`height`in e&&typeof e.width==`number`&&typeof e.height==`number`&&(Number.isFinite(e.width)&&(i.style.width=`${Math.max(300,e.width)}px`),Number.isFinite(e.height)&&(i.style.height=`${Math.max(240,e.height)}px`))}catch{}let g=new ResizeObserver(()=>{if(t.hidden||i.classList.contains(`expanded`)||innerWidth<=640)return;let e=i.offsetWidth,n=i.offsetHeight;try{localStorage.setItem(h,JSON.stringify({width:e,height:n}))}catch{}});g.observe(i);let _=()=>{t.hidden=!0,e.trigger.setAttribute(`aria-expanded`,`false`),e.trigger.focus({preventScroll:!0}),e.onHide?.(),Jr()};l.addEventListener(`click`,()=>{let e=i.classList.toggle(`expanded`);l.setAttribute(`aria-label`,e?`Restore window size`:`Expand window`),l.title=e?`Restore window size`:`Expand window`,l.setAttribute(`aria-pressed`,String(e))}),u.addEventListener(`click`,_);let v=()=>{t.style.colorScheme=e.colorScheme?.()??``};e.colorScheme&&addEventListener(`storage`,v,{signal:e.signal}),n.addEventListener(`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),_())}),t.style.viewTransitionName=`vitehub-window-${++qr}`,Qr(t);let y=
|
|
127
|
+
`,Ur={edge:`bottom`,at:50},Wr=new Map,Gr=new Set,Kr=!1,qr=0;function Jr(){Kr||(Kr=!0,queueMicrotask(()=>{Kr=!1;for(let e of Gr)e()}))}function Yr(){return[...Wr.keys()].some(e=>!e.hidden)}function Xr(){for(let[e,t]of Wr)e.hidden||t()}function Zr(e,t){Gr.add(e),t.addEventListener(`abort`,()=>Gr.delete(e),{once:!0})}function Qr(e){e.setAttribute(`edge`,Ur.edge),e.toggleAttribute(`collapsed`,!!Ur.collapsed),e.style.setProperty(`--at`,String(Ur.at)),Ur.thickness?e.style.setProperty(`--thickness`,`${Ur.thickness}px`):e.style.removeProperty(`--thickness`);for(let[t,n]of[[`start`,0],[`end`,100]])Ur.beside&&Ur.at===n?e.style.setProperty(`--beside-${t}`,`${Ur.beside}px`):e.style.removeProperty(`--beside-${t}`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=$r(t)===0}function $r(e){return(e===`top`||e===`bottom`)==(Ur.edge===`top`||Ur.edge===`bottom`)?1:e===`top`||e===`left`?Ur.at/100:1-Ur.at/100}function ei(e){Ur=e;for(let e of Wr.keys())Qr(e)}function ti(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,n]of Object.entries({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))t.setAttribute(e,n);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,e),t.append(n),t}function ni(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=Hr;let i=document.createElement(`section`);i.className=`window`,i.setAttribute(`role`,`dialog`),i.setAttribute(`aria-labelledby`,`title`),i.tabIndex=-1;let a=document.createElement(`header`),o=document.createElement(`h2`);o.id=`title`,o.textContent=e.title;let s=document.createElement(`div`);s.className=`body`;let c=(e,t,n)=>{let r=document.createElement(`button`);return r.className=e,r.type=`button`,r.setAttribute(`aria-label`,t),r.title=t,r.append(ti(n)),r},l=c(`expand`,`Expand window`,`M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5`),u=c(`hide`,`Minimize window`,`M5 12h14`),d=document.createElement(`a`);d.className=`tab`,d.target=`_blank`,d.rel=`noopener`,d.setAttribute(`aria-label`,`Open in new tab`),d.title=`Open in new tab`,d.append(ti(`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`));let f=()=>{let t=e.href?.();d.hidden=!t,t?d.href=t:d.removeAttribute(`href`)};for(let e of[`pointerenter`,`pointerdown`,`focus`,`click`,`contextmenu`])d.addEventListener(e,f);f(),a.append(o,...e.href?[d]:[],...e.expand===!1?[]:[l],u);let p=document.createElement(`div`);p.className=`frame`,p.append(a,s);let m=[`top`,`right`,`bottom`,`left`].map(e=>{let t=document.createElement(`div`);return t.className=`grip ${e}`,t.addEventListener(`pointerdown`,n=>{if(n.button!==0)return;let r=$r(e);if(r===0)return;n.preventDefault(),t.setPointerCapture(n.pointerId);let a=e===`top`||e===`bottom`,o=a?i.offsetHeight:i.offsetWidth,s=t=>{let s=a?t.clientY-n.clientY:t.clientX-n.clientX,c=o+(e===`top`||e===`left`?-s:s)/r;a?i.style.height=`${Math.max(240,c)}px`:i.style.width=`${Math.max(300,c)}px`};t.addEventListener(`pointermove`,s),t.addEventListener(`lostpointercapture`,()=>t.removeEventListener(`pointermove`,s),{once:!0})}),t});i.append(p,...m),n.append(r,i);let h=`vitehub-window:${e.id}`;try{let e=JSON.parse(localStorage.getItem(h)??`null`);e&&typeof e==`object`&&`width`in e&&`height`in e&&typeof e.width==`number`&&typeof e.height==`number`&&(Number.isFinite(e.width)&&(i.style.width=`${Math.max(300,e.width)}px`),Number.isFinite(e.height)&&(i.style.height=`${Math.max(240,e.height)}px`))}catch{}let g=new ResizeObserver(()=>{if(t.hidden||i.classList.contains(`expanded`)||innerWidth<=640)return;let e=i.offsetWidth,n=i.offsetHeight;try{localStorage.setItem(h,JSON.stringify({width:e,height:n}))}catch{}});g.observe(i);let _=()=>{t.hidden=!0,e.trigger.setAttribute(`aria-expanded`,`false`),e.trigger.focus({preventScroll:!0}),e.onHide?.(),Jr()};l.addEventListener(`click`,()=>{let e=i.classList.toggle(`expanded`);l.setAttribute(`aria-label`,e?`Restore window size`:`Expand window`),l.title=e?`Restore window size`:`Expand window`,l.setAttribute(`aria-pressed`,String(e))}),u.addEventListener(`click`,_);let v=()=>{t.style.colorScheme=e.colorScheme?.()??``};e.colorScheme&&addEventListener(`storage`,v,{signal:e.signal}),n.addEventListener(`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),_())}),t.style.viewTransitionName=`vitehub-window-${++qr}`,Qr(t);let y=be(n,qt),b=()=>{Wr.delete(t)&&!t.hidden&&Jr(),g.disconnect(),t.remove(),y()};return e.signal.aborted?b():(e.signal.addEventListener(`abort`,b,{once:!0}),Wr.set(t,_),document.documentElement.append(t)),{body:s,show(){e.signal.aborted||(v(),f(),t.hidden=!1,Jr(),e.trigger.setAttribute(`aria-expanded`,`true`),i.focus({preventScroll:!0}))},hide:_,destroy:b,syncColorScheme:v}}function ri(e){let t=typeof e==`object`&&e?Reflect.get(e,`default`):void 0;return t instanceof Function?t:void 0}var ii=`:host([off]){--vitehub-hex-h:14px;filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
|
|
125
128
|
:host([off]) button{position:relative;display:block;width:var(--vitehub-hex-w);min-width:0;height:var(--vitehub-hex-h);padding:0;border-radius:4px;pointer-events:auto;cursor:grab;opacity:.55;transition:opacity 150ms ease-out}
|
|
126
129
|
:host([off][edge=bottom]) button{transform-origin:calc(var(--at) * 1%) 100%}
|
|
127
130
|
:host([off][edge=top]) button{transform-origin:calc(var(--at) * 1%) 0}
|
|
@@ -135,47 +138,47 @@ svg{display:block;width:100%;height:100%;overflow:visible;fill:rgb(17 17 17/92%)
|
|
|
135
138
|
:host([off][dragging]) svg{scale:none}
|
|
136
139
|
@media(hover:hover){:host([off]) button:hover{opacity:1;background:none}button:hover svg{fill:rgb(38 38 38/94%)}}
|
|
137
140
|
@media(any-pointer:coarse){:host([off]){--vitehub-hex-h:20px}:host([off]) button{min-width:0;height:var(--vitehub-hex-h)}:host([off]) button::before{inset:-10px}}
|
|
138
|
-
@media(prefers-reduced-motion:reduce){:host([off]) button,svg{transition:none}}`,ai=`vitehub-tools-off`,oi=`vitehub-tools-collapsed`,si=`vitehub-tools-dock`,ci=`vitehub-account`;function li(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function ui(e){try{let t=JSON.parse(localStorage.getItem(e)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function di(e){let t=document.createElement(`link`);t.rel=`modulepreload`,t.href=e;let n=document.querySelector(`script[${v}]`)?.nonce;n&&(t.nonce=n),document.head.append(t)}function fi(e,t,n){let r=Symbol.for(y),i=Reflect.get(globalThis,r);if(Reflect.deleteProperty(globalThis,r),typeof i!=`object`||!i)return;let a=new URL(e,t);if(a.origin!==t.origin||a.search||Reflect.get(i,`route`)!==a.pathname||Reflect.get(i,`page`)!==t.pathname||Reflect.get(i,`open`)!==(n||void 0))return;let o=l(Reflect.get(i,`session`));return o.tools.length>0?o:void 0}function pi(e,t){try{localStorage.setItem(e,JSON.stringify(t.filter(e=>!e.lazy).map(e=>e.script)))}catch{}}function mi(e,t){try{t?localStorage.setItem(e,`1`):localStorage.removeItem(e)}catch{}}function hi(){return document.documentElement.getAttribute(`data-vitehub-pill`)===`mark`||gi}var gi=!1,_i=!1;function vi(){try{return localStorage.getItem(si)}catch{return null}}function yi(){if(_i||typeof document.elementsFromPoint!=`function`)return!1;let e=e=>{let t=e.getBoundingClientRect();return t.width*t.height<innerWidth*innerHeight/2},t=Array.from({length:36},(e,t)=>[Math.min(innerWidth-1,Math.max(0,innerWidth/2-140+t%18*16+8)),innerHeight-(t<18?24:44)]),n=new Set;for(let[r,i]of t)for(let t of document.elementsFromPoint(r,i))if(!n.has(t)){n.add(t);for(let n=t;n&&n!==document.body&&n!==document.documentElement&&!n.localName.startsWith(`vitehub-`);n=n.parentElement){let r=getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`&&r.bottom!==`auto`){if(e(n)||n!==t&&e(t))return!0;break}if(/auto|scroll/.test(r.overflowY)&&n.scrollHeight>n.clientHeight)break}}return!1}function bi(e){return e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:e}function xi(e,t){let n=hi(),r=vi(),i=()=>{_i||=vi()!==r;let t=gi;if(gi=yi(),t&&!gi&&_i&&document.querySelector(`vitehub-pill`)?.hasAttribute(`collapsed`))try{localStorage.setItem(oi,`1`)}catch{}hi()!==n&&(n=!n,e())},a=new MutationObserver(i);a.observe(document.documentElement,{attributes:!0,attributeFilter:[_]});let o,s=()=>{o??=setTimeout(()=>{o=void 0,i()},200)},c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.localName.startsWith(`vitehub-`)))&&s()});c.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`class`,`style`]}),addEventListener(`scroll`,s,{capture:!0,passive:!0,signal:t}),addEventListener(`resize`,s,{signal:t}),addEventListener(`storage`,e=>{(e.key===null||e.key===si)&&(r=vi()),s()},{signal:t}),document.addEventListener(`pointerup`,s,{signal:t}),t.addEventListener(`abort`,()=>{a.disconnect(),c.disconnect(),clearTimeout(o)},{once:!0})}var Si={name:`vitehub-pill`,label:`ViteHub tools`,off:ai,collapsed:oi,dock:si};function Ci(e,t,n,r,i){if(t.aborted)return;let a=document.createElement(e.off);a.setAttribute(`off`,``),a.setAttribute(`collapsed`,``),i&&a.setAttribute(`closing`,``),a.style.viewTransitionName=e.name;let o=z(e.dock)??e.initialDock??{edge:`bottom`,at:50},s=()=>{let t=e===Si&&hi()&&!a.hasAttribute(`dragging`)?bi(o):o;a.setAttribute(`edge`,t.edge),a.style.setProperty(`--at`,String(t.at))};s();let c=new AbortController;t.addEventListener(`abort`,()=>{c.abort(),a.remove()},{once:!0,signal:c.signal}),e===Si&&xi(s,c.signal);let l=a.attachShadow({mode:`open`}),u=xe(l,Jt);c.signal.addEventListener(`abort`,u,{once:!0});let d=document.createElement(`style`);d.textContent=`${on}\n${ii}`;let f=document.createElement(`button`);if(f.type=`button`,f.title=`Turn on ${e.label}`,f.dataset.motionPress=``,f.setAttribute(`aria-label`,f.title),f.append(He(`0 0 20 18`,en,{})),l.append(d,f),document.documentElement.append(a),Ie(a,c.signal),i){let e=i/et(a).height,t=j(e,(e,t)=>{let n=t===0&&e===1;L(f,{scale:n?null:e.toFixed(4)}),n&&a.removeAttribute(`closing`)},at.snappy);t.set(e),t.to(1,{preset:at.snappy})}let p=$e({host:a,handle:f,dock:()=>o,shape:e=>{let t=e?a.offsetHeight:a.offsetWidth,n=et(a);return{size:t,lead:t/2,part:e?n.height:n.width,margin:2}},place:e=>{o=e,s()},drop:()=>{s();try{localStorage.setItem(e.dock,JSON.stringify(o))}catch{}},signal:c.signal});f.addEventListener(`click`,()=>{p()||(c.abort(),a.remove(),n())}),r&&f.focus({preventScroll:!0})}async function wi(e={}){return await Di(e,!1)}var Ti=new AbortController;function Ei(){Ti.abort(),Ti=new AbortController}async function Di(e,t){let n=new URL(location.href),o=n.searchParams,s=o.get(u),c=typeof e.session==`function`?e.session:void 0,d=typeof e.session==`string`?e.session:a(import.meta.url);if(!c&&!i(location.search,document.cookie))return[];let{signal:f}=Ti;try{CSS.registerProperty({name:`--vitehub-page-bar`,syntax:`<length>`,inherits:!0,initialValue:`0px`})}catch{}let p=e.pill??Si;p===Si&&(_i=z(si)!==void 0,gi=yi());let m=e.load??(e=>import(e)),h=`vitehub-tools-scripts:${d}`,_;try{let e=c?void 0:fi(d,n,s);if(c)_=await c();else if(e)_=e,document.cookie=r(!0),pi(h,_.tools);else{if(!li(p.off))for(let e of ui(h))di(e);let e=new URL(d,location.href);e.searchParams.set(`page`,location.pathname),s&&e.searchParams.set(`open`,s);let t=await fetch(e.origin===location.origin?`${e.pathname}${e.search}`:e.href,{credentials:`same-origin`,headers:{accept:`application/json`}});if(!t.ok)return[];_=l(await t.json()),pi(h,_.tools)}}catch{return[]}if(f.aborted||_.tools.length===0||document.querySelector(`${p.name}, ${p.off}`))return[];let v=s||_.tools.find(e=>e.param&&o.has(e.param))?.id;if(o.has(`vitehub`)||v||e.open)mi(p.off,!1);else if(li(p.off))return Ci(p,f,()=>{mi(p.off,!1),Di(e,!0)},!1),[];let y=e.open||v,b=_.tools.some(e=>e.id===y),x=new AbortController,S=_.tools.map(()=>new AbortController);f.addEventListener(`abort`,()=>{for(let e of S)e.abort();x.abort()},{once:!0,signal:x.signal});let C=new Set,w=!1,T=()=>!w&&[...C].every(e=>e()),E=(t=!1)=>{if(!T())return;w=!0;let n=_.tools.filter(e=>te(e.id));for(let e of _.tools)N(e.id,!1);mi(p.off,!0);let r=new URL(location.href);(p===Si||_.tools.some(e=>e.id===r.searchParams.get(`vitehub`)))&&r.searchParams.delete(u);for(let e of _.tools)e.param&&r.searchParams.delete(e.param);r.href!==location.href&&history.replaceState(history.state,``,r);let i=et(O).height,a=Qe(O);for(let e of S)e.abort();a.then(()=>{x.abort(),Ci(p,f,()=>{mi(p.off,!1);for(let e of n)N(e.id,!0);Di(e,!0)},t,i&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?i:void 0)})},D=_.account,O=Ze({name:p.name,label:p.label,mark:He(`0 0 20 18`,en,{fill:`currentColor`}),slots:[..._.tools.map(e=>e.id),ci],storage:{collapsed:p.collapsed,dock:p.dock},...p.initialDock?{initial:{dock:p.initialDock}}:{},exit:{label:`Turn off ${p.label}`,press:E,...D&&!D.guest?{menu:e=>hn({account:D,button:e,turnOff:{label:`Turn off ${p.label}`,press:E},canExit:T,signal:x.signal})}:{}},onPlace:ei,windows:{shown:Yr,hide:Xr,watch:Zr},...p===Si?{markOnly:{active:hi,watch:xi,opened:t}}:{},signal:x.signal});x.signal.addEventListener(`abort`,xe(O,{effects:[Rt,Vr]}),{once:!0});let k=new Map,A=document.createElement(`vitehub-account`);A.slot=ci,O.append(A);let ee=mn({..._.account?{account:_.account}:{},bar:A,items:()=>_.tools.map(e=>k.get(e.id)??[]),signal:x.signal}),j=new Map,M=t=>`vitehub-open:${e.pill?.name??d}:${t}`,N=(e,t)=>{try{sessionStorage.setItem(M(e),String(t))}catch{}},te=e=>{try{return sessionStorage.getItem(M(e))===`true`}catch{return!1}},P=new Map,F=async(e,t)=>await P.get(e)?.(t)??!1,I=(await Promise.all(_.tools.map(async(e,t)=>{let{signal:n}=S[t],r=document.createElement(`vitehub-tool`);r.slot=e.id,O.append(r);let i,a,o,s=()=>(o||(o=m(e.script),o.catch(()=>{o=void 0})),o),c=!1,l=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,r.replaceWith(t),r=t},u=()=>{let e=r.attachShadow({mode:`open`}),t=xe(e,Jt);n.addEventListener(`abort`,t,{once:!0});let i=document.createElement(`style`);i.textContent=g,e.append(i,f)},d=(t,o=!0)=>n.aborted?Promise.resolve(!1):c?(i?.(t),Promise.resolve(!0)):a?a.then(e=>(e&&i?.(t),e)):(a=(async()=>{let d=new AbortController,p=()=>d.abort();n.addEventListener(`abort`,p,{once:!0}),d.signal.addEventListener(`abort`,()=>{k.delete(e.id)&&ee.update()},{once:!0});try{r.setAttribute(`aria-busy`,`true`);let a=ri(await s());if(Pn(a,`the script of a page tool default-exports a function (${e.script})`),n.aborted)return!1;f.remove(),r.shadowRoot?l():r.replaceChildren();let u=a({beforeExit:e=>{let t=()=>e();C.add(t),d.signal.addEventListener(`abort`,()=>C.delete(t),{once:!0})},tool:e,bar:r,signal:d.signal,open:o&&(e.lazy===!0||e.id===y||te(e.id)),linked:o&&e.id===v,exit:()=>E(),createWindow:t=>{let n=ni({...t,signal:d.signal,onHide:()=>{N(e.id,!1),O.hasAttribute(`collapsed`)&&O.shadowRoot.querySelector(`button.mark`).focus({preventScroll:!0}),t.onHide?.()}}),r={...n,show(){if(!d.signal.aborted){for(let[t,n]of j)t!==e.id&&n.hide();N(e.id,!0),n.show()}},destroy(){j.get(e.id)===r&&(j.delete(e.id),N(e.id,!1)),n.destroy()}};return j.set(e.id,r),r},openTool:F,menu:t=>{d.signal.aborted||(k.set(e.id,t),ee.update())},createTab:()=>{let e=document.createElement(`vitehub-tab`);return e.slot=`tab`,e.setAttribute(`data-motion-appear`,`vitehub-pill`),O.append(e),d.signal.addEventListener(`abort`,()=>e.remove(),{once:!0}),e},onOpen:e=>{i=e}});return c=!0,t&&i?.(t),!r.shadowRoot&&!r.hasChildNodes()&&(r.hidden=!0),u instanceof Function&&(n.aborted?u():d.signal.addEventListener(`abort`,()=>u(),{once:!0})),!n.aborted}catch(t){return d.abort(),n.removeEventListener(`abort`,p),j.delete(e.id)&&N(e.id,!1),i=void 0,c=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),l(),f.textContent=`Retry ${e.label}`,f.title=`The tool could not load. Try again.`,r.hidden=!1,u(),!1}finally{r.removeAttribute(`aria-busy`),a=void 0}})(),a),f=document.createElement(`button`);f.type=`button`,f.textContent=e.label,f.dataset.motionPress=``,f.addEventListener(`click`,()=>void d());for(let e of[`pointerenter`,`pointerdown`,`focus`])f.addEventListener(e,()=>void s());return P.set(e.id,d),e.lazy&&e.id!==y&&!te(e.id)?(u(),e):(await d(void 0,!b||e.id===y),n.aborted?void 0:e)}))).filter(e=>!!e);if(I.length===0)x.abort();else if(s!==null){let e=new URL(location.href);e.pathname===n.pathname&&e.searchParams.get(`vitehub`)===s&&(p===Si||_.tools.some(e=>e.id===s))&&(e.searchParams.delete(u),history.replaceState(history.state,``,e))}return I}function Oi(e){let{code:t,details:n,fix:r,retryAfter:i,status:a,why:o}=e,s=t.startsWith(`COMMENTS_`)?`https://vitehub.dev/docs/comments/diagnostics/${t.toLowerCase()}`:void 0;return Object.assign(new kn({code:t,why:o,...r?{fix:r}:{},...s?{docs:s}:{}}),{status:a,...n?{details:n}:{},...i===void 0?{}:{retryAfter:i}})}function ki(e,t,n){return Object.assign(Mi.COMMENTS_R0013(t===void 0?{}:{cause:t}),{status:e,...n===void 0?{}:{retryAfter:n}})}function Ai(e){console.warn(`[vitehub] ${e.code}: ${e.why}${e.fix?` ${e.fix}`:``}`)}var ji,Mi,Ni=t((()=>{jn(),ji={COMMENTS_HOSTED_CONFLICT:{why:`This page runs the app's own Comments, so the Hosted Comments script does not start its overlay.`,fix:"Remove the Hosted Comments script, or keep it and set `comments: { overlay: false }` to turn off the app's overlay. See https://vitehub.dev/docs/comments/configure#add-hosted-comments"},COMMENTS_OUTBOX_ACCOUNT_CHANGED:{why:`The current author is not the author of this queued comment.`,fix:`Sign in as the original author and retry the outbox.`},COMMENTS_OUTBOX_RESOLVE_BLOCKED:{why:`Queued delivery must resume before the thread can close.`,fix:`Go online, then retry or dismiss any blocked comments and resolve the thread again.`},COMMENTS_OUTBOX_SENDING:{why:`The server may already have this comment, so the draft cannot change.`,fix:`Wait for delivery to finish, then edit or delete the server copy.`},COMMENTS_OVERLAY_ELEMENT_TAKEN:{why:({name:e})=>`Another script defined the <${e}> element, so this Comments overlay cannot start.`,fix:`Load one Comments overlay script on the page. Remove the other script that defines the element.`},COMMENTS_R0001:{why:({target:e})=>`createAnchor() found nothing to anchor to for ${e}.`,fix:`Pass an element, a non-empty selection, or a point that is over an element of the page.`},COMMENTS_R0013:{why:`The comments request did not get an answer from the server.`,fix:`Check the connection and the app URL, then try again.`},COMMENTS_R0015:{why:`The comment list kept changing while its pages were loading.`,fix:`Refresh again. The previous cache is kept until two complete scans agree.`}},Mi=Dn({docsBase:`https://vitehub.dev/docs/comments/diagnostics`,codes:ji})}));function Pi(e){return Fi.test(e)&&URL.canParse(e)?new URL(e).pathname:e}var Fi,Ii=t((()=>{Fi=/^https?:\/\//i}));function Li(e){let t=new URL(e).pathname,n=t.lastIndexOf(`${Ui}/assets/`);return n===-1?Ui:`${t.slice(0,n)}${Ui}`}function Ri(e){let t=Pi(e).split(/[?#]/,1)[0]??``;return t.startsWith(`/`)||(t=`/${t}`),t=t.replace(/\/{2,}/g,`/`),t.length>1&&(t=t.replace(/\/+$/,``)),t||`/`}function zi(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619)>>>0,n=Math.imul(n^i,2671213388)>>>0}return`pages/${t.toString(16).padStart(8,`0`)}${n.toString(16).padStart(8,`0`)}`}function Bi(e){return`subjects/${encodeURIComponent(JSON.stringify([e.kind,e.id]))}`}var Vi,Hi,Ui,Wi=t((()=>{Ii(),Vi=`comments`,Hi=`comments-notices`,Ui=`/_vitehub/comments`}));function Gi(){try{let e=JSON.parse(localStorage.getItem(Yi)??`null`);if(e&&typeof e==`object`&&`id`in e&&`name`in e&&typeof e.id==`string`&&typeof e.name==`string`)return{id:e.id,name:e.name}}catch{}}function Ki(e){let t={id:Gi()?.id??crypto.randomUUID(),name:e};localStorage.setItem(Yi,JSON.stringify(t));for(let e of Xi)e(t);return t}function qi(e){return Xi.add(e),()=>Xi.delete(e)}function Ji(e){return{id:`guest:${e.id}`,name:e.name,guest:!0}}var Yi,Xi,Zi=t((()=>{Yi=`vitehub-comments-guest`,Xi=new Set}));async function Qi(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function $i(e){if(e instanceof File&&e.name)return e.name;let t=/^[a-z]+\/([a-z0-9]+)/i.exec(e.type)?.[1];return t?`file.${t}`:`file`}async function ea(e,t,n,r){let i=[];for(let a of e){let e=await n({name:$i(a),type:a.type||`application/octet-stream`,data:await Qi(a),...t?{subject:t}:{}});await r?.(e.key),i.push(e.key)}return i}async function ta(e,{files:t,outbox:n},r,i){if(!t?.length)return e;try{return{...e,attachments:[...e.attachments??[],...await ea(t,r,i,n?.uploaded)]}}catch(e){throw n&&ia.set(n,{cause:e}),e}}function na(e,t=Date.now()){let n=e.headers.get(`retry-after`)?.trim();if(!n)return;if(/^\d+$/.test(n))return Number(n)*1e3;let r=Date.parse(n);return Number.isNaN(r)?void 0:Math.max(0,r-t)}var ra,ia,aa=t((()=>{ra=`x-vitehub-comments-outbox-account`,ia=new WeakMap}));function oa(e){return Object(e)===e&&!Array.isArray(e)}var sa=t((()=>{}));function ca(e,t=``){return`${t.replace(/\/+$/,``)}${Ui}/attachments/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function la(e={}){let t=e.route??`${(e.base??``).replace(/\/+$/,``)}/_vitehub/comments`;return async(n,r={})=>{let i=e.fetch??globalThis.fetch,a=new Headers(typeof e.headers==`function`?await e.headers():e.headers);for(let[e,t]of new Headers(r.headers))a.set(e,t);r.body!==void 0&&!a.has(`content-type`)&&a.set(`content-type`,`application/json`);let o=typeof e.guest==`function`?e.guest():e.guest;o&&(a.set(`x-vitehub-comments-guest-id`,o.id),a.set(`x-vitehub-comments-guest-name`,encodeURIComponent(o.name)));let s;try{s=await i(`${t}${n}`,{...r,headers:a,credentials:e.credentials??`same-origin`,cache:`no-store`})}catch(e){throw ki(0,e)}let c=await s.json().catch(()=>void 0),l=na(s);if(oa(c)&&oa(c.error)){let{code:e,why:t,fix:n}=c.error;throw typeof e!=`string`||typeof t!=`string`?ki(s.status,void 0,l):Oi({code:e,why:t,...typeof n==`string`?{fix:n}:{},...l===void 0?{}:{retryAfter:l},status:s.status})}if(oa(c)&&`data`in c){let t={data:c.data,people:Array.isArray(c.people)?c.people:[],...oa(c.thread)?{thread:c.thread}:{}};return e.onAnswer?.(t),t}throw ki(s.status,void 0,l)}}function ua(e){let t=new URLSearchParams;return e.page!==void 0&&t.set(`page`,e.page),e.subject?(t.set(`subjectKind`,e.subject.kind),t.set(`subjectId`,e.subject.id)):e.subjectKind&&t.set(`subjectKind`,e.subjectKind),e.status&&t.set(`status`,e.status),e.mine!==void 0&&t.set(`mine`,String(e.mine)),e.mentions!==void 0&&t.set(`mentions`,String(e.mentions)),e.revision&&t.set(`revision`,String(e.revision.lte)),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.before&&(t.set(`beforeId`,e.before.id),t.set(`beforeUpdatedAt`,String(e.before.updatedAt))),t}function da(e={}){let t=la(e),n=(e.base??``).replace(/\/+$/,``),r=async(e,n)=>(await t(`/attachments`,pa(e,n))).data;return{async list(e){return(await t(`/threads?${ua(e)}`)).data},async get(e){let n=`threadId`in e?fa(e.threadId):`/scopes/${encodeURIComponent(e.scope)}/threads/${e.n}`;return(await t(n)).data},async create({files:e,outbox:n,...i}){let a=await ta(i,{files:e,outbox:n},i.subject,e=>r(e,n?.account));return(await t(`/threads`,pa(a,n?.account))).data},async reply({threadId:e,subject:n,files:i,outbox:a,...o}){let s=await ta(o,{files:i,outbox:a},n,e=>r(e,a?.account)),c=await t(`${fa(e)}/comments`,pa(s,a?.account));if(!c.thread)throw ki(200);return c.thread},async edit({threadId:e,messageId:n,...r}){return(await t(`${fa(e)}/comments/${encodeURIComponent(n)}`,{method:`PATCH`,body:JSON.stringify(r)})).data},async delete({threadId:e,messageId:n}){let r=n===void 0?fa(e):`${fa(e)}/comments/${encodeURIComponent(n)}`;return(await t(r,{method:`DELETE`})).data},async resolve({threadId:e}){return(await t(`${fa(e)}/resolve`,pa())).data},async reopen({threadId:e}){return(await t(`${fa(e)}/reopen`,pa())).data},async users({query:e,limit:n,threadId:r,subject:i}){let a=new URLSearchParams({q:e});return n!==void 0&&a.set(`limit`,String(n)),r===void 0?i&&(a.set(`subjectKind`,i.kind),a.set(`subjectId`,i.id)):a.set(`thread`,r),(await t(`/people?${a}`)).data},upload:e=>r(e),attachmentUrl:e=>ca(e,n)}}var fa,pa,ma=t((()=>{Ni(),aa(),Wi(),sa(),fa=e=>`/threads/${encodeURIComponent(e)}`,pa=(e,t)=>({method:`POST`,...e===void 0?{}:{body:JSON.stringify(e)},...t===void 0?{}:{headers:{[ra]:encodeURIComponent(t)}}})}));function ha(){return Ea?Ea.namespace:new URL(wa,location.href).href}function ga(e){if(!_a(e))throw e;return{code:e.code,why:e.message,...e.fix?{fix:e.fix}:{}}}function _a(e){return e instanceof kn?!0:!(e instanceof Error)||!(`code`in e)||typeof e.code!=`string`||e.name!==e.code?!1:!(`fix`in e)||e.fix===void 0||typeof e.fix==`string`}async function va(e,t={}){try{return[void 0,(await Ta(e,t)).data]}catch(e){return[ga(e),void 0]}}function ya(e){Ea=e}function ba(e){return Ea?.changes?.(e)??(()=>void 0)}function xa(e,t){if(Ea)return;let n=Ta(`/threads?page=${encodeURIComponent(e)}&limit=${Oa}`,{signal:t});return n.catch(()=>void 0),{answer:n,signal:t}}function Sa(e,t){let{subject:n,limit:r,...i}=e;return Object.keys(i).length===0&&r===Oa&&n?.kind===t.kind&&n.id===t.id}function Ca(e){let t=t=>t.people.length&&e.onPeople(t.people),n=Ea?Ea.transport(t):da({base:wa.slice(0,-Ui.length),guest:Gi,onAnswer:t}),r=e.pageThreads,i=async i=>{e.pageThreads?.signal.throwIfAborted();let a=r;r=void 0;let o=a&&Sa(i,a.subject)?await a.answer.catch(()=>void 0):void 0;return a?.signal.throwIfAborted(),o?(t(o),o.data):await n.list(i)},a=t=>async(...n)=>{let r=await t(...n);return e.onChange(),r};return{...n,list:i,create:a(n.create),reply:a(n.reply),edit:a(n.edit),delete:a(n.delete),resolve:a(n.resolve),reopen:a(n.reopen)}}var wa,Ta,Ea,Da,Oa,ka,Aa=t((()=>{Wi(),jn(),Zi(),ma(),wa=Li(import.meta.url),Ta=la({route:wa,guest:Gi}),Da=e=>({method:`POST`,body:JSON.stringify(e)}),Oa=200,ka={session:e=>Ea?Ea.session(e):va(`/session?page=${encodeURIComponent(e)}`),pageThreads:xa,field:(e,t)=>va(`/fields?page=${encodeURIComponent(t)}&field=${encodeURIComponent(e)}`),saveField:(e,t)=>va(`/fields?page=${encodeURIComponent(t)}`,Da(e))}}));function ja(){let e={};return document.querySelector(Pa)?.dispatchEvent(new CustomEvent(Fa,{detail:e})),e.draft}function Ma(){return customElements.get(`vitehub-comments`)?(Ai(Mi.COMMENTS_HOSTED_CONFLICT()),!0):!1}var Na,Pa,Fa,Ia=t((()=>{Ni(),Na=`vitehub-comments`,Pa=`vitehub-hosted-comments`,Fa=`vitehub:hosted-comments-draft`}));Aa(),Ia();function La(e){return`/comments/${encodeURIComponent(e)}/embed`}var Ra,za,Ba,Va,Ha,Ua,Wa=t((()=>{Ra=`modulepreload`,za=function(e,t){return new URL(e,t).href},Ba={},Va=function(e){return e.pathname.endsWith(`.css`)},Ha=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Ua=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=za(t,n);let r=s(t),i=Va(r);return Ha(Ba,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ra,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}})),Ga,Ka=t((()=>{Ga=`:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}[data-slot=comment-mark-pin][data-motion-leave-managed]{transition:none}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}`}));function qa(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e.replace(/[^\w-]/g,e=>`\\${e}`)}function Ja(e,t){return`[${e}="${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"]`}function Ya(e){let t=[],n=e;for(;n&&n!==document.documentElement&&t.length<no;){if(n.id)return t.unshift(`#${qa(n.id)}`),t.join(` > `);let e=n.getAttribute(to);if(e)return t.unshift(Ja(to,e)),t.join(` > `);let r=n.tagName.toLowerCase(),i=n.parentElement;if(!i){t.unshift(r);break}let a=[...i.children].filter(e=>e.tagName===n.tagName);t.unshift(a.length>1?`${r}:nth-of-type(${a.indexOf(n)+1})`:r),n=i}return t.join(` > `)}function Xa(e){let t=(e.textContent??``).replace(/\s+/g,` `).trim().slice(0,40),n=e.tagName.toLowerCase();return t?`${n} ${t}`:n}function Za(e,t){return t?Math.min(1e3,Math.max(0,Math.round(e/t*1e3))):0}function Qa(){return Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth,1)}function $a(e){return e.closest(`[data-content-field]`)??void 0}function eo(e,t,n){let r=e.getBoundingClientRect(),i=$a(e)?.getAttribute(`data-content-field`)??void 0;return{kind:`element`,...i?{field:i}:{},selector:Ya(e),label:Xa(e),x:Za(t-r.left,r.width),y:Za(n-r.top,r.height),page:{x:Za(t+window.scrollX,Qa()),y:Math.max(0,Math.round(n+window.scrollY))},viewport:{width:window.innerWidth}}}var to,no,ro=t((()=>{to=`data-content-field`,no=10}));function io(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function ao(e){if(B(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=jo(r)?oo(r):ao(r);if(i)for(let e in i)t[e]=i[e]}return t}if(jo(e)||No(e))return e}function oo(e){let t={};return e.replace(rs,e=>e.startsWith(`/*`)?``:e).split(ts).forEach(e=>{if(e){let n=e.split(ns);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function so(e){let t=``;if(jo(e))t=e;else if(B(e))for(let n=0;n<e.length;n++){let r=so(e[n]);r&&(t+=r+` `)}else if(No(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function co(e){if(!e)return null;let{class:t,style:n}=e;return t&&!jo(t)&&(e.class=so(t)),n&&(e.style=ao(n)),e}function lo(e){return!!e||e===``}function uo(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=ho(e[i],t[i],n);return r}function fo(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]&&ho(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function po(e,t,n){let r=Do(e),i=Do(t);if(r||i||(r=Oo(e),i=Oo(t),r||i))return r&&i?fo(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=Eo(e,r),a=Eo(t,r);if(i&&!a||!i&&a||!ho(e[r],t[r],n))return!1}return go(e)===go(t)}function mo(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 ho(e,t,n){if(e===t)return!0;let r=ko(e),i=ko(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=Mo(e),i=Mo(t),r||i?e===t:(r=B(e),i=B(t),r||i?r&&i?mo(e,t,n,uo):!1:(r=No(e),i=No(t),r||i?!r||!i?!1:mo(e,t,n,po):String(e)===String(t))))}function go(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?Io(e):String(e)}var _o,vo,yo,bo,xo,So,Co,wo,To,Eo,B,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us=t((()=>{_o={},vo=[],yo=()=>{},bo=()=>!1,xo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),So=e=>e.startsWith(`onUpdate:`),Co=Object.assign,wo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},To=Object.prototype.hasOwnProperty,Eo=(e,t)=>To.call(e,t),B=Array.isArray,Do=e=>Io(e)===`[object Map]`,Oo=e=>Io(e)===`[object Set]`,ko=e=>Io(e)===`[object Date]`,Ao=e=>typeof e==`function`,jo=e=>typeof e==`string`,Mo=e=>typeof e==`symbol`,No=e=>typeof e==`object`&&!!e,Po=e=>(No(e)||Ao(e))&&Ao(e.then)&&Ao(e.catch),Fo=Object.prototype.toString,Io=e=>Fo.call(e),Lo=e=>Io(e).slice(8,-1),Ro=e=>Io(e)===`[object Object]`,zo=e=>jo(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,Bo=io(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Vo=1e4,Ho=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>Vo&&(t=Object.create(null),n=1),t[r]=e(r)):i})},Uo=/-\w/g,Wo=Ho(e=>e.replace(Uo,e=>e.slice(1).toUpperCase())),Go=/\B([A-Z])/g,Ko=Ho(e=>e.replace(Go,`-$1`).toLowerCase()),qo=Ho(e=>e.charAt(0).toUpperCase()+e.slice(1)),Jo=Ho(e=>e?`on${qo(e)}`:``),Yo=(e,t)=>!Object.is(e,t),Xo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Zo=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Qo=e=>{let t=parseFloat(e);return isNaN(t)?e:t},es=()=>$o||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ts=/;(?![^(]*\))/g,ns=/:([^]+)/,rs=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g,is=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,as=io(is),os=e=>!!(e&&e.__v_isRef===!0),ss=e=>jo(e)?e:e==null?``:B(e)||No(e)&&(e.toString===Fo||!Ao(e.toString))?os(e)?ss(e.value):JSON.stringify(e,cs,2):String(e),cs=(e,t)=>os(t)?cs(e,t.value):Do(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ls(t,r)+` =>`]=n,e),{})}:Oo(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ls(e))}:Mo(t)?ls(t):No(t)&&!B(t)&&!Ro(t)?String(t):t,ls=(e,t=``)=>Mo(e)?`Symbol(${e.description??t})`:e}));function ds(e){return new dc(e)}function fs(){return uc}function ps(e,t=!1){uc&&(uc.active?uc.cleanups.push(e):e())}function ms(e,t=!1){e.flags|=8,t?(e.next=_c,_c=e):(e.next=gc,gc=e)}function hs(){hc++}function gs(){if(--hc>0)return;if(_c){let e=_c;for(_c=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;gc;){let t=gc;for(gc=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 _s(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vs(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),xs(r),Ss(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bs(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bs(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===bc)||(e.globalVersion=bc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ys(e))))return;e.flags|=2;let t=e.dep,n=fc,r=vc;fc=e,vc=!0;try{_s(e);let n=e.fn(e._value);(t.version===0||Yo(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{fc=n,vc=r,vs(e),e.flags&=-3}}function xs(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)xs(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ss(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Cs(){yc.push(vc),vc=!1}function ws(){let e=yc.pop();vc=e===void 0||e}function Ts(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=fc;fc=void 0;try{t()}finally{fc=e}}}function Es(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)Es(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function Ds(e,t,n){if(vc&&fc){let t=Cc.get(e);t||Cc.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Sc),r.map=t,r.key=n),r.track()}}function Os(e,t,n,r,i,a){let o=Cc.get(e);if(!o){bc++;return}let s=e=>{e&&e.trigger()};if(hs(),t===`clear`)o.forEach(s);else{let i=B(e),a=i&&zo(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ec||!Mo(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ec)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(wc)),Do(e)&&s(o.get(Tc)));break;case`delete`:i||(s(o.get(wc)),Do(e)&&s(o.get(Tc)));break;case`set`:Do(e)&&s(o.get(wc))}}gs()}function ks(e){let t=Qs(e);return t===e||(Ds(t,`iterate`,Ec),Xs(e))?t:Ys(e)?Js(e)?t.map(e=>qc(Kc(e))):t.map(qc):t.map(Kc)}function As(e){return Ds(e=Qs(e),`iterate`,Ec),e}function js(e,t){return Ys(e)?qc(Js(e)?Kc(t):t):Kc(t)}function Ms(e,t,n){let r=As(e),i=r[t],a=i.call(r);if(r!==e&&!Xs(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>Ns(a.next(),n),i!==Oc[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=()=>Ns(a._next(),n)}return a}function Ns(e,t){return e.done||(e.value=t(e.value)),e}function Ps(e,t,n,r,i,a){let o=As(e),s=o!==e&&!Xs(e),c=o[t];if(c!==Oc[t]){let t=c.apply(e,a);return s?Kc(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,js(e,t),r,e)}: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 Fs(e,t,n,r){let i=As(e),a=i!==e&&!Xs(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=js(e,t)),n.call(this,t,js(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?js(e,c):c}function Is(e,t,n){let r=Qs(e);Ds(r,`iterate`,Ec);let i=r[t](...n);return(i===-1||i===!1)&&Zs(n[0])?(n[0]=Qs(n[0]),r[t](...n)):i}function Ls(e,t,n=[]){Cs(),hs();let r=Qs(e)[t].apply(e,n);return gs(),ws(),r}function Rs(e){Mo(e)||(e=String(e));let t=Qs(this);return Ds(t,`has`,e),t.hasOwnProperty(e)}function zs(e,t,n){return function(...r){let i=this.__v_raw,a=Qs(i),o=Do(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Lc:t?qc:Kc;return!t&&Ds(a,`iterate`,c?Tc:wc),Co(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Bs(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Vs(e,t){let n={get(n){let r=this.__v_raw,i=Qs(r),a=Qs(n);e||(Yo(n,a)&&Ds(i,`get`,n),Ds(i,`get`,a));let{has:o}=Rc(i),s=t?Lc:e?qc:Kc;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&&Ds(Qs(t),`iterate`,wc),t.size},has(t){let n=this.__v_raw,r=Qs(n),i=Qs(t);return e||(Yo(t,i)&&Ds(r,`has`,t),Ds(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=Qs(a),s=t?Lc:e?qc:Kc;return!e&&Ds(o,`iterate`,wc),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return Co(n,e?{add:Bs(`add`),set:Bs(`set`),delete:Bs(`delete`),clear:Bs(`clear`)}:{add(e){let n=Qs(this),r=Rc(n),i=Qs(e),a=!t&&!Xs(e)&&!Ys(e)?i:e;return r.has.call(n,a)||Yo(e,a)&&r.has.call(n,e)||Yo(i,a)&&r.has.call(n,i)||(n.add(a),Os(n,`add`,a,a)),this},set(e,n){t||Xs(n)||Ys(n)||(n=Qs(n));let r=Qs(this),{has:i,get:a}=Rc(r),o=i.call(r,e);o||=(e=Qs(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Yo(n,s)&&Os(r,`set`,e,n,s):Os(r,`add`,e,n),this},delete(e){let t=Qs(this),{has:n,get:r}=Rc(t),i=n.call(t,e);i||=(e=Qs(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Os(t,`delete`,e,void 0,a),o},clear(){let e=Qs(this),t=e.size!==0,n=e.clear();return t&&Os(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=zs(r,e,t)}),n}function Hs(e,t){let n=Vs(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(Eo(n,i)&&i in r?n:r,i,a)}function Us(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Ws(e){return Ys(e)?e:qs(e,!1,Pc,zc,Hc)}function Gs(e){return qs(e,!1,Ic,Bc,Uc)}function Ks(e){return qs(e,!0,Fc,Vc,Wc)}function qs(e,t,n,r,i){if(!No(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=Us(Lo(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Js(e){return Ys(e)?Js(e.__v_raw):!!(e&&e.__v_isReactive)}function Ys(e){return!!(e&&e.__v_isReadonly)}function Xs(e){return!!(e&&e.__v_isShallow)}function Zs(e){return e?!!e.__v_raw:!1}function Qs(e){let t=e&&e.__v_raw;return t?Qs(t):e}function $s(e){return!Eo(e,`__v_skip`)&&Object.isExtensible(e)&&Zo(e,`__v_skip`,!0),e}function ec(e){return e?e.__v_isRef===!0:!1}function V(e){return nc(e,!1)}function tc(e){return nc(e,!0)}function nc(e,t){return ec(e)?e:new Jc(e,t)}function H(e){return ec(e)?e.value:e}function rc(e){return Ao(e)?e():H(e)}function ic(e){return Js(e)?e:new Proxy(e,Yc)}function ac(e){return new Xc(e)}function oc(e,t,n=!1){let r,i;return Ao(e)?r=e:(r=e.get,i=e.set),new Zc(r,i,n)}function sc(e,t=!1,n=el){if(n){let t=$c.get(n);t||$c.set(n,t=[]),t.push(e)}}function cc(e,t,n=_o){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:Xs(e)||i===!1||i===0?lc(e,1):lc(e),u,d,f,p,m=!1,h=!1;if(ec(e)?(d=()=>e.value,m=Xs(e)):Js(e)?(d=()=>l(e),m=!0):B(e)?(h=!0,m=e.some(e=>Js(e)||Xs(e)),d=()=>e.map(e=>{if(ec(e))return e.value;if(Js(e))return l(e);if(Ao(e))return c?c(e,2):e()})):d=Ao(e)?t?c?()=>c(e,2):e:()=>{if(f){Cs();try{f()}finally{ws()}}let t=el;el=u;try{return c?c(e,3,[p]):e(p)}finally{el=t}}:yo,t&&i){let e=d,t=i===!0?1/0:i;d=()=>lc(e(),t)}let g=fs(),_=()=>{u.stop(),g&&g.active&&wo(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{_()}}}let v=h?Array(e.length).fill(Qc):Qc,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Yo(e,v[t])):Yo(n,v))){let e=el;Cs();try{f&&f(),el=u;let e=[n,v===Qc?void 0:h&&v[0]===Qc?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{el=e,ws()}}}else u.run()}};return s&&s(y),u=new mc(d),u.scheduler=o?()=>o(y,!1):y,p=e=>sc(e,!1,u),f=u.onStop=()=>{let e=$c.get(u);if(e){if(c)c(e,4);else for(let t of e)t();$c.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function lc(e,t=1/0,n){if(t<=0||!No(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ec(e))lc(e.value,t,n);else if(B(e))for(let r=0;r<e.length;r++)lc(e[r],t,n);else if(Oo(e)||Do(e))e.forEach(e=>{lc(e,t,n)});else if(Ro(e)){for(let r in e)lc(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&lc(e[r],t,n)}return e}var uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl=t((()=>{us(),dc=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&&uc&&(uc.active?(this.parent=uc,this.index=(uc.scopes||(uc.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=uc;try{return uc=this,e()}finally{uc=t}}}on(){++this._on===1&&(this.prevScope=uc,uc=this)}off(){if(this._on>0&&--this._on===0){if(uc===this)uc=this.prevScope;else{let e=uc;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}}},pc=new WeakSet,mc=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,uc&&(uc.active?uc.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,pc.has(this)&&(pc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ms(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ts(this),_s(this);let e=fc,t=vc;fc=this,vc=!0;try{return this.fn()}finally{vs(this),fc=e,vc=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)xs(e);this.deps=this.depsTail=void 0,Ts(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?pc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ys(this)&&this.run()}get dirty(){return ys(this)}},hc=0,vc=!0,yc=[],bc=0,xc=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}},Sc=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(!fc||!vc||fc===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==fc)t=this.activeLink=new xc(fc,this),fc.deps?(t.prevDep=fc.depsTail,fc.depsTail.nextDep=t,fc.depsTail=t):fc.deps=fc.depsTail=t,Es(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=fc.depsTail,t.nextDep=void 0,fc.depsTail.nextDep=t,fc.depsTail=t,fc.deps===t&&(fc.deps=e)}return t}trigger(e){this.version++,bc++,this.notify(e)}notify(e){hs();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{gs()}}},Cc=new WeakMap,wc=Symbol(``),Tc=Symbol(``),Ec=Symbol(``),Dc={__proto__:null,[Symbol.iterator](){return Ms(this,Symbol.iterator,e=>js(this,e))},concat(...e){return ks(this).concat(...e.map(e=>B(e)?ks(e):e))},entries(){return Ms(this,`entries`,e=>(e[1]=js(this,e[1]),e))},every(e,t){return Ps(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ps(this,`filter`,e,t,e=>e.map(e=>js(this,e)),arguments)},find(e,t){return Ps(this,`find`,e,t,e=>js(this,e),arguments)},findIndex(e,t){return Ps(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ps(this,`findLast`,e,t,e=>js(this,e),arguments)},findLastIndex(e,t){return Ps(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ps(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Is(this,`includes`,e)},indexOf(...e){return Is(this,`indexOf`,e)},join(e){return ks(this).join(e)},lastIndexOf(...e){return Is(this,`lastIndexOf`,e)},map(e,t){return Ps(this,`map`,e,t,void 0,arguments)},pop(){return Ls(this,`pop`)},push(...e){return Ls(this,`push`,e)},reduce(e,...t){return Fs(this,`reduce`,e,t)},reduceRight(e,...t){return Fs(this,`reduceRight`,e,t)},shift(){return Ls(this,`shift`)},some(e,t){return Ps(this,`some`,e,t,void 0,arguments)},splice(...e){return Ls(this,`splice`,e)},toReversed(){return ks(this).toReversed()},toSorted(e){return ks(this).toSorted(e)},toSpliced(...e){return ks(this).toSpliced(...e)},unshift(...e){return Ls(this,`unshift`,e)},values(){return Ms(this,`values`,e=>js(this,e))}},Oc=Array.prototype,kc=io(`__proto__,__v_isRef,__isVue`),Ac=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(Mo)),jc=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?Gc:Wc:i?Uc:Hc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=B(e);if(!r){let e;if(a&&(e=Dc[t]))return e;if(t===`hasOwnProperty`)return Rs}let o=Reflect.get(e,t,ec(e)?e:n);if((Mo(t)?Ac.has(t):kc(t))||(r||Ds(e,`get`,t),i))return o;if(ec(o)){let e=a&&zo(t)?o:o.value;return r&&No(e)?Ks(e):e}return No(o)?r?Ks(o):Ws(o):o}},Mc=class extends jc{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=B(e)&&zo(t);if(!this._isShallow){let e=Ys(i);if(!Xs(n)&&!Ys(n)&&(i=Qs(i),n=Qs(n)),!a&&ec(i)&&!ec(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:Eo(e,t),s=Reflect.set(e,t,n,ec(e)?e:r);return e===Qs(r)&&s&&(o?Yo(n,i)&&Os(e,`set`,t,n,i):Os(e,`add`,t,n)),s}deleteProperty(e,t){let n=Eo(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Os(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return Mo(t)&&Ac.has(t)||Ds(e,`has`,t),n}ownKeys(e){return Ds(e,`iterate`,B(e)?`length`:wc),Reflect.ownKeys(e)}},Nc=class extends jc{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Pc=new Mc,Fc=new Nc,Ic=new Mc(!0),Lc=e=>e,Rc=e=>Reflect.getPrototypeOf(e),zc={get:Hs(!1,!1)},Bc={get:Hs(!1,!0)},Vc={get:Hs(!0,!1)},Hc=new WeakMap,Uc=new WeakMap,Wc=new WeakMap,Gc=new WeakMap,Kc=e=>No(e)?Ws(e):e,qc=e=>No(e)?Ks(e):e,Jc=class{constructor(e,t){this.dep=new Sc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Qs(e),this._value=t?e:Kc(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Xs(e)||Ys(e);e=n?e:Qs(e),Yo(e,t)&&(this._rawValue=e,this._value=n?e:Kc(e),this.dep.trigger())}},Yc={get:(e,t,n)=>t===`__v_raw`?e:H(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return ec(i)&&!ec(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},Xc=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new Sc,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}},Zc=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Sc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=bc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&fc!==this)return ms(this,!0),!0}get value(){let e=this.dep.track();return bs(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},Qc={},$c=new WeakMap,el=void 0}));function nl(e,t,n,r){try{return r?e(...r):e()}catch(e){il(e,t,n)}}function rl(e,t,n,r){if(Ao(e)){let i=nl(e,t,n,r);return i&&Po(i)&&i.catch(e=>{il(e,t,n,void 0,!0)}),i}if(B(e)){let i=[];for(let a=0;a<e.length;a++)i.push(rl(e[a],t,n,r));return i}}function il(e,t,n,r=!0,i=!1){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||_o;if(t){let r=t.parent,a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t&&!r.isUnmounted&&(!i||r.scope.active)){for(let n=0;n<t.length;n++)if(t[n](e,a,s)===!1)return}r=r.parent}if(o){Cs(),nl(o,null,10,[e,a,s]),ws();return}}al(e,n,a,r,s)}function al(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function ol(e){let t=md||pd;return e?t.then(this?e.bind(this):e):t}function sl(e){let t=ld+1,n=cd.length;for(;t<n;){let r=t+n>>>1,i=cd[r],a=gd(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function cl(e){if(!(e.flags&1)){let t=gd(e),n=cd[cd.length-1];!n||!(e.flags&2)&&t>=gd(n)?cd.push(e):cd.splice(sl(t),0,e),e.flags|=1,ll()}}function ll(){md||=pd.then(ml)}function ul(e){if(!B(e))dd&&e.id===-1?dd.splice(fd+1,0,e):e.flags&1||(ud.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)ud.push(e[t]);ll()}function dl(e,t,n,r=ld+1){for(;r<cd.length;r++){let n=cd[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;cd.splice(r,1),r=e?r-1:ld,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function fl(e,t,n=0){if(ud.length){let e=ud,r=0;if(t){e=[];for(let i=0;i<ud.length;i++){let a=ud[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?ud[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>gd(e)-gd(t));if(ud.length=r,dd){for(let e=0;e<i.length;e++)dd.push(i[e]);return}for(dd=i,fd=0;fd<dd.length;fd++){let e=dd[fd];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}dd=null,fd=0}}function pl(e,t){if(hd){e();return}let n=t===void 0?void 0:new Set(ud);e(),hd=!0;try{dl(void 0,t),fl(void 0,n,t)}finally{hd=!1}}function ml(e){try{for(ld=0;ld<cd.length;ld++){let e=cd[ld];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),nl(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ld<cd.length;ld++){let e=cd[ld];e&&(e.flags&=-2)}ld=-1,cd.length=0,fl(e),md=null,(cd.length||ud.length)&&ml(e)}}function hl(e){let t=_d;return _d=e,vd=e&&e.type.__scopeId||null,t}function gl(e,t=_d,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Fu(-1);let i=hl(t),a=vf.length,o;try{o=e(...n)}finally{for(let e=vf.length;e>a;e--)Pu();hl(i),r._d&&Fu(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function _l(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 s=0;s<a.length;s++){let c=a[s];o?c.oldValue=o[s].value:r===`mounted`&&c.oldValue!==void 0&&(c=Co({},c,{oldValue:void 0}));let l=c.dir[r];l&&(Cs(),rl(l,n,8,[e.el,c,i,t]),ws())}}function vl(e,t){if(Ef){let n=Ef.provides,r=Ef.parent&&Ef.parent.provides;r===n&&(n=Ef.provides=Object.create(r)),n[e]=t}}function yl(e,t,n=!1){let r=Df();if(r||Yd){let i=Yd?Yd._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&&Ao(t)?t.call(r&&r.proxy):t}}function bl(){return!!(Df()||Yd)}function xl(e,t){return Cl(e,null,t)}function Sl(e,t){return Cl(e,null,{flush:`sync`})}function U(e,t,n){return Cl(e,t,n)}function Cl(e,t,n=_o){let{immediate:r,deep:i,flush:a,once:o}=n,s=Co({},n),c=t&&r||!t&&a!==`post`,l;if(Mf){if(a===`sync`){let e=bd();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=yo,e.resume=yo,e.pause=yo,e}}let u=Ef;s.call=(e,t,n)=>rl(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{e.i=u,df(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():cl(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=cc(e,t,s);return Mf&&(l?l.push(f):c&&f()),f}function wl(e,t,n,{o:{insert:r},m:i},a=2){a===0&&(e.targetStart&&r(e.targetStart,t,n),r(e.targetAnchor,t,n),n=e.targetAnchor);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!xd.has(e)&&(!d||wd(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function Tl(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=Od(t.props,c),h=wd(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(f(m,c),p(e,t),t.targetAnchor||Dl(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Dl(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),El(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}function El(e,t){let n=e.ctx;n&&n.ut&&(t?n.ut(e.el,e.anchor):n.ut(e.targetStart,e.targetAnchor))}function Dl(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Sd]=o,e&&(r(a,e,i),r(o,e,i)),o}function Ol(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==gf){t=n;break}}return t}function kl(e){if(!Fd(e))return Cd(e.type)&&e.children?Ol(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&&Ao(n.default))return n.default()}}function Al(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Al(Cd(n.type)&&kl(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&Al(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===mf&&B(e.children)){let n=fu(e.children,!1);n&&Al(n,t)}}function jl(e){if(e.component)return jl(e.component.subTree);if(e.type===mf){let t=B(e.children)&&fu(e.children,!1);return t?jl(t):void 0}if(e.type!==gf)return e}function W(e,t){return Ao(e)?Co({name:e.name},t,{setup:e}):e}function Ml(){let e=Df();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function Nl(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Pl(e){let t=Df(),n=tc(null);if(t){let r=t.refs===_o?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function Fl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Il(e,t,n,r,i=!1){if(B(e)){e.forEach((e,a)=>Il(e,t&&(B(t)?t[a]:t),n,r,i));return}if(Pd(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Il(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?ad(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===_o?s.refs={}:s.refs,d=s.setupState,f=Qs(d),p=d===_o?bo:e=>!Fl(u,e)&&Eo(f,e),m=(e,t)=>!(t&&Fl(u,t));if(l!=null&&l!==c){if(Ll(t),jo(l))u[l]=null,p(l)&&(d[l]=null);else if(ec(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(Ao(c))nl(c,s,12,[o,u]);else{let t=jo(c),r=ec(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)B(n)&&wo(n,a);else if(B(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Md.delete(e)};t.id=-1,Md.set(e,t),df(t,n)}else Ll(e),s()}}}function Ll(e){let t=Md.get(e);t&&(t.flags|=8,Md.delete(e))}function Rl(e,t){if(Nd(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Nd(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}function zl(e){Ao(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return W({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Rl(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ef;if(Nl(e),u)return()=>Bl(u,e);let t=t=>{l=null,il(t,e,13,!r,!0)};if(s&&e.suspense||Mf)return p().then(t=>()=>Bl(t,e)).catch(e=>(t(e),()=>r?Cf(r,{error:e}):null));let a=V(!1),c=V(),d=V(!!i),f,m;return ps(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Fd(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Bl(u,e);if(c.value&&r)return Cf(r,{error:c.value});if(n&&!d.value)return Bl(n,e)}}})}function Bl(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=Cf(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}function Vl(e,t){Ul(e,`a`,t)}function Hl(e,t){Ul(e,`da`,t)}function Ul(e,t,n=Ef){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Gl(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Fd(e.parent.vnode)&&Wl(r,t,n,e),e=e.parent}}function Wl(e,t,n,r){let i=Gl(t,e,r,!0),a=Gl(`um`,()=>wo(r[t],i),n);a.flags=16}function Gl(e,t,n=Ef,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Cs();let i=Af(n),a=rl(t,n,e,r);return i(),ws(),a};return r?i.unshift(a):i.push(a),a}}function Kl(e,t=Ef){Gl(`ec`,e,t)}function ql(e){return jo(e)?Jl(Hd,e,!1)||e:e||Ud}function Jl(e,t,n=!0,r=!1){let i=_d||Ef;if(i){let n=i.type;if(e===Hd){let e=od(n,!1);if(e&&(e===t||e===Wo(t)||e===qo(Wo(t))))return n}let a=Yl(i[e]||n[e],t)||Yl(i.appContext[e],t);return!a&&r?n:a}}function Yl(e,t){return e&&(e[t]||e[Wo(t)]||e[qo(Wo(t))])}function Xl(e,t,n,r){let i,a=n&&n[r],o=B(e);if(o||jo(e)){let n=o&&Js(e),r=!1,s=!1;n&&(r=!Xs(e),s=Ys(e),e=As(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?qc(Kc(e[n])):Kc(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(No(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 Zl(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(B(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Ql(e,t,n,r,i,a){if(n??={},_d.ce||_d.parent&&Pd(_d.parent)&&_d.parent.ce){let e=a!=null&&n.key==null?Co({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),G(),Lu(mf,null,[Cf(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=vf.length;G();let c;try{let i=o&&$l(o(n)),s=n.key||a||i&&i.key;c=Lu(mf,{key:(s&&!Mo(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=vf.length;e>s;e--)Pu();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function $l(e){return e.some(e=>!Ru(e)||!(e.type===gf||e.type===mf&&!$l(e.children)))?e:null}function eu(){return nu(`useSlots`).slots}function tu(){return nu(`useAttrs`).attrs}function nu(e){let t=Df();return t.setupContext||=id(t)}function ru(e){return B(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function iu(e,t){return!e||!t?e||t:B(e)&&B(t)?e.concat(t):Co({},ru(e),ru(t))}function au(){return{app:null,config:{isNativeTag:bo,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}}function ou(e,t){return function(n,r=null){Ao(n)||(n=Co({},n)),r!=null&&!No(r)&&(r=null);let i=au(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Jd++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Lf,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&Ao(e.install)?(a.add(e),e.install(c,...t)):Ao(e)&&(a.add(e),e(c,...t))),c},mixin(e){return c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||Cf(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,ad(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(rl(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Yd;Yd=c;try{return e()}finally{Yd=t}}};return c}}function su(e,t,n=_o){let r=Df(),i=Wo(t),a=Ko(t),o=Xd(e,i),s=ac((o,s)=>{let c,l=_o,u;return Sl(()=>{let t=e[i];Yo(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Yo(o,c)&&!(l!==_o&&Yo(e,l)))return;let d=r.vnode.props,f=!!(d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d));f||(c=e,s()),r.emit(`update:${t}`,o),Yo(e,l)&&(Yo(e,o)&&!Yo(o,u)||f&&l!==_o&&!Yo(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||_o:s,done:!1}:{done:!0}}}},s}function cu(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||_o,i=n,a=t.startsWith(`update:`),o=a&&Xd(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>jo(e)?e.trim():e)),o.number&&(i=i.map(Qo)));let s,c=r[s=Jo(t)]||r[s=Jo(Wo(t))];!c&&a&&(c=r[s=Jo(Ko(t))]),c&&rl(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,rl(l,e,6,i)}}function lu(e,t,n=!1){let r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={};return a?(B(a)?a.forEach(e=>o[e]=null):Co(o,a),No(e)&&r.set(e,o),o):(No(e)&&r.set(e,null),null)}function uu(e,t){return!e||!xo(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),Eo(e,t[0].toLowerCase()+t.slice(1))||Eo(e,Ko(t))||Eo(e,t))}function du(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=hl(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=Ku(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=Ku(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Zd(s)}}catch(t){vf.length=0,il(t,e,1),_=Cf(gf)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(So)&&(v=Qd(v,a)),y=Uu(y,v,!1,!0))}return n.dirs&&(y=Uu(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Al(Cd(y.type)&&kl(y)||y,n.transition),_=y,hl(g),_}function fu(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Ru(r)){if(r.type!==gf||r.children===`v-if`){if(n)return;n=r}}else return}return n}function pu(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?mu(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(hu(o,r,n)&&!uu(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||mu(r,o,l):!!o;return!1}function mu(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(!Eo(e,a)||hu(t,e,a)&&!uu(n,a))return!0}return!1}function hu(e,t,n){let r=e[n],i=t[n];return n===`style`&&No(r)&&No(i)?!ho(r,i):r!==i}function gu({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)}function _u(e,t,n,r=!1){let i={},a=ef();e.propsDefaults=Object.create(null),yu(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Gs(i):e.type.props?i:a,e.attrs=a}function vu(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Qs(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(uu(e.emitsOptions,o))continue;let u=t[o];if(c){if(Eo(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Wo(o);i[t]=bu(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{yu(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(Eo(t,a)||(r=Ko(a))!==a&&Eo(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=bu(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&Eo(t,e)||(delete a[e],l=!0)}l&&Os(e.attrs,`set`,``)}function yu(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(Bo(c))continue;let l=t[c],u;i&&Eo(i,u=Wo(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:uu(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=Qs(n),r=s||_o;for(let o=0;o<a.length;o++){let s=a[o];n[s]=bu(i,t,s,r[s],e,!Eo(r,s))}}return o}function bu(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=Eo(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&Ao(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Af(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===Ko(n))&&(r=!0))}return r}function xu(e,t,n=!1){let r=t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[];if(!a)return No(e)&&r.set(e,vo),vo;if(B(a))for(let e=0;e<a.length;e++){let t=Wo(a[e]);Su(t)&&(o[t]=_o)}else if(a)for(let e in a){let t=Wo(e);if(Su(t)){let n=a[e],r=o[t]=B(n)||Ao(n)?{type:n}:Co({},n),i=r.type,c=!1,l=!0;if(B(i))for(let e=0;e<i.length;++e){let t=i[e],n=Ao(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=Ao(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||Eo(r,`default`))&&s.push(t)}}let c=[o,s];return No(e)&&r.set(e,c),c}function Su(e){return e[0]!==`$`&&!Bo(e)}function Cu(e){return wu(e)}function wu(e,t){let n=es();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=yo,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!zu(e,t)&&(r=ae(e),I(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===vo&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case hf:g(e,t,n,r);break;case gf:_(e,t,n,r);break;case _f:e??v(t,n,r,o);break;case mf:O(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?k(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,oe)}u!=null&&i?Il(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Il(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,Tu(e,c),l,d),_&&_l(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!Bo(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Xu(p,i,e)}_&&_l(e,null,i,`beforeMount`);let v=Du(s,g);v?g.beforeEnter(f):g&&!g.persisted&&(f[pf]=!0),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&df(()=>{try{p&&Xu(p,i,e),v&&g.enter(f),_&&_l(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||ff(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?qu(e[l]):Ku(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||_o,m=t.props||_o,h;if(n&&Eu(n,!1),(h=m.onVnodeBeforeUpdate)&&Xu(h,n,t,e),f&&_l(t,e,n,`beforeUpdate`),n&&Eu(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,Tu(t,i),o):s||N(e,t,c,null,n,r,Tu(t,i),o,!1),l>0){if(l&16)D(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&D(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&df(()=>{h&&Xu(h,n,t,e),f&&_l(t,e,n,`updated`)},r)},E=(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||Mu(c),f=u&&(c.type===mf||!zu(c,l)||c.shapeFlag&198)?d(u):n;h(c,l,f,null,r,i,a,o,!0)}},D=(e,t,n,r,i)=>{if(t!==n){if(t!==_o)for(let o in t)!Bo(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(Bo(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},O=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Ou(e,t,!0)):N(e,t,n,f,a,o,c,l,u)},k=(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):A(t,n,r,i,a,o,c):ee(e,t,c)},A=(e,t,n,r,i,a,o)=>{let s=e.component=Qu(e,r,i);if(Fd(e)&&(s.ctx.renderer=oe),ed(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,j,o,a),!e.el){let r=s.subTree=Cf(gf);_(null,r,t,n),e.placeholder=r.el}}else j(s,e,t,n,i,a,o)},ee=(e,t,n)=>{let r=t.component=e.component;if(pu(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,M(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},j=(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=Au(e);if(n){t&&(t.el=c.el,M(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?df(t,i):l())};t.flags=48,df(t,i)});return}}let u=t,f;Eu(e,!1),t?(t.el=c.el,M(e,t,o)):t=c,n&&Xo(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&Xu(f,s,t,c),Eu(e,!0);let p=du(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el||Mu(m)),ae(m),e,i,a),t.el=p.el,u===null&&gu(e,p.el),r&&df(r,i),(f=t.props&&t.props.onVnodeUpdated)&&df(()=>Xu(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Pd(t);if(Eu(e,!1),l&&Xo(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Xu(o,d,t),Eu(e,!0),s&&ce){let t=()=>{e.subTree=du(e),ce(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=du(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&df(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;df(()=>Xu(o,d,e),i)}(t.shapeFlag&256||d&&Pd(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&df(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new mc(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=()=>cl(u),Eu(e,!0),l()},M=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,vu(e,t.props,r,n),uf(e,t.children,n),Cs(),dl(e),ws()},N=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){P(l,f,n,r,i,a,o,s,c);return}if(p&256){te(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&ie(l,i,a),f!==l&&u(n,f)):d&16?m&16?P(l,f,n,r,i,a,o,s,c):ie(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},te=(e,t,n,r,i,a,o,s,c)=>{e||=vo,t||=vo;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?qu(t[f]):Ku(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?ie(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},P=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?qu(t[l]):Ku(t[l]);if(zu(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?qu(t[f]):Ku(t[f]);if(zu(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?qu(t[l]):Ku(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)I(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?qu(t[l]):Ku(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){I(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&zu(r,t[_])){u=_;break}u===void 0?I(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?ku(S):vo;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Mu(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?F(d,n,p,2):_--)}}},F=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)F(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,oe);else if(c===mf){r(s,t,n);for(let e=0;e<u.length;e++)F(u[e],t,n,a);r(e.anchor,t,n)}else if(c===_f)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[jd]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),df(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[jd];s._isLeaving&&s[jd](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},I=(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&&(Cs(),Il(s,null,n,e,!0),ws()),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=!Pd(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Xu(_,t,e),u&6)L(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&_l(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,oe,r):l&&!l.hasOnce&&(a!==mf||d>0&&d&64)?ie(l,t,n,!1,!0):(a===mf&&d&384||!i&&u&16)&&ie(c,t,n),r&&ne(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&df(()=>{_&&Xu(_,t,e),h&&_l(e,null,t,`unmounted`),v&&(e.el=null)},n)},ne=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===mf;if(o&&!a){re(n,r);return}if(t===_f){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?jl(e):e,c=()=>{o?d(n)&&re(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},re=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},L=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;ju(c),ju(l),r&&Xo(r),i.stop(),a?(a.flags|=8,I(o,e,t,n)):o&&(o.transition=e.vnode.transition,I(o,e,t,n)),s&&df(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,df(u,t)},ie=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)I(e[o],t,n,r,i)},ae=e=>{if(e.shapeFlag&6)return ae(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[Sd];return n?f(n):t},R=(e,t,n)=>{pl(()=>{e==null?t._vnode&&I(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:Zu())},oe={p:h,um:I,m:F,r:ne,mt:A,mc:w,pc:N,pbc:E,n:ae,o:e},se,ce;return t&&([se,ce]=t(oe)),{render:R,hydrate:se,createApp:ou(R,se)}}function Tu({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 Eu({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Du(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ou(e,t,n=!1){let r=e.children,i=t.children;if(B(r)&&B(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]=qu(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Ou(t,a)),a.type===hf&&(a.patchFlag===-1&&(a=i[e]=qu(a)),a.el=t.el),a.type===gf&&!a.el&&(a.el=t.el)}}function ku(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 Au(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Au(t)}function ju(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Mu(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return Mu(t.subTree);let n=e.suspense;return n&&n.activeBranch?Mu(n.activeBranch):null}function Nu(e,t){t&&t.pendingBranch?B(e)?t.effects.push(...e):t.effects.push(e):ul(e)}function G(e=!1){vf.push(yf=e?null:[])}function Pu(){vf.pop(),yf=vf[vf.length-1]||null}function Fu(e,t=!1){bf+=e,e<0&&yf&&t&&(yf.hasOnce=!0)}function Iu(e){return e.dynamicChildren=bf>0?yf||vo:null,Pu(),bf>0&&yf&&yf.push(e),e}function K(e,t,n,r,i,a){return Iu(Bu(e,t,n,r,i,a,!0))}function Lu(e,t,n,r,i){return Iu(Cf(e,t,n,r,i,!0))}function Ru(e){return e?e.__v_isVNode===!0:!1}function zu(e,t){return e.type===t.type&&e.key===t.key}function Bu(e,t=null,n=null,r=0,i=null,a=e===mf?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xf(t),ref:t&&Sf(t),scopeId:vd,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:_d};return s?(Ju(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=jo(n)?8:16),bf>0&&!o&&yf&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&yf.push(c),c}function Vu(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Ud||(e=gf),Ru(e)){let r=Uu(e,t,!0);return n&&Ju(r,n),bf>0&&!a&&yf&&(r.shapeFlag&6?yf[yf.indexOf(e)]=r:yf.push(r)),r.patchFlag=-2,r}if(sd(e)&&(e=e.__vccOpts),t){t=Hu(t);let{class:e,style:n}=t;e&&!jo(e)&&(t.class=so(e)),No(n)&&(Zs(n)&&!B(n)&&(n=Co({},n)),t.style=ao(n))}let o=jo(e)?1:ff(e)?128:Cd(e)?64:No(e)?4:Ao(e)?2:0;return Bu(e,t,n,r,i,o,a,!0)}function Hu(e){return e?Zs(e)?Co({},e):tf(e)?Co({},e[Ff]||e):e:null}function Uu(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Yu(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&xf(l),ref:t&&t.ref?n&&a?B(a)?a.concat(Sf(t)):[a,Sf(t)]:Sf(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!==mf?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&&Uu(e.ssContent),ssFallback:e.ssFallback&&Uu(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Al(u,c.clone(u)),u}function Wu(e=` `,t=0){return Cf(hf,null,e,t)}function Gu(e=``,t=!1){return t?(G(),Lu(gf,null,e)):Cf(gf,null,e)}function Ku(e){return e==null||typeof e==`boolean`?Cf(gf):B(e)?Cf(mf,null,e.slice()):Ru(e)?qu(e):Cf(hf,null,String(e))}function qu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Uu(e)}function Ju(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(B(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ju(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!tf(t)?t._ctx=_d:r===3&&_d&&(_d.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(Ao(t)){if(r&65){Ju(e,{default:t});return}t={default:t,_ctx:_d},n=32}else t=String(t),r&64?(n=16,t=[Wu(t)]):n=8;e.children=t,e.shapeFlag|=n}function Yu(...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=so([t.class,r.class]));else if(e===`style`)t.style=ao([t.style,r.style]);else if(xo(e)){let n=t[e],i=r[e];i&&n!==i&&!(B(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!So(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Xu(e,t,n,r=null){rl(e,t,7,[n,r])}function Zu(){return Tf}function Qu(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||wf,a={uid:Tf++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xu(r,i),emitsOptions:lu(r,i),emit:null,emitted:null,propsDefaults:_o,inheritAttrs:r.inheritAttrs,ctx:_o,data:_o,props:_o,attrs:_o,slots:_o,refs:_o,setupState:_o,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=cu.bind(null,a),e.ce&&e.ce(a),a}function $u(e){return e.vnode.shapeFlag&4}function ed(e,t=!1,n=!1){t&&kf(t);let{props:r,children:i}=e.vnode,a=$u(e);_u(e,r,a,t),lf(e,i,n||t);let o=a?td(e,t):void 0;return t&&kf(!1),o}function td(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,qd);let{setup:r}=n;if(r){Cs();let n=e.setupContext=r.length>1?id(e):null,i=Af(e),a=nl(r,e,0,[e.props,n]),o=Po(a);if(ws(),i(),(o||e.sp)&&!Pd(e)&&Nl(e),o){if(a.then(jf,jf),t)return a.then(n=>{kf(!0);try{nd(e,n,t)}finally{kf(!1)}}).catch(t=>{il(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(`<!---->`)});e.asyncDep=a}else nd(e,a,t)}else rd(e,t)}function nd(e,t,n){Ao(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:No(t)&&(e.setupState=ic(t)),rd(e,n)}function rd(e,t,n){let r=e.type;if(!e.render){if(!t&&Nf&&!r.render){let t=r.template||!1;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Nf(t,Co(Co({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||yo,Pf&&Pf(e)}}function id(e){return{attrs:new Proxy(e.attrs,If),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function ad(e){return e.exposed?e.exposeProxy||=new Proxy(ic($s(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gd)return Gd[n](e)},has(e,t){return t in e||t in Gd}}):e.proxy}function od(e,t=!0){return Ao(e)?e.displayName||e.name:e.name||t&&e.__name}function sd(e){return Ao(e)&&`__vccOpts`in e}function q(e,t,n){try{Fu(-1);let r=arguments.length;return r===2?No(t)&&!B(t)?Ru(t)?Cf(e,null,[t]):Cf(e,t):Cf(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ru(n)&&(n=[n]),Cf(e,t,n))}finally{Fu(1)}}var cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,J,Lf,Rf=t((()=>{tl(),us(),cd=[],ld=-1,ud=[],dd=null,fd=0,pd=Promise.resolve(),md=null,hd=!1,gd=e=>e.id==null?e.flags&2?-1:1/0:e.id,_d=null,vd=null,yd=Symbol.for(`v-scx`),bd=()=>yl(yd),xd=new WeakMap,Sd=Symbol(`_vte`),Cd=e=>e.__isTeleport,wd=e=>e&&(e.disabled||e.disabled===``),Td=e=>e&&(e.defer||e.defer===``),Ed=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Dd=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Od=(e,t)=>{let n=e&&e.to;return jo(n)?t?t(n):null:n},kd={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=wd(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=wd(e.props),r=e.target=Od(e.props,m),a=Dl(r,e,h,p);r&&(o!==`svg`&&Ed(r)?o=`svg`:o!==`mathml`&&Dd(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),El(e,!1)))},S=e=>{let t=()=>{if(xd.get(e)===t){if(xd.delete(e),wd(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),El(e,!0)}x(e)}};xd.set(e,t),df(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Td(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),El(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=xd.get(e);if(u){u.flags|=8,xd.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=wd(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Ed(p)?o=`svg`:(o===`mathml`||Dd(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Ou(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):wl(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Od(t.props,m);e&&(t.target=e,wl(t,e,null,l,0))}else g&&wl(t,p,h,l,1);El(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=wd(f),m=a||!p,h=xd.get(e);if(h&&(h.flags|=8,xd.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:wl,hydrate:Tl},Ad=kd,jd=Symbol(`_leaveCb`),Md=new WeakMap,Nd=e=>e.nodeType===8,es().requestIdleCallback,es().cancelIdleCallback,Pd=e=>!!e.type.__asyncLoader,Fd=e=>e.type.__isKeepAlive,Id=e=>(t,n=Ef)=>{Mf&&e!==`sp`||Gl(e,(...e)=>t(...e),n)},Id(`bm`),Ld=Id(`m`),Rd=Id(`bu`),zd=Id(`u`),Bd=Id(`bum`),Vd=Id(`um`),Id(`sp`),Id(`rtg`),Id(`rtc`),Hd=`components`,Ud=Symbol.for(`v-ndc`),Wd=e=>e?$u(e)?ad(e):Wd(e.parent):null,Gd=Co(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=>Wd(e.parent),$root:e=>Wd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||=()=>{cl(e.update)},$nextTick:e=>e.n||=ol.bind(e.proxy),$watch:e=>yo}),Kd=(e,t)=>e!==_o&&!e.__isScriptSetup&&Eo(e,t),qd={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Kd(r,t))return o[t]=1,r[t];else if(Eo(a,t))return o[t]=3,a[t];else if(n!==_o&&Eo(n,t))return o[t]=4,n[t];else o[t]=0}let l=Gd[t],u,d;if(l)return t===`$attrs`&&Ds(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==_o&&Eo(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,Eo(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Kd(i,t)?(i[t]=n,!0):Eo(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||Kd(t,s)||Eo(a,s)||Eo(r,s)||Eo(Gd,s)||Eo(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?Eo(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Jd=0,Yd=null,Xd=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Wo(t)}Modifiers`]||e[`${Ko(t)}Modifiers`],Zd=e=>{let t;for(let n in e)(n===`class`||n===`style`||xo(n))&&((t||={})[n]=e[n]);return t},Qd=(e,t)=>{let n={};for(let r in e)So(r)&&r.slice(9)in t||(n[r]=e[r]);return n},$d={},ef=()=>Object.create($d),tf=e=>Object.getPrototypeOf(e)===$d,nf=e=>e===`_`||e===`_ctx`||e===`$stable`,rf=e=>B(e)?e.map(Ku):[Ku(e)],af=(e,t,n)=>{if(t._n)return t;let r=gl((...e)=>rf(t(...e)),n);return r._c=!1,r},of=(e,t,n)=>{let r=e._ctx;for(let n in e){if(nf(n))continue;let i=e[n];if(Ao(i))t[n]=af(n,i,r);else if(i!=null){let e=rf(i);t[n]=()=>e}}},sf=(e,t)=>{let n=rf(t);e.slots.default=()=>n},cf=(e,t,n)=>{for(let r in t)(n||!nf(r))&&(e[r]=t[r])},lf=(e,t,n)=>{let r=e.slots=ef();if(e.vnode.shapeFlag&32){let e=t._;e?(cf(r,t,n),n&&Zo(r,`_`,e,!0)):of(t,r)}else t&&sf(e,t)},uf=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=_o;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:cf(i,t,n):(a=!t.$stable,of(t,i)),o=t}else t&&(sf(e,t),o={default:1});if(a)for(let e in i)!nf(e)&&o[e]==null&&delete i[e]},df=Nu,ff=e=>e.__isSuspense,pf=Symbol(`_deferredEnter`),mf=Symbol.for(`v-fgt`),hf=Symbol.for(`v-txt`),gf=Symbol.for(`v-cmt`),_f=Symbol.for(`v-stc`),vf=[],yf=null,bf=1,xf=({key:e})=>e??null,Sf=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:jo(e)||ec(e)||Ao(e)?{i:_d,r:e,k:t,f:!!n}:e),Cf=Vu,wf=au(),Tf=0,Ef=null,Df=()=>Ef||_d;{let e=es(),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)}};Of=t(`__VUE_INSTANCE_SETTERS__`,e=>Ef=e),kf=t(`__VUE_SSR_SETTERS__`,e=>Mf=e)}Af=e=>{let t=Ef;return Of(e),e.scope.on(),()=>{e.scope.off(),Of(t)}},jf=()=>{Ef&&Ef.scope.off(),Of(null)},Mf=!1,Ff=Symbol(),If={get(e,t){return Ds(e,`get`,``),t===Ff?e:e[t]}},J=(e,t)=>oc(e,t,Mf),Lf=`3.5.46`}));function zf(e,t,n){let r=e[up];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function Bf(e,t,n){let r=e.style,i=jo(n),a=!1;if(n&&!i){if(t){if(jo(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Vf(r,t,``)}else for(let e in t)n[e]??Vf(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Vf(r,i,``):Uf(e,i,!jo(t)&&t?t[i]:void 0,o)||Vf(r,i,o)}}else if(i){if(t!==n){let e=r[pp];e&&(n+=`;`+e),r.cssText=n,a=mp.test(n)}}else t&&e.removeAttribute(`style`);dp in e&&(i&&t===n||(e[dp]=a?r.display:``),e[fp]&&(r.display=`none`))}function Vf(e,t,n){if(B(n))n.forEach(n=>Vf(e,t,n));else if(n??=``,t.startsWith(`--`))hp.test(n)?e.setProperty(t,n.replace(hp,``),`important`):e.setProperty(t,n);else{let r=Hf(e,t);hp.test(n)?e.setProperty(Ko(r),n.replace(hp,``),`important`):e[r]=n}}function Hf(e,t){let n=_p[t];if(n)return n;let r=Wo(t);if(r!==`filter`&&r in e)return _p[t]=r;r=qo(r);for(let n=0;n<gp.length;n++){let i=gp[n]+r;if(i in e)return _p[t]=i}return t}function Uf(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&jo(r)&&n===r}function Wf(e,t,n,r,i,a=as(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(vp,t.slice(6,t.length)):e.setAttributeNS(vp,t,n):n==null||a&&!lo(n)?e.removeAttribute(t):e.setAttribute(t,a?``:Mo(n)?String(n):n)}function Gf(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?ip(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=lo(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 Kf(e,t,n,r){e.addEventListener(t,n,r)}function qf(e,t,n,r){e.removeEventListener(t,n,r)}function Jf(e,t,n,r,i=null){let a=e[yp]||(e[yp]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Yf(t);r?Kf(e,n,a[t]=Xf(r,i),s):o&&(qf(e,n,o,s),a[t]=void 0)}}function Yf(e){let t,n;for(;(n=e.match(bp))&&!xp.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Ko(e.slice(2)),t]}function Xf(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(B(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&&rl(e,t,5,a)}}else rl(r,t,5,[e])};return n.value=e,n.attached=wp(),n}function Zf(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Tp(t)&&Ao(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 Tp(t)&&jo(n)?!1:t in e}function Qf(e,t){let n=e._def.props;if(!n)return!1;let r=Wo(t);return Array.isArray(n)?n.some(e=>Wo(e)===r):Object.keys(n).some(e=>Wo(e)===r)}function $f(){return jp||=Cu(Ap)}function ep(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function tp(e){return jo(e)?document.querySelector(e):e}var np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np=t((()=>{if(Rf(),Rf(),us(),np=void 0,rp=typeof window<`u`&&window.trustedTypes,rp)try{np=rp.createPolicy(`vue`,{createHTML:e=>e})}catch{}ip=np?e=>np.createHTML(e):e=>e,ap=`http://www.w3.org/2000/svg`,op=`http://www.w3.org/1998/Math/MathML`,sp=typeof document<`u`?document:null,cp=sp&&sp.createElement(`template`),lp={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`?sp.createElementNS(ap,e):t===`mathml`?sp.createElementNS(op,e):n?sp.createElement(e,{is:n}):sp.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>sp.createTextNode(e),createComment:e=>sp.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sp.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{cp.innerHTML=ip(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=cp.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]}},up=Symbol(`_vtc`),dp=Symbol(`_vod`),fp=Symbol(`_vsh`),pp=Symbol(``),mp=/(?:^|;)\s*display\s*:/,hp=/\s*!important$/,gp=[`Webkit`,`Moz`,`ms`],_p={},vp=`http://www.w3.org/1999/xlink`,yp=Symbol(`_vei`),bp=/(Once|Passive|Capture)$/,xp=/^on:?(?:Once|Passive|Capture)$/,Sp=0,Cp=Promise.resolve(),wp=()=>Sp||=(Cp.then(()=>Sp=0),Date.now()),Tp=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ep=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?zf(e,r,o):t===`style`?Bf(e,n,r):xo(t)?So(t)||Jf(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Zf(e,t,r,o))?(Gf(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Wf(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Qf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!jo(r)))?Gf(e,Wo(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Wf(e,t,r,o))},Dp=[`ctrl`,`shift`,`alt`,`meta`],Op={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)=>Dp.some(n=>e[`${n}Key`]&&!t.includes(n))},kp=(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=Op[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Ap=Co({patchProp:Ep},lp),Mp=((...e)=>{let t=$f().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=tp(e);if(!r)return;let i=t._component;Ao(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,ep(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t})})),Y=t((()=>{Np()}));function Pp(){let e=e=>{e.stopPropagation(),e.preventDefault(),t()},t=()=>{document.removeEventListener(`click`,e,!0),document.removeEventListener(`pointerdown`,t,!0)};document.addEventListener(`click`,e,!0),document.addEventListener(`pointerdown`,t,!0)}function Fp(e){Ld(()=>document.addEventListener(`pointerdown`,e,!0)),Bd(()=>document.removeEventListener(`pointerdown`,e,!0))}function Ip(e=document,t){return[...e.querySelectorAll(Vp)].some(e=>!t||!e.matches(t))}function Lp(e=document,t=!1){let n=[...e.querySelectorAll(Vp)];for(let e of n)e.dispatchEvent(new CustomEvent(Bp,{detail:{escape:t}}));return n.length>0}var Rp,zp,Bp,Vp,Hp,Up=t((()=>{Y(),Rp=Symbol(`comment-thread-portals`),zp=new WeakSet,Bp=`comments:shake`,Vp=`[data-slot='comment-composer'][data-dirty='true']`,Hp=e=>e.composedPath().filter(e=>e instanceof Element)}));function Wp(e){let t;return{listen(e){let t=()=>e(`online`),n=()=>e(`offline`),r=()=>e(document.visibilityState===`hidden`?`hidden`:`visible`);return window.addEventListener(`online`,t),window.addEventListener(`offline`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n),document.removeEventListener(`visibilitychange`,r)}},isVisible:()=>document.visibilityState!==`hidden`,isOnline:()=>navigator.onLine!==!1,lock(e,t){let n=navigator.locks;return n?n.request(e,t):t()},lead(e,t){let n=new AbortController,r=()=>n.signal.aborted?Promise.resolve():t(n.signal),i=navigator.locks;return i?i.request(e,{signal:n.signal},r).catch(()=>void 0):r(),()=>n.abort()},post(n){t?t.postMessage(n):Gp(e.channel,n)},receive(n){if(typeof BroadcastChannel!=`function`)return()=>void 0;let r=new BroadcastChannel(e.channel);return t=r,r.onmessage=t=>{e.isMessage(t.data)&&n(t.data)},()=>{r.close(),t===r&&(t=void 0)}},schedule(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)},random:Math.random}}function Gp(e,t){if(typeof BroadcastChannel!=`function`)return;let n=new BroadcastChannel(e);n.postMessage(t),n.close()}function Kp(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function qp(e,t){let n=Math.min(3e4,1e3*2**e);return n/2+t*n/2}var Jp=t((()=>{}));async function Yp(e,t){let n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify([e,t]))));return`message_${Array.from(n.subarray(0,16),e=>e.toString(16).padStart(2,`0`)).join(``)}`}var Xp=t((()=>{}));function Zp(e){return e.status!==`sending`&&!e.uncertain}function Qp(e){if(!e||typeof e!=`object`)return!1;let t=Reflect.get(e,`type`);if(typeof Reflect.get(e,`account`)!=`string`)return!1;if(t===`change`)return!0;let n=Reflect.get(e,`kind`);return t===`sent`&&(n===`create`||n===`reply`)&&typeof Reflect.get(e,`id`)==`string`&&typeof Reflect.get(e,`key`)==`string`&&!!Reflect.get(e,`thread`)}function $p(e){let t=JSON.parse(JSON.stringify(e.input)),n=e.kind===`reply`&&e.subject?{kind:e.subject.kind,id:e.subject.id}:void 0;return{...e,input:t,files:[...e.files],...n?{subject:n}:{},...e.uploaded?{uploaded:[...e.uploaded]}:{},...e.error?{error:{...e.error}}:{}}}function em(e){return e.sort((e,t)=>e.order-t.order)}function tm(){let e=new Map;return{persisted:!1,async list(t){return em([...e.get(t)?.values()??[]].map($p))},async update(t,n){let r=new Map([...e.get(t)??[]].map(([e,t])=>[e,$p(t)])),i=n(r);return e.set(t,new Map([...r].map(([e,t])=>[e,$p(t)]))),i}}}function nm(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onabort=()=>n(e.error??Error(`The IndexedDB transaction was aborted.`)),e.onerror=()=>n(e.error??Error(`The IndexedDB transaction failed.`))})}function rm(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??Error(`The IndexedDB request failed.`))})}function im(e){return new Promise((t,n)=>{let r=indexedDB.open(e,um);r.onupgradeneeded=e=>{let t=r.result.createObjectStore(`drafts`,{keyPath:[`account`,`id`]});if(t.createIndex(`account`,`account`),e.oldVersion===1&&r.transaction){let e=r.transaction.objectStore(`outbox`).openCursor();e.onsuccess=()=>{let n=e.result;if(!n){r.result.deleteObjectStore(`outbox`);return}let i=n.value;t.put({...i,id:i.requestId,uncertain:!0}),n.continue()}}},r.onsuccess=()=>{let e=r.result;e.onversionchange=()=>e.close(),t(e)},r.onerror=()=>n(r.error??Error(`IndexedDB did not open.`)),r.onblocked=()=>n(Error(`IndexedDB is blocked by another tab.`))})}function am(e){let t,n=typeof indexedDB<`u`,r=()=>t??=(n?im(e):Promise.reject(Error(`No IndexedDB.`))).then(e=>({database:e}),()=>(n=!1,{memory:tm()})),i=async(e,t)=>{let n=await r();return`database`in n?t(n.database):e(n.memory)};return{get persisted(){return n},list:e=>i(t=>t.list(e),async t=>em(await rm(t.transaction(`drafts`,`readonly`).objectStore(`drafts`).index(`account`).getAll(e)))),update:(e,t)=>i(n=>n.update(e,t),async n=>{let r=n.transaction(`drafts`,`readwrite`),i=r.objectStore(`drafts`),a=i.index(`account`).getAll(e),o=nm(r),s=new Promise((n,o)=>{a.onsuccess=()=>{let s=new Map(a.result.map(e=>[e.id,e])),c=new Map(s);try{let r=t(c);for(let t of s.keys())c.has(t)||i.delete([e,t]);for(let[e,t]of c)s.get(e)!==t&&i.put($p(t));n(r)}catch(e){o(e),r.abort()}},a.onerror=()=>o(a.error)});return(await Promise.all([s,o]))[0]})}}function om(e){let t=t=>e&&typeof e==`object`?Reflect.get(e,t):void 0,n=t(`status`),r=t(`code`),i=t(`why`)??t(`message`),a=t(`fix`),o=t(`retryAfter`);return{status:typeof n==`number`?n:0,why:typeof i==`string`&&i?i:String(e),...typeof r==`string`?{code:r}:{},...typeof a==`string`?{fix:a}:{},...typeof o==`number`&&o>=0?{retryAfter:o}:{}}}function sm(e){return e===401||e===402?`hold`:e===408||e===429?`wait`:e>=400&&e<500?`fail`:`wait`}function cm(e,t){let{account:n,namespace:r}=e,i=r===void 0?lm:`${lm}:${JSON.stringify(r)}`,a=!!(e.environment||globalThis.navigator?.locks),o=!(!e.store||a),s=e.store??(a?am(i):tm()),c=e.environment??Wp({channel:i,isMessage:Qp}),l=r===void 0?n:JSON.stringify([r,n]),u=e.store?l:n,d=`vitehub-comments-outbox:${l}`,f=e=>`vitehub-comments-files:${l}:${e}`,p=[],m=[],h=new Map,g=new Map,_=new Map,v=new Map,y=e=>v.get(e)??e,b=new Set,x=()=>{for(let e of b)e()},S=new Set,C=0,w=new Map,T=new Map,E=e=>e.kind===`create`?JSON.stringify([e.kind,e.input.subject.kind,e.input.subject.id,e.requestId]):JSON.stringify([e.kind,e.input.threadId,e.requestId]),D=(e,t)=>JSON.stringify([e,t]),O=new Map,k=Promise.resolve(),A,ee=!1,j=!1,M,N=e=>c.post(e),te=()=>k=k.catch(()=>void 0).then(async()=>{let e=[...h].flatMap(([e,t])=>t.saved?[e]:[]),t=await s.list(u),n=new Map;globalThis.crypto?.subtle&&await Promise.all(t.map(async e=>{if(e.kind!==`reply`)return;let t=ie(e.input.threadId),r=D(t,e.requestId);n.set(r,O.get(r)??await Yp(t,e.requestId))})),O=n,m=t;for(let t of e)h.delete(t);P()}),P=()=>{let e=new Set(m.map(e=>e.id));p=em([...m,...[...h.values()].flatMap(t=>e.has(t.entry.id)||t.duplicate?[]:[t.entry])]).map(e=>{let t=_.get(e.id);return t?{...e,status:`failed`,files:[...e.files,...t.files],error:t.error}:e}),ne(!s.persisted&&p.length>0||_.size>0||[...h.values()].some(e=>!e.saved)),t.changed(),x()},F=!1,I=e=>{e.preventDefault(),Reflect.set(e,`returnValue`,``)},ne=e=>{e!==F&&typeof globalThis.addEventListener==`function`&&(F=e,e?globalThis.addEventListener(`beforeunload`,I):globalThis.removeEventListener(`beforeunload`,I))},re=async()=>{await te(),N({type:`change`,account:l})},L=e=>{for(let n of t.threads())if(n.id===e)return n},ie=e=>{let t=y(e);return w.get(t)?.id??t},ae=e=>({status:e.status===`failed`?`failed`:`pending`,requestId:e.requestId,files:e.files,...e.error?{error:e.error}:{}}),R=()=>t.user?.id===n?t.user:{id:n},oe=(e,t)=>({id:e.id,threadId:t,body:e.input.body,author:R(),mentions:e.input.mentions??[],attachments:e.input.attachments??[],createdAt:e.createdAt,delivery:ae(e)}),se=e=>{let t=new Map;for(let e of p){if(e.kind!==`reply`)continue;let n=ie(e.input.threadId);t.set(n,[...t.get(n)??[],e])}let r=e=>{let r=t.get(e.id);if(!r)return e;let i=new Set(e.messages.filter(e=>e.author.id===n).map(e=>e.id)),a=r.filter(t=>{let n=e.delivery?void 0:O.get(D(e.id,t.requestId));return!(n&&i.has(n))}).map(t=>oe(t,e.id));return a.length?{...e,messages:[...e.messages,...a]}:e},i=e.map(r),a=[];for(let t of p)t.kind!==`create`||w.has(t.id)||e.some(e=>ce(t,e))||a.push(r(le(t)));return{server:i,local:a}},ce=(e,t)=>t.requestId===e.requestId&&t.author.id===n&&t.subject.kind===e.input.subject.kind&&t.subject.id===e.input.subject.id,le=e=>{let{input:t}=e;return{id:e.id,scope:``,n:0,subject:t.subject,anchor:t.anchor,status:`open`,author:R(),messages:[oe(e,e.id)],...t.metadata===void 0?{}:{metadata:t.metadata},...t.revision===void 0?{}:{revision:t.revision},createdAt:e.createdAt,updatedAt:e.createdAt,requestId:e.requestId,delivery:ae(e)}},ue=e=>{let t=new Set([...e,...[...h.values()].map(e=>e.entry)].flatMap(e=>e.kind===`create`?[e.id]:[]));return e.find(e=>e.status!==`failed`&&!(e.kind===`reply`&&t.has(e.input.threadId)))},de=e=>[...h.values()].some(t=>!t.saved&&!t.parked&&t.entry.status!==`failed`&&t.entry.order<e),fe=e=>new Promise(t=>{e.aborted?t():e.addEventListener(`abort`,()=>t(),{once:!0})}),pe=e=>{M?.(),M=c.schedule(()=>{M=void 0,_e()},e)},me=e=>s.update(u,e),he=async e=>{let r=t=>me(n=>{let r=n.get(e.id);if(r&&r.claim===e.claim)return t(r,n)}),i,a=!1,o={account:n,async uploaded(t){if(!await r((n,r)=>r.set(e.id,{...n,uploaded:[...n.uploaded??[],t]})))throw new DOMException(`This draft is no longer in the outbox.`,`AbortError`)}};try{let n={files:e.files.slice(e.uploaded?.length??0),outbox:o},s=[...e.input.attachments??[],...e.uploaded??[]],c={...n,requestId:e.requestId,...s.length?{attachments:s}:{}};if(e.kind===`create`){if(!await r(()=>!0))return;a=!0,i=await t.transport.create({...e.input,...c})}else{let o=ie(e.input.threadId),s=e.subject??L(o)?.subject??(n.files?.length?(await t.transport.get({threadId:o}))?.subject:void 0);if(n.files?.length&&!s)throw Object.assign(Error(`The thread for this reply does not exist.`),{status:404});if(!await r(()=>!0))return;a=!0,i=await t.transport.reply({...e.input,...c,threadId:o,...s?{subject:s}:{}})}}catch(t){let n=ia.get(o),i=n!==void 0&&Object.is(n.cause,t),{retryAfter:s,...l}=om(t),u=sm(l.status),d=e.attempts??0;await r((t,n)=>n.set(e.id,{...t,status:u===`fail`?`failed`:`pending`,uncertain:e.uncertain||a&&!i&&u===`wait`&&l.status!==429,held:u===`hold`,retryAt:u===`wait`?Date.now()+Math.max(1,s??qp(d,c.random())):void 0,attempts:d+1,error:l}))&&await re();return}if(!await r((t,n)=>{if(t.kind===`create`)for(let t of n.values())t.kind===`reply`&&t.input.threadId===e.id&&n.set(t.id,{...t,subject:i.subject,input:{...t.input,threadId:i.id}});return n.delete(e.id)}))return;let s=E(e);e.kind===`create`&&w.set(e.id,i),T.set(s,i),t.upsert(i),await te(),N({type:`sent`,account:l,id:e.id,kind:e.kind,key:s,thread:i})},ge=async e=>{for(M?.(),M=void 0;!e.aborted&&c.isOnline();){let t=Kp(),n=await me(n=>{if(e.aborted)return;let r=ue(em([...n.values()]));if(!r||r.held||de(r.order))return;if(r.awaitingFiles)return{files:r.id};let i=(r.retryAt??0)-Date.now();if(i>0)return{delay:i};let a={...r,claim:t,status:`sending`,uncertain:r.uncertain||r.status===`sending`};return n.set(r.id,a),{claimed:a}});if(!n)return;if(`delay`in n){pe(n.delay);return}if(`files`in n){if(o||g.has(n.files)||(await Promise.race([c.lock(f(n.files),async()=>void 0),fe(e)]),e.aborted))return;await me(e=>{let t=e.get(n.files);t?.awaitingFiles&&!g.has(t.id)&&e.set(t.id,{...t,awaitingFiles:!1})}),await re()}else await te(),await he(n.claimed)}};function _e(){if(j)return;if(A){ee=!0;return}let e={giveUp:()=>void 0};A=e,e.giveUp=c.lead(d,async t=>{try{do ee=!1,await ge(t);while(ee&&!t.aborted)}finally{A===e&&(A=void 0)}})}let ve=e=>{let t=h.get(e);if(!t)return Promise.resolve();let n=Promise.resolve().then(async()=>{t.parked=!1;let r=[t];try{if(await me(i=>{if(h.get(e)!==t)return!1;t.entry.kind===`reply`&&(t.entry={...t.entry,input:{...t.entry.input,threadId:ie(t.entry.input.threadId)}});let a=t.entry.kind===`reply`?h.get(t.entry.input.threadId):void 0;if(a&&!a.saved&&!i.has(a.entry.id))return!0;let o=t.entry.order;for(let e of i.values())S.has(e.id)||(o=Math.max(o,e.order+1));let s=[...h.values()].filter(e=>e!==t&&!i.has(e.entry.id)&&e.entry.order>t.entry.order),c=o;for(let e of s.sort((e,t)=>e.entry.order-t.entry.order))c=Math.max(e.entry.order,c+1),e.entry={...e.entry,order:c};C=Math.max(C,c),t.entry={...t.entry,order:o},r=[t,...[...h.values()].filter(t=>t.parked&&t.entry.kind===`reply`&&t.entry.input.threadId===e)];for(let e of r)e.write??=n;let l=new Map([...i.values()].map(e=>[E(e),e]));for(let e of r){e.entry.kind===`reply`&&(e.entry={...e.entry,input:{...e.entry.input,threadId:ie(e.entry.input.threadId)}});let t=E(e.entry),n=l.get(t);n?(e.duplicate=n,v.set(e.entry.id,n.id)):(i.set(e.entry.id,e.entry),l.set(t,e.entry))}return!1})){t.parked=!0;return}}catch(e){t.entry={...t.entry,status:`failed`,error:om(e)},P(),_e();return}finally{for(let e of r)e.write===n&&(e.write=void 0)}for(let e of r)Object.assign(e,{saved:!0,parked:!1});await re().catch(()=>void 0),_e()});return t.write=n,n},ye=()=>{let e=[...h.values()];if(e.some(e=>e.write))return;let t=e.find(e=>!e.saved&&!e.parked&&e.entry.status===`pending`);t&&!t.entry.awaitingFiles&&ve(t.entry.id).then(ye)},be=e=>o?(e.parked=!1,ye(),e.write??Promise.resolve()):ve(e.entry.id),xe=(e,t)=>{let n=t!==void 0&&!Array.isArray(t),r=Math.max(Date.now(),C+1,...p.map(e=>e.order+1));C=r,S.add(e.id);let i={entry:$p({...e,order:r,...n?{awaitingFiles:!0}:{}}),saved:!1};return h.set(e.id,i),n&&Ce(e.id,Promise.resolve(t)),P(),{local:i,write:be(i)}},Se=(e,t)=>{let n=p.find(t=>E(t)===E(e));if(!n)return{entry:e,...xe(e,t)};let r=h.get(n.id);return{entry:n,local:r,write:r?.write}},Ce=(e,t)=>{let n=c.lock(f(e),async()=>{let n=await t.then(e=>[...e],()=>[]),r=h.get(e);await r?.write;let i=e=>({...e,files:[...e.files,...n],awaitingFiles:!1});if(r&&!r.saved)r.entry=i(r.entry),P(),o&&ye();else for(;g.has(e);)try{await me(t=>{let n=t.get(e);n?.awaitingFiles&&t.set(e,i(n))});break}catch(t){if(!g.has(e))break;let r=new Promise(r=>{_.set(e,{files:n,error:om(t),resume:r})});P(),await r}}).catch(()=>void 0).then(async()=>{g.delete(e),_.delete(e),await re().catch(()=>void 0),_e()});g.set(e,n)},we=async e=>{await h.get(e)?.write;let t=h.get(e);return t&&!t.saved?t:void 0},Te=(e,t)=>{let r=Date.now(),i=Kp();return{id:i,requestId:e??i,account:n,files:Array.isArray(t)?[...t]:[],createdAt:r,order:r,status:`pending`}};return te(),{get entries(){return p},get queued(){return p.filter(e=>e.status!==`failed`)},get failures(){return p.filter(e=>e.status===`failed`)},get persisted(){return s.persisted},overlay:se,owns:(e,t)=>p.some(n=>n.id===y(t??e)),async beforeResolve(e){for(await te();;){let t=ie(e),n=p.filter(e=>e.id===t||e.kind===`reply`&&ie(e.input.threadId)===t);if(!n.length)return t;if(j||!c.isOnline()||n.some(e=>e.held||e.status===`failed`||e.retryAt!==void 0)||p.some(e=>e.held))return;await new Promise(e=>{let t=()=>{b.delete(t),e()};b.add(t)})}},async create({files:e,deferredFiles:n,requestId:r,...i}){let a={...Te(r,e),kind:`create`,input:i},o=()=>T.get(E(a))??[...t.threads()].find(e=>ce(a,e)),s=o();if(s)return s;let c=Se(a,n??e);if(r!==void 0){await c.write;let e=o();if(e)return e}let l=c.local?.duplicate??p.find(e=>e.id===c.entry.id)??c.entry;return le(l.kind===`create`?l:a)},async reply({files:e,deferredFiles:t,requestId:n,subject:r,...i}){let a=ie(i.threadId),o=p.find(e=>e.kind===`create`&&e.id===a),s=L(a),c=r??s?.subject??(o?.kind===`create`?o.input.subject:void 0),l={...Te(n,e),kind:`reply`,input:{...i,threadId:a},...c?{subject:c}:{}},u=T.get(E(l));if(u)return L(u.id)??u;let d=Se(l,t??e);n!==void 0&&await d.write;let f=d.local?.duplicate??d.local?.entry??d.entry,m=T.get(E(f));if(m)return L(m.id)??m;let h=ie(a),g=L(h)??s;return g?se([g]).server[0]??g:se([]).local.find(e=>e.id===h)||{id:h,scope:``,n:0,subject:c??{kind:``,id:``},anchor:{kind:`page`},status:`open`,author:R(),messages:[oe(f,h)],createdAt:l.createdAt,updatedAt:l.createdAt}},async retry(e){if(e!==void 0){e=y(e);let t=_.get(e);if(t){t.resume();return}}let t=e===void 0?void 0:await we(e);t?(t.entry={...t.entry,status:`pending`,error:void 0},P(),await be(t)):(await me(t=>{for(let n of t.values())n.status===`sending`||e!==void 0&&n.id!==e||(n.status!==`failed`||e!==void 0)&&t.set(n.id,{...n,status:`pending`,held:!1,attempts:0,retryAt:void 0,error:void 0})}),await re(),_e())},async dismiss(e){if(e=y(e),await we(e)){for(let[t,n]of h)(t===e||n.entry.kind===`reply`&&n.entry.input.threadId===e)&&h.delete(t);return await me(t=>{for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id)}),await re(),o&&ye(),_e(),!0}let t=await me(t=>{let n=t.get(e);if(!n||!Zp(n))return!1;if(n.kind===`create`)for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id);return t.delete(e)});return t&&(g.delete(e),_.get(e)?.resume(),await re(),_e()),t},async edit(e,t,n){e=y(e);let r=await we(e);if(r){let e={...r.entry.input,body:t,...n?{mentions:n}:{}};return r.entry={...r.entry,input:e,status:`pending`,error:void 0},P(),await be(r),!0}let i=await me(r=>{let i=r.get(e);if(!i||!Zp(i))return!1;let a={body:t,...n?{mentions:n}:{}};return i.kind,r.set(e,{...i,input:{...i.input,...a},status:`pending`,error:void 0}),!0});return i&&(await re(),_e()),i},async clear(){M?.(),M=void 0,h.clear(),await me(e=>e.clear()),g.clear();for(let e of _.values())e.resume();_.clear(),v.clear(),w.clear(),T.clear(),await re()},start(){j=!1;let e=[c.listen(e=>{e===`offline`&&x(),(e===`online`||e===`visible`)&&me(e=>{for(let t of e.values())t.status===`pending`&&t.retryAt!==void 0&&e.set(t.id,{...t,retryAt:void 0})}).then(re).then(_e)}),c.receive(e=>{e.account===l&&(e.type===`sent`&&(e.kind===`create`&&w.set(e.id,e.thread),T.set(e.key,e.thread),t.upsert(e.thread)),te())})];return te(),_e(),()=>{for(let t of e.splice(0))t();j=!0,x(),M?.(),M=void 0,A?.giveUp(),A=void 0}}}}var lm,um,dm=t((()=>{Jp(),aa(),Xp(),lm=`vitehub-comments`,um=2}));function fm(e,t,n,{thread:r,message:i}){if(!e)return!1;let a=r.can??{comment:!!t?.comment,resolve:!!t?.resolve,delete:!!t?.delete};if(n===`reply`)return r.status===`open`&&a.comment;if(n===`resolve`)return a.resolve;let o=t=>!e.guest&&!t.author.guest&&t.author.id===e.id;return!i||t?.change===!1?!1:n===`edit`?o(i):(r.messages[0]?.id===i.id?r.messages.every(o):o(i))?a.comment:a.delete===!0&&!e.guest}function pm(){let e=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__;return e.startsWith(`/`)&&!e.startsWith(`//`)?e.replace(/\/+$/,``):``}var mm=t((()=>{}));function hm(e){return e&&Em.test(e)?e:void 0}function gm(e,t){return e.length>t?`${e.slice(0,t).trimEnd()}…`:e}function _m(e,t){return e.kind===`page`?`on the whole page`:e.kind===`text`?`on the text "${gm(e.exact,t)}" in ${gm(e.selector,t)}`:`on ${gm(e.selector,t)}`}function vm(e,t){let[n,...r]=e.messages,i=e.revision===void 0?``:` (version ${e.revision})`;return[`"${gm(n?.body??``,t)}" — ${n?.author??`Someone`}, ${_m(e.anchor,t)}${i}`,...r.map(e=>`Reply: "${gm(e.body,t)}" — ${e.author}`),...e.files?.length?[`Files: ${e.files.join(` `)}`]:[]]}function ym(e,t){if(!e)return[`When you are done, tell me what you changed.`];let{mcp:n,project:r,resolve:i}=e,a=`operation "comments.get", and input { threadId } for ${t.length===1?`thread ${t[0]}`:`each ID in ${JSON.stringify(t)}`}`;return[`In the ViteHub MCP (${n}), use list_apps to verify team ${r.teamId} and app ${r.url} (id: ${r.id}). If the team is different, ask me to switch to that team in the Console; if the app is missing, ask me to check the link. Only after both match, call read_operation with the app id, ${a}.`,i?`When the fix is live, use run_operation with the app id, operation "comments.resolve", and input { threadId, reply }. In the reply, say what you changed.`:`Report the fixes to me without resolving the threads.`]}function bm(e){return`${e.id}: "${gm(e.messages[0]?.body??``,Dm)}"`}function xm({agent:e,threads:t,url:n},r){let i=new URL(n).href,a=t.length===1,o=ym(e,t.map(e=>e.id)),s=a?`Fix this comment on ${i}`:`Fix these ${t.length} comments on ${i}`;return r===`ids`?[s,...o].join(`
|
|
141
|
+
@media(prefers-reduced-motion:reduce){:host([off]) button,svg{transition:none}}`,ai=`vitehub-tools-off`,oi=`vitehub-tools-collapsed`,si=`vitehub-tools-dock`,ci=`vitehub-account`;function li(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function ui(e){try{let t=JSON.parse(localStorage.getItem(e)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function di(e){let t=document.createElement(`link`);t.rel=`modulepreload`,t.href=e;let n=document.querySelector(`script[${v}]`)?.nonce;n&&(t.nonce=n),document.head.append(t)}function fi(e,t,n){let r=Symbol.for(y),i=Reflect.get(globalThis,r);if(Reflect.deleteProperty(globalThis,r),typeof i!=`object`||!i)return;let a=new URL(e,t);if(a.origin!==t.origin||a.search||Reflect.get(i,`route`)!==a.pathname||Reflect.get(i,`page`)!==t.pathname||Reflect.get(i,`open`)!==(n||void 0))return;let o=l(Reflect.get(i,`session`));return o.tools.length>0?o:void 0}function pi(e,t){try{localStorage.setItem(e,JSON.stringify(t.filter(e=>!e.lazy).map(e=>e.script)))}catch{}}function mi(e,t){try{t?localStorage.setItem(e,`1`):localStorage.removeItem(e)}catch{}}function hi(){return document.documentElement.getAttribute(`data-vitehub-pill`)===`mark`||gi}var gi=!1,_i=!1;function vi(){try{return localStorage.getItem(si)}catch{return null}}function yi(){if(_i||typeof document.elementsFromPoint!=`function`)return!1;let e=e=>{let t=e.getBoundingClientRect();return t.width*t.height<innerWidth*innerHeight/2},t=Array.from({length:36},(e,t)=>[Math.min(innerWidth-1,Math.max(0,innerWidth/2-140+t%18*16+8)),innerHeight-(t<18?24:44)]),n=new Set;for(let[r,i]of t)for(let t of document.elementsFromPoint(r,i))if(!n.has(t)){n.add(t);for(let n=t;n&&n!==document.body&&n!==document.documentElement&&!n.localName.startsWith(`vitehub-`);n=n.parentElement){let r=getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`&&r.bottom!==`auto`){if(e(n)||n!==t&&e(t))return!0;break}if(/auto|scroll/.test(r.overflowY)&&n.scrollHeight>n.clientHeight)break}}return!1}function bi(e){return e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:e}function xi(e,t){let n=hi(),r=vi(),i=()=>{_i||=vi()!==r;let t=gi;if(gi=yi(),t&&!gi&&_i&&document.querySelector(`vitehub-pill`)?.hasAttribute(`collapsed`))try{localStorage.setItem(oi,`1`)}catch{}hi()!==n&&(n=!n,e())},a=new MutationObserver(i);a.observe(document.documentElement,{attributes:!0,attributeFilter:[_]});let o,s=()=>{o??=setTimeout(()=>{o=void 0,i()},200)},c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.localName.startsWith(`vitehub-`)))&&s()});c.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`class`,`style`]}),addEventListener(`scroll`,s,{capture:!0,passive:!0,signal:t}),addEventListener(`resize`,s,{signal:t}),addEventListener(`storage`,e=>{(e.key===null||e.key===si)&&(r=vi()),s()},{signal:t}),document.addEventListener(`pointerup`,s,{signal:t}),t.addEventListener(`abort`,()=>{a.disconnect(),c.disconnect(),clearTimeout(o)},{once:!0})}var Si={name:`vitehub-pill`,label:`ViteHub tools`,off:ai,collapsed:oi,dock:si};function Ci(e,t,n,r,i){if(t.aborted)return;let a=document.createElement(e.off);a.setAttribute(`off`,``),a.setAttribute(`collapsed`,``),i&&a.setAttribute(`closing`,``),a.style.viewTransitionName=e.name;let o=B(e.dock)??e.initialDock??{edge:`bottom`,at:50},s=()=>{let t=e===Si&&hi()&&!a.hasAttribute(`dragging`)?bi(o):o;a.setAttribute(`edge`,t.edge),a.style.setProperty(`--at`,String(t.at))};s();let c=new AbortController;t.addEventListener(`abort`,()=>{c.abort(),a.remove()},{once:!0,signal:c.signal}),e===Si&&xi(s,c.signal);let l=a.attachShadow({mode:`open`}),u=be(l,qt);c.signal.addEventListener(`abort`,u,{once:!0});let d=document.createElement(`style`);d.textContent=`${an}\n${ii}`;let f=document.createElement(`button`);if(f.type=`button`,f.title=`Turn on ${e.label}`,f.dataset.motionPress=``,f.setAttribute(`aria-label`,f.title),f.append(Ve(`0 0 20 18`,$t,{})),l.append(d,f),document.documentElement.append(a),Fe(a,c.signal),i){let e=i/$e(a).height,t=j(e,(e,t)=>{let n=t===0&&e===1;L(f,{scale:n?null:e.toFixed(4)}),n&&a.removeAttribute(`closing`)},it.snappy);t.set(e),t.to(1,{preset:it.snappy})}let p=Qe({host:a,handle:f,dock:()=>o,shape:e=>{let t=e?a.offsetHeight:a.offsetWidth,n=$e(a);return{size:t,lead:t/2,part:e?n.height:n.width,margin:2}},place:e=>{o=e,s()},drop:()=>{s();try{localStorage.setItem(e.dock,JSON.stringify(o))}catch{}},signal:c.signal});f.addEventListener(`click`,()=>{p()||(c.abort(),a.remove(),n())}),r&&f.focus({preventScroll:!0})}async function wi(e={}){return await Di(e,!1)}var Ti=new AbortController;function Ei(){Ti.abort(),Ti=new AbortController}async function Di(e,t){let n=new URL(location.href),o=n.searchParams,s=o.get(u),c=typeof e.session==`function`?e.session:void 0,d=typeof e.session==`string`?e.session:a(import.meta.url);if(!c&&!i(location.search,document.cookie))return[];let{signal:f}=Ti;try{CSS.registerProperty({name:`--vitehub-page-bar`,syntax:`<length>`,inherits:!0,initialValue:`0px`})}catch{}let p=e.pill??Si;p===Si&&(_i=B(si)!==void 0,gi=yi());let m=e.load??(e=>import(e)),h=`vitehub-tools-scripts:${d}`,_;try{let e=c?void 0:fi(d,n,s);if(c)_=await c();else if(e)_=e,document.cookie=r(!0),pi(h,_.tools);else{if(!li(p.off))for(let e of ui(h))di(e);let e=new URL(d,location.href);e.searchParams.set(`page`,location.pathname),s&&e.searchParams.set(`open`,s);let t=await fetch(e.origin===location.origin?`${e.pathname}${e.search}`:e.href,{credentials:`same-origin`,headers:{accept:`application/json`}});if(!t.ok)return[];_=l(await t.json()),pi(h,_.tools)}}catch{return[]}if(f.aborted||_.tools.length===0||document.querySelector(`${p.name}, ${p.off}`))return[];let v=s||_.tools.find(e=>e.param&&o.has(e.param))?.id;if(o.has(`vitehub`)||v||e.open)mi(p.off,!1);else if(li(p.off))return Ci(p,f,()=>{mi(p.off,!1),Di(e,!0)},!1),[];let y=e.open||v,b=_.tools.some(e=>e.id===y),x=new AbortController,S=_.tools.map(()=>new AbortController);f.addEventListener(`abort`,()=>{for(let e of S)e.abort();x.abort()},{once:!0,signal:x.signal});let C=new Set,w=!1,T=()=>!w&&[...C].every(e=>e()),E=(t=!1)=>{if(!T())return;w=!0;let n=_.tools.filter(e=>te(e.id));for(let e of _.tools)N(e.id,!1);mi(p.off,!0);let r=new URL(location.href);(p===Si||_.tools.some(e=>e.id===r.searchParams.get(`vitehub`)))&&r.searchParams.delete(u);for(let e of _.tools)e.param&&r.searchParams.delete(e.param);r.href!==location.href&&history.replaceState(history.state,``,r);let i=$e(O).height,a=Ze(O);for(let e of S)e.abort();a.then(()=>{x.abort(),Ci(p,f,()=>{mi(p.off,!1);for(let e of n)N(e.id,!0);Di(e,!0)},t,i&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?i:void 0)})},D=_.account,O=Xe({name:p.name,label:p.label,mark:Ve(`0 0 20 18`,$t,{fill:`currentColor`}),slots:[..._.tools.map(e=>e.id),ci],storage:{collapsed:p.collapsed,dock:p.dock},...p.initialDock?{initial:{dock:p.initialDock}}:{},exit:{label:`Turn off ${p.label}`,press:E,...D&&!D.guest?{menu:e=>mn({account:D,button:e,turnOff:{label:`Turn off ${p.label}`,press:E},canExit:T,signal:x.signal})}:{}},onPlace:ei,windows:{shown:Yr,hide:Xr,watch:Zr},...p===Si?{markOnly:{active:hi,watch:xi,opened:t}}:{},signal:x.signal});x.signal.addEventListener(`abort`,be(O,{effects:[Lt,Vr]}),{once:!0});let k=new Map,A=document.createElement(`vitehub-account`);A.slot=ci,O.append(A);let ee=pn({..._.account?{account:_.account}:{},bar:A,items:()=>_.tools.map(e=>k.get(e.id)??[]),signal:x.signal}),j=new Map,M=t=>`vitehub-open:${e.pill?.name??d}:${t}`,N=(e,t)=>{try{sessionStorage.setItem(M(e),String(t))}catch{}},te=e=>{try{return sessionStorage.getItem(M(e))===`true`}catch{return!1}},P=new Map,F=async(e,t)=>await P.get(e)?.(t)??!1,I=(await Promise.all(_.tools.map(async(e,t)=>{let{signal:n}=S[t],r=document.createElement(`vitehub-tool`);r.slot=e.id,O.append(r);let i,a,o,s=()=>(o||(o=m(e.script),o.catch(()=>{o=void 0})),o),c=!1,l=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,r.replaceWith(t),r=t},u=()=>{let e=r.attachShadow({mode:`open`}),t=be(e,qt);n.addEventListener(`abort`,t,{once:!0});let i=document.createElement(`style`);i.textContent=g,e.append(i,f)},d=(t,o=!0)=>n.aborted?Promise.resolve(!1):c?(i?.(t),Promise.resolve(!0)):a?a.then(e=>(e&&i?.(t),e)):(a=(async()=>{let d=new AbortController,p=()=>d.abort();n.addEventListener(`abort`,p,{once:!0}),d.signal.addEventListener(`abort`,()=>{k.delete(e.id)&&ee.update()},{once:!0});try{r.setAttribute(`aria-busy`,`true`);let a=ri(await s());if(Pn(a,`the script of a page tool default-exports a function (${e.script})`),n.aborted)return!1;f.remove(),r.shadowRoot?l():r.replaceChildren();let u=a({beforeExit:e=>{let t=()=>e();C.add(t),d.signal.addEventListener(`abort`,()=>C.delete(t),{once:!0})},tool:e,bar:r,signal:d.signal,open:o&&(e.lazy===!0||e.id===y||te(e.id)),linked:o&&e.id===v,exit:()=>E(),createWindow:t=>{let n=ni({...t,signal:d.signal,onHide:()=>{N(e.id,!1),O.hasAttribute(`collapsed`)&&O.shadowRoot.querySelector(`button.mark`).focus({preventScroll:!0}),t.onHide?.()}}),r={...n,show(){if(!d.signal.aborted){for(let[t,n]of j)t!==e.id&&n.hide();N(e.id,!0),n.show()}},destroy(){j.get(e.id)===r&&(j.delete(e.id),N(e.id,!1)),n.destroy()}};return j.set(e.id,r),r},openTool:F,menu:t=>{d.signal.aborted||(k.set(e.id,t),ee.update())},createTab:()=>{let e=document.createElement(`vitehub-tab`);return e.slot=`tab`,e.setAttribute(`data-motion-appear`,`vitehub-pill`),O.append(e),d.signal.addEventListener(`abort`,()=>e.remove(),{once:!0}),e},onOpen:e=>{i=e}});return c=!0,t&&i?.(t),!r.shadowRoot&&!r.hasChildNodes()&&(r.hidden=!0),u instanceof Function&&(n.aborted?u():d.signal.addEventListener(`abort`,()=>u(),{once:!0})),!n.aborted}catch(t){return d.abort(),n.removeEventListener(`abort`,p),j.delete(e.id)&&N(e.id,!1),i=void 0,c=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),l(),f.textContent=`Retry ${e.label}`,f.title=`The tool could not load. Try again.`,r.hidden=!1,u(),!1}finally{r.removeAttribute(`aria-busy`),a=void 0}})(),a),f=document.createElement(`button`);f.type=`button`,f.textContent=e.label,f.dataset.motionPress=``,f.addEventListener(`click`,()=>void d());for(let e of[`pointerenter`,`pointerdown`,`focus`])f.addEventListener(e,()=>void s());return P.set(e.id,d),e.lazy&&e.id!==y&&!te(e.id)?(u(),e):(await d(void 0,!b||e.id===y),n.aborted?void 0:e)}))).filter(e=>!!e);if(I.length===0)x.abort();else if(s!==null){let e=new URL(location.href);e.pathname===n.pathname&&e.searchParams.get(`vitehub`)===s&&(p===Si||_.tools.some(e=>e.id===s))&&(e.searchParams.delete(u),history.replaceState(history.state,``,e))}return I}function Oi(e){let{code:t,details:n,fix:r,retryAfter:i,status:a,why:o}=e,s=t.startsWith(`COMMENTS_`)?`https://vitehub.dev/docs/comments/diagnostics/${t.toLowerCase()}`:void 0;return Object.assign(new kn({code:t,why:o,...r?{fix:r}:{},...s?{docs:s}:{}}),{status:a,...n?{details:n}:{},...i===void 0?{}:{retryAfter:i}})}function ki(e,t,n){return Object.assign(Mi.COMMENTS_R0013(t===void 0?{}:{cause:t}),{status:e,...n===void 0?{}:{retryAfter:n}})}function Ai(e){console.warn(`[vitehub] ${e.code}: ${e.why}${e.fix?` ${e.fix}`:``}`)}var ji,Mi,Ni=t((()=>{jn(),ji={COMMENTS_HOSTED_CONFLICT:{why:`This page runs the app's own Comments, so the Hosted Comments script does not start its overlay.`,fix:"Remove the Hosted Comments script, or keep it and set `comments: { overlay: false }` to turn off the app's overlay. See https://vitehub.dev/docs/comments/configure#add-hosted-comments"},COMMENTS_OUTBOX_ACCOUNT_CHANGED:{why:`The current author is not the author of this queued comment.`,fix:`Sign in as the original author and retry the outbox.`},COMMENTS_OUTBOX_RESOLVE_BLOCKED:{why:`Queued delivery must resume before the thread can close.`,fix:`Go online, then retry or dismiss any blocked comments and resolve the thread again.`},COMMENTS_OUTBOX_SENDING:{why:`The server may already have this comment, so the draft cannot change.`,fix:`Wait for delivery to finish, then edit or delete the server copy.`},COMMENTS_OVERLAY_ELEMENT_TAKEN:{why:({name:e})=>`Another script defined the <${e}> element, so this Comments overlay cannot start.`,fix:`Load one Comments overlay script on the page. Remove the other script that defines the element.`},COMMENTS_R0001:{why:({target:e})=>`createAnchor() found nothing to anchor to for ${e}.`,fix:`Pass an element, a non-empty selection, or a point that is over an element of the page.`},COMMENTS_R0013:{why:`The comments request did not get an answer from the server.`,fix:`Check the connection and the app URL, then try again.`},COMMENTS_R0015:{why:`The comment list kept changing while its pages were loading.`,fix:`Refresh again. The previous cache is kept until two complete scans agree.`}},Mi=Dn({docsBase:`https://vitehub.dev/docs/comments/diagnostics`,codes:ji})}));function Pi(e){return Fi.test(e)&&URL.canParse(e)?new URL(e).pathname:e}var Fi,Ii=t((()=>{Fi=/^https?:\/\//i}));function Li(e){let t=new URL(e).pathname,n=t.lastIndexOf(`${Ui}/assets/`);return n===-1?Ui:`${t.slice(0,n)}${Ui}`}function Ri(e){let t=Pi(e).split(/[?#]/,1)[0]??``;return t.startsWith(`/`)||(t=`/${t}`),t=t.replace(/\/{2,}/g,`/`),t.length>1&&(t=t.replace(/\/+$/,``)),t||`/`}function zi(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619)>>>0,n=Math.imul(n^i,2671213388)>>>0}return`pages/${t.toString(16).padStart(8,`0`)}${n.toString(16).padStart(8,`0`)}`}function Bi(e){return`subjects/${encodeURIComponent(JSON.stringify([e.kind,e.id]))}`}var Vi,Hi,Ui,Wi=t((()=>{Ii(),Vi=`comments`,Hi=`comments-notices`,Ui=`/_vitehub/comments`}));function Gi(){try{let e=JSON.parse(localStorage.getItem(Yi)??`null`);if(e&&typeof e==`object`&&`id`in e&&`name`in e&&typeof e.id==`string`&&typeof e.name==`string`)return{id:e.id,name:e.name}}catch{}}function Ki(e){let t={id:Gi()?.id??crypto.randomUUID(),name:e};localStorage.setItem(Yi,JSON.stringify(t));for(let e of Xi)e(t);return t}function qi(e){return Xi.add(e),()=>Xi.delete(e)}function Ji(e){return{id:`guest:${e.id}`,name:e.name,guest:!0}}var Yi,Xi,Zi=t((()=>{Yi=`vitehub-comments-guest`,Xi=new Set}));async function Qi(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function $i(e){if(e instanceof File&&e.name)return e.name;let t=/^[a-z]+\/([a-z0-9]+)/i.exec(e.type)?.[1];return t?`file.${t}`:`file`}async function ea(e,t,n,r){let i=[];for(let a of e){let e=await n({name:$i(a),type:a.type||`application/octet-stream`,data:await Qi(a),...t?{subject:t}:{}});await r?.(e.key),i.push(e.key)}return i}async function ta(e,{files:t,outbox:n},r,i){if(!t?.length)return e;try{return{...e,attachments:[...e.attachments??[],...await ea(t,r,i,n?.uploaded)]}}catch(e){throw n&&ia.set(n,{cause:e}),e}}function na(e,t=Date.now()){let n=e.headers.get(`retry-after`)?.trim();if(!n)return;if(/^\d+$/.test(n))return Number(n)*1e3;let r=Date.parse(n);return Number.isNaN(r)?void 0:Math.max(0,r-t)}var ra,ia,aa=t((()=>{ra=`x-vitehub-comments-outbox-account`,ia=new WeakMap}));function oa(e){return Object(e)===e&&!Array.isArray(e)}var sa=t((()=>{}));function ca(e,t=``){return`${t.replace(/\/+$/,``)}${Ui}/attachments/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function la(e={}){let t=e.route??`${(e.base??``).replace(/\/+$/,``)}/_vitehub/comments`;return async(n,r={})=>{let i=e.fetch??globalThis.fetch,a=new Headers(typeof e.headers==`function`?await e.headers():e.headers);for(let[e,t]of new Headers(r.headers))a.set(e,t);r.body!==void 0&&!a.has(`content-type`)&&a.set(`content-type`,`application/json`);let o=typeof e.guest==`function`?e.guest():e.guest;o&&(a.set(`x-vitehub-comments-guest-id`,o.id),a.set(`x-vitehub-comments-guest-name`,encodeURIComponent(o.name)));let s;try{s=await i(`${t}${n}`,{...r,headers:a,credentials:e.credentials??`same-origin`,cache:`no-store`})}catch(e){throw ki(0,e)}let c=await s.json().catch(()=>void 0),l=na(s);if(oa(c)&&oa(c.error)){let{code:e,why:t,fix:n}=c.error;throw typeof e!=`string`||typeof t!=`string`?ki(s.status,void 0,l):Oi({code:e,why:t,...typeof n==`string`?{fix:n}:{},...l===void 0?{}:{retryAfter:l},status:s.status})}if(oa(c)&&`data`in c){let t={data:c.data,people:Array.isArray(c.people)?c.people:[],...oa(c.thread)?{thread:c.thread}:{}};return e.onAnswer?.(t),t}throw ki(s.status,void 0,l)}}function ua(e){let t=new URLSearchParams;return e.page!==void 0&&t.set(`page`,e.page),e.subject?(t.set(`subjectKind`,e.subject.kind),t.set(`subjectId`,e.subject.id)):e.subjectKind&&t.set(`subjectKind`,e.subjectKind),e.status&&t.set(`status`,e.status),e.mine!==void 0&&t.set(`mine`,String(e.mine)),e.mentions!==void 0&&t.set(`mentions`,String(e.mentions)),e.revision&&t.set(`revision`,String(e.revision.lte)),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.before&&(t.set(`beforeId`,e.before.id),t.set(`beforeUpdatedAt`,String(e.before.updatedAt))),t}function da(e={}){let t=la(e),n=(e.base??``).replace(/\/+$/,``),r=async(e,n)=>(await t(`/attachments`,pa(e,n))).data;return{async list(e){return(await t(`/threads?${ua(e)}`)).data},async get(e){let n=`threadId`in e?fa(e.threadId):`/scopes/${encodeURIComponent(e.scope)}/threads/${e.n}`;return(await t(n)).data},async create({files:e,outbox:n,...i}){let a=await ta(i,{files:e,outbox:n},i.subject,e=>r(e,n?.account));return(await t(`/threads`,pa(a,n?.account))).data},async reply({threadId:e,subject:n,files:i,outbox:a,...o}){let s=await ta(o,{files:i,outbox:a},n,e=>r(e,a?.account)),c=await t(`${fa(e)}/comments`,pa(s,a?.account));if(!c.thread)throw ki(200);return c.thread},async edit({threadId:e,messageId:n,...r}){return(await t(`${fa(e)}/comments/${encodeURIComponent(n)}`,{method:`PATCH`,body:JSON.stringify(r)})).data},async delete({threadId:e,messageId:n}){let r=n===void 0?fa(e):`${fa(e)}/comments/${encodeURIComponent(n)}`;return(await t(r,{method:`DELETE`})).data},async resolve({threadId:e}){return(await t(`${fa(e)}/resolve`,pa())).data},async reopen({threadId:e}){return(await t(`${fa(e)}/reopen`,pa())).data},async users({query:e,limit:n,threadId:r,subject:i}){let a=new URLSearchParams({q:e});return n!==void 0&&a.set(`limit`,String(n)),r===void 0?i&&(a.set(`subjectKind`,i.kind),a.set(`subjectId`,i.id)):a.set(`thread`,r),(await t(`/people?${a}`)).data},upload:e=>r(e),attachmentUrl:e=>ca(e,n)}}var fa,pa,ma=t((()=>{Ni(),aa(),Wi(),sa(),fa=e=>`/threads/${encodeURIComponent(e)}`,pa=(e,t)=>({method:`POST`,...e===void 0?{}:{body:JSON.stringify(e)},...t===void 0?{}:{headers:{[ra]:encodeURIComponent(t)}}})}));function ha(){return Ea?Ea.namespace:new URL(wa,location.href).href}function ga(e){if(!_a(e))throw e;return{code:e.code,why:e.message,...e.fix?{fix:e.fix}:{}}}function _a(e){return e instanceof kn?!0:!(e instanceof Error)||!(`code`in e)||typeof e.code!=`string`||e.name!==e.code?!1:!(`fix`in e)||e.fix===void 0||typeof e.fix==`string`}async function va(e,t={}){try{return[void 0,(await Ta(e,t)).data]}catch(e){return[ga(e),void 0]}}function ya(e){Ea=e}function ba(e){return Ea?.changes?.(e)??(()=>void 0)}function xa(e,t){if(Ea)return;let n=Ta(`/threads?page=${encodeURIComponent(e)}&limit=${Oa}`,{signal:t});return n.catch(()=>void 0),{answer:n,signal:t}}function Sa(e,t){let{subject:n,limit:r,...i}=e;return Object.keys(i).length===0&&r===Oa&&n?.kind===t.kind&&n.id===t.id}function Ca(e){let t=t=>t.people.length&&e.onPeople(t.people),n=Ea?Ea.transport(t):da({base:wa.slice(0,-Ui.length),guest:Gi,onAnswer:t}),r=e.pageThreads,i=async i=>{e.pageThreads?.signal.throwIfAborted();let a=r;r=void 0;let o=a&&Sa(i,a.subject)?await a.answer.catch(()=>void 0):void 0;return a?.signal.throwIfAborted(),o?(t(o),o.data):await n.list(i)},a=t=>async(...n)=>{let r=await t(...n);return e.onChange(),r};return{...n,list:i,create:a(n.create),reply:a(n.reply),edit:a(n.edit),delete:a(n.delete),resolve:a(n.resolve),reopen:a(n.reopen)}}var wa,Ta,Ea,Da,Oa,ka,Aa=t((()=>{Wi(),jn(),Zi(),ma(),wa=Li(import.meta.url),Ta=la({route:wa,guest:Gi}),Da=e=>({method:`POST`,body:JSON.stringify(e)}),Oa=200,ka={session:e=>Ea?Ea.session(e):va(`/session?page=${encodeURIComponent(e)}`),pageThreads:xa,field:(e,t)=>va(`/fields?page=${encodeURIComponent(t)}&field=${encodeURIComponent(e)}`),saveField:(e,t)=>va(`/fields?page=${encodeURIComponent(t)}`,Da(e))}}));function ja(){let e={};return document.querySelector(Pa)?.dispatchEvent(new CustomEvent(Fa,{detail:e})),e.draft}function Ma(){return customElements.get(`vitehub-comments`)?(Ai(Mi.COMMENTS_HOSTED_CONFLICT()),!0):!1}var Na,Pa,Fa,Ia=t((()=>{Ni(),Na=`vitehub-comments`,Pa=`vitehub-hosted-comments`,Fa=`vitehub:hosted-comments-draft`}));Aa(),Ia();function La(e){return`/comments/${encodeURIComponent(e)}/embed`}var Ra,za,Ba,Va,Ha,Ua,Wa=t((()=>{Ra=`modulepreload`,za=function(e,t){return new URL(e,t).href},Ba={},Va=function(e){return e.pathname.endsWith(`.css`)},Ha=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Ua=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=za(t,n);let r=s(t),i=Va(r);return Ha(Ba,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ra,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}})),Ga,Ka=t((()=>{Ga=`:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}[data-slot=comment-mark-pin][data-motion-leave-managed]{transition:none}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}`}));function qa(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e.replace(/[^\w-]/g,e=>`\\${e}`)}function Ja(e,t){return`[${e}="${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"]`}function Ya(e){let t=[],n=e;for(;n&&n!==document.documentElement&&t.length<no;){if(n.id)return t.unshift(`#${qa(n.id)}`),t.join(` > `);let e=n.getAttribute(to);if(e)return t.unshift(Ja(to,e)),t.join(` > `);let r=n.tagName.toLowerCase(),i=n.parentElement;if(!i){t.unshift(r);break}let a=[...i.children].filter(e=>e.tagName===n.tagName);t.unshift(a.length>1?`${r}:nth-of-type(${a.indexOf(n)+1})`:r),n=i}return t.join(` > `)}function Xa(e){let t=(e.textContent??``).replace(/\s+/g,` `).trim().slice(0,40),n=e.tagName.toLowerCase();return t?`${n} ${t}`:n}function Za(e,t){return t?Math.min(1e3,Math.max(0,Math.round(e/t*1e3))):0}function Qa(){return Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth,1)}function $a(e){return e.closest(`[data-content-field]`)??void 0}function eo(e,t,n){let r=e.getBoundingClientRect(),i=$a(e)?.getAttribute(`data-content-field`)??void 0;return{kind:`element`,...i?{field:i}:{},selector:Ya(e),label:Xa(e),x:Za(t-r.left,r.width),y:Za(n-r.top,r.height),page:{x:Za(t+window.scrollX,Qa()),y:Math.max(0,Math.round(n+window.scrollY))},viewport:{width:window.innerWidth}}}var to,no,ro=t((()=>{to=`data-content-field`,no=10}));function io(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function ao(e){if(V(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=jo(r)?oo(r):ao(r);if(i)for(let e in i)t[e]=i[e]}return t}if(jo(e)||No(e))return e}function oo(e){let t={};return e.replace(rs,e=>e.startsWith(`/*`)?``:e).split(ts).forEach(e=>{if(e){let n=e.split(ns);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function so(e){let t=``;if(jo(e))t=e;else if(V(e))for(let n=0;n<e.length;n++){let r=so(e[n]);r&&(t+=r+` `)}else if(No(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function co(e){if(!e)return null;let{class:t,style:n}=e;return t&&!jo(t)&&(e.class=so(t)),n&&(e.style=ao(n)),e}function lo(e){return!!e||e===``}function uo(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=ho(e[i],t[i],n);return r}function fo(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]&&ho(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function po(e,t,n){let r=Do(e),i=Do(t);if(r||i||(r=Oo(e),i=Oo(t),r||i))return r&&i?fo(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=Eo(e,r),a=Eo(t,r);if(i&&!a||!i&&a||!ho(e[r],t[r],n))return!1}return go(e)===go(t)}function mo(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 ho(e,t,n){if(e===t)return!0;let r=ko(e),i=ko(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=Mo(e),i=Mo(t),r||i?e===t:(r=V(e),i=V(t),r||i?r&&i?mo(e,t,n,uo):!1:(r=No(e),i=No(t),r||i?!r||!i?!1:mo(e,t,n,po):String(e)===String(t))))}function go(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?Io(e):String(e)}var _o,vo,yo,bo,xo,So,Co,wo,To,Eo,V,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us=t((()=>{_o={},vo=[],yo=()=>{},bo=()=>!1,xo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),So=e=>e.startsWith(`onUpdate:`),Co=Object.assign,wo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},To=Object.prototype.hasOwnProperty,Eo=(e,t)=>To.call(e,t),V=Array.isArray,Do=e=>Io(e)===`[object Map]`,Oo=e=>Io(e)===`[object Set]`,ko=e=>Io(e)===`[object Date]`,Ao=e=>typeof e==`function`,jo=e=>typeof e==`string`,Mo=e=>typeof e==`symbol`,No=e=>typeof e==`object`&&!!e,Po=e=>(No(e)||Ao(e))&&Ao(e.then)&&Ao(e.catch),Fo=Object.prototype.toString,Io=e=>Fo.call(e),Lo=e=>Io(e).slice(8,-1),Ro=e=>Io(e)===`[object Object]`,zo=e=>jo(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,Bo=io(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Vo=1e4,Ho=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>Vo&&(t=Object.create(null),n=1),t[r]=e(r)):i})},Uo=/-\w/g,Wo=Ho(e=>e.replace(Uo,e=>e.slice(1).toUpperCase())),Go=/\B([A-Z])/g,Ko=Ho(e=>e.replace(Go,`-$1`).toLowerCase()),qo=Ho(e=>e.charAt(0).toUpperCase()+e.slice(1)),Jo=Ho(e=>e?`on${qo(e)}`:``),Yo=(e,t)=>!Object.is(e,t),Xo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Zo=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Qo=e=>{let t=parseFloat(e);return isNaN(t)?e:t},es=()=>$o||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ts=/;(?![^(]*\))/g,ns=/:([^]+)/,rs=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g,is=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,as=io(is),os=e=>!!(e&&e.__v_isRef===!0),ss=e=>jo(e)?e:e==null?``:V(e)||No(e)&&(e.toString===Fo||!Ao(e.toString))?os(e)?ss(e.value):JSON.stringify(e,cs,2):String(e),cs=(e,t)=>os(t)?cs(e,t.value):Do(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ls(t,r)+` =>`]=n,e),{})}:Oo(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ls(e))}:Mo(t)?ls(t):No(t)&&!V(t)&&!Ro(t)?String(t):t,ls=(e,t=``)=>Mo(e)?`Symbol(${e.description??t})`:e}));function ds(e){return new dc(e)}function fs(){return uc}function ps(e,t=!1){uc&&(uc.active?uc.cleanups.push(e):e())}function ms(e,t=!1){e.flags|=8,t?(e.next=_c,_c=e):(e.next=gc,gc=e)}function hs(){hc++}function gs(){if(--hc>0)return;if(_c){let e=_c;for(_c=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;gc;){let t=gc;for(gc=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 _s(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vs(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),xs(r),Ss(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bs(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bs(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===bc)||(e.globalVersion=bc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ys(e))))return;e.flags|=2;let t=e.dep,n=fc,r=vc;fc=e,vc=!0;try{_s(e);let n=e.fn(e._value);(t.version===0||Yo(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{fc=n,vc=r,vs(e),e.flags&=-3}}function xs(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)xs(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ss(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Cs(){yc.push(vc),vc=!1}function ws(){let e=yc.pop();vc=e===void 0||e}function Ts(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=fc;fc=void 0;try{t()}finally{fc=e}}}function Es(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)Es(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function Ds(e,t,n){if(vc&&fc){let t=Cc.get(e);t||Cc.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Sc),r.map=t,r.key=n),r.track()}}function Os(e,t,n,r,i,a){let o=Cc.get(e);if(!o){bc++;return}let s=e=>{e&&e.trigger()};if(hs(),t===`clear`)o.forEach(s);else{let i=V(e),a=i&&zo(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ec||!Mo(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ec)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(wc)),Do(e)&&s(o.get(Tc)));break;case`delete`:i||(s(o.get(wc)),Do(e)&&s(o.get(Tc)));break;case`set`:Do(e)&&s(o.get(wc))}}gs()}function ks(e){let t=Qs(e);return t===e||(Ds(t,`iterate`,Ec),Xs(e))?t:Ys(e)?Js(e)?t.map(e=>qc(Kc(e))):t.map(qc):t.map(Kc)}function As(e){return Ds(e=Qs(e),`iterate`,Ec),e}function js(e,t){return Ys(e)?qc(Js(e)?Kc(t):t):Kc(t)}function Ms(e,t,n){let r=As(e),i=r[t],a=i.call(r);if(r!==e&&!Xs(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>Ns(a.next(),n),i!==Oc[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=()=>Ns(a._next(),n)}return a}function Ns(e,t){return e.done||(e.value=t(e.value)),e}function Ps(e,t,n,r,i,a){let o=As(e),s=o!==e&&!Xs(e),c=o[t];if(c!==Oc[t]){let t=c.apply(e,a);return s?Kc(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,js(e,t),r,e)}: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 Fs(e,t,n,r){let i=As(e),a=i!==e&&!Xs(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=js(e,t)),n.call(this,t,js(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?js(e,c):c}function Is(e,t,n){let r=Qs(e);Ds(r,`iterate`,Ec);let i=r[t](...n);return(i===-1||i===!1)&&Zs(n[0])?(n[0]=Qs(n[0]),r[t](...n)):i}function Ls(e,t,n=[]){Cs(),hs();let r=Qs(e)[t].apply(e,n);return gs(),ws(),r}function Rs(e){Mo(e)||(e=String(e));let t=Qs(this);return Ds(t,`has`,e),t.hasOwnProperty(e)}function zs(e,t,n){return function(...r){let i=this.__v_raw,a=Qs(i),o=Do(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Lc:t?qc:Kc;return!t&&Ds(a,`iterate`,c?Tc:wc),Co(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Bs(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Vs(e,t){let n={get(n){let r=this.__v_raw,i=Qs(r),a=Qs(n);e||(Yo(n,a)&&Ds(i,`get`,n),Ds(i,`get`,a));let{has:o}=Rc(i),s=t?Lc:e?qc:Kc;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&&Ds(Qs(t),`iterate`,wc),t.size},has(t){let n=this.__v_raw,r=Qs(n),i=Qs(t);return e||(Yo(t,i)&&Ds(r,`has`,t),Ds(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=Qs(a),s=t?Lc:e?qc:Kc;return!e&&Ds(o,`iterate`,wc),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return Co(n,e?{add:Bs(`add`),set:Bs(`set`),delete:Bs(`delete`),clear:Bs(`clear`)}:{add(e){let n=Qs(this),r=Rc(n),i=Qs(e),a=!t&&!Xs(e)&&!Ys(e)?i:e;return r.has.call(n,a)||Yo(e,a)&&r.has.call(n,e)||Yo(i,a)&&r.has.call(n,i)||(n.add(a),Os(n,`add`,a,a)),this},set(e,n){t||Xs(n)||Ys(n)||(n=Qs(n));let r=Qs(this),{has:i,get:a}=Rc(r),o=i.call(r,e);o||=(e=Qs(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Yo(n,s)&&Os(r,`set`,e,n,s):Os(r,`add`,e,n),this},delete(e){let t=Qs(this),{has:n,get:r}=Rc(t),i=n.call(t,e);i||=(e=Qs(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Os(t,`delete`,e,void 0,a),o},clear(){let e=Qs(this),t=e.size!==0,n=e.clear();return t&&Os(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=zs(r,e,t)}),n}function Hs(e,t){let n=Vs(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(Eo(n,i)&&i in r?n:r,i,a)}function Us(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Ws(e){return Ys(e)?e:qs(e,!1,Pc,zc,Hc)}function Gs(e){return qs(e,!1,Ic,Bc,Uc)}function Ks(e){return qs(e,!0,Fc,Vc,Wc)}function qs(e,t,n,r,i){if(!No(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=Us(Lo(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Js(e){return Ys(e)?Js(e.__v_raw):!!(e&&e.__v_isReactive)}function Ys(e){return!!(e&&e.__v_isReadonly)}function Xs(e){return!!(e&&e.__v_isShallow)}function Zs(e){return e?!!e.__v_raw:!1}function Qs(e){let t=e&&e.__v_raw;return t?Qs(t):e}function $s(e){return!Eo(e,`__v_skip`)&&Object.isExtensible(e)&&Zo(e,`__v_skip`,!0),e}function ec(e){return e?e.__v_isRef===!0:!1}function H(e){return nc(e,!1)}function tc(e){return nc(e,!0)}function nc(e,t){return ec(e)?e:new Jc(e,t)}function U(e){return ec(e)?e.value:e}function rc(e){return Ao(e)?e():U(e)}function ic(e){return Js(e)?e:new Proxy(e,Yc)}function ac(e){return new Xc(e)}function oc(e,t,n=!1){let r,i;return Ao(e)?r=e:(r=e.get,i=e.set),new Zc(r,i,n)}function sc(e,t=!1,n=el){if(n){let t=$c.get(n);t||$c.set(n,t=[]),t.push(e)}}function cc(e,t,n=_o){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:Xs(e)||i===!1||i===0?lc(e,1):lc(e),u,d,f,p,m=!1,h=!1;if(ec(e)?(d=()=>e.value,m=Xs(e)):Js(e)?(d=()=>l(e),m=!0):V(e)?(h=!0,m=e.some(e=>Js(e)||Xs(e)),d=()=>e.map(e=>{if(ec(e))return e.value;if(Js(e))return l(e);if(Ao(e))return c?c(e,2):e()})):d=Ao(e)?t?c?()=>c(e,2):e:()=>{if(f){Cs();try{f()}finally{ws()}}let t=el;el=u;try{return c?c(e,3,[p]):e(p)}finally{el=t}}:yo,t&&i){let e=d,t=i===!0?1/0:i;d=()=>lc(e(),t)}let g=fs(),_=()=>{u.stop(),g&&g.active&&wo(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{_()}}}let v=h?Array(e.length).fill(Qc):Qc,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Yo(e,v[t])):Yo(n,v))){let e=el;Cs();try{f&&f(),el=u;let e=[n,v===Qc?void 0:h&&v[0]===Qc?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{el=e,ws()}}}else u.run()}};return s&&s(y),u=new mc(d),u.scheduler=o?()=>o(y,!1):y,p=e=>sc(e,!1,u),f=u.onStop=()=>{let e=$c.get(u);if(e){if(c)c(e,4);else for(let t of e)t();$c.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function lc(e,t=1/0,n){if(t<=0||!No(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ec(e))lc(e.value,t,n);else if(V(e))for(let r=0;r<e.length;r++)lc(e[r],t,n);else if(Oo(e)||Do(e))e.forEach(e=>{lc(e,t,n)});else if(Ro(e)){for(let r in e)lc(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&lc(e[r],t,n)}return e}var uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl=t((()=>{us(),dc=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&&uc&&(uc.active?(this.parent=uc,this.index=(uc.scopes||(uc.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=uc;try{return uc=this,e()}finally{uc=t}}}on(){++this._on===1&&(this.prevScope=uc,uc=this)}off(){if(this._on>0&&--this._on===0){if(uc===this)uc=this.prevScope;else{let e=uc;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}}},pc=new WeakSet,mc=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,uc&&(uc.active?uc.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,pc.has(this)&&(pc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ms(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ts(this),_s(this);let e=fc,t=vc;fc=this,vc=!0;try{return this.fn()}finally{vs(this),fc=e,vc=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)xs(e);this.deps=this.depsTail=void 0,Ts(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?pc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ys(this)&&this.run()}get dirty(){return ys(this)}},hc=0,vc=!0,yc=[],bc=0,xc=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}},Sc=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(!fc||!vc||fc===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==fc)t=this.activeLink=new xc(fc,this),fc.deps?(t.prevDep=fc.depsTail,fc.depsTail.nextDep=t,fc.depsTail=t):fc.deps=fc.depsTail=t,Es(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=fc.depsTail,t.nextDep=void 0,fc.depsTail.nextDep=t,fc.depsTail=t,fc.deps===t&&(fc.deps=e)}return t}trigger(e){this.version++,bc++,this.notify(e)}notify(e){hs();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{gs()}}},Cc=new WeakMap,wc=Symbol(``),Tc=Symbol(``),Ec=Symbol(``),Dc={__proto__:null,[Symbol.iterator](){return Ms(this,Symbol.iterator,e=>js(this,e))},concat(...e){return ks(this).concat(...e.map(e=>V(e)?ks(e):e))},entries(){return Ms(this,`entries`,e=>(e[1]=js(this,e[1]),e))},every(e,t){return Ps(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ps(this,`filter`,e,t,e=>e.map(e=>js(this,e)),arguments)},find(e,t){return Ps(this,`find`,e,t,e=>js(this,e),arguments)},findIndex(e,t){return Ps(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ps(this,`findLast`,e,t,e=>js(this,e),arguments)},findLastIndex(e,t){return Ps(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ps(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Is(this,`includes`,e)},indexOf(...e){return Is(this,`indexOf`,e)},join(e){return ks(this).join(e)},lastIndexOf(...e){return Is(this,`lastIndexOf`,e)},map(e,t){return Ps(this,`map`,e,t,void 0,arguments)},pop(){return Ls(this,`pop`)},push(...e){return Ls(this,`push`,e)},reduce(e,...t){return Fs(this,`reduce`,e,t)},reduceRight(e,...t){return Fs(this,`reduceRight`,e,t)},shift(){return Ls(this,`shift`)},some(e,t){return Ps(this,`some`,e,t,void 0,arguments)},splice(...e){return Ls(this,`splice`,e)},toReversed(){return ks(this).toReversed()},toSorted(e){return ks(this).toSorted(e)},toSpliced(...e){return ks(this).toSpliced(...e)},unshift(...e){return Ls(this,`unshift`,e)},values(){return Ms(this,`values`,e=>js(this,e))}},Oc=Array.prototype,kc=io(`__proto__,__v_isRef,__isVue`),Ac=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(Mo)),jc=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?Gc:Wc:i?Uc:Hc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=V(e);if(!r){let e;if(a&&(e=Dc[t]))return e;if(t===`hasOwnProperty`)return Rs}let o=Reflect.get(e,t,ec(e)?e:n);if((Mo(t)?Ac.has(t):kc(t))||(r||Ds(e,`get`,t),i))return o;if(ec(o)){let e=a&&zo(t)?o:o.value;return r&&No(e)?Ks(e):e}return No(o)?r?Ks(o):Ws(o):o}},Mc=class extends jc{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=V(e)&&zo(t);if(!this._isShallow){let e=Ys(i);if(!Xs(n)&&!Ys(n)&&(i=Qs(i),n=Qs(n)),!a&&ec(i)&&!ec(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:Eo(e,t),s=Reflect.set(e,t,n,ec(e)?e:r);return e===Qs(r)&&s&&(o?Yo(n,i)&&Os(e,`set`,t,n,i):Os(e,`add`,t,n)),s}deleteProperty(e,t){let n=Eo(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Os(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return Mo(t)&&Ac.has(t)||Ds(e,`has`,t),n}ownKeys(e){return Ds(e,`iterate`,V(e)?`length`:wc),Reflect.ownKeys(e)}},Nc=class extends jc{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Pc=new Mc,Fc=new Nc,Ic=new Mc(!0),Lc=e=>e,Rc=e=>Reflect.getPrototypeOf(e),zc={get:Hs(!1,!1)},Bc={get:Hs(!1,!0)},Vc={get:Hs(!0,!1)},Hc=new WeakMap,Uc=new WeakMap,Wc=new WeakMap,Gc=new WeakMap,Kc=e=>No(e)?Ws(e):e,qc=e=>No(e)?Ks(e):e,Jc=class{constructor(e,t){this.dep=new Sc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Qs(e),this._value=t?e:Kc(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Xs(e)||Ys(e);e=n?e:Qs(e),Yo(e,t)&&(this._rawValue=e,this._value=n?e:Kc(e),this.dep.trigger())}},Yc={get:(e,t,n)=>t===`__v_raw`?e:U(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return ec(i)&&!ec(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},Xc=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new Sc,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}},Zc=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Sc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=bc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&fc!==this)return ms(this,!0),!0}get value(){let e=this.dep.track();return bs(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},Qc={},$c=new WeakMap,el=void 0}));function nl(e,t,n,r){try{return r?e(...r):e()}catch(e){il(e,t,n)}}function rl(e,t,n,r){if(Ao(e)){let i=nl(e,t,n,r);return i&&Po(i)&&i.catch(e=>{il(e,t,n,void 0,!0)}),i}if(V(e)){let i=[];for(let a=0;a<e.length;a++)i.push(rl(e[a],t,n,r));return i}}function il(e,t,n,r=!0,i=!1){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||_o;if(t){let r=t.parent,a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t&&!r.isUnmounted&&(!i||r.scope.active)){for(let n=0;n<t.length;n++)if(t[n](e,a,s)===!1)return}r=r.parent}if(o){Cs(),nl(o,null,10,[e,a,s]),ws();return}}al(e,n,a,r,s)}function al(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function ol(e){let t=fd||dd;return e?t.then(this?e.bind(this):e):t}function sl(e){let t=sd+1,n=od.length;for(;t<n;){let r=t+n>>>1,i=od[r],a=md(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function cl(e){if(!(e.flags&1)){let t=md(e),n=od[od.length-1];!n||!(e.flags&2)&&t>=md(n)?od.push(e):od.splice(sl(t),0,e),e.flags|=1,ll()}}function ll(){fd||=dd.then(ml)}function ul(e){if(!V(e))ld&&e.id===-1?ld.splice(ud+1,0,e):e.flags&1||(cd.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)cd.push(e[t]);ll()}function dl(e,t,n,r=sd+1){for(;r<od.length;r++){let n=od[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;od.splice(r,1),r=e?r-1:sd,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function fl(e,t,n=0){if(cd.length){let e=cd,r=0;if(t){e=[];for(let i=0;i<cd.length;i++){let a=cd[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?cd[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>md(e)-md(t));if(cd.length=r,ld){for(let e=0;e<i.length;e++)ld.push(i[e]);return}for(ld=i,ud=0;ud<ld.length;ud++){let e=ld[ud];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}ld=null,ud=0}}function pl(e,t){if(pd){e();return}let n=t===void 0?void 0:new Set(cd);e(),pd=!0;try{dl(void 0,t),fl(void 0,n,t)}finally{pd=!1}}function ml(e){try{for(sd=0;sd<od.length;sd++){let e=od[sd];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),nl(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;sd<od.length;sd++){let e=od[sd];e&&(e.flags&=-2)}sd=-1,od.length=0,fl(e),fd=null,(od.length||cd.length)&&ml(e)}}function hl(e){let t=hd;return hd=e,gd=e&&e.type.__scopeId||null,t}function gl(e,t=hd,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Mu(-1);let i=hl(t),a=hf.length,o;try{o=e(...n)}finally{for(let e=hf.length;e>a;e--)ju();hl(i),r._d&&Mu(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function _l(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 s=0;s<a.length;s++){let c=a[s];o?c.oldValue=o[s].value:r===`mounted`&&c.oldValue!==void 0&&(c=Co({},c,{oldValue:void 0}));let l=c.dir[r];l&&(Cs(),rl(l,n,8,[e.el,c,i,t]),ws())}}function vl(e,t){if(Cf){let n=Cf.provides,r=Cf.parent&&Cf.parent.provides;r===n&&(n=Cf.provides=Object.create(r)),n[e]=t}}function yl(e,t,n=!1){let r=wf();if(r||Kd){let i=Kd?Kd._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&&Ao(t)?t.call(r&&r.proxy):t}}function bl(){return!!(wf()||Kd)}function xl(e,t){return Cl(e,null,t)}function Sl(e,t){return Cl(e,null,{flush:`sync`})}function W(e,t,n){return Cl(e,t,n)}function Cl(e,t,n=_o){let{immediate:r,deep:i,flush:a,once:o}=n,s=Co({},n),c=t&&r||!t&&a!==`post`,l;if(kf){if(a===`sync`){let e=vd();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=yo,e.resume=yo,e.pause=yo,e}}let u=Cf;s.call=(e,t,n)=>rl(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{e.i=u,cf(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():cl(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=cc(e,t,s);return kf&&(l?l.push(f):c&&f()),f}function wl(e,t,n,{o:{insert:r},m:i},a=2){a===0&&(e.targetStart&&r(e.targetStart,t,n),r(e.targetAnchor,t,n),n=e.targetAnchor);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!yd.has(e)&&(!d||Sd(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function Tl(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=Ed(t.props,c),h=Sd(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(f(m,c),p(e,t),t.targetAnchor||Dl(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Dl(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),El(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}function El(e,t){let n=e.ctx;n&&n.ut&&(t?n.ut(e.el,e.anchor):n.ut(e.targetStart,e.targetAnchor))}function Dl(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[bd]=o,e&&(r(a,e,i),r(o,e,i)),o}function Ol(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==pf){t=n;break}}return t}function kl(e){if(!Md(e))return xd(e.type)&&e.children?Ol(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&&Ao(n.default))return n.default()}}function Al(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Al(xd(n.type)&&kl(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&Al(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===df&&V(e.children)){let n=lu(e.children,!1);n&&Al(n,t)}}function jl(e){if(e.component)return jl(e.component.subTree);if(e.type===df){let t=V(e.children)&&lu(e.children,!1);return t?jl(t):void 0}if(e.type!==pf)return e}function G(e,t){return Ao(e)?Co({name:e.name},t,{setup:e}):e}function Ml(){let e=wf();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function Nl(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Pl(e){let t=wf(),n=tc(null);if(t){let r=t.refs===_o?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function Fl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Il(e,t,n,r,i=!1){if(V(e)){e.forEach((e,a)=>Il(e,t&&(V(t)?t[a]:t),n,r,i));return}if(jd(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Il(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?rd(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===_o?s.refs={}:s.refs,d=s.setupState,f=Qs(d),p=d===_o?bo:e=>!Fl(u,e)&&Eo(f,e),m=(e,t)=>!(t&&Fl(u,t));if(l!=null&&l!==c){if(Ll(t),jo(l))u[l]=null,p(l)&&(d[l]=null);else if(ec(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(Ao(c))nl(c,s,12,[o,u]);else{let t=jo(c),r=ec(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)V(n)&&wo(n,a);else if(V(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Ad.delete(e)};t.id=-1,Ad.set(e,t),cf(t,n)}else Ll(e),s()}}}function Ll(e){let t=Ad.get(e);t&&(t.flags|=8,Ad.delete(e))}function Rl(e,t){Bl(e,`a`,t)}function zl(e,t){Bl(e,`da`,t)}function Bl(e,t,n=Cf){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Hl(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Md(e.parent.vnode)&&Vl(r,t,n,e),e=e.parent}}function Vl(e,t,n,r){let i=Hl(t,e,r,!0),a=Hl(`um`,()=>wo(r[t],i),n);a.flags=16}function Hl(e,t,n=Cf,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Cs();let i=Df(n),a=rl(t,n,e,r);return i(),ws(),a};return r?i.unshift(a):i.push(a),a}}function Ul(e,t=Cf){Hl(`ec`,e,t)}function Wl(e){return jo(e)?Gl(zd,e,!1)||e:e||Bd}function Gl(e,t,n=!0,r=!1){let i=hd||Cf;if(i){let n=i.type;if(e===zd){let e=id(n,!1);if(e&&(e===t||e===Wo(t)||e===qo(Wo(t))))return n}let a=Kl(i[e]||n[e],t)||Kl(i.appContext[e],t);return!a&&r?n:a}}function Kl(e,t){return e&&(e[t]||e[Wo(t)]||e[qo(Wo(t))])}function ql(e,t,n,r){let i,a=n&&n[r],o=V(e);if(o||jo(e)){let n=o&&Js(e),r=!1,s=!1;n&&(r=!Xs(e),s=Ys(e),e=As(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?qc(Kc(e[n])):Kc(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(No(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 Jl(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(V(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Yl(e,t,n,r,i,a){if(n??={},hd.ce||hd.parent&&jd(hd.parent)&&hd.parent.ce){let e=a!=null&&n.key==null?Co({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),K(),Fu(df,null,[bf(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=hf.length;K();let c;try{let i=o&&Xl(o(n)),s=n.key||a||i&&i.key;c=Fu(df,{key:(s&&!Mo(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=hf.length;e>s;e--)ju();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function Xl(e){return e.some(e=>!Iu(e)||!(e.type===pf||e.type===df&&!Xl(e.children)))?e:null}function Zl(){return $l(`useSlots`).slots}function Ql(){return $l(`useAttrs`).attrs}function $l(e){let t=wf();return t.setupContext||=nd(t)}function eu(e){return V(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function tu(e,t){return!e||!t?e||t:V(e)&&V(t)?e.concat(t):Co({},eu(e),eu(t))}function nu(){return{app:null,config:{isNativeTag:bo,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}}function ru(e,t){return function(n,r=null){Ao(n)||(n=Co({},n)),r!=null&&!No(r)&&(r=null);let i=nu(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Gd++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Pf,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&Ao(e.install)?(a.add(e),e.install(c,...t)):Ao(e)&&(a.add(e),e(c,...t))),c},mixin(e){return c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||bf(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,rd(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(rl(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Kd;Kd=c;try{return e()}finally{Kd=t}}};return c}}function iu(e,t,n=_o){let r=wf(),i=Wo(t),a=Ko(t),o=qd(e,i),s=ac((o,s)=>{let c,l=_o,u;return Sl(()=>{let t=e[i];Yo(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Yo(o,c)&&!(l!==_o&&Yo(e,l)))return;let d=r.vnode.props,f=!!(d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d));f||(c=e,s()),r.emit(`update:${t}`,o),Yo(e,l)&&(Yo(e,o)&&!Yo(o,u)||f&&l!==_o&&!Yo(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||_o:s,done:!1}:{done:!0}}}},s}function au(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||_o,i=n,a=t.startsWith(`update:`),o=a&&qd(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>jo(e)?e.trim():e)),o.number&&(i=i.map(Qo)));let s,c=r[s=Jo(t)]||r[s=Jo(Wo(t))];!c&&a&&(c=r[s=Jo(Ko(t))]),c&&rl(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,rl(l,e,6,i)}}function ou(e,t,n=!1){let r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={};return a?(V(a)?a.forEach(e=>o[e]=null):Co(o,a),No(e)&&r.set(e,o),o):(No(e)&&r.set(e,null),null)}function su(e,t){return!e||!xo(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),Eo(e,t[0].toLowerCase()+t.slice(1))||Eo(e,Ko(t))||Eo(e,t))}function cu(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=hl(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=Wu(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=Wu(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Jd(s)}}catch(t){hf.length=0,il(t,e,1),_=bf(pf)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(So)&&(v=Yd(v,a)),y=Vu(y,v,!1,!0))}return n.dirs&&(y=Vu(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Al(xd(y.type)&&kl(y)||y,n.transition),_=y,hl(g),_}function lu(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Iu(r)){if(r.type!==pf||r.children===`v-if`){if(n)return;n=r}}else return}return n}function uu(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?du(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(fu(o,r,n)&&!su(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||du(r,o,l):!!o;return!1}function du(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(!Eo(e,a)||fu(t,e,a)&&!su(n,a))return!0}return!1}function fu(e,t,n){let r=e[n],i=t[n];return n===`style`&&No(r)&&No(i)?!ho(r,i):r!==i}function pu({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)}function mu(e,t,n,r=!1){let i={},a=Zd();e.propsDefaults=Object.create(null),gu(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Gs(i):e.type.props?i:a,e.attrs=a}function hu(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Qs(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(su(e.emitsOptions,o))continue;let u=t[o];if(c){if(Eo(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Wo(o);i[t]=_u(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{gu(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(Eo(t,a)||(r=Ko(a))!==a&&Eo(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=_u(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&Eo(t,e)||(delete a[e],l=!0)}l&&Os(e.attrs,`set`,``)}function gu(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(Bo(c))continue;let l=t[c],u;i&&Eo(i,u=Wo(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:su(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=Qs(n),r=s||_o;for(let o=0;o<a.length;o++){let s=a[o];n[s]=_u(i,t,s,r[s],e,!Eo(r,s))}}return o}function _u(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=Eo(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&Ao(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Df(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===Ko(n))&&(r=!0))}return r}function vu(e,t,n=!1){let r=t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[];if(!a)return No(e)&&r.set(e,vo),vo;if(V(a))for(let e=0;e<a.length;e++){let t=Wo(a[e]);yu(t)&&(o[t]=_o)}else if(a)for(let e in a){let t=Wo(e);if(yu(t)){let n=a[e],r=o[t]=V(n)||Ao(n)?{type:n}:Co({},n),i=r.type,c=!1,l=!0;if(V(i))for(let e=0;e<i.length;++e){let t=i[e],n=Ao(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=Ao(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||Eo(r,`default`))&&s.push(t)}}let c=[o,s];return No(e)&&r.set(e,c),c}function yu(e){return e[0]!==`$`&&!Bo(e)}function bu(e){return xu(e)}function xu(e,t){let n=es();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=yo,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Lu(e,t)&&(r=ie(e),I(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===vo&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case ff:g(e,t,n,r);break;case pf:_(e,t,n,r);break;case mf:e??v(t,n,r,o);break;case df:O(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?k(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ae)}u!=null&&i?Il(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Il(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,Su(e,c),l,d),_&&_l(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!Bo(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Ju(p,i,e)}_&&_l(e,null,i,`beforeMount`);let v=wu(s,g);v?g.beforeEnter(f):g&&!g.persisted&&(f[uf]=!0),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&cf(()=>{try{p&&Ju(p,i,e),v&&g.enter(f),_&&_l(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||lf(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Gu(e[l]):Wu(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||_o,m=t.props||_o,h;if(n&&Cu(n,!1),(h=m.onVnodeBeforeUpdate)&&Ju(h,n,t,e),f&&_l(t,e,n,`beforeUpdate`),n&&Cu(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,Su(t,i),o):s||N(e,t,c,null,n,r,Su(t,i),o,!1),l>0){if(l&16)D(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&D(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&cf(()=>{h&&Ju(h,n,t,e),f&&_l(t,e,n,`updated`)},r)},E=(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||ku(c),f=u&&(c.type===df||!Lu(c,l)||c.shapeFlag&198)?d(u):n;h(c,l,f,null,r,i,a,o,!0)}},D=(e,t,n,r,i)=>{if(t!==n){if(t!==_o)for(let o in t)!Bo(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(Bo(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},O=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Tu(e,t,!0)):N(e,t,n,f,a,o,c,l,u)},k=(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):A(t,n,r,i,a,o,c):ee(e,t,c)},A=(e,t,n,r,i,a,o)=>{let s=e.component=Xu(e,r,i);if(Md(e)&&(s.ctx.renderer=ae),Qu(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,j,o,a),!e.el){let r=s.subTree=bf(pf);_(null,r,t,n),e.placeholder=r.el}}else j(s,e,t,n,i,a,o)},ee=(e,t,n)=>{let r=t.component=e.component;if(uu(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,M(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},j=(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=Du(e);if(n){t&&(t.el=c.el,M(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?cf(t,i):l())};t.flags=48,cf(t,i)});return}}let u=t,f;Cu(e,!1),t?(t.el=c.el,M(e,t,o)):t=c,n&&Xo(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&Ju(f,s,t,c),Cu(e,!0);let p=cu(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el||ku(m)),ie(m),e,i,a),t.el=p.el,u===null&&pu(e,p.el),r&&cf(r,i),(f=t.props&&t.props.onVnodeUpdated)&&cf(()=>Ju(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=jd(t);if(Cu(e,!1),l&&Xo(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Ju(o,d,t),Cu(e,!0),s&&se){let t=()=>{e.subTree=cu(e),se(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=cu(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&cf(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;cf(()=>Ju(o,d,e),i)}(t.shapeFlag&256||d&&jd(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&cf(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new mc(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=()=>cl(u),Cu(e,!0),l()},M=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,hu(e,t.props,r,n),sf(e,t.children,n),Cs(),dl(e),ws()},N=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){P(l,f,n,r,i,a,o,s,c);return}if(p&256){te(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&R(l,i,a),f!==l&&u(n,f)):d&16?m&16?P(l,f,n,r,i,a,o,s,c):R(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},te=(e,t,n,r,i,a,o,s,c)=>{e||=vo,t||=vo;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?Gu(t[f]):Wu(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?R(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},P=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Gu(t[l]):Wu(t[l]);if(Lu(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Gu(t[f]):Wu(t[f]);if(Lu(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?Gu(t[l]):Wu(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)I(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?Gu(t[l]):Wu(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){I(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&Lu(r,t[_])){u=_;break}u===void 0?I(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?Eu(S):vo;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||ku(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?F(d,n,p,2):_--)}}},F=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)F(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,ae);else if(c===df){r(s,t,n);for(let e=0;e<u.length;e++)F(u[e],t,n,a);r(e.anchor,t,n)}else if(c===mf)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[kd]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),cf(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[kd];s._isLeaving&&s[kd](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},I=(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&&(Cs(),Il(s,null,n,e,!0),ws()),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=!jd(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Ju(_,t,e),u&6)L(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&_l(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ae,r):l&&!l.hasOnce&&(a!==df||d>0&&d&64)?R(l,t,n,!1,!0):(a===df&&d&384||!i&&u&16)&&R(c,t,n),r&&ne(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&cf(()=>{_&&Ju(_,t,e),h&&_l(e,null,t,`unmounted`),v&&(e.el=null)},n)},ne=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===df;if(o&&!a){re(n,r);return}if(t===mf){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?jl(e):e,c=()=>{o?d(n)&&re(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},re=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},L=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Ou(c),Ou(l),r&&Xo(r),i.stop(),a?(a.flags|=8,I(o,e,t,n)):o&&(o.transition=e.vnode.transition,I(o,e,t,n)),s&&cf(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,cf(u,t)},R=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)I(e[o],t,n,r,i)},ie=e=>{if(e.shapeFlag&6)return ie(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[bd];return n?f(n):t},z=(e,t,n)=>{pl(()=>{e==null?t._vnode&&I(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:Yu())},ae={p:h,um:I,m:F,r:ne,mt:A,mc:w,pc:N,pbc:E,n:ie,o:e},oe,se;return t&&([oe,se]=t(ae)),{render:z,hydrate:oe,createApp:ru(z,oe)}}function Su({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 Cu({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Tu(e,t,n=!1){let r=e.children,i=t.children;if(V(r)&&V(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]=Gu(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Tu(t,a)),a.type===ff&&(a.patchFlag===-1&&(a=i[e]=Gu(a)),a.el=t.el),a.type===pf&&!a.el&&(a.el=t.el)}}function Eu(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 Du(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Du(t)}function Ou(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ku(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return ku(t.subTree);let n=e.suspense;return n&&n.activeBranch?ku(n.activeBranch):null}function Au(e,t){t&&t.pendingBranch?V(e)?t.effects.push(...e):t.effects.push(e):ul(e)}function K(e=!1){hf.push(gf=e?null:[])}function ju(){hf.pop(),gf=hf[hf.length-1]||null}function Mu(e,t=!1){_f+=e,e<0&&gf&&t&&(gf.hasOnce=!0)}function Nu(e){return e.dynamicChildren=_f>0?gf||vo:null,ju(),_f>0&&gf&&gf.push(e),e}function Pu(e,t,n,r,i,a){return Nu(Ru(e,t,n,r,i,a,!0))}function Fu(e,t,n,r,i){return Nu(bf(e,t,n,r,i,!0))}function Iu(e){return e?e.__v_isVNode===!0:!1}function Lu(e,t){return e.type===t.type&&e.key===t.key}function Ru(e,t=null,n=null,r=0,i=null,a=e===df?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vf(t),ref:t&&yf(t),scopeId:gd,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:hd};return s?(Ku(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=jo(n)?8:16),_f>0&&!o&&gf&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&gf.push(c),c}function zu(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Bd||(e=pf),Iu(e)){let r=Vu(e,t,!0);return n&&Ku(r,n),_f>0&&!a&&gf&&(r.shapeFlag&6?gf[gf.indexOf(e)]=r:gf.push(r)),r.patchFlag=-2,r}if(ad(e)&&(e=e.__vccOpts),t){t=Bu(t);let{class:e,style:n}=t;e&&!jo(e)&&(t.class=so(e)),No(n)&&(Zs(n)&&!V(n)&&(n=Co({},n)),t.style=ao(n))}let o=jo(e)?1:lf(e)?128:xd(e)?64:No(e)?4:Ao(e)?2:0;return Ru(e,t,n,r,i,o,a,!0)}function Bu(e){return e?Zs(e)?Co({},e):Qd(e)?Co({},e[Mf]||e):e:null}function Vu(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?qu(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&vf(l),ref:t&&t.ref?n&&a?V(a)?a.concat(yf(t)):[a,yf(t)]:yf(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!==df?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&&Vu(e.ssContent),ssFallback:e.ssFallback&&Vu(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Al(u,c.clone(u)),u}function Hu(e=` `,t=0){return bf(ff,null,e,t)}function Uu(e=``,t=!1){return t?(K(),Fu(pf,null,e)):bf(pf,null,e)}function Wu(e){return e==null||typeof e==`boolean`?bf(pf):V(e)?bf(df,null,e.slice()):Iu(e)?Gu(e):bf(ff,null,String(e))}function Gu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vu(e)}function Ku(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(V(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ku(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Qd(t)?t._ctx=hd:r===3&&hd&&(hd.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(Ao(t)){if(r&65){Ku(e,{default:t});return}t={default:t,_ctx:hd},n=32}else t=String(t),r&64?(n=16,t=[Hu(t)]):n=8;e.children=t,e.shapeFlag|=n}function qu(...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=so([t.class,r.class]));else if(e===`style`)t.style=ao([t.style,r.style]);else if(xo(e)){let n=t[e],i=r[e];i&&n!==i&&!(V(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!So(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Ju(e,t,n,r=null){rl(e,t,7,[n,r])}function Yu(){return Sf}function Xu(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||xf,a={uid:Sf++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:vu(r,i),emitsOptions:ou(r,i),emit:null,emitted:null,propsDefaults:_o,inheritAttrs:r.inheritAttrs,ctx:_o,data:_o,props:_o,attrs:_o,slots:_o,refs:_o,setupState:_o,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=au.bind(null,a),e.ce&&e.ce(a),a}function Zu(e){return e.vnode.shapeFlag&4}function Qu(e,t=!1,n=!1){t&&Ef(t);let{props:r,children:i}=e.vnode,a=Zu(e);mu(e,r,a,t),of(e,i,n||t);let o=a?$u(e,t):void 0;return t&&Ef(!1),o}function $u(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Wd);let{setup:r}=n;if(r){Cs();let n=e.setupContext=r.length>1?nd(e):null,i=Df(e),a=nl(r,e,0,[e.props,n]),o=Po(a);if(ws(),i(),(o||e.sp)&&!jd(e)&&Nl(e),o){if(a.then(Of,Of),t)return a.then(n=>{Ef(!0);try{ed(e,n,t)}finally{Ef(!1)}}).catch(t=>{il(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(`<!---->`)});e.asyncDep=a}else ed(e,a,t)}else td(e,t)}function ed(e,t,n){Ao(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:No(t)&&(e.setupState=ic(t)),td(e,n)}function td(e,t,n){let r=e.type;if(!e.render){if(!t&&Af&&!r.render){let t=r.template||!1;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Af(t,Co(Co({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||yo,jf&&jf(e)}}function nd(e){return{attrs:new Proxy(e.attrs,Nf),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function rd(e){return e.exposed?e.exposeProxy||=new Proxy(ic($s(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Hd)return Hd[n](e)},has(e,t){return t in e||t in Hd}}):e.proxy}function id(e,t=!0){return Ao(e)?e.displayName||e.name:e.name||t&&e.__name}function ad(e){return Ao(e)&&`__vccOpts`in e}function q(e,t,n){try{Mu(-1);let r=arguments.length;return r===2?No(t)&&!V(t)?Iu(t)?bf(e,null,[t]):bf(e,t):bf(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Iu(n)&&(n=[n]),bf(e,t,n))}finally{Mu(1)}}var od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,J,Pf,Ff=t((()=>{tl(),us(),od=[],sd=-1,cd=[],ld=null,ud=0,dd=Promise.resolve(),fd=null,pd=!1,md=e=>e.id==null?e.flags&2?-1:1/0:e.id,hd=null,gd=null,_d=Symbol.for(`v-scx`),vd=()=>yl(_d),yd=new WeakMap,bd=Symbol(`_vte`),xd=e=>e.__isTeleport,Sd=e=>e&&(e.disabled||e.disabled===``),Cd=e=>e&&(e.defer||e.defer===``),wd=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Td=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Ed=(e,t)=>{let n=e&&e.to;return jo(n)?t?t(n):null:n},Dd={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Sd(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Sd(e.props),r=e.target=Ed(e.props,m),a=Dl(r,e,h,p);r&&(o!==`svg`&&wd(r)?o=`svg`:o!==`mathml`&&Td(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),El(e,!1)))},S=e=>{let t=()=>{if(yd.get(e)===t){if(yd.delete(e),Sd(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),El(e,!0)}x(e)}};yd.set(e,t),cf(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Cd(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),El(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=yd.get(e);if(u){u.flags|=8,yd.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Sd(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||wd(p)?o=`svg`:(o===`mathml`||Td(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Tu(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):wl(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Ed(t.props,m);e&&(t.target=e,wl(t,e,null,l,0))}else g&&wl(t,p,h,l,1);El(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Sd(f),m=a||!p,h=yd.get(e);if(h&&(h.flags|=8,yd.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:wl,hydrate:Tl},Od=Dd,kd=Symbol(`_leaveCb`),Ad=new WeakMap,es().requestIdleCallback,es().cancelIdleCallback,jd=e=>!!e.type.__asyncLoader,Md=e=>e.type.__isKeepAlive,Nd=e=>(t,n=Cf)=>{kf&&e!==`sp`||Hl(e,(...e)=>t(...e),n)},Nd(`bm`),Pd=Nd(`m`),Fd=Nd(`bu`),Id=Nd(`u`),Ld=Nd(`bum`),Rd=Nd(`um`),Nd(`sp`),Nd(`rtg`),Nd(`rtc`),zd=`components`,Bd=Symbol.for(`v-ndc`),Vd=e=>e?Zu(e)?rd(e):Vd(e.parent):null,Hd=Co(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=>Vd(e.parent),$root:e=>Vd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||=()=>{cl(e.update)},$nextTick:e=>e.n||=ol.bind(e.proxy),$watch:e=>yo}),Ud=(e,t)=>e!==_o&&!e.__isScriptSetup&&Eo(e,t),Wd={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ud(r,t))return o[t]=1,r[t];else if(Eo(a,t))return o[t]=3,a[t];else if(n!==_o&&Eo(n,t))return o[t]=4,n[t];else o[t]=0}let l=Hd[t],u,d;if(l)return t===`$attrs`&&Ds(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==_o&&Eo(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,Eo(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ud(i,t)?(i[t]=n,!0):Eo(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||Ud(t,s)||Eo(a,s)||Eo(r,s)||Eo(Hd,s)||Eo(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?Eo(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Gd=0,Kd=null,qd=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Wo(t)}Modifiers`]||e[`${Ko(t)}Modifiers`],Jd=e=>{let t;for(let n in e)(n===`class`||n===`style`||xo(n))&&((t||={})[n]=e[n]);return t},Yd=(e,t)=>{let n={};for(let r in e)So(r)&&r.slice(9)in t||(n[r]=e[r]);return n},Xd={},Zd=()=>Object.create(Xd),Qd=e=>Object.getPrototypeOf(e)===Xd,$d=e=>e===`_`||e===`_ctx`||e===`$stable`,ef=e=>V(e)?e.map(Wu):[Wu(e)],tf=(e,t,n)=>{if(t._n)return t;let r=gl((...e)=>ef(t(...e)),n);return r._c=!1,r},nf=(e,t,n)=>{let r=e._ctx;for(let n in e){if($d(n))continue;let i=e[n];if(Ao(i))t[n]=tf(n,i,r);else if(i!=null){let e=ef(i);t[n]=()=>e}}},rf=(e,t)=>{let n=ef(t);e.slots.default=()=>n},af=(e,t,n)=>{for(let r in t)(n||!$d(r))&&(e[r]=t[r])},of=(e,t,n)=>{let r=e.slots=Zd();if(e.vnode.shapeFlag&32){let e=t._;e?(af(r,t,n),n&&Zo(r,`_`,e,!0)):nf(t,r)}else t&&rf(e,t)},sf=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=_o;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:af(i,t,n):(a=!t.$stable,nf(t,i)),o=t}else t&&(rf(e,t),o={default:1});if(a)for(let e in i)!$d(e)&&o[e]==null&&delete i[e]},cf=Au,lf=e=>e.__isSuspense,uf=Symbol(`_deferredEnter`),df=Symbol.for(`v-fgt`),ff=Symbol.for(`v-txt`),pf=Symbol.for(`v-cmt`),mf=Symbol.for(`v-stc`),hf=[],gf=null,_f=1,vf=({key:e})=>e??null,yf=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:jo(e)||ec(e)||Ao(e)?{i:hd,r:e,k:t,f:!!n}:e),bf=zu,xf=nu(),Sf=0,Cf=null,wf=()=>Cf||hd;{let e=es(),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)}};Tf=t(`__VUE_INSTANCE_SETTERS__`,e=>Cf=e),Ef=t(`__VUE_SSR_SETTERS__`,e=>kf=e)}Df=e=>{let t=Cf;return Tf(e),e.scope.on(),()=>{e.scope.off(),Tf(t)}},Of=()=>{Cf&&Cf.scope.off(),Tf(null)},kf=!1,Mf=Symbol(),Nf={get(e,t){return Ds(e,`get`,``),t===Mf?e:e[t]}},J=(e,t)=>oc(e,t,kf),Pf=`3.5.46`}));function If(e,t,n){let r=e[sp];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function Lf(e,t,n){let r=e.style,i=jo(n),a=!1;if(n&&!i){if(t){if(jo(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Rf(r,t,``)}else for(let e in t)n[e]??Rf(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Rf(r,i,``):Bf(e,i,!jo(t)&&t?t[i]:void 0,o)||Rf(r,i,o)}}else if(i){if(t!==n){let e=r[up];e&&(n+=`;`+e),r.cssText=n,a=dp.test(n)}}else t&&e.removeAttribute(`style`);cp in e&&(i&&t===n||(e[cp]=a?r.display:``),e[lp]&&(r.display=`none`))}function Rf(e,t,n){if(V(n))n.forEach(n=>Rf(e,t,n));else if(n??=``,t.startsWith(`--`))fp.test(n)?e.setProperty(t,n.replace(fp,``),`important`):e.setProperty(t,n);else{let r=zf(e,t);fp.test(n)?e.setProperty(Ko(r),n.replace(fp,``),`important`):e[r]=n}}function zf(e,t){let n=mp[t];if(n)return n;let r=Wo(t);if(r!==`filter`&&r in e)return mp[t]=r;r=qo(r);for(let n=0;n<pp.length;n++){let i=pp[n]+r;if(i in e)return mp[t]=i}return t}function Bf(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&jo(r)&&n===r}function Vf(e,t,n,r,i,a=as(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(hp,t.slice(6,t.length)):e.setAttributeNS(hp,t,n):n==null||a&&!lo(n)?e.removeAttribute(t):e.setAttribute(t,a?``:Mo(n)?String(n):n)}function Hf(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?tp(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=lo(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 Uf(e,t,n,r){e.addEventListener(t,n,r)}function Wf(e,t,n,r){e.removeEventListener(t,n,r)}function Gf(e,t,n,r,i=null){let a=e[gp]||(e[gp]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Kf(t);r?Uf(e,n,a[t]=qf(r,i),s):o&&(Wf(e,n,o,s),a[t]=void 0)}}function Kf(e){let t,n;for(;(n=e.match(_p))&&!vp.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Ko(e.slice(2)),t]}function qf(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(V(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&&rl(e,t,5,a)}}else rl(r,t,5,[e])};return n.value=e,n.attached=xp(),n}function Jf(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Sp(t)&&Ao(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 Sp(t)&&jo(n)?!1:t in e}function Yf(e,t){let n=e._def.props;if(!n)return!1;let r=Wo(t);return Array.isArray(n)?n.some(e=>Wo(e)===r):Object.keys(n).some(e=>Wo(e)===r)}function Xf(){return Op||=bu(Dp)}function Zf(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Qf(e){return jo(e)?document.querySelector(e):e}var $f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap=t((()=>{if(Ff(),Ff(),us(),$f=void 0,ep=typeof window<`u`&&window.trustedTypes,ep)try{$f=ep.createPolicy(`vue`,{createHTML:e=>e})}catch{}tp=$f?e=>$f.createHTML(e):e=>e,np=`http://www.w3.org/2000/svg`,rp=`http://www.w3.org/1998/Math/MathML`,ip=typeof document<`u`?document:null,ap=ip&&ip.createElement(`template`),op={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`?ip.createElementNS(np,e):t===`mathml`?ip.createElementNS(rp,e):n?ip.createElement(e,{is:n}):ip.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ip.createTextNode(e),createComment:e=>ip.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ip.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{ap.innerHTML=tp(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ap.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]}},sp=Symbol(`_vtc`),cp=Symbol(`_vod`),lp=Symbol(`_vsh`),up=Symbol(``),dp=/(?:^|;)\s*display\s*:/,fp=/\s*!important$/,pp=[`Webkit`,`Moz`,`ms`],mp={},hp=`http://www.w3.org/1999/xlink`,gp=Symbol(`_vei`),_p=/(Once|Passive|Capture)$/,vp=/^on:?(?:Once|Passive|Capture)$/,yp=0,bp=Promise.resolve(),xp=()=>yp||=(bp.then(()=>yp=0),Date.now()),Sp=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Cp=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?If(e,r,o):t===`style`?Lf(e,n,r):xo(t)?So(t)||Gf(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Jf(e,t,r,o))?(Hf(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Vf(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Yf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!jo(r)))?Hf(e,Wo(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Vf(e,t,r,o))},wp=[`ctrl`,`shift`,`alt`,`meta`],Tp={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)=>wp.some(n=>e[`${n}Key`]&&!t.includes(n))},Ep=(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=Tp[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Dp=Co({patchProp:Cp},op),kp=((...e)=>{let t=Xf().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Qf(e);if(!r)return;let i=t._component;Ao(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Zf(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t})})),Y=t((()=>{Ap()}));function jp(){let e=e=>{e.stopPropagation(),e.preventDefault(),t()},t=()=>{document.removeEventListener(`click`,e,!0),document.removeEventListener(`pointerdown`,t,!0)};document.addEventListener(`click`,e,!0),document.addEventListener(`pointerdown`,t,!0)}function Mp(e){Pd(()=>document.addEventListener(`pointerdown`,e,!0)),Ld(()=>document.removeEventListener(`pointerdown`,e,!0))}function Np(e=document,t){return[...e.querySelectorAll(Rp)].some(e=>!t||!e.matches(t))}function Pp(e=document,t=!1){let n=[...e.querySelectorAll(Rp)];for(let e of n)e.dispatchEvent(new CustomEvent(Lp,{detail:{escape:t}}));return n.length>0}var Fp,Ip,Lp,Rp,zp,Bp=t((()=>{Y(),Fp=Symbol(`comment-thread-portals`),Ip=new WeakSet,Lp=`comments:shake`,Rp=`[data-slot='comment-composer'][data-dirty='true']`,zp=e=>e.composedPath().filter(e=>e instanceof Element)}));function Vp(e){let t;return{listen(e){let t=()=>e(`online`),n=()=>e(`offline`),r=()=>e(document.visibilityState===`hidden`?`hidden`:`visible`);return window.addEventListener(`online`,t),window.addEventListener(`offline`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n),document.removeEventListener(`visibilitychange`,r)}},isVisible:()=>document.visibilityState!==`hidden`,isOnline:()=>navigator.onLine!==!1,lock(e,t){let n=navigator.locks;return n?n.request(e,t):t()},lead(e,t){let n=new AbortController,r=()=>n.signal.aborted?Promise.resolve():t(n.signal),i=navigator.locks;return i?i.request(e,{signal:n.signal},r).catch(()=>void 0):r(),()=>n.abort()},post(n){t?t.postMessage(n):Hp(e.channel,n)},receive(n){if(typeof BroadcastChannel!=`function`)return()=>void 0;let r=new BroadcastChannel(e.channel);return t=r,r.onmessage=t=>{e.isMessage(t.data)&&n(t.data)},()=>{r.close(),t===r&&(t=void 0)}},schedule(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)},random:Math.random}}function Hp(e,t){if(typeof BroadcastChannel!=`function`)return;let n=new BroadcastChannel(e);n.postMessage(t),n.close()}function Up(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Wp(e,t){let n=Math.min(3e4,1e3*2**e);return n/2+t*n/2}var Gp=t((()=>{}));async function Kp(e,t){let n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify([e,t]))));return`message_${Array.from(n.subarray(0,16),e=>e.toString(16).padStart(2,`0`)).join(``)}`}var qp=t((()=>{}));function Jp(e){return e.status!==`sending`&&!e.uncertain}function Yp(e){if(!e||typeof e!=`object`)return!1;let t=Reflect.get(e,`type`);if(typeof Reflect.get(e,`account`)!=`string`)return!1;if(t===`change`)return!0;let n=Reflect.get(e,`kind`);return t===`sent`&&(n===`create`||n===`reply`)&&typeof Reflect.get(e,`id`)==`string`&&typeof Reflect.get(e,`key`)==`string`&&!!Reflect.get(e,`thread`)}function Xp(e){let t=JSON.parse(JSON.stringify(e.input)),n=e.kind===`reply`&&e.subject?{kind:e.subject.kind,id:e.subject.id}:void 0;return{...e,input:t,files:[...e.files],...n?{subject:n}:{},...e.uploaded?{uploaded:[...e.uploaded]}:{},...e.error?{error:{...e.error}}:{}}}function Zp(e){return e.sort((e,t)=>e.order-t.order)}function Qp(){let e=new Map;return{persisted:!1,async list(t){return Zp([...e.get(t)?.values()??[]].map(Xp))},async update(t,n){let r=new Map([...e.get(t)??[]].map(([e,t])=>[e,Xp(t)])),i=n(r);return e.set(t,new Map([...r].map(([e,t])=>[e,Xp(t)]))),i}}}function $p(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onabort=()=>n(e.error??Error(`The IndexedDB transaction was aborted.`)),e.onerror=()=>n(e.error??Error(`The IndexedDB transaction failed.`))})}function em(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??Error(`The IndexedDB request failed.`))})}function tm(e){return new Promise((t,n)=>{let r=indexedDB.open(e,sm);r.onupgradeneeded=e=>{let t=r.result.createObjectStore(`drafts`,{keyPath:[`account`,`id`]});if(t.createIndex(`account`,`account`),e.oldVersion===1&&r.transaction){let e=r.transaction.objectStore(`outbox`).openCursor();e.onsuccess=()=>{let n=e.result;if(!n){r.result.deleteObjectStore(`outbox`);return}let i=n.value;t.put({...i,id:i.requestId,uncertain:!0}),n.continue()}}},r.onsuccess=()=>{let e=r.result;e.onversionchange=()=>e.close(),t(e)},r.onerror=()=>n(r.error??Error(`IndexedDB did not open.`)),r.onblocked=()=>n(Error(`IndexedDB is blocked by another tab.`))})}function nm(e){let t,n=typeof indexedDB<`u`,r=()=>t??=(n?tm(e):Promise.reject(Error(`No IndexedDB.`))).then(e=>({database:e}),()=>(n=!1,{memory:Qp()})),i=async(e,t)=>{let n=await r();return`database`in n?t(n.database):e(n.memory)};return{get persisted(){return n},list:e=>i(t=>t.list(e),async t=>Zp(await em(t.transaction(`drafts`,`readonly`).objectStore(`drafts`).index(`account`).getAll(e)))),update:(e,t)=>i(n=>n.update(e,t),async n=>{let r=n.transaction(`drafts`,`readwrite`),i=r.objectStore(`drafts`),a=i.index(`account`).getAll(e),o=$p(r),s=new Promise((n,o)=>{a.onsuccess=()=>{let s=new Map(a.result.map(e=>[e.id,e])),c=new Map(s);try{let r=t(c);for(let t of s.keys())c.has(t)||i.delete([e,t]);for(let[e,t]of c)s.get(e)!==t&&i.put(Xp(t));n(r)}catch(e){o(e),r.abort()}},a.onerror=()=>o(a.error)});return(await Promise.all([s,o]))[0]})}}function rm(e){let t=t=>e&&typeof e==`object`?Reflect.get(e,t):void 0,n=t(`status`),r=t(`code`),i=t(`why`)??t(`message`),a=t(`fix`),o=t(`retryAfter`);return{status:typeof n==`number`?n:0,why:typeof i==`string`&&i?i:String(e),...typeof r==`string`?{code:r}:{},...typeof a==`string`?{fix:a}:{},...typeof o==`number`&&o>=0?{retryAfter:o}:{}}}function im(e){return e===401||e===402?`hold`:e===408||e===429?`wait`:e>=400&&e<500?`fail`:`wait`}function am(e,t){let{account:n,namespace:r}=e,i=r===void 0?om:`${om}:${JSON.stringify(r)}`,a=!!(e.environment||globalThis.navigator?.locks),o=!(!e.store||a),s=e.store??(a?nm(i):Qp()),c=e.environment??Vp({channel:i,isMessage:Yp}),l=r===void 0?n:JSON.stringify([r,n]),u=e.store?l:n,d=`vitehub-comments-outbox:${l}`,f=e=>`vitehub-comments-files:${l}:${e}`,p=[],m=[],h=new Map,g=new Map,_=new Map,v=new Map,y=e=>v.get(e)??e,b=new Set,x=()=>{for(let e of b)e()},S=new Set,C=0,w=new Map,T=new Map,E=e=>e.kind===`create`?JSON.stringify([e.kind,e.input.subject.kind,e.input.subject.id,e.requestId]):JSON.stringify([e.kind,e.input.threadId,e.requestId]),D=(e,t)=>JSON.stringify([e,t]),O=new Map,k=Promise.resolve(),A,ee=!1,j=!1,M,N=e=>c.post(e),te=()=>k=k.catch(()=>void 0).then(async()=>{let e=[...h].flatMap(([e,t])=>t.saved?[e]:[]),t=await s.list(u),n=new Map;globalThis.crypto?.subtle&&await Promise.all(t.map(async e=>{if(e.kind!==`reply`)return;let t=R(e.input.threadId),r=D(t,e.requestId);n.set(r,O.get(r)??await Kp(t,e.requestId))})),O=n,m=t;for(let t of e)h.delete(t);P()}),P=()=>{let e=new Set(m.map(e=>e.id));p=Zp([...m,...[...h.values()].flatMap(t=>e.has(t.entry.id)||t.duplicate?[]:[t.entry])]).map(e=>{let t=_.get(e.id);return t?{...e,status:`failed`,files:[...e.files,...t.files],error:t.error}:e}),ne(!s.persisted&&p.length>0||_.size>0||[...h.values()].some(e=>!e.saved)),t.changed(),x()},F=!1,I=e=>{e.preventDefault(),Reflect.set(e,`returnValue`,``)},ne=e=>{e!==F&&typeof globalThis.addEventListener==`function`&&(F=e,e?globalThis.addEventListener(`beforeunload`,I):globalThis.removeEventListener(`beforeunload`,I))},re=async()=>{await te(),N({type:`change`,account:l})},L=e=>{for(let n of t.threads())if(n.id===e)return n},R=e=>{let t=y(e);return w.get(t)?.id??t},ie=e=>({status:e.status===`failed`?`failed`:`pending`,requestId:e.requestId,files:e.files,...e.error?{error:e.error}:{}}),z=()=>t.user?.id===n?t.user:{id:n},ae=(e,t)=>({id:e.id,threadId:t,body:e.input.body,author:z(),mentions:e.input.mentions??[],attachments:e.input.attachments??[],createdAt:e.createdAt,delivery:ie(e)}),oe=e=>{let t=new Map;for(let e of p){if(e.kind!==`reply`)continue;let n=R(e.input.threadId);t.set(n,[...t.get(n)??[],e])}let r=e=>{let r=t.get(e.id);if(!r)return e;let i=new Set(e.messages.filter(e=>e.author.id===n).map(e=>e.id)),a=r.filter(t=>{let n=e.delivery?void 0:O.get(D(e.id,t.requestId));return!(n&&i.has(n))}).map(t=>ae(t,e.id));return a.length?{...e,messages:[...e.messages,...a]}:e},i=e.map(r),a=[];for(let t of p)t.kind!==`create`||w.has(t.id)||e.some(e=>se(t,e))||a.push(r(ce(t)));return{server:i,local:a}},se=(e,t)=>t.requestId===e.requestId&&t.author.id===n&&t.subject.kind===e.input.subject.kind&&t.subject.id===e.input.subject.id,ce=e=>{let{input:t}=e;return{id:e.id,scope:``,n:0,subject:t.subject,anchor:t.anchor,status:`open`,author:z(),messages:[ae(e,e.id)],...t.metadata===void 0?{}:{metadata:t.metadata},...t.revision===void 0?{}:{revision:t.revision},createdAt:e.createdAt,updatedAt:e.createdAt,requestId:e.requestId,delivery:ie(e)}},le=e=>{let t=new Set([...e,...[...h.values()].map(e=>e.entry)].flatMap(e=>e.kind===`create`?[e.id]:[]));return e.find(e=>e.status!==`failed`&&!(e.kind===`reply`&&t.has(e.input.threadId)))},ue=e=>[...h.values()].some(t=>!t.saved&&!t.parked&&t.entry.status!==`failed`&&t.entry.order<e),de=e=>new Promise(t=>{e.aborted?t():e.addEventListener(`abort`,()=>t(),{once:!0})}),fe=e=>{M?.(),M=c.schedule(()=>{M=void 0,ge()},e)},pe=e=>s.update(u,e),me=async e=>{let r=t=>pe(n=>{let r=n.get(e.id);if(r&&r.claim===e.claim)return t(r,n)}),i,a=!1,o={account:n,async uploaded(t){if(!await r((n,r)=>r.set(e.id,{...n,uploaded:[...n.uploaded??[],t]})))throw new DOMException(`This draft is no longer in the outbox.`,`AbortError`)}};try{let n={files:e.files.slice(e.uploaded?.length??0),outbox:o},s=[...e.input.attachments??[],...e.uploaded??[]],c={...n,requestId:e.requestId,...s.length?{attachments:s}:{}};if(e.kind===`create`){if(!await r(()=>!0))return;a=!0,i=await t.transport.create({...e.input,...c})}else{let o=R(e.input.threadId),s=e.subject??L(o)?.subject??(n.files?.length?(await t.transport.get({threadId:o}))?.subject:void 0);if(n.files?.length&&!s)throw Object.assign(Error(`The thread for this reply does not exist.`),{status:404});if(!await r(()=>!0))return;a=!0,i=await t.transport.reply({...e.input,...c,threadId:o,...s?{subject:s}:{}})}}catch(t){let n=ia.get(o),i=n!==void 0&&Object.is(n.cause,t),{retryAfter:s,...l}=rm(t),u=im(l.status),d=e.attempts??0;await r((t,n)=>n.set(e.id,{...t,status:u===`fail`?`failed`:`pending`,uncertain:e.uncertain||a&&!i&&u===`wait`&&l.status!==429,held:u===`hold`,retryAt:u===`wait`?Date.now()+Math.max(1,s??Wp(d,c.random())):void 0,attempts:d+1,error:l}))&&await re();return}if(!await r((t,n)=>{if(t.kind===`create`)for(let t of n.values())t.kind===`reply`&&t.input.threadId===e.id&&n.set(t.id,{...t,subject:i.subject,input:{...t.input,threadId:i.id}});return n.delete(e.id)}))return;let s=E(e);e.kind===`create`&&w.set(e.id,i),T.set(s,i),t.upsert(i),await te(),N({type:`sent`,account:l,id:e.id,kind:e.kind,key:s,thread:i})},he=async e=>{for(M?.(),M=void 0;!e.aborted&&c.isOnline();){let t=Up(),n=await pe(n=>{if(e.aborted)return;let r=le(Zp([...n.values()]));if(!r||r.held||ue(r.order))return;if(r.awaitingFiles)return{files:r.id};let i=(r.retryAt??0)-Date.now();if(i>0)return{delay:i};let a={...r,claim:t,status:`sending`,uncertain:r.uncertain||r.status===`sending`};return n.set(r.id,a),{claimed:a}});if(!n)return;if(`delay`in n){fe(n.delay);return}if(`files`in n){if(o||g.has(n.files)||(await Promise.race([c.lock(f(n.files),async()=>void 0),de(e)]),e.aborted))return;await pe(e=>{let t=e.get(n.files);t?.awaitingFiles&&!g.has(t.id)&&e.set(t.id,{...t,awaitingFiles:!1})}),await re()}else await te(),await me(n.claimed)}};function ge(){if(j)return;if(A){ee=!0;return}let e={giveUp:()=>void 0};A=e,e.giveUp=c.lead(d,async t=>{try{do ee=!1,await he(t);while(ee&&!t.aborted)}finally{A===e&&(A=void 0)}})}let _e=e=>{let t=h.get(e);if(!t)return Promise.resolve();let n=Promise.resolve().then(async()=>{t.parked=!1;let r=[t];try{if(await pe(i=>{if(h.get(e)!==t)return!1;t.entry.kind===`reply`&&(t.entry={...t.entry,input:{...t.entry.input,threadId:R(t.entry.input.threadId)}});let a=t.entry.kind===`reply`?h.get(t.entry.input.threadId):void 0;if(a&&!a.saved&&!i.has(a.entry.id))return!0;let o=t.entry.order;for(let e of i.values())S.has(e.id)||(o=Math.max(o,e.order+1));let s=[...h.values()].filter(e=>e!==t&&!i.has(e.entry.id)&&e.entry.order>t.entry.order),c=o;for(let e of s.sort((e,t)=>e.entry.order-t.entry.order))c=Math.max(e.entry.order,c+1),e.entry={...e.entry,order:c};C=Math.max(C,c),t.entry={...t.entry,order:o},r=[t,...[...h.values()].filter(t=>t.parked&&t.entry.kind===`reply`&&t.entry.input.threadId===e)];for(let e of r)e.write??=n;let l=new Map([...i.values()].map(e=>[E(e),e]));for(let e of r){e.entry.kind===`reply`&&(e.entry={...e.entry,input:{...e.entry.input,threadId:R(e.entry.input.threadId)}});let t=E(e.entry),n=l.get(t);n?(e.duplicate=n,v.set(e.entry.id,n.id)):(i.set(e.entry.id,e.entry),l.set(t,e.entry))}return!1})){t.parked=!0;return}}catch(e){t.entry={...t.entry,status:`failed`,error:rm(e)},P(),ge();return}finally{for(let e of r)e.write===n&&(e.write=void 0)}for(let e of r)Object.assign(e,{saved:!0,parked:!1});await re().catch(()=>void 0),ge()});return t.write=n,n},ve=()=>{let e=[...h.values()];if(e.some(e=>e.write))return;let t=e.find(e=>!e.saved&&!e.parked&&e.entry.status===`pending`);t&&!t.entry.awaitingFiles&&_e(t.entry.id).then(ve)},ye=e=>o?(e.parked=!1,ve(),e.write??Promise.resolve()):_e(e.entry.id),be=(e,t)=>{let n=t!==void 0&&!Array.isArray(t),r=Math.max(Date.now(),C+1,...p.map(e=>e.order+1));C=r,S.add(e.id);let i={entry:Xp({...e,order:r,...n?{awaitingFiles:!0}:{}}),saved:!1};return h.set(e.id,i),n&&Se(e.id,Promise.resolve(t)),P(),{local:i,write:ye(i)}},xe=(e,t)=>{let n=p.find(t=>E(t)===E(e));if(!n)return{entry:e,...be(e,t)};let r=h.get(n.id);return{entry:n,local:r,write:r?.write}},Se=(e,t)=>{let n=c.lock(f(e),async()=>{let n=await t.then(e=>[...e],()=>[]),r=h.get(e);await r?.write;let i=e=>({...e,files:[...e.files,...n],awaitingFiles:!1});if(r&&!r.saved)r.entry=i(r.entry),P(),o&&ve();else for(;g.has(e);)try{await pe(t=>{let n=t.get(e);n?.awaitingFiles&&t.set(e,i(n))});break}catch(t){if(!g.has(e))break;let r=new Promise(r=>{_.set(e,{files:n,error:rm(t),resume:r})});P(),await r}}).catch(()=>void 0).then(async()=>{g.delete(e),_.delete(e),await re().catch(()=>void 0),ge()});g.set(e,n)},Ce=async e=>{await h.get(e)?.write;let t=h.get(e);return t&&!t.saved?t:void 0},we=(e,t)=>{let r=Date.now(),i=Up();return{id:i,requestId:e??i,account:n,files:Array.isArray(t)?[...t]:[],createdAt:r,order:r,status:`pending`}};return te(),{get entries(){return p},get queued(){return p.filter(e=>e.status!==`failed`)},get failures(){return p.filter(e=>e.status===`failed`)},get persisted(){return s.persisted},overlay:oe,owns:(e,t)=>p.some(n=>n.id===y(t??e)),async beforeResolve(e){for(await te();;){let t=R(e),n=p.filter(e=>e.id===t||e.kind===`reply`&&R(e.input.threadId)===t);if(!n.length)return t;if(j||!c.isOnline()||n.some(e=>e.held||e.status===`failed`||e.retryAt!==void 0)||p.some(e=>e.held))return;await new Promise(e=>{let t=()=>{b.delete(t),e()};b.add(t)})}},async create({files:e,deferredFiles:n,requestId:r,...i}){let a={...we(r,e),kind:`create`,input:i},o=()=>T.get(E(a))??[...t.threads()].find(e=>se(a,e)),s=o();if(s)return s;let c=xe(a,n??e);if(r!==void 0){await c.write;let e=o();if(e)return e}let l=c.local?.duplicate??p.find(e=>e.id===c.entry.id)??c.entry;return ce(l.kind===`create`?l:a)},async reply({files:e,deferredFiles:t,requestId:n,subject:r,...i}){let a=R(i.threadId),o=p.find(e=>e.kind===`create`&&e.id===a),s=L(a),c=r??s?.subject??(o?.kind===`create`?o.input.subject:void 0),l={...we(n,e),kind:`reply`,input:{...i,threadId:a},...c?{subject:c}:{}},u=T.get(E(l));if(u)return L(u.id)??u;let d=xe(l,t??e);n!==void 0&&await d.write;let f=d.local?.duplicate??d.local?.entry??d.entry,m=T.get(E(f));if(m)return L(m.id)??m;let h=R(a),g=L(h)??s;return g?oe([g]).server[0]??g:oe([]).local.find(e=>e.id===h)||{id:h,scope:``,n:0,subject:c??{kind:``,id:``},anchor:{kind:`page`},status:`open`,author:z(),messages:[ae(f,h)],createdAt:l.createdAt,updatedAt:l.createdAt}},async retry(e){if(e!==void 0){e=y(e);let t=_.get(e);if(t){t.resume();return}}let t=e===void 0?void 0:await Ce(e);t?(t.entry={...t.entry,status:`pending`,error:void 0},P(),await ye(t)):(await pe(t=>{for(let n of t.values())n.status===`sending`||e!==void 0&&n.id!==e||(n.status!==`failed`||e!==void 0)&&t.set(n.id,{...n,status:`pending`,held:!1,attempts:0,retryAt:void 0,error:void 0})}),await re(),ge())},async dismiss(e){if(e=y(e),await Ce(e)){for(let[t,n]of h)(t===e||n.entry.kind===`reply`&&n.entry.input.threadId===e)&&h.delete(t);return await pe(t=>{for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id)}),await re(),o&&ve(),ge(),!0}let t=await pe(t=>{let n=t.get(e);if(!n||!Jp(n))return!1;if(n.kind===`create`)for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id);return t.delete(e)});return t&&(g.delete(e),_.get(e)?.resume(),await re(),ge()),t},async edit(e,t,n){e=y(e);let r=await Ce(e);if(r){let e={...r.entry.input,body:t,...n?{mentions:n}:{}};return r.entry={...r.entry,input:e,status:`pending`,error:void 0},P(),await ye(r),!0}let i=await pe(r=>{let i=r.get(e);if(!i||!Jp(i))return!1;let a={body:t,...n?{mentions:n}:{}};return i.kind,r.set(e,{...i,input:{...i.input,...a},status:`pending`,error:void 0}),!0});return i&&(await re(),ge()),i},async clear(){M?.(),M=void 0,h.clear(),await pe(e=>e.clear()),g.clear();for(let e of _.values())e.resume();_.clear(),v.clear(),w.clear(),T.clear(),await re()},start(){j=!1;let e=[c.listen(e=>{e===`offline`&&x(),(e===`online`||e===`visible`)&&pe(e=>{for(let t of e.values())t.status===`pending`&&t.retryAt!==void 0&&e.set(t.id,{...t,retryAt:void 0})}).then(re).then(ge)}),c.receive(e=>{e.account===l&&(e.type===`sent`&&(e.kind===`create`&&w.set(e.id,e.thread),T.set(e.key,e.thread),t.upsert(e.thread)),te())})];return te(),ge(),()=>{for(let t of e.splice(0))t();j=!0,x(),M?.(),M=void 0,A?.giveUp(),A=void 0}}}}var om,sm,cm=t((()=>{Gp(),aa(),qp(),om=`vitehub-comments`,sm=2}));function lm(e,t,n,{thread:r,message:i}){if(!e)return!1;let a=r.can??{comment:!!t?.comment,resolve:!!t?.resolve,delete:!!t?.delete};if(n===`reply`)return r.status===`open`&&a.comment;if(n===`resolve`)return a.resolve;let o=t=>!e.guest&&!t.author.guest&&t.author.id===e.id;return!i||t?.change===!1?!1:n===`edit`?o(i):(r.messages[0]?.id===i.id?r.messages.every(o):o(i))?a.comment:a.delete===!0&&!e.guest}function um(){let e=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__;return e.startsWith(`/`)&&!e.startsWith(`//`)?e.replace(/\/+$/,``):``}var dm=t((()=>{}));function fm(e){return e&&Cm.test(e)?e:void 0}function pm(e,t){return e.length>t?`${e.slice(0,t).trimEnd()}…`:e}function mm(e,t){return e.kind===`page`?`on the whole page`:e.kind===`text`?`on the text "${pm(e.exact,t)}" in ${pm(e.selector,t)}`:`on ${pm(e.selector,t)}`}function hm(e,t){let[n,...r]=e.messages,i=e.revision===void 0?``:` (version ${e.revision})`;return[`"${pm(n?.body??``,t)}" — ${n?.author??`Someone`}, ${mm(e.anchor,t)}${i}`,...r.map(e=>`Reply: "${pm(e.body,t)}" — ${e.author}`),...e.files?.length?[`Files: ${e.files.join(` `)}`]:[]]}function gm(e,t){if(!e)return[`When you are done, tell me what you changed.`];let{mcp:n,project:r,resolve:i}=e,a=`operation "comments.get", and input { threadId } for ${t.length===1?`thread ${t[0]}`:`each ID in ${JSON.stringify(t)}`}`;return[`In the ViteHub MCP (${n}), use list_apps to verify team ${r.teamId} and app ${r.url} (id: ${r.id}). If the team is different, ask me to switch to that team in the Console; if the app is missing, ask me to check the link. Only after both match, call read_operation with the app id, ${a}.`,i?`When the fix is live, use run_operation with the app id, operation "comments.resolve", and input { threadId, reply }. In the reply, say what you changed.`:`Report the fixes to me without resolving the threads.`]}function _m(e){return`${e.id}: "${pm(e.messages[0]?.body??``,wm)}"`}function vm({agent:e,threads:t,url:n},r){let i=new URL(n).href,a=t.length===1,o=gm(e,t.map(e=>e.id)),s=a?`Fix this comment on ${i}`:`Fix these ${t.length} comments on ${i}`;return r===`ids`?[s,...o].join(`
|
|
139
142
|
|
|
140
|
-
`):r===`titles`?[s,t.map((e,t)=>a?
|
|
143
|
+
`):r===`titles`?[s,t.map((e,t)=>a?_m(e):`${t+1}. ${_m(e)}`).join(`
|
|
141
144
|
`),...o].join(`
|
|
142
145
|
|
|
143
|
-
`):a?[s,...
|
|
144
|
-
`):[s,...t.map((e,t)=>
|
|
146
|
+
`):a?[s,...hm(t[0],r),...o].join(`
|
|
147
|
+
`):[s,...t.map((e,t)=>hm(e,r).map((e,n)=>n===0?`${t+1}. ${e}`:` ${e}`).join(`
|
|
145
148
|
`)),o.join(`
|
|
146
149
|
`)].join(`
|
|
147
150
|
|
|
148
|
-
`)}function
|
|
149
|
-
`)}var Tm,Em,Dm,Om=t((()=>{Tm=`https://app.t3.codes/new`,Em=/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/,Dm=40}));function km(e,t){return t>0?oh(Math.round(e/t*1e3)):0}function Am(e){return e.nodeType===9?e:e.ownerDocument}function jm(e){let t=e.getRootNode();return t.nodeType===11?t:Am(e)??document}function Mm(e){return`"${e.replace(/["\\]/g,`\\$&`)}"`}function Nm(e,t){if(t===`:scope`&&e.nodeType===1)return[e];try{return[...e.querySelectorAll(t)]}catch{return[]}}function Pm(e,t,n){let r=Nm(e,t);return r.length===1&&r[0]===n}function Fm(e){if(sh.some(t=>t.test(e)))return!0;let t=e.replace(/\D/g,``).length;return e.length>=6&&t/e.length>.5}function Im(e,t){let n=[],r=e.getAttribute(`data-comment-id`);r&&n.push(`[data-comment-id=${Mm(r)}]`);let i=e.getAttribute(`id`);i&&!Fm(i)&&n.push(/^[A-Za-z][\w-]*$/.test(i)?`#${i}`:`[id=${Mm(i)}]`);let a=e.getAttribute(`data-testid`);return a&&n.push(`[data-testid=${Mm(a)}]`),n.find(n=>Pm(t,n,e))}function Lm(e){let t=e.localName,n=e.parentElement;if(!n)return t;let r=[...n.children].filter(e=>e.localName===t);return r.length>1?`${t}:nth-of-type(${r.indexOf(e)+1})`:t}function Rm(e,t=jm(e)){if(e===t)return`:scope`;let n=Im(e,t);if(n)return n;let r=[],i=e;for(;i&&i!==t;){let n=i===e?void 0:Im(i,t);r.unshift(n??Lm(i));let a=r.join(` > `);if(n||Pm(t,a,e))return a;i=i.parentElement}return r.join(` > `)}function zm(e){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}function Bm(e,t){let n=t.root,r=n?.nodeType===11?n:n&&Am(n)||document;return(typeof r.elementsFromPoint==`function`?r.elementsFromPoint(e.x,e.y):[r.elementFromPoint(e.x,e.y)]).find(e=>e!==null&&(!n||n.contains(e))&&!t.ignore?.(e))}function Vm(e,t=[]){for(let n of e.childNodes)n.nodeType===3?t.push(n):n.nodeType===1&&Vm(n,t);return t}function Hm(e,t,n){let r=0,i=t.nodeType===3?void 0:t.childNodes[n];for(let a of Vm(e)){if(t.nodeType===3){if(a===t)return r+n}else if(i?a===i||i.compareDocumentPosition(a)&ch:!t.contains(a)&&t.compareDocumentPosition(a)&ch)break;r+=a.data.length}return r}function Um(e){return`rangeCount`in e?e.rangeCount>0&&!e.isCollapsed?e.getRangeAt(0):void 0:e.collapsed?void 0:e}function Wm(e){return e.nodeType===1?e:e.parentElement}function Gm(e,t){let n=Um(e),r=n?.toString()??``,i=n&&Wm(n.commonAncestorContainer);if(!n||!i||r===``)throw Mi.COMMENTS_R0001({target:`an empty selection`});let a=Km(i,t)??i;if(t.root&&(!t.root.contains(n.startContainer)||!t.root.contains(n.endContainer)||!t.root.contains(a)))throw Mi.COMMENTS_R0001({target:`a selection outside the configured root`});let o=Hm(a,n.startContainer,n.startOffset),s=Vm(a).map(e=>e.data).join(``),c=t.context??ah;return{kind:`text`,selector:Rm(a,t.root??jm(a)),exact:r,prefix:s.slice(Math.max(0,o-c),o),suffix:s.slice(o+r.length,o+r.length+c)}}function Km(e,t){let n=e;for(;n&&t.ignore?.(n);)n=n.parentElement;return n??void 0}function qm(e){return e.localName===`img`}function Jm(e,t,n){if(t.root&&!t.root.contains(e))throw Mi.COMMENTS_R0001({target:`an element outside the configured root`});let r=zm(e),i=Rm(e,t.root??jm(e)),a=qm(e)?`image`:void 0;if(t.area){let e=km(t.area.left-r.left,r.width),n=km(t.area.top-r.top,r.height),o={selector:i,x:e,y:n,width:Math.max(0,km(t.area.left+t.area.width-r.left,r.width)-e),height:Math.max(0,km(t.area.top+t.area.height-r.top,r.height)-n)};if(o.width>0&&o.height>0)return a?{kind:a,...o}:{kind:`area`,...o}}let o=n?km(n.x-r.left,r.width):500,s=n?km(n.y-r.top,r.height):500;return a?{kind:a,selector:i,x:o,y:s}:{kind:`element`,selector:i,x:o,y:s}}function Ym(e,t={}){if(e===`page`)return{kind:`page`};if(`nodeType`in e)return Jm(e,t,t.point);if(`rangeCount`in e||`startContainer`in e)return Gm(e,t);let n=Bm(e,t);if(!n)throw Mi.COMMENTS_R0001({target:`the point ${Math.round(e.x)}, ${Math.round(e.y)}`});return Jm(n,t,e)}function Xm(e,t){let n=[];for(let r=e.indexOf(t.exact);r!==-1;r=e.indexOf(t.exact,r+1)){let i=e.slice(0,r),a=e.slice(r+t.exact.length),o=0;for(;o<t.prefix.length&&i.at(-1-o)===t.prefix.at(-1-o);)o++;let s=0;for(;s<t.suffix.length&&a[s]===t.suffix[s];)s++;n.push({start:r,score:o+s,ambiguous:!1})}if(n.length===1)return n[0];let r=Math.min(lh,t.prefix.length+t.suffix.length),i=n.reduce((e,t)=>!e||t.score>e.score?t:e,void 0);if(!(!i||r===0||i.score<r))return{...i,ambiguous:n.filter(e=>e.score===i.score).length>1}}function Zm(e,t,n){let r=0;for(let i of e){let e=r+i.data.length;if(n?t>r&&t<=e:t>=r&&t<e)return{node:i,offset:t-r};r=e}let i=e.at(-1);return i&&t===r?{node:i,offset:i.data.length}:void 0}function Qm(e){return e.width>0||e.height>0}function $m(e){let t=Am(e)?.defaultView;for(let n=e;n;n=n.parentElement){let e=t?.getComputedStyle(n).display??`block`;if(!e.startsWith(`inline`)&&e!==`contents`)return n}return e}function eh(e,t){let n=Vm(t),r=Xm(n.map(e=>e.data).join(``),e);if(!r)return;let i=r.start,a=Zm(n,i,!1),o=Zm(n,i+e.exact.length,!0),s=zm(t),c=s,l=s;if(a&&o){let e=(Am(t)??document).createRange();if(e.setStart(a.node,a.offset),e.setEnd(o.node,o.offset),typeof e.getBoundingClientRect==`function`){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();Qm({left:t,top:n,width:r,height:i})&&(c={left:t,top:n,width:r,height:i})}let n=(typeof e.getClientRects==`function`?[...e.getClientRects()].filter(Qm):[]).at(-1);l=n?{left:n.left,top:n.top,width:n.width,height:n.height}:c}if(!Qm(c))return;let u=Am(t)?.defaultView,d=zm($m(t)),f=Math.min(Math.max(d.left+d.width,l.left+l.width)+uh,(u?.innerWidth??1/0)-dh),p=l.top+l.height/2;return{position:{clipped:nh(t,l.left+Math.max(0,l.width-1),p),detached:!1,kind:`text`,x:f,y:p,width:c.width,height:c.height,element:t},score:r.score,ambiguous:r.ambiguous}}function th(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function nh(e,t,n){let r=e.ownerDocument.defaultView;if(!r)return!1;for(let i=th(e);i;i=th(i)){let{overflow:e,overflowX:a,overflowY:o}=r.getComputedStyle(i);if(![e,a,o].some(e=>e!==``&&e!==`visible`))continue;let s=zm(i);if(Qm(s)&&(t<s.left-1||t>s.left+s.width+1||n<s.top-1||n>s.top+s.height+1))return!0}return!1}function rh(e,t=document){let n;for(let r of Nm(t,e.selector)){let t=Vm(r),i=Xm(t.map(e=>e.data).join(``),e),a=i&&Zm(t,i.start,!1),o=i&&Zm(t,i.start+e.exact.length,!0);if(!i||!a||!o)continue;if(n&&i.score===n.score){n.ambiguous=!0;continue}if(n&&i.score<n.score)continue;let s=(Am(r)??document).createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n={range:s,score:i.score,ambiguous:i.ambiguous}}return n&&!n.ambiguous?n.range:void 0}function ih(e,t=document){if(e.kind===`page`)return{clipped:!1,detached:!1,kind:`page`,x:0,y:0,width:0,height:0};let n=Nm(t,e.selector);if(e.kind===`text`){let t;for(let r of n){let n=eh(e,r);n&&(!t||n.score>t.score)?t=n:n&&t&&n.score===t.score&&(t.ambiguous=!0)}return t&&!t.ambiguous?t.position:{detached:!0}}let r=n.length===1?n[0]:void 0;if(!r)return{detached:!0};let i=zm(r);if(!Qm(i))return{detached:!0};let a=`width`in e&&e.width?e.width/1e3*i.width:0,o=`height`in e&&e.height?e.height/1e3*i.height:0,s=i.left+e.x/1e3*i.width,c=i.top+e.y/1e3*i.height;return{clipped:nh(r,s,c),detached:!1,kind:e.kind,x:s,y:c,width:a,height:o,element:r}}var ah,oh,sh,ch,lh,uh,dh,fh=t((()=>{Ni(),ah=32,oh=e=>Math.min(1e3,Math.max(0,e)),sh=[/^:[\w-]+:$/,/^«[^»]*»$/,/^_r_[\w-]+_$/,/^radix-/,/^headlessui-/,/^reka-/,/^v-\d/,/^data-v-/,/^ember\d/,/^[\da-f-]{8,}$/i],ch=4,lh=4,uh=8,dh=30}));function ph(e){return e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase()}var mh=t((()=>{}));function hh(e){for(let t of[e.files,e.deferredFiles])t&&!Array.isArray(t)&&t.catch(()=>{});return e}async function gh({files:e,deferredFiles:t,...n}){return t?{...n,files:[...e??[],...await t]}:{...n,...e?{files:await e}:{}}}function _h(e={}){let t=e.transport??da({base:pm(),guest:Gi}),n=new Set,r=new Map,i=new Set,a=new Set,o=new Set,s=[],c=`idle`,l,u=e.query??{},d=0,f=()=>!e.user&&!!(u.mine||u.mentions),p=()=>{for(let e of n)e()},m=(t,n=!1)=>{let r=e.user;return u.subject&&(t.subject.kind!==u.subject.kind||t.subject.id!==u.subject.id)||u.subjectKind!==void 0&&t.subject.kind!==u.subjectKind||u.page!==void 0&&(t.subject.kind!==`page`||t.subject.id!==u.page)||u.revision&&(t.revision===void 0||t.revision>u.revision.lte)||u.status&&t.status!==u.status||r&&u.mine&&t.author.id!==r.id||r&&u.mentions&&!t.messages.some(e=>e.mentions.includes(r.id))?!1:n?!(u.mentions&&!r):!(f()&&!i.has(t.id))},h=()=>{let e=[...r.values()],{server:t,local:n}=S?S.overlay(e):{server:e,local:[]};s=[...t.filter(e=>m(e)).sort((e,t)=>e.n-t.n),...n.filter(e=>m(e,!0))],p()},g=e=>{let t=r.get(e.id);return o.has(e.id)||t&&t.updatedAt>e.updatedAt?t??e:(r.set(e.id,e),a.add(e.id),h(),f()&&C(),e)},_=e=>{o.add(e),a.delete(e),r.delete(e)&&h()},v=new Map,y=async(e,t)=>{let n=v.get(e),r=(async()=>(await n?.catch(()=>void 0),t()))();v.set(e,r);try{return await r}finally{v.get(e)===r&&v.delete(e)}},b=async()=>{let e=++d;a=new Set,o=new Set,c=`loading`,p();try{let n={...u},f=n.limit??200,p=[],m;for(let r=0;;r++){p=[];let i=n.before,a=0;for(;;){let r=await t.list({...n,limit:f,...i?{before:i}:{}});if(e!==d)return s;if(a++,p.push(...r),n.limit!==void 0||r.length<f)break;let o=r.at(-1);i={id:o.id,updatedAt:o.updatedAt}}if(n.limit!==void 0||a===1&&m===void 0)break;let o=JSON.stringify(p);if(o===m)break;if(r===2)throw Mi.COMMENTS_R0015();m=o}if(e!==d)return s;let g=new Map;for(let e of p){let t=r.get(e.id);o.has(e.id)||g.set(e.id,t&&(t.updatedAt>e.updatedAt||a.has(e.id)&&t.updatedAt===e.updatedAt)?t:e)}for(let e of a){let t=r.get(e);t&&!g.has(e)&&g.set(e,t)}r.clear();for(let[e,t]of g)r.set(e,t);i=new Set(p.map(e=>e.id)),c=`ready`,l=void 0,h()}catch(t){throw e===d&&(c=`error`,l=t,p()),t}return s},x=e=>{let t=r.get(e),{server:n,local:i}=S?S.overlay(t?[t]:[]):{server:t?[t]:[],local:[]};return n[0]??i.find(t=>t.id===e)??null},S=e.outbox&&cm(e.outbox,{transport:t,user:e.user,threads:()=>r.values(),upsert:e=>void g(e),changed:h}),C=()=>{b().catch(()=>void 0)},w=t=>{if(t.type===`thread`){if(!e.user&&(u.mine||u.mentions))return C();r.get(t.thread.id)?.updatedAt===t.thread.updatedAt?C():g(t.thread)}else t.type===`deleted`?_(t.threadId):C()};return{transport:t,user:e.user,get threads(){return s},get status(){return c},get error(){return l},get query(){return u},set query(e){u=e,d++,i.clear(),h()},refresh:b,get:async e=>{let n=await t.get(e);return!n||!S?n:(g(n),x(n.id)??n)},create:async e=>(hh(e),S?S.create(e):g(await t.create(await gh(e)))),reply:e=>(hh(e),S?S.reply(e):y(e.threadId,async()=>g(await t.reply(await gh(e))))),edit:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.edit(e.messageId,e.body,e.mentions))throw Mi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>g(await t.edit(e)))},delete:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.dismiss(e.messageId??e.threadId))throw Mi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>{let n=await t.delete(e);return n?g(n):_(e.threadId),n})},resolve:e=>y(e.threadId,async()=>{let n=S?await S.beforeResolve(e.threadId):e.threadId;if(n===void 0)throw Mi.COMMENTS_OUTBOX_RESOLVE_BLOCKED();return g(await t.resolve({...e,threadId:n}))}),reopen:e=>y(e.threadId,async()=>g(await t.reopen(e))),users:e=>t.users(e),outbox:S,onChange(e){return n.add(e),()=>{n.delete(e)}},start(){let n=[];return t.subscribe?n.push(t.subscribe(w)):e.refreshOnFocus!==!1&&typeof window<`u`&&(window.addEventListener(`focus`,C),n.push(()=>window.removeEventListener(`focus`,C))),S&&n.push(S.start()),C(),()=>{for(let e of n.splice(0))e()}}}}var vh=t((()=>{Ni(),dm(),mm(),Zi(),ma(),Om(),fh(),jn(),mh()}));function yh(e){return{id:e.id,image:e.image,name:Ch(e)}}function bh(e){let{author:t,actor:n}=e;return n?{id:`${t.id}:${n.id}`,image:n.image,name:n.name??n.id}:yh(t)}function xh(e){let t=e.replace(/\\([\\`*_{}[\]()#+\-.!>~|])/g,(e,t)=>String.fromCharCode(57344+t.charCodeAt(0))).replace(/^\s*(?:```|~~~).*$/gm,``).replace(/^\s*::+[\w-]*(?:\{[^}\n]*\})?\s*$/gm,``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/<\/?[a-z][^>]*>/gi,``).replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+\[[ xX]\]\s+|[-*+]\s+|\d+[.)]\s+)/gm,``);for(let e=0;e<3;e++)t=t.replace(/(`+)([^`]+?)\1/g,`$2`).replace(/(\*\*|~~|\*)(?=\S)(.*?\S)\1/g,`$2`).replace(/(?<![\p{L}\p{N}_])(__|_)(?=\S)(.*?\S)\1(?![\p{L}\p{N}_])/gu,`$2`);return t.replace(/[\ue000-\ue07f]/g,e=>String.fromCharCode(e.charCodeAt(0)-57344)).replace(/\s+/g,` `).trim()}function Sh(e,t=60){let n=xh(e);return n.length>t?`${n.slice(0,t-1)}…`:n}var Ch,wh,Th=t((()=>{Ch=e=>e.name??e.id,wh=({author:e,actor:t})=>t?`${t.name??t.id} (${Ch(e)})`:Ch(e)}));function Eh(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&!Mh.test(n[r-1]))return;let i=n.slice(r+1);if(!(i.length>40||/^\s|\n|\s{2}|@/u.test(i)))return{start:r,query:i}}function Dh(e,t,n={}){let r=ph(t),i=new Set(n.participants),a=new Set,o=[[],[],[],[]];for(let t of e){if(t.id===n.exclude||a.has(t.id))continue;a.add(t.id);let e=ph(Ch(t)),s=e.startsWith(r)?0:e.split(/\s+/u).some((e,t)=>t>0&&e.startsWith(r))?1:void 0;s!==void 0&&o[s*2+ +!i.has(t.id)].push(t)}return o.flat().slice(0,n.limit??6)}function Oh(e,t){let n=[...t].filter(e=>e.name).sort((e,t)=>t.name.length-e.name.length);if(n.length===0)return[e];let r=RegExp(`@(${n.map(e=>Nh(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`uy`),i=[],a=0;for(let t=e.indexOf(`@`);t!==-1;t=e.indexOf(`@`,t+1)){if(t>0&&!Mh.test(e[t-1]))continue;r.lastIndex=t;let o=r.exec(e),s=o&&n.find(e=>e.name===o[1]);o&&s&&(t>a&&i.push(e.slice(a,t)),i.push(s),a=t+o[0].length,t=a-1)}return a<e.length&&i.push(e.slice(a)),i}function kh(e){return Ph.get(e)}function Ah(e){let t=[...new Map(e.filter(e=>e.name).map(e=>[e.name,e])).values()].sort((e,t)=>t.name.length-e.name.length),n=t.length>0?RegExp(`@(${t.map(e=>Nh(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`iuy`):void 0,r={name:`vitehub-comment-mentions`,markdownItPlugins:[e=>{e.inline.ruler.before(`text`,`vitehub_comment_mention`,(e,r)=>{if(!n||e.src[e.pos]!==`@`)return!1;let i=e.src[e.pos-1];if(i!==void 0&&!Mh.test(i))return!1;n.lastIndex=e.pos;let a=n.exec(e.src);if(!a)return!1;let o=a[1].toLowerCase(),s=t.find(e=>e.name.toLowerCase()===o);if(!s)return!1;if(!r){let t=e.push(`mdc_inline_component`,jh,0);t.attrs=[[`user`,s.id],[`label`,s.name]]}return e.pos+=a[0].length,!0})}]};return Ph.set(r,t),r}var jh,Mh,Nh,Ph,Fh=t((()=>{vh(),Th(),jh=`comment-mention`,Mh=/[\s([{"'“]/u,Nh=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ph=new WeakMap}));function Ih(){return Uh??Hh?.matches??!1}function Lh(){let e=Ih();if(e!==Wh){Wh=e;for(let t of Vh)t(e)}}function Rh(){Hh||typeof matchMedia!=`function`||(Hh=matchMedia(`(prefers-reduced-motion: reduce)`),Hh.addEventListener?.(`change`,Lh),Wh=Ih())}function zh(){return Rh(),Ih()}function Bh(e){return Rh(),Vh.add(e),()=>Vh.delete(e)}var Vh,Hh,Uh,Wh,Gh=t((()=>{Vh=new Set,Wh=!1}));function Kh(){let e=Reflect.get(globalThis,ng);if(e&&e!==rg&&typeof e==`object`&&`define`in e&&`install`in e)return e}function qh(e){rg=e,Reflect.get(globalThis,ng)||Reflect.set(globalThis,ng,e)}function Jh(e){let t=[...eg.values()];eg.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function Yh(e,t=zh){let n={effect:e,isReduced:t};eg.set(e.name,n);for(let e of tg)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(eg.get(e.name)===n){eg.delete(e.name);for(let e of tg)e()}}}function Xh(){return[...eg.values()].map(e=>e.effect)}function Zh(){return[...eg.values()]}function Qh(e){return tg.add(e),()=>tg.delete(e)}function X(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}var $h,eg,tg,ng,rg,ig=t((()=>{Gh(),$h=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],eg=new Map,tg=new Set,ng=Symbol.for(`vite-hub.motion.layer`)}));function ag(){return yg}function og(e){let t=Math.min(.032,vg?(e-vg)/1e3:.016)/yg;vg=e;let n=Array.from(pg),r=Array.from(mg);for(let[e,r]of n)if(pg.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&sg(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&sg(e)}e.frame(e.value,e.velocity)}for(let e of r)mg.has(e)&&e(t)===!1&&mg.delete(e);pg.size||mg.size?_g=requestAnimationFrame(og):(_g=0,vg=0)}function sg(e){e.value=e.target,e.velocity=0,e.tween=void 0,pg.delete(e)}function cg(e){pg.set(e,++hg),_g||=requestAnimationFrame(og)}function lg(e){let t=t=>e(t);return mg.add(t),_g||=requestAnimationFrame(og),()=>{mg.delete(t)}}function ug(e){if(!e)return;let t=Array.from(pg);for(let[e,n]of t)pg.get(e)!==n||e.tween||(sg(e),e.frame(e.value,0))}function dg(e,t,n=fg.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return pg.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&zh())return i.set(e);t.tween===void 0&&!gg&&(gg=!0,Bh(ug)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},cg(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,pg.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,pg.delete(r)}};return i}var fg,pg,mg,hg,gg,_g,vg,yg,bg=t((()=>{Gh(),fg={snappy:{stiffness:520,damping:34},glide:{stiffness:800,damping:57},soft:{stiffness:380,damping:20}},pg=new Map,mg=new Set,hg=0,gg=!1,_g=0,vg=0,yg=1}));function xg(e,t){let n=e.getAttribute(`aria-orientation`);return n===`vertical`?`x`:n===`horizontal`?`y`:t.height>=t.width?`x`:`y`}function Sg(e){return!/^transparent$|rgba\([^)]*,\s*0\)$|\/\s*0\)$/.test(e.trim())}function Cg(e,t){let n=e=>Number.parseFloat(t===`x`?e.width:e.height),r=[[getComputedStyle(e),e],[getComputedStyle(e,`::before`),e],[getComputedStyle(e,`::after`),e]];for(let t of e.children)t instanceof HTMLElement&&r.push([getComputedStyle(t),t]);for(let[e,t]of r){let r=n(e);if(e.display!==`none`&&Sg(e.backgroundColor)&&r>0&&r<=4)return{color:e.backgroundColor,width:r,element:t}}return{color:`var(--ui-border, var(--vh-border, currentColor))`,width:1}}function wg(e,t){let{handle:n,axis:r,line:i}=e;if(Math.abs(t)<.5&&!e.spring.active){e.lane?.svg.remove(),i.element&&e.opacity&&i.element.style.setProperty(`opacity`,e.opacity.value,e.opacity.priority),jg.get(n)===e&&jg.delete(n);return}if(!e.lane){let t=document.createElementNS(kg,`svg`);t.setAttribute(`aria-hidden`,`true`),t.dataset.motion=`bend`,t.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;z-index:1`;let n=document.createElementNS(kg,`path`);if(n.setAttribute(`fill`,`none`),n.style.stroke=i.color,n.style.strokeWidth=`${i.width}px`,t.append(n),e.lane={svg:t,path:n},i.element){let{style:t}=i.element;e.opacity={value:t.opacity,priority:t.getPropertyPriority(`opacity`)},t.setProperty(`opacity`,`0`)}}let{svg:a,path:o}=e.lane;a.isConnected||n.after(a);let s=n.offsetHeight&&n.getBoundingClientRect().height/n.offsetHeight||1,c=e=>({left:e.left/s,top:e.top/s,width:e.width/s,height:e.height/s}),l=c(a.getBoundingClientRect()),u=c(n.getBoundingClientRect()),d=r===`x`?u.left+u.width/2-l.left:u.top+u.height/2-l.top,f=r===`x`?u.top-l.top:u.left-l.left,p=f+(r===`x`?u.height:u.width),m=(f+p)/2,h=p-f>80?Math.max(f+Og,Math.min(p-Og,e.at/s-(r===`x`?l.top:l.left))):m,g=(e,t)=>r===`x`?`${t.toFixed(2)},${e.toFixed(2)}`:`${e.toFixed(2)},${t.toFixed(2)}`,_=d+t;o.setAttribute(`d`,`M${g(f,d)} C${g(h-70,d)} ${g(h-40,_)} ${g(h,_)} C${g(h+40,_)} ${g(h+70,d)} ${g(p,d)}`)}function Tg(e){return e.matches(`[aria-disabled=true], [data-disabled]:not([data-disabled=false]), [data-panel-resize-handle-enabled=false]`)?!1:/resize/.test(getComputedStyle(e).cursor)||e.tabIndex>=0||e.hasAttribute(`aria-valuenow`)}var Eg,Dg,Og,kg,Ag,jg,Mg,Ng=t((()=>{bg(),Eg={stiffness:500,damping:14},Dg=60,Og=40,kg=`http://www.w3.org/2000/svg`,Ag=`data-resize-handle-active`,jg=new WeakMap,Mg={name:`divider`,selector:`[role=separator]`,press(e,t){if(!(t instanceof PointerEvent)||!Tg(e)||e.matches(`[role=separator][data-panel-resize-handle-id]`)&&e.getAttribute(`data-resize-handle-active`)!==`pointer`)return;let n=e.getBoundingClientRect(),r=xg(e,n),i=e=>r===`x`?e.clientX:e.clientY,a=e=>r===`x`?e.clientY:e.clientX,o=e=>r===`x`?e.left+e.width/2:e.top+e.height/2,s=i(t)-o(n),c=jg.get(e);if(!c){let n={handle:e,axis:r,line:Cg(e,r),at:a(t),spring:dg(0,e=>wg(n,e),Eg)};c=n,jg.set(e,c)}let l=c;l.at=a(t);let u=t,d=0,f=()=>{d=0;let t=e.getBoundingClientRect(),n=e.offsetHeight&&t.height/e.offsetHeight||1,r=(i(u)-s-o(t))/n;l.at=a(u),l.spring.set(Math.abs(r)<1?0:r/(1+Math.abs(r)/Dg))};return{move(e){u=e,d||=requestAnimationFrame(f)},release(){cancelAnimationFrame(d),l.spring.to(0,{preset:Eg})}}}}}));function Pg(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}var Fg=t((()=>{}));function Ig(e,t){if(l_.has(t))return!1;try{return e.matches(t)}catch{return l_.add(t),!1}}function Lg(e){let t=e;for(;;){for(let e of n_.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&n_.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function Rg(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&Ig(e,t));return r===-1||r<=n||!Lg(e[r])?void 0:e[r]}function zg(e,t,n){Bg(e,!0);let r=c_(t),i=[];for(let{effect:a,isReduced:o}of Zh()){if(!a.press||o())continue;let s=Rg(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>Vg(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(i_.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,Gg,{capture:!0,passive:!0}))}function Bg(e,t=!1){let n=i_.get(e);if(n){i_.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();Hg()}}function Vg(e,t,n=!1){let r=i_.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||i_.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),Hg())}function Hg(){[...i_.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,Gg,{capture:!0})}function Ug(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(a_={event:e,path:t}),zg(e.pointerId,e,t)}function Wg(e){a_?.event.pointerId===e.pointerId&&(a_=void 0),Bg(e.pointerId,e.type===`pointercancel`)}function Gg(e){for(let{press:t}of i_.get(e.pointerId)??[])t.move?.(e)}function Kg(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||zg(`key`,e,t)}function qg(e){(e.key===` `||e.key===`Enter`)&&Bg(`key`)}function Jg(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)Ig(e,t.selector)&&!Pg(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function Yg(e){if(!a_||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=Zh().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=a_,i=i_.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&Vg(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!Lg(e)||Pg(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),i_.set(n.pointerId,i),document.addEventListener(`pointermove`,Gg,{capture:!0,passive:!0}))}function Xg(e){let t=[...new Set(e)],n=Xh(),r=new Map;Jg(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){Yg(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&Ig(t,r.selector)&&!Pg(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=Ig(t,e.selector);if(l_.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)Pg(t)||e.enter(t)}}}function Zg(e,t){let n=Xh().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...$h,...Xh().some(e=>e.name===`divider`)?[Ag]:[]],attributeOldValue:!0,childList:n||Xh().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function Qg(e,t){let n=Xh();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function $g(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Ug,e),document.addEventListener(`pointerup`,Wg,e),document.addEventListener(`pointercancel`,Wg,e),document.addEventListener(`keydown`,Kg,e),document.addEventListener(`keyup`,qg,e),o_=[()=>{document.removeEventListener(`pointerdown`,Ug,e),document.removeEventListener(`pointerup`,Wg,e),document.removeEventListener(`pointercancel`,Wg,e),document.removeEventListener(`keydown`,Kg,e),document.removeEventListener(`keyup`,qg,e),a_=void 0;for(let e of i_.keys())Bg(e,!0)},Bh(e=>{if(e){a_=void 0;for(let e of i_.keys())Bg(e,!0)}})]}function e_(e,t){if(typeof document>`u`)return()=>{};let n=Kh();return n?(Jh(n),n.install(e,t.effects,zh)):(qh(u_),t_(e,t.effects))}function t_(e,t,n=zh){let r=new Set(Xh().map(e=>e.name));for(let e of t)r.has(e.name)||Yh(e,n);if(!r_){$g();let e=new MutationObserver((e,t)=>Xg(e.concat(t.takeRecords())));r_=e,o_.push(Qh(()=>{for(let[t,{watchers:n}]of n_)Zg(t,e),Qg(t,n)}))}let i=n_.get(e);if(i)i.installs++;else{let t=new Map;Zg(e,r_),n_.set(e,{installs:1,watchers:t}),Qg(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=n_.get(e);if(!t||--t.installs>0)return;n_.delete(e);let n=r_,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(n_.size){for(let e of n_.keys())Zg(e,n);r.length&&queueMicrotask(()=>{if(r_!==n)return;let e=[...n_.keys()];Xg(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{r_=void 0;for(let e of o_)e();o_=[]}}}var n_,r_,i_,a_,o_,s_,c_,l_,u_,d_=t((()=>{Ng(),Fg(),Gh(),ig(),n_=new Map,i_=new Map,o_=[],s_=Symbol.for(`vite-hub.motion.effect-presses`),c_=e=>{let t=Reflect.get(e,s_);if(t)return t;let n=new Map;return Reflect.set(e,s_,n),n},l_=new Set,u_={define:Yh,install:t_}}));function f_(e){return S_.add(e),e}function p_(e){return S_.has(e)}function m_(e){let t=e.getRootNode(),n=t instanceof ShadowRoot?t:e.ownerDocument.head;if(!n)return!1;let r=w_.get(t);if(r?.parentNode===n)return!!r.sheet;let i=f_(e.ownerDocument.createElement(`style`));return i.dataset.motionGlyphs=``,i.textContent=C_,n.append(i),w_.set(t,i),!!i.sheet}function h_(e){let t=f_(document.createElement(`span`));return t.dataset.motionGlyph=e,t.style.whiteSpace=`pre`,t}function g_(e){return!e.isConnected||typeof requestAnimationFrame!=`function`||Pg(e)}function __(e){return g_(e)||!e.getClientRects().length||!m_(e)}function v_(){return zh()}function y_(e){return D_.get(e)}function b_(e,t,n){let r=E_.map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]),i=getComputedStyle(e);t===`end`?(e.style.display=i.display.startsWith(`inline`)||i.display===`contents`?`inline-flex`:`flex`,e.style.justifyContent=`flex-end`):(i.display===`inline`||i.display===`contents`)&&(e.style.display=`inline-block`),i.position===`static`&&(e.style.position=`relative`),e.style.whiteSpace=`nowrap`,e.style.boxSizing=`border-box`,e.style.overflow=`visible`;let a=f_(document.createElement(`span`));a.dataset.motionCopy=``,a.style.cssText=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0`;let o=f_(document.createElement(`span`));o.setAttribute(`aria-hidden`,`true`),o.dataset.motionGlyphs=``,o.style.display=`contents`,e.replaceChildren(a,o);let s=dg(0,(t,r)=>{e.style.width=`${t}px`,r===0&&t===s.target&&n()},T_),c={element:e,holder:o,width:s,name(e){a.textContent=e},restore(){(o.parentNode!==e||a.parentNode!==e)&&e.replaceChildren(a,o)},natural(){let t=e.style.width;e.style.width=`max-content`;let n=getComputedStyle(e),r=Number.parseFloat(n.width),i=Number.isFinite(r)?r:e.offsetWidth;return e.style.width=t,i},collapse(t){c.discard(),e.replaceChildren(f_(document.createTextNode(t)))},discard(){s.stop(),D_.delete(e),a.remove(),o.remove();for(let[t,n,i]of r)n?e.style.setProperty(t,n,i):e.style.removeProperty(t);e.getAttribute(`style`)||e.removeAttribute(`style`)}};return D_.set(e,c),c}function x_(e,t){let n=D_.get(e);n?n.collapse(t):e.textContent!==t&&e.replaceChildren(f_(document.createTextNode(t)))}var S_,C_,w_,T_,E_,D_,O_=t((()=>{d_(),Gh(),bg(),S_=new WeakSet,C_=`[data-motion-glyph]::before{content:attr(data-motion-glyph)}`,w_=new WeakMap,T_={stiffness:380,damping:34},E_=[`display`,`position`,`width`,`white-space`,`box-sizing`,`overflow`,`justify-content`,`vertical-align`],D_=new WeakMap}));function k_(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}function A_(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??M_,c=zh(),l=0;return{stop:lg(n=>{l+=n;let u=!c&&zh()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function j_(e,t,n=M_,r=0){let i=()=>{},a=new Promise(e=>i=e),o=A_(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}var M_,N_,P_,F_=t((()=>{Gh(),bg(),M_=e=>e,N_=k_(.42,0,1,1),P_=k_(0,0,.58,1)}));function I_(e){let t=Math.max(0,B_.findIndex(([t])=>t>=e)-1),[n,r]=B_[t],[i,a]=B_[t+1]??B_[t],o=i>n?(e-n)/(i-n):1;return r+(a-r)*z_(Math.min(1,Math.max(0,o)))}function L_(e){if(V_.get(e)?.(),g_(e)||v_())return;let t=j_(R_,t=>X(e,{translate:t>=1?null:`${I_(t).toFixed(2)}px 0`})),n=()=>{t.stop(),V_.delete(e),X(e,{translate:null})};V_.set(e,n),t.done.then(e=>e&&n())}var R_,z_,B_,V_,H_=t((()=>{ig(),O_(),F_(),R_=.4,z_=k_(.36,.07,.19,.97),B_=[[0,0],[.1,-1],[.2,3],[.3,-5],[.4,5],[.5,-5],[.6,5],[.7,-5],[.8,3],[.9,-1],[1,0]],V_=new WeakMap})),U_,W_,G_=t((()=>{Y(),U_=Symbol(`ViteHubComments`),W_=()=>yl(U_,null)??void 0}));function K_(e,t,n){return n?t.slice(-1):[...e,...t]}function q_(e,t){return!t||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function J_(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??new DOMException(`Could not read ${e.name}.`,`NotReadableError`)),r.onload=()=>t({filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:String(r.result)}),r.readAsDataURL(e)})}function Y_(){return typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches&&!matchMedia(`(any-pointer: fine)`).matches}var X_=t((()=>{})),Z_=t((()=>{X_()}));function Q_(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function $_(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function ev(e,t){return window.setTimeout(t,e*ag())}var tv=t((()=>{bg()}));function nv(e){let t=[];for(let n of e.querySelectorAll(`svg, .iconify`))n instanceof SVGSVGElement&&n.parentElement?.closest(`svg`)||(n instanceof SVGSVGElement||rv(n))&&t.push(n);return t}function rv(e){let t=getComputedStyle(e).getPropertyValue(`--svg`).trim(),n=/^url\(\s*(["']?)(.*)\1\s*\)$/s.exec(t)?.[2];if(!n?.startsWith(`data:image/svg+xml`))return;let r=n.indexOf(`,`),i=n.slice(r+1);try{return n.slice(0,r).endsWith(`;base64`)?atob(i):decodeURIComponent(i)}catch{return}}function iv(e){let t=new Map;return{set(e,n,r){let i=t.get(e);i||t.set(e,i=new Map),i.has(n)||i.set(n,e.getAttribute(n)),e.setAttribute(n,r)},putBack(){for(let[e,n]of t)for(let[t,r]of n)r===null?e.removeAttribute(t):e.setAttribute(t,r);t.clear()},shapes:e}}function av(e){if(e instanceof SVGSVGElement){let{set:t,putBack:n,shapes:r}=iv([...e.querySelectorAll(cv)]);return r.length?{shapes:r,set:t,commit(){},restore:n,measure:e=>e(r)}:void 0}let t=rv(e);if(!t)return;let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(!(n instanceof SVGSVGElement)||n.matches(`[style], [class], [transform]`))return;let r=[],i=[];for(let e of n.children){let t=sv.get(e.localName);if(!t||!(e instanceof SVGGeometryElement)||e.childElementCount||e.matches(`[style], [class], [transform]`))return;let n=document.createElementNS(ov,e.localName);if(!(n instanceof SVGGeometryElement))return;for(let r of t){let t=e.getAttribute(r);t!==null&&n.setAttribute(r,t)}r.push(n),i.push(e)}if(!r.length)return;let{set:a,putBack:o,shapes:s}=iv(i),c=()=>({value:e.style.getPropertyValue(`--svg`),priority:e.style.getPropertyPriority(`--svg`)}),l=c(),u,d=e=>{let t=c();return e.value===t.value&&e.priority===t.priority};return{shapes:s,set:a,commit(){d(u??l)&&(e.style.setProperty(`--svg`,`url("data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(n))}")`,l.priority),u=c())},restore(){if(o(),u&&d(u)){let{value:t,priority:n}=l;t?e.style.setProperty(`--svg`,t,n):e.style.removeProperty(`--svg`)}u=void 0},measure(e){let t=document.createElementNS(ov,`svg`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,t.append(...r),document.body.append(t);try{return e(r)}finally{t.remove()}}}}var ov,sv,cv,lv=t((()=>{ov=`http://www.w3.org/2000/svg`,sv=new Map([[`path`,[`d`]],[`line`,[`x1`,`y1`,`x2`,`y2`]],[`polyline`,[`points`]],[`polygon`,[`points`]],[`circle`,[`cx`,`cy`,`r`]],[`ellipse`,[`cx`,`cy`,`rx`,`ry`]],[`rect`,[`x`,`y`,`width`,`height`,`rx`,`ry`]]]),cv=[...sv.keys()].join(`, `)}));function uv(e){return e===`true`||e===`mixed`}function dv(e){return e instanceof HTMLElement||e instanceof SVGElement?e:void 0}function fv(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;)n=n.parentElement;return n}function pv(e){let{indicator:t}=e;if(e.drawn.target||e.ghost||!t||t.isConnected)return;let n=dv(t);if(!n)return;let r=Q_(n,e.element,null);e.ghost=r,_v(e,nv(r)[0],r)}function mv(e,t){pv(e);let n=Math.min(1,Math.max(0,t));if(e.icon&&!e.reduced){let{icon:t,lengths:r}=e;t.shapes.forEach((e,i)=>{let a=r[i];t.set(e,`stroke-dasharray`,`${a} ${a}`),t.set(e,`stroke-dashoffset`,String(a*(1-n)))}),t.commit()}e.fade&&X(e.fade,{opacity:String(n)})}function hv(e){e.icon?.restore(),e.icon=void 0,e.fade&&X(e.fade,{opacity:null}),e.fade=void 0,e.ghost?.remove(),e.ghost=void 0}function gv(e,t){let n=vv.get(e);if(n)return n;let r={element:e,drawn:dg(+!!t,e=>{r.drawn.active?mv(r,e):hv(r)}),icon:void 0,lengths:[],fade:void 0,indicator:void 0,ghost:void 0,reduced:!1};return vv.set(e,r),r}function _v(e,t,n){return e.icon?.restore(),e.fade&&e.fade!==n&&X(e.fade,{opacity:null}),e.icon=t&&!e.reduced?av(t):void 0,e.lengths=e.icon?.measure(e=>e.map(e=>e.getTotalLength()))??[],e.fade=n,!!e.icon||!!n}var vv,yv,bv=t((()=>{ig(),Gh(),bg(),tv(),lv(),vv=new WeakMap,yv={name:`check`,selector:`[role=checkbox]`,state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=gv(e,uv(n));i.ghost?.remove(),i.ghost=void 0,i.reduced=zh();let a=i.reduced?{tween:.15}:void 0;if(uv(r)){let t=nv(e)[0];if(i.indicator=t&&fv(e,t),uv(n)&&i.drawn.set(0),!_v(i,t,i.reduced?dv(i.indicator):void 0))return;mv(i,i.drawn.value),i.drawn.to(1,a);return}if(n!==`true`){i.drawn.set(0),i.indicator=void 0;return}let o=nv(e)[0];o&&(i.indicator=fv(e,o)),(_v(i,o,i.reduced?dv(i.indicator):void 0)||i.indicator)&&(i.drawn.to(0,a),mv(i,i.drawn.value))}}}));function xv(e){return e instanceof HTMLDetailsElement?e.querySelector(`:scope > summary`):e}function Sv(e){if(!e||e===`none`)return 0;let t=e.trim().split(/\s+/),n=t.pop();if(t.length===1&&t[0]!==`z`||t.length===3&&(Number(t[0])!==0||Number(t[1])!==0))return 0;let r=Number.parseFloat(n);return n.endsWith(`turn`)?r*360:n.endsWith(`grad`)?r*.9:n.endsWith(`rad`)?r*180/Math.PI:Number.isFinite(r)?r:0}function Cv(e){let t=/^matrix(?:3d)?\(([^)]+)\)$/.exec(e);if(!t)return 0;let[n=1,r=0]=t[1].split(`,`).map(Number);return Math.atan2(r,n)*180/Math.PI}function wv(e){let t=e.style.getPropertyValue(`rotate`);t&&e.style.removeProperty(`rotate`);let n=getComputedStyle(e),r=Cv(n.transform),i=r+Sv(n.rotate);return t&&e.style.setProperty(`rotate`,t),{total:i,base:r}}function Tv(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|rotate|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function Ev(e){return[...e.querySelectorAll(Ov)].filter(e=>!e.parentElement?.closest(Ov)||e.matches(`[data-motion-chevron]`))}function Dv(e){let t=Av.get(e);if(t)return t;let n={base:0,spring:dg(0,(t,r)=>{Pg(e)?(n.spring.stop(),X(e,{rotate:null})):X(e,{rotate:r===0&&t===n.spring.target?null:`${(t*kv-n.base).toFixed(2)}deg`})},fg.snappy)};return Av.set(e,n),n}var Ov,kv,Av,jv,Mv,Nv=t((()=>{d_(),Gh(),ig(),bg(),Ov=`[data-motion-chevron], svg, img, .iconify, [data-slot=icon], [data-slot$=Icon]`,kv=90,Av=new WeakMap,jv=new WeakMap,Mv={name:`disclosure`,selector:`details, summary, [aria-expanded]`,press(e){let t=e.tagName===`SUMMARY`?e.parentElement:e.matches(`[aria-expanded]`)?e:null;if(!t||!(t instanceof HTMLDetailsElement||t.matches(`[aria-expanded]`)))return;let n=xv(t);if(!n)return;let r=new Map;for(let e of Ev(n)){if(Pg(e)||Tv(e))continue;let t=Av.get(e)?.spring;r.set(e,t?.active?t.target*kv:wv(e).total)}if(r.size)return jv.set(t,r),{release(){setTimeout(()=>{jv.get(t)===r&&jv.delete(t)})}}},state(e,{attribute:t}){if(t!==(e instanceof HTMLDetailsElement?`open`:`aria-expanded`))return;let n=jv.get(e);jv.delete(e);let r=xv(e);if(r)for(let e of Ev(r)){let t=Av.get(e),r=n?.get(e);if(Pg(e)||r===void 0||zh()||Tv(e)){t?.spring.active&&(t.spring.stop(),X(e,{rotate:null}));continue}let i=Dv(e),a=i.spring.active?i.spring.value*kv:r,{total:o,base:s}=wv(e);i.base=s,Math.abs(o-a)<.5?i.spring.active&&i.spring.set(o/kv):(i.spring.active||i.spring.set(a/kv),i.spring.to(o/kv),i.spring.active&&X(e,{rotate:`${(i.spring.value*kv-s).toFixed(2)}deg`}))}}}}));function Pv({outline:e,box:t},n){let r=n<=1?.5*Math.sin(Math.PI*n):-.12*Math.sin(Math.PI*(n-1)/.5),i=-.15+1.35*Math.min(1,Math.max(0,n)),a=4*t.height/18;return`M${e.map(([e,n])=>{let o=(n-t.top)/t.height,s=Math.exp(-(((o-i)/.3)**2)),c=r*s*(.12+1.1*Math.max(0,o)**1.6),l=t.center+(e-t.center)*(1+c),u=o>.8?n-r*s*a*(o-.8):n;return`${l.toFixed(2)} ${u.toFixed(2)}`}).join(`L`)}Z`}function Fv(e){let[t,...n]=e.shapes;if(n.length||!(t instanceof SVGPathElement))return;let r=t.getAttribute(`d`)??``;return/^[Mm][^MmZz]+[Zz]\s*$/.test(r.trim())?t:void 0}function Iv(e){let t=Vv.get(e);if(t){t.clock.set(0),t.clock.to(1,{tween:zv});return}let n=av(e),r=n&&Fv(n);if(!n||!r)return;let i=n.measure(([e])=>{let t=e.getTotalLength(),n=e.getBBox();return{outline:Array.from({length:Bv},(n,r)=>{let i=e.getPointAtLength(t*r/Bv);return[i.x,i.y]}),box:{top:n.y,height:n.height,center:n.x+n.width/2}}});if(!i.box.height)return;let a={shape:n,path:r,...i,clock:dg(0,t=>{let i=1-Math.cbrt(1-Math.min(1,t));i>=1||!e.isConnected?(Vv.delete(e),a.clock.stop(),n.restore()):(n.set(r,`d`,Pv(a,i*Rv)),n.commit())})};Vv.set(e,a),a.clock.to(1,{tween:zv})}function Lv(){let e=Hv;Hv=void 0;for(let t of e.values())if(!(new Set(t.map(e=>e.getAttribute(`aria-pressed`)===`true`)).size>1))for(let e of t){let t=nv(e);t.length===1&&Iv(t[0])}}var Rv,zv,Bv,Vv,Hv,Uv,Wv=t((()=>{Gh(),bg(),lv(),Rv=1.5,zv=.56*Rv,Bv=120,Vv=new WeakMap,Uv={name:`jelly`,selector:`[aria-pressed]`,state(e,{attribute:t}){if(t!==`aria-pressed`||zh())return;Hv||(Hv=new Map,queueMicrotask(Lv));let n=Hv.get(e.parentElement)??[];n.push(e),Hv.set(e.parentElement,n)}}}));function Gv(e){let t=ly.get(e);return t||(t={shown:1,leaving:!1},ly.set(e,t)),t}function Kv(e){return e instanceof HTMLElement||e instanceof SVGElement}function qv(e){let t=e instanceof SVGSVGElement?e:e.querySelector(`svg`),n=t?av(t):void 0,r=n?.shapes.filter(e=>getComputedStyle(e).stroke!==`none`)??[];return n&&r.length?{shape:n,parts:r}:void 0}function Jv(e,t){let n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return()=>{n?e.setProperty(t,n,r):e.removeProperty(t)}}function Yv(e,t,n){if(!Kv(e))return;let r=t.styles??=new Map;for(let[t,i]of Object.entries(n))r.has(t)||r.set(t,Jv(e.style,t)),e.style.setProperty(t,i)}function Xv(e){e.stroke?.restore(),e.stroke=void 0;for(let t of e.styles?.values()??[])t();e.styles=void 0}function Zv(e){let t=ly.get(e);t&&(t.fade?.stop(),Xv(t),t.restorePlacement?.(),ly.delete(e))}function Qv(e,t,n,r){let i=Gv(e);i.fade?.stop(),Xv(i),i.leaving=!0;let[a,o]=t===`blur`?[0,0]:cy[t];i.fade=A_(i.shown,0,{duration:n?sy:ry.duration,ease:n?P_:N_},r=>{i.shown=r;let s=1-r;Yv(e,i,{opacity:String(r),...n?{}:t===`blur`?{filter:`blur(${(ry.blur*s).toFixed(2)}px)`,scale:String(1-(1-ry.scale)*s)}:{translate:`${a*ry.travel*s}px ${o*ry.travel*s}px`}})},()=>{i.fade=void 0,r()})}function $v(e,t,n,r){let i=Gv(e);i.fade?.stop(),i.restorePlacement?.(),i.restorePlacement=void 0,i.leaving=!1,Xv(i);let a=t===`draw`&&!n?qv(e):void 0;i.stroke=a?.shape;let o=()=>{i.fade=void 0,i.shown=1,Xv(i)};if(n){i.fade=A_(r,1,{duration:sy,ease:P_},t=>{i.shown=t,Yv(e,i,{opacity:String(t)})},o);return}if(a){let{shape:t,parts:n}=a;for(let e of n)t.set(e,`pathLength`,`1`),t.set(e,`stroke-dasharray`,`1`),t.set(e,`stroke-dashoffset`,`1`);t.commit();let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);i.shown=1,i.fade=A_(1,0,{duration:r?oy.spinner:oy.duration,delay:oy.delay,ease:oy.ease},e=>{for(let r of n)t.set(r,`stroke-dashoffset`,String(e));t.commit()},o);return}let s=t===`draw`?`blur`:t;if(s===`blur`){i.fade=A_(r,1,{duration:iy.duration,delay:r?0:iy.delay,ease:iy.ease},t=>{i.shown=Math.min(1,t);let n=1-t;Yv(e,i,{opacity:String(Math.min(1,Math.max(0,t))),filter:`blur(${Math.max(0,iy.blur*n).toFixed(2)}px)`,scale:String(1-(1-iy.scale)*n)})},o);return}let[c,l]=cy[s];i.fade=A_(r,1,{duration:ay.duration,delay:r?0:ay.delay,ease:ay.ease},t=>{i.shown=t;let n=1-t;Yv(e,i,{opacity:String(Math.min(1,t)),translate:`${-c*ay.travel*n}px ${-l*ay.travel*n}px`})},o)}function ey(e,t,n,r,i){let a=v_(),o=uy.get(e);!o&&getComputedStyle(e).position===`static`&&(o={exits:0,restore:Jv(e.style,`position`)},uy.set(e,o),e.style.position=`relative`),o&&o.exits++;let s=[];if(Kv(t)){let e={position:`absolute`,left:`${n.left}px`,top:`${n.top}px`,"pointer-events":`none`,"margin-top":`0`,"margin-right":`0`,"margin-bottom":`0`,"margin-left":`0`};for(let[n,r]of Object.entries(e))s.push(Jv(t.style,n)),t.style.setProperty(n,r)}let c=t.getAttribute(`aria-hidden`);t.setAttribute(`aria-hidden`,`true`),Gv(t).restorePlacement=()=>{for(let e of s)e();c===null?t.removeAttribute(`aria-hidden`):t.setAttribute(`aria-hidden`,c),o&&--o.exits===0&&(o.restore(),uy.delete(e))},Qv(t,r,a,()=>{Zv(t),i(t)})}function ty(e,t,n){let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);$v(e,t??(r?`draw`:`blur`),v_(),n)}function ny(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.offsetWidth?n.width/e.offsetWidth:1;return{left:(r.left-n.left)/(i||1)-e.clientLeft,top:(r.top-n.top)/(i||1)-e.clientTop}}var ry,iy,ay,oy,sy,cy,ly,uy,dy=t((()=>{lv(),O_(),F_(),ry={duration:200,travel:12,scale:.6,blur:2},iy={duration:260,delay:40,scale:.5,blur:3,ease:k_(.3,1.5,.5,1)},ay={duration:260,delay:80,travel:10,ease:k_(.2,.8,.2,1)},oy={duration:340,spinner:420,delay:120,ease:k_(.6,0,.2,1)},sy=150,cy={left:[-1,0],right:[1,0],up:[0,-1],down:[0,1]},ly=new WeakMap,uy=new WeakMap}));function fy(e,t){let n=[...e],r=[...t],i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{kept:n.slice(0,i).join(``),gone:n.slice(i).join(``),typed:r.slice(i).join(``)}}function py(e,t,n){return n>1?Math.min(e,t/(n-1)):e}function my(e){return ky.get(e)?.text}function hy(e,t,n){e.shown=t,X(e.node,{opacity:t>=1?null:String(t),filter:n||t>=1?null:`blur(${(Ty*(1-t)).toFixed(2)}px)`})}function gy(e){return h_(e)}function _y(e,t){ky.get(e)===t&&(t.leaving.size||t.timers.size||t.frame.width.active||t.letters.some(e=>e.fade||e.waiting)||(ky.delete(e),t.frame.collapse(t.text)))}function vy(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[...e.letters,...e.leaving])t.fade?.stop()}function yy(e){let t=ky.get(e);t&&(vy(t),ky.delete(e),t.frame.discard())}function by(e,t){Sy(e,t,void 0)}function xy(e){let t=e;for(;t;){if(t.getClientRects().length)return!0;if(getComputedStyle(t).display!==`contents`)return!1;let e=t.getRootNode();t=t.parentElement??(e instanceof ShadowRoot?e.host:null)}return!1}function Sy(e,t,n){let r=ky.get(e),i=r?.text??n??e.textContent??``;if(!r&&i===t||__(e)||!xy(e)){r&&(vy(r),ky.delete(e)),x_(e,t);return}let a=v_();if(!r){let t=y_(e)??b_(e,`inline`,()=>{let t=ky.get(e);t&&_y(e,t)}),n=[...i].map(e=>({node:gy(e),char:e,shown:1,waiting:!1}));t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),r={frame:t,text:i,letters:n,leaving:new Set,timers:new Set},ky.set(e,r)}let o=r,s=o.frame.width;o.frame.restore();for(let e of o.timers)clearTimeout(e);if(o.timers.clear(),o.text=t,o.frame.name(t),a){wy(o,o.letters,!0),o.letters=[...t].map(e=>{let t={node:gy(e),char:e,shown:0,waiting:!1};return hy(t,0,!0),o.frame.holder.append(t.node),t}),s.set(o.frame.natural());for(let t of o.letters)Cy(e,o,t,0,Oy,!0);return}let c=fy(o.letters.map(e=>e.char).join(``),t),l=[...c.kept].length,u=o.letters.slice(0,l);wy(o,o.letters.slice(l),!1);let d=[...u.filter(e=>e.waiting),...[...c.typed].map(e=>{let t={node:gy(e),char:e,shown:0,waiting:!0};return hy(t,0,!1),o.frame.holder.append(t.node),t})];o.letters=[...u,...d.filter(e=>!u.includes(e))];let f=o.frame.natural();if(!d.length){s.to(f);return}let p=s.value,m=f-d.reduce((e,t)=>e+t.node.offsetWidth,0),h=ag(),g=py(Dy.stagger,Dy.spread,d.length);d.forEach((t,n)=>{m+=t.node.offsetWidth;let r=n===d.length-1?f:Math.max(m,n===0?Math.min(p,f):0),i=setTimeout(()=>{o.timers.delete(i),t.waiting=!1,s.to(r),Cy(e,o,t,t.shown,Dy.duration,!1)},(Dy.lead+n*g)*h);o.timers.add(i)})}function Cy(e,t,n,r,i,a){n.fade?.stop(),n.fade=A_(r,1,{duration:i,ease:P_},e=>hy(n,e,a),()=>{n.fade=void 0,hy(n,1,a),_y(e,t)})}function wy(e,t,n){let r=e.frame.element,i=t.map(e=>({letter:e,left:e.node.offsetLeft,top:e.node.offsetTop})),a=py(Ey.stagger,Ey.spread,i.length),o=0;for(let{letter:t,left:s,top:c}of i)t.fade?.stop(),t.fade=void 0,t.waiting||t.shown<=0?t.node.remove():(t.node.style.position=`absolute`,t.node.style.left=`${s}px`,t.node.style.top=`${c}px`,e.leaving.add(t),t.fade=A_(t.shown,0,{duration:n?Oy:Ey.duration,delay:n?0:o++*a,ease:n?P_:N_},e=>hy(t,e,n),()=>{t.fade=void 0,t.node.remove(),e.leaving.delete(t),_y(r,e)}))}var Ty,Ey,Dy,Oy,ky,Ay=t((()=>{ig(),bg(),O_(),F_(),Ty=6,Ey={duration:200,stagger:30,spread:120},Dy={duration:240,lead:30,stagger:55,spread:240},Oy=150,ky=new WeakMap})),jy,My,Ny,Py=t((()=>{O_(),dy(),Ay(),jy=`:is(button, a, [role=button])`,My={name:`label`,selector:`${jy} > [data-slot=label]`,content(e,{added:t,removed:n,oldText:r}){if(!(e instanceof HTMLElement))return;if([...e.childNodes].some(e=>e.nodeType!==Node.TEXT_NODE&&!p_(e))){yy(e);return}if(t.length?t.every(p_):n.length>0)return;let i=my(e)??r;i!==void 0&&Sy(e,e.textContent??``,i)}},Ny={name:`button-icon`,selector:`${jy}, ${jy} > svg:is([data-slot=leadingIcon], [data-slot=trailingIcon])`,content(e,{added:t,removed:n}){if(e instanceof HTMLElement){for(let r of[`leadingIcon`,`trailingIcon`]){let i=e=>e instanceof SVGSVGElement&&e.getAttribute(`data-slot`)===r&&!p_(e),a=t.find(t=>i(t)&&t.parentNode===e),o=n.find(i);if(o){let t=f_(o.cloneNode(!0));t.classList.remove(`animate-spin`),t.removeAttribute(`data-slot`),a?a.after(t):r===`leadingIcon`?e.prepend(t):e.append(t),ey(e,t,ny(e,a??t),`blur`,e=>e.remove())}a&&ty(a,void 0,0)}return}let r=e.parentElement;if(!(e instanceof SVGSVGElement)||!r||!n.length||t.every(p_)||!n.some(e=>e instanceof SVGElement))return;let i=ny(r,e),a=f_(e.cloneNode(!1));a.classList.remove(`animate-spin`),a.removeAttribute(`data-slot`),a.append(...n),e.after(a),ey(r,a,i,`blur`,e=>e.remove()),ty(e,void 0,0)}}}));function Fy(e){let t=zy.get(e);t&&(zy.delete(e),t.spring.stop(),t.ghost.remove(),e.removeAttribute(`data-motion-leave-managed`),X(e,{opacity:null}))}var Iy,Ly,Ry,zy,By,Vy=t((()=>{Gh(),ig(),bg(),tv(),Iy={stiffness:260,damping:28},Ly=.9,Ry=.15,zy=new WeakMap,By={name:`leave`,selector:`*`,state(e,{attribute:t,value:n}){if(t!==`data-leaving`||(Fy(e),n!==`true`||!e.parentNode))return;e.setAttribute(`data-motion-leave-managed`,``);let r=e.getBoundingClientRect(),i=Q_(e,e.parentNode,e.nextSibling),a=getComputedStyle(e).position;a!==`absolute`&&a!==`fixed`&&$_(i,r),X(e,{opacity:`0`});let o=zh(),s=dg(1,e=>{X(i,{scale:o?null:(Ly+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&(s.stop(),i.remove())},Iy);zy.set(e,{ghost:i,spring:s}),s.to(0,o?{tween:Ry}:{preset:Iy})}}}));function Hy(e){let t=Jy.get(e)?.spring;t?.active&&(t.stop(),X(e,{width:null}))}function Uy(e){let t=new Set,n=new ResizeObserver(e=>{for(let{target:n}of e)n instanceof HTMLElement&&t.has(n)&&!Jy.get(n)?.spring.active&&Yy.set(n,n.getBoundingClientRect().width)});function r(r){if(t.has(r)||!e.contains(r)||!r.matches(qy))return;t.add(r);let i=Xy.get(r)??0;i===0&&Yy.set(r,r.getBoundingClientRect().width),Xy.set(r,i+1),n.observe(r,{box:`border-box`})}function i(e){t.delete(e),n.unobserve(e);let r=Xy.get(e)??1;r>1?Xy.set(e,r-1):(Xy.delete(e),Hy(e),Yy.delete(e))}let a=new MutationObserver(n=>{for(let n of t)e.contains(n)&&n.matches(qy)||i(n);for(let e of n){e.type===`attributes`&&e.target instanceof HTMLElement&&r(e.target);for(let t of e.addedNodes)if(t instanceof HTMLElement){r(t);for(let e of t.querySelectorAll(qy))r(e)}}});e instanceof HTMLElement&&r(e);for(let t of e.querySelectorAll(qy))r(t);return a.observe(e,{subtree:!0,childList:!0,attributeFilter:[`data-motion-panel`]}),()=>{a.disconnect();for(let e of t)i(e);n.disconnect()}}function Wy(e){let t=getComputedStyle(e);return t.boxSizing===`border-box`?0:[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+Number.parseFloat(t),0)}function Gy(e,t){X(e,{width:`${t.spring.value*Zy-t.frame}px`})}var Ky,qy,Jy,Yy,Xy,Zy,Qy,$y=t((()=>{Gh(),ig(),bg(),Ky={stiffness:420,damping:30},qy=`[data-motion-panel]`,Jy=new WeakMap,Yy=new WeakMap,Xy=new WeakMap,Zy=100,Qy={name:`panel`,selector:qy,watch:Uy,state(e){let t=Jy.get(e),n=t?.spring.active?t.spring.value*Zy:Yy.get(e);t?.spring.active&&X(e,{width:null});let r=e.getBoundingClientRect().width;if(Yy.set(e,r),n===void 0||zh()||Math.abs(r-n)<.5)Hy(e);else{if(!t){let r={frame:0,spring:dg(n/Zy,(t,n)=>{n===0&&t===r.spring.target?X(e,{width:null}):Gy(e,r)},Ky)};t=r,Jy.set(e,t)}t.frame=Wy(e),t.spring.active||t.spring.set(n/Zy),t.spring.to(r/Zy),t.spring.active&&Gy(e,t)}}}}));function eb(){let e=Reflect.get(globalThis,fb);return e===`opt-in`||e===`all`?e:`buttons`}function tb(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function nb(e){let t=eb();return t===`buttons`?e.matches(db)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function rb(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(ub);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!nb(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:hb(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(ub)?{target:r,amount:.15}:{target:e,amount:hb(e)}}function ib(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function ab(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}var ob,sb,cb,lb,ub,db,fb,pb,mb,hb,gb,_b=t((()=>{ig(),bg(),ob={stiffness:900,damping:40},sb={stiffness:380,damping:14},cb=[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`],lb=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${cb.map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,ub=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,db=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,fb=Symbol.for(`vite-hub.motion.press-mode`),pb=new WeakMap,mb=e=>e>=40?.03:e>=32?.04:.05,hb=e=>Math.min(mb(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight)),gb={name:`press`,selector:lb,press(e,t){if(!(`pointerId`in t))return;let n=rb(e,tb(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(ib(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),ab(o,t,i)))return;let s=pb.get(r);if(!s){let e={amount:i,spring:dg(0,t=>{X(r,{scale:t?String(1-e.amount*t):null})},ob)};s=e,pb.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:ob});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{ab(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:sb})},cancel:u}}}}));function vb(e,t){return e===`aria-selected`||e===`aria-checked`?t===`true`:e===`data-state`?t===`active`||t===`checked`||t===`on`:e===`data-checked`&&t!==null&&t!==`false`}function yb(e){let t=e.parentElement?.closest(Vb);if(!t||t.matches(`[role=listbox][aria-multiselectable=true]`))return null;let n=e.getAttribute(`role`),r=n?zb[n]:void 0;return t.matches(Bb)||r&&t.matches(r)?t:null}function bb(e){return Wb.some(t=>vb(t,e.getAttribute(t)))}function xb(e,t){for(let n=t;n&&n!==e;n=n.parentElement)if(Xb.has(n)||n.matches(Gb))return n}function Sb(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,k:e.offsetWidth?t.width/e.offsetWidth:1}}function Cb(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width/t.k,i=e.offsetHeight||n.height/t.k;return{x:(n.left+n.width/2-t.left)/t.k-r/2,y:(n.top+n.height/2-t.top)/t.k-i/2,width:r,height:i}}function wb(e,t){for(let n of t.querySelectorAll(Kb))if(n.closest(Vb)===e&&xb(e,n)===t)return n;for(let t of e.querySelectorAll(qb))if(t.closest(Vb)===e&&!xb(e,t))return t}function Tb(e,t){return e.endsWith(`%`)?Number.parseFloat(e)/100*t:Number.parseFloat(e)||0}function Eb(e){X(e.element,{translate:null,scale:null});let t=getComputedStyle(e.element);e.rest=Cb(e.element,Sb(e.group));let[n=`0`,r=`0`]=t.translate===`none`?[]:t.translate.split(` `),[i=`50%`,a=`50%`]=t.transformOrigin.split(` `);e.translate=[Tb(n,e.rest.width),Tb(r,e.rest.height)],e.origin=[Tb(i,e.rest.width),Tb(a,e.rest.height)]}function Db(e,t,n){let r=t.width?n.width/t.width:1,i=t.height?n.height/t.height:1;return{x:n.x+(e.x-t.x)*r,y:n.y+(e.y-t.y)*i,width:e.width*r,height:e.height*i}}function Ob(e){return!!e&&(e.x.active||e.y.active||e.width.active||e.height.active)}function kb(e){e.queued||(e.queued=!0,queueMicrotask(()=>{e.queued=!1,Ab(e)}))}function Ab(e){if(!e.ready)return;let{element:t,rest:n,translate:r,origin:i,x:a,y:o,width:s,height:c}=e;if(!Ob(e)){X(t,{translate:null,scale:null}),Fb(e);return}let l=n.width?s.value/n.width:1,u=n.height?c.value/n.height:1;X(t,{translate:`${a.value-(n.x-r[0])-i[0]*(1-l)}px ${o.value-(n.y-r[1])-i[1]*(1-u)}px`,scale:`${l} ${u}`})}function jb(e,t,n,r,i){let a=Jb.get(e),o=Ob(a);a&&a.element!==t&&(X(a.element,{translate:null,scale:null}),Fb(a));let s=a??{element:t,group:e,ready:!1,rest:{x:0,y:0,width:0,height:0},translate:[0,0],origin:[0,0],queued:!1,x:dg(0,()=>kb(s),fg.glide),y:dg(0,()=>kb(s),fg.glide),width:dg(0,()=>kb(s),fg.glide),height:dg(0,()=>kb(s),fg.glide)};Jb.set(e,s),s.ready=!1,s.element=t,s.copyOf=i,Eb(s);let{rest:c}=s;if(!c.width||!c.height||!o&&!n)return s.ready=!0,Fb(s);if(!o&&n){let t=Sb(e),i=Db(c,Cb(r,t),Cb(n,t));s.x.set(i.x),s.y.set(i.y),s.width.set(i.width),s.height.set(i.height)}for(let[e,t]of[[s.x,c.x],[s.y,c.y],[s.width,c.width],[s.height,c.height]])e.stop(),e.to(t);s.ready=!0,Ab(s)}function Mb(e){getComputedStyle(e).backgroundColor;for(let t of e.getAnimations())t instanceof CSSTransition&&ex.includes(t.transitionProperty)&&t.finish()}function Nb(e){let t=e.getRootNode();(t instanceof Document||t instanceof ShadowRoot)&&(nx||(nx=new CSSStyleSheet,nx.replaceSync(tx)),t.adoptedStyleSheets.includes(nx)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,nx]))}function Pb(e,t,n){Mb(t),Mb(n);let r=getComputedStyle(t),i=getComputedStyle(n),a=[],o={position:`absolute`,"z-index":`-1`,"box-sizing":`border-box`,margin:`0`,"pointer-events":`none`,"border-radius":i.borderRadius,"background-color":`transparent`,"box-shadow":`none`};i.backgroundColor!==r.backgroundColor&&!rx.test(i.backgroundColor)&&(o[`background-color`]=i.backgroundColor,a.push(`background`)),i.boxShadow!==r.boxShadow&&i.boxShadow!==`none`&&(o[`box-shadow`]=i.boxShadow,a.push(`shadow`));for(let e of Qb){let t=`border-${e}`,n=i.getPropertyValue(`${t}-width`),s=i.getPropertyValue(`${t}-color`);o[`${t}-width`]=n,o[`${t}-style`]=i.getPropertyValue(`${t}-style`),o[`${t}-color`]=`transparent`,Number.parseFloat(n)>0&&!rx.test(s)&&$b.some(e=>{let n=`${t}-${e}`;return i.getPropertyValue(n)!==r.getPropertyValue(n)})&&(o[`${t}-color`]=s,a.push(t))}if(!a.length)return;let s=document.createElement(`span`);s.setAttribute(`aria-hidden`,`true`),s.setAttribute(`data-motion-copy`,``);for(let[e,t]of Object.entries(o))s.style.setProperty(e,t);Nb(e),e.append(s);let c=s.offsetParent instanceof HTMLElement?s.offsetParent:null,l=c&&(c!==document.body||getComputedStyle(c).position!==`static`)?c:null,u=Cb(n,Sb(l??document.documentElement));return s.style.left=`${u.x-(l?l.clientLeft-l.scrollLeft:0)}px`,s.style.top=`${u.y-(l?l.clientTop-l.scrollTop:0)}px`,s.style.width=`${u.width}px`,s.style.height=`${u.height}px`,{element:s,hidden:a}}function Fb(e){let t=e.copyOf;t&&(e.copyOf=void 0,t.removeAttribute(`data-motion-select-hidden`),Mb(t),e.element.remove(),e.group.removeAttribute(`data-motion-select-moving`))}function Ib(e){let t=Jb.get(e);if(t){Jb.delete(e),t.ready=!1;for(let e of[t.x,t.y,t.width,t.height])e.stop();X(t.element,{translate:null,scale:null}),Fb(t)}}function Lb(e,t,n){if(zh()||Pg(n))return Ib(e);let r=wb(e,n);if(r)return Pg(r)?Ib(e):jb(e,r,t,n);let i=Jb.get(e),a=t??(Ob(i)?i?.copyOf:void 0);if(!a)return;let o=Pb(e,a,n);o&&(n.setAttribute(`data-motion-select-hidden`,o.hidden.join(` `)),Mb(n),jb(e,o.element,t,n,n),o.element.isConnected&&e.setAttribute(`data-motion-select-moving`,``))}function Rb(){Zb=0;let e=[...Yb];Yb.clear();for(let[t,{from:n,to:r}]of e)r?.isConnected&&yb(r)===t&&bb(r)?Lb(t,n?.isConnected&&yb(n)===t?n:void 0,r):(!t.isConnected||Jb.has(t)&&![...t.querySelectorAll(Ub)].some(e=>bb(e)&&yb(e)===t))&&Ib(t)}var zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx,rx,ix,ax=t((()=>{Fg(),Gh(),ig(),bg(),zb={tab:`[role=tablist]`,radio:`[role=radiogroup]`,option:`[role=listbox]`,menuitemradio:`[role=group], [role=menu]`},Bb=`[data-motion-select]`,Vb=`[role=tablist], [role=radiogroup], [role=listbox], [role=group], [role=menu], ${Bb}`,Hb=Object.keys(zb).map(e=>`[role=${e}]`).join(`, `),Ub=`${Hb}, ${Bb} *`,Wb=[`aria-selected`,`aria-checked`,`data-state`,`data-checked`],Gb=`${Hb}, [aria-selected], [aria-checked], [data-checked], ${[`active`,`inactive`,`checked`,`unchecked`,`on`,`off`].map(e=>`[data-state=${e}]`).join(`, `)}`,Kb=`[data-motion-indicator], [data-slot=indicator]`,qb=`${Kb}, [data-slot$="-indicator"]`,Jb=new WeakMap,Yb=new Map,Xb=new WeakSet,Zb=0,Qb=[`top`,`right`,`bottom`,`left`],$b=[`width`,`style`,`color`],ex=[`background-color`,`box-shadow`,...Qb.flatMap(e=>$b.map(t=>`border-${e}-${t}`))],tx=[`[data-motion-select-moving] { isolation: isolate; }`,`[data-motion-select-hidden~="background"] { background-color: transparent !important; }`,`[data-motion-select-hidden~="shadow"] { box-shadow: none !important; }`,...Qb.map(e=>`[data-motion-select-hidden~="border-${e}"] { border-${e}-color: transparent !important; }`)].join(`
|
|
150
|
-
`),rx=/^transparent$|^rgba\((?:[^,]+,){3}\s*0(?:\.0+)?\)$|\/\s*0(?:\.0+)?%?\s*\)$/,ix={name:`select`,selector:Ub,state(e,{attribute:t,oldValue:n,value:r}){let i=vb(t,n),a=vb(t,r);if(i===a)return;let o=yb(e);if(!o)return;Xb.add(e);let s=Yb.get(o)??{};a?s.to=e:s.from=e,Yb.set(o,s),Zb||=requestAnimationFrame(Rb)}}}));function ox(e){if(!(e instanceof HTMLInputElement))return e;let t=e.parentElement;return t?.matches(Fx)?t:void 0}function sx(e){return e.querySelectorAll(`:scope > [role=slider], :scope > ${Fx} > input[type=range]`)}function cx(e){return e.getAttribute(`aria-orientation`)===`vertical`||e.closest(`[data-orientation=vertical]`)?`y`:`x`}function lx(e,t){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();return{left:n/t.zoom,top:r/t.zoom,width:i/t.zoom,height:a/t.zoom}}function ux(e){return e.offsetWidth&&e.getBoundingClientRect().width/e.offsetWidth||1}function dx(e,t){return t===`x`?{start:e.left,size:e.width}:{start:e.top,size:e.height}}function fx(e){let{thumb:t,track:n,axis:r}=e;e.zoom=ux(n);let i=dx(lx(t,e),r),a=dx(lx(n,e),r);return e.length=a.size,i.start+i.size/2-a.start-(Rx.get(t)===e?e.position.value-e.layout:0)}function px(e){return Number.parseFloat(e??``)}function mx({thumb:e,axis:t}){let{style:n}=e,r=t===`x`?n.left:n.top,i=t===`x`?n.right:n.bottom;return r&&!i?1:i&&!r||t===`y`||getComputedStyle(e).direction===`rtl`?-1:1}function hx(e,t,n,r){let i=px(t.getAttribute(`aria-valuemin`)??t.getAttribute(`min`)),a=px(t.getAttribute(`aria-valuemax`)??t.getAttribute(`max`)),o=Number.isFinite(i)?i:0,s=Number.isFinite(a)?a:100;if(!(s>o)||!Number.isFinite(n)||!Number.isFinite(r))return;let c=dx(lx(e.thumb,e),e.axis).size,l=(r-o)/(s-o),u=mx(e),d;for(let t of[e.length-c,e.length])for(let n of[u,-u]){let r=e.length/2+n*(l-.5)*t,i=Math.abs(r-e.layout);(!d||i<d.error)&&(d={error:i,travel:t,sign:n})}if(!(!d||d.error>3))return e.layout-d.sign*((r-n)/(s-o))*d.travel}function gx(e){let[t=`0px`,n=`0px`]=e.split(` `).filter(Boolean);return{raw:e,x:t,y:n}}function _x(e,t){let n=e.parentElement;if(!n)return;let r=cx(t),i={thumb:e,track:n,range:n.querySelector(`:scope > [data-slot=range], :scope > [data-slot=slider-indicator]`),axis:r,layout:0,length:0,zoom:1,direction:1,held:!1,position:dg(0,(e,t)=>{Math.abs(t)>kx*i.length&&(i.direction=t>0?1:-1),i.tail.to(Math.min(Dx,Math.abs(t)*Ox)),xx(i)},wx),tail:dg(0,()=>xx(i),Tx),ownTranslate:gx(e.style.translate)};return i.layout=fx(i),i.position.set(i.layout),Rx.set(e,i),i}function vx(e){Rx.delete(e.thumb),e.position.stop(),e.tail.stop(),X(e.thumb,{translate:e.ownTranslate.raw||null,scale:null}),yx(e),e.lane?.ownerSVGElement?.remove()}function yx(e){let{range:t,axis:n,track:r}=e;if(!t)return;let i=[...sx(r)].flatMap(t=>{let r=ox(t);if(!r)return[];let i=Rx.get(r),a=dx(lx(r,e),n);return[{center:a.start+a.size/2,moving:!!i&&Math.abs(i.position.value-i.layout)>=.01}]}),a=n===`x`?`minWidth`:`minHeight`,o=zx.get(t);if(!i.some(e=>e.moving)){o&&(t.style[a]=o.minSize,X(t,{translate:o.translate,scale:o.scale}),zx.delete(t));return}o||(o={minSize:t.style[a],scale:t.style.scale,translate:t.style.translate,shift:0},zx.set(t,o),t.style[a]=`1px`);let s=Number.parseFloat(getComputedStyle(t)[n===`x`?`width`:`height`]);if(!(s>0))return;let c=dx(lx(t,e),n),l=c.start+c.size/2-o.shift-s/2,u=l+s,d=i.map(e=>e.center),f=Math.min(...d),p=Math.max(...d);i.length===1&&(mx(e)>0?f=l:p=u);let m=Math.max(0,p-f)/s,h=o.shift=(f+p)/2-(l+u)/2;X(t,{translate:n===`x`?`${h}px 0px`:`0px ${h}px`,scale:n===`x`?`${m} 1`:`1 ${m}`})}function bx(e){let{thumb:t,track:n,axis:r,direction:i,length:a,range:o}=e,s=Math.min(Dx,e.tail.value);if(s<=2){e.lane?.setAttribute(`d`,``);return}if(!e.lane){let n=document.createElementNS(Nx,`svg`);n.setAttribute(`aria-hidden`,`true`),n.dataset.motion=`tail`,n.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;margin:0`;let r=document.createElementNS(Nx,`path`);r.style.fill=getComputedStyle(o??t).backgroundColor,n.append(r),e.lane=r}let c=e.lane.ownerSVGElement;c.isConnected||t.before(c);let l=lx(c,e),u=lx(n,e),d=lx(t,e),f=(r===`x`?d.height:d.width)/2/(e.held?Ex:1),p=r===`x`?d.top+d.height/2-l.top:d.left+d.width/2-l.left,m=r===`x`?u.left-l.left:u.top-l.top,h=Math.max(0,Math.min(a,e.position.value)),g=Math.min(s,i>0?h:a-h),_=i>0&&o?(r===`x`?o.offsetHeight:o.offsetWidth)/2:0,v=[],y=[];for(let e=0;e<=Ax;e++){let t=e/Ax,n=(m+h-i*g*t).toFixed(1),a=Math.max(_,f*.95*(1-t)**1.3),o=(p-a).toFixed(2),s=(p+a).toFixed(2);v.push(r===`x`?`${n} ${o}`:`${o} ${n}`),y.push(r===`x`?`${n} ${s}`:`${s} ${n}`)}e.lane.setAttribute(`d`,`M${v.join(`L`)}L${y.reverse().join(`L`)}Z`)}function xx(e){if(Rx.get(e.thumb)!==e)return;if(!e.held&&!e.position.active&&!e.tail.active){vx(e);return}let{thumb:t,axis:n}=e,r=e.position.value-e.layout,{x:i,y:a}=e.ownTranslate,o=n===`x`?`calc(${i} + ${r.toFixed(2)}px) ${a}`:`${i} calc(${a} + ${r.toFixed(2)}px)`,s=Math.abs(e.position.velocity)/Math.max(1,e.length),c=Math.min(Mx,s*jx),l=e.held?Ex:1,u=(l*(1+c)).toFixed(4),d=(l*(1-c*.25)).toFixed(4);X(t,{translate:o,scale:n===`x`?`${u} ${d}`:`${d} ${u}`}),yx(e),bx(e)}function Sx(e,t,n,r){if(zh()){let t=Rx.get(e);t&&vx(t);return}let i=Rx.get(e),a=i??_x(e,t);if(!a)return;let o=fx(a);if(!i){let e=n===void 0||r===void 0?void 0:hx(a,t,n,r);a.position.set(e??o)}Math.abs(o-a.layout)<.01&&i||(a.layout=o,a.position.to(o),xx(a))}function Cx(e){return e.matches(`:disabled, [aria-disabled=true], [data-disabled]:not([data-disabled=false])`)}var wx,Tx,Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx=t((()=>{d_(),ig(),Gh(),bg(),wx={stiffness:520,damping:38},Tx={stiffness:260,damping:30},Ex=1.12,Dx=150,Ox=.13,kx=.05,Ax=28,jx=.09,Mx=.55,Nx=`http://www.w3.org/2000/svg`,Px=`[role=slider], input[type=range]`,Fx=`[data-slot=slider-thumb]`,Ix=`[data-slot=range], [data-slot=slider-indicator]`,Lx=`[data-slot=track], [data-slot=slider-track], :has(> [data-slot=range])`,Rx=new WeakMap,zx=new WeakMap,Bx={name:`slider`,selector:`${Px}, ${Lx}, [data-slot=slider-control]`,press(e,t){if(!(t instanceof PointerEvent))return;let n=t.composedPath()[0];if(!(n instanceof Element))return;let r=e.matches(`[data-slot=slider-control]`)?e.querySelector(`[data-slot=slider-track]`):e,i=e.matches(Px)?[e]:r&&(n===e||n===r||n.closest(Ix)?.parentElement===r)?sx(r):[],a,o=1/0;for(let e of i){let n=ox(e);if(!n||Cx(e)||Pg(e))continue;let r=n.getBoundingClientRect(),i=Math.hypot(r.left+r.width/2-t.clientX,r.top+r.height/2-t.clientY);i<o&&(o=i,a={thumb:n,value:e})}if(!a)return;let{thumb:s,value:c}=a,l=Rx.get(s)??_x(s,c);if(!l)return;l.held=!0,xx(l);let u=0;return{move(){u||=requestAnimationFrame(()=>{u=0,Sx(s,c)})},release(){cancelAnimationFrame(u);let e=Rx.get(s);e&&(e.held=!1,Sx(s,c),xx(e))}}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-valuenow`&&t!==`aria-valuetext`||!e.matches(Px))return;let i=ox(e);i&&Sx(i,e,px(n),px(r))}}}));function Hx(e){let t=e.querySelector(rS)??e.firstElementChild;return t instanceof HTMLElement?t:void 0}function Ux(e){return e===`true`}function Wx(e,t){X(t,{translate:null,scale:null});let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),[i=`0px`,a=`0px`]=getComputedStyle(t).translate.split(` `),o=e.offsetWidth?n.width/e.offsetWidth:1;return{rest:{center:(r.left+r.width/2-n.left)/o,width:r.width/o,height:r.height/o},translate:i===`none`?[`0px`,`0px`]:[i,a],width:t.offsetWidth,height:t.offsetHeight}}function Gx(e,t,n){let r=e.rest[+!!t];if(r)return r;let i=e.rest[+!t];return{...i,center:n-i.center}}function Kx(e,t){let{knob:n,now:r}=t;if(!t.position.active&&!t.size.active&&!t.press.active&&!t.press.target&&!t.wobble.active&&t.wobbleTimer===void 0){X(n,{translate:null,scale:null});return}let i=e.offsetWidth,a=Gx(t,!1,i),o=Gx(t,!0,i),s=t.position.value,c=t.size.value,l=Math.min(.55,Math.abs(t.velocity)*.09)+t.press.value*.4,u=1+l+t.wobble.value*.14,d=1-l*.25-t.wobble.value*.14,f=(a.width+(o.width-a.width)*c)*u,p=(a.height+(o.height-a.height)*c)*d,m=Math.min(a.center-a.width/2,o.center-o.width/2),h=Math.max(a.center+a.width/2,o.center+o.width/2),g=a.center+(o.center-a.center)*s,_=f/2,v=(m+_>h-_?(m+h)/2:Math.max(m+_,Math.min(h-_,g)))-(r.on?o:a).center;X(n,{translate:`calc(${r.translate[0]} + ${v.toFixed(2)}px) ${r.translate[1]}`,scale:`${(f/r.width).toFixed(4)} ${(p/r.height).toFixed(4)}`})}function qx(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|translate|scale|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function Jx(e,t){let n=iS.get(e);if(n&&n.knob.isConnected&&e.contains(n.knob))return n;let r=Hx(e);if(!r||qx(r))return;let i=+!!t,a=()=>Kx(e,o),o={knob:r,rest:[void 0,void 0],now:{on:t,translate:[`0px`,`0px`],width:1,height:1},position:dg(i,(e,t)=>{o.velocity=t,a()},Zx),velocity:0,size:dg(i,a,Qx),press:dg(0,a,$x),wobble:dg(0,a,eS),wobbleTimer:void 0};return iS.set(e,o),o}function Yx(e,t,n){let{rest:r,translate:i,width:a,height:o}=Wx(e,t.knob);t.rest[+!!n]=r,t.now={on:n,translate:i,width:a,height:o}}function Xx(e){return e.matches(`:disabled, [aria-disabled="true"]`)}var Zx,Qx,$x,eS,tS,nS,rS,iS,aS,oS=t((()=>{ig(),Gh(),bg(),Zx={stiffness:300,damping:24},Qx={stiffness:320,damping:16},$x={stiffness:700,damping:32},eS={stiffness:520,damping:9},tS=170,nS=-5,rS=`[data-slot=thumb], [data-slot=switch-thumb]`,iS=new WeakMap,aS={name:`switch`,selector:`[role=switch]`,press(e){if(Xx(e))return;let t=Ux(e.getAttribute(`aria-checked`)),n=Jx(e,t);if(n)return n.position.active||Yx(e,n,t),n.press.to(1),{release:()=>n.press.to(0)}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=Ux(r),a=Jx(e,Ux(n));a&&(Yx(e,a,i),a.position.to(+!!i),a.size.to(+!!i),clearTimeout(a.wobbleTimer),a.wobbleTimer=void 0,zh()||(a.wobbleTimer=setTimeout(()=>{a.wobbleTimer=void 0,a.wobble.to(0,{velocity:nS})},tS*ag())),Kx(e,a))}}}));function sS(e){let t=e.parentElement;if(!t||t.tagName!==`OL`&&t.tagName!==`UL`)return!1;let n=t.closest(`[role=region], [data-slot=toast-region]`);return!!n&&(SS(t)||SS(t.parentElement)||SS(n))}function cS(e){return e.top+e.height/2>innerHeight/2?`bottom`:`top`}function lS(e){return cS(e)===`bottom`?innerHeight-e.top:-(e.top+e.height)}function uS(e,t){if(t===`left`)return{axis:`x`,distance:-e.right};if(t===`right`)return{axis:`x`,distance:innerWidth-e.left};if(t===`up`)return{axis:`y`,distance:-e.bottom};if(t===`down`)return{axis:`y`,distance:innerHeight-e.top};let n=e.left+e.width/2;return Math.abs(n-innerWidth/2)<innerWidth/8?{axis:`y`,distance:lS(e)}:{axis:`x`,distance:n>innerWidth/2?innerWidth-e.left:-e.right}}function dS(e,t){let n=e.region.getAttribute(`data-align`);return n===`center`?e.region.getAttribute(`data-side`)===`top`?`up`:`down`:n===`start`||n===`end`?n===`start`==(getComputedStyle(e.region).direction===`rtl`)?`right`:`left`:t.getAttribute(`data-swipe-direction`)}function fS(e,t,n=!1){let r=`--reka-toast-swipe-${n?`end`:`move`}-${t}`;return Number.parseFloat(e.style.getPropertyValue(r)||e.style.getPropertyValue(`--toast-swipe-${t}`))||0}function pS(e,t,n,r){let i=Math.abs(t.value)<.01&&Math.abs(n.value)<.01,a=(e,t)=>`calc(${`${Math.round(e*100)/100}px`} + var(--reka-toast-swipe-move-${t}, var(--toast-swipe-${t}, 0px)))`;X(e,{translate:i&&!t.active&&!n.active?null:`${a(t.value,`x`)} ${a(n.value,`y`)}`,opacity:r&&(r.active||r.value<1)?String(r.value):null})}function mS(e,t){let n={element:e,rest:t},r=()=>pS(e,n.x,n.y,n.fade);return n.x=dg(0,r,fg.snappy),n.y=dg(0,r,fg.snappy),n}function hS(e,t){let n=e.velocity;e.set(e.value+t),e.to(0,{velocity:n})}function gS(e){for(let t of e.items.values()){if(!t.element.isConnected)continue;let e=t.element.getBoundingClientRect(),n={left:e.left-t.x.value-fS(t.element,`x`),top:e.top-t.y.value-fS(t.element,`y`),width:e.width,height:e.height},r=t.rest.left-n.left,i=t.rest.top-n.top;t.rest=n,Math.abs(r)>.5&&hS(t.x,r),Math.abs(i)>.5&&hS(t.y,i)}}function _S(e){if(e.watchFrames=12,e.frame)return;let t=()=>{gS(e),e.watchFrames=[...e.items.values()].some(e=>e.x.active||e.y.active)?Math.max(e.watchFrames,2):e.watchFrames-1,e.frame=e.watchFrames>0?requestAnimationFrame(t):0};e.frame=requestAnimationFrame(t)}function vS(e,t){let n=e.items.get(t);if(!n)return;e.items.delete(t),n.x.stop(),n.y.stop();let r=dS(e,t),i=t.getAttribute(`data-swipe`)===`end`||t.matches(`[data-slot=toast]`)&&t.hasAttribute(`data-swipe-direction`),a=i?t.getAttribute(`data-swipe-direction`):null,o=e.region.parentNode;if(o){let s=new DOMRect(n.rest.left+n.x.value+(i?fS(t,`x`,!0):0),n.rest.top+n.y.value+(i?fS(t,`y`,!0):0),n.rest.width,n.rest.height),c=Q_(t,o,e.region.nextSibling);if(X(c,{translate:null,opacity:null}),$_(c,s),zh()){let e=dg(1,t=>{X(c,{opacity:String(t)}),!e.active&&t===0&&c.remove()});e.to(0,{tween:bS})}else{let{axis:e,distance:t}=uS(s,a??r),n=dg(0,r=>{let i=`${Math.round(r*100)/100}px`;X(c,{translate:e===`x`?`${i} 0px`:`0px ${i}`}),((t>0?r>=t:r<=t)||!n.active)&&(n.stop(),c.remove())},fg.snappy);n.to(t)}}gS(e),_S(e),e.items.size||(e.observer.disconnect(),xS.delete(e.element))}function yS(e){let t=e.parentElement,n=xS.get(t);if(n)return n;let r={element:t,items:new Map,observer:new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLElement&&!e.isConnected&&vS(r,e)}),region:t.closest(`[role=region], [data-slot=toast-region]`)??t,watchFrames:0,frame:0};return r.observer.observe(t,{childList:!0}),xS.set(t,r),n=r,n}var bS,xS,SS,CS,wS=t((()=>{Gh(),ig(),bg(),tv(),bS=.15,xS=new WeakMap,SS=e=>!!e&&getComputedStyle(e).position===`fixed`,CS={name:`toast`,selector:`[role=region] li, [data-slot=toast]`,enter(e){if(!sS(e))return;let t=yS(e);if(t.items.has(e))return;gS(t);let n=e.getBoundingClientRect(),r=mS(e,{left:n.left,top:n.top,width:n.width,height:n.height});if(t.items.set(e,r),zh()){let t=dg(0,()=>pS(e,r.x,r.y,t));r.fade=t,t.set(0),t.to(1,{tween:bS})}else r.y.set(lS(n)),r.y.to(0);_S(t)}}}));function TS(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function ES(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}function DS(e){if(e.matches(xC))return e;if(e.matches(`[role=tooltip]`))return TS(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&TS(t)?e:null}function OS(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function kS(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=ES(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function AS(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);X(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function jS(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function MS(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}function NS(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function PS(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!TS(t))}function FS(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!TS(t)).map(e=>e.textContent??``).join(``)}function IS(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}function LS(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(CC).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(CC).join(` `)})`);X(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${CC(u)} ${CC(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of PS(e))X(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${CC((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;X(e.old.element,{scale:h,opacity:String(t),filter:`blur(${CC((1-t)*5)})`})}}function RS(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function zS(e){if(!RS(e)){e.old?.element.remove(),e.old=void 0,X(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of PS(e))X(t,{scale:null,opacity:null,filter:null});e.done?.()}}function BS(e,t,n){let r=getComputedStyle(e),i=jS(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:MS(i,t,n),trigger:n,mode:IS(e)||e.matches(xC)?`clip`:`scale`,handoff:!e.matches(xC),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{LS(a),zS(a)};return a.x=dg(t.left+t.width/2,o,sC),a.y=dg(t.top+t.height/2,o,sC),a.width=dg(t.width,o,lC),a.label=dg(1,o),a.fade=dg(1,o),a}function VS(e){return e.handoff?fC:pC}function HS(e,t,n){let r=ev(t,()=>{e.timers.delete(r),n(),zS(e)});e.timers.add(r)}function US(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function WS(e){US(e),yC.delete(e),bC===e&&(bC=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function GS(e){if(e){for(let e of yC)WS(e);for(let e of vC){let t=_C.get(e)?.box;t&&(US(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,zS(t))}}}function KS(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:SC(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function qS(e){return SC(e.side)?e.y:e.x}function JS(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=dg(n,()=>{LS(e),zS(e)});e.old={element:r,spring:i},i.to(0,{tween:mC})}function YS(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):PS(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function XS(e,t){let n=t.trigger?.getBoundingClientRect(),r=AS(e),i=BS(e,r,n);t.box=i,t.text=FS(i),t.label=YS(i),X(e,{opacity:null});let a=i.handoff&&bC&&KS(bC,i)?bC:void 0;if(a&&(bC=void 0),zh()){a&&ZS(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:gC});return}if(a){let e=YS(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;WS(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),JS(i,e,n),i.x.to(r.left+r.width/2,{preset:sC,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:sC,velocity:t.y[1]}),i.width.to(r.width,{preset:lC,velocity:t.width[1]}),HS(i,dC,()=>i.label.to(1,{tween:fC.labelIn})),i.holding=!1,LS(i);return}qS(i).set(NS(i)),i.width.set(Math.min(uC,r.width)),i.label.set(0),LS(i),qS(i).to(SC(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:cC});let o=VS(i);HS(i,o.widenAfter,()=>{i.width.to(r.width,{preset:lC}),HS(i,o.labelAfterRise,()=>i.label.to(1,{tween:o.labelIn}))}),i.holding=!1}function ZS(e,t){if(yC.add(e),e.holding=!1,t){e.done=()=>WS(e),e.fade.to(0,{tween:gC});return}e.handoff&&(bC=e),e.old&&e.old.spring.to(0,{tween:hC}),e.label.to(0,{tween:hC}),e.width.to(Math.min(uC,e.rest.width),{preset:lC});let n=VS(e);HS(e,n.sinkAfter,()=>{bC===e&&(bC=void 0),qS(e).to(NS(e),{preset:cC})}),HS(e,n.goneAfter,()=>WS(e))}function QS(e,t){if(!t.open)return;t.open=!1,vC.delete(e),t.stopWatch?.(),t.stopWatch=void 0,vC.size||oC();let n=t.box;if(t.box=void 0,X(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Q_(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;US(n),n.old?.element.remove(),X(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of PS(n))X(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=$S(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(X(c,{scale:null}),$_(c,n.rest));let l=BS(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:dg(s,()=>LS(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);LS(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});ZS(l,zh())}function $S(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function eC(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return eC(e,t,n,r-1);n()})}function tC(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):QS(e,t)});return n(),()=>r.disconnect()}function nC(e){let t=_C.get(e);if(t?.open)return;let n=kS(e);if(n&&Pg(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},_C.set(e,t),vC.add(e),aC(),X(e,{opacity:`0`}),t.stopWatch=tC(e,t);let i=t;eC(e,t,()=>XS(e,i))}function rC(){wC=0;for(let e of vC){let t=_C.get(e),n=t?.box;if(!t||!n)continue;let r=AS(e),i=FS(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!RS(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=kS(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=YS(n),n.rest=r,n.side=jS(e,r,c),n.edge=MS(n.side,r,c),zh()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:sC}),n.y.to(r.top+r.height/2,{preset:sC}),n.width.to(r.width,{preset:lC}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),JS(n,s,n.label.value),n.label.set(0),HS(n,dC,()=>n.label.to(1,{tween:VS(n).labelIn}))))}}function iC(){wC||=requestAnimationFrame(rC)}function aC(){EC??=Bh(GS),TC||(TC=!0,document.addEventListener(`pointerover`,iC,{capture:!0,passive:!0}),document.addEventListener(`focusin`,iC,{capture:!0,passive:!0}))}function oC(){TC=!1,cancelAnimationFrame(wC),wC=0,document.removeEventListener(`pointerover`,iC,{capture:!0}),document.removeEventListener(`focusin`,iC,{capture:!0})}var sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC=t((()=>{d_(),Gh(),ig(),bg(),tv(),sC={stiffness:480,damping:36},cC={stiffness:380,damping:26},lC={stiffness:440,damping:32},uC=30,dC=40,fC={widenAfter:120,labelAfterRise:70,labelIn:.24,sinkAfter:90,goneAfter:520},pC={widenAfter:60,labelAfterRise:40,labelIn:.18,sinkAfter:50,goneAfter:320},mC=.15,hC=.14,gC=.15,_C=new WeakMap,vC=new Set,yC=new Set,xC=`[data-motion-appear]`,SC=e=>e===`top`||e===`bottom`,CC=e=>`${Math.round(e*100)/100}px`,wC=0,TC=!1,DC={enter(e){DS(e)===e&&OS(e)&&nC(e)},state(e){if(DS(e)!==e)return;let t=_C.get(e);OS(e)?nC(e):t&&QS(e,t)}},OC={name:`tooltip`,selector:`[role=tooltip], :has(> [role=tooltip])`,...DC},kC={name:`appear`,selector:xC,...DC}})),jC,MC=t((()=>{bv(),Nv(),Ng(),Wv(),Py(),Vy(),$y(),_b(),ax(),Vx(),oS(),wS(),AC(),jC=[gb,ix,aS,yv,Uv,OC,kC,CS,Bx,Mg,My,Ny,Mv,By,Qy]}));function NC(e){let t=h_(e);return t.style.gridArea=`1 / 1`,{node:t,shown:1}}function PC(e){let t=f_(document.createElement(`span`));t.style.cssText=`display:inline-grid;overflow:hidden;justify-items:center`;let n=e?NC(e):void 0;return n&&t.append(n.node),{node:t,char:e,current:n,leaving:new Set}}function FC(e,t,n,r){e.shown=t;let i=1-t;X(e.node,{opacity:t>=1?null:String(Math.max(0,t)),filter:r||t>=1?null:`blur(${Math.max(0,HC*i).toFixed(2)}px)`,scale:r||t===1?null:String(1-.44999999999999996*i),translate:r||t===1?null:`0 ${(n*VC*i).toFixed(3)}em`})}function IC(e){return!e.frame.width.active&&e.columns.every(e=>!e.leaving.size&&!e.current?.fade)}function LC(e,t){KC.get(e)===t&&IC(t)&&(KC.delete(e),t.frame.collapse(t.text))}function RC(e,t,n=String){let r=n(t),i=KC.get(e),a=i?.text??e.textContent??``,o=i?.value??qC.get(e)??zC(a);if(qC.set(e,t),o===void 0||!i&&a===r||__(e)){if(i){for(let e of i.columns)for(let t of[e.current,...e.leaving])t?.fade?.stop();KC.delete(e)}x_(e,r);return}let s=t>o?1:t<o?-1:0,c=v_();if(!i){let t=y_(e)??b_(e,`end`,()=>{let t=KC.get(e);t&&LC(e,t)}),n=[...a].map(PC);t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),i={frame:t,text:a,value:o,columns:n},KC.set(e,i)}let l=i;l.frame.restore(),l.text=r,l.value=t,l.frame.name(r);let u=[...r],d=Math.max(u.length,l.columns.length);for(;l.columns.length<d;){let e=PC(``);l.frame.holder.prepend(e.node),l.columns.unshift(e)}let f=d-u.length;l.columns.forEach((t,n)=>{let r=u[n-f]??``;if(r===t.char)return;t.char=r;let i=t.current;if(i&&(i.fade?.stop(),t.leaving.add(i),i.fade=A_(i.shown,0,c?{duration:GC,ease:P_}:UC,e=>FC(i,e,-s,c),()=>{i.fade=void 0,i.node.remove(),t.leaving.delete(i),BC(e,l)})),t.current=void 0,!r)return;let a=NC(r);t.current=a,t.node.append(a.node),FC(a,0,s,c),a.fade=A_(0,1,c?{duration:GC,ease:P_}:WC,e=>FC(a,e,s,c),()=>{a.fade=void 0,FC(a,1,s,c),BC(e,l)})});let p=l.frame.width,m=l.columns.filter(e=>!e.char);for(let e of m)e.node.style.display=`none`;let h=l.frame.natural();for(let e of m)e.node.style.display=`inline-grid`;c?p.set(h):p.to(h)}function zC(e){let t=e.replace(/[^\d.-]/g,``),n=t?Number(t):NaN;return Number.isFinite(n)?n:void 0}function BC(e,t){KC.get(e)===t&&(t.columns=t.columns.filter(e=>e.char||e.leaving.size?!0:(e.node.remove(),!1)),LC(e,t))}var VC,HC,UC,WC,GC,KC,qC,JC=t((()=>{ig(),O_(),F_(),VC=1,HC=2,UC={duration:240,ease:N_},WC={duration:380,delay:60,ease:k_(.3,1.4,.5,1)},GC=150,KC=new WeakMap,qC=new WeakMap}));function YC(e,t,n){let r=e.width?n.width/e.width:1,i=e.height?n.height/e.height:1;return{x:n.left-t.x-r*(e.left-t.x),y:n.top-t.y-i*(e.top-t.y),scaleX:r,scaleY:i}}function XC(e){let{translate:t,scale:n}=e.style;X(e,{translate:null,scale:null});let r=e.getBoundingClientRect();X(e,{scale:`0.5`});let i=e.getBoundingClientRect();X(e,{translate:`100px 100px`});let a=e.getBoundingClientRect();return X(e,{translate:t,scale:n}),{box:r,origin:{x:2*i.left-r.left,y:2*i.top-r.top},pixels:{x:(a.left-i.left)/100||1,y:(a.top-i.top)/100||1}}}function ZC(e,t){let n=QC.get(e);if(g_(e)||v_())return n?.stop(),{done:Promise.resolve(!1),stop(){}};let{box:r,origin:i,pixels:a}=XC(e),o=t.to??r,s=t.preset??fg.snappy,c,l=new Promise(e=>{c=e}),u=()=>{if(QC.get(e)!==h)return;let n=YC(r,i,{left:f.left.value,top:f.top.value,width:f.width.value,height:f.height.value});X(e,{translate:`${n.x/a.x}px ${n.y/a.y}px`,scale:`${n.scaleX} ${n.scaleY}`}),$C.some(e=>f[e].active)||(m(),t.to||(QC.delete(e),X(e,{translate:null,scale:null})),c(!0))},d=e=>dg(t.from?.[e]??n?.parts[e].value??r[e],u,s),f={left:d(`left`),top:d(`top`),width:d(`width`),height:d(`height`)},p=$C.map(e=>n?.parts[e].velocity??0),m=Bh(e=>{if(e)for(let e of $C)f[e].set(o[e])}),h={parts:f,stop(){if(QC.get(e)===h){m();for(let e of $C)f[e].stop();QC.delete(e),X(e,{translate:null,scale:null}),c(!1)}}};return n?.stop(),QC.set(e,h),$C.forEach((e,t)=>f[e].to(o[e],{velocity:p[t]})),u(),{done:l,stop:h.stop}}var QC,$C,ew=t((()=>{Gh(),ig(),bg(),O_(),QC=new WeakMap,$C=[`left`,`top`,`width`,`height`]}));function tw(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}var nw=t((()=>{}));function rw(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function iw(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(dw))}function aw(e,t={}){let n=t.items??iw,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){X(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;X(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:dg(0,n,fg.snappy),y:dg(0,n,fg.snappy),grow:dg(1,n,ow),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),X(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:fg.snappy,velocity:n})}function f(t,n,r){if(!rw(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=tw(t);o.setAttribute(dw,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),X(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),zh()){let e=j_(.15,e=>X(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=fw(r.getBoundingClientRect()),t=fw(n),i=j_(lw,n=>{X(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},uw);s.stop=i.stop,i.done.then(c);return}let l=dg(1,e=>{X(o,{scale:(cw+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},sw);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=fw(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=Pg(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=fw(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!rw(a.rect)&&!rw(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!rw(n)||t.movesOnly)return;let o=l(e),s=_[i];if(zh())o.from={x:0,y:0,scale:1};else if(s){let e=fw(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:cw};o.grow.set(0),o.grow.to(1,zh()?{tween:.15}:{preset:ow})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}var ow,sw,cw,lw,uw,dw,fw,pw=t((()=>{F_(),nw(),d_(),Gh(),ig(),bg(),ow={stiffness:380,damping:26},sw={stiffness:260,damping:28},cw=.9,lw=.32,uw=k_(.5,0,.75,0),dw=`data-motion-ghost`,fw=e=>({x:e.left+e.width/2,y:e.top+e.height/2})})),mw=t((()=>{d_(),MC(),bv(),Nv(),Ng(),Wv(),Py(),Vy(),$y(),_b(),ax(),Vx(),oS(),wS(),AC(),ig(),Gh(),bg(),Ay(),dy(),JC(),O_(),F_(),H_(),ew(),pw()}));function hw(e){return typeof document>`u`?()=>{}:e_(e??document,{effects:jC})}var gw=t((()=>{MC(),d_()})),_w=t((()=>{mw(),gw()}));function vw(e){let t=e instanceof Element?e:e?.$el;return t instanceof HTMLElement?t:void 0}var yw=t((()=>{})),bw,xw=t((()=>{Y(),_w(),yw(),bw=W({inheritAttrs:!1,__name:`MotionList`,props:{origin:{type:Function},target:{type:Function}},setup(e){let t=eu(),n,r;function i(e){let t=vw(e);t!==n&&(r?.destroy(),n=t,r=t?aw(t):void 0)}Rd(()=>r?.measure()),zd(()=>r?.play({origin:e.origin,target:e.target?.()})),Bd(()=>{r?.destroy(),r=void 0,n=void 0});let a=()=>q(mf,t.default?.());return(e,t)=>Ql(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`motion-list`,ref:i},children:a()},()=>[Bu(`div`,Yu(e.$attrs,{ref:i,"data-slot":`motion-list`}),[Ql(e.$slots,`default`)],16)])}})})),Sw,Cw=t((()=>{xw(),xw(),Sw=bw})),ww,Tw=t((()=>{Y(),_w(),yw(),ww=W({inheritAttrs:!1,__name:`RollNumber`,props:{value:{},format:{type:Function},text:{}},setup(e){let t=e,n=e=>t.text??(t.format??String)(e),r=n(t.value),i=tc();function a(e){let r=vw(e);r&&(i.value&&r!==i.value&&(r.textContent=n(t.value)),i.value=r)}return U(()=>[i.value,t.value,t.text,t.format],([e,t])=>{e&&RC(e,t,n)},{flush:`post`}),(e,t)=>Ql(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`roll-number`,style:[e.$attrs.style,{fontVariantNumeric:`tabular-nums`}],ref:a},children:Wu(H(r))},()=>[Bu(`span`,Yu(e.$attrs,{ref:a,"data-slot":`roll-number`,style:{fontVariantNumeric:`tabular-nums`}}),ss(H(r)),17)])}})})),Ew,Dw=t((()=>{Tw(),Tw(),Ew=ww})),Ow=t((()=>{Y(),_w(),Cw(),Dw()})),kw=t((()=>{Ow()}));function Aw(e){return yl(jw,void 0)?.[e]??Df()?.appContext.components[e]}var jw,Mw=t((()=>{Y(),jw=Symbol(`ViteHubUIComponents`)}));function Nw(){let e=yl(Pw,void 0);return J(()=>({...Fw,...Object.fromEntries(Object.entries(rc(e)??{}).filter(([,e])=>e))}))}var Pw,Fw,Iw=t((()=>{Y(),Pw=Symbol(`ViteHubUIIcons`),Fw={arrowLeft:`i-lucide-arrow-left`,arrowUp:`i-lucide-arrow-up`,check:`i-lucide-check`,chevronLeft:`i-lucide-chevron-left`,chevronRight:`i-lucide-chevron-right`,close:`i-lucide-x`,copy:`i-lucide-copy`,copyCheck:`i-lucide-check`,loading:`i-lucide-loader-circle`,external:`i-lucide-external-link`,file:`i-lucide-file`,plus:`i-lucide-plus`,reload:`i-lucide-refresh-cw`,stop:`i-lucide-square`,comment:`i-lucide-message-circle`,commentList:`i-lucide-list`,commentPage:`i-lucide-square-pen`,delete:`i-lucide-trash-2`,edit:`i-lucide-pencil`,reopen:`i-lucide-rotate-ccw`}})),Lw,Rw=t((()=>{Lw={"i-lucide-arrow-left":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m12 19l-7-7l7-7m7 7H5`}]],"i-lucide-arrow-up":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m5 12l7-7l7 7m-7 7V5`}]],"i-lucide-arrow-up-right":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 7h10v10M7 17L17 7`}]],"i-lucide-check":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`}]],"i-lucide-circle-alert":[[`circle`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,cx:`12`,cy:`12`,r:`10`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01`}]],"i-lucide-copy":[[`rect`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],"i-lucide-external-link":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]],"i-lucide-file":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14 2v5a1 1 0 0 0 1 1h5`}]],"i-lucide-inbox":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M22 12h-6l-2 3h-4l-2-3H2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11`}]],"i-lucide-list":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13`}]],"i-lucide-loader-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 1 1-6.219-8.56`}]],"i-lucide-message-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719`}]],"i-lucide-pencil":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`}]],"i-lucide-plus":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`}]],"i-lucide-refresh-cw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H3v5`}]],"i-lucide-rotate-ccw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 3v5h5`}]],"i-lucide-send":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11zm7.318-19.539l-10.94 10.939`}]],"i-lucide-square":[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,rx:`2`}]],"i-lucide-square-pen":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`}]],"i-lucide-trash-2":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]],"i-lucide-x":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18 6L6 18M6 6l12 12`}]]}}));function zw(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:e.ownerDocument.body}function Bw(e){e.component(`UButton`,Hw),e.component(`UIcon`,Vw),e.component(`UModal`,Uw),e.component(`UTooltip`,Ww)}var Vw,Hw,Uw,Ww,Gw=t((()=>{Y(),Rw(),Vw=W({name:`UIcon`,inheritAttrs:!1,props:{name:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=Lw[e.name];return n?q(`svg`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`,fill:`none`,viewBox:`0 0 24 24`},n.map(([e,t])=>q(e,t))):q(`span`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`})}}}),Hw=W({name:`UButton`,inheritAttrs:!1,props:{color:{default:`primary`,type:String},disabled:{default:!1,type:Boolean},icon:{type:String},label:{type:String},loading:{default:!1,type:Boolean},size:{default:`md`,type:String},square:{default:!1,type:Boolean},to:{type:String},type:{default:`button`,type:String},variant:{default:`solid`,type:String}},setup(e,{attrs:t,slots:n}){return()=>{let r={...t,"aria-busy":e.loading?`true`:void 0,"data-color":e.color,"data-size":e.size,"data-square":e.square||!e.label&&!n.default?`true`:void 0,"data-variant":e.variant,"data-standalone-button":``},i=[e.icon?q(Vw,{name:e.icon}):null,e.label?q(`span`,e.label):null,n.default?.()];return e.to?q(`a`,{...r,href:e.to},i):q(`button`,{...r,disabled:e.disabled||e.loading,type:e.type},i)}}}),Uw=W({name:`UModal`,inheritAttrs:!1,props:{title:{type:String},ui:{default:()=>({}),type:Object}},setup(e,{slots:t}){let n=V(!1),r=V(null),i=V(null),a=()=>{n.value=!1,r.value?.querySelector(`button, a`)?.focus()},o=e=>{e.key===`Escape`&&n.value&&(e.stopPropagation(),a())};return U(n,e=>{e&&requestAnimationFrame(()=>i.value?.focus())}),Bd(()=>{n.value=!1}),()=>{let s=e.ui;return[q(`span`,{"data-slot":`standalone-modal-trigger`,onClick:()=>n.value=!0,ref:r},t.default?.()),n.value&&r.value?q(Ad,{to:zw(r.value)},q(`div`,{class:s.overlay,"data-slot":`standalone-modal`,onClick:e=>e.target===e.currentTarget&&a()},q(`div`,{"aria-label":e.title,"aria-modal":`true`,class:s.content,onKeydown:o,ref:i,role:`dialog`,tabindex:-1},t.content?.({close:a})))):null]}}}),Ww=W({name:`UTooltip`,inheritAttrs:!1,props:{text:String},setup(e,{slots:t}){return()=>(t.default?.()??[]).map(t=>Uu(t,{title:e.text}))}})})),Kw=n({uiSdkComponents:()=>Jw}),qw,Jw,Yw=t((()=>{Gw(),qw={name:`StandIn`,render:()=>null},Jw={UButton:Hw,UIcon:Vw,UModal:Uw,UTooltip:Ww,UDropdownMenu:qw,UInput:qw,UTabs:qw}}));function Xw(e){return zl({loader:()=>Promise.resolve(Kw).then(t=>t.uiSdkComponents[e]),suspensible:!1})}function Zw(e){let t=Aw(e);if(t)return t;let n=Qw.get(e)??Xw(e);return Qw.set(e,n),n}var Qw,$w=t((()=>{Yw(),Y(),Mw(),Qw=new Map}));function eT(e){if(!e)return!1;if(/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(e)||e.startsWith(`blob:`))return!0;try{let t=new URL(e,`https://vitehub.invalid`);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var tT,nT=t((()=>{Y(),Iw(),$w(),tT=W({name:`ImagePreview`,inheritAttrs:!1,props:{alt:{default:``,type:String},compact:{default:!1,type:Boolean},src:{default:``,type:String},title:{type:String}},setup(e){let t=V(!1),n=J(()=>e.alt||e.title||`Image`),r=Zw(`UModal`),i=Zw(`UButton`),a=Nw();return U(()=>e.src,()=>{t.value=!1}),()=>eT(e.src)?q(r,{title:n.value,transition:!1,ui:{overlay:`vh-image-overlay`,content:`vh-image-dialog`}},{default:()=>q(`button`,{"aria-label":`Preview ${n.value}`,class:[`vh-image-preview`,e.compact&&`vh-image-preview--compact`],title:e.title||n.value,type:`button`},t.value?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:n.value,loading:`lazy`,onError:()=>{t.value=!0},src:e.src})),content:({close:r})=>[q(`div`,{class:`vh-image-dialog__toolbar`},[q(`span`,{class:`vh-image-dialog__name`,title:n.value},n.value),q(i,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,icon:a.value.external,external:!0,to:e.src,target:`_blank`,rel:`noreferrer`,variant:`ghost`}),q(i,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:a.value.close,onClick:r,variant:`ghost`})]),t.value?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:n.value,class:`vh-image-dialog__image`,onError:()=>{t.value=!0},src:e.src})]}):q(`span`,{class:`vh-image-unavailable`},n.value)}})})),rT,iT,aT=t((()=>{Y(),kw(),Iw(),pw(),ew(),nT(),$w(),rT=250,iT=W({name:`CommentImageStack`,props:{images:{required:!0,type:Array},disabled:{default:!1,type:Boolean},origin:{type:Function}},emits:[`remove`],setup(e,{emit:t}){let n=Nw(),r=Zw(`UButton`),i=V(),a=V(),o=V(!1),s=V({left:0,width:0,scrollable:!1,below:!1}),c,l,u,d=!1,f=!1,p=!1,m,h=()=>[...a.value?.children??[]].filter(e=>e instanceof HTMLElement&&e.hasAttribute(`data-key`)&&!e.hasAttribute(`data-motion-ghost`));function g(){let t=i.value;if(!t)return;let n=(t.closest(`[data-slot=comment-composer-box]`)??t).getBoundingClientRect(),r=Math.max(0,n.left),a=t.ownerDocument.documentElement,o=Math.max(0,Math.min(a.clientWidth,n.right)-r),c=t.getBoundingClientRect(),l=r-c.left,u=Number.parseFloat(getComputedStyle(a).fontSize)||16,d=o<(e.images.length*4+.5)*u,f=c.top<4.5*u&&a.clientHeight-c.bottom>c.top;(s.value.left!==l||s.value.width!==o||s.value.scrollable!==d||s.value.below!==f)&&(s.value={left:l,width:o,scrollable:d,below:f})}function _(t){clearTimeout(u),t&&e.images.length===0&&(t=!1),o.value!==t&&(m=new Map(h().map(e=>[e,e.getBoundingClientRect()])),t&&g(),o.value=t)}let v=()=>{clearTimeout(u),u=setTimeout(()=>{!f&&!d&&_(!1)},rT)};Ld(()=>{a.value&&(l=aw(a.value));let e=i.value?.closest(`[data-slot=comment-composer-box]`);e&&typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{o.value&&g()}),c.observe(e))}),Rd(()=>{m||l?.measure()}),zd(()=>{e.images.length===0&&o.value&&_(!1),o.value&&g();let t=m;if(m=void 0,!t)return l?.play({origin:e.origin?.()??void 0});for(let[e,n]of t)e.isConnected&&ZC(e,{from:n})}),Bd(()=>{clearTimeout(u),c?.disconnect(),l?.destroy()});let y=J(()=>e.images.length===1?`1 picture`:`${e.images.length} pictures`);return()=>{let c=e.images.length;return q(`div`,{"data-fanned":o.value?`true`:void 0,"data-slot":`comment-image-stack`,onFocusin:e=>{f=!0,p||e.target instanceof Element&&e.target.matches(`:focus-visible`)&&_(!0)},onFocusout:e=>{e.relatedTarget instanceof Node&&i.value?.contains(e.relatedTarget)||(f=!1,v())},onKeydown:e=>{e.key===`Escape`&&o.value&&(e.preventDefault(),e.stopPropagation(),_(!1),p=!0,i.value?.querySelector(`[data-slot=comment-image-stack-toggle]`)?.focus(),p=!1)},onPointerenter:e=>{e.pointerType===`mouse`&&(d=!0,_(!0))},onPointerleave:e=>{e.pointerType===`mouse`&&(d=!1,v())},ref:i,role:`group`,"aria-label":`Attached ${y.value}`,style:{"--vh-fan-left":`${s.value.left}px`,"--vh-fan-room":`${s.value.width}px`,"--vh-fan-count":c}},[q(`button`,{"aria-expanded":String(o.value),"aria-label":`Show ${y.value}`,"data-slot":`comment-image-stack-toggle`,onClick:()=>_(d||!o.value),type:`button`}),q(`div`,{"data-slot":`comment-image-stack-cards`,"data-scrollable":o.value&&s.value.scrollable?`true`:void 0,"data-below":s.value.below?``:void 0,ref:a},e.images.map((i,a)=>q(`div`,{"data-key":i.key,"data-slot":`comment-image-stack-card`,inert:!o.value||void 0,key:i.key,style:{"--vh-stack-depth":c-1-a}},[q(tT,{alt:i.name,compact:!0,src:i.url}),q(r,{"aria-label":`Remove ${i.name}`,color:`neutral`,"data-slot":`comment-image-stack-remove`,disabled:e.disabled,icon:n.value.close,onClick:()=>t(`remove`,i.key),size:`xs`,square:!0,variant:`ghost`})]))),c>1?q(Ew,{value:c},{render:({props:e,children:t})=>q(`span`,{...e,"aria-hidden":`true`,"data-slot":`comment-image-stack-count`},[t])}):null])}}})})),oT,sT,cT=t((()=>{Y(),oT=[`data-status`,`data-size`,`data-orientation`],sT=W({__name:`Attachment`,props:{status:{default:`done`},size:{default:`md`},orientation:{default:`horizontal`}},setup(e){return(t,n)=>(G(),K(`div`,{"data-slot":`attachment`,"data-status":e.status,"data-size":e.size,"data-orientation":e.orientation},[Ql(t.$slots,`default`)],8,oT))}})})),lT,uT=t((()=>{cT(),cT(),lT=sT})),dT,fT=t((()=>{dT={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}})),pT,mT=t((()=>{pT=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)}}));function hT(e){return e!=null}function gT(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??dT.width,a=e.size??e.height??dT.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?pT(...c):pT(`lucide`,...s,...c),u=t.strokeWidth??dT[`stroke-width`];if(t.absoluteStrokeWidth){let n=Number(u)*Number(e.size??e.width??dT.width)/Number(t.size??t.width??dT.width);Number.isFinite(n)&&(u=n)}return[`svg`,{...Object.entries(dT).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&hT(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&hT(t.width)&&{[r(`width`)]:t.width},...`height`in t&&hT(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}var _T=t((()=>{fT(),mT()})),vT,yT=t((()=>{vT=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1}})),bT,xT=t((()=>{bT=e=>e===``})),ST,CT=t((()=>{ST=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase()}));function wT(){return yl(TT,{})}var TT,ET=t((()=>{Y(),TT=Symbol(`lucide-icons`)})),DT,OT=t((()=>{Y(),_T(),yT(),xT(),CT(),ET(),DT=({name:e,iconNode:t,"icon-node":n,icon:r={name:e&&ST(e),node:t??n??[],size:24,aliases:[]},absoluteStrokeWidth:i,"absolute-stroke-width":a,nonScalingStroke:o,"non-scaling-stroke":s,strokeWidth:c,"stroke-width":l,size:u,width:d=u,height:f=u,color:p,...m},{slots:h})=>{let{size:g,color:_,strokeWidth:v=2,absoluteStrokeWidth:y=!1,nonScalingStroke:b=!1,class:x=``}=wT(),S=bT(i)||bT(a)||i===!0||a===!0||y===!0,C=bT(o)||bT(s)||o===!0||s===!0||b===!0;delete m.class;let w=h.default?.(),[,T,E=[]]=gT(r,{color:p??_,width:d??u??g,height:f??u??g,strokeWidth:c??l??v,absoluteStrokeWidth:S,nonScalingStroke:C,className:x,hasA11yProp:w!=null&&w.length>0||vT(m),attributes:m});return q(`svg`,T,[...E.map(([e,t])=>q(e,t)),...w??[]])}}));function kT(e,t=[]){let n=typeof e==`string`?{name:e,node:t}:e;return(e,{slots:t})=>q(DT,{...e,icon:n},t.default?{default:t.default}:void 0)}var AT=t((()=>{Y(),OT()})),jT,MT,NT=t((()=>{AT(),jT={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]},MT=kT(jT)})),PT,FT,IT=t((()=>{AT(),PT={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]},FT=kT(PT)})),LT,RT,zT=t((()=>{AT(),LT={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]},RT=kT(LT)})),BT,VT,HT=t((()=>{AT(),BT={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]},VT=kT(BT)})),UT,WT,GT=t((()=>{AT(),UT={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]},WT=kT(UT)})),KT,qT,JT=t((()=>{AT(),KT={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]},qT=kT(KT)})),YT,XT,ZT=t((()=>{AT(),YT={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]},XT=kT(YT)})),QT,$T,eE=t((()=>{AT(),QT={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]},$T=kT(QT)})),tE,nE,rE=t((()=>{AT(),tE={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]},nE=kT(tE)})),iE,aE,oE=t((()=>{AT(),iE={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]},aE=kT(iE)})),sE,cE,lE=t((()=>{AT(),sE={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]},cE=kT(sE)})),uE=t((()=>{AT(),NT(),IT(),zT(),HT(),GT(),JT(),ZT(),eE(),rE(),oE(),lE(),ET(),OT()})),dE,fE,pE=t((()=>{Y(),uE(),dE=[`aria-label`,`disabled`],fE=W({__name:`AttachmentAction`,props:{label:{default:`Remove`},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(G(),K(`button`,{type:`button`,"data-slot":`attachment-action`,"aria-label":e.label,disabled:e.disabled},[Ql(t.$slots,`default`,{},()=>[Cf(H(cE),{"aria-hidden":`true`})])],8,dE))}})})),mE,hE=t((()=>{pE(),pE(),mE=fE})),gE,_E,vE=t((()=>{Y(),gE={"data-slot":`attachment-actions`},_E=W({__name:`AttachmentActions`,setup(e){return(e,t)=>(G(),K(`div`,gE,[Ql(e.$slots,`default`)]))}})})),yE,bE=t((()=>{vE(),vE(),yE=_E})),xE,SE,CE=t((()=>{Y(),xE={"data-slot":`attachment-content`},SE=W({__name:`AttachmentContent`,setup(e){return(e,t)=>(G(),K(`div`,xE,[Ql(e.$slots,`default`)]))}})})),wE,TE=t((()=>{CE(),CE(),wE=SE})),EE,DE,OE=t((()=>{Y(),EE={"data-slot":`attachment-group`},DE=W({__name:`AttachmentGroup`,setup(e){return(e,t)=>(G(),K(`div`,EE,[Ql(e.$slots,`default`)]))}})})),kE,AE=t((()=>{OE(),OE(),kE=DE})),jE,ME,NE=t((()=>{Y(),jE=[`data-kind`],ME=W({__name:`AttachmentMedia`,props:{kind:{default:`icon`}},setup(e){return(t,n)=>(G(),K(`div`,{"data-slot":`attachment-media`,"data-kind":e.kind},[Ql(t.$slots,`default`)],8,jE))}})})),PE,FE=t((()=>{NE(),NE(),PE=ME})),IE,LE,RE=t((()=>{Y(),IE={"data-slot":`attachment-title`},LE=W({__name:`AttachmentTitle`,setup(e){return(e,t)=>(G(),K(`span`,IE,[Ql(e.$slots,`default`)]))}})})),zE,BE=t((()=>{RE(),RE(),zE=LE})),VE=t((()=>{uT(),hE(),bE(),TE(),Y(),AE(),FE(),BE()})),HE=t((()=>{VE()}));function UE(e){let t=e.replace(/@.*/,``).trim().split(/[\s._-]+/).filter(Boolean),n=t[0]??``,r=t.length>1?t.at(-1)??``:n.slice(1);return(n.slice(0,1)+r.slice(0,1)).toUpperCase()||`?`}var WE=t((()=>{})),GE,KE,qE,JE,YE,XE,ZE=t((()=>{Y(),Ow(),WE(),GE=[`data-size`,`data-variant`,`aria-label`],KE=[`title`],qE=[`src`],JE={key:1,"data-slot":`avatar-stack-fallback`},YE=[`title`],XE=W({__name:`AvatarStack`,props:{people:{},max:{default:3},size:{default:`md`},variant:{default:`solid`}},setup(e){let t=J(()=>{let t=new Set;return e.people.filter(e=>!t.has(e.id)&&t.add(e.id))}),n=J(()=>{let n=e.max===null?1/0:Math.max(2,e.max);return t.value.length>n?t.value.slice(0,n-1):t.value}),r=J(()=>t.value.slice(n.value.length)),i=J(()=>`${t.value.length} ${t.value.length===1?`person`:`people`}: ${t.value.map(e=>e.name).join(`, `)}`);return(t,a)=>(G(),K(`div`,{"data-slot":`avatar-stack`,"data-size":e.size,"data-variant":e.variant,role:`group`,"aria-label":i.value},[(G(!0),K(mf,null,Xl(n.value,e=>(G(),K(`span`,{key:e.id,"data-slot":`avatar-stack-item`,"aria-hidden":`true`,title:e.name,style:ao(e.color?{"--vh-avatar-color":e.color}:void 0)},[e.image?(G(),K(`img`,{key:0,"data-slot":`avatar-stack-image`,alt:``,src:e.image},null,8,qE)):(G(),K(`span`,JE,ss(H(UE)(e.name)),1))],12,KE))),128)),r.value.length?(G(),K(`span`,{key:0,"data-slot":`avatar-stack-count`,"aria-hidden":`true`,title:r.value.map(e=>e.name).join(`, `)},[a[0]||=Wu(`+`,-1),Cf(H(Ew),{value:r.value.length},null,8,[`value`])],8,YE)):Gu(``,!0)],8,GE))}})})),QE,$E=t((()=>{ZE(),ZE(),QE=XE})),eD=t((()=>{$E()})),tD=t((()=>{eD()}));function nD(){return yl(rD,void 0)}var rD,iD=t((()=>{Y(),rD=Symbol(`PromptInput`)})),aD,oD,sD,cD=t((()=>{Y(),uE(),iD(),aD=[`accept`,`aria-label`,`disabled`,`multiple`],oD=[`data-variant`,`aria-label`,`disabled`],sD=W({inheritAttrs:!1,__name:`PromptInputAttach`,props:{variant:{default:`outline`},disabled:{type:Boolean,default:!1},label:{default:`Add attachment`}},setup(e){let t=tu(),n=nD(),r=Pl(`input`);n&&ps(n.addAttach(()=>e.disabled));let i=()=>e.disabled||(n?.disabled.value??!0);async function a(e){let t=e.currentTarget;t instanceof HTMLInputElement&&n&&(await n.addFiles(t.files??[]),t.value=``)}return(o,s)=>H(n)?(G(),K(mf,{key:0},[Bu(`input`,{ref_key:`input`,ref:r,type:`file`,"data-slot":`visually-hidden`,tabindex:`-1`,accept:H(n).accept.value,"aria-label":e.label,disabled:i(),multiple:!H(n).single.value,onChange:a},null,40,aD),Bu(`button`,Yu(H(t),{type:`button`,"data-slot":`prompt-input-attach`,"data-variant":e.variant,"aria-label":e.label,disabled:i(),onClick:s[0]||=e=>r.value?.click()}),[Ql(o.$slots,`default`,{},()=>[Cf(H(XT),{"data-slot":`prompt-input-attach-icon`,"aria-hidden":`true`})])],16,oD)],64)):Gu(``,!0)}})})),lD,uD=t((()=>{cD(),cD(),lD=sD})),dD,fD,pD=t((()=>{Y(),uE(),VE(),iD(),dD=[`src`,`alt`],fD=W({__name:`PromptInputAttachments`,props:{disabled:{type:Boolean,default:!1}},setup(e){let t=nD();return(n,r)=>H(t)&&H(t).files.value.length>0?(G(),Lu(H(kE),{key:0,"data-slot":`prompt-input-attachments`},{default:gl(()=>[(G(!0),K(mf,null,Xl(H(t).files.value,(n,r)=>(G(),Lu(H(lT),{key:`${n.filename}-${r}`,size:`xs`},{default:gl(()=>[Cf(H(PE),{kind:n.mediaType.startsWith(`image/`)?`image`:`icon`},{default:gl(()=>[n.mediaType.startsWith(`image/`)?(G(),K(`img`,{key:0,src:n.url,alt:n.filename??n.mediaType},null,8,dD)):(G(),Lu(H(FT),{key:1,"aria-hidden":`true`}))]),_:2},1032,[`kind`]),Cf(H(wE),null,{default:gl(()=>[Cf(H(zE),null,{default:gl(()=>[Wu(ss(n.filename??n.mediaType),1)]),_:2},1024)]),_:2},1024),Cf(H(yE),null,{default:gl(()=>[Cf(H(mE),{label:`Remove ${n.filename??`attachment`}`,disabled:e.disabled||H(t).disabled.value,onClick:e=>H(t).removeFile(r)},null,8,[`label`,`disabled`,`onClick`])]),_:2},1024)]),_:2},1024))),128))]),_:1})):Gu(``,!0)}})})),mD,hD=t((()=>{pD(),pD(),mD=fD})),gD,_D,vD=t((()=>{Y(),uE(),iD(),gD=[`data-status`,`data-variant`,`data-loading`,`aria-label`,`disabled`],_D=W({inheritAttrs:!1,__name:`PromptInputSubmit`,setup(e){let t=tu(),n=nD(),r={error:`Retry prompt`,ready:`Send prompt`,streaming:`Stop response`,submitted:`Stop response`},i=J(()=>n?.status.value??`ready`),a=J(()=>i.value===`ready`&&n?.submitLabel.value||r[i.value]),o=J(()=>i.value===`ready`&&!!(n?.preparing.value||n?.readonly.value)),s=J(()=>i.value===`ready`&&!n?.canSubmit.value||i.value===`error`&&!!n?.disabled.value),c=J(()=>i.value===`ready`&&!n?.canSubmit.value?`soft`:`solid`),l=J(()=>({canSubmit:n?.canSubmit.value??!1,preparing:n?.preparing.value??!1,status:i.value}));return(e,r)=>H(n)?(G(),K(mf,{key:0},[r[1]||=Bu(`span`,{"data-slot":`prompt-input-spacer`},null,-1),Bu(`button`,Yu(H(t),{type:`button`,"data-slot":`prompt-input-submit`,"data-status":i.value,"data-variant":c.value,"data-loading":o.value?``:void 0,"aria-label":a.value,disabled:s.value||o.value,onClick:r[0]||=e=>H(n).press()}),[Ql(e.$slots,`default`,co(Hu(l.value)),()=>[o.value?(G(),Lu(H(VT),{key:0,class:`vh-prompt-input-spinner`,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`ready`?(G(),Lu(H(MT),{key:1,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`error`?(G(),Lu(H($T),{key:2,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):(G(),Lu(H(aE),{key:3,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`}))])],16,gD)],64)):Gu(``,!0)}})})),yD,bD=t((()=>{vD(),vD(),yD=_D})),xD,SD,CD=t((()=>{Y(),iD(),X_(),xD=[`aria-label`,`enterkeyhint`,`placeholder`,`aria-busy`,`disabled`,`readonly`,`value`],SD=W({__name:`PromptInputTextarea`,setup(e){let t=nD(),n=V(!1);Ld(()=>{n.value=Y_()});function r(e){!t||e.key!==`Enter`||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.isComposing||Y_()||(e.preventDefault(),t.status.value===`ready`&&!t.disabled.value&&!t.readonly.value&&t.requestSubmit())}async function i(e){let n=e.clipboardData;if(!t?.takesFiles.value||!n)return;let r=n.getData(`text/plain`).length>0,i=Array.from(n.files).filter(e=>e.type.startsWith(`image/`)||!r);i.length>0&&await t.addFiles(i,()=>e.preventDefault())}function a(e){t&&e.target instanceof HTMLTextAreaElement&&(t.text.value=e.target.value)}return(e,o)=>H(t)?(G(),K(`textarea`,{key:0,"data-slot":`prompt-input-textarea`,"aria-label":H(t).label.value,enterkeyhint:n.value?`enter`:`send`,placeholder:H(t).placeholder.value,"aria-busy":H(t).readonly.value?`true`:void 0,disabled:H(t).disabled.value,readonly:H(t).readonly.value,rows:`1`,value:H(t).text.value,onInput:a,onKeydown:r,onPaste:i},null,40,xD)):Gu(``,!0)}})})),wD,TD=t((()=>{CD(),CD(),wD=SD})),ED,DD,OD=t((()=>{Y(),ED={"data-slot":`prompt-input-toolbar`},DD=W({__name:`PromptInputToolbar`,setup(e){return(e,t)=>(G(),K(`div`,ED,[Ql(e.$slots,`default`)]))}})})),kD,AD=t((()=>{OD(),OD(),kD=DD})),jD,MD,ND=t((()=>{Y(),iD(),X_(),uD(),hD(),bD(),TD(),AD(),jD={"data-focus-frame":``,"data-slot":`prompt-input-group`},MD=W({inheritAttrs:!1,__name:`PromptInput`,props:{modelValue:{},defaultValue:{default:``},files:{},defaultFiles:{},status:{default:`ready`},accept:{},single:{type:Boolean,default:!1},filterFiles:{type:Function},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{},submitLabel:{}},emits:[`update:modelValue`,`update:files`,`submit`,`stop`,`retry`,`error`],setup(e,{emit:t}){let n=t,r=tu(),i=Pl(`form`),a=V(e.defaultValue),o=J({get:()=>e.modelValue??a.value,set:e=>{a.value=e,n(`update:modelValue`,e)}}),s=tc(e.defaultFiles??[]),c=J(()=>e.files??s.value);function l(e){s.value=e,n(`update:files`,e)}let u=V(0),d=J(()=>u.value>0),f=J(()=>e.status===`ready`&&!e.disabled&&!e.readonly&&!d.value&&(o.value.trim().length>0||c.value.length>0)),p=tc([]),m=J(()=>!e.disabled&&p.value.some(e=>!e()));function h(e){return p.value=[...p.value,e],()=>{p.value=p.value.filter(t=>t!==e)}}let g=!1,_=0,v=new Map;Bd(()=>{g=!0});async function y(t,r){if(e.disabled)return;let i=_++;u.value++;try{let n=Array.from(t),a=e.filterFiles?.(n)??n;if(a.length===0)return;r?.();let o=await Promise.all(Array.from(a,J_));g||v.set(i,o)}catch(e){g||n(`error`,{error:e})}finally{if(u.value--,!g&&u.value===0&&v.size>0){let t=[...v].sort(([e],[t])=>e-t).flatMap(([,e])=>e);v.clear(),l(K_(c.value,t,e.single))}}}function b(e){e.preventDefault(),f.value&&n(`submit`,{files:c.value,text:o.value.trim()})}return vl(rD,{text:o,files:c,status:J(()=>e.status),disabled:J(()=>e.disabled),readonly:J(()=>e.readonly),placeholder:J(()=>e.placeholder),accept:J(()=>e.accept),single:J(()=>e.single),submitLabel:J(()=>e.submitLabel),label:J(()=>typeof r[`aria-label`]==`string`?r[`aria-label`]:`Message`),canSubmit:f,preparing:d,takesFiles:m,addAttach:h,addFiles:y,removeFile:t=>{e.disabled||l(c.value.filter((e,n)=>n!==t))},requestSubmit:()=>i.value?.requestSubmit(),press:()=>{e.status===`streaming`||e.status===`submitted`?n(`stop`):e.status===`error`?n(`retry`):i.value?.requestSubmit()}}),(t,n)=>(G(),K(`form`,Yu({ref_key:`form`,ref:i},H(r),{"data-slot":`prompt-input`,onSubmit:b}),[Bu(`div`,jD,[Ql(t.$slots,`default`,{canSubmit:f.value,preparing:d.value,status:e.status},()=>[Cf(mD),Cf(wD),Cf(kD,null,{default:gl(()=>[Cf(lD),Cf(yD)]),_:1})])])],16))}})})),PD,FD=t((()=>{ND(),ND(),PD=MD})),ID=t((()=>{FD(),uD(),hD(),bD(),TD(),AD()})),LD=t((()=>{ID()})),RD,zD,BD,VD,HD,UD,WD,GD,KD=t((()=>{Y(),Up(),Fh(),H_(),Th(),G_(),Z_(),aT(),$w(),Iw(),HE(),tD(),LD(),RD=/^\S{2,}$/u,zD={comment:`Add a comment`,edit:`Edit your comment`,reply:`Reply`},BD={comment:`Comment`,edit:`Save`,reply:`Reply`},VD={comment:`Comment`,edit:`Edit comment`,reply:`Reply`},HD=e=>{let t=e.getData(`text/plain`).length>0;return Array.from(e.files).filter(e=>e.type.startsWith(`image/`)||!t)},UD=2e3,WD=1e3,GD=W({name:`CommentComposer`,props:{modelValue:{default:``,type:String},mentions:{default:()=>[],type:Array},files:{type:Array},user:{type:Object},variant:{default:`comment`,type:String},placeholder:{type:String},busy:{default:!1,type:Boolean},error:{type:String},autofocus:{default:!0,type:Boolean},guard:{default:!0,type:Boolean},people:{default:()=>[],type:Array},participants:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},allowEmpty:{default:void 0,type:Boolean},layout:{default:`box`,type:String},size:{default:`md`,type:String},frame:{default:`field`,type:String}},emits:[`update:modelValue`,`update:mentions`,`update:files`,`submit`,`cancel`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=W_(),a=V(null),o=V(null),s=V(null),c=V(),l=V(!1),u=new Map,d=Ml(),f=e=>`${d}-option-${e}`,p,m=V(!1),h;U(m,e=>{clearTimeout(h),e&&(h=setTimeout(()=>m.value=!1,UD))});let g=0,_,v,y=V([]),b=J(()=>e.files??y.value);U([()=>e.modelValue,b],()=>m.value=!1);let x=J(()=>e.attachments&&e.variant!==`edit`),S=J(()=>e.allowEmpty??e.variant===`reply`),C=new WeakMap,w=new Set,T=[],E=e=>{let t=C.get(e);return t||(t={filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:URL.createObjectURL(e)},C.set(e,t),w.add(t.url)),t},D=J(()=>b.value.map(E));U(()=>[...b.value],(e,t)=>{for(let n of t){let t=C.get(n);t&&!e.includes(n)&&(C.delete(n),T.push(setTimeout(()=>{URL.revokeObjectURL(t.url),w.delete(t.url)},WD)))}});function O(n){e.busy||(y.value=n,c.value=void 0,t(`update:files`,n))}function k(t){if(!x.value)return[];let n=Array.from(t).filter(t=>q_(t,e.accept));return n.length>0&&O([...b.value,...n]),n}let A=J(()=>[...e.people,...i?.people.value??[]]),ee=e=>{let t=A.value.find(t=>t.id===e);return u.get(e)??(t?Ch(t):void 0)},j=()=>e.users?e.users:i?i.users:e.people.length>0?async()=>e.people:void 0,M=()=>e.user?.id??i?.user.value?.id,N=()=>a.value?.querySelector(`textarea`)??null,te=()=>e.modelValue.trim().length>0,P=()=>te()||b.value.length>0,F=()=>N()?.focus(),I=V(!1),ne=0;function re(){let t=N(),n=t?.parentElement;if(e.layout!==`row`||!t||!n||!e.modelValue){I.value=!1;return}let r=getComputedStyle(t),i=Number.parseFloat(r.lineHeight);if(!(i>0))return;I.value?(t.style.boxSizing=`border-box`,t.style.maxWidth=`${n.clientWidth-ne}px`):ne=n.clientWidth-t.offsetWidth;let a=t.scrollHeight-Number.parseFloat(r.paddingTop)-Number.parseFloat(r.paddingBottom);t.style.removeProperty(`box-sizing`),t.style.removeProperty(`max-width`),I.value=a>i*1.5}let L=typeof ResizeObserver==`function`?new ResizeObserver(()=>re()):void 0;U([()=>e.modelValue,()=>e.layout,()=>e.size],re,{flush:`post`});async function ie(){let e=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;o.value=null,await ol(),a.value?.offsetWidth,o.value=e?`flash`:`shake`,!e&&a.value&&L_(a.value),clearTimeout(p),p=setTimeout(()=>o.value=null,450),F()}let ae=e=>{e instanceof CustomEvent&&e.detail?.escape===!0&&(m.value=!0),ie()};Ld(()=>{a.value?.addEventListener(Bp,ae);let t=N()?.parentElement;t&&L?.observe(t),re(),e.autofocus&&ol(F)}),Bd(()=>{L?.disconnect(),a.value?.removeEventListener(Bp,ae),clearTimeout(p),clearTimeout(h);for(let e of T)clearTimeout(e);for(let e of w)URL.revokeObjectURL(e)}),n({focus:F,shake:ie}),U(s,e=>{let t=N();if(!t)return;t.setAttribute(`role`,`combobox`),t.setAttribute(`aria-autocomplete`,`list`);let n=e!==null&&e.items.length>0;t.setAttribute(`aria-expanded`,String(n)),n?(t.setAttribute(`aria-controls`,`${d}-list`),t.setAttribute(`aria-activedescendant`,f(e.index))):(t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`))},{deep:!0}),Fp(n=>{e.guard&&a.value&&!Hp(n).includes(a.value)&&(zp.add(n),P()?(n.stopPropagation(),Pp(),ie()):t(`cancel`))});function R(){let e=N();!e||e.selectionStart===_&&e.selectionEnd===_||(g++,_=void 0,s.value=null)}function oe(n){R();let r=N(),i=s.value;if(!r||!i)return;if(r.selectionStart!==r.selectionEnd||r.value.slice(0,r.selectionStart)!==i.before){s.value=null;return}let a=r.selectionStart,o=`@${Ch(n)} `,c=e.modelValue.slice(0,i.start)+o+e.modelValue.slice(a).replace(/^ /u,``);u.set(n.id,Ch(n)),t(`update:modelValue`,c),e.mentions.includes(n.id)||t(`update:mentions`,[...e.mentions,n.id]),s.value=null,ol(()=>{let e=i.start+o.length;r.setSelectionRange(e,e),r.focus()})}async function se(t){let n=++g;_=t.selectionStart;let r=j(),i=t.value.slice(0,t.selectionStart),a=t.selectionStart===t.selectionEnd?Eh(t.value,t.selectionStart):void 0;if(a?.start!==v&&(v=void 0),!r||!a||a.start===v){s.value=null;return}let o=[],c=!1;try{o=await r(a.query)}catch(e){c=!0,console.warn(`[vitehub] The comment box could not load people to mention:`,e)}let l=Dh(o,a.query,{exclude:M(),participants:e.participants});if(R(),n!==g||a.start===v)return;let u=t.selectionStart===t.selectionEnd&&t.value.slice(0,t.selectionStart)===i,d=l.length>0||RD.test(a.query);s.value=u&&d?{before:i,failed:c,index:0,items:l,query:a.query,start:a.start}:null}function ce(n){if(e.busy)return;let r=[...b.value];if(!n.text&&(r.length===0||!S.value)){r.length>0&&(c.value=`Write a comment to send with the files.`);return}let i=e.mentions.filter(e=>{let t=ee(e);if(t===void 0)return!1;let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|[^\\p{L}\\p{N}\\p{M}_])@${r}(?=$|[^\\p{L}\\p{N}\\p{M}_])`,`iu`).test(n.text)});t(`submit`,{body:n.text,files:r,mentions:[...i]})}function le(e){if(e.isComposing||e.target instanceof Element&&e.target.closest(`[data-slot=comment-image-stack][data-fanned]`))return;let t=s.value,n=t!==null&&t.items.length>0;if(n&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault();let n=e.key===`ArrowDown`?1:-1;t.index=(t.index+n+t.items.length)%t.items.length}else n&&(e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey?(e.preventDefault(),e.stopPropagation(),oe(t.items[t.index])):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.repeat||(t?(g++,v=t.start,s.value=null):P()&&!m.value?(m.value=!0,ie()):ue()))}async function ue(){e.busy||(m.value=!1,P()&&(t(`update:modelValue`,``),t(`update:mentions`,[]),O([]),await ol()),t(`cancel`))}let de=e=>x.value&&(e.dataTransfer?.types.includes(`Files`)??!1),fe,pe=()=>{let e=fe;return fe=void 0,e},me=Zw(`UIcon`),he=Nw(),ge=e=>{let t=D.value[e];O(b.value.filter(e=>E(e)!==t))},_e=({files:t,remove:n})=>{let r=[],i=[];return t.forEach((e,t)=>{e.mediaType.startsWith(`image/`)?r.push({key:e.url,name:e.filename??`Picture`,url:e.url}):i.push({file:e,index:t})}),[q(iT,{disabled:e.busy,images:r,onRemove:e=>n(t.findIndex(t=>t.url===e)),origin:pe}),i.length>0?q(kE,{"data-slot":`prompt-input-attachments`},()=>i.map(({file:t,index:r})=>q(lT,{key:t.url,size:`xs`},()=>[q(PE,{kind:`icon`},()=>q(me,{name:he.value.file})),q(wE,()=>q(zE,()=>t.filename??t.mediaType)),q(yE,()=>q(mE,{disabled:e.busy,label:`Remove ${t.filename??`attachment`}`,onClick:()=>n(r)},()=>q(me,{name:he.value.close})))]))):null]};return()=>q(`div`,{"data-busy":e.busy?`true`:void 0,"data-dirty":P()?`true`:void 0,"data-dragging":l.value?`true`:void 0,"data-frame":e.frame,"data-layout":e.layout,"data-multiline":I.value?`true`:void 0,"data-shake":o.value??void 0,"data-size":e.size,"data-slot":`comment-composer`,"data-variant":e.variant,onKeydownCapture:le,onKeyupCapture:R,onClickCapture:R,onSelectCapture:R,onInputCapture:e=>{e.target instanceof HTMLTextAreaElement&&se(e.target)},onPasteCapture:t=>{x.value&&t.clipboardData&&(fe=N(),HD(t.clipboardData).some(t=>q_(t,e.accept))&&t.preventDefault())},onDragover:e=>{de(e)&&(e.preventDefault(),l.value=!0)},onDragleave:e=>{e.relatedTarget instanceof Node&&a.value?.contains(e.relatedTarget)||(l.value=!1)},onDrop:e=>{l.value=!1,de(e)&&(e.preventDefault(),fe=a.value?.querySelector(`[data-slot=prompt-input-group]`),k(e.dataTransfer?.files??[]),F())},onChangeCapture:e=>{e.target instanceof HTMLInputElement&&e.target.type===`file`&&(fe=a.value?.querySelector(`[data-slot=prompt-input-attach]`))},ref:a},[q(`div`,{"data-slot":`comment-composer-box`},[r.extra?q(`div`,{"data-slot":`comment-composer-extra`},r.extra()):null,q(PD,{accept:e.accept,"aria-label":VD[e.variant],files:D.value,readonly:e.busy,filterFiles:e=>(k(e),[]),modelValue:e.modelValue,placeholder:e.placeholder??zD[e.variant],submitLabel:BD[e.variant],onSubmit:ce,"onUpdate:files":e=>O(b.value.filter(t=>e.includes(E(t)))),"onUpdate:modelValue":e=>t(`update:modelValue`,e)},()=>[x.value?_e({files:D.value,remove:ge}):null,q(wD),q(kD,()=>[x.value?q(lD,{disabled:e.busy,variant:e.layout===`row`?`ghost`:`outline`},()=>q(me,{name:he.value.plus})):null,q(yD,null,()=>q(me,{name:he.value.arrowUp}))])]),s.value&&s.value.items.length===0?q(`div`,{"data-slot":`comment-composer-mentions`,"data-state":s.value.failed?`error`:`empty`,role:`status`},q(`p`,{"data-slot":`comment-composer-mention-empty`},r[`mention-empty`]?.({failed:s.value.failed,query:s.value.query})??(s.value.failed?`Could not load people.`:`No one by that name can be mentioned here.`))):s.value?q(`ul`,{"aria-label":`People`,"data-slot":`comment-composer-mentions`,id:`${d}-list`,role:`listbox`},s.value.items.map((e,t)=>{let n=t===s.value?.index;return q(`li`,{"aria-selected":String(n),"data-slot":`comment-composer-mention`,id:f(t),key:e.id,onMousedown:t=>{t.preventDefault(),oe(e)},role:`option`},r[`mention-item`]?.({active:n,person:e})??[q(QE,{"aria-hidden":`true`,people:[yh(e)],size:`sm`}),q(`span`,{"data-slot":`comment-composer-mention-name`},Ch(e))])})):null,e.error??c.value?q(`p`,{"data-slot":`comment-composer-error`,role:`alert`},e.error??c.value):null,q(`p`,{"aria-live":`polite`,"data-slot":`comment-composer-status`},m.value?`Press Esc again to discard.`:``)])])}})})),qD,JD,YD=t((()=>{jn(),qD={why:({message:e})=>e===void 0?``:String(e)},JD=Dn({docsBase:`https://vitehub.dev/docs/ui/diagnostics`,codes:{UI_R0001:{...qD,fix:`Pick the file again. The browser could not read the file that the message names.`},UI_R0002:{...qD,fix:"Use the component that the message names as it says: inside its parent, such as `CommentLayer`, `ChoicesInput`, or `MessageScroller`, or with the props that the message names."},UI_CLIPBOARD_UNAVAILABLE:{why:`The clipboard is not available.`,fix:"Serve the page over HTTPS or from `localhost`, where the browser gives pages the clipboard API."},UI_MARKDOWN_UPLOAD_URL_MISSING:{why:({route:e,file:t})=>`${e} stored ${t} without a URL. Serve the Blob store with \`blob.serve\` so the editor can link it.`,fix:"Add `serve` to the Blob options, such as `vitehub({ blob: { serve: { access: 'public' } } })`, so the upload route returns a URL for each file that it stores."},UI_RELATIVE_TIME_NOW_INVALID:{why:`RelativeTime cannot read the supplied clock value.`,fix:`Pass a valid Date, an ISO date string, or milliseconds as now.`},UI_RELATIVE_TIME_THRESHOLD_INVALID:{why:({threshold:e})=>`RelativeTime threshold "${e}" is not a duration.`,fix:`Pass a number and a unit, such as "3w", or "none" as threshold.`},UI_ZIP_PATH_UNSAFE:{why:`ZIP files must use safe project-relative paths.`,fix:"Pass `zipFiles()` and `downloadZip()` a folder name and file paths that are relative to the project, without empty, `.`, or `..` segments, `:`, or a backslash."}}})}));function XD(e={}){let t=e.flashMs??2500,n=e.visibility??`all`,r=null,i=null,a=[],o=[],s=[],c=new Set,l=new Map,u=new Map,d=new Map,f=new Map,p=new Set,m=(e,t)=>{let n=setTimeout(()=>{c.delete(n),e()},t);return c.add(n),n};function h(){let e=o;o=n===`hidden`?[...new Set([...r?[r]:[],...a])]:[];let t=n===`hidden`?e.filter(e=>!o.includes(e)):[];s=n===`hidden`?[...s.filter(e=>!o.includes(e)),...t.filter(e=>!s.includes(e))]:[];for(let e of t)clearTimeout(f.get(e)),f.set(e,m(()=>{f.delete(e),s=s.filter(t=>t!==e);for(let e of p)e()},130));for(let e of p)e()}function g(e){let t=l.get(e);t&&(clearTimeout(t),c.delete(t),l.delete(e))}function _(e,t){g(e),d.delete(e),e===i?d.set(e,t):(u.set(e,Date.now()+t),l.set(e,m(()=>{l.delete(e),u.delete(e),a=a.filter(t=>t!==e),h()},t)))}return{get visibility(){return n},get only(){return o},get leaving(){return s},set(e){if(e!==n){if(n=e,e===`all`){for(let e of[...l.keys()])g(e);u.clear(),d.clear(),a=[]}h()}},open(e){e!==r&&(r=e,h())},flash(e){n===`hidden`&&(_(e,t),a.includes(e)||(a=[...a,e],h()))},hover(e){if(e===i)return;let t=i;if(i=e,t!==null){let e=d.get(t);e!==void 0&&_(t,e)}if(e!==null&&l.has(e)){let t=Math.max(0,(u.get(e)??0)-Date.now());g(e),u.delete(e),d.set(e,t)}},isShown:e=>n===`all`||o.includes(e),subscribe(e){return p.add(e),()=>p.delete(e)},stop(){for(let e of c)clearTimeout(e);c.clear(),l.clear(),u.clear(),d.clear(),f.clear()}}}var ZD=t((()=>{}));function QD(e){return e.requestId===void 0?e.id:JSON.stringify([e.subject.kind,e.subject.id,e.author.id,e.requestId])}function $D(e,t){let n=J(n=>{let r=t.value,i=e.value,a=i.find(e=>e.id===r),o=n?.id===r?n.thread:void 0,s=o?.requestId===void 0?void 0:QD(o);return{id:r,thread:a??(s===void 0?void 0:i.find(e=>QD(e)===s))}});return J(()=>n.value.thread)}var eO=t((()=>{Y()}));function tO(e){return(t,{message:n})=>e?t===`edit`||t===`delete`?n?.author.id===e.id:!0:!1}function nO(e){for(let t=e;t;){if(t.closest(uO))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function rO(e,t){return e.kind===t.kind&&e.id===t.id}function iO(e,t){return!e||!t?e===t:e.detached||t.detached?e.detached===t.detached:e.element===t.element&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.clipped===t.clipped}function aO(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}function oO(e){let t=e.client??_h(),n=tc(),r=tc(e.client?void 0:Gi()),i=tc(),a=J(()=>n.value??(r.value?Ji(r.value):void 0)),o=e.param??`comment`,s=e.hotkey===void 0?`c`:e.hotkey!==!1&&e.hotkey.toLowerCase(),c=e.ignore??nO,l=J(()=>rc(e.subject)),u=J(()=>rc(e.user)??t.user??a.value),d=V(!1),f=V(`page`),p=J({get:()=>f.value,set:e=>{if(e!==f.value){if(se())return ce();f.value=e}}}),m=Ws({open:!0,resolved:!1,mine:!1}),h=V(t.status),g=tc(t.threads),_=tc(t.outbox?.entries??[]),v=tc(new Map),y=V(null),b=V(null),x=tc(new Map),S=J(()=>new Set(x.value.values())),C=e=>{let t=Symbol();return x.value=new Map(x.value).set(t,e),()=>{let e=new Map(x.value);e.delete(t),x.value=e}},w=V(null),T=V(!1),E=V(0),D=e=>e.status===`open`,O=e=>m.open&&D(e)||m.resolved&&e.status===`resolved`?!m.mine||e.author.id===u.value?.id:!1,k=e=>rO(e.subject,l.value),A=J(()=>g.value.filter(e=>k(e)&&O(e))),ee=J(()=>g.value.filter(e=>(p.value===`site`||k(e))&&O(e))),j=J(()=>g.value.filter(e=>p.value===`site`||k(e))),M=J(()=>j.value.filter(D)),N=J(()=>({open:M.value.length,resolved:j.value.filter(e=>e.status===`resolved`).length})),te=$D(g,b);U(te,e=>{e&&e.id!==b.value&&(b.value=e.id)},{flush:`sync`});let P=ec(e.visibility)?e.visibility:V(e.visibility??`all`),F=XD({visibility:P.value,flashMs:e.flashMs}),I=V(0);F.subscribe(()=>I.value++),U(P,e=>F.set(e),{flush:`sync`}),U(b,e=>F.open(e),{flush:`sync`}),U(w,e=>F.hover(e),{flush:`sync`});let ne=J(()=>{I.value;let e=new Set(A.value.map(e=>e.id));te.value&&k(te.value)&&e.add(te.value.id);for(let t of g.value){let n=P.value===`hidden`&&(F.isShown(t.id)||F.leaving.includes(t.id));k(t)&&(S.value.has(t.id)||n)&&e.add(t.id)}return e}),re=J(()=>(I.value,new Set([...ne.value].filter(e=>F.isShown(e)||S.value.has(e))))),L=J(()=>(I.value,new Set(F.leaving.filter(e=>ne.value.has(e)&&!S.value.has(e))))),ie=e=>F.flash(e),ae=()=>rc(e.root)??document,R=()=>rc(e.uiRoot)??document;function oe(){let e=new Map;for(let t of g.value.filter(e=>ne.value.has(e.id)))e.set(t.id,ih(t.anchor,ae()));y.value&&e.set(lO,ih(y.value.anchor,ae()));let t=v.value;e.size===t.size&&[...e].every(([e,n])=>iO(n,t.get(e)))||(v.value=e)}let se=()=>(y.value?.body.trim().length??0)>0||Ip(R(),y.value?void 0:dO),ce=(e=!1)=>{E.value++,Lp(R(),e)};function le(){d.value=!0;let e=typeof window>`u`?void 0:window.getSelection();if(e&&!e.isCollapsed&&e.rangeCount>0){let t=e.getRangeAt(0).commonAncestorContainer,n=t instanceof Element?t:t.parentElement;if(n?.isConnected&&!c(n)){let t=e.getRangeAt(0).getBoundingClientRect();try{me(e,{point:{x:t.left,y:t.top}}),e.removeAllRanges()}catch{}}}}function ue(){y.value=null}function de(){return se()?(ce(),!1):(b.value=null,w.value=null,!0)}function fe(e=!1){if(se())return ce(e);ue(),de(),d.value=!1}function pe(){d.value?fe():le()}function me(e,{files:t,...n}={}){if(se())return ce();de();let r=Ym(e,{root:ae(),ignore:c,...n}),i=n.point??{x:0,y:0};if(e===`page`)i={x:Math.max(16,window.innerWidth/2-180),y:96};else if(`nodeType`in e){let t=e.getBoundingClientRect();i=n.point??{x:t.left+t.width/2,y:t.top+t.height/2}}else!(`rangeCount`in e)&&!(`startContainer`in e)&&(i=e);y.value={anchor:r,point:i,body:``,mentions:[],attachments:[],...t?.length?{files:t}:{},busy:!1,error:void 0},oe()}async function he(e={}){let n=y.value,r=n?.body.trim()??``,i=e.files,a=hO(i);if(!n||n.busy||!r&&n.attachments.length===0&&!a)return;let o=n.body,s=[...n.mentions],c=[...n.attachments],u={subject:l.value,anchor:Qs(n.anchor),body:r,mentions:s,...c.length>0?{attachments:c}:{},...a?{files:i}:{}};if(n.error=void 0,t.outbox){y.value=null;try{let e=await t.create(u);return ie(e.id),e}catch(e){n.error=aO(e),y.value||=n;return}}n.busy=!0;try{let e=await t.create(u);return n.busy=!1,ie(e.id),y.value===n&&n.body===o&&n.mentions.length===s.length&&n.mentions.every((e,t)=>e===s[t])&&(y.value=null),e}catch(e){n.busy=!1,n.error=aO(e);return}}let ge;function _e(e){clearTimeout(ge);let t=0,n=()=>{oe();let r=v.value.get(e);r&&!r.detached?(r.element?.scrollIntoView?.({block:`center`}),oe()):++t<20&&(ge=setTimeout(n,150))};n()}function ve(e,t={}){let n=typeof e==`string`?e:e.id;if(se())return ce();ue(),b.value=n,w.value=null;let r=g.value.find(e=>e.id===n);r&&k(r)&&(t.scroll?_e(n):oe())}function ye(t){let n=e.location?.()??window.location,r=e.subjectUrl?.(t.subject)??(t.subject.kind===`page`?t.subject.id:n.href),i=new URL(r,n.origin);return i.searchParams.set(o,String(t.n)),`${i.pathname.startsWith(`//`)?`/%2F${i.pathname.slice(2)}`:i.pathname}${i.search}${i.hash}`}let be=!1;function xe(){if(be||h.value!==`ready`)return;be=!0;let t=e.location?.()??window.location,n=Number(new URLSearchParams(t.search).get(o));if(!Number.isInteger(n)||n<1)return;let r=g.value.find(e=>e.n===n&&k(e));r&&(r.status===`resolved`&&(m.resolved=!0),m.mine=!1,ve(r,{scroll:!0}))}function Se(e){if(e.defaultPrevented||e.isComposing||e.repeat)return;let t=fO(e),n=t[0];if(e.key===`Escape`){if(t.some(e=>e.matches(`[data-slot='comment-composer']`)))return;(d.value||y.value||b.value)&&fe(!0)}else if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||mO(t))){if(e.key===`Enter`&&d.value&&n&&!t.some(c)&&n!==document.body&&n!==document.documentElement){e.preventDefault();try{me(n)}catch{}}else s!==!1&&e.key.toLowerCase()===s&&(e.preventDefault(),pe())}}function Ce(){let a=[];if(t.query=p.value===`page`?{subject:l.value}:{},a.push(t.onChange(()=>{h.value=t.status,g.value=t.threads,_.value=t.outbox?.entries??[]})),h.value=t.status,g.value=t.threads,a.push(t.start()),!e.client){let e=la({base:pm(),guest:Gi});a.push(U([()=>l.value.kind,()=>l.value.id],([t,r],a,o)=>{i.value=void 0;let s=new AbortController;o(()=>s.abort());let c=new URLSearchParams({subjectKind:t,subjectId:r});e(`/session?${c}`,{signal:s.signal}).then(({data:e})=>{s.signal.aborted||(n.value=e.user??void 0,i.value=e.can)},()=>{})},{immediate:!0})),a.push(qi(e=>{r.value=e}))}document.addEventListener(`keydown`,Se),a.push(()=>document.removeEventListener(`keydown`,Se));let o=0,s=()=>{o||=requestAnimationFrame(()=>{o=0,oe()})};window.addEventListener(`scroll`,s,{capture:!0,passive:!0}),window.addEventListener(`resize`,s),window.addEventListener(`load`,s,{capture:!0}),document.fonts?.addEventListener(`loadingdone`,s);let c=()=>{be=!1,xe()};window.addEventListener(`popstate`,c),a.push(U(()=>e.location?.().search,c));let u=new MutationObserver(e=>{e.every(e=>e.target instanceof Element&&nO(e.target))||s()}),d={attributes:!0,characterData:!0,childList:!0,subtree:!0};a.push(U(ae,e=>{u.disconnect(),u.observe(document.documentElement,d),e!==document&&u.observe(e,d),s()},{immediate:!0,flush:`post`}));let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(s),m=new Set;return a.push(()=>{window.removeEventListener(`scroll`,s,{capture:!0}),window.removeEventListener(`resize`,s),window.removeEventListener(`load`,s,{capture:!0}),window.removeEventListener(`popstate`,c),document.fonts?.removeEventListener(`loadingdone`,s),u.disconnect(),f?.disconnect(),clearTimeout(ge),o&&cancelAnimationFrame(o),F.stop()}),a.push(U(v,()=>{let e=new Set;for(let t of v.value.values())!t.detached&&t.element&&e.add(t.element);for(let t of m)e.has(t)||(f?.unobserve(t),m.delete(t));for(let t of e)m.has(t)||(f?.observe(t),m.add(t))},{flush:`post`})),a.push(U([ne,()=>y.value?.anchor,b],()=>oe(),{flush:`post`})),a.push(U(()=>h.value===`ready`,e=>e&&xe(),{immediate:!0})),a.push(U(()=>`${l.value.kind}\u0000${l.value.id}\u0000${p.value}`,()=>{t.query=p.value===`page`?{subject:l.value}:{},ue(),b.value=null,w.value=null,be=!1,t.refresh().catch(()=>void 0)})),()=>{for(let e of a.splice(0))e()}}let we=tc(new Map),Te=J(()=>{let t=new Map,n=e=>{e&&(!t.has(e.id)||e.name)&&t.set(e.id,e)};for(let e of we.value.values())n(e);for(let t of rc(e.people)??[])n(t);for(let e of g.value){n(e.author),n(e.resolvedBy);for(let t of e.messages)n(t.author)}return n(u.value),[...t.values()]});async function Ee(e,n){let r=await t.users({query:e,...n?{threadId:n}:{subject:l.value}});if(r.some(e=>we.value.get(e.id)!==e)){let e=new Map(we.value);for(let t of r)e.set(t.id,t);we.value=e}return r}let De=(e,t)=>fm(u.value,i.value,e,t),Oe={client:t,subject:l,user:u,can:(t,n)=>u.value!==void 0&&(e.can??(e.client?tO(u.value):De))(t,n),people:Te,active:d,scope:p,filters:m,status:h,threads:g,outbox:{enabled:t.outbox!==void 0,queued:J(()=>_.value.filter(e=>e.status!==`failed`)),failures:J(()=>_.value.filter(e=>e.status===`failed`)),delivery(e,t){let n=g.value.find(t=>t.id===e);return t===void 0?n?.delivery:n?.messages.find(e=>e.id===t)?.delivery},retry:async e=>t.outbox?.retry(e),dismiss:async e=>await t.outbox?.dismiss(e)??!1,edit:async(e,n,r)=>await t.outbox?.edit(e,n,r)??!1},pageThreads:A,listed:ee,openThreads:M,counts:N,positions:v,draft:y,openId:b,hoverId:w,opened:te,listOpen:T,blocked:E,visibility:P,shown:re,leaving:L,retainMark:C,isShown:e=>re.value.has(e),flash:ie,enter:le,exit:fe,toggle:pe,startDraft:me,cancelDraft:ue,send:he,open:ve,close:de,create:async({anchor:e={kind:`page`},attachments:n,body:r,files:i,mentions:a})=>{let o=await t.create({subject:l.value,anchor:e,body:r,mentions:a,...n?.length?{attachments:n}:{},...hO(i)?{files:i}:{}});return ie(o.id),o},reply:async(e,n,r,i,a)=>{let o=await t.reply({threadId:e,body:n,mentions:r,...i?.length?{attachments:i}:{},...hO(a)?{files:a}:{}});return ie(e),o},edit:(e,n,r,i)=>t.edit({threadId:e,messageId:n,body:r,mentions:i}),remove:async(e,n)=>{let r=await t.delete({threadId:e,messageId:n});return!r&&b.value===e&&(b.value=null,w.value=null),r},resolve:e=>t.resolve({threadId:e}),reopen:e=>t.reopen({threadId:e}),users:Ee,link:ye,measure:oe,start:Ce};if(e.autoStart!==!1&&Df()){let e;Ld(()=>{e=Ce()}),Bd(()=>e?.())}return Oe}function sO(e){vl(U_,e)}function cO(e){let t=e??W_();if(!t)throw JD.UI_R0002({message:"Comment parts need a comments state. Put them inside CommentLayer, or pass the result of useComments() as the `comments` prop."});return t}var lO,uO,dO,fO,pO,mO,hO,gO=t((()=>{Y(),vh(),YD(),ZD(),Up(),eO(),G_(),lO=`draft`,uO=`[data-comments-ui]`,dO=`[data-draft] [data-slot='comment-composer']`,fO=e=>e.composedPath().filter(e=>e instanceof Element),pO=`input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='combobox'], [role='searchbox']`,mO=e=>e.some(e=>e.matches(pO)),hO=e=>e!==void 0&&(!Array.isArray(e)||e.length>0)}));function _O(e,t){let n=J(()=>{if(e.client.transport.supportsAttachments!==!1){if(t.upload)return`upload`;if(e.outbox.enabled&&t.queueFiles)return`queue`}});return{enabled:J(()=>n.value!==void 0),queued(t){if(!(!e.outbox.enabled||n.value===`upload`&&t.length>0))return n.value===`queue`?t:[]},async prepare(e){return{files:n.value===`queue`?e:[],attachments:n.value===`upload`&&e.length>0&&t.upload?await t.upload(e):[]}}}}var vO=t((()=>{Y()}));function yO(e,t={}){let[n,r,i,a]=[1e3,6e4,36e5,864e5],[o,s,c]=[7*a,30*a,365*a],l={s:n,m:r,h:i,d:a,w:o,mo:s,y:c},{threshold:u=`3w`,locale:d=`en-US`,style:f=`long`}=t,[,p,m]=/^(\d+(?:\.\d+)?)\s*(s|m|h|d|w|mo|y)$/i.exec(u)??[],h=/^(none|never)$/i.test(u)?1/0:p&&m?Number(p)*(l[m.toLowerCase()]??NaN):NaN;if(Number.isNaN(h))throw JD.UI_RELATIVE_TIME_THRESHOLD_INVALID({threshold:u});let g=t.now===void 0?Date.now():new Date(t.now).getTime();if(!Number.isFinite(g))throw JD.UI_RELATIVE_TIME_NOW_INVALID();let _=t.timeZone??new Intl.DateTimeFormat().resolvedOptions().timeZone,v=new Intl.RelativeTimeFormat(d,{numeric:`auto`,style:f}),y=e=>Object.fromEntries(new Intl.DateTimeFormat(`en-US`,{timeZone:_,hourCycle:`h23`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}).formatToParts(e).map(e=>[e.type,Number(e.value)])),b=e=>{let t=y(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)-Math.floor(e/1e3)*1e3},x=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?\s*(Z|[+-]\d{2}:?\d{2})?)?$/i.exec(e);if(!t)return;let[n,r,i,o,s,c]=[1,2,3,4,5,6].map(e=>Number(t[e]??0)),l=Date.UTC(n,r-1,i,o,s,c,Number((t[7]??``).slice(0,3).padEnd(3,`0`))),u=new Date(l);if(u.getUTCFullYear()!==n||u.getUTCMonth()!==r-1||u.getUTCDate()!==i||o>23||s>59||c>59)return;if(t[4]===void 0)return{at:Math.floor(l/a)*a,wall:!0};let d=t[8];if(d?.toUpperCase()===`Z`)return{at:l,wall:!1};if(d){let e=d.replace(/\D/g,``),t=Number(e.slice(0,2)),n=Number(e.slice(2));return t>23||n>59?void 0:{at:l-(d.startsWith(`-`)?-1:1)*(t*60+n)*6e4,wall:!1}}let f=[...new Set([l-a,l,l+a].map(e=>l-b(e)))].filter(e=>e+b(e)===l).sort((e,t)=>e-t)[0];return f===void 0?void 0:{at:f,wall:!1}},S=Math.floor((g+b(g))/a),C=typeof e==`string`?NaN:new Date(e).getTime(),w=typeof e==`string`?x(e.trim()):Number.isFinite(C)?{at:C,wall:!1}:void 0;if(!w)return;let T=w.wall?(w.at/a-S)*a:w.at-g,E=w.wall?Math.max(Math.abs(T),a):Math.abs(T),[D,O]=E<r?[`second`,n]:E<i?[`minute`,r]:E<a?[`hour`,i]:E<o?[`day`,a]:E<s?[`week`,o]:E<c?[`month`,s]:[`year`,c],k=v.format(Math.trunc(T/O)||0,D),A=e=>new Intl.DateTimeFormat(d,{timeZone:w.wall?`UTC`:_,...e}).format(w.at),ee={day:`numeric`,month:`short`},j={hour:`numeric`,minute:`2-digit`,timeZoneName:`short`},M=Math.abs(T)>=h,N=w.wall?new Date(w.at).getUTCFullYear():y(w.at).year;return{datetime:w.wall?new Date(w.at).toISOString().slice(0,10):new Date(w.at).toISOString().replace(/\.000Z$/,`Z`),mode:M?`absolute`:`relative`,label:M?A(N===y(g).year?ee:{...ee,year:`numeric`}):k,tip:M?w.wall?k:`${k} · ${A(j)}`:A({weekday:`short`,...ee,year:`numeric`,...w.wall?{}:j})}}var bO=t((()=>{YD()}));function xO(e){let t,n=()=>e.value=Date.now(),r=()=>clearInterval(t),i=()=>{r(),n(),t=setInterval(n,TO)},a=()=>document.visibilityState===`hidden`?r():i();return document.addEventListener(`visibilitychange`,a),a(),()=>{r(),document.removeEventListener(`visibilitychange`,a)}}function SO(){return DO++===0&&(OO=xO(EO)),EO}function CO(){--DO===0&&OO?.()}var wO,TO,EO,DO,OO,kO=t((()=>{Y(),wO=Symbol(`ViteHubRelativeNow`),TO=3e4,EO=V(0),DO=0}));function AO(e){let t=yl(wO,void 0),n=tc(),r=V(!1);Ld(()=>{t||(n.value=SO()),r.value=!0}),Bd(()=>{n.value&&CO()});let i=J(()=>t?.value??n.value?.value),a=t=>{let n=i.value;if(n===void 0)return;let{at:r,format:a,locale:o,threshold:s}=e(),c={locale:o,style:a,threshold:s,timeZone:t},l=yO(r,{...c,now:n});if(!l?.datetime.includes(`T`))return l;let u=Date.parse(l.datetime);return Math.abs(u-n)<jO?yO(r,{...c,now:u}):l},o=J(()=>{let{at:t,locale:n}=e(),r=yO(t,{locale:n,now:0,threshold:`none`,timeZone:`UTC`});if(!r)return;let i=new Intl.DateTimeFormat(n,{day:`numeric`,month:`short`,timeZone:`UTC`,year:`numeric`}).format(Date.parse(r.datetime));return{...r,label:i,mode:`absolute`}});return{time:J(()=>a(r.value?void 0:`UTC`)??o.value),tip:J(()=>r.value?a()?.tip:void 0)}}var jO,MO=t((()=>{Y(),bO(),kO(),jO=6e4}));function NO(e){e()}var PO=t((()=>{})),FO=t((()=>{})),IO,LO=t((()=>{IO=e=>e.isTrusted}));function RO(e){(e.key===`Enter`||e.key===` `)&&(ik=e.target,setTimeout(ak))}function zO(e){RO(e),ek=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);e.key!==`Tab`&&t||(YO=`keyboard`)}function BO(e){if(YO=`pointer`,ek=!1,!(`pointerType`in e)){nk||(tk=`touch`);return}nk=!0,setTimeout(rk);let t=e.pointerType;tk=UO(e)?`virtual`:t===`touch`||t===`pen`?t:`mouse`}function VO(){XO||typeof document>`u`||(XO=!0,document.addEventListener(`keydown`,zO,!0),document.addEventListener(`keyup`,RO,!0),document.addEventListener(`pointerdown`,BO,!0),document.addEventListener(`touchstart`,BO,{capture:!0,passive:!0}),window.addEventListener(`blur`,e=>{e.target===window&&(ek=!0)}))}function HO(){XO||ZO||(ZO=!0,queueMicrotask(VO))}function UO(e){return e.type===`pointermove`?!1:e.width===0&&e.height===0&&e.pressure===0||e.pointerType===`mouse`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function WO(e){return e.detail>0?tk:ik&&ik.contains(e.target)?`keyboard`:`virtual`}function GO(e){if(VO(),!e)return ok();if(!IO(e))return`programmatic`;if(e.type.startsWith(`key`))return`keyboard`;if(e.type.startsWith(`touch`))return`touch`;if(e.type===`click`)return WO(e);let t=e.pointerType;return t===`mouse`||t===`touch`||t===`pen`?UO(e)?`virtual`:t:`button`in e?tk:ok()}function KO(){return VO(),YO===`keyboard`&&!QO&&!$O&&!ek}function qO(e){VO(),QO=!0;try{e.focus({preventScroll:!0})}finally{QO=!1}}function JO(e){VO(),$O=!0;try{e.focus({preventScroll:!0})}finally{$O=!1}}var YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok,sk=t((()=>{LO(),YO=`pointer`,XO=!1,ZO=!1,QO=!1,$O=!1,ek=!1,tk=`mouse`,nk=!1,rk=()=>nk=!1,ik=null,ak=()=>ik=null,ok=()=>YO===`keyboard`?`keyboard`:tk}));function ck(e,t){let n=uk.get(e);n||uk.set(e,n={});let r=n[t];if(r?.isConnected)return r;let i=e.createElement(`div`);return i.setAttribute(`role`,t===`assertive`?`alert`:`status`),i.setAttribute(`aria-live`,t),i.setAttribute(`aria-atomic`,`true`),i.setAttribute(`data-ui-sdk-announcer`,t===`assertive`?`assertive`:``),i.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(i),n[t]=i,i}function lk(e,{priority:t=`polite`,doc:n=typeof document>`u`?void 0:document}={}){if(!e)return;if(dk)return dk(e,t);if(!n?.body)return;let r=ck(n,t);r.textContent=``,clearTimeout(fk[t]),fk[t]=setTimeout(()=>{r.textContent=e},100)}var uk,dk,fk,pk=t((()=>{uk=new WeakMap,fk={}}));function mk(){return hk&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)}var hk,gk=t((()=>{hk=typeof window<`u`&&typeof document<`u`}));function _k(){return hk&&typeof HTMLElement.prototype.showPopover==`function`}function vk(e){return e||(hk&&!_k()?document.body:null)}function yk(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function bk(e){let t=[e],n=e;for(;n;){let e=n.assignedSlot??n.parentNode??n.host;e&&e!==n.parentNode&&t.push(e),n=e}return t}function xk(e,t){return bk(t).some(t=>e.contains(t))}function Sk(){return Ek?Ek===`apple`:Dk??=hk&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function Ck(){return Ek===`apple`}function wk(e,t=Sk()){return e.split(`+`).map(e=>{let n=e.toLowerCase();return n===`mod`?t?`Meta`:`Control`:Ok[n]?Ok[n]:e.length>1?e[0].toUpperCase()+e.slice(1):e.toUpperCase()}).join(`+`)}function Tk(e,t=Sk()){let n=wk(e,t);if(!n)return``;let r=n.split(`+`);return`\u2066${t?r.map(e=>kk[e]??e).join(``):r.map(e=>Ak[e]??e).join(`+`)}\u2069`}var Ek,Dk,Ok,kk,Ak,jk=t((()=>{gk(),Ok={alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`,ctrl:`Control`,control:`Control`,cmd:`Meta`,command:`Meta`,meta:`Meta`,backspace:`Backspace`,delete:`Delete`,del:`Delete`,enter:`Enter`,return:`Enter`,escape:`Escape`,esc:`Escape`,tab:`Tab`,space:`Space`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,arrowup:`ArrowUp`,arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,home:`Home`,end:`End`,pageup:`PageUp`,pagedown:`PageDown`},kk={Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`,Backspace:`⌫`,Delete:`⌦`,Enter:`↩`,Escape:`⎋`,Tab:`⇥`,Space:`␣`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`,PageUp:`⇞`,PageDown:`⇟`,Home:`↖`,End:`↘`},Ak={Control:`Ctrl`,Delete:`Del`,Escape:`Esc`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`}}));function Mk(e){return{"data-open":e?``:void 0,"data-closed":e?void 0:``}}var Nk=t((()=>{}));function Pk(e){Gk++;try{e()}finally{Gk--}}function Fk(e){let t=Uk,n={starts:[]};Uk=n;let r;try{r=e()}finally{Uk=t}return Hk.set(r,n),t?t.starts.push(()=>(zk(r),()=>Bk(r))):!Wk&&typeof document<`u`&&zk(r),r}function Ik(e){let t=Wk;Wk=!0;try{return e()}finally{Wk=t}}function Lk(e){Uk&&Uk.starts.push(e)}function Rk(e,t){let n=Uk,r={starts:[]};Uk=r;try{t()}finally{Uk=n}let i=Hk.get(e);if(i){i.starts.push(...r.starts);for(let e of i.stops?r.starts:[]){let t=e();t&&i.stops.push(t)}}}function zk(e){let t=Hk.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let e of t.starts){let t=e();t&&n.push(t)}}function Bk(e){let t=Hk.get(e),n=t?.stops;n&&(t.stops=void 0,n.forEach(e=>e()))}function Vk(e){Bk(e),Hk.delete(e)}var Hk,Uk,Wk,Gk,Kk=t((()=>{PO(),Hk=new WeakMap,Wk=!1,Gk=0}));function qk(e,t){e?.[Xk]?.(t)}function Jk(e,t){e?.[Zk]?.(t)}function Yk(e,t){let n=e.options().controller,r=!1;Lk(()=>(r=!0,qk(n,t),()=>{r=!1,Jk(n,t)})),e.onOptions(({controller:e})=>{e!==n&&(Jk(n,t),n=e,r&&qk(e,t))})}var Xk,Zk,Qk=t((()=>{Kk(),Xk=Symbol.for(`ui-sdk.controller.attach`),Zk=Symbol.for(`ui-sdk.controller.detach`)}));function $k(e,t){let n=nA.get(e);n||nA.set(e,n=[]),n.push(t)}function eA(e,t,n){$k(e.store,{from:`options`,keys:t,derive:n})}function tA(e,t,n,r){let i=nA.get(e);if(!i)return n;let a=n??{},o=!n,s=!!n;for(let c=0;c<i.length;c++){let l=i[c];if(!n&&l.from===`state`)continue;let u=s?{...r,...a}:r,d=l.from===`state`?e.view(u,()=>l.derive(u)):l.derive(a,r,t);if(d||l.from!==`options`){o||=(a={...a},!0);for(let e=0;e<l.keys.length;e++){let t=l.keys[e];d&&t in d?(a[t]=d[t],s=!0):l.from===`state`&&(a[t]=u[t],s=!0)}}}return s?a:void 0}var nA,rA,iA=t((()=>{nA=new WeakMap,rA=e=>nA.has(e)}));function aA(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function oA(e){let t=`nativeEvent`in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var sA=t((()=>{}));function cA(e,t){let{x:n,y:r}=e,{borders:i}=t,a=n>=i.left&&n<t.width-i.right&&r>=i.top&&r<t.height-i.bottom,o=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return a&&!o}function lA(e,t){if(!(t instanceof Element))return!1;if(t===t.ownerDocument.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let n=t.getBoundingClientRect(),r=getComputedStyle(t);return cA({x:e.clientX-n.left,y:e.clientY-n.top},{width:n.width,height:n.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(r.borderTopWidth)||0,right:parseFloat(r.borderRightWidth)||0,bottom:parseFloat(r.borderBottomWidth)||0,left:parseFloat(r.borderLeftWidth)||0}})}var uA=t((()=>{}));function dA(){return jA.persistent??=new Set}function fA(e){for(let t of dA())if(xk(t,e))return!0;return!1}function pA(){return[...dA()].filter(e=>e.isConnected)}function mA(){return jA.pushed??0}function hA(e){return gA().some(t=>(t.order??0)>e)}function gA(){return jA.stack.filter(e=>e.active())}function _A(){return gA()}function vA(){return jA.escapeAt??-1/0}function yA(e,t,n){return bA(e,bk(t),n)}function bA(e,t,n){return t.some(t=>e.contains(t,n))?!0:gA().some(r=>r.parent===e&&(t.some(e=>r.covers?.(e))||bA(r,t,n)))}function xA(e,t){let n=!1,r,i;function a(e,t,n){let r=[],i=!1;if(fA(t))return{dismissed:r,consume:i};for(let a of[...jA.stack].reverse())if(a.active()){if(yA(a,t,e)||(a.modal!==!1&&(i=!0),r.push(a),a.shield))break}else if(a.exiting?.()){if(yA(a,t,e))break;if(a.modal===!1)continue;a.overBackdrop?.(n.x,n.y)&&(i=!0);break}return{dismissed:r,consume:i}}function o(e,t,n){let{dismissed:r,consume:i}=a(e,t,n);for(let t of r)t.onOutsidePress?.(e);return i}let s=aA(t,`pointerdown`,e=>{n=!1;let t=e.composedPath()[0];if(e.pointerType===`touch`){r={x:e.clientX,y:e.clientY,target:t};return}if(r=void 0,i=void 0,lA(e,t))return;let o={x:e.clientX,y:e.clientY},{dismissed:s,consume:c}=a(e,t,o);if(s[0]?.outsidePress===`click`){if(e.button!==0)return;i={layer:s[0],target:t,point:o},c&&(e.preventDefault(),n=!0)}else{c&&(e.preventDefault(),n=!0);for(let t of s)t.onOutsidePress?.(e)}},{capture:!0}),c=aA(t,`pointerup`,e=>{let t=i;i=void 0,t&&t.layer.active()&&(yA(t.layer,e.composedPath()[0],e)||o(e,t.target,t.point))},{capture:!0}),l=aA(t,`click`,e=>{if(n&&e.detail){n=!1,e.preventDefault(),e.stopPropagation();return}if(n=!1,!r)return;let t=r;r=void 0,Math.hypot(e.clientX-t.x,e.clientY-t.y)>10||o(e,t.target,{x:t.x,y:t.y})&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),u=aA(e,`keydown`,t=>OA(e,t)),d=aA(t,`blur`,e=>{for(let t of gA().reverse())t.onBlur?.(e)});return()=>{if(s(),c(),u(),d(),!n)return l();let e=()=>(l(),r(),i()),r=aA(t,`pointerdown`,e,{capture:!0}),i=aA(t,`click`,e,{capture:!0})}}function SA(e,t){return yA(e,t)}function CA(e){let t=bk(e);return gA().reverse().find(e=>t.some(t=>e.contains(t)))}function wA(e){jA.closed=e,setTimeout(()=>{jA.closed===e&&(jA.closed=void 0)})}function TA(){return jA.closed}function EA(e){let t=e.defaultView;if(!t)return()=>{};let n=jA.listening.get(e);n||jA.listening.set(e,n={layers:0,stop:xA(e,t)});let r=n;return r.layers++,()=>{--r.layers>0||(jA.listening.delete(e),r.stop())}}function DA(e){return e.el?.ownerDocument??document}function OA(e,t,n){if(t.key!==`Escape`||t.defaultPrevented||oA(t))return;let r=gA().filter(t=>DA(t)===e).at(-1);!r?.onEscape||r.takesEscape?.()===!1||n&&r!==n||(jA.escapeAt=performance.now(),r.onEscape(t))}function kA(e,t){OA(DA(e),t,e)}function AA(e){jA.pushed=(jA.pushed??0)+1,e.order=jA.pushed,jA.stack.push(e);let t=EA(DA(e)),n=!1;return()=>{if(n)return;n=!0;let r=jA.stack.indexOf(e);r!==-1&&jA.stack.splice(r,1),t()}}var jA,MA=t((()=>{PO(),sA(),jk(),uA(),jA=globalThis[Symbol.for(`ui-sdk.layers@2`)]??={stack:[],listening:new Map}}));function NA(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let a=e.style.getPropertyValue(t);return()=>{e.style.getPropertyValue(t)===a&&(r?e.style.setProperty(t,r,i):e.style.removeProperty(t))}}function PA(e){if(typeof CSS<`u`&&CSS.registerProperty){for(let t of e)if(!HA.has(t)){HA.add(t);try{CSS.registerProperty({name:t,syntax:`*`,inherits:!1})}catch{}}}}function FA(e){if(WA.has(e))return WA.get(e);let t;for(let n=e;n&&!t;n=n.defaultView?.frameElement?.ownerDocument)t=n.head?.querySelector(`meta[property="csp-nonce"]`);let n=t?t.nonce||t.getAttribute(`nonce`)||``:null;return WA.set(e,n),n}function IA(e,t,n){if(!e.head)return;let r=e.defaultView;FA(e)===``&&r&&`adoptedStyleSheets`in e?RA(e,r,t,n):LA(e,t,n)}function LA(e,t,n){let r=e.getElementById(t);if(r){if(GA.get(r)===n)return;r.textContent!==n&&(r.textContent=n),GA.set(r,n);return}let i=e.createElement(`style`);i.id=t;let a=FA(e);a&&(i.nonce=a),i.textContent=n,GA.set(i,n);let o=e.head.querySelectorAll(`:scope > style[id^="ui-sdk-"]`);o.length?o[o.length-1].after(i):e.head.prepend(i)}function RA(e,t,n,r){let i=UA().get(e);i||UA().set(e,i=new Map);let a=i.get(n);a||i.set(n,a={sheet:new t.CSSStyleSheet,css:``}),a.css!==r&&(a.sheet.replaceSync(r),a.css=r),e.adoptedStyleSheets.includes(a.sheet)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a.sheet])}function zA(e){IA(e,`ui-sdk-hidden`,`@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }`)}function BA(e){typeof window<`u`&&(performance.getEntriesByType(`paint`).length?KA?KA.push(e):(KA=[e],(window.requestIdleCallback??setTimeout)(()=>{let e=KA;KA=void 0,e.forEach(e=>e())})):e())}function VA(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var HA,UA,WA,GA,KA,qA,JA=t((()=>{HA=new Set,UA=()=>globalThis[Symbol.for(`ui-sdk.styles@1`)]??=new WeakMap,WA=new WeakMap,GA=new WeakMap,qA=new WeakSet}));function YA(e=document,t){let n={},r=cj.holders.get(e);r||cj.holders.set(e,r=new Set),r.size||cj.thaw.set(e,ZA(e)),r.add(n);let i=t&&mk()?ij(t):void 0;return()=>{r.delete(n)&&(i?.(),r.size||(cj.thaw.get(e)?.(),cj.thaw.delete(e)))}}function XA({scrollbar:e,gutter:t,padding:n}){let r={overflow:`hidden`,"scroll-behavior":`auto`};return e>0&&(t?r[`scrollbar-gutter`]=`stable`:r[`padding-right`]=`${n+e}px`),r}function ZA(e){let{scroller:t,gutter:n,padding:r}=lj.get(e)??QA(e),i=XA({scrollbar:n,gutter:typeof CSS<`u`&&CSS.supports(`scrollbar-gutter`,`stable`),padding:r}),a=Object.entries(i).map(([e,n])=>NA(t,e,n));return n>0&&a.push(NA(e.documentElement,`--scrollbar-width`,`${n}px`)),()=>a.forEach(e=>e())}function QA(e){let t=e.defaultView??window,n=$A(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:ej(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function $A(e,t){let{body:n,documentElement:r}=e;return!n||t.getComputedStyle(r).overflowY===`visible`?r:/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function ej(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let i=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-i}function tj(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,i=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||i}function nj(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let i=e;i&&i!==n&&i!==r;i=i.parentElement)if(tj(i,t))return!0;return!1}function rj(e){return e.fingers>1||e.zoomed?`browser`:e.scroller||e.slider||e.selecting?`element`:`page`}function ij(e){let t=e.ownerDocument,n=t.defaultView??window;IA(t,`ui-sdk-scroll-guard`,uj);let r=!e.hasAttribute(`data-scroll-guard`);r&&e.setAttribute(`data-scroll-guard`,``);let i=`browser`,a={x:0,y:0},o=!1,s=!0,c=aA(t,`touchstart`,e=>{let r=e.target instanceof Element?e.target:null,c=e.touches[0];a={x:c?.clientX??0,y:c?.clientY??0},o=!1,s=!0,i=rj({fingers:e.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!r&&nj(r,n),slider:!!r?.closest(`input[type="range"]`),selecting:t.getSelection()?.type===`Range`})},{capture:!0,passive:!0}),l=aA(t,`touchmove`,e=>{let t=e.touches[0];(!t||Math.hypot(t.clientX-a.x,t.clientY-a.y)>dj)&&(s=!1),i===`page`&&e.cancelable&&(e.preventDefault(),o=!0)},{passive:!1}),u=aA(t,`touchend`,e=>{let t=e.target;!e.defaultPrevented&&o&&s&&e.cancelable&&t instanceof n.Element&&(e.preventDefault(),t.closest(`input, textarea, select, [contenteditable]`)?.focus(),t instanceof n.HTMLElement?t.click():t.dispatchEvent(new n.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0})))},{passive:!1});return()=>{c(),l(),u(),r&&e.removeAttribute(`data-scroll-guard`)}}function aj(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function oj(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(fj)),...pA()],r=n.filter(e=>!n.some(t=>t!==e&&t.contains(e))),i=new Set;for(let e of r)for(let t=e;t;t=aj(t))i.add(t);let a=[];for(let e of r)for(let n=e;n&&n!==t.body;n=aj(n))for(let e of Array.from(n.parentNode?.children??[])){if(i.has(e)||!(e instanceof HTMLElement))continue;let t=cj.inert.get(e)??(e.inert?1/0:0);t===0&&(e.inert=!0),t!==1/0&&cj.inert.set(e,t+1),a.push(e)}return()=>{for(let e of a){let t=cj.inert.get(e);t!==void 0&&(t<=1?(e.inert=!1,cj.inert.delete(e)):cj.inert.set(e,t-1))}}}function sj(e){let t=e,n=oj(t),r=!1,i=e=>{let r=n;t=e,n=oj(e),r()};return Object.assign(()=>{r||(r=!0,n())},{keep(e){return r?()=>{}:(i([...t,e]),()=>{r||i(t.filter(t=>t!==e))})}})}var cj,lj,uj,dj,fj,pj=t((()=>{sA(),MA(),gk(),JA(),cj=globalThis[Symbol.for(`ui-sdk.modal@2`)]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap},lj=new WeakMap,uj=`@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }`,dj=8,fj=`[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output`}));function mj(e){let t=e.length;if(t<=1)return e;let n=e[0].el.parentNode;if(n){let r=!0,i=!0;for(let a=1;a<t;a++){let t=e[a].el;if(t.parentNode!==n){r=!1;break}i&&e[a-1].el.nextElementSibling!==t&&(i=!1)}if(r){if(i)return e;if(`firstElementChild`in n){let r=new Map;for(let n=0;n<t;n++)r.set(e[n].el,e[n]);let i=[],a=t*yj;for(let e=n.firstElementChild;e&&a--;e=e.nextElementSibling){let n=r.get(e);if(n&&i.push(n)===t)return i}}}}let r=t<vj?null:n;for(;r;){let n=!0;for(let i=0;i<t;i++)if(!r.contains(e[i].el)){n=!1;break}if(n)break;r=r.parentNode}if(r){let n=new Map;for(let r=0;r<t;r++)n.set(e[r].el,e[r]);let i=[],a=e[0].el.ownerDocument.createTreeWalker(r,1),o=t*yj;for(let e=r;e&&o--;e=a.nextNode()){let r=n.get(e);if(r&&i.push(r)===t)return i}}return e.sort((e,t)=>_j(e.el,t.el))}var hj,gj,_j,vj,yj,bj=t((()=>{hj=4,gj=(e,t)=>!!(e.compareDocumentPosition(t)&hj),_j=(e,t)=>gj(e,t)?-1:1,vj=16,yj=32}));function xj(e,t){let n={...wj[e]};for(let e of Object.keys(Sj)){let r=t[e];r!==void 0&&Object.assign(n,{[e]:r})}return n}var Sj,Cj,wj,Tj=t((()=>{Sj={tab:`close`,blur:`always`,outsidePress:`pointerdown`,shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},Cj=e=>e.trapFocus?`trap`:`flow`,wj={menu:Sj,select:Sj,combobox:{...Sj,tab:`native`},popover:{...Sj,tab:Cj,blur:`iframe`},dialog:{...Sj,tab:Cj,blur:`never`,outsidePress:`click`,shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:e=>e.inertAndLock},tooltip:{...Sj,tab:`native`,movesFocus:!1},hoverCard:{...Sj,tab:`flow`},navigationMenu:{...Sj,tab:`flow`,blur:`never`}}}));function Ej(e){let t=Oj();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;r>0?t.set(e,r):t.delete(e)}}function Dj(e,t,n=`[data-slot="${e.getAttribute(`data-slot`)}"]`){return t.target.closest(n)===e}var Oj,kj=t((()=>{Oj=()=>globalThis[Symbol.for(`ui-sdk.popup-elements@1`)]??=new WeakMap}));function Aj(e){return!(e instanceof HTMLElement)||e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert]`)||(e.checked?[]:jj(e)).some(e=>e.checked&&Aj(e))?!1:typeof e.checkVisibility==`function`?e.checkVisibility({visibilityProperty:!0}):e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`}function jj(e){return!(e instanceof HTMLInputElement)||e.type!==`radio`||!e.name?[]:(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter(t=>t instanceof HTMLInputElement&&t.type===`radio`&&t.name===e.name&&t.form===e.form)}function Mj(e){return Array.from(e.querySelectorAll(Lj)).filter(Aj)}function Nj(e){let t=e=>[...e.filter(e=>e.index>0).sort((e,t)=>e.index-t.index),...e.filter(e=>e.index<=0)].flatMap(e=>e.stops),n=(e,r)=>{for(let i of e){let e=i.hasAttribute(`tabindex`)?i.tabIndex:0;if(i.hasAttribute(`inert`)||i.shadowRoot&&e<0)continue;let a=i.matches(Lj)&&!i.shadowRoot?.delegatesFocus&&Aj(i)?[i]:[],o=i instanceof HTMLSlotElement?i.assignedElements():[];if(i.shadowRoot||o.length){let s=[];n(i.shadowRoot?.children??o,s),r.push({index:e,stops:[...a,...t(s)]})}else r.push({index:e,stops:a}),n(i.children,r)}},r=[];return n(e.children,r),r.flatMap(e=>e.stops)}function Pj(e,t){let n=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(n.assignedSlot)return!0;return!1};return e.filter(e=>e.tabIndex>0&&!n(e)).sort((e,t)=>e.tabIndex-t.tabIndex)}function Fj(e,t,n){let r=e=>{for(let t of e.children)if(i(t))return!0;return!1},i=e=>{if(e===n)return!1;if(t(e))return!0;if(e.shadowRoot)return r(e.shadowRoot);if(e.localName===`slot`){let t=e.assignedElements({flatten:!0});if(t.length)return t.some(i)}return r(e)};r(e)}function Ij(e,t){let n=e.ownerDocument??document,r=!1,i;return Fj(n.body,t=>r&&t.matches(Lj)&&Aj(t)?(i=t,!0):(r||=t===e,!1),t),i}var Lj,Rj=t((()=>{Lj=`a[href],area[href],button,input:not([type='hidden']),select,textarea,iframe,summary,audio[controls],video[controls],[contenteditable]:not([contenteditable='false']),[tabindex]`}));function zj(e,t){let n=e.ownerDocument,r=!1,i,a=[],o=()=>{a.forEach(e=>e.remove()),a=[],i=void 0},s=()=>{let e=n.createElement(`span`);return e.tabIndex=0,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=Bj,e},c=()=>{let o=yk(n);!r&&!a.length&&t()&&o instanceof HTMLIFrameElement&&xk(e,o)&&(i=o,a=[s(),s()],o.before(a[0]),o.after(a[1]))},l=()=>{c(),setTimeout(c)},u=aA(n.defaultView??window,`blur`,l),d=aA(n,`focusout`,l),f=aA(n,`focusin`,t=>{let n=a.indexOf(t.composedPath()[0]),r=i;if(o(),n<0||!r)return;let s=Nj(e),c=n===0?-1:1;(s.at((s.indexOf(r)+c)%s.length)??e).focus({preventScroll:!0})});return()=>{r=!0,u(),d(),f(),o()}}var Bj,Vj=t((()=>{sA(),Rj(),jk(),Bj=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none`}));function Hj(e,t){Zj.get(e)?.();let n=qA.delete(e)?[]:e.getAnimations?.({subtree:!0}).filter(Qj),r=n?.every(t=>$j(t)!==e);if(e.setAttribute(`data-starting-style`,``),n&&r)for(let t of e.getAnimations?.({subtree:!0})??[])Qj(t)&&!n.some(e=>eM(t,e))&&t.finish();let i,a,o=requestAnimationFrame(()=>a=setTimeout(()=>{e.removeAttribute(`data-starting-style`),t&&(i=qj(e,t))}));return()=>{cancelAnimationFrame(o),clearTimeout(a),i?.(),e.removeAttribute(`data-starting-style`)}}function Uj(e){return e.split(`,`).map(e=>{let t=parseFloat(e)||0;return e.trim().endsWith(`ms`)?t/1e3:t})}function Wj(e){return Math.max(Gj(getComputedStyle(e)),Gj(getComputedStyle(e,`::backdrop`)))}function Gj(e){let t=(e,t,n=`1`)=>{let r=Uj(e),i=Uj(t),a=n.split(`,`).map(e=>e.trim()===`infinite`?1:parseFloat(e)||1);return r.map((e,t)=>(e*(a[t%a.length]??1)+(i[t%i.length]??0))*1e3)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Kj(e){let t=0;for(let n of e){let e=n.effect?.getComputedTiming(),r=Number(e?.endTime);e&&Number.isFinite(r)&&(t=Math.max(t,r-(Number(e.localTime)||0)))}return t}function qj(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter(tM),i=()=>{n||(n=!0,clearTimeout(a),t())},a=r.length?setTimeout(i,Math.max(Wj(e),Kj(r))+50):void 0;return r.length?Promise.allSettled(r.map(e=>e.finished)).then(i):NO(i),()=>{n=!0,clearTimeout(a)}}function Jj(e,t){e.toggleAttribute(`data-open`,t),e.toggleAttribute(`data-closed`,!t)}function Yj(e,t){let n=e.length,r=!1,i=[],a=e.map(e=>Xj(e,(e,a)=>{i.push(e),r||=a,--n>0||(i.forEach(e=>e(r)),t())}));return()=>a.forEach(e=>e())}function Xj(e,t){Zj.get(e)?.(),e.removeAttribute(`data-starting-style`),e.setAttribute(`data-ending-style`,``);let n=e.hasAttribute(`inert`);e.setAttribute(`inert`,``);let r=e.ownerDocument?.defaultView?.MutationObserver,i=!1,a=r&&new r(()=>i=!0);a?.observe(e,{attributeFilter:[`inert`]});let o=0,s=()=>{cancelAnimationFrame(o),Zj.delete(e),e.removeAttribute(`data-ending-style`),i||=!!a?.takeRecords().length,a?.disconnect(),i||e.toggleAttribute(`inert`,n)},c=t=>{if(!t)return s();Zj.set(e,s),o=requestAnimationFrame(()=>{o=requestAnimationFrame(s)})},l=!1,u=qj(e,()=>t(c,l));return l=!0,()=>{u(),s()}}var Zj,Qj,$j,eM,tM,nM=t((()=>{PO(),JA(),Zj=new WeakMap,Qj=e=>`transitionProperty`in e,$j=e=>e.effect?.target,eM=(e,t)=>$j(e)===$j(t)&&e.transitionProperty===t.transitionProperty,tM=e=>!e.timeline||!(`source`in e.timeline)}));function rM(e){return{consumeOutsidePress:e===!0||e===`pointer`,trapFocus:e===!0||e===`trap-focus`,inertAndLock:e===!0}}function iM(e){return e===`initial`||e===`hover`?`none`:e===`touch`?`popup`:`auto`}function aM(e){return e.focusable&&!e.consumed?!1:e.type!==`pointerdown`||`later`}function oM(e){e.localName===`input`&&wM.has(e.type)&&e.value&&e.getAttribute(`aria-expanded`)!==`true`&&e.select()}function sM(e,t){for(let n of e){let e=n();if(e&&t(e))return e}}function cM(e,t,n){eA(e,t,(e,t)=>`open`in e&&e.open!==t.open?n(!!e.open,t):void 0)}function lM(e,t){return{id:`${t}-content`,tabindex:`-1`,hidden:e.mounted?void 0:``,...Mk(e.open)}}function uM(e,t){return typeof e==`function`?e()??void 0:typeof e==`string`?t.querySelector(e)??void 0:e}function dM(e){return e.isConnected&&!e.closest(`[inert]`)}function fM(e){let t=e.getRangeAt(0).cloneRange();return{range:t,backward:!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset}}function pM(){let e=yk();return!e||e===e.ownerDocument.body||!dM(e)||e.checkVisibility?.()===!1}function mM(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function hM(e){return e.getRootNode().activeElement}function gM(e,t){let n=EM().get(e);n||EM().set(e,n={selectors:new Set,css:``});let r=n.selectors;t.every(e=>r.has(e))||(t.forEach(e=>r.add(e)),n.css=`@layer ui-sdk { :where(${[...r].map(e=>`${e}[popover]`).join(`, `)}) { inset: auto; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none } }`),n.css&&IA(e,`ui-sdk-popover-reset`,n.css)}function _M(e){hk&&!DM.has(e)&&(DM.add(e),BA(()=>{gM(document,e),zA(document)}))}function vM(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener(`close`,t=>{performance.now()-vA()<100||e(t)}),()=>n?.destroy()}function yM(e,t){for(let n=e;n;n=n.parent)if(n===t||kM.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function bM(e){let t=xj(e.preset,e),n=()=>typeof t.tab==`function`?t.tab(e.modal()):t.tab,{store:r}=e,i,a,o,s=!1,c,l,u,d=r.get().open?`initial`:`imperative`,f=t.focusOnMount&&r.get().open,p=!1,m=!1,h=!1,g=!0,_=!1,v,y=!1,b,x=r.get().open,S=()=>void 0,C=[],w=e.returnTrigger??e.trigger,T,E,D,O,k=(t,n)=>e.onOpenChangeComplete?.(t,n),A=e=>e||!!a?.el&&hk;cM({store:r},[`mounted`],e=>A(e)===e?{mounted:e}:void 0);function ee(e){v=e;let t=e?.isContentEditable?e.ownerDocument.getSelection():null;b=t?.rangeCount&&e.contains(t.anchorNode)?fM(t):void 0;let n=v&&CA(v),r=n?void 0:TA();S=n?.returnTarget??(()=>r)}let j=r.get().open;r.subscribe(()=>{let{open:n}=r.get();if(n===j)return;if(j=n,n){if(O?.(!0),e.onOpenChange?.(!0),c?.(),c=void 0,a)for(let e of[a.el,a.backdrop])e&&Jj(e,!0);let t=e.trigger();_=d===`imperative`&&!!t&&CM.has(t),f=!_,p=!0,g=!0;let n=hk?yk():null;ee(n&&n!==n.ownerDocument.body?n:void 0);let o=w();x=d===`imperative`||h&&!!v&&!CA(v)&&!TA()&&!(o&&xk(o,v));let s=!!a;r.set({mounted:!0}),i?(s&&ae(),re()):hk||(p=!1,k(!0));return}let m=t.movesFocus&&!_&&g;g=!0,f=!1,p=!1,d=`imperative`,h=!1;let y=O?.(!1);s=y?.reason===`outside-press`;let C=a?.el;o&&wA(te());let T=S,E=b;if(b=void 0,!C||!hk){e.onOpenChange?.(!1,y),r.set({mounted:!1}),k(!1,y);return}let D=yk(),A=e.trigger(),M=!D||D===C.ownerDocument.body||xk(C,D)||!!o&&SA(o,D)&&!(A&&xk(A,D));e.onOpenChange?.(!1,y),i?.config.onClose?.();let N=mA(),P=e.finalFocus?.()??`trigger`,I=[C,...a?.backdrop?[a.backdrop]:[]];I.forEach(e=>Jj(e,!1));let ne=!1,L=Yj(I,()=>{ne=!0,c=void 0,r.set({mounted:!1}),ae(),k(!1,y)});if(ne||(c=L),l?.(),l=void 0,u?.(),u=void 0,!m||!M)return;if(m===!0){F(C,T,!1,E,P);let e=yk();setTimeout(()=>{e&&!e.isConnected&&pM()&&!hA(N)&&F(C,T,!1,void 0,P)});return}if(m===`unless-moved`){queueMicrotask(()=>{let e=yk();e&&e!==C.ownerDocument.body&&!xk(C,e)||hA(N)||F(C,T,!1,E,P)});return}let ie=()=>{R(),clearTimeout(oe),setTimeout(()=>{let e=yk();e&&e!==C.ownerDocument.body||F(C,T,!1,E,P)})},R=aA(window,`pointerup`,ie,{capture:!0}),oe=setTimeout(ie,1e3)});function M(t,n,r=S,i=!1){let a=()=>r(n,i),o=()=>P(t,i);return x?[()=>v,a,w,o,e.trigger]:[w,()=>v,a,o,e.trigger]}let N=!1;function te(e=dM,t=!1){if(!N){N=!0;try{return sM(M(a?.el,e,S,t),e)}finally{N=!1}}}function P(e,t=!1){let n=C[0]?.node;if(n?.isConnected&&!e?.contains(n)){for(let t of[...C.slice(1).map(e=>e.node),n.ownerDocument.body]){let r=Mj(t).filter(t=>!e?.contains(t)),i=r.find(e=>gj(n,e)&&!n.contains(e))??r.filter(e=>gj(e,n)).pop();if(i)return i}return}let r=C.findIndex((e,t)=>!e.node.isConnected&&C[t+1]?.node.isConnected);if(r===-1)return;let i=C[r],a=i.next?.deref(),o=i.previous?.deref(),s=C[r+1].node,c=e=>!!e?.isConnected&&e.parentNode===s,l=c(a)?a.previousElementSibling===(i.previous?o:null):!i.next&&(i.previous?c(o)&&!o.nextElementSibling:!s.firstElementChild);if(t&&!l)return;let u=(e,t)=>e.contains(t)||gj(e,t),d=c(a)?e=>u(a,e):c(o)?e=>gj(o,e)&&!o.contains(e):e=>u(s,e);for(let{node:t}of C.slice(r+1)){let n=Mj(t).filter(t=>!e?.contains(t)),r=c(o)?n.filter(e=>!u(o,e)||o.contains(e)).pop():void 0,i=n.find(d)??r??n[0];if(i)return i}}function F(t,n,r=!1,i,a=e.finalFocus?.()??`trigger`){if(a===`none`)return;let o=e=>{if(!dM(e)||t.contains(e))return!1;let n=e.ownerDocument.getSelection(),r=i&&e===v?n?.rangeCount&&e.contains(n.anchorNode)?fM(n):i:void 0;if(qO(e),yk()!==e)return!1;if(r&&e.contains(r.range.startContainer)){let{startContainer:e,startOffset:t,endContainer:i,endOffset:a}=r.range;r.backward?n?.setBaseAndExtent(i,a,e,t):n?.setBaseAndExtent(e,t,i,a)}return!0},s=M(t,o,n,r);a!==`trigger`&&s.unshift(()=>uM(a,t.ownerDocument)),sM(s,o)}function I(e,n){if(!f||!a||!r.get().open||!t.movesFocus)return;f=!1;let i=iM(d),o=d===`initial`&&t.focusOnMount||i===`popup`&&n?.()?`auto`:i;if(o===`none`)return;let s=()=>{if(!a||!r.get().open)return;let t=o===`popup`?a.el:e?.();if(!t||(JO(t),!a||!r.get().open))return;let n=yk();!n||!xk(t,n)&&!xk(a.el,n)?JO(a.el):oM(t)};m?requestAnimationFrame(()=>{let e=yk();a&&e&&xk(a.el,e)||s()}):s()}function ne(i,c,m){let h=[],g=e.trigger(),b=c.host?.()??i;if(d===`initial`&&!v){let e=yk();ee(e&&e!==e.ownerDocument.body&&!xk(i,e)?e:void 0)}i.removeAttribute(`hidden`),b.removeAttribute(`hidden`);let x=a?.backdrop;if(x){let e=L(x,c.inline);h.push(()=>{e(),ie(x)})}if(!c.inline){b.setAttribute(`popover`,`manual`);try{b.showPopover()}catch{}}if(m&&qA.add(i),c.position&&e.position){let t=e.position(()=>c.anchor?.()??e.trigger(),i,c.position,()=>e.close(`anchor-hidden`,{focus:!1}));T=t.place,E=t.follow,h.push(t,()=>T=E=void 0),c.rendered&&h.push(c.rendered(t.follow))}c.inline||_k()||b.style.zIndex||(b.style.zIndex=`2147483000`),h.push(Hj(i,p?()=>{p=!1,k(!0)}:void 0)),HO();let S=_?rM(!1):e.modal(),O=t.blur,A=e.persistent?.()??[],j=(e,t)=>e===i&&!!t&&`clientX`in t&&mM({x:t.clientX,y:t.clientY},i.getBoundingClientRect()),M=w()??(!g&&v?.isConnected?v:void 0);(M||!g)&&(C=[]);for(let e=M??null;e&&e!==i.ownerDocument.body;e=e.parentElement){let{nextElementSibling:t,previousElementSibling:n}=e;C.push({node:e,next:t&&new WeakRef(t),previous:n&&new WeakRef(n)})}let N={parent:e.parent?.()??(g&&CA(g)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:S.consumeOutsidePress,blocking:typeof t.blocking==`function`?t.blocking(S):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:i,covers:e=>b.contains(e),contains:(t,n)=>i.contains(t)&&!j(t,n)||A.some(e=>e.contains(t))||(e.contains?e.contains(t,n):!!e.trigger()?.contains(t)),overBackdrop:(e,t)=>s&&!!a?.backdrop&&!mM({x:e,y:t},a.backdrop.getBoundingClientRect())&&mM({x:e,y:t},i.getBoundingClientRect()),returnTarget:te,onOutsidePress:t=>{let n=t.composedPath()[0];e.close(`outside-press`,{event:t,focus:aM({type:t.type,focusable:!!n?.closest?.(TM),consumed:S.consumeOutsidePress})})},takesEscape:e.takesEscape,onEscape:t=>{t.preventDefault(),e.onEscape?e.onEscape(t):e.close(`escape-key`,{event:t,focus:!0})},onBlur:O===`never`?void 0:O===`always`?t=>e.close(`window-blur`,{event:t,focus:!1}):(t=>setTimeout(()=>{let n=hM(i)??i.ownerDocument.activeElement;n?.tagName===`IFRAME`&&!i.contains(n)&&e.close(`focus-out`,{event:t,focus:!1})}))};o=N,OM.set(N,[i,...x?[x]:[]]),h.push(AA(N)),AM.set(N,{inside:e=>e.contains(i)||!!g&&e.contains(g),again:()=>{let e=yk();ae();for(let e of[b,x])try{e?.hidePopover()}catch{}re(),e&&e!==yk()&&e.focus({preventScroll:!0})}}),S.inertAndLock&&kM.add(N);for(let t of[e.onShow,c.onShow]){let e=t?.(N);e&&h.push(e)}let P,F,ne,R=()=>{let e=[i,...a?.backdrop?[a.backdrop]:[],...A];g&&t.keepTrigger&&e.push(g);for(let t of _A())t!==N&&yM(t,N)&&e.push(...OM.get(t)??[]);P=YA(i.ownerDocument,i);let n=sj(e);N.keep=n.keep,l=F=n},oe=()=>{ne?.(),F?.(),P?.(),l===F&&(l=void 0),F=P=N.keep=void 0};S.inertAndLock&&(ne=VA(()=>{if(ne=void 0,!r.get().open)return;let e=yk();R(),n()===`trap`&&e&&!dM(e)&&(f=!0,I(c.initialFocus,c.chosenFocus))})),D=()=>{let n=_?rM(!1):e.modal();N.modal=n.consumeOutsidePress,N.blocking=typeof t.blocking==`function`?t.blocking(n):t.blocking,n.inertAndLock?kM.add(N):kM.delete(N),n.inertAndLock&&!S.inertAndLock&&r.get().open?R():!n.inertAndLock&&S.inertAndLock&&oe(),S=n},h.push(oe,()=>D=void 0);let se=new Set(_A());for(let e=N.parent;e;e=e.parent)se.add(e);se.delete(N);for(let e of se)if(e.keep&&yM(N,e))for(let t of[i,...x?[x]:[]])h.push(e.keep(t));if(n()===`flow`&&t.dismissOnFocusLoss){let t;h.push(aA(i.ownerDocument,`mousedown`,e=>{t=e,y=!1,setTimeout(()=>{t===e&&(t=void 0)})},{capture:!0}),aA(i.ownerDocument,`focusin`,n=>{y=!1;let a=hM(i)??n.target;r.get().open&&!SA(N,a)&&(t&&N.contains(a,t)||e.close(`focus-out`,{event:n,focus:!1}))}),aA(i,`focusout`,t=>{y&&!t.relatedTarget&&setTimeout(()=>{let n=yk(i.ownerDocument);r.get().open&&!(n&&SA(N,n))&&e.close(`focus-out`,{event:t,focus:!1})})}))}if(h.push(zj(i,()=>n()===`trap`)),t.closeWatcher){let t=vM(t=>e.close(`back`,{event:t,focus:!0}));t&&(u=t,h.push(()=>{t(),u===t&&(u=void 0)}))}let ce=t=>{let n=t.target,r=t.submitter;(r?.getAttribute(`formmethod`)??n.getAttribute(`method`))?.toLowerCase()===`dialog`&&CA(n)===N&&(t.preventDefault(),e.close(`close-press`,{event:t,focus:!0,returnValue:r?.value||void 0}))};i.addEventListener(`submit`,ce),h.push(()=>i.removeEventListener(`submit`,ce)),r.get().open&&!f&&n()===`trap`&&pM()&&(f=!0);for(let e of _A()){let t=AM.get(e);e!==N&&t?.inside(i)&&t.again()}return queueMicrotask(()=>I(c.initialFocus,c.chosenFocus)),()=>{if(h.forEach(e=>e()),o===N&&(o=void 0),!r.get().mounted&&!c.inline)try{b.hidePopover()}catch{}}}function re(e=!1){if(!i||a)return;let{el:t,config:n}=i;a={el:t,cleanup:()=>{},backdrop:n.backdrop?.()},a.cleanup=ne(t,n,e)}function L(e,t=!1){if(e.removeAttribute(`hidden`),t)return Hj(e);e.setAttribute(`popover`,`manual`);try{e.showPopover()}catch{}return!_k()&&!e.style.zIndex&&(e.style.zIndex=`2147483000`),Hj(e)}function ie(e){if(!r.get().mounted)try{e.hidePopover()}catch{}}function ae(){if(!a)return;let{cleanup:e}=a;a=void 0,e()}function R(t){if(y=t.key===`Tab`,t.key===`Escape`&&o)return kA(o,t);let r=a?.el;if(t.key!==`Tab`||!r)return;let i=n();if(i===`native`)return;if(i===`close`)return e.close(`focus-out`,{event:t,focus:!1});let s=Mj(r),c=Nj(r),l=c[0],u=c.at(-1),d=yk(),f=!l||d===l||d===r,p=!u||d===u,m=i===`trap`?Pj(s,r):[];if(m.length){let e=[...m,...s.filter(e=>!m.includes(e))],n=e.indexOf(d),i=d===r?e.at(t.shiftKey?-1:0):e.at((n+(t.shiftKey?-1:1))%e.length),a=m.includes(d)||!!i&&m.includes(i),o=d?.shadowRoot,c=!t.shiftKey&&!!o&&Mj(o).length>0;if(d!==r&&(n<0||!a||c))return;t.preventDefault(),i?.focus({preventScroll:!0});return}if(i===`trap`){if(t.shiftKey?f:p){t.preventDefault(),((t.shiftKey?u:l)??r).focus({preventScroll:!0});return}let e=s.indexOf(d),n=e<0?void 0:s[e+(t.shiftKey?-1:1)],i=n&&!n.checked?jj(n):[];if(i.some(e=>e.checked)&&!i.includes(d)){t.preventDefault(),n?.focus({preventScroll:!0});return}setTimeout(()=>{let e=yk(r.ownerDocument);a?.el===r&&!(e&&(xk(r,e)||o&&SA(o,e)))&&((t.shiftKey?u:l)??r).focus({preventScroll:!0})});return}let h=e.trigger()??(v?.isConnected?v:void 0);if(h){if(t.shiftKey&&f)t.preventDefault(),h.focus({preventScroll:!0});else if(!t.shiftKey&&p){let e=Ij(h,r);if(!e)return;t.preventDefault(),e.focus()}}}return{bind(n,o={}){let s=!1,c=Ej(n),l=()=>{i={el:n,config:o},r.get().mounted&&(a&&a.el!==n&&ae(),re(!0))};return n.isConnected?l():queueMicrotask(()=>{!s&&n.isConnected&&l()}),()=>{s=!0;let o=e.finalFocus?.()??`trigger`;if(c(),i?.el===n&&(i=void 0,a?.el===n)){let e=yk(),a=r.get().open&&t.movesFocus&&!_&&(!e||e===n.ownerDocument.body||xk(n,e)),s=S;if(ae(),a){let e=b;b=void 0,queueMicrotask(()=>{!i&&!n.isConnected&&pM()&&F(n,s,!0,e,o)})}}}},keydown:R,triggerKeydown(e){let t=a?.el;e.key===`Tab`&&!e.shiftKey&&t&&r.get().open&&n()===`flow`&&(e.preventDefault(),(Nj(t)[0]??t).focus({preventScroll:!0}))},opening(e,t){d=e,m=t?.type===`pointerdown`,h=t?.type===`keydown`},opener:()=>d,observe(e){O=e},requestClose:(t,n)=>e.close(t,{event:n,focus:!0}),returnFocus(e){g=e},initialFocus:I,place:()=>T?.(),checkPlacement:()=>E?.(),updateModal:()=>D?.(),layer:()=>o,element:()=>a?.el,mountedAs:A,backdrop(e){if(!a||a.backdrop===e)return()=>{};let{el:t}=a,n=i?.config.host?.()??t,r=!!i?.config.inline;a.backdrop=e;let s=L(e,r),c=yk();if(!r)try{n.hidePopover(),n.showPopover()}catch{}c&&c!==yk()&&c.focus({preventScroll:!0});let l=o?.keep?.(e);return()=>{l?.(),s(),a?.backdrop===e&&(a.backdrop=void 0),ie(e)}}}}var xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM=t((()=>{Nk(),iA(),sA(),MA(),pj(),sk(),bj(),gk(),JA(),jk(),Tj(),kj(),Vj(),nM(),Rj(),xM={mouse:`pointer`,pen:`pointer`,touch:`touch`,keyboard:`keyboard`,virtual:`keyboard`,programmatic:`imperative`,agent:`imperative`},SM=e=>e?xM[GO(e)]:`imperative`,CM=new Set,wM=new Set([`text`,`search`,`url`,`tel`,`email`,`password`]),TM=`a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]`,EM=()=>globalThis[Symbol.for(`ui-sdk.popover-reset@2`)]??=new WeakMap,DM=new WeakSet,OM=new WeakMap,kM=new WeakSet,AM=new WeakMap}));function MM(e,t=!1){return e===`start`?t?`right`:`left`:e===`end`?t?`left`:`right`:e}var NM,PM=t((()=>{NM={top:`bottom`,bottom:`top`,left:`right`,right:`left`}}));function FM(){return BM??=typeof CSS<`u`&&typeof CSS.supports==`function`&&[`position-anchor: --a`,`position-try-fallbacks: flip-y`,`position-visibility: always`].every(e=>CSS.supports(e)),BM}function IM(e,t,n,r,i){if(!FM()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!VM(i))return!1;let a=e=>e.split(`,`).some(e=>parseFloat(e)>0);return!a(r.transitionDuration)&&(r.animationName===`none`||!a(r.animationDuration))}function LM(e,t,n,r,i){let{sideOffset:a,alignOffset:o,collisionPadding:s}=r,c=t===`top`||t===`bottom`,[l,u]=c?[`left`,`right`]:[`top`,`bottom`],d=c?i.width:i.height,f=n===`start`?`anchor(${l}) + ${o}px`:n===`end`?`anchor(${u}) - ${d+o}px`:`anchor(center) - ${d/2-o}px`,p=NM[t];return{[p]:`round(anchor(${t}), 1px)`,[t]:`auto`,[`margin-${p}`]:`${a}px`,[`margin-${t}`]:`${s}px`,[l]:`round(min(max(${f}, min(${s}px, anchor(${u}))), max(100% - ${d+s}px, anchor(${l}) - ${d}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":c?`flip-y`:`flip-x`,"position-visibility":`always`}}function RM(e){let t=HM.get(e);if(t||(t=`--ui-anchor-${++UM.count}`,HM.set(e,t)),!e.style.getPropertyValue(`anchor-name`).split(`,`).some(e=>e.trim()===t)){let n=getComputedStyle(e).getPropertyValue(`anchor-name`);e.style.setProperty(`anchor-name`,n&&n!==`none`?`${n}, ${t}`:t)}return t}function zM(e){let t=HM.get(e),n=e.style.getPropertyValue(`anchor-name`).split(`,`).map(e=>e.trim()).filter(e=>e&&e!==t);n.length?e.style.setProperty(`anchor-name`,n.join(`, `)):e.style.removeProperty(`anchor-name`),e.getAttribute(`style`)||e.removeAttribute(`style`)}var BM,VM,HM,UM,WM=t((()=>{PM(),VM=e=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1},HM=new WeakMap,UM=globalThis[Symbol.for(`ui-sdk.anchor-names@1`)]??={count:0}}));function GM(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,[`scroll`,`load`,`input`,`pointermove`,`focusin`,`transitionstart`,`animationstart`]],[window,[`resize`]],[window.visualViewport,[`resize`,`scroll`]],[document.fonts,[`loadingdone`]]];for(let[e,r]of n)for(let n of r)e?.addEventListener(n,$M,t);let r=new MutationObserver(eN);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}function KM(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let t of[`scroll`,`load`,`transitionstart`,`animationstart`])e.addEventListener(t,$M,n);let r=new MutationObserver(eN);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function qM(e){let t=[];for(let n=e;n;)n.nodeType===11&&`host`in n?(t.push(n),n=n.host):n=n.assignedSlot??n.parentNode;return t}function JM(e){let t=[...e];for(let e of t){let t=tN.get(e)??{count:0,stop:KM(e)};t.count++,tN.set(e,t)}return()=>{for(let e of t.splice(0)){let t=tN.get(e);--t.count||(t.stop(),tN.delete(e))}}}function YM(e,t){XM.size||(QM=GM());let n=typeof ResizeObserver==`function`?new ResizeObserver(e):void 0;return t&&n?.observe(t),XM.set(e,n&&t),()=>{n?.disconnect(),XM.delete(e),XM.size||(QM(),QM=ZM)}}var XM,ZM,QM,$M,eN,tN,nN=t((()=>{XM=new Map,ZM=()=>{},QM=ZM,$M=e=>XM.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),eN=e=>XM.forEach((t,n)=>e.some(e=>e.attributeName!=`aria-activedescendant`&&!t?.contains(e.target))&&n()),tN=new Map}));function rN(e){let t=e;if(!e.getClientRects().length&&(getComputedStyle(e).display!==`contents`||(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)))return;let{x:n,y:r,width:i,height:a}=t.getBoundingClientRect();return{x:n,y:r,width:i,height:a}}function iN(e){let t=`getBoundingClientRect`in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}function aN(e,t,n,r,i){let{sideOffset:a,alignOffset:o}=i,s=n===`top`||n===`bottom`,c=0,l=0;return n===`bottom`&&(l=e.y+e.height+a),n===`top`&&(l=e.y-t.height-a),n===`right`&&(c=e.x+e.width+a),n===`left`&&(c=e.x-t.width-a),s?(r===`start`&&(c=e.x+o),r===`center`&&(c=e.x+e.width/2-t.width/2+o),r===`end`&&(c=e.x+e.width-t.width-o)):(r===`start`&&(l=e.y+o),r===`center`&&(l=e.y+e.height/2-t.height/2+o),r===`end`&&(l=e.y+e.height-t.height-o)),{x:c,y:l}}function oN(e,t,n,r,i){return e===`bottom`?t.y+n.height-(r.y+r.height-i):e===`top`?r.y+i-t.y:e===`right`?t.x+n.width-(r.x+r.width-i):r.x+i-t.x}function sN(e,t,n,r){let{sideOffset:i,collisionPadding:a}=r,o=e===`bottom`?n.y+n.height-a-(t.y+t.height+i):e===`top`?t.y-i-a-n.y:n.height-a*2,s=e===`right`?n.x+n.width-a-(t.x+t.width+i):e===`left`?t.x-i-a-n.x:n.width-a*2;return{width:Math.max(0,s),height:Math.max(0,o)}}function cN(e,t,n,r){let i={x:0,y:0,...n},a={...r,side:MM(r.side,r.rtl)},o=yN(a.side,a.align,a.rtl),s=a.side,c=aN(e,t,s,o,a),l=oN(s,c,t,i,a.collisionPadding);if(l>0){let n=NM[s],r=aN(e,t,n,o,a);oN(n,r,t,i,a.collisionPadding)<l&&(s=n,c=r)}let u=a.collisionPadding,d=sN(s,e,i,a),f=!1;if(oN(s,c,t,i,u)>0&&((s===`top`||s===`bottom`)&&t.height&&(e.height>=t.height||a.inside)?(f=!0,c.y=bN(bN(c.y,i.y+u,i.y+i.height-t.height-u),e.y,e.y+e.height-t.height),d.height=Math.max(0,i.height-u*2)):(s===`left`||s===`right`)&&t.width&&(e.width>=t.width||a.inside)&&(f=!0,c.x=bN(bN(c.x,i.x+u,i.x+i.width-t.width-u),e.x,e.x+e.width-t.width),d.width=Math.max(0,i.width-u*2))),s===`top`||s===`bottom`){let n=bN(c.x,i.x+u,i.x+i.width-t.width-u);c.x=n===c.x?n:bN(n,e.x-t.width,e.x+e.width)}else{let n=bN(c.y,i.y+u,i.y+i.height-t.height-u);c.y=n===c.y?n:bN(n,e.y-t.height,e.y+e.height)}return{...c,side:s,align:a.align,available:d,inside:f}}function lN(){wN||(wN=!0,BA(()=>PA(CN)))}function uN(e){let t=new Map,n=(e,n)=>t.get(e)!==n&&(t.set(e,n),!0);return{style(t,r){n(`style:${t}`,r)&&e.style.setProperty(t,r)},attribute(t,r){n(t,r)&&(r===null?e.removeAttribute(t):e.setAttribute(t,r))},reset:()=>t.clear()}}function dN(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function fN(e,t,n={},r){let i=()=>typeof n==`function`?n():n,a=()=>typeof e==`function`?e():e,o=e=>({side:e.side??`bottom`,align:e.align??`start`,sideOffset:Number(e.sideOffset??4),alignOffset:Number(e.alignOffset??0),collisionPadding:Number(e.collisionPadding??8)});PA(CN),Object.assign(t.style,{position:`fixed`,inset:`auto`,margin:`0`,left:`0`,top:`0`});let s=uN(t),c=getComputedStyle(t),l,u=``,d=``,f=!1,p,m=!1,h=!1,g=[],_=()=>{},v=!1,y,b={left:`0`,top:`0`},x,S=new Set;function C(e={left:`0`,top:`0`}){y&&zM(y.anchor),y=void 0;for(let e of S)s.style(e,``);S.clear(),u=``,s.style(`inset`,`auto`),s.style(`margin`,`0`),s.style(`left`,e.left),s.style(`top`,e.top)}function w(){if(h)return!1;let e=i(),n=o(e),T=Number(e.arrowPadding??6),E=a();if(!E)return!1;let D=`nodeType`in E?E:void 0,O=D&&rN(D);if(D&&f&&(!D.isConnected||!O))return y&&C(b),D.isConnected&&p===D&&(p=void 0,r?.()),!1;p=O?D:void 0;let k=D?qM(D):[];(k.length!==g.length||k.some((e,t)=>e!==g[t]))&&(_(),g=k,_=JM(k)),m=!D&&`getBoundingClientRect`in E;let A=dN();if(y&&(D!==y.anchor||!VM(A))&&C(),v)y&&RM(y.anchor);else if(v=!0,D&&O&&IM(D,O,t,c,A))y={anchor:D,name:RM(D)};else for(let e of TN)t.style.getPropertyValue(e)&&t.style.removeProperty(e);let ee=!f,j=ee&&qA.has(t),M=t.style.transition;ee&&!j&&(t.style.transition=`none`);let N=iN(O??E),te={width:t.offsetWidth,height:t.offsetHeight},P=EN(e),F=P?{width:P.offsetWidth,height:P.offsetHeight}:void 0,I=`${N.x},${N.y},${N.width},${N.height},${A.x},${A.y},${A.width},${A.height},${n.side},${n.align},${n.sideOffset},${n.alignOffset},${n.collisionPadding}`,ne=`${I},${te.width},${te.height},${F?.width??``},${F?.height??``},${T}`;if(ne===u&&(!P||P===l?.el))return!1;u=ne;let re={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},L=c.direction===`rtl`,ie=pN(c,te);if(y){let e=MM(n.side,L),t=LM(y.name,e,yN(e,n.align,L),n,ie);for(let[e,n]of Object.entries(t))S.add(e),s.style(e,n)}let ae=mN(t.getBoundingClientRect(),ie,c),{scale:R}=ae,oe={width:ie.width*R.x,height:ie.height*R.y},se={...n,inside:d===I,sideOffset:n.sideOffset*(vN(n.side)?R.y:R.x),alignOffset:n.alignOffset*(vN(n.side)?R.x:R.y),rtl:L},ce={x:N.x,y:N.y,width:N.width,height:N.height},le=cN(ce,oe,A,se);d=le.inside?I:``;let ue=x;x=ce;let de=e=>Math.abs(ae.x-e.x)<=1&&Math.abs(ae.y-e.y)<=1;if(y){let e=de(le),n=!e&&!!ue&&de(cN(ue,oe,A,se));if(!e&&!n)return C(),j||(t.style.transition=M),w();n&&(u=``),b={left:`${parseFloat(c.left)+parseFloat(c.marginLeft)}px`,top:`${parseFloat(c.top)+parseFloat(c.marginTop)}px`}}else{let e={x:ae.x-(parseFloat(c.left)||0)*R.x,y:ae.y-(parseFloat(c.top)||0)*R.y},n=t.ownerDocument.defaultView?.devicePixelRatio||1,r=e=>Math.round(e*n)/n;s.style(`left`,`${r((le.x-e.x)/R.x)}px`),s.style(`top`,`${r((le.y-e.y)/R.y)}px`)}let fe=vN(le.side)?R.x:R.y;ee&&(f=!0,j||(c.left,t.style.transition=M)),s.attribute(`data-side`,le.side),s.attribute(`data-align`,le.align),s.style(`--available-height`,`${le.available.height/R.y}px`),s.style(`--available-width`,`${le.available.width/R.x}px`),s.style(`--anchor-width`,`${N.width/R.x}px`),s.style(`--anchor-height`,`${N.height/R.y}px`);let[pe,me]=_N(le.side,le.align,L,N,oe,le);s.style(`--transform-origin`,`${Math.round(pe/R.x)}px ${Math.round(me/R.y)}px`);let he={x:le.x+re.left*R.x,y:le.y+re.top*R.y,width:re.width*R.x,height:re.height*R.y},ge=gN(N,he,le.side,T*fe);if(s.style(`--arrow-offset`,`${Math.round(ge/fe)}px`),P&&F){let e=hN(N,{...he,...oe},{width:F.width*R.x,height:F.height*R.y},le.side,T*fe),t=Math.round(e.offset/fe);l?.el!==P&&(l={el:P,write:uN(P)});let{write:n}=l;n.style(`position`,`absolute`),n.style(`left`,vN(le.side)?`${t}px`:``),n.style(`top`,vN(le.side)?``:`${t}px`),n.attribute(`data-side`,le.side),n.attribute(`data-align`,le.align),n.attribute(`data-arrow-clamped`,e.clamped?``:null)}return!0}let T=0,E=0;function D(){T=0,E=w()?0:E+1,(E<xN||m)&&(T=requestAnimationFrame(D))}function O(){E=0,T||=requestAnimationFrame(D)}let k=YM(O,t),A=setInterval(()=>T||w()&&O(),SN);w(),O();let ee=()=>{cancelAnimationFrame(T),clearInterval(A),k(),_(),g=[],h=!0},j=i(),M=DN(j),N=EN(j);function te(){let e=i(),t=DN(e),n=EN(e);(t!==M||n!==N)&&(M=t,N=n,O())}return Object.assign(ee,{follow:te,place(){f=!1,u=``,s.reset(),l?.write.reset(),w()}})}function pN(e,t){let n=t=>parseFloat(e.getPropertyValue(t))||0,r=(t,r)=>e.boxSizing===`border-box`?0:n(`padding-${t}`)+n(`padding-${r}`)+n(`border-${t}-width`)+n(`border-${r}-width`),i=parseFloat(e.width)+r(`left`,`right`),a=parseFloat(e.height)+r(`top`,`bottom`),o={width:Math.abs(i-t.width)<1,height:Math.abs(a-t.height)<1};return{width:o.width?i:t.width,height:o.height?a:t.height,exact:o}}function mN(e,t,n){let r=!!n.translate&&n.translate!==`none`,i=!!n.rotate&&n.rotate!==`none`,a=!!n.scale&&n.scale!==`none`,o=!!n.transform&&n.transform!==`none`;if(!r&&!i&&!a&&!o)return{x:e.x,y:e.y,scale:{x:kN(e.width,t.width,t.exact?.width),y:kN(e.height,t.height,t.exact?.height)}};let[s=0,c=0]=n.transformOrigin.split(` `).map(e=>parseFloat(e)||0),l=(e,t)=>e?e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)||0:0,u=r?n.translate.split(` `):[],d=l(u[0],t.width),f=l(u[1],t.height),p=i?n.rotate.split(` `):[],[m,h,g]={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[p[0]]??(p.length===4?p.slice(0,3).map(parseFloat):[0,0,1]),_=Math.hypot(m,h,g)||1,[v,y,b]=[m/_,h/_,g/_],x=p.length?ON(p[p.length-1]):0,[S,C]=[Math.cos(x),Math.sin(x)],w=[S+(1-S)*v*v,(1-S)*v*y-C*b,(1-S)*v*y+C*b,S+(1-S)*y*y],[T=1,E=T]=a?n.scale.split(` `).map(parseFloat):[],D=o?/^matrix(3d)?\((.*)\)$/.exec(n.transform):null,O=D?.[2].split(`,`).map(parseFloat)??[],[k,A,ee,j,M,N,te,P,F]=D?D[1]?[O[0],O[1],O[4],O[5],O[12],O[13],O[3],O[7],O[15]]:[...O,0,0,1]:[1,0,0,1,0,0,0,0,1],I=(e,t)=>{let[n,r]=[e-s,t-c],i=te*n+P*r+F||1,a=T*(k*n+ee*r+M)/i,o=E*(A*n+j*r+N)/i;return[s+d+w[0]*a+w[1]*o,c+f+w[2]*a+w[3]*o]},ne=[I(0,0),I(t.width,0),I(0,t.height),I(t.width,t.height)],re=ne.map(([e])=>e),L=ne.map(([,e])=>e),ie=Math.min(...re),ae=Math.min(...L),R={x:kN(e.width,Math.max(...re)-ie,t.exact?.width),y:kN(e.height,Math.max(...L)-ae,t.exact?.height)};return{x:e.x-R.x*ie,y:e.y-R.y*ae,scale:R}}function hN(e,t,n,r,i){let a=r===`top`||r===`bottom`,o=a?n.width:n.height,s=(a?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-o/2,c=(a?t.width:t.height)-o-i,l=Math.max(i,Math.min(s,c));return{offset:Math.round(l),clamped:Math.abs(l-s)>.5}}function gN(e,t,n,r){let i=n===`top`||n===`bottom`,a=i?e.x+e.width/2-t.x:e.y+e.height/2-t.y,o=i?t.width:t.height;return Math.round(Math.min(Math.max(a,r),Math.max(r,o-r)))}function _N(e,t,n,r,i,a){if(e===`top`||e===`bottom`){let o=n?r.right-a.x:r.left-a.x,s=n?r.left-a.x:r.right-a.x;return[t===`center`?r.left+r.width/2-a.x:t===`start`?o:s,e===`bottom`?0:i.height]}let o=t===`center`?r.top+r.height/2-a.y:t===`start`?r.top-a.y:r.bottom-a.y;return[e===`right`?0:i.width,o]}var vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN=t((()=>{WM(),nN(),PM(),JA(),vN=e=>e===`top`||e===`bottom`,yN=(e,t,n=!1)=>n&&vN(e)&&t!==`center`?t===`start`?`end`:`start`:t,bN=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n)),xN=3,SN=500,CN=[`--available-height`,`--available-width`],wN=!1,TN=[`position-anchor`,`position-try-fallbacks`,`position-visibility`],EN=e=>typeof e.arrow==`function`?e.arrow():e.arrow,DN=e=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join(),ON=e=>{let t=parseFloat(e)||0;return e.endsWith(`turn`)?t*2*Math.PI:e.endsWith(`grad`)?t*Math.PI/200:e.endsWith(`rad`)?t:t*Math.PI/180},kN=(e,t,n=!1)=>t>.01&&Math.abs(e-t)>=(n?.05:1)?e/t:1}));function jN(e){return e.getAttribute(`role`)?.trim().split(/\s+/)[0]||(zN.find(([t])=>e.matches(t))?.[1]??``)}function MN(e){if(e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?.display===`none`||t?.visibility===`hidden`}function NN(e,t){return e.getRootNode().getElementById?.(t)??null}function PN(e){return(e.getAttribute(`aria-labelledby`)??``).split(/\s+/).map(t=>t&&NN(e,t)).filter(e=>!!e).map(e=>e.getAttribute(`aria-label`)??LN(e,!0)).join(` `)}function FN(e){return e.localName===`img`?e.getAttribute(`alt`)??``:e.localName===`svg`?[...e.children].find(e=>e.localName===`title`)?.textContent??``:``}function IN(e,t,n){if(e.matches(`input, select, textarea`))return``;let r=!t&&PN(e)||e.getAttribute(`aria-label`)?.trim()||FN(e);if(r)return` ${r} `;if(e.localName===`svg`)return``;let i=LN(e,t,n),a=e.getAttribute(`title`);return i||(a?` ${a} `:``)}function LN(e,t=!1,n=MN(e)){let r=``;for(let i of e.childNodes)if(i.nodeType===Node.TEXT_NODE)r+=i.nodeValue;else if(i.nodeType===Node.ELEMENT_NODE&&(n||!MN(i))){let e=IN(i,t,n);r+=RN(i,e)?` ${e} `:e}return r}function RN(e,t){let n=e.ownerDocument.defaultView?.getComputedStyle(e).display;return!!n&&n!==`inline`&&(!n.startsWith(`inline`)||!!t.trim())}var zN,BN,VN,HN,UN=t((()=>{zN=[[`button`,`button`],[`a[href]`,`link`],[`input[type=checkbox][switch]`,`switch`],[`input[type=checkbox]`,`checkbox`],[`input[type=radio]`,`radio`],[`input[type=range]`,`slider`],[`dialog`,`dialog`],[`h1, h2, h3, h4, h5, h6`,`heading`]],BN=new Set([`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`treeitem`]),VN=e=>[...e.labels??[]].map(e=>LN(e)).join(` `),HN=[PN,e=>e.getAttribute(`aria-label`)??``,VN,FN,e=>BN.has(jN(e))?LN(e):``,e=>e.getAttribute(`title`)??``],[...HN.filter(e=>e!==VN)]}));function WN(e){let t=``;for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3)t+=n.nodeValue;else if(n.nodeType===1){let e=n;if(e.hasAttribute(`hidden`)||e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`)continue;t+=e.firstElementChild?WN(e):e.textContent??``}return t}function GN(e){return e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`?``:e.firstElementChild?WN(e):e.textContent??``}var KN=t((()=>{}));function qN(e,t){if(ZN===`agent`)return ZN;if(XN.has(e))return`programmatic`;if(t){let e=t();return e===`programmatic`&&ZN?ZN:e}return ZN??`programmatic`}function JN(e,t){let n=ZN;ZN=e;try{return t()}finally{ZN=n}}function YN(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var XN,ZN,QN=t((()=>{XN=new Set([`image-load`,`image-error`,`imperative`,`item-removed`,`unmount`,`reset`,`restore`,`timeout`,`resize`,`page-hide`])})),$N,eP,tP,nP=t((()=>{$N=e=>`${e[0].toUpperCase()}${e.slice(1)}`,eP=(e,t)=>`on${$N(e)}${t}`,tP=e=>`default${$N(e)}`}));function rP(e){return uP.add(e),e}function iP(e,t){return Object.is(e,t)?!0:!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length||uP.has(e)||uP.has(t)?!1:e.every((e,n)=>Object.is(e,t[n]))}function aP(e,t){return oP(e,t,void 0)}function oP(e,t,n){if(Object.is(e,t))return!0;let r=Array.isArray(e)&&Array.isArray(t);if(!r&&!(dP(e)&&dP(t)))return!1;if(n){for(let r=0;r<n.length;r+=2)if(n[r]===e&&n[r+1]===t)return!0}let i=n??[];i.push(e,t);try{if(r){let n=e,r=t;if(n.length!==r.length||uP.has(n)||uP.has(r))return!1;for(let e=0;e<n.length;e++)if(!oP(n[e],r[e],i))return!1;return!0}let n=e,a=t,o=Object.keys(n);if(o.length!==Object.keys(a).length)return!1;for(let e of o)if(!(e in a)||!oP(n[e],a[e],i))return!1;return!0}finally{i.length-=2}}function sP(e,t){let n=e,r,i,a=!1,o,s=new Set,c=new Map,l,u={state:e,renders:0,writes:0,touch:()=>p([],n,!1,!1),skipping:c},d={get(){return o??f()},set(e,i=!1){if(r&&!i&&!a){let t=f();if(t!==n){let n={...t};for(let t in e)delete n[t];d.set(n,!0)}}let o;for(let t in e)iP(n[t],e[t])||(o??=[]).push(t);if(!o)return;let s=n;n={...n,...e},u.state=n;let c=t.length>0;if(c){for(let e=0;e<o.length;e++)if(!t.includes(o[e])){c=!1;break}}p(o,s,c,i)},subscribe(e){return s.add(e),()=>{s.delete(e)}},setFanout(e){l=e},follow(e){r=e},view(e,t){let n=o;o=e;try{return t()}finally{o=n}}};function f(){if(!r||a)return n;a=!0;let e;try{e=r(n)}finally{a=!1}if(!e)return n;if(i?.state===n&&i.over===e)return i.result;let t=n;for(let r in e)if(!iP(n[r],e[r])){t={...n,...e};break}return i={state:n,over:e,result:t},t}function p(e,t,n,r){n||u.renders++,r||u.writes++;for(let t of s)t(n,r,e);for(let[t,i]of c){let a=!e.length;if(!a){for(let n=0;n<e.length;n++)if(!Object.hasOwn(t,e[n])){a=!0;break}}if(a)for(let t of i)t(n,r,e)}l?.(e,t,n,r)}return fP.set(d,u),d}function cP(e,t,n){return lP(fP.get(e).skipping,t,n)}function lP(e,t,n){let r=e.get(t);return r||e.set(t,r=new Set),r.add(n),()=>{r.delete(n),!r.size&&e.get(t)===r&&e.delete(t)}}var uP,dP,fP,pP,mP,hP,gP,_P=t((()=>{uP=new WeakSet,dP=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},fP=new WeakMap,pP=e=>fP.get(e).state,mP=e=>fP.get(e).renders,hP=(e,t)=>{fP.set(e,fP.get(t))},gP=e=>fP.get(e).touch()}));function vP(e,t,n,r){Lk(()=>{let i,a,o;if(yP.add)i=yP.add(e,t,n,r);else if(typeof document<`u`&&(bP.add(a=new WeakRef(e)),o={parts:t,definition:n,options:r},xP.set(e,o),bP.size%1e3==0))for(let e of bP)e.deref()||bP.delete(e);return()=>{(i??o?.unwatch)?.(),i=void 0,o&&(o.unwatch=void 0),a&&=(bP.delete(a),void 0)}})}var yP,bP,xP,SP=t((()=>{Kk(),yP={},bP=new Set,xP=new WeakMap}));function CP(e,t){let{store:n,options:r}=e,i=new Map,a=new Map,o=new Map;return e.onOptions((e,t)=>{if(!t)return;let n;for(let[e,r]of i)e in t&&(iP(t[e],r.value)&&(n=r.source),i.delete(e));return n}),(s,c,l)=>{if(o.has(s)&&iP(o.get(s),c))return!1;let u=(a.get(s)??0)+1;a.set(s,u);let d=n.get()[s];if(iP(d,c))return!1;let{reason:f,event:p}=l,m=YN(l,l.source??t(f,p));m.source;let h=r(),g=h[s]!==void 0,_=o.has(s),v=o.get(s);o.set(s,c);try{JN(m.source,()=>{let e=eP(s,`Change`),t=h[e];typeof t==`function`&&t(c,m);let r=a.get(s)!==u;m.canceled||g||r||n.set({[s]:c})})}finally{_?o.set(s,v):o.delete(s)}return!m.canceled&&(yP.change?.(e.id,s,c,m,d),g&&i.set(s,{value:c,source:m.source}),!0)}}var wP=t((()=>{PO(),QN(),nP(),_P(),SP()}));function TP(){return HO(),DP}function EP(e,t=TP()){return CP(e,t)}var DP,OP=t((()=>{sk(),wP(),QN(),DP=(e,t)=>qN(e,t&&(()=>GO(t)))}));function kP(e,t){return mj([...e.parts()].filter(e=>e.slot===t&&!!e.el?.isConnected)).map(({el:e,key:t,props:n})=>({el:e,key:t,props:n}))}var AP=t((()=>{bj()})),jP,MP,NP=t((()=>{jP=new WeakSet,MP=e=>(jP.add(e),e)}));function PP(e,t){return MP(Promise.resolve({reason:e,source:DP(e,t)}))}function FP(e){let{popup:t,store:n,rules:r={}}=e,i=`imperative`,a,o,s;t.observe(e=>{let t=e?void 0:o??{reason:i,source:`programmatic`};if(o=void 0,t)return a?.resolve(t),a=void 0,t}),e.onDestroy(()=>{a?.resolve({reason:`unmount`,source:`programmatic`}),a=void 0});function c(e){if(!a){let e;a={promise:MP(new Promise(t=>e=t)),resolve:e}}if(e&&!e.aborted){let n=()=>t.requestClose(`imperative`);e.addEventListener(`abort`,n,{once:!0}),a.promise.then(()=>e.removeEventListener(`abort`,n))}return a.promise}let l,u=(t,n)=>{let r=l;l=t;try{return e.change(t,n)}finally{l=r}};function d(e={},t){return f(e,t).result}function f(a,o){let{event:l,signal:d}=a;if(d?.aborted)return{opened:!1,result:PP(i)};let f=a.reason??(l?`trigger-press`:i),p=o??f,m={...a,reason:p,payloadReason:f},h=!1,g=(n=a.by??`imperative`)=>{s=a.anchor;let r=e.payload?.opening(a.trigger,a.payload,{reason:f,event:l});return t.opening(n,l),h=u(!0,{reason:p,event:l}),h||r?.(),h};return n.get().open?(t.opener()===`hover`&&a.by!==`hover`&&t.opening(a.by??`imperative`,l),a.trigger===void 0&&e.payload?.reopening(a,{reason:f})&&a.anchor&&(s=a.anchor),r.reopen?.(m,g),{opened:h,result:c(d)}):(r.open?r.open(m,g):g(),{opened:h,result:h?c(d):PP(p,l)})}function p(a={}){if(!n.get().open)return!1;let{event:s,returnValue:c}=a,l=a.reason??i;if(e.dismissal&&!e.dismissal.allows(l,s))return!1;let d=!1,f=()=>{o={reason:l,source:DP(l,s),returnValue:c},t.returnFocus(a.focus??e.returnFocus??!0);let n=u(!1,{reason:l,event:s,...c!==void 0&&{returnValue:c}});return n||(t.returnFocus(!0),o=void 0),d=n,n};return r.close?r.close({...a,reason:l},f):f(),d}function m({trigger:t,payload:n,anchor:r,reason:i,event:a}){s=r,e.payload?.handOver(t,n,{reason:i,event:a})}let h=(e,t)=>f({reason:i,event:t},e).opened;return{api:{isOpen:()=>n.get().open,setOpen:(e,{reason:t,event:r}={})=>e!==(l??n.get().open)&&(e?h(t,r):p({reason:t,event:r})),open:(e={})=>d({...e,reason:e.reason??i}),close:({reason:e,event:t,returnValue:n}={})=>p({reason:e,event:t,returnValue:n}),toggle:({reason:e,event:t}={})=>n.get().open?p({reason:e,event:t}):h(e,t)},show:d,attempt:f,hide:p,takeOver:m,result:c,anchor:()=>s}}var IP=t((()=>{NP(),OP()}));function LP(e,t){let n=e,{store:r,element:i,options:a}=n,{preset:o}=t,s=t.slot??`content`,c=t.trigger??`trigger`,l=EP(n),u=e=>e!==void 0&&n.props(s,e)||kP(n,s)[0]?.props||n.props(s)||{},d=()=>{if(v?.trigger)return v.trigger();let e=r.get().trigger;return e!==null&&i(c,e)||i(c)},f=null,p,m=()=>{let e=r.get().trigger;if(v?.trigger||e===null||e===f)return d();let t=p??kP(n,c).length<=1;return i(c,e)??(t?i(c):void 0)},h=r.get().open;r.subscribe(()=>{let{open:e,trigger:t}=r.get();e!==h&&(h=e,e&&(f=t!==null&&!i(c,t)?t:null,p=kP(n,c).length<=1))});function g(e){for(let t of n.parts())if(t.slot===c&&t.key!==e&&t.el?.isConnected)return t.key}let _={label:n.label,role:t.role??o.role,store:r,options:a,onOptions:n.onOptions,onDestroy:n.onDestroy,element:i,parts:n.parts,preset:o,get popup(){return k},get control(){return A},triggerElement:d,triggerSlot:c,nextTrigger:g,firstTrigger(){for(let e of n.parts())if(e.slot===c)return g()??e.key},triggerDisabled:e=>!!n.props(c,e)?.disabled,contentProps:u},v=_.rules=t.rules?.(_),y=o.dismissal?.(a,v),b=o.presentation?.(_,y),x=o.press?.(_),S=o.group?.(_),C=o.hover?.(_,S),w=o.focus?.(_),T=o.triggerName?.(_);o.resetStyles?.prepare(n.label,s),o.placement?.prepare();function E(e,t){if(o.modal!==void 0)return{modal:e.modal??(t.presentation===`sheet`||o.modal)}}function D(){let e=E(a(),r.get());e&&r.set(e)}function O(e,t){v?.dismiss?v.dismiss(e,t):A.hide({reason:e,...t})}let k=bM({...t.behavior,preset:o.behavior,position:o.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:d,returnTrigger:m,contains:(e,t)=>v?.contains?v.contains(e,t):!!d()?.contains(e)||!!x?.contains(e,t),close:O,modal:()=>v?.modal?.()??rM(r.get().modal),parent:()=>v?.parent?.(),persistent:()=>v?.persistent?.()??[],finalFocus:()=>u().finalFocus,takesEscape:v?.takesEscape,onEscape:e=>v?.onEscape?v.onEscape(e):O(`escape-key`,{event:e,focus:!0}),onShow:e=>v?.onShow?.(e),onOpenChange(e,t){v?.onOpenChange?.(e,t),S?.change(e),e?(b?.open(),D()):(C?.clear(),w?.clear())},onOpenChangeComplete(e,t){v?.onOpenChangeComplete?.(e,t),a().onOpenChangeComplete?.(e)}}),A=FP({dismissal:y,popup:k,store:r,payload:o.payload?.(r,(e,t)=>l(`payload`,e,t)),change:(e,t)=>l(`open`,e,{...t,...v?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return v?.returnFocus},rules:{open(e,t){C?.clear(),S?.opening(e.event),v?.open?v.open(e,t):t()},reopen(e){if(C?.clear(),v?.reopen)return v.reopen(e);let{trigger:t,payload:n,payloadReason:i,event:a}=e;t!==void 0&&t!==r.get().trigger&&A.takeOver({trigger:t,payload:n,reason:i,event:a})},close:(e,t)=>v?.close?v.close(e,t):t()}});D(),eA(n,[`modal`],(e,t,n)=>E(n,{...t,...e}));let ee=r.get().modal;r.subscribe(()=>{let{modal:e}=r.get();e!==ee&&(ee=e,k.updateModal())});let j={dismissal:y,presentation:b,press:x,group:S,hover:C,focus:w,triggerName:T,rules:v};return{...A.api,getPayload:()=>r.get().payload,focus:()=>d()?.focus(),internal:Object.assign(_,j)}}function RP(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:`popover`}}var zP=t((()=>{iA(),OP(),AP(),jM(),IP()}));function BP(e){HP.add(e),UP||(UP=!0,queueMicrotask(VP))}function VP(){UP=!1;try{for(let e of HP)HP.delete(e),e()}finally{HP.size&&!UP&&(UP=!0,queueMicrotask(VP))}}var HP,UP,WP=t((()=>{HP=new Set,UP=!1}));function GP(e,t){let n=e;if(n.owner.sleeping)return new EF(n,t);let r=n.view;if(r&&r.props===t&&r.api===e.api)return r;let i={id:e.id,key:e.key,props:t,api:e.api};return t===e.props&&(n.view=i),i}function KP(e){e.dropped&&!e.owner.parts.has(e.mapKey)&&(XP(e),e.dropped=!1),e.leases++;let t=!0;return()=>{if(!t||(t=!1,--e.leases))return;let{owner:n}=e;n.released?n.released.push(e):(n.released=[e],queueMicrotask(()=>JP(n)))}}function qP(e){let{owner:t}=e;t.released?t.released.push(e):(t.released=[e],queueMicrotask(()=>JP(t)))}function JP(e){let t=e.released;if(t){e.released=void 0;for(let n=0;n<t.length;n++){let r=t[n];if(!r.leases&&e.parts.get(r.mapKey)===r){e.parts.delete(r.mapKey);let t=e.keyed.get(r.slot);t===r?e.keyed.delete(r.slot):t instanceof Map&&t.get(r.key)===r&&t.delete(r.key),r.dropped=!0}}}}function YP(e){let{parts:t}=e;if(e.unordered){e.unordered=!1;let n=0,r=!0;for(let e of t.values()){if(e.rank<n){r=!1;break}n=e.rank}if(!r){let e=[...t.values()].sort((e,t)=>e.rank-t.rank);t.clear();for(let n of e)t.set(n.mapKey,n)}}return t}function XP(e){let{owner:t}=e,{parts:n,keyed:r}=t;e.rank=++t.rank,n.set(e.mapKey,e);let i=r.get(e.slot);if(!i)r.set(e.slot,e);else if(i instanceof Map)i.set(e.key,e);else if(i.key===e.key)r.set(e.slot,e);else{let t=new Map;t.set(i.key,i),t.set(e.key,e),r.set(e.slot,t)}}function ZP(e,t=e.props,n=e.store.get()){let r=CF(e),i=r.slots[e.slot],a=i.role,o=i.attrs||typeof a==`function`?GP(e,t):void 0,s=i.attrs?.(n,o),c=typeof a==`function`?a(n,o):a;if(s){let e=FF.get(i);e===void 0?FF.set(i,(`hidden`in s?NF:0)|(`id`in s?PF:0)):!(e&PF)&&`id`in s&&FF.set(i,e|PF)}let l=t.id;e.made=l===void 0||s?.id!==l?s?.id??null:void 0;let u=r.slotNames[e.slot]??(r.slotNames[e.slot]=e.slot===`root`?r.name:`${r.name}-${e.slot}`),d=a===void 0?{"data-slot":u,...s}:{"data-slot":u,role:c,...s};return a!==void 0&&(d.role=c),uF(e,d)}function QP(e,t){let n;for(let r in e)e[r]!==void 0&&kF.has(r)&&t(r)&&((n??={...e})[r]=void 0);return n??e}function $P(e,t=e.props,n=e.store.get()){let r=wF(e).state;return r?r(n,GP(e,t)):bF}function eF(e,t=e.props,n=e.store.get()){let r=wF(e).present;return!r||r(n,GP(e,t))}function tF(e,t,n=e.props){let r=wF(e).selects,i=KP(e),a=r?r.subscribe(e,t,n):cP(e.store,MF,t);return()=>{i(),a()}}function nF(e){let t=e,n=wF(e);if(t.handlersFor===n&&t.handlers)return t.handlers;let{on:r,press:i}=n;if(!r&&typeof i!=`function`)return t.handlersFor=n,t.handlers=xF;let a={};for(let t in r){let n=r[t];a[t]=t=>{t.defaultPrevented||yF(t)||n(t,OF(e))}}return typeof i==`function`&&!a.click&&(a.click=n=>{n.defaultPrevented||(t.owner.sleeping?.wake(),i(OF(e),n))}),t.handlersFor=n,t.handlers=a}function rF(e){e.propsListeners?.forEach(e=>e())}function iF(e){return CF(e).sleeping?.wake(),e.api}function aF(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}function oF(e){let t=IF.get(e);return t||(t=new Set(e),IF.set(e,t)),t}function sF(e){let t=wF(e),n=FF.get(t);if(n===void 0){let r=t.attrs?.(e.store.get(),GP(e,e.props));n=r?(`hidden`in r?NF:0)|(`id`in r?PF:0):0,FF.set(t,n)}return n}function cF(e,t,n={by:`core`}){let r=e,{owner:i}=r,a=e.el?r:i.parts.get(r.mapKey);a?!e.el&&a===r&&r.rank!==i.rank&&(r.rank=++i.rank,i.unordered=!0):XP(r);let o=wF(e),s={};e.el=t,r.binding=s;let c=[KP(r)],l=sF(e);if(l&NF&&zA(t.ownerDocument),(n.by===`core`||n.attaches!==`all`)&&(o.on||typeof o.press==`function`)){let r=n.by===`framework`&&n.attaches!==`all`?oF(n.attaches):void 0,i=n.by===`core`;if(r){for(let e in o.on)if(!r.has(e)){i=!0;break}!i&&typeof o.press==`function`&&!r.has(`click`)&&(i=!0)}if(i){let n=nF(e);for(let e in n)r&&r.has(e)||c.push(aA(t,e,n[e]))}}o.live&&c.push(o.live.attach(e,t)),n.by===`framework`&&o.direct&&c.push(o.direct.attach(e,t));let u=o.asleep?.(t,e);u&&c.push(u);let{sleeping:d}=i;if(d&&o.bind){let n=()=>{let n=o.bind?.(t,e);n&&c.push(n)};d.binds.add(n),c.push(()=>d.binds.delete(n))}else if(o.bind){let n=o.bind(t,e);n&&c.push(n)}return l&PF&&typeof MutationObserver<`u`&&c.push(fF(r,t)),()=>{for(let e=0;e<c.length;e++)c[e]();r.binding===s&&(e.el=r.binding=void 0,r.own!==void 0&&mF(r))}}function lF(e,t){let n=e;if(n.ref)return n.ref;let r=null,i=()=>{};return n.ref=n=>{n!==r&&(i(),r=n,i=n?cF(e,n,t):()=>{})}}function uF(e,t){let{owner:n}=e;if(!n.named?.size||!LF.some(e=>t[e]))return t;let r=dF(n,e.store);if(!r.size)return t;let i={...t};for(let e of LF){let t=i[e];t&&(i[e]=t.split(` `).map(e=>r.get(e)??e).join(` `))}return i}function dF(e,t){let n=mP(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let t of e.named){let e=RF(t);e!==void 0&&e!==t.own&&r.set(e,t.own)}return e.aliases={version:n,map:r},r}function fF(e,t){let n=gF(t);(e.own!==void 0||n&&n!==e.made)&&mF(e);let r=BF.get(t);r?r instanceof Set?r.add(e):r!==e&&BF.set(t,new Set([r,e])):(BF.set(t,e),pF().observe(t,zF)),HF++;let i=!0;return()=>{if(!i)return;i=!1;let n=BF.get(t);n===e?BF.delete(t):n instanceof Set&&(n.delete(e),n.size||BF.delete(t)),!--HF&&VF&&(VF.disconnect(),VF=void 0)}}function pF(){return VF||=new MutationObserver(e=>{for(let{target:t}of e){let e=BF.get(t);if(e instanceof Set)for(let t of e)mF(t);else e&&mF(e)}}),VF}function mF(e){let{owner:t}=e;t.unread||(t.unread=new Set,BP(()=>hF(t,e.store))),t.unread.add(e)}function hF(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let e of n)r=vF(e,e.el&&gF(e.el))||r;r&&gP(t)}function gF(e){let t=e.id;return t&&typeof t==`object`?e.getAttribute(`id`):t}function _F(e,t){!e.el&&typeof t==`string`&&wF(e).attrs&&vF(e,t)&&(CF(e).renamed=!0)}function vF(e,t){let n=RF(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:i}=e;return e.own=r,i.named??=new Set,r===void 0?i.named.delete(e):i.named.add(e),i.aliases=void 0,n!==void 0}function yF(e){return(e.type===`keydown`||e.type===`keyup`)&&(typeof e.key!=`string`||oA(e))}var bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF=t((()=>{WP(),PO(),JA(),sA(),_P(),bF=Object.freeze({}),Object.freeze({}),xF=Object.freeze({}),SF=Symbol(),CF=e=>e.owner,wF=e=>CF(e).slots[e.slot],TF=class{slot;key;mapKey;id;store;props;el=void 0;owner;leases=0;constructor(e,t,n,r,i,a,o){this.slot=e,this.key=t,this.mapKey=n,this.id=r,this.store=i,this.props=a,this.owner=o}get api(){return this.owner.api}},EF=class{id;key;props;[SF];constructor(e,t){this.id=e.id,this.key=e.key,this.props=t,this[SF]=e}get api(){return iF(this[SF])}},DF=class{el;id;key;props;store;#e;constructor(e,t){this.el=e.el,this.id=e.id,this.key=e.key,this.props=t,this.store=e.store,this.#e=e}get api(){return iF(this.#e)}},OF=(e,t=e.props)=>CF(e).sleeping?new DF(e,t):{el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api},kF=new Set([`aria-label`,`aria-labelledby`,`aria-description`,`title`,`autocomplete`,`autocapitalize`,`autocorrect`,`spellcheck`,`inputmode`,`enterkeyhint`]),AF=e=>wF(e).direct?.names,jF=(e,t=e.props)=>wF(e).selects?.selection(e,t)??``,MF={},NF=1,PF=2,FF=new WeakMap,IF=new WeakMap,LF=[`aria-activedescendant`,`aria-controls`,`aria-describedby`,`aria-details`,`aria-errormessage`,`aria-flowto`,`aria-labelledby`,`aria-owns`,`for`,`headers`],RF=e=>wF(e).attrs?.(e.store.get(),GP(e,{...e.props,id:void 0})).id,zF={attributeFilter:[`id`]},BF=new WeakMap,HF=0}));function WF(e,t,n=4){let r=KF([e,t].flatMap(e=>[{x:e.left-n,y:e.top-n},{x:e.right+n,y:e.top-n},{x:e.right+n,y:e.bottom+n},{x:e.left-n,y:e.bottom+n}]));return(e,t)=>{for(let n=0;n<r.length;n++){let i=r[n],a=r[(n+1)%r.length];if((a.x-i.x)*(t-i.y)-(a.y-i.y)*(e-i.x)<0)return!1}return!0}}function GF(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function KF(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=e=>{let t=[];for(let n of e){for(;t.length>=2&&GF(t[t.length-2],t[t.length-1],n)<=0;)t.pop();t.push(n)}return t.pop(),t};return[...n(t),...n(t.reverse())]}var qF=t((()=>{}));function JF(e){let t,n,r;function i(){r?.(),r=void 0}function a(){clearTimeout(t),clearTimeout(n),i()}function o(t){i(),clearTimeout(n),n=setTimeout(()=>e.close(t),e.closeDelay())}return{clear:a,enter(e,r,a=0){e.pointerType!==`touch`&&(clearTimeout(n),i(),r&&(clearTimeout(t),a>0?t=setTimeout(r,a):r()))},leave(n){if(n.pointerType===`touch`||(clearTimeout(t),!e.closesOnLeave()))return;let a=e.trigger(),s=e.popup();if(!a||!s)return o(n);let c=WF(a.getBoundingClientRect(),s.getBoundingClientRect());if(!c(n.clientX,n.clientY))return o(n);i(),r=aA(s.ownerDocument,`pointermove`,e=>{c(e.clientX,e.clientY)||o(e)})}}}var YF=t((()=>{sA(),qF()}));function XF(e,t,n){if(typeof t!=`string`)return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function ZF(e,t,n){return{side:e.side??t.side??`bottom`,align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}function QF(e,t,n){for(let r of aI){let i=r.popup.element();!r.store.get().open||r.popup.opener()!==`hover`?aI.delete(r):r!==e&&!i?.contains(t??null)&&!i?.contains(document.activeElement)&&r.control.hide({reason:`trigger-hover`,event:n,focus:!1})}}function $F(e,t){let{store:n,options:r,preset:i}=e;e.onDestroy(()=>aI.delete(e));let a=JF({trigger:e.triggerElement,popup:()=>e.popup.element(),closesOnLeave:()=>n.get().open&&e.popup.opener()===`hover`,closeDelay:()=>r().closeDelay??i.closeDelay??0,close(t){e.popup.element()?.contains(document.activeElement)||e.control.hide({reason:`trigger-hover`,event:t,focus:!1})}});e.onDestroy(a.clear);let o=()=>(!i.press||!!r().openOnHover)&&!r().disabled,s=e=>o()&&a.leave(e);return{clear:a.clear,enter(s,c,l){if(!o())return;if(c===void 0)return a.enter(s);let u=()=>{o()&&!e.triggerDisabled(c)&&(t||(QF(e,e.element(e.triggerSlot,c),s),aI.add(e)),e.control.show({by:`hover`,event:s,reason:`trigger-hover`,trigger:c,payload:l}))};if(n.get().open){a.enter(s),n.get().trigger!==c&&u();return}let d=r().delay??i.delay??300;a.enter(s,u,t?t.delay(d):d)},leave:s,leaveContent(t){let n=t.relatedTarget;n&&e.triggerElement()?.contains(n)||s(t)}}}function eI(e){let{store:t,options:n,preset:r}=e,i,a=()=>clearTimeout(i);return e.onDestroy(a),{clear:a,enter(o,s,c){if(n().disabled||!KO())return;let l=()=>{!n().disabled&&!e.triggerDisabled(o)&&e.element(e.triggerSlot,o)?.contains(document.activeElement)&&e.control.show({by:`keyboard`,event:c,reason:`trigger-focus`,trigger:o,payload:s})},u=r.focusDelay??n().delay??r.delay??0;a(),t.get().open?l():u>0?i=setTimeout(l,u):l()},leave(n){if(a(),!t.get().open||e.popup.opener()===`hover`)return;let r=n.relatedTarget;r&&(e.popup.element()?.contains(r)||[...e.parts()].some(t=>t.slot===e.triggerSlot&&t.el?.contains(r)&&!e.triggerDisabled(t.key)))||e.control.hide({reason:`focus-out`,event:n,focus:!1})},keydown(t){let n=e.popup.element();return t.key===`Tab`&&!(n&&Nj(n).length)},triggerAttrs(e,t,n,r,i){let a=e.trigger===null||e.trigger===n;return{...Mk(e.open&&a),"aria-describedby":i===`tooltip`&&a?`${t}-content`:void 0,"data-disabled":r.disabled?``:void 0}}}}function tI(e){return e?e.type.startsWith(`focus`)?`focus-out`:e.type.startsWith(`pointer`)?`trigger-hover`:`outside-press`:`imperative`}function nI(e){let t=t=>e.control.hide({reason:tI(t),event:t});function n(e){sI.close!==t&&sI.close?.(e)}let r=!1;return e.onDestroy(()=>{sI.close===t&&(sI.close=void 0)}),{delay:e=>cI()?0:e,opening:n,change(e){e?(r=cI(),n(),sI.close=t):sI.close===t&&(sI.close=void 0,sI.closedAt=performance.now())},instant:()=>r,join(){e.store.get().open&&!sI.close&&(sI.close=t)}}}function rI(e,t){let n=`${e}-${t}`,r=lI.get(n);return r||(r=[`[data-slot="${n}"]`,`[data-slot="${e}-backdrop"]`],lI.set(n,r)),r}var iI,aI,oI,sI,cI,lI,uI,dI=t((()=>{Kk(),sk(),Nk(),AN(),Rj(),YF(),jM(),iI={position:fN,prepare:()=>Lk(lN),anchor:XF,options:ZF},aI=new Set,oI=400,sI={close:void 0,closedAt:-1/0},cI=()=>!!sI.close||performance.now()-sI.closedAt<oI,lI=new Map,uI={prepare(e,t){let n=rI(e,t);Lk(()=>_M(n))},prepareClient(e,t){_M(rI(e,t))},bind(e){gM(e.ownerDocument,[`[data-slot="${e.getAttribute(`data-slot`)}"]`])}}}));function fI(e,t){return{opening(n,r,i){let a={trigger:e.get().trigger,payload:e.get().payload};return n!==void 0&&e.set({trigger:n}),t(r,i),()=>e.set(a)},handOver(n,r,i){e.set({trigger:n}),t(r,i)},reopening(e,n){return`payload`in e&&t(e.payload,n)}}}var pI=t((()=>{})),mI,hI=t((()=>{dI(),pI(),mI={payload:fI,behavior:`tooltip`,role:`tooltip`,side:`top`,delay:600,closeDelay:0,focusDelay:0,placement:iI,hover:$F,focus:eI,group:nI,resetStyles:uI}}));function gI(e,t){let n=vI.get(e);if(n){n.push(t);return}let r=[t];vI.set(e,r),BP(()=>{vI.delete(e);let t={};for(let e of r)e(t);e.set(t)})}function _I(e,t){gI(e,n=>{n[t]===void 0&&e.get()[t]===null&&(n[t]=!1)})}var vI,yI=t((()=>{WP(),vI=new WeakMap}));function bI(e,t,n,r,i){e.press?.keydown(t,n,r,i)||e.focus?.keydown(t)||e.popup.triggerKeydown(t)}function xI(e,t,n){Dj(n,t)&&e.popup.keydown(t)}function SI(e,t,n,r){let{preset:i,control:a,contentProps:o,triggerElement:s,element:c,popup:l,press:u,rules:d,presentation:f}=t,{placement:p}=i;i.resetStyles?.bind(e);let m=!!o(n).inline;return(f??l).bind(e,{inline:m,anchor:()=>a.anchor()??p?.anchor(e,o().anchor,s),position:p&&!m?()=>p.options(o(n),{side:i.side,align:`center`},c(`arrow`)):void 0,rendered:r&&(e=>aF(r,e)),initialFocus:u&&(()=>u.initialFocus(l.element(),o().initialFocus,d?.preferredFocus)),chosenFocus:u&&(()=>(o().initialFocus??`auto`)!==`auto`),backdrop:()=>c(`backdrop`),...d?.bind?.()})}function CI(e,t,n){return e.get().trigger===null&&e.set({trigger:t}),()=>{e.get().trigger===t&&!e.get().open&&e.set({trigger:n?.(t)??null})}}function wI(e){return e({props:{id:`id`,disabled:`boolean`,focusableWhenDisabled:`boolean`,payload:`value`},state:(e,{key:t,props:n})=>({open:e.open&&(e.trigger===null||e.trigger===t),disabled:!!n.disabled}),attrs:(e,{id:t,key:n,props:r,api:i})=>{let{press:a,focus:o,role:s}=i.internal;return(a??o)?.triggerAttrs(e,t,n,r,s)??{}},on:{pointerenter:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.hover?.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.hover?.leave(e),focusin:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.focus?.enter(n,r.payload,e),focusout:(e,{api:t})=>t.internal.focus?.leave(e),keydown:(e,{api:t,el:n,key:r,props:i})=>n&&bI(t.internal,e,n,r,i)},press:({api:e,key:t,props:n},r)=>e.internal.press?.press(t,n,r),bind(e,{api:t,key:n,id:r,store:i}){let a=CI(i,n,t.internal.nextTrigger);return i.get().trigger===n&&!e.hasAttribute(`id`)&&(e.id=`${r}-trigger`),a}})}function TI(e){return e({props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`,initialFocus:`string`,finalFocus:`string`,keepMounted:`boolean`},connect:Ej,role:(e,{api:t})=>t.internal.role,roles:[`dialog`,`alertdialog`,`menu`,`tooltip`],keys:[`Tab`],state:e=>({open:e.open,modal:e.modal,presentation:e.presentation,payload:e.payload}),present:(e,{props:t,api:n})=>e.mounted||!!t.keepMounted||n.internal.role===`tooltip`,attrs:(e,{id:t,api:n})=>{let{role:r,press:i,triggerName:a}=n.internal;return{...lM(e,t),tabindex:r===`tooltip`?void 0:`-1`,...i?.contentAttrs(e,t,r),...a?.contentAttrs(e,t)}},on:{keydown:(e,{api:t,el:n})=>n&&xI(t.internal,e,n),pointerenter:(e,{api:t})=>t.internal.hover?.enter(e),pointerleave:(e,{api:t})=>t.internal.hover?.leaveContent(e)},bind(e,t){_I(t.store,`titled`);let n=()=>{let n=e.hasAttribute(`aria-label`);n!==!!t.store.get().named&&gI(t.store,e=>{e.named=n})};n();let r=new MutationObserver(n);r.observe(e,{attributeFilter:[`aria-label`]});let i=SI(e,t.api.internal,t.key,t);return()=>{r.disconnect(),i?.()}}})}function EI(e){return e({state:e=>({open:e.open}),attrs:e=>({"aria-hidden":`true`,...Mk(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}})}var DI=t((()=>{PO(),FO(),yI(),Nk(),UF(),jM(),kj()}));function OI(e){let t=e.slots(e=>e),n=e.name,r=e.label??n,i={};for(let e in t)i[e]=e===`root`?n:`${n}-${e}`;let a=a=>{let o=a,s=a.id,c=e.state(o),l=e.sync?.(o),u=sP(l?{...c,...l}:c,e.live??AI),d,f,p=t,m;function h(e){m?.has(e)||(m||(m=new Set,g.slots=Object.create(p)),m.add(e),Object.assign(g.slots,e.slots),E(),e.extend?.(C))}let g={name:n,label:r,slots:p,slotNames:i,parts:new Map,keyed:new Map,rank:0},{parts:_}=g;function v(e={}){return e.id??(e.value==null?``:String(e.value))}let y;function b(e,t={},n=!1){let r=v(t),i=g.keyed.get(e),a=i instanceof Map?i.get(r):i?.key===r?i:void 0;if(!a){let i=`${e}:${r}`;a=g.sleeping?new TF(e,r,i,s,u,t,g):{slot:e,key:r,mapKey:i,id:s,api:C,store:u,props:t,el:void 0,owner:g,leases:0},XP(a),n&&qP(a)}else if(n)return a;return a.props=t,rF(a),a}function x(e,t){if(t===void 0){for(let t of YP(g).values())if(t.slot===e&&t.el?.isConnected)return t.el;return}let n=_.get(`${e}:${t}`)?.el;return n?.isConnected?n:void 0}let S={id:s,label:r,store:u,options:()=>o,onOptions:e=>{(f??=[]).push(e)},onDestroy:e=>{(d??=[]).push(e)},parts:()=>YP(g).values(),element:x,props:(e,t=``)=>{let n=y?.[e];return n&&v(n)===t?n:_.get(`${e}:${t}`)?.props}},C;function w(){C=e.api(S),g.api=C,Yk(S,C)}let T=!1;function E(){let{sleeping:e}=g;if(e&&!T){T=!0,Rk(k,w),g.sleeping=void 0;for(let t of[...e.binds])t()}}e.asleep?.(o)?g.sleeping={wake:E,binds:new Set}:w();let D=!1,O=(t,n)=>tA(u,t,e.sync?.(t),n),k={types:void 0,name:n,id:s,get:u.get,subscribe:u.subscribe,get api(){return E(),C},part:b,use:h,preview(e){let t=O({...e,id:s},u.get()),n=u.get();for(let e in t)if(!iP(n[e],t[e]))return{...n,...t}},get derives(){return rA(u)},view(e,t,n){let r=y;y=n;try{return u.view(e,t)}finally{y=r}},setOptions(t){let n=pP(u);o=t.id===s?t:{...t,id:s},g.sleeping&&!e.asleep(o)&&E();let r=O(o,n),i;try{if(f)for(let e of f)i=e(o,r)??i;let e=pP(u)===n?r:O(o,pP(u));e&&JN(i,()=>u.set(e,!0))}finally{}},startState:t=>e.state({...t,id:s}),follow(e){let t,n,r=(r=pP(u),i)=>{if(i)return O({...i,id:s},r);if(D)return n;let a=e();return(t?.options!==a||t.state!==r)&&(t={options:a,state:r},n=O({...a,id:s},r)),n};return u.follow(r),r},destroy(){D||(D=!0,Vk(k),d&&Pk(()=>{for(let e=0;e<d.length;e++)d[e]()}))}};return hP(k,u),vP(k,_,e,S.options),k},o=e=>Fk(()=>a(e));return Object.defineProperty(o,"name",{value:n}),Object.assign(o,{options:e.options,slots:t})}function kI(e){let t=jI.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:`boolean`,...n},slots:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.props??{}]))},jI.set(e,t)}return t}var AI,jI,MI,NI=t((()=>{PO(),Qk(),iA(),QN(),Kk(),UF(),_P(),SP(),AI=[],jI=new WeakMap,MI=e=>mP(e)}));function PI(e,t){return e?Tk(e,t):``}function FI(e){queueMicrotask(()=>e.get().apple!==Sk()&&e.set({apple:Sk()}))}function II(e,t){return e({props:{shortcut:`string`},state:(e,n)=>({text:PI(n.props.shortcut??t(e),e.apple)}),attrs:()=>({"aria-hidden":`true`,translate:`no`}),asleep(e,n){let{store:r,props:i}=n;if(FI(r),e.childNodes.length)return;let a=()=>{let a=r.get();e.textContent=PI(i.shortcut??t(a,e,n),a.apple)};a();let o=r.subscribe(a);return()=>{o(),e.textContent=``}}})}var LI=t((()=>{jk()}));function RI(e,t){let n=e.getAttribute(`aria-labelledby`);return!!e.getAttribute(`aria-label`)?.trim()||!!n&&n!==t||!!e.getAttribute(`title`)?.trim()||!!GN(e).trim()||!!e.querySelector(`img[alt]:not([alt=''])`)}function zI(e,t){let n=``;for(let r of e.childNodes)if(r.nodeType===Node.TEXT_NODE)n+=r.nodeValue;else if(r.nodeType===Node.ELEMENT_NODE&&!(t&&UI(r))){let e=zI(r,t);n+=e.trim()&&RN(r,e)?` ${e} `:e}return n}function BI(e){let t=null,n=()=>{let n=e.getAttribute(`aria-label`);if(n!==null&&n!==t)return;let r=GI(e),i=r===WI(zI(e,!1))?null:r;i!==t&&(t=i,i===null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,i))};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,characterData:!0,attributeFilter:[`aria-hidden`,`hidden`]}),()=>{r.disconnect(),t!==null&&e.getAttribute(`aria-label`)===t&&e.removeAttribute(`aria-label`)}}function VI(e){let{store:t,options:n}=e,r=LP(e,{preset:mI}),{control:i,hover:a,group:o}=r.internal,s=!1,c=!1,l=t.get().open;t.subscribe(()=>{let{open:e}=t.get();e!==l&&(l=e,e&&t.set({instant:!!o?.instant()}),e&&c&&queueMicrotask(()=>{let e=r.internal.popup.element();e&&lk(GI(e),{doc:e.ownerDocument})}),c=!1)});function u(e,o,l,u){let d=SM(l);if(n().toggleable){if(t.get().open&&r.internal.popup.opener()!==`hover`)return i.hide({reason:`trigger-press`,event:l});if(n().disabled)return;c=!t.get().open,i.show({event:l,by:d,reason:`trigger-press`,trigger:e,payload:o})}else n().closeOnPress!==!1&&u?.getAttribute(`aria-disabled`)!==`true`&&(a?.clear(),s=!!l&&d!==`keyboard`,i.hide({reason:`trigger-press`,event:l}))}return{...r,internal:Object.assign(r.internal,{tooltipPress:u,enter(e,t,n){s||a?.enter(e,t,n)},leave(e){s=!1,a?.leave(e)}})}}var HI,UI,WI,GI,KI,qI=t((()=>{PO(),FO(),sk(),pk(),jk(),jM(),UN(),KN(),zP(),hI(),DI(),NI(),LI(),HI=e=>(e.type??(e.unnamed?`label`:`description`))===`label`,UI=e=>e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`,WI=e=>e.replace(/\s+/g,` `).trim(),GI=e=>WI(zI(e,!0)),KI=OI({name:`tooltip`,options:{container:`value`,open:`boolean`,defaultOpen:`boolean`,onOpenChange:`callback`,onOpenChangeComplete:`callback`,onPayloadChange:`callback`,delay:`number`,closeDelay:`number`,disabled:`boolean`,toggleable:`boolean`,closeOnPress:`boolean`,type:`string`,shortcut:`string`,controller:`value`},state:e=>({...RP(e),instant:!1,unnamed:!1,type:e.type,shortcut:e.shortcut,apple:Ck()}),asleep:e=>e.open===void 0&&!e.defaultOpen&&!e.controller,sync:e=>({...e.open!==void 0&&{open:e.open},type:e.type,shortcut:e.shortcut}),api:VI,slots:e=>{let t=wI(e),n=TI(e);return{trigger:e({...t,props:{id:`id`,payload:`value`},state:(e,{key:t})=>({open:e.open&&(e.trigger===null||e.trigger===t)}),attrs:(e,{id:t,key:n})=>{let r=e.trigger===null||e.trigger===n,i=HI(e);return{type:`button`,"aria-labelledby":i?`${t}-content`:void 0,"aria-describedby":!i&&r?`${t}-content`:void 0,"aria-keyshortcuts":e.shortcut?wk(e.shortcut,e.apple):void 0}},on:{...t.on,pointerenter:(e,{api:t,key:n,props:r})=>t.internal.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.leave(e)},press:({api:e,key:t,props:n,el:r},i)=>e.internal.tooltipPress(t,n.payload,i,r),bind:void 0,asleep(e,{key:t,store:n,id:r}){let i=CI(n,t);HO();let a=!0,o;return queueMicrotask(()=>{let i=n.get(),s={};i.trigger===t&&(s.unnamed=!RI(e,`${r}-content`)),i.apple!==Sk()&&(i.shortcut?s.apple=Sk():a&&(o=n.subscribe(()=>{n.get().shortcut&&(o(),FI(n))}))),(s.unnamed!==void 0||s.apple!==void 0)&&n.set(s)}),e.matches(`:disabled`),()=>{a=!1,o?.(),i()}}}),content:e({...n,props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`},state:e=>({open:e.open,instant:e.instant,payload:e.payload}),role:`tooltip`,present:()=>!0,attrs:(e,{id:t})=>({...lM(e,t),tabindex:void 0,"data-instant":e.instant?``:void 0}),asleep:e=>BI(e),bind(e,t){return t.api.internal.group?.join(),n.bind(e,t)}}),arrow:EI(e),shortcut:II(e,e=>e.shortcut)}},agent:{actions:[`setOpen`]}})})),JI=t((()=>{Y()}));function YI(){if(!(XI||typeof document>`u`)){XI=new WeakMap;for(let e of Array.from(document.querySelectorAll(`input`)))e.value!==e.defaultValue&&XI.set(e,e.value)}}var XI,ZI=t((()=>{}));function QI(e){let t=nL.get(e);if(t)return t;let n=kI(e).options,r=Object.keys(n).filter(e=>tP(e)in n||eP(e,`Change`)in n),i=new Set(r.map(tP));return t={controlled:r,data:Object.keys(n).filter(e=>{let t=n[e],a=typeof t==`object`?t.kind:t;return(a===`value`||a===`list`)&&!r.includes(e)&&!i.has(e)})},nL.set(e,t),t}function $I(e,t){if(typeof e==`object`&&e&&!t.includes(e)){if(t.push(e),Array.isArray(e))for(let n=0;n<e.length;n++)$I(e[n],t);else if(dP(e))for(let n in e)$I(e[n],t);t.pop()}}function eL(e,t){let n=!1;return t(()=>($I(e,[]),n?rP([...e]):(n=!0,e)))}function tL(e,t){let n=QI(e);if(!n.controlled.length&&!n.data.length)return e=>e;let r,i;return e=>{let a=e,o;for(let e of n.controlled){let t=a[e];if(!Array.isArray(t))continue;let n=[...t];r??={};let i=r[e];i&&iP(i,n)||(r[e]=i=n),o??={...a},o[e]=i}for(let e of n.data){let n=a[e];if(!Array.isArray(n)){i&&e in i&&delete i[e];continue}i??={};let r=i[e];r?.list!==n&&(i[e]=r={list:n,handed:eL(n,t)});let s=r.handed();s!==n&&(o??={...a},o[e]=s)}return o??e}}var nL,rL=t((()=>{nP(),NI(),_P(),nL=new WeakMap})),iL=t((()=>{PO(),rL(),UF(),ZI(),Kk(),NI(),_P(),jk()}));function aL(e){for(let t=e;t;t=t.parent)if(t.isDeactivated)return!0;return!1}function oL(){let e=tc(aL(Df()));return Hl(()=>e.value=!0),Vl(()=>e.value=!1),e}function sL(){let e=new Map,t=fs(),n=aL(Df()),r,i=i=>{if(!r){let i=tc(n);r=i;let a=()=>U(i,()=>{n=i.value,e.forEach((e,t)=>t(n?null:e))},{flush:`post`});t?t.run(a):a()}r.value=i};Hl(()=>i(!0)),Vl(()=>i(!1));let a=new WeakMap,o=new WeakMap,s={};return(t,r)=>{let i=Df()??s,c=a.get(i);c||a.set(i,c=new WeakMap);let l=c.get(t);if(l)return l;let u=i.suspense,d=null;return l=i=>{let a=i&&typeof i==`object`&&`$el`in i?i.$el:i;if(!a){let n=d;return d=null,e.get(t)===n?(e.delete(t),t(null)):void 0}let s=o.get(a);s||o.set(a,s=new Map);let c=s.get(r);s.set(r,t),c&&c!==t&&e.get(c)===a&&(e.delete(c),n||c(null)),d=a,e.set(t,a),n||(u?.pendingBranch?u.effects.push(()=>e.get(t)===a&&t(a)):t(a))},c.set(t,l),l}}var cL=t((()=>{Y()}));function lL(e){if(!Df()&&bl())throw Error(`${e} isn't set up in a VDOM component's setup. In a Vapor app, install vaporInteropPlugin, and define your own parts with defineComponent.`)}function uL(e,t){if(!e||!t)return e??t;let n=NL.get(e);n||NL.set(e,n=new WeakMap);let r=n.get(t);return r||(r=n=>{e(n),t(n)},n.set(t,r)),r}function dL(e){let t=PL.get(e);if(t)return t;t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);e!==-1&&(t[n.slice(0,e).trim()]=n.slice(e+1).trim())}return PL.size>=500&&PL.clear(),PL.set(e,t),t}function fL(e){let t=FL.get(e);return t||FL.set(e,t=`on${e[0].toUpperCase()}${e.slice(1)}`),t}function pL(e){let t=nF(e),n=zL.get(e);if(n&&n.source===t)return n.entries;let r=null;for(let e in t){let n=t[e];YL.add(n),(r??=[]).push({prop:fL(e),handler:n})}return zL.set(e,{source:t,entries:r}),r}function mL(e,t,n){let r=QP(t,n?t=>e[t]!=null:IL);for(let t in r){let i=r[t];i===void 0||n&&t===`id`&&e.id!=null||(t===`style`?e.style=n&&e.style?ao([e.style,dL(i)]):dL(i):e[t]=n&&t===`class`&&e.class?so([e.class,i]):i)}return e}function hL(e){let t=VL.get(e);return t||VL.set(e,t=Symbol(e.name)),t}function gL(e){return yl(hL(e),null)}function _L(e){let t=gL(e);if(!t){let t=HL(e.name);throw Error(`${t} parts must be used inside <${t}>.`)}return t.handle}function vL(e){vl(hL(e.primitive),{handle:e,around:{}})}function yL(e,t,n){let r=gL(e);r&&vl(hL(e),{...r,around:{...r.around,[t]:n}})}function bL(e,t){lL(`A ui-sdk root`);let n=`ui-sdk-${Ml()}`,r=tL(e,UL);YI();let i;xl(()=>{let a=r({...t(),id:n});i?i.setOptions(a):(i=Ik(()=>e(a)),i.preview(a)&&i.setOptions(a))}),Ld(()=>zk(i));let a,o,s=()=>{if(!a){let e=tc(MI(i));a=e,o=i.subscribe(()=>e.value=MI(i))}a.value};ps(()=>{o?.(),i.destroy()});let c=sL(),l=xL(i);WL.set(i,l);let u=e=>{let t=Df();if(t)return l(t,e);s()},d=(e,t,n,r)=>{let i={},a=!1;for(let e in n)e!==`ref`&&(i[e]=n[e],a=!0);mL(i,r,a);let o=pL(e);if(o)for(let e=0;e<o.length;e++){let{prop:t,handler:n}=o[e],r=a?i[t]:void 0;if(r){let e=e=>{if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]?.(e);else r(e);n(e)};YL.add(e),i[t]=e}else i[t]=n}return i.ref=uL(n.ref,c(lF(e,LL),t)),i},f={primitive:e,instance:i,get api(){return i.api},get state(){return s(),i.get()},present(e,t){let n=i.part(e,t),r=eF(n),a=u(n);return a&&(a.present=r),r},slot(e,t,n=RL){let r=i.part(e,t);_F(r,n.id);let a=ZP(r),o=u(r);return o&&(o.attrs=a),d(r,e,n,a)}};return BL.set(f,(e,t,n)=>{let r=i.part(e,t),a=eF(r),o=u(r);if(o&&(o.present=a),!a)return null;_F(r,n.id);let s=ZP(r);return o&&(o.attrs=s),d(r,e,n,s)}),vL(f),f}function xL(e){let t=new WeakMap;function n(t,n,r){n.onChange?.();let i=()=>n.present!==void 0&&eF(t,n.props)!==n.present;if(r){i()&&n.tick.value++;return}let a=MI(e);a!==n.version&&(n.version=a,(i()||n.attrs&&!SL(ZP(t,n.props),n.attrs,AF(t)))&&n.tick.value++)}return(r,i)=>{let a=t.get(r);if(!a){let e=a=new Map;t.set(r,e),Vd(()=>e.forEach(e=>e.unsubscribe?.()),r)}let o=a.get(i);o||a.set(i,o={tick:tc(0),props:i.props,version:0}),o.props=i.props,o.version=MI(e);let s=jF(i);if(o.subscription!==s){let e=o;e.unsubscribe?.(),e.subscription=s,e.unsubscribe=tF(i,t=>n(i,e,t))}return o.tick.value,o}}function SL(e,t,n){let r=0;for(let i in e)if(r++,(e[i]!==t[i]||!(i in t))&&!n?.includes(i))return!1;let i=0;for(let e in t)i++;return r===i}function CL(e,t){let n={};for(let r in Qs(e))r!==t&&(n[r]=e[r]);return n}function wL(e,t,n,r=Df()){let i=tc(0),a,o,s=new Set,c=()=>$P(e.part(t,n())),l=e=>{for(let t of s)if(!aP(e[t],a[t]))return!0;return!1},u=()=>{let e=c();l(e)&&(a=e,s.clear(),i.value++)},d=r&&WL.get(e),f,p,m,h=e=>{let t=jF(e);(e!==p||t!==m)&&(p=e,m=t,d?(f&&(f.onChange=void 0),f=d(r,e),f.onChange=u):(o?.(),o=tF(e,u)))};return r?Vd(()=>o?.(),r):ps(()=>o?.()),new Proxy({},{get(r,o){i.value;let c=e.part(t,n());return a=$P(c),typeof o==`string`&&s.add(o),h(c),a[o]}})}function TL(e,t){let n=GL.get(e);if(!n){let r=tc(t);GL.set(e,n={own:r,component:()=>r.value()})}return n.own.value=t,n.component}function EL(e,t,n,r){let{tag:i,children:a,hidden:o}=r;if(t.render){let r=a?()=>a(n()):()=>t.default?.({get state(){return n()}}),{ref:i,...s}=e,c=t.render({props:i?{...s,...OL(i)}:s,get state(){return n()},children:TL(t,r)});return i&&kL(c,i,e[`data-slot`]),o?[...c,o()]:c.length===1?c[0]:c}let s=a?a(n()):t.default?.({get state(){return n()}});return q(i,e,o?[s,o()]:s)}function DL(e,t,n,r){return EL(e,t,()=>n,r)}function OL(e){let t=KL.get(e);if(!t){let n=t=>{!JL.has(t)&&t.el?.nodeType===Node.ELEMENT_NODE&&qL.get(e)!==t.el&&(qL.set(e,t.el),e(t.el))};t={onVnodeMounted:n,onVnodeUpdated:n,onVnodeUnmounted:t=>{qL.get(e)===t.el&&(qL.delete(e),e(null))}},KL.set(e,t)}return t}function kL(e,t,n){let r=[...e];for(;r.length;){let e=r.shift();if(Array.isArray(e))r.unshift(...e);else if(Ru(e)&&e.props?.[`data-slot`]===n){JL.has(e)||(JL.add(e),e.ref=Uu(e,{ref:t},!0).ref);return}else Ru(e)&&(e.type===mf||e.type===Ad)&&Array.isArray(e.children)&&r.unshift(...e.children)}}function AL(e,t,n=()=>({}),r,i=`div`){lL(`The ${t} part`);let a=Df();if(!a)throw Error(`The ${t} part must call usePart in its setup.`);let o=typeof e==`function`?gL(e)?.handle:e;if(!o)throw Error(`The ${t} part must be used inside its primitive's root.`);let s=tu(),c=eu(),l=typeof i==`string`?{tag:i}:i,u=BL.get(o),d,f=()=>d??=wL(o.instance,t,n,a);return Object.defineProperty(()=>{let e=n(),i=r?r():s,a;if(u){if(a=u(t,e,i),!a)return null}else{if(!o.present(t,e))return null;a=o.slot(t,e,i)}return EL(l.extend?l.extend(a):a,c,f,l)},"state",{get:f,enumerable:!0})}var jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL=t((()=>{iL(),Y(),JI(),cL(),jL={type:Boolean,default:void 0},ML=(e,t)=>e===void 0?t:e,NL=new WeakMap,PL=new Map,FL=new Map,IL=()=>!1,LL={by:`framework`,attaches:`all`},RL=Object.freeze({}),zL=new WeakMap,BL=new WeakMap,VL=new WeakMap,HL=e=>e.replace(/(^|-)(\w)/g,(e,t,n)=>n.toUpperCase()),UL=e=>{let t=J(e);return()=>t.value},WL=new WeakMap,GL=new WeakMap,KL=new WeakMap,qL=new WeakMap,JL=new WeakSet,YL=new WeakSet}));function ZL(e){let t=iR.get(e);return t||iR.set(e,t=tc(void 0)),t}function QL(e,t){let n=gL(e)?.handle;return()=>{let e=t();return(e&&ZL(e).value)??n}}function $L(e,t){Ld(()=>U(e,(e,n,r)=>{if(!e)return;let i=ZL(e);i.value=t,r(()=>{i.value===t&&(i.value=void 0)})},{flush:`post`,immediate:!!e()}))}function eR(e,t,{slots:n,state:r,children:i}){return DL(t,n,r,{tag:e,children:i})}function tR(e){let t,n=Object.create(e);n.slot=(n,r,i)=>{let a=e.slot(n,r,i);return t=a.ref,a};let r=BL.get(e);return r&&BL.set(n,(e,n,i)=>{let a=r(e,n,i);return a&&(t=a.ref),a}),{handle:n,release:()=>t?.(null)}}function nR(e,t,n){let r,i;return ps(()=>i?.scope.stop()),()=>{let a=e();return a!==r&&(r=a,i?.release(),i?.scope.stop(),i=a&&rR(a,t)),i?i.render():n()}}function rR(e,t){let n=ds(!0),r=tR(e);return{scope:n,render:n.run(()=>t(r.handle)),release:r.release}}var iR,aR=t((()=>{Y(),XL(),iR=new WeakMap}));function oR(e){let t=yl(lR,()=>void 0);return()=>e()??t()}function sR(e,t){let n=vk(t),r=t?[q(uR,{container:t},()=>e)]:[].concat(e);return n?q(dR,{to:n},()=>r):r.length===1?r[0]:r}var cR,lR,uR,dR,fR,pR=t((()=>{iL(),Y(),cL(),aR(),cR=Object,lR=Symbol(`popup-container`),uR=W({name:`PopupContainerScope`,props:{container:Object},setup(e,{slots:t}){return vl(lR,()=>e.container),()=>t.default?.()}}),dR=W({name:`PopupTeleport`,props:{to:{type:Object,required:!0}},slots:Object,setup(e,{slots:t}){let n=oL();return()=>q(Ad,{to:e.to,disabled:n.value},t.default())}}),fR=e=>e}));function mR(e,t,n=[]){let r=!1;for(let e in t)if(!n.includes(e)){r=!0;break}if(!r)return;let i=Object.keys(t).filter(e=>!n.includes(e)).join(`, `);i&&!gR.has(`${e} ${i}`)&&(gR.add(`${e} ${i}`),`${e}${i}`)}function hR(e){let t=e,n=t.setup;t.inheritAttrs=!1;let r=t.props&&`readOnly`in t.props?[`readonly`]:[];return t.setup=(e,i)=>(mR(t.name??`This root`,i.attrs,r),n?.(e,i)),e}var gR,_R=t((()=>{iL(),gR=new Set}));function vR(e){let t=[];for(let n in e){let r=e[n],i=wR(r);i!==`callback`&&t.push({prop:n,isId:i===`id`,from:TR(r,n),required:typeof r==`object`&&!!r.required,key:i===`key`})}return t}function yR(...e){let t={};for(let n of e)for(let e in n){let r=wR(n[e]);r!==`callback`&&(t[e]=kR[r])}return t}function bR(e){return Object.keys(e).filter(t=>wR(e[t])===`callback`).map(t=>{let n=t[2].toLowerCase()+t.slice(3),r=n.endsWith(`Change`)?n.slice(0,-6):``;return{key:t,event:n,update:r in e?`update:${r}`:void 0}})}function xR(e,t){let n={};for(let{key:r,event:i,update:a}of e)n[r]=(...e)=>{t(i,...e),a&&!e[1]?.canceled&&t(a,e[0])};return n}function SR(e,t){return t}function CR(e,t){let n=kI(e),r=HL(e.name),i=t,a=new Set(Object.values(n.slots).flatMap(e=>Object.entries(e).flatMap(([e,t])=>TR(t,e)?.slot??[]))),o=new Set(Object.entries(n.slots).flatMap(([e,t])=>Object.values(t).some(e=>wR(e)===`key`)?[e]:[])),s=Object.keys(n.options).filter(e=>wR(n.options[e])!==`callback`),c=i.root?n.slots.root??{}:{},l=i.root?vR(c):[],u=bR({...n.options,...c}),d=jR(u);function f(t,n,i,a,o){if(!n.length&&!a)return OR;let s=gL(e),c=s?.around??DR,l=n.some(e=>e.isId)?n.map(e=>e.isId?Ml():void 0):void 0;for(let e=0;e<n.length;e++){let i=n[e];if(i.from&&!c[i.from.slot]&&i.required)throw Error(`<${r}${HL(t)}> must be used inside <${r}${HL(i.from.slot)}>.`)}return()=>{let e=a?{...a}:{};for(let t=0;t<n.length;t++){let{prop:r,from:a,key:u}=n[t],d=i[r];d===void 0&&r===o&&(d=i.modelValue),d===void 0&&(d=l?.[t]??(a&&c[a.slot]?.()[a.prop])),e[r]=d,u&&(e.id=(s?.handle.api).internal.keyOf(d))}return e}}let p=u.length>0,m={Root:W({name:r,inheritAttrs:!1,props:{...yR(n.options,c),...d?{modelValue:null}:{}},emits:[...MR(u),...d?[`update:modelValue`]:[]],setup(t,{slots:n,emit:a,attrs:o}){let c=p?xR(u,(e,...t)=>{a(e,...t),e===`update:${d}`&&a(`update:modelValue`,...t)}):void 0,m=bL(e,()=>{let e=c?{...c}:{};for(let n=0;n<s.length;n++){let r=s[n];e[r]=t[r]}return d&&e[d]===void 0&&(e[d]=t.modelValue),e});return i.root?AL(m,`root`,f(`root`,l,t,c,d),void 0,i.root):(mR(r,o),()=>n.default?.())}})};for(let t in i){if(t===`root`)continue;let s=`${r}${HL(t)}`,c=n.slots[t]??{},l=vR(c),u=bR(c),d=u.length>0,p=a.has(t),h=o.has(t),g=`id`in c;m[HL(t)]=W({name:s,inheritAttrs:!1,props:yR(c),emits:MR(u),setup(n,{emit:a,attrs:o}){if(!gL(e))throw Error(`<${s}> must be used inside <${r}>.`);let c=f(t,l,n,d?xR(u,a):void 0);return p&&yL(e,t,h?()=>{let e=c();return{...e,value:e.id}}:c),AL(e,t,c,g?()=>n.id==null?o:{...o,id:n.id}:void 0,i[t])}})}return m}var wR,TR,ER,DR,OR,kR,AR,jR,MR,NR=t((()=>{iL(),Y(),XL(),_R(),wR=e=>typeof e==`string`?e:typeof e==`object`?e.kind:`value`,TR=(e,t)=>{if(typeof e!=`object`)return;let[n,r=t]=e.from.split(`.`);return{slot:n,prop:r}},ER=Object.freeze({}),DR=Object.freeze({}),OR=()=>ER,kR={string:String,number:Number,boolean:jL,list:[Array,String],value:null,id:null,key:null,action:Function},AR=[`value`,`checked`,`pressed`,`open`,`page`,`layout`],jR=e=>AR.find(t=>e.some(({update:e})=>e===`update:${t}`)),MR=e=>e.flatMap(({event:e,update:t})=>t?[e,t]:[e])})),PR,FR,IR,LR,RR,zR,BR=t((()=>{qI(),Y(),JI(),pR(),NR(),XL(),_R(),PR=Symbol(`tooltip-container`),FR=Symbol(`tooltip-trigger`),IR=CR(KI,{arrow:`div`}),LR=hR(W({name:`Tooltip`,props:{open:jL,modelValue:jL,defaultOpen:jL,delay:Number,closeDelay:Number,disabled:jL,toggleable:jL,closeOnPress:jL,type:String,shortcut:String,controller:Object,debug:jL,container:cR},emits:{"update:open":e=>!0,"update:modelValue":e=>!0,openChange:(e,t)=>!0,openChangeComplete:e=>!0,payloadChange:(e,t)=>!0},setup(e,{slots:t,emit:n}){vl(PR,()=>e.container);let r={onOpenChange:(e,t)=>{n(`openChange`,e,t),t.canceled||(n(`update:open`,e),n(`update:modelValue`,e))},onOpenChangeComplete:e=>n(`openChangeComplete`,e),onPayloadChange:(e,t)=>n(`payloadChange`,e,t)};return $L(()=>e.controller,bL(KI,()=>({...CL(e,`container`),open:ML(e.open,e.modelValue),...r}))),()=>t.default?.()}})),RR=SR(`button`,W({name:`TooltipTrigger`,inheritAttrs:!1,props:{payload:null,controller:Object},slots:Object,setup(e,{slots:t,attrs:n}){let r=QL(KI,()=>e.controller);vl(FR,r);let i=Ml();return nR(r,t=>AL(t,`trigger`,()=>({id:i,payload:e.payload}),void 0,`button`),()=>eR(`button`,{type:`button`,...n},{slots:t,state:{open:!1}}))}})),zR=fR(SR(`div`,W({name:`TooltipContent`,inheritAttrs:!1,props:{side:String,align:String,sideOffset:Number,alignOffset:Number,collisionPadding:Number,arrowPadding:Number,anchor:[Object,String],container:cR},slots:Object,setup(e){let t=_L(KI),n=yl(PR,()=>void 0),r=oR(()=>e.container??n()),i=AL(t,`content`,()=>CL(e,`container`));return()=>{let e=i();return e&&sR(e,r())}}}))),IR.Arrow})),VR,HR=t((()=>{Y(),BR(),VR=W({__name:`TooltipContent`,props:{side:{default:`top`},sideOffset:{default:6}},setup(e){return(t,n)=>(G(),Lu(H(zR),{"data-slot":`tooltip-content`,side:e.side,"side-offset":e.sideOffset},{default:gl(()=>[Ql(t.$slots,`default`)]),_:3},8,[`side`,`side-offset`]))}})})),UR,WR=t((()=>{HR(),HR(),UR=VR})),GR,KR=t((()=>{Y(),BR(),WR(),GR=W({__name:`Tooltip`,props:iu({open:{type:Boolean},defaultOpen:{type:Boolean,default:!1},delay:{},label:{}},{open:{type:Boolean,default:void 0},openModifiers:{}}),emits:iu([`update:open`],[`update:open`]),setup(e){let t=su(e,`open`);return(n,r)=>(G(),Lu(H(LR),{open:t.value,"onUpdate:open":r[0]||=e=>t.value=e,"default-open":e.defaultOpen||void 0,delay:e.delay},{default:gl(()=>[Ql(n.$slots,`default`),e.label?(G(),Lu(UR,{key:0},{default:gl(()=>[Wu(ss(e.label),1)]),_:1})):Gu(``,!0)]),_:3},8,[`open`,`default-open`,`delay`]))}})})),qR,JR=t((()=>{KR(),KR(),qR=GR})),YR=t((()=>{JR(),WR(),Y(),BR()})),XR,ZR,QR,$R=t((()=>{Y(),MO(),BR(),YR(),XR=[`data-mode`,`datetime`],ZR=[`data-mode`,`data-slot`,`datetime`],QR=W({inheritAttrs:!1,__name:`RelativeTime`,props:{at:{},threshold:{default:`3w`},format:{default:`long`},locale:{default:`en`},plain:{type:Boolean,default:!1}},setup(e){let t=tu(),{time:n,tip:r}=AO(()=>({at:e.at,threshold:e.threshold,format:e.format,locale:e.locale})),i=J(()=>t[`data-slot`]??`relative-time`),a=e=>{if(!r.value)return t;let{type:n,...i}=e;return{...i,...t}};return(o,s)=>H(n)?e.plain?(G(),K(`time`,Yu({key:1,"data-slot":`relative-time`},H(t),{"data-mode":H(n).mode,datetime:H(n).datetime}),ss(H(n).label),17,XR)):(G(),Lu(H(qR),{key:2,label:H(r)},{default:gl(()=>[Cf(H(RR),null,{render:gl(({props:e,children:t})=>[Bu(`time`,Yu(a(e),{"data-mode":H(n).mode,"data-slot":i.value,datetime:H(n).datetime}),[(G(),Lu(ql(t)))],16,ZR)]),default:gl(()=>[Wu(ss(H(n).label),1)]),_:1})]),_:1},8,[`label`])):(G(),K(`time`,Yu({key:0,"data-slot":`relative-time`},H(t)),ss(String(e.at)),17))}})})),ez,tz=t((()=>{$R(),$R(),ez=QR})),nz=t((()=>{tz()}));function rz(e){let t=e.anchor.kind===`text`?e.anchor.exact:``;return xh(e.messages[0]?.body??``)||t}function iz(e){return{thread:e,text:rz(e)}}var az=t((()=>{Th()})),oz,sz,cz,lz,uz,dz,fz,pz,mz,hz=t((()=>{Y(),eD(),nz(),Th(),az(),oz={"data-slot":`comment-list-number`},sz={"data-slot":`comment-list-body`},cz={"data-slot":`comment-list-text`},lz={"data-slot":`comment-list-meta`},uz={key:0},dz={key:1},fz={key:2,"data-slot":`comment-list-detached`},pz={key:3},mz=W({name:`CommentRow`,__name:`CommentRow`,props:{thread:{},detached:{type:Boolean,default:!1},site:{type:Boolean,default:!1}},setup(e){let t=J(()=>e.thread.messages.length-1);return(n,r)=>(G(),K(mf,null,[Bu(`span`,oz,ss(e.thread.n?String(e.thread.n):``),1),Cf(H(QE),{"aria-hidden":`true`,people:[H(bh)(e.thread)],size:`sm`},null,8,[`people`]),Bu(`span`,sz,[Bu(`span`,cz,[Ql(n.$slots,`preview`,{},()=>[Wu(ss(H(rz)(e.thread)),1)])]),Bu(`span`,lz,[Bu(`span`,null,ss(H(wh)(e.thread)),1),Cf(H(ez),{at:e.thread.updatedAt},null,8,[`at`]),t.value>0?(G(),K(`span`,uz,ss(t.value)+` `+ss(t.value===1?`reply`:`replies`),1)):Gu(``,!0),e.thread.status===`resolved`?(G(),K(`span`,dz,`Resolved`)):Gu(``,!0),e.detached?(G(),K(`span`,fz,`Detached`)):Gu(``,!0),e.site&&e.thread.subject.kind===`page`?(G(),K(`span`,pz,ss(e.thread.subject.id),1)):Gu(``,!0)])])],64))}})})),gz,_z=t((()=>{hz(),hz(),gz=mz}));function vz(e,t){let n=e.subject.value;return t.anchor.kind===`page`&&t.subject.kind===n.kind&&t.subject.id===n.id}var yz,bz,xz,Sz=t((()=>{Y(),tD(),Iw(),Ay(),Up(),Th(),_z(),$w(),yz=3,bz=`Comment on the whole page`,xz=W({name:`CommentPageIsland`,props:{comments:{required:!0,type:Object},canComment:{required:!0,type:Boolean}},slots:Object,setup(e,{slots:t}){let n=Zw(`UIcon`),r=Nw(),i=e.comments,a=V(),o=V(),s=new Set;vl(Rp,s);let c=J(()=>i.pageThreads.value.filter(e=>e.anchor.kind===`page`)),l=J(()=>c.value.filter(e=>e.status===`open`)),u=J(()=>i.draft.value?.anchor.kind===`page`?i.draft.value:null),d=J(()=>i.opened.value&&vz(i,i.opened.value)?i.opened.value:null),f=J(()=>e.canComment&&!!i.user.value),p=V(!1),m=J(()=>i.visibility.value===`hidden`),h=J(()=>m.value?c.value.filter(e=>i.isShown(e.id)):c.value),g=()=>{let e=a.value?.getRootNode();return e instanceof ShadowRoot?e:document},_=J(()=>u.value||d.value||p.value&&(h.value.length>0||f.value)?`open`:i.active.value&&f.value?`hint`:m.value?`none`:l.value.length>0?`count`:`none`),v=V(),y=J(()=>m.value?0:l.value.length),b=J(()=>_.value===`hint`||_.value===`open`&&f.value);U([v,J(()=>b.value?bz:String(y.value))],([e,t],n)=>{e&&(e===n?.[0]?by(e,t):e.textContent=t)},{flush:`post`,immediate:!0});let x=!1,S;U(m,e=>{e&&(p.value=!1)}),U(d,(e,t)=>{if(e){p.value=!0;return}if(!t||_.value!==`open`)return;let n=g().activeElement;n&&a.value?.contains(n)||ol(()=>a.value?.querySelector(`[data-slot='comment-page-island-item'][data-thread-id='${t.id}']`)?.focus())},{flush:`post`});let C=()=>(a.value?Ip(a.value):!1)||(u.value?.body.trim().length??0)>0,w=e=>[...s].some(t=>t.value&&e.includes(t.value)),T=()=>{let e=g().activeElement,t=!!(e&&a.value?.contains(e));p.value=!1,u.value&&i.cancelDraft(),d.value&&i.close(),t&&ol(()=>o.value?.focus({preventScroll:!0}))},E=(e=!1)=>C()?(a.value&&Lp(a.value,e),!1):(T(),!0);Fp(e=>{if(_.value!==`open`||!a.value)return;let t=Hp(e);t.includes(a.value)||w(t)||zp.has(e)||(t.some(e=>e.matches(`[data-slot='comment-pin']`))||zp.add(e),E()||(e.stopPropagation(),Pp()))});let D=e=>{if(e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.repeat||_.value!==`open`)return;let t=Hp(e);w(t)||t.some(e=>e.matches(`[data-slot='comment-composer']`))||(e.preventDefault(),E(!0))};Ld(()=>document.addEventListener(`keydown`,D,!0)),Bd(()=>{document.removeEventListener(`keydown`,D,!0)});let O=()=>{if(_.value===`open`)E();else if(_.value===`hint`)try{i.startDraft(`page`)}catch{}else p.value=!0},k=()=>{let e=new Map;for(let t of l.value){let n=bh(t);e.has(n.id)||e.set(n.id,n)}return[...e.values()].slice(0,yz)},A=()=>q(`ul`,{"data-slot":`comment-page-island-items`},h.value.map(e=>q(`li`,{key:e.id},q(`button`,{"data-focus-inset":``,"data-slot":`comment-page-island-item`,"data-status":e.status,"data-thread-id":e.id,onClick:()=>{p.value=!0,i.open(e)},type:`button`},[q(gz,{thread:e})])))),ee=()=>{let e=d.value;return e&&t.thread?t.thread({thread:e}):[h.value.length>0?A():null,f.value&&t.composer?q(`div`,{"data-draft":`true`,"data-slot":`comment-page-island-composer`,key:`composer`},t.composer({autofocus:!!u.value,draft:u.value,onCancel:T})):null]};return()=>{let e=_.value,t=e===`open`,s=y.value,c=b.value?bz:`${s} ${s===1?`comment`:`comments`} on the whole page`;return e===`none`?S=void 0:S??=x&&!t,x=i.status.value===`ready`||i.status.value===`error`,q(`div`,{"data-slot":`comment-page-island`,"data-state":e,ref:a},e===`none`?[]:[q(`div`,{"data-motion-appear":S?``:void 0,"data-open":t?``:void 0,"data-side":`bottom`,"data-slot":`comment-page-island-card`},[q(`button`,{"aria-expanded":String(t),"aria-label":b.value&&s>0?`${c}, ${s} open`:c,"data-motion-press":``,"data-slot":`comment-page-island-trigger`,onClick:O,ref:o,type:`button`},[s>0?q(`span`,{"data-slot":`comment-page-island-faces`},q(QE,{"aria-hidden":`true`,max:null,people:k(),size:`sm`})):q(n,{"aria-hidden":`true`,name:r.value.commentPage}),q(`span`,{"data-slot":`comment-page-island-label`,ref:v})]),t?q(`div`,{"data-slot":`comment-page-island-content`},ee()):null])])}}})}));function Cz(e){let{resolvedAt:t}=e;return e.status!==`resolved`||t===void 0?[]:e.messages.filter(e=>e.createdAt>t)}function wz(e){return e.n?`Comment ${e.n}`:`Comment`}function Tz(e){return e.n?`#${e.n}`:`Comment`}function Ez(e){return{"data-failed":e?.status===`failed`?`true`:void 0,"data-pending":e?.status===`pending`?`true`:void 0}}var Dz=t((()=>{})),Oz=t((()=>{Y()})),kz=t((()=>{Y(),YD(),gO(),ZD(),Oz(),MO()})),Az,jz,Mz,Nz,Pz=t((()=>{Y(),kz(),Ow(),Az={"data-slot":`comment-filters`,role:`group`,"aria-label":`Filter comments`},jz=[`data-variant`,`data-active`,`aria-pressed`,`onClick`],Mz={key:0},Nz=W({name:`CommentFilters`,__name:`CommentFilters`,props:{comments:{}},setup(e){let t=cO(e.comments),n=J(()=>[{key:`open`,label:`Open`,count:t.counts.value.open},{key:`resolved`,label:`Resolved`,count:t.counts.value.resolved},{key:`mine`,label:`Mine`}]);return(e,r)=>(G(),K(`div`,Az,[(G(!0),K(mf,null,Xl(n.value,e=>(G(),K(`button`,{key:e.key,type:`button`,"data-slot":`comment-filter`,"data-comment-button":``,"data-size":`xs`,"data-variant":H(t).filters[e.key]?`soft`:`ghost`,"data-active":H(t).filters[e.key]?``:void 0,"aria-pressed":H(t).filters[e.key],onClick:n=>H(t).filters[e.key]=!H(t).filters[e.key]},[e.count===void 0?(G(),K(`span`,Mz,ss(e.label),1)):(G(),K(mf,{key:1},[Wu(ss(`${e.label} `),1),Cf(H(Ew),{value:e.count},null,8,[`value`])],64))],8,jz))),128))]))}})})),Fz,Iz=t((()=>{Pz(),Pz(),Fz=Nz})),Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz=t((()=>{Y(),kz(),Ow(),Iz(),_z(),az(),Dz(),Lz={"data-slot":`comment-list`,"data-comments-ui":``,"aria-label":`Comments`},Rz={"data-slot":`comment-list-header`},zz={"data-slot":`comment-list-scopes`,role:`group`,"aria-label":`Scope`},Bz=[`data-variant`,`aria-pressed`,`onClick`],Vz={key:0,"data-slot":`comment-list-empty`,role:`status`},Hz=[`data-status`,`data-detached`,`aria-current`,`href`,`onClick`],Uz=W({name:`CommentList`,__name:`CommentList`,props:{comments:{},navigate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=cO(n.comments),a=[{value:`page`,label:`This page`},{value:`site`,label:`All pages`}],o=J(()=>i.listed.value),s=J(()=>i.status.value===`loading`&&i.threads.value.length===0?`Loading comments.`:i.status.value===`error`?`The comments could not load.`:`No comments here.`);function c(e,t){r(`select`,{thread:e}),t.ctrlKey||t.metaKey||t.shiftKey||t.button!==0||(t.preventDefault(),e.subject.kind===i.subject.value.kind&&e.subject.id===i.subject.value.id?i.open(e,{scroll:!0}):i.close()&&(n.navigate??(e=>window.location.assign(e)))(i.link(e)))}return(e,t)=>(G(),K(`section`,Lz,[Bu(`header`,Rz,[Bu(`div`,zz,[(G(),K(mf,null,Xl(a,e=>Bu(`button`,{key:e.value,type:`button`,"data-slot":`comment-list-scope`,"data-comment-button":``,"data-size":`xs`,"data-variant":H(i).scope.value===e.value?`soft`:`ghost`,"aria-pressed":H(i).scope.value===e.value,onClick:t=>H(i).scope.value=e.value},[Bu(`span`,null,ss(e.label),1)],8,Bz)),64))]),Cf(Fz,{comments:H(i)},null,8,[`comments`])]),o.value.length===0?(G(),K(`p`,Vz,ss(s.value),1)):(G(),Lu(H(Sw),{key:1},{render:gl(({props:e,children:t})=>[Bu(`ol`,Yu(e,{"data-slot":`comment-list-items`}),[(G(),Lu(ql(t)))],16)]),default:gl(()=>[(G(!0),K(mf,null,Xl(o.value,t=>(G(),K(`li`,{key:t.id},[Bu(`a`,Yu({"data-slot":`comment-list-item`,"data-focus-inset":``,"data-status":t.status,"data-detached":H(i).positions.value.get(t.id)?.detached===!0?`true`:void 0},{ref_for:!0},H(Ez)(t.delivery),{"aria-current":H(i).openId.value===t.id?`true`:void 0,href:H(i).link(t),onClick:e=>c(t,e)}),[Ql(e.$slots,`row`,Yu({ref_for:!0},H(iz)(t)),()=>[Cf(gz,{thread:t,detached:H(i).positions.value.get(t.id)?.detached===!0,site:H(i).scope.value===`site`},Zl({_:2},[e.$slots.preview?{name:`preview`,fn:gl(()=>[Ql(e.$slots,`preview`,Yu({ref_for:!0},H(iz)(t)))]),key:`0`}:void 0]),1032,[`thread`,`detached`,`site`])])],16,Hz)]))),128))]),_:3}))]))}})})),Gz,Kz=t((()=>{Wz(),Wz(),Gz=Uz})),qz,Jz,Yz,Xz=t((()=>{Y(),eD(),Th(),qz=[`data-status`,`data-active`,`data-draft`,`aria-expanded`,`aria-label`],Jz={key:1,"data-slot":`comment-pin-number`},Yz=W({name:`CommentPin`,__name:`CommentPin`,props:{number:{},author:{},status:{default:`open`},excerpt:{},active:{type:Boolean,default:!1},draft:{type:Boolean,default:!1}},emits:[`select`,`hover`,`leave`],setup(e,{emit:t}){let n=t,r=J(()=>{if(e.draft)return`New comment`;let t=e.author?` by ${Ch(e.author)}`:``,n=e.excerpt?`: ${e.excerpt}`:``;return`Comment${e.number===void 0?``:` ${e.number}`}${t}${n}${e.status===`resolved`?`, resolved`:``}`}),i=!1,a=!1;function o(){a=!0,n(`hover`)}function s(){a=!1,i||n(`leave`)}function c(){i=!0,n(`hover`)}function l(){i=!1,a||n(`leave`)}return(t,i)=>(G(),K(`button`,{type:`button`,"data-slot":`comment-pin`,"data-status":e.status,"data-active":e.active?`true`:void 0,"data-draft":e.draft?`true`:void 0,"aria-expanded":e.draft?void 0:e.active,"aria-label":r.value,onClick:i[0]||=e=>n(`select`),onFocus:o,onBlur:s,onPointerenter:c,onPointerleave:l},[e.author?(G(),Lu(H(QE),{key:0,"aria-hidden":`true`,people:[H(yh)(e.author)],size:`sm`},null,8,[`people`])):Gu(``,!0),!e.draft&&e.number!==void 0?(G(),K(`span`,Jz,ss(e.number),1)):Gu(``,!0)],40,qz))}})})),Zz,Qz=t((()=>{Xz(),Xz(),Zz=Yz})),$z,eB,tB,nB=t((()=>{Y(),uE(),$z=[`data-side`],eB=[`data-action`,`aria-keyshortcuts`,`title`,`onClick`],tB=W({name:`CommentSelectionBar`,__name:`CommentSelectionBar`,props:{suggest:{type:Boolean,default:!1},side:{default:`top`},tooltip:{type:[Object,Function]}},emits:[`comment`,`suggest`],setup(e,{emit:t}){let n=t,r=(e,{slots:t})=>t.default?.(),i=J(()=>[{name:`comment`,label:`Comment`,hint:`Comment on the selected text`,key:`C`,icon:WT},...e.suggest?[{name:`suggest`,label:`Suggest`,hint:`Suggest new words`,key:`E`,icon:qT}]:[]]);function a(e){n(e===`comment`?`comment`:`suggest`)}return(t,n)=>(G(),K(`div`,{"data-slot":`comment-selection-bar`,"data-side":e.side,role:`group`,"aria-label":`Selected text`,onMousedown:n[0]||=kp(()=>{},[`prevent`])},[(G(!0),K(mf,null,Xl(i.value,n=>(G(),Lu(ql(e.tooltip||r),Yu({key:n.name},{ref_for:!0},e.tooltip?{side:e.side,hint:n.hint,shortcut:n.key}:{}),{default:gl(()=>[Bu(`button`,{type:`button`,"data-slot":`comment-selection-bar-action`,"data-action":n.name,"aria-keyshortcuts":n.key,title:e.tooltip?void 0:`${n.hint} (${n.key})`,onClick:e=>a(n.name)},[Ql(t.$slots,`${n.name}-icon`,{},()=>[(G(),Lu(ql(n.icon),{"data-slot":`comment-icon`,"aria-hidden":`true`}))]),Wu(ss(n.label),1)],8,eB)]),_:2},1040))),128))],40,$z))}})})),rB,iB=t((()=>{nB(),nB(),rB=tB})),aB,oB,sB,cB,lB=t((()=>{Y(),uE(),kz(),eD(),aB={"data-slot":`comment-toolbar`,"data-comments-ui":``,role:`toolbar`,"aria-label":`Comments`},oB=[`data-variant`,`aria-pressed`],sB=[`data-variant`,`aria-label`,`aria-pressed`],cB=W({name:`CommentToolbar`,__name:`CommentToolbar`,props:{comments:{},people:{default:()=>[]}},setup(e){let t=e,n=cO(t.comments),r=J(()=>n.pageThreads.value.length);return(e,i)=>(G(),K(`div`,aB,[Bu(`button`,{type:`button`,"data-slot":`comment-toolbar-mode`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":H(n).active.value?`solid`:`ghost`,"aria-keyshortcuts":`C`,"aria-label":`Comment mode`,"aria-pressed":H(n).active.value,title:`Comment (C)`,onClick:i[0]||=e=>H(n).toggle()},[Ql(e.$slots,`mode-icon`,{},()=>[Cf(H(WT),{"data-slot":`comment-icon`,"aria-hidden":`true`})])],8,oB),Bu(`button`,{type:`button`,"data-slot":`comment-toolbar-list`,"data-comment-button":``,"data-size":`sm`,"data-variant":H(n).listOpen.value?`solid`:`ghost`,"aria-label":`Comment list, ${r.value} on this page`,"aria-pressed":H(n).listOpen.value,onClick:i[1]||=e=>H(n).listOpen.value=!H(n).listOpen.value},[Ql(e.$slots,`list-icon`,{},()=>[Cf(H(RT),{"data-slot":`comment-icon`,"aria-hidden":`true`})]),Bu(`span`,null,ss(r.value),1)],8,sB),Bu(`button`,{type:`button`,"data-slot":`comment-toolbar-page`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":`ghost`,"aria-label":`Comment on page`,title:`Comment on the whole page`,onClick:i[2]||=e=>H(n).startDraft(`page`)},[Ql(e.$slots,`page-icon`,{},()=>[Cf(H(nE),{"data-slot":`comment-icon`,"aria-hidden":`true`})])]),t.people.length>0?(G(),Lu(H(QE),{key:0,people:t.people,size:`sm`,variant:`outline`},null,8,[`people`])):Gu(``,!0),Ql(e.$slots,`default`)]))}})})),uB,dB=t((()=>{lB(),lB(),uB=cB})),fB=t((()=>{Iz(),Kz(),Qz(),iB(),dB()}));function pB(e,t,n){if(!t||!n||!e.width||!e.height)return e;let r=Math.max(e.width/t,e.height/n),i=t*r,a=n*r;return{left:e.left+(e.width-i)/2,top:e.top+(e.height-a)/2,width:i,height:a}}var mB,hB,gB=t((()=>{Y(),kw(),Iw(),ew(),Up(),$w(),mB=4,hB=W({name:`ImageGallery`,props:{images:{required:!0,type:Array}},setup(e){let t=Zw(`UModal`),n=Zw(`UButton`),r=Nw(),i=V(null),a=V(!1),o=V(new Map),s=V(),c=yl(Rp,void 0);c?.add(s);let l=[],u=V(null),d,f=e=>l[Math.min(e,3)],p=J(()=>i.value===null?void 0:e.images[i.value]);U(()=>e.images,e=>{o.value=new Map(e.filter(({key:e,src:t})=>o.value.get(e)===t).map(({key:e,src:t})=>[e,t]))});let m=({key:t,src:n})=>{e.images.some(e=>e.key===t&&e.src===n)&&o.value.set(t,n)};async function h(e){await ol();let t=u.value,n=f(e);t&&n&&i.value===e&&(t.complete||await new Promise(e=>t.addEventListener(`load`,e,{once:!0})),i.value===e&&t.isConnected&&(d=ZC(t,{from:pB(n.getBoundingClientRect(),t.offsetWidth,t.offsetHeight)})))}function g(e){d?.stop(),a.value=!1,i.value=e,h(e)}async function _(){if(i.value===null||a.value)return;let e=u.value,t=f(i.value);a.value=!0,e&&t&&e.complete&&e.naturalWidth&&(d=ZC(e,{to:pB(t.getBoundingClientRect(),e.offsetWidth,e.offsetHeight)}),await d.done),d?.stop(),a.value&&(a.value=!1,i.value=null)}function v(t){i.value===null||a.value||e.images.length<2||(d?.stop(),i.value=(i.value+t+e.images.length)%e.images.length)}return Bd(()=>{d?.stop(),c?.delete(s)}),()=>{let c=e.images.length;l.length=0;let d=c>1,f=p.value;return q(`div`,{"data-count":Math.min(c,mB),"data-slot":`comment-reply-images`},[...e.images.slice(0,mB).map((e,t)=>q(`button`,{"aria-label":`Preview ${e.name}`,"data-open":i.value!==null&&Math.min(i.value,3)===t?`true`:void 0,"data-slot":`comment-reply-image`,key:e.key,onClick:()=>g(t),ref:e=>{e instanceof HTMLElement&&(l[t]=e)},title:e.name,type:`button`},[o.value.get(e.key)===e.src?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:``,loading:`lazy`,key:e.src,onError:()=>m(e),src:e.src}),t===3&&c>mB?q(`span`,{"aria-hidden":`true`,"data-slot":`comment-reply-image-more`},`+${c-mB+1}`):null])),q(t,{open:i.value!==null,title:p.value?.name??`Image`,transition:!1,ui:{content:`vh-image-dialog vh-image-gallery`,overlay:a.value?`vh-image-overlay vh-image-overlay--closing`:`vh-image-overlay`},"onUpdate:open":e=>{e||_()}},{content:()=>q(`div`,{class:`vh-image-gallery__body`,ref:s,onKeydown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),v(e.key===`ArrowLeft`?-1:1))}},[q(`div`,{class:`vh-image-dialog__toolbar`,"data-closing":a.value?`true`:void 0},[q(`span`,{class:`vh-image-dialog__name`,title:p.value?.name},p.value?.name),d?q(`span`,{class:`vh-image-gallery__count`},[q(Ew,{value:(i.value??0)+1}),` of ${c}`]):null,q(n,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,external:!0,icon:r.value.external,rel:`noreferrer`,target:`_blank`,to:p.value?.src,variant:`ghost`}),q(n,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:r.value.close,onClick:()=>void _(),variant:`ghost`})]),q(`div`,{class:`vh-image-gallery__stage`},[d?q(n,{"aria-label":`Previous picture`,class:`vh-image-gallery__step vh-image-gallery__step--previous rounded-full`,color:`neutral`,icon:r.value.chevronLeft,onClick:()=>v(-1),variant:`solid`}):null,f&&o.value.get(f.key)===f.src?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:f?.name??``,class:`vh-image-dialog__image`,key:f?.src,onError:()=>f&&m(f),ref:u,src:f?.src}),d?q(n,{"aria-label":`Next picture`,class:`vh-image-gallery__step vh-image-gallery__step--next rounded-full`,color:`neutral`,icon:r.value.chevronRight,onClick:()=>v(1),variant:`solid`}):null])])})])}}})}));function _B(e,t){return q(`a`,{href:e,rel:`noopener noreferrer`,target:`_blank`},t)}function vB(e,t,n){return!n||t.length===0?[e]:Oh(e,t).map(e=>typeof e==`string`?e:q(n,{label:e.name,user:e.id}))}function yB(e,t=[],n){let r=[],i=0;for(let a of e.matchAll(bB)){let o=a.index;o>i&&r.push(...vB(e.slice(i,o),t,n));let s=a[0];if(a[1])r.push(q(`code`,s.slice(1,-1)));else if(a[2])r.push(q(`strong`,vB(s.slice(2,-2),t,n)));else if(a[3])r.push(q(`em`,vB(s.slice(1,-1),t,n)));else if(a[4]){let e=s.indexOf(`](`);r.push(_B(s.slice(e+2,-1),s.slice(1,e)))}else r.push(_B(s,s));i=o+s.length}return i<e.length&&r.push(...vB(e.slice(i),t,n)),r}var bB,xB,SB=t((()=>{Y(),Fh(),bB=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)|(\[[^\]\n]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s<>)]+)/g,xB=W({name:`Markdown`,inheritAttrs:!1,props:{components:{type:Object},plugins:{type:Array},value:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=(e.plugins??[]).flatMap(e=>kh(Qs(e))??[]),r=e.components?.[`comment-mention`];return q(`div`,{...t,class:[`vh-markdown`,t.class]},e.value.split(/\n{2,}/).filter(e=>e.trim()).map(e=>q(`p`,e.split(`
|
|
151
|
-
`).flatMap((e,t)=>t?[q(`br`),...yB(e,n,r)]:yB(e,n,r)))))}}})})),CB,wB,TB=t((()=>{Y(),CB=[`data-variant`],wB=W({inheritAttrs:!1,__name:`Marker`,props:{variant:{default:`ghost`}},setup(e){let t=eu(),n=()=>q(mf,t.default?.());return(t,r)=>Ql(t.$slots,`render`,{props:{...t.$attrs,"data-slot":`marker`,"data-variant":e.variant},children:n()},()=>[Bu(`div`,Yu(t.$attrs,{"data-slot":`marker`,"data-variant":e.variant}),[Ql(t.$slots,`default`)],16,CB)])}})})),EB,DB=t((()=>{TB(),TB(),EB=wB})),OB,kB,AB=t((()=>{Y(),OB={"data-slot":`marker-content`},kB=W({__name:`MarkerContent`,setup(e){return(e,t)=>(G(),K(`span`,OB,[Ql(e.$slots,`default`)]))}})})),jB,MB=t((()=>{AB(),AB(),jB=kB})),NB=t((()=>{DB(),MB(),Y()})),PB=t((()=>{NB()})),FB=t((()=>{Ow()})),IB=t((()=>{nz()}));function LB(e){return e instanceof Error?e.message:`That did not work. Try again.`}function RB(e){if(e)try{let{protocol:t}=new URL(e,`https://vitehub.invalid`);return t===`http:`||t===`https:`||t===`blob:`?e:void 0}catch{return}}function zB(e,t,n,r){if(e.attachments.length===0)return null;let i=e.attachments.map(e=>{let n=t?.(e),r=typeof n==`string`?{url:n}:n,i=r?.name||VB(e),a=/\.([a-z0-9]+)$/i.exec(i)?.[1]?.toLowerCase(),o=RB(r?.url);return{href:o,image:o!==void 0&&(r?.type?r.type.startsWith(`image/`):a===void 0||BB.has(a)),key:e,name:i}}),a=i.flatMap(e=>e.image&&e.href?[{key:e.key,name:e.name,src:e.href}]:[]),o=i.filter(e=>!e.image);return[a.length>0?q(hB,{images:a}):null,o.length>0?q(kE,{"data-slot":`comment-reply-attachments`},()=>o.map(e=>q(lT,{key:e.key,size:`xs`},()=>[q(PE,{kind:`icon`},()=>q(n,{name:r})),q(wE,()=>q(zE,()=>e.href?q(`a`,{href:e.href,rel:`noreferrer`,target:`_blank`},e.name):e.name))]))):null]}var BB,VB,HB,UB,WB,GB=t((()=>{Y(),kw(),Up(),Fh(),Th(),Dz(),G_(),gO(),gB(),HE(),tD(),KD(),SB(),PB(),FB(),IB(),$w(),Iw(),BB=new Set([`apng`,`avif`,`bmp`,`gif`,`heic`,`jpeg`,`jpg`,`png`,`svg`,`webp`]),VB=e=>e.split(/[/\\]/).at(-1)||e,HB=W({name:`CommentReply`,props:{message:{required:!0,type:Object},user:{type:Object},editable:{default:!1,type:Boolean},deletable:{default:void 0,type:Boolean},compact:{default:!1,type:Boolean},confirmDelete:{default:!1,type:Boolean},size:{default:`md`,type:String},people:{default:()=>[],type:Array},users:{type:Function},attachmentUrl:{type:Function},onEdit:{type:Function},onDelete:{type:Function}},slots:Object,setup(e,{slots:t}){let n=Zw(`UButton`),r=Zw(`UIcon`),i=Nw(),a=W_(),o=V(!1),s=V(!1),c=V(!1),l=V(),u=V(``),d=V([]),f=()=>e.user?.id??a?.user.value?.id,p=W({props:{label:{default:``,type:String},user:{default:``,type:String}},setup(t){return()=>e.message.mentions.includes(t.user)?q(`span`,{"data-self":t.user===f()?`true`:void 0,"data-slot":`comment-mention`},`@${t.label}`):`@${t.label}`}}),m={[jh]:p},h=J(()=>{let t=new Map;for(let n of[...a?.people.value??[],...e.people,...e.user?[e.user]:[]])t.set(n.id,n);return[Ah(e.message.mentions.flatMap(e=>{let n=t.get(e);return n?[{id:e,name:Ch(n)}]:[]}))]});async function g(e){if(c.value)return!1;c.value=!0,l.value=void 0;try{return await e(),!0}catch(e){return l.value=LB(e),!1}finally{c.value=!1}}function _(){u.value=e.message.body,d.value=[...e.message.mentions],l.value=void 0,o.value=!0}async function v(t){if(!e.onEdit)return;let n=u.value,r=d.value,i=t.body===e.message.body?[...new Set([...e.message.mentions,...t.mentions])]:t.mentions;await g(()=>e.onEdit?.(e.message.id,t.body,i))&&u.value===n&&d.value===r&&(o.value=!1)}let y=()=>e.editable&&e.onEdit!==void 0,b=()=>(e.deletable??e.editable)&&e.onDelete!==void 0;async function x(){e.onDelete&&await g(()=>e.onDelete?.(e.message.id))&&(s.value=!1)}let S=(n,r)=>{if(!t.status)return null;let i=a?.outbox,o=()=>!e.compact&&e.message.id===n.id&&e.message.delivery!==void 0,s=()=>o()&&e.editable,c=()=>o()&&(e.deletable??e.editable);return q(`div`,{"data-slot":`comment-reply-status`},t.status({delivery:r,dismiss:i?.enabled&&c()?async()=>c()&&await i.dismiss(n.id):void 0,edit:i?.enabled&&s()?async(e,t)=>s()&&await i.edit(n.id,e,t):void 0,message:n,retry:i?.enabled&&s()?async()=>{s()&&await i.retry(n.id)}:void 0}))};return()=>{let{message:a}=e;return q(`div`,{"data-compact":e.compact?`true`:void 0,"data-editing":o.value?`true`:void 0,...Ez(a.delivery),"data-size":e.size,"data-slot":`comment-reply`},[q(`div`,{"data-slot":`comment-reply-content`},[q(`div`,{"data-slot":`comment-reply-header`},[q(QE,{"aria-hidden":`true`,people:[bh(a)],size:`sm`}),q(`span`,{"data-agent":a.actor?`true`:void 0,"data-slot":`comment-reply-author`},wh(a)),q(ez,{at:a.createdAt,"data-slot":`comment-reply-time`}),a.editedAt?q(`span`,{"data-slot":`comment-reply-edited`},`edited`):null]),o.value?q(GD,{autofocus:!0,busy:c.value,error:l.value,layout:`row`,mentions:d.value,modelValue:u.value,onCancel:()=>{c.value||(o.value=!1)},onSubmit:v,"onUpdate:mentions":e=>d.value=e,"onUpdate:modelValue":e=>u.value=e,people:e.people,size:e.size,users:e.users,variant:`edit`},{...t[`mention-item`]?{"mention-item":t[`mention-item`]}:{},...t[`mention-empty`]?{"mention-empty":t[`mention-empty`]}:{}}):t.body?.({message:a})??q(xB,{components:m,"data-slot":`comment-reply-body`,plugins:h.value,value:a.body}),o.value||e.compact?null:t.attachments?.({message:a})??zB(a,e.attachmentUrl,r,i.value.file),o.value||e.compact||!t.footer?null:q(`div`,{"data-slot":`comment-reply-footer`},t.footer({message:a})),!o.value&&a.delivery?S(a,a.delivery):null,s.value?q(`div`,{"aria-label":`Confirm delete`,"data-slot":`comment-reply-confirm`,role:`group`},[q(`p`,`Delete this comment and every reply to it?`),q(n,{color:`error`,label:`Delete thread`,loading:c.value,onClick:x,size:`xs`}),q(n,{color:`neutral`,label:`Cancel`,onClick:()=>s.value=!1,size:`xs`,variant:`ghost`})]):null,!o.value&&l.value?q(`p`,{"data-slot":`comment-reply-error`,role:`alert`},l.value):null]),(y()||b())&&!o.value&&!s.value&&!e.compact?q(`div`,{"data-slot":`comment-reply-actions`},[y()?q(n,{"aria-label":`Edit`,color:`neutral`,icon:i.value.edit,onClick:_,size:`xs`,variant:`ghost`}):null,b()?q(n,{"aria-label":`Delete`,color:`neutral`,icon:i.value.delete,onClick:()=>e.confirmDelete?s.value=!0:void x(),size:`xs`,variant:`ghost`}):null]):null])}}}),UB=e=>q(EB,{key:`resolved`,variant:`separator`},()=>q(jB,()=>`Resolved${e.resolvedBy?` by ${wh({author:e.resolvedBy,...e.resolvedActor?{actor:e.resolvedActor}:{}})}`:``}`)),WB=W({name:`CommentThread`,props:{thread:{required:!0,type:Object},user:{type:Object},preview:{default:!1,type:Boolean},readOnly:{default:!1,type:Boolean},can:{type:Function},busy:{default:!1,type:Boolean},error:{type:String},detached:{default:!1,type:Boolean},people:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},navigation:{default:`close`,type:String},dismissible:{default:!0,type:Boolean},size:{default:`md`,type:String},onReply:{type:Function},onEdit:{type:Function},onDelete:{type:Function},onResolve:{type:Function},onReopen:{type:Function}},emits:[`close`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=Zw(`UButton`),a=Nw(),o=W_(),s=V(null),c=V(``),l=V([]),u=V([]),d=V(!1),f=V(),p=V(null),m=yl(Rp,void 0)??new Set;vl(Rp,m);let h=J(()=>e.user??o?.user.value),g=J(()=>e.users??(o?t=>o.users(t,e.thread.id):void 0)),_=(t,n)=>!e.readOnly&&(e.can??o?.can??tO(h.value))(t,{message:n,thread:e.thread}),v=J(()=>{let t=new Map;for(let n of[...e.people,e.thread.author,...e.thread.messages.map(e=>e.author),...h.value?[h.value]:[]])t.set(n.id,n);return[...t.values()]}),y=J(()=>[...new Set([e.thread.author.id,...e.thread.messages.map(e=>e.author.id)])]);Fp(n=>{let r=Hp(n);if(e.preview||!e.dismissible||!s.value||r.includes(s.value))return;for(let e of m)if(e.value&&r.includes(e.value))return;if(r.some(e=>e.matches(`[data-slot='comment-pin']`))||zp.has(n))return;zp.add(n);let i=s.value.getRootNode();Lp(i instanceof ShadowRoot?i:document)?(n.stopPropagation(),Pp()):t(`close`)});async function b(t){if(d.value||!e.onReply)return;d.value=!0,f.value=void 0;let n=c.value,r=l.value,i=u.value;try{await e.onReply(t.body,[...t.mentions],[...t.files]),c.value===n&&l.value===r&&u.value===i&&(c.value=``,l.value=[],u.value=[]),ol(()=>p.value?.focus())}catch(e){f.value=LB(e)}finally{d.value=!1}}async function x(e){if(!(s.value&&Lp(s.value))){f.value=void 0;try{await e?.()}catch(e){f.value=LB(e)}}}function S(){s.value&&Lp(s.value)||t(`close`)}n({close:S});let C=()=>({...r.body?{body:r.body}:{},...r.attachments?{attachments:r.attachments}:{},...r.footer?{footer:r.footer}:{},...r.status?{status:r.status}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}}),w=()=>({...r.extra?{extra:r.extra}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}});return()=>{let{thread:t}=e,n=t.status===`resolved`,o=Cz(t),m=t.messages[0],T=t.anchor.kind===`text`?t.anchor.exact:void 0;if(e.preview){let n=t.messages.length-1;return q(`div`,{...Ez(t.delivery),"data-preview":`true`,"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status},[m?q(HB,{compact:!0,message:m,people:v.value,size:e.size,user:h.value},{...r.body?{body:r.body}:{},...r.status?{status:r.status}:{}}):null,n>0?q(`p`,{"data-slot":`comment-thread-count`},[q(Ew,{value:n}),n===1?` reply`:` replies`]):null])}let E=e.navigation===`back`,D=r.anchor?r.anchor({thread:t}):T?q(`blockquote`,{"data-slot":`comment-thread-quote`},T):null;return q(`section`,{"aria-label":wz(t),...Ez(t.delivery),"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status,ref:s,role:`dialog`,tabindex:-1},[q(`header`,{"data-slot":`comment-thread-header`},[E?q(i,{"aria-label":`Back to comments`,color:`neutral`,icon:a.value.arrowLeft,onClick:S,size:`xs`,variant:`ghost`}):null,q(`span`,{"data-slot":`comment-thread-title`},Tz(t)),q(`span`,{"data-slot":`comment-thread-spacer`}),r.actions?q(`div`,{"data-slot":`comment-thread-actions`},r.actions({thread:t})):null,_(`resolve`)?q(i,{"aria-label":n?`Reopen`:`Resolve`,color:`neutral`,icon:n?a.value.reopen:a.value.check,onClick:()=>void x(n?e.onReopen:e.onResolve),size:`xs`,variant:`ghost`}):null,E?null:q(i,{"aria-label":`Close`,color:`neutral`,icon:a.value.close,onClick:S,size:`xs`,variant:`ghost`})]),q(Sw,null,{render:({props:e,children:t})=>q(`div`,{...e,"data-slot":`comment-thread-messages`},[t]),default:()=>[D,e.detached?q(`p`,{"data-slot":`comment-thread-detached`,role:`status`},`The place of this comment is no longer on the page.`):null,...t.messages.flatMap((r,i)=>[n&&r===o[0]?UB(t):null,q(HB,{attachmentUrl:e.attachmentUrl,confirmDelete:i===0,deletable:_(`delete`,r),editable:_(`edit`,r),key:r.id,message:r,onDelete:e.onDelete,onEdit:e.onEdit,people:v.value,size:e.size,user:h.value,users:g.value},C())]),n&&o.length===0?UB(t):null,r.after?q(`div`,{"data-slot":`comment-thread-after`},r.after({thread:t})):null]}),!_(`reply`)&&(f.value??e.error)?q(`p`,{role:`alert`},f.value??e.error):null,_(`reply`)?q(GD,{accept:e.accept,attachments:e.attachments,autofocus:!1,busy:e.busy||d.value,error:f.value??e.error,files:u.value,guard:!1,layout:`row`,mentions:l.value,modelValue:c.value,onCancel:S,onSubmit:b,participants:y.value,"onUpdate:files":e=>u.value=e,"onUpdate:mentions":e=>l.value=e,"onUpdate:modelValue":e=>c.value=e,people:v.value,ref:p,size:e.size,user:h.value,users:g.value,variant:`reply`},w()):null])}}})}));function KB(e,t,n){let r=(Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)||16)/2,i=e.x,a=i>n/2&&i+r+t>n-r,o=Math.max(r,Math.min(a?i-r-t:i+r,n-r-t));return{x:i,y:e.y,flipX:a,left:o-i}}function qB(e){let t={x:e.left+e.width/2,y:e.top+e.height/2},n=document.elementsFromPoint(t.x,t.y).find(e=>!e.closest(`[data-comments-ui]`)&&!e.localName.startsWith(`vitehub-`)&&e!==document.documentElement);for(let t=n??null;t&&t!==document.documentElement;t=t.parentElement){let n=t.getBoundingClientRect();if(n.left<=e.left+1&&n.top<=e.top+1&&n.right>=e.left+e.width-1&&n.bottom>=e.top+e.height-1)return t}}var JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV=t((()=>{Y(),gO(),YD(),vO(),Up(),Sz(),Th(),_z(),eO(),Dz(),pw(),KD(),fB(),GB(),JB=360,YB=420,XB=e=>e===`area`||e===`image`?`round`:`point`,ZB=6,QB=32,$B=8,eV=900,tV=8,nV=72,rV=W({name:`CommentLayer`,props:{client:{type:Object},subject:{type:Object},user:{type:Object},comments:{type:Object},people:{default:()=>[],type:Array},hotkey:{default:`c`,type:[String,Boolean]},readOnly:{default:!1,type:Boolean},canComment:{default:!0,type:Boolean},subjectUrl:{type:Function},navigate:{type:Function},can:{type:Function},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},placement:{default:`pin`,type:String},size:{default:`sm`,type:String}},setup(e,{slots:t}){let{client:n,subject:r}=e;if(!e.comments&&!r)throw JD.UI_R0002({message:"CommentLayer needs a `subject`, or the `comments` state from useComments()."});let i=V(null),a=()=>{let e=i.value?.getRootNode();return e instanceof ShadowRoot?e:document},o=e.comments??oO({client:n,hotkey:e.hotkey,subject:()=>e.subject,subjectUrl:e.subjectUrl,uiRoot:a,user:()=>e.user});sO(o);let s=V([]),c=tc(null);U(()=>o.draft.value,(e,t)=>{e!==t&&(s.value=e?.files?[...e.files]:[])});let{enabled:l,prepare:u,queued:d}=_O(o,e),f=J(()=>o.user.value),p=J(()=>o.threads.value.filter(e=>o.pageThreads.value.includes(e)||o.shown.value.has(e.id)||o.leaving.value.has(e.id))),m=J(()=>p.value.filter(e=>o.shown.value.has(e.id)||o.leaving.value.has(e.id))),h=null,g=V(null),_=(e,t)=>({left:Math.min(e.x,t.clientX),top:Math.min(e.y,t.clientY),width:Math.abs(t.clientX-e.x),height:Math.abs(t.clientY-e.y)}),v=e=>{g.value=null,h=zp.has(e)||e.button!==0?null:{x:e.clientX,y:e.clientY,draw:e.pointerType!==`touch`},h?.draw&&e.target instanceof Element&&e.target.setPointerCapture?.(e.pointerId)},y=e=>{h?.draw&&(!g.value&&Math.hypot(e.clientX-h.x,e.clientY-h.y)<=ZB||(g.value=_(h,e)))},b=e=>{let t=h,n=g.value;if(h=null,g.value=null,t){if(n){let n=_(t,e),r=n.width>=$B&&n.height>=$B?qB(n):void 0;if(!r)return;e.preventDefault();try{o.startDraft(r,{area:n,point:{x:n.left,y:n.top}})}catch{}}else if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>ZB)){e.preventDefault();try{o.startDraft({x:e.clientX,y:e.clientY})}catch{}}}},x=null,S=!1;U(()=>o.opened.value&&QD(o.opened.value),e=>{e&&ol(()=>i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`)?.focus())}),U(()=>o.openId.value,(e,t)=>{if(e)return;x=null;let n=a().activeElement,r=i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`),s=o.threads.value.some(e=>e.id===t&&vz(o,e));t&&!s&&(!n||n===document.body||r?.contains(n))&&(x=t)},{flush:`pre`}),U(()=>o.openId.value,e=>{if(e||!x)return;let t=x;x=null,ol(()=>{let e=i.value?.querySelectorAll(`[data-slot='comment-pin']`)??[];S=!0,([...e].find(e=>e.getAttribute(`data-thread-id`)===t)??i.value?.querySelector(`[data-slot='comment-toolbar-mode']`))?.focus(),S=!1})},{flush:`post`});let C=null;U(()=>o.draft.value,(e,t)=>{if(e&&!t){let e=document.activeElement,t=a();C=e instanceof HTMLElement&&e!==document.body&&!(t instanceof ShadowRoot&&e===t.host)&&!i.value?.contains(e)?e:null;return}if(e||!t)return;let n=C;C=null,ol(()=>{let e=a().activeElement;n?.isConnected&&(!e||e===document.body)&&n.focus({preventScroll:!0})})},{flush:`sync`});let w=V(null),T=V(!1),E=V(0),D=()=>{E.value=w.value?.offsetWidth??0};U(()=>o.draft.value,(e,t)=>{e!==t&&(T.value=!1)});let O=typeof ResizeObserver==`function`?new ResizeObserver(()=>{D();let e=w.value;e?.parentElement?.hasAttribute(`data-above`)&&e.getBoundingClientRect().top<8&&(T.value=!0)}):void 0;U(w,(e,t)=>{t&&O?.unobserve(t),e&&O?.observe(e),D()}),Bd(()=>O?.disconnect());let k=({x:e,y:t})=>({left:`${e}px`,top:`${t}px`,"--vh-comment-x":`${e}px`}),A=Ws(new Map),ee=new Map,j=new Map,M=(e,t)=>{let n=j.get(e);n!==t&&(n&&te?.unobserve(n),j.delete(e),t&&(j.set(e,t),te?.observe(t)))},N=()=>{for(let[e,t]of ee){let n=t.querySelector(`:scope > [data-slot='comment-layer-popover']`),r=n?getComputedStyle(n).getPropertyValue(`position-area`):``;if(M(e,n&&r&&r!==`none`?n:null),!n||!r||r===`none`){A.delete(e);continue}let i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o={x:a.left+a.right<i.left*2,y:a.top+a.bottom<i.top*2},s=A.get(e);(s?.x!==o.x||s?.y!==o.y)&&A.set(e,o)}},te=typeof ResizeObserver==`function`?new ResizeObserver(N):void 0,P=0,F=()=>{P||=requestAnimationFrame(()=>{P=0,N()})};Ld(()=>{N(),window.addEventListener(`resize`,F,{passive:!0}),window.visualViewport?.addEventListener(`resize`,F,{passive:!0})});let I,ne=()=>{let e=i.value;e&&(I?I.play():I=aw(e,{items:e=>[...e.querySelectorAll(`[data-margin-key]`)],movesOnly:!0}),I.measure())};Ld(ne),zd(()=>{N(),ne()}),Bd(()=>{I?.destroy(),te?.disconnect(),cancelAnimationFrame(P),window.removeEventListener(`resize`,F),window.visualViewport?.removeEventListener(`resize`,F)});let re=e=>t=>{t instanceof HTMLElement?ee.set(e,t):(ee.delete(e),M(e,null),A.delete(e))},L=(e,t,n)=>{let r=n===void 0?void 0:A.get(n),i=r?r.x:e+JB>window.innerWidth,a=r?r.y:t+YB>window.innerHeight;return{"data-flip-x":i?`true`:void 0,"data-flip-y":a?`true`:void 0}},ie=e=>{let t=o.draft.value;if(t?.anchor.kind===`page`)return t;try{o.startDraft(`page`,e?.length?{files:e}:{})}catch{}let n=o.draft.value;return n?.anchor.kind===`page`?n:null},ae=(t,n)=>q(GD,{accept:e.accept,attachments:l.value,autofocus:!n||n.autofocus,busy:t?t.busy||c.value===t:!1,error:t?.error,guard:!n,key:n?`page-island-composer`:void 0,mentions:t?.mentions??[],modelValue:t?.body??``,onCancel:n?n.onCancel:()=>o.cancelDraft(),files:s.value,frame:`none`,layout:`row`,onSubmit:async e=>{let n=t??ie(e.files);if(!n||n.busy||c.value===n||o.draft.value!==n)return;n.error=void 0,n.mentions=e.mentions;let r=d(e.files);if(r){n.attachments=[],await o.send({files:r});return}c.value=n;let i=s.value,a=n.body,l=n.mentions;try{let{attachments:t,files:r}=await u(e.files);if(o.draft.value!==n||n.body!==a||n.mentions!==l||s.value!==i)return;n.attachments=t,await o.send({files:r})&&s.value===i&&(s.value=[])}catch(e){n.error=e instanceof Error?e.message:`The files could not be uploaded. Try again.`}finally{c.value===n&&(c.value=null)}},"onUpdate:files":e=>{t||!e.length?s.value=e:ie(e)},"onUpdate:mentions":e=>{let n=t??(e.length?ie():null);n&&(n.mentions=e)},"onUpdate:modelValue":e=>{let n=t??(e?ie():null);n&&(n.body=e)},people:f.value?[f.value]:[],size:e.size,user:f.value,users:o.users}),R=V(0),oe=()=>{R.value=window.innerWidth,D()};Ld(()=>{R.value=window.innerWidth,window.addEventListener(`resize`,oe,{passive:!0})}),Bd(()=>window.removeEventListener(`resize`,oe));let se=J(()=>e.placement===`margin`&&R.value>=eV),ce=Ws(new Map),le=new Map,ue=typeof ResizeObserver==`function`?new ResizeObserver(e=>{for(let t of e){let e=t.target.getAttribute(`data-margin-key`),n=Math.round(t.target.getBoundingClientRect().height);e&&n&&ce.get(e)!==n&&ce.set(e,n)}}):void 0;Bd(()=>ue?.disconnect());let de=e=>t=>{let n=le.get(e);n&&n!==t&&ue?.unobserve(n),t instanceof Element?(le.set(e,t),ue?.observe(t)):le.delete(e)},fe=()=>t.status?{status:t.status}:void 0,pe=()=>({...fe(),...t.actions?{actions:t.actions}:{}}),me=(t,n=!1)=>q(WB,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:l.value,can:e.can,key:QD(t),detached:o.positions.value.get(t.id)?.detached===!0,...n?{dismissible:!1,navigation:`back`}:{},readOnly:e.readOnly,size:e.size,onClose:()=>o.close(),onDelete:e=>o.remove(t.id,e),onEdit:(e,n,r)=>o.edit(t.id,e,n,r),onReopen:()=>o.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:i,files:a}=await u(r);return o.reply(t.id,e,n,i,a)},onResolve:async()=>{await o.resolve(t.id),o.close()},thread:t,user:f.value},pe()),he=(e,t)=>{let n=p.value.flatMap(t=>{let n=o.shown.value.has(t.id)?e.get(t.id):void 0;return n?[{active:o.openId.value===t.id,key:t.id,thread:t,y:n.y}]:[]});t!==void 0&&n.push({active:!0,key:lO,y:t}),n.sort((e,t)=>e.y-t.y);let r=e=>ce.get(e.key)??(e.active?YB:nV),i=[],a=-1/0;for(let e of n){let t=Math.max(e.y-16,a+tV);i.push(t),a=t+r(e)}let s=window.innerHeight-16;return n.forEach((e,t)=>{if(!(!e.active||i[t]+r(e)<=s)){i[t]=Math.max(16,s-r(e));for(let e=t-1;e>=0;e--)i[e]=Math.min(i[e],i[e+1]-tV-r(n[e]));for(let e=t+1;e<n.length;e++)i[e]=Math.max(i[e],i[e-1]+tV+r(n[e-1]))}}),{at:new Map(n.map((e,t)=>[e.key,i[t]])),node:q(`div`,{"data-slot":`comment-margin`},n.flatMap((e,t)=>{let n=e.thread;return!n||e.active?[]:[q(`button`,{"aria-label":`${wz(n)}: ${Sh(n.messages[0]?.body??``)}`,"data-margin-key":e.key,"data-slot":`comment-margin-card`,"data-status":n.status,...Ez(n.delivery),key:e.key,onClick:()=>o.open(n),onPointerenter:()=>{o.draft.value||(o.hoverId.value=n.id)},onPointerleave:()=>{o.hoverId.value===n.id&&(o.hoverId.value=null)},ref:de(e.key),style:{top:`${i[t]}px`},type:`button`},[q(gz,{thread:n})])]}))}};return()=>{let n=new Map;for(let e of m.value){let t=o.positions.value.get(e.id);if(!t||t.detached||t.clipped||e.anchor.kind===`page`)continue;let r=e=>[...n.values()].some(n=>Math.abs(n.x-t.x)<QB&&Math.abs(n.y-e)<QB),i=t.y;for(;r(i);)i+=QB;if(i!==t.y&&i>window.innerHeight-QB)for(i=t.y-QB;r(i);)i-=QB;n.set(e.id,{...t,y:i})}let r=m.value.flatMap(t=>{let r=n.get(t.id);if(!r)return[];let i=!o.shown.value.has(t.id),a=o.openId.value===t.id,s=o.hoverId.value===t.id&&!i&&!a&&!o.draft.value&&!se.value;return[q(`div`,{...L(r.x,r.y,t.id),"data-kind":t.anchor.kind,"data-leaving":i?`true`:void 0,"data-slot":`comment-layer-item`,inert:i||void 0,key:t.id,ref:re(t.id),style:k(r)},[q(Zz,{active:a,author:t.author,"data-shape":XB(t.anchor.kind),"data-thread-id":t.id,...Ez(t.delivery),excerpt:Sh(t.messages[0]?.body??``),...t.n?{number:t.n}:{},onHover:()=>{a||S||o.draft.value||(o.hoverId.value=t.id)},onLeave:()=>{o.hoverId.value===t.id&&(o.hoverId.value=null)},onSelect:()=>a?o.close():o.open(t),status:t.status}),s?q(`div`,{"data-preview":`true`,"data-slot":`comment-layer-popover`},q(WB,{preview:!0,size:e.size,thread:t},fe())):null])]}),a=o.draft.value,s=a&&o.positions.value.get(`draft`),c=a&&a.anchor.kind!==`page`?a:null,l=c&&s&&!s.detached?s:c?.point,u=!!(se.value&&c&&l),d=se.value?he(n,u?l.y:void 0):null,p=e=>{let t=d?.at.get(e);return t===void 0?void 0:{"data-margin":`true`,"data-margin-key":e,style:{top:`${t}px`}}},_=o.opened.value,x=_&&!vz(o,_)?_:void 0,C=x&&o.positions.value.get(x.id),D=x&&C&&!C.detached&&!C.clipped&&x.anchor.kind!==`page`?n.get(x.id)??C:void 0,O=x&&D?p(x.id):void 0,A=x?q(`div`,{...D?L(D.x,D.y,`opened-thread`):{},"data-kind":x.anchor.kind,"data-slot":`comment-layer-item`,key:`opened-thread`,ref:re(`opened-thread`),style:D?k(D):void 0},q(`div`,{...O,"data-floating":D?void 0:`true`,"data-slot":`comment-layer-popover`,ref:e=>O&&de(x.id)(e)},me(x))):null,ee=c&&l?KB(l,E.value,R.value):void 0,j=u?p(lO):void 0,M=c&&ee?q(`div`,{...L(ee.x,ee.y),"data-flip-x":ee.flipX?`true`:void 0,...(c.anchor.kind===`area`||c.anchor.kind===`image`)&&ee.y>72&&!T.value?{"data-above":`true`}:{},"data-draft":`true`,"data-kind":c.anchor.kind,"data-slot":`comment-layer-item`,style:k(ee)},[q(Zz,{author:f.value,"data-shape":XB(c.anchor.kind),draft:!0}),q(`div`,{...j,"data-motion-appear":j?void 0:`[data-slot=comment-pin]`,"data-slot":`comment-layer-popover`,style:j?.style??{"--vh-comment-draft-left":`${ee.left}px`},ref:e=>{w.value=e instanceof HTMLElement?e:null,j&&de(lO)(e)}},ae(c))]):null;return q(`div`,{"data-active":o.active.value?`true`:void 0,"data-comments-ui":``,"data-slot":`comment-layer`,ref:i},[o.active.value?q(`div`,{"data-slot":`comment-layer-overlay`,onPointercancel:()=>{h=null,g.value=null},onPointerdown:v,onPointermove:y,onPointerup:b},g.value?[q(`div`,{"data-slot":`comment-layer-area`,style:{left:`${g.value.left}px`,top:`${g.value.top}px`,width:`${g.value.width}px`,height:`${g.value.height}px`}},[...[`top-left`,`top-right`,`bottom-left`,`bottom-right`].map(e=>q(`span`,{"data-corner":e,"data-slot":`comment-layer-area-handle`,key:e})),q(`span`,{"data-slot":`comment-layer-area-size`},`${Math.round(g.value.width)} × ${Math.round(g.value.height)}`)])]:[]):null,...r,M,A,q(xz,{comments:o,canComment:e.canComment&&!e.readOnly},{composer:e=>[ae(e.draft,e)],thread:({thread:e})=>[me(e,!0)]}),d?.node,t.default?.({comments:o})??[q(uB,{comments:o,people:e.people}),o.listOpen.value?q(Gz,{comments:o,navigate:e.navigate}):null]])}}})}));function aV(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}var oV,sV,cV,lV=t((()=>{Y(),kw(),gO(),YD(),vO(),_z(),az(),eO(),Dz(),G_(),KD(),GB(),$w(),oV=new Set([`row`,`preview`,`group-header`,`list-actions`]),sV=(e,t)=>e.kind===t.kind&&e.id===t.id,cV=W({name:`CommentPanel`,props:{comments:{type:Object},client:{type:Object},subject:{type:Object},user:{type:Object},variant:{default:`docked`,type:String},thread:{default:void 0,type:[String,null]},status:{type:String},title:{default:`Comments`,type:String},heading:{default:!0,type:Boolean},composer:{default:!0,type:Boolean},readOnly:{default:!1,type:Boolean},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},allowEmpty:{default:!1,type:Boolean},people:{default:()=>[],type:Array},can:{type:Function},group:{type:Function}},emits:[`update:thread`,`update:status`,`select`],slots:Object,setup(e,{emit:t,slots:n}){let r=Zw(`UButton`),i=e.comments??W_();if(!i&&!e.subject)throw JD.UI_R0002({message:"CommentPanel needs a comments state: put it inside CommentLayer, pass `comments`, or pass a `subject`."});let a=cO(i??oO({client:e.client,hotkey:!1,subject:()=>e.subject,user:()=>e.user}));sO(a);let o=V(null),s=V(null),c=V(`open`),l=J(()=>e.thread===void 0?s.value:e.thread),u=J(()=>e.status??c.value),d=J(()=>a.threads.value.filter(e=>a.scope.value===`site`||sV(e.subject,a.subject.value))),f=J(()=>d.value.filter(e=>e.status===u.value)),p=$D(a.threads,l);U(p,(e,t,n)=>{e&&n(a.retainMark(e.id))},{immediate:!0,flush:`sync`}),U(p,e=>{e&&e.id!==l.value&&y(e.id)});let m=V(``),h=V([]),g=V([]),_=V(!1),v=V();function y(e){s.value=e,t(`update:thread`,e)}function b(e){c.value=e,t(`update:status`,e)}function x(e){t(`select`,e),y(e.id),ol(()=>o.value?.querySelector(`[data-slot='comment-thread']`)?.focus())}function S(){let e=p.value?.id;y(null),ol(()=>{[...o.value?.querySelectorAll(`[data-slot='comment-panel-item']`)??[]].find(t=>t.dataset.threadId===e)?.focus()})}let{enabled:C,prepare:w,queued:T}=_O(a,e),E=()=>`${a.subject.value.kind}\u0000${a.subject.value.id}`,D=0;U(E,()=>{D++,m.value=``,h.value=[],g.value=[],v.value=void 0,_.value=!1});async function O(e){if(_.value)return;let t=++D;v.value=void 0;let n={body:m.value,files:g.value,mentions:h.value},r=T(e.files);if(r){m.value=``,h.value=[],g.value=[];try{await a.create({files:r,body:e.body,mentions:e.mentions})}catch(e){if(t!==D)return;v.value=aV(e),!m.value&&!g.value.length&&(m.value=n.body,h.value=n.mentions,g.value=n.files)}}else{_.value=!0;try{let r=await w(e.files);if(t!==D)return;await a.create({...r,body:e.body,mentions:e.mentions}),t===D&&m.value===n.body&&g.value===n.files&&h.value===n.mentions&&(m.value=``,h.value=[],g.value=[])}catch(e){t===D&&(v.value=aV(e))}finally{t===D&&(_.value=!1)}}}let k=()=>Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0&&!oV.has(e))),A=J(()=>{let t=[];for(let n of f.value){let r=e.group?.(n),i=t.find(e=>e.label===r);i||t.push(i={label:r,threads:[]}),i.threads.push(n)}return t.sort((e,t)=>Number(e.label!==void 0)-Number(t.label!==void 0))}),ee=e=>q(`li`,{key:e.id},[q(`button`,{"data-focus-inset":``,"data-slot":`comment-panel-item`,"data-status":e.status,...Ez(e.delivery),"data-thread-id":e.id,onClick:()=>x(e),type:`button`},n.row?.(iz(e))??q(gz,{detached:a.positions.value.get(e.id)?.detached===!0,site:a.scope.value===`site`,thread:e},n.preview?{preview:()=>n.preview?.(iz(e))}:void 0))]),j=(e,t,n)=>q(`ol`,{"aria-label":t,"data-slot":`comment-panel-items`,key:n},e.map(ee)),M=()=>A.value.map(({label:t,threads:r})=>t===void 0?j(r,e.title,`ungrouped`):q(`section`,{"aria-label":t,"data-slot":`comment-panel-group`,key:t},[q(`h3`,{"data-slot":`comment-panel-group-header`},n[`group-header`]?.({group:t,threads:r})??t),j(r,t)])),N=()=>{let t=a.counts.value,i=(e,t,n)=>q(r,{"aria-checked":String(u.value===e),color:`neutral`,"data-slot":`comment-panel-filter`,"data-state":u.value===e?`on`:`off`,onClick:()=>b(e),onKeydown:t=>{if(![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key))return;t.preventDefault();let n=t.currentTarget.closest(`[role=radiogroup]`);b(e===`open`?`resolved`:`open`),ol(()=>n?.querySelector(`[role=radio][aria-checked=true]`)?.focus())},role:`radio`,size:`xs`,tabindex:u.value===e?0:-1,variant:u.value===e?`soft`:`ghost`},{default:()=>[`${t} `,q(Ew,{value:n})]}),o=a.status.value===`loading`&&a.threads.value.length===0?`Loading comments.`:a.status.value===`error`?`The comments could not load.`:u.value===`open`?`No open comments.`:`No resolved comments.`;return[q(`header`,{"data-slot":`comment-panel-header`},[e.heading?q(`h2`,{"data-slot":`comment-panel-title`},e.title):null,q(`div`,{"aria-label":`Filter comments`,"data-slot":`comment-panel-filters`,role:`radiogroup`},[i(`open`,`Open`,t.open),i(`resolved`,`Resolved`,t.resolved)]),n[`list-actions`]?q(`div`,{"data-slot":`comment-panel-actions`},n[`list-actions`]()):null]),f.value.length===0?q(`p`,{"data-slot":`comment-panel-empty`,role:`status`},o):e.group||A.value.some(e=>e.label!==void 0)?q(`div`,{"data-slot":`comment-panel-groups`},M()):j(f.value,e.title),e.readOnly||!e.composer?null:q(`div`,{"data-slot":`comment-panel-composer`},[q(GD,{accept:e.accept,allowEmpty:e.allowEmpty,attachments:C.value,autofocus:!1,busy:_.value,error:v.value,files:g.value,guard:!1,layout:`row`,mentions:h.value,modelValue:m.value,onSubmit:O,"onUpdate:files":e=>g.value=e,"onUpdate:mentions":e=>h.value=e,"onUpdate:modelValue":e=>m.value=e,people:e.people,placeholder:`Comment on this page`,user:a.user.value},{...n.extra?{extra:n.extra}:{},...n[`mention-item`]?{"mention-item":n[`mention-item`]}:{},...n[`mention-empty`]?{"mention-empty":n[`mention-empty`]}:{}})])]},te=t=>q(WB,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:C.value,can:e.can,detached:a.positions.value.get(t.id)?.detached===!0,dismissible:!1,key:QD(t),navigation:`back`,onClose:S,onDelete:async e=>{await a.remove(t.id,e)||S()},onEdit:(e,n,r)=>a.edit(t.id,e,n,r),onReopen:()=>a.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:i,files:o}=await w(r);return a.reply(t.id,e,n,i,o)},onResolve:()=>a.resolve(t.id),people:e.people,readOnly:e.readOnly,thread:t,user:a.user.value},k());return()=>q(`section`,{"aria-label":p.value?wz(p.value):e.title,"data-comments-ui":``,"data-slot":`comment-panel`,"data-variant":e.variant,"data-view":p.value?`thread`:`list`,ref:o},p.value?te(p.value):N())}})})),uV,dV,fV=t((()=>{Y(),iB(),$w(),uV=W({props:{hint:{required:!0,type:String},shortcut:{required:!0,type:String},side:{required:!0,type:String}},setup(e,{slots:t}){let n=Zw(`UTooltip`),r=V(!1),i=!1;return Kl(()=>{if(!(i||r.value))return r.value=!0,!1}),()=>{let a=`${e.hint} (${e.shortcut})`;return r.value?t.default?.().map(e=>Uu(e,{title:a})):q(n,{content:{side:e.side,sideOffset:8},onVnodeMounted:()=>i=!0,text:a},{content:()=>[e.hint,q(`kbd`,{"data-slot":`comment-selection-bar-kbd`},e.shortcut)],default:t.default})}}}),dV=W({name:`CommentSelectionBar`,props:{side:{default:`top`,type:String},suggest:{default:!1,type:Boolean}},emits:{comment:()=>!0,suggest:()=>!0},slots:Object,setup(e,{emit:t,slots:n}){return()=>q(rB,{...e,"data-slot":`comment-selection-bar`,tooltip:uV,onComment:()=>t(`comment`),onSuggest:()=>t(`suggest`)},n)}})})),pV=t((()=>{KD(),iV(),lV(),GB(),fB(),fV(),Dz()})),mV=t((()=>{pV()})),hV,gV=t((()=>{hV=`:host{color:canvastext;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}*,:before,:after{box-sizing:border-box}[data-slot=standalone-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-standalone-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-standalone-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-standalone-button][data-size=sm]{padding:.375rem .625rem;font-size:.75rem}[data-standalone-button][data-square=true]{padding:.375rem}[data-standalone-button][data-size=xs][data-square=true]{padding:.25rem}[data-standalone-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=primary]{background:var(--vh-primary);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=error]{background:var(--vh-error);color:var(--vh-inverted)}[data-standalone-button][data-variant=outline]{border-color:var(--vh-border)}[data-standalone-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-standalone-button][data-variant=ghost]{color:var(--vh-muted)}[data-standalone-button]:is([data-variant=ghost],[data-variant=outline],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-standalone-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-standalone-button].rounded-full{border-radius:9999px}[data-standalone-button][aria-busy=true]{opacity:.6}[data-standalone-button]:disabled{cursor:default;opacity:.4}[data-slot=standalone-modal-trigger]{display:contents}[data-slot=standalone-modal]{background:color-mix(in oklab, var(--vh-bg-elevated) 75%, transparent);pointer-events:auto;z-index:2147483002;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}[data-slot=standalone-modal]>[role=dialog]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);overflow:auto}`})),_V,vV=t((()=>{_V=`@layer theme,base,comark;@layer components{:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}[data-slot=status]{align-items:center;gap:.375rem;min-width:0;font-size:.75rem;line-height:1rem;display:inline-flex}[data-slot=status][data-size=md]{font-size:.875rem;line-height:1.25rem}[data-slot=status][data-colored][data-tone=success]{color:var(--vh-text-success,var(--vh-success))}[data-slot=status][data-colored][data-tone=warning]{color:var(--vh-text-warning,var(--vh-warning))}[data-slot=status][data-colored][data-tone=error]{color:var(--vh-text-error,var(--vh-error))}[data-slot=status][data-colored][data-tone=info]{color:var(--vh-text-info,var(--vh-info))}@keyframes status-pulse{50%{opacity:.35}}@keyframes copy-button-spin{to{transform:rotate(360deg)}}[data-slot=message][data-align]{gap:.5rem;width:100%;min-width:0;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}[data-slot=message][data-align=end]{flex-direction:row-reverse}:is([data-slot=message-header],[data-slot=message-footer]){color:var(--vh-muted);align-items:center;min-width:0;max-width:100%;padding-inline:.75rem;font-size:.75rem;font-weight:500;line-height:1rem;display:flex}[data-slot=message][data-align]:is(:has([data-variant=ghost]),:not(:has([data-slot=bubble]))) :is([data-slot=message-header],[data-slot=message-footer]){padding-inline:0}[data-slot=bubble]{flex-direction:column;gap:.25rem;width:fit-content;min-width:0;max-width:80%;display:flex;position:relative}:is([data-slot=bubble][data-align=end],[data-slot=message][data-align=end] [data-slot=bubble]){align-self:flex-end}[data-slot=bubble][data-variant=ghost]{max-width:100%}[data-slot=bubble][data-variant=soft][data-tone=info]{--vh-bubble-tone:var(--vh-info)}[data-slot=bubble][data-variant=soft][data-tone=success]{--vh-bubble-tone:var(--vh-success)}[data-slot=bubble][data-variant=soft][data-tone=warning]{--vh-bubble-tone:var(--vh-warning)}[data-slot=bubble][data-variant=soft][data-tone=error]{--vh-bubble-tone:var(--vh-error)}[data-slot=attachment]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);flex-wrap:wrap;flex-shrink:0;width:fit-content;min-width:0;max-width:100%;transition:background-color .15s,border-color .15s;display:flex;position:relative}[data-slot=attachment]:has(>a,>button):hover{background:color-mix(in oklab, var(--vh-bg-elevated) 50%, var(--vh-bg))}[data-slot=attachment][data-status=error]{border-color:color-mix(in oklab, var(--vh-error) 30%, transparent)}[data-slot=attachment][data-status=idle]{border-style:dashed}[data-slot=attachment][data-size=md]{gap:.5rem;font-size:.875rem;line-height:1.25rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-media]){padding:.5rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-content]){padding:.5rem .625rem}[data-slot=attachment][data-size=sm]{gap:.625rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-media]){padding:.375rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-content]){padding:.375rem .5rem}[data-slot=attachment][data-size=xs]{border-radius:var(--vh-radius);gap:.375rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-media]){padding:.25rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-content]){padding:.25rem .375rem}[data-slot=attachment][data-orientation=horizontal]{align-items:center;min-width:10rem}[data-slot=attachment][data-orientation=vertical]{flex-direction:column;width:6rem}[data-slot=attachment][data-orientation=vertical]:has([data-slot=attachment-content]){width:7.5rem}[data-slot=attachment-media]{aspect-ratio:1;background:var(--vh-bg-elevated);border-radius:var(--vh-radius);color:var(--vh-highlighted);flex-shrink:0;justify-content:center;align-items:center;width:2.5rem;display:flex;position:relative;overflow:hidden}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media]{width:100%}[data-slot=attachment][data-size=sm] [data-slot=attachment-media]{width:2rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media]{border-radius:calc(var(--vh-radius) * .75);width:1.75rem}[data-slot=attachment][data-status=error] [data-slot=attachment-media]{background:color-mix(in oklab, var(--vh-error) 10%, transparent);color:var(--vh-error)}[data-slot=attachment-media] svg{pointer-events:none}[data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1rem;height:1rem}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1.5rem;height:1.5rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:.875rem;height:.875rem}[data-slot=attachment-media][data-kind=image]{opacity:.6}[data-slot=attachment]:is([data-status=done],[data-status=idle]) [data-slot=attachment-media][data-kind=image]{opacity:1}[data-slot=attachment-media][data-kind=image]>img{aspect-ratio:1;object-fit:cover;width:100%}[data-slot=attachment-content]{flex:1;min-width:0;max-width:100%;line-height:1.25}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-content]{padding-inline:.25rem}[data-slot=attachment-title]{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;font-weight:500;display:block;overflow:hidden}[data-slot=attachment-description]{color:var(--vh-muted);text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;margin-top:.125rem;font-size:.75rem;line-height:1rem;display:block;overflow:hidden}[data-slot=attachment][data-status=error] [data-slot=attachment-description]{color:color-mix(in oklab, var(--vh-error) 80%, transparent)}[data-slot=attachment-actions]{z-index:20;flex-shrink:0;align-items:center;display:flex;position:relative}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-actions]{gap:.25rem;position:absolute;top:.75rem;right:.75rem}[data-slot=attachment-action]{border-radius:calc(var(--vh-radius) * .75);color:var(--vh-text);cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;padding:.25rem;transition:color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=attachment-action]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}@media (hover:hover){[data-slot=attachment-action]:hover:not(:disabled){background:var(--vh-bg-elevated)}}[data-slot=attachment-action]:active:not(:disabled){background:var(--vh-bg-elevated)}[data-slot=attachment-action]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent)}[data-slot=attachment-action]:disabled{cursor:not-allowed;opacity:.5}[data-slot=attachment-trigger]{border-radius:inherit;cursor:pointer;z-index:10;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=attachment-group]{overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;gap:.75rem;min-width:0;padding-block:.25rem;scroll-padding-inline:.25rem;display:flex;overflow-x:auto}[data-slot=attachment-group]>[data-slot=attachment]{scroll-snap-align:start;flex:none}[data-slot=prompt-input]{width:100%}[data-slot=prompt-input-group]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 2);flex-direction:column;min-width:0;display:flex}[data-slot=prompt-input-attachments]{padding:.5rem .5rem 0}[data-slot=prompt-input-textarea]{color:var(--vh-highlighted);field-sizing:content;font:inherit;resize:none;background:0 0;border:0;width:100%;min-height:3.5rem;max-height:12rem;padding:.75rem .875rem .25rem;font-size:.875rem;line-height:1.5rem}@media (any-pointer:coarse){[data-slot=prompt-input-textarea]{font-size:max(1rem,16px)}}[data-slot=prompt-input-textarea]::placeholder{color:var(--vh-muted)}[data-slot=prompt-input-toolbar]{align-items:center;gap:.375rem;min-width:0;padding:.25rem .5rem .5rem;display:flex}[data-slot=prompt-input-spacer]{flex:1}@media (pointer:coarse){[data-slot=prompt-input-toolbar] button{position:relative}[data-slot=prompt-input-toolbar] button:before{content:"";position:absolute;inset:-8px}}[data-slot=prompt-input-attach],[data-slot=prompt-input-submit]{color:var(--vh-text);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:9999px;flex-shrink:0;justify-content:center;align-items:center;padding:.375rem;font-weight:500;transition-property:color,background-color,border-color,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=prompt-input-attach]>*,[data-slot=prompt-input-submit]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}[data-slot=prompt-input-attach]:focus-visible,[data-slot=prompt-input-submit]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent);outline-offset:0}[data-slot=prompt-input-attach]:disabled,[data-slot=prompt-input-submit]:disabled{cursor:not-allowed;opacity:.5}[data-slot=prompt-input-attach][data-variant=outline]{background:var(--vh-bg);box-shadow:inset 0 0 0 1px var(--vh-border-accented)}[data-slot=prompt-input-attach][data-variant=outline]:not(:disabled):hover{background:var(--vh-bg-elevated)}[data-slot=prompt-input-attach][data-variant=ghost]{color:var(--vh-muted)}[data-slot=prompt-input-attach][data-variant=ghost]:not(:disabled):hover{background:var(--vh-bg-elevated);color:var(--vh-text)}[data-slot=prompt-input-submit][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-slot=prompt-input-submit][data-variant=solid]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-highlighted) 90%, transparent)}[data-slot=prompt-input-submit][data-variant=soft]{background:var(--vh-bg-elevated)}[data-slot=prompt-input-submit][data-variant=soft]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-bg-accented) 75%, transparent)}[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation:1s linear infinite vh-prompt-input-spin}@media (prefers-reduced-motion:reduce){[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation-duration:3s}}[data-slot=swap-icon-item][data-spin]>*{animation:1s linear infinite swap-icon-spin}@keyframes swap-icon-spin{to{transform:rotate(360deg)}}@keyframes sync-status-pulse{50%{opacity:.35}}@keyframes connection-status-pulse{50%{opacity:.35}}[data-slot=progress]{color:var(--vh-highlighted);align-items:center;gap:.5rem;min-width:0;display:flex}[data-slot=drop-field]{--vh-drop-dot:var(--vh-highlighted);background:var(--vh-bg);border:1px solid var(--vh-border-accented);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;text-align:center;align-content:center;justify-items:center;gap:.125rem;min-height:10rem;padding:1rem;display:grid;overflow:hidden}[data-slot=drop-field][data-disabled]{cursor:not-allowed;opacity:.6}[data-slot=hold-to-delete] [data-part=icon]{flex:none;display:inline-flex}[data-slot=hold-to-delete] [data-part=icon]>svg{overflow:visible}[data-slot=hold-to-delete] [data-part=icon] [data-part=lid]{rotate:var(--vh-hold-lid,none);transform-box:fill-box;transform-origin:0 100%}[data-slot=hold-to-delete]{background:var(--vh-bg);border:1px solid color-mix(in oklch, var(--vh-error) calc(var(--vh-hold,0) * 100%), var(--vh-border-accented));border-radius:calc(var(--vh-radius) * .75);color:var(--vh-highlighted);cursor:pointer;justify-content:flex-start;align-items:center;gap:.375rem;height:1.75rem;padding:0 .625rem;font-size:.75rem;font-weight:500;display:inline-flex;overflow:visible}[data-slot=hold-to-delete][data-status=undo]{border-color:color-mix(in oklch, var(--vh-error) 40%, var(--vh-border-accented))}[data-slot=hold-to-delete][data-icon-only]:not([data-status=undo]){border-color:#0000;justify-content:center;width:1.75rem;padding:0}[data-slot=avatar-stack]{--vh-avatar-size:2rem;isolation:isolate;align-items:center;display:inline-flex}[data-slot=avatar-stack][data-size=sm]{--vh-avatar-size:1.5rem}[data-slot=avatar-stack][data-size=lg]{--vh-avatar-size:2.5rem}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){background:var(--vh-bg-accented);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-highlighted);font-size:calc(var(--vh-avatar-size) * .4);height:var(--vh-avatar-size);-webkit-user-select:none;user-select:none;width:var(--vh-avatar-size);border-radius:9999px;flex:none;justify-content:center;align-items:center;font-weight:500;line-height:1;display:inline-flex;overflow:hidden}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * -.15)}[data-slot=avatar-stack-count]{color:var(--vh-muted);font-size:calc(var(--vh-avatar-size) * .34)}[data-slot=avatar-stack][data-variant=outline] [data-slot=avatar-stack-item]{box-shadow:0 0 0 2px var(--vh-bg), 0 0 0 4px var(--vh-avatar-color,var(--vh-border))}[data-slot=avatar-stack][data-variant=outline] :is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * .05)}[data-slot=avatar-stack-image]{object-fit:cover;width:100%;height:100%}:is([data-slot=marker],[data-slot=marker-separator]){color:var(--vh-muted);text-align:left;align-items:center;gap:.5rem;width:100%;min-height:1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}:is([data-slot=marker],[data-slot=marker-separator]) :is(svg,.iconify):not([class*=size-]),[data-slot=marker-icon]{flex-shrink:0;width:1rem;height:1rem}:is(a[data-slot=marker],[data-slot=marker-content]>a){color:inherit;text-underline-offset:3px;text-decoration:underline}@media (hover:hover){:is(a[data-slot=marker],[data-slot=marker-content]>a):hover{color:var(--vh-highlighted)}}[data-slot=marker-separator]:before,[data-slot=marker-separator]:after{background:var(--vh-border);content:"";flex:1;min-width:0;height:1px}[data-slot=marker-separator]:before{margin-right:.25rem}[data-slot=marker-separator]:after{margin-left:.25rem}[data-slot=marker][data-variant=outline]{border-bottom:1px solid var(--vh-border);padding-bottom:.5rem}[data-slot=marker-content]{overflow-wrap:break-word;min-width:0}[data-slot=marker-separator] [data-slot=marker-content]{text-align:center;flex:none}[data-slot=tooltip-content]{border-radius:calc(var(--vh-radius) * .75);text-wrap:balance;max-width:20rem;font-size:.75rem;line-height:1rem}:is([data-slot=relative-time],[data-slot=comment-reply-time]){font-variant-numeric:tabular-nums}:is([data-slot=filter-search-leading],[data-slot=filter-search-trailing]){align-items:center;display:flex;position:absolute;inset-block:0}@keyframes vh-filter-search-spin{to{transform:rotate(360deg)}}:is([data-slot=code-view],[data-slot=file-diff],[data-slot=file-view],[data-slot=multi-file-diff],[data-slot=patch-diff],[data-slot=unresolved-file]){box-sizing:content-box;--diffs-addition-base:var(--vh-success);--diffs-bg:var(--vh-bg);--diffs-bg-addition:color-mix(in oklab, var(--vh-success) 12%, var(--vh-bg));--diffs-bg-addition-emphasis:color-mix(in oklab, var(--vh-success) 22%, var(--vh-bg));--diffs-bg-buffer:var(--vh-bg-muted);--diffs-bg-context:var(--vh-bg);--diffs-bg-context-gutter:color-mix(in oklab, var(--vh-bg-muted) 72%, var(--vh-bg));--diffs-bg-deletion:color-mix(in oklab, var(--vh-error) 12%, var(--vh-bg));--diffs-bg-deletion-emphasis:color-mix(in oklab, var(--vh-error) 22%, var(--vh-bg));--diffs-bg-separator:var(--vh-bg-muted);--diffs-deletion-base:var(--vh-error);--diffs-fg:var(--vh-text);--diffs-fg-conflict-marker:var(--vh-muted);--diffs-fg-number:var(--vh-dimmed);--diffs-font-family:var(--font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);--diffs-font-size:.8125rem;--diffs-header-font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);--diffs-modified-base:var(--vh-info);background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-text);min-height:4rem;display:block;overflow:hidden}:is([data-slot=markdown-editor-content],.vh-markdown-editor-content) .ProseMirror{outline:none;min-height:100%}:is([data-slot=editor-suggestion-label],[data-slot=editor-suggestion-description]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=comment-layer]{pointer-events:none;z-index:2147483000;position:fixed;inset:0}[data-slot=comment-layer]>*{pointer-events:auto}[data-slot=comment-layer-overlay]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M2 26V14a12 12 0 1 1 12 12H2z' fill='%23fff' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") 2 26,crosshair;position:absolute;inset:0}[data-slot=comment-layer-area-size]{background:color-mix(in oklab, var(--vh-comment-mark), black 10%);color:var(--vh-on-media,white);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:.25rem;padding:.0625rem .3125rem;font:500 .6875rem/1rem ui-monospace,SFMono-Regular,Menlo,monospace;position:absolute;top:calc(100% + .375rem);left:-2px}[data-slot=comment-margin]{pointer-events:none;width:18rem;position:absolute;top:0;right:1rem}[data-slot=comment-margin-card]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));box-sizing:border-box;color:var(--vh-text);font:inherit;pointer-events:auto;text-align:start;border:0;font-size:.875rem;position:absolute;left:0;right:0}button[data-slot=comment-margin-card]{cursor:pointer;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;display:flex}button[data-slot=comment-margin-card]:hover{background:var(--vh-bg-elevated)}button[data-slot=comment-margin-card][data-status=resolved]{opacity:.65}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{z-index:1;width:18rem;position:fixed;bottom:auto;left:auto;right:1rem}[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{flex-direction:column;max-height:calc(100dvh - 2rem);display:flex}[data-slot=comment-layer-popover][data-margin=true]>[data-slot=comment-thread]{flex-direction:column;flex:auto;min-height:0;display:flex}[data-slot=comment-layer-popover][data-margin=true] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}[data-slot=comment-margin-card] [data-slot=comment-list-text]{-webkit-line-clamp:3}[data-slot=comment-layer-item]{pointer-events:none;position:absolute}[data-slot=comment-layer-item]>*{pointer-events:auto}[data-slot=comment-pin]{translate:0 -100%}[data-slot=comment-pin] [data-slot=avatar-stack]{--vh-avatar-size:var(--vh-comment-pin-size);border-radius:inherit}[data-slot=comment-pin] [data-slot=avatar-stack-item]{border-radius:inherit;box-shadow:none;color:inherit;font-size:inherit;font-weight:inherit;background:0 0}[data-slot=comment-pin-number]{background:var(--vh-highlighted);color:var(--vh-inverted);text-align:center;border-radius:9999px;min-width:1rem;padding:.15rem .25rem;font-size:.625rem;font-weight:600;line-height:1;position:absolute;top:-.4rem;right:-.4rem}[data-slot=comment-selection-bar]{--vh-selection-bar-text:color-mix(in oklab, var(--vh-inverted) 82%, var(--vh-highlighted));background:var(--vh-highlighted);border:1px solid color-mix(in oklab, var(--vh-inverted) 12%, transparent);-webkit-font-smoothing:antialiased;border-radius:12px;align-items:center;gap:4px;width:max-content;padding:4px;font-size:12px;font-weight:500;line-height:1;display:flex;box-shadow:0 8px 24px oklab(0% none none/.25)}[data-slot=comment-selection-bar-action]{color:var(--vh-selection-bar-text);cursor:pointer;font:inherit;touch-action:manipulation;white-space:nowrap;background:0 0;border:0;border-radius:8px;align-items:center;gap:6px;height:28px;padding:0 10px;transition-property:background-color,color;transition-duration:.15s;transition-timing-function:cubic-bezier(.23,1,.32,1);display:inline-flex;position:relative}[data-slot=comment-selection-bar-action]:before{content:"";position:absolute;inset:-8px -2px}[data-slot=comment-selection-bar-action]>:first-child{flex:none;width:1.1em;height:1.1em}@media (hover:hover) and (pointer:fine){[data-slot=comment-selection-bar-action]:hover{background:color-mix(in oklab, var(--vh-inverted) 8%, transparent);color:var(--vh-inverted)}}[data-slot=comment-selection-bar-kbd]{font:inherit;opacity:.6;margin-inline-start:6px}[data-slot=comment-layer-popover]{--vh-comment-card-width:22.5rem;background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);max-width:calc(100vw - 1rem);width:var(--vh-comment-card-width);font-size:.875rem;position:absolute;top:.5rem;left:.5rem;overflow:visible}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]{left:auto;right:clamp(calc(var(--vh-comment-x,0px) + .5rem - 100vw), .5rem, calc(var(--vh-comment-x,100vw) - min(var(--vh-comment-card-width), 100vw - 1rem) - .5rem))}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]{top:auto;bottom:2.5rem}[data-slot=comment-layer-popover]:not([data-margin],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){--vh-comment-card-radius:1rem;--vh-comment-card-width:21.25rem;flex-direction:column;max-height:min(28rem,60dvh);display:flex;&>[data-slot=comment-thread]{flex:auto;min-height:0}& [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:.375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) .375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}[data-slot=comment-layer-item][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}@position-try --vh-comment-above{margin:0 0 2.5rem .5rem;position-area:top right}@position-try --vh-comment-above-left{margin:0 .5rem 2.5rem 0;position-area:top left}@position-try --vh-comment-below-inside{margin:.5rem .5rem 0;position-area:bottom span-all}@position-try --vh-comment-above-inside{margin:0 .5rem 2.5rem;position-area:top span-all}@supports (anchor-name:--a){[data-slot=comment-layer-item]{anchor-name:--vh-comment-spot;anchor-scope:--vh-comment-spot}[data-slot=comment-layer-item]:not([data-draft])>[data-slot=comment-layer-popover]:not([data-margin],[data-floating]){position-anchor:--vh-comment-spot;position-area:bottom right;position-try-fallbacks:flip-inline, --vh-comment-above, --vh-comment-above-left, --vh-comment-below-inside, --vh-comment-above-inside;margin:.5rem 0 0 .5rem;position:fixed;inset:auto}}[data-slot=comment-layer-popover][data-preview=true]{pointer-events:none;width:18rem}[data-slot=comment-layer-popover][data-floating=true]{position:fixed;inset:auto 1rem 4.5rem auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]{--vh-bubble-edge:var(--vh-border);--vh-bubble-radius:1.4375rem;border-radius:.375rem var(--vh-bubble-radius) var(--vh-bubble-radius);left:var(--vh-comment-draft-left,.5rem);box-shadow:0 0 0 1px var(--vh-bubble-edge), 0 2px 4px color-mix(in oklab, var(--vh-comment-shadow) calc(100% / 3), transparent), 0 10px 24px -6px var(--vh-comment-shadow);border:0;width:18rem;right:auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]:has(>[data-slot=comment-composer][data-size=sm]){--vh-bubble-radius:1.125rem}[data-slot=comment-layer-popover]:has([data-slot=comment-composer][data-frame=none] [data-slot=prompt-input-textarea]:focus-visible){--vh-bubble-edge:color-mix(in oklab, var(--vh-highlighted) 22%, transparent)}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) .375rem var(--vh-bubble-radius) var(--vh-bubble-radius)}[data-slot=comment-layer-item][data-draft=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer]>[data-slot=comment-page-island]{pointer-events:none;left:0;right:0;top:var(--vh-comment-island-top,max(12px, env(safe-area-inset-top)));place-items:start center;display:grid;position:fixed;&>*{grid-area:1/1}}[data-slot=comment-page-island-card]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);pointer-events:auto;border-radius:1rem;flex-direction:column;max-width:calc(100vw - 1.5rem);font-size:.875rem;line-height:1.25rem;display:flex}[data-slot=comment-page-island-card][data-open]{border-radius:.75rem;width:min(21.25rem,100vw - 1.5rem)}@media (hover:hover) and (pointer:fine){[data-slot=comment-page-island-card]:not([data-open]):hover{background:var(--vh-bg-elevated)}}[data-slot=comment-page-island-trigger]{color:inherit;cursor:pointer;font:inherit;font-variant-numeric:tabular-nums;text-align:start;white-space:nowrap;background:0 0;border:0;border-radius:1rem;flex:none;align-items:center;gap:.375rem;height:2rem;padding:0 .75rem 0 .4375rem;font-weight:500;display:flex;overflow:clip;&>svg,&>[data-slot=icon]{flex:none;width:1rem;height:1rem;margin-inline-start:.0625rem}}[data-slot=comment-page-island-label]{text-overflow:ellipsis;min-width:0;overflow:hidden}[data-slot=comment-page-island-faces]{flex:none;display:flex;& [data-slot=avatar-stack]{--vh-avatar-size:1.125rem}}[data-slot=comment-page-island-content]{flex-direction:column;min-height:0;max-height:min(26rem,60dvh - 2rem);display:flex;&>*{border-block-start:1px solid var(--vh-border)}&>[data-slot=comment-thread]{flex:auto;min-height:0}&>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-page-island-items]{flex:0 auto;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto;&>li:last-child>[data-slot=comment-page-island-item]{border-block-end:0}}[data-slot=comment-page-island-composer]{flex:none}[data-slot=comment-composer]{align-items:flex-start;gap:.5rem;padding:.5rem;display:flex}[data-slot=comment-composer-box]{flex:1;min-width:0;position:relative}[data-slot=comment-composer] [data-slot=prompt-input-textarea]{min-height:2.25rem;padding-block:.5rem .125rem}[data-slot=comment-composer][data-shake=flash] [data-slot=prompt-input-group]{animation:.45s both vh-comment-flash}@keyframes vh-comment-flash{0%,60%{border-color:var(--vh-error);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-error) 25%, transparent)}}[data-slot=comment-composer-mentions]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));z-index:1;width:100%;margin:.25rem 0 0;padding:.25rem;list-style:none;position:absolute;top:100%;left:0}[data-slot=comment-composer-mention]{border-radius:calc(var(--vh-radius) * .75);cursor:pointer;padding:.375rem .5rem}[data-slot=comment-composer-mention][aria-selected=true]{background:var(--vh-bg-accented)}[data-slot=comment-composer-mention-empty]{color:var(--vh-muted);margin:0;padding:.375rem .5rem}[data-slot=comment-composer-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-composer-status]{color:var(--vh-muted);margin:0;font-size:.75rem}[data-slot=comment-composer-status]:not(:empty){padding:.25rem .625rem .125rem}[data-slot=comment-thread]{flex-direction:column;display:flex}[data-slot=comment-thread-header]{border-block-end:1px solid var(--vh-border);align-items:center;gap:.25rem;padding:.375rem .5rem .375rem .75rem;display:flex}@media (pointer:coarse){:is([data-slot=comment-thread-header],[data-slot=comment-reply-actions])>:is(button,a){justify-content:center;min-width:2.75rem;min-height:2.75rem}}[data-slot=comment-thread-title]{color:var(--vh-highlighted);font-weight:600}[data-slot=comment-thread-spacer]{flex:1}[data-slot=comment-thread-messages]{flex-direction:column;max-height:22rem;display:flex;overflow-y:auto}[data-slot=comment-thread-quote]{border-inline-start:2px solid var(--vh-border);color:var(--vh-muted);margin:.75rem .75rem 0;padding-inline-start:.625rem}:is([data-slot=comment-thread-detached],[data-slot=comment-thread-count]){color:var(--vh-muted);margin:.5rem .75rem 0;font-size:.75rem}[data-slot=comment-reply]{gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-reply-content]{flex:1;min-width:0}[data-slot=comment-reply-header]{flex-wrap:wrap;align-items:center;gap:.375rem;min-height:1.5rem;display:flex}[data-slot=comment-reply-header]>[data-slot=avatar-stack]{margin-inline-end:.125rem}[data-slot=comment-reply-content]>:not([data-slot=comment-reply-header]){margin-inline-start:2rem}[data-slot=comment-reply-author]{color:var(--vh-highlighted);font-weight:500}:is([data-slot=comment-reply-time],[data-slot=comment-reply-edited]){color:var(--vh-muted);font-size:.75rem}[data-slot=comment-reply-body]{overflow-wrap:anywhere}[data-slot=comment-reply-actions]{opacity:0;transition:opacity .12s;display:flex}[data-slot=comment-reply]:is(:hover,:focus-within) [data-slot=comment-reply-actions]{opacity:1}@media (any-pointer:coarse){[data-slot=comment-reply-actions]{opacity:1}}[data-slot=comment-reply][data-compact=true] [data-slot=comment-reply-body]{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-reply][data-editing=true] [data-slot=comment-composer]{padding:.25rem 0 0}[data-slot=comment-thread]:has([data-slot=comment-reply][data-editing=true])>[data-slot=comment-composer]{display:none}[data-slot=comment-toolbar]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));border-radius:9999px;align-items:center;gap:.25rem;padding:.25rem;display:flex;position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}[data-slot=comment-filters]{flex-wrap:wrap;gap:.25rem;display:flex}[data-slot=comment-list]{background:var(--vh-bg);border-inline-start:1px solid var(--vh-border);color:var(--vh-text);flex-direction:column;width:20rem;max-width:100vw;font-size:.875rem;display:flex;position:fixed;top:0;bottom:0;right:0;overflow-y:auto}[data-slot=comment-list-header]{border-block-end:1px solid var(--vh-border);flex-direction:column;gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-list-scopes]{gap:.25rem;display:flex}[data-slot=comment-list-empty]{color:var(--vh-muted);margin:0;padding:1rem .75rem}[data-slot=comment-list-items]{margin:0;padding:0;list-style:none}[data-slot=comment-list-item]{border-block-end:1px solid var(--vh-border);color:inherit;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;text-decoration:none;display:flex}[data-slot=comment-list-item]:is(:hover,[aria-current=true]){background:var(--vh-bg-elevated)}[data-slot=comment-list-item][data-status=resolved]{opacity:.65}[data-slot=comment-list-number]{color:var(--vh-muted);flex:none;min-width:1.25rem;padding-top:.25rem;font-size:.75rem}[data-slot=comment-list-body]{flex-direction:column;flex:1;gap:.125rem;min-width:0;display:flex}[data-slot=comment-list-text]{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-list-meta]{color:var(--vh-muted);flex-wrap:wrap;gap:.25rem .5rem;font-size:.75rem;display:flex}[data-slot=comment-reply-confirm]{flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}[data-slot=comment-reply-confirm]>p{flex-basis:100%;margin:0}[data-slot=comment-reply-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-mention]{background:var(--vh-comment-mention-bg,color-mix(in oklab, var(--vh-bg-accented) 80%, transparent));border-radius:calc(var(--vh-radius) * .5);color:var(--vh-highlighted);padding:0 .125rem;font-weight:500}[data-slot=comment-mention][data-self=true]{background:var(--vh-comment-mention-self-bg,color-mix(in oklab, var(--vh-warning) 25%, transparent))}[data-slot=comment-composer-extra]{margin-block-end:.375rem}[data-slot=comment-composer-mention]{align-items:center;gap:.5rem;display:flex}[data-slot=comment-composer-mention] [data-slot=avatar-stack]{--vh-avatar-size:1.25rem}[data-slot=comment-composer][data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 20%, transparent)}[data-slot=comment-composer] [data-slot=prompt-input-attachments]{flex-wrap:wrap;gap:.375rem;overflow:visible}[data-slot=comment-reply-attachments]{flex-wrap:wrap;margin-top:.5rem}[data-slot=comment-panel-groups]{flex:1;min-height:0;overflow-y:auto}[data-slot=comment-panel-groups] [data-slot=comment-panel-items]{flex:none;overflow:visible}[data-slot=comment-panel-group-header]{border-block-start:1px solid var(--vh-border);color:var(--vh-muted);margin:0;padding:.75rem .75rem .25rem;font-size:.75rem;font-weight:500}[data-slot=comment-reply-images]{gap:.25rem;margin-top:.5rem;display:grid;&[data-count="1"]{display:flex}&[data-count="2"]{grid-template-rows:7rem;grid-template-columns:1fr 1fr}&[data-count="3"]{grid-template-rows:4.75rem 4.75rem;grid-template-columns:2fr 1fr;&>[data-slot=comment-reply-image]:first-child{grid-row:span 2}}&[data-count="4"]{grid-template-rows:5.25rem 5.25rem;grid-template-columns:1fr 1fr}}[data-slot=comment-reply-image]{appearance:none;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * .75);color:var(--vh-muted);cursor:zoom-in;min-width:0;padding:0;display:flex;position:relative;overflow:hidden;& img{object-fit:cover;width:100%;height:100%;display:block}&[data-open=true]{visibility:hidden}}[data-count="1"]>[data-slot=comment-reply-image]{max-width:100%;& img{width:auto;max-width:100%;height:auto;max-height:10rem}}[data-slot=comment-reply-image-more]{background:color-mix(in oklab, var(--vh-highlighted) 55%, transparent);color:var(--vh-inverted);font-variant-numeric:tabular-nums;place-items:center;font-size:.9375rem;font-weight:500;display:grid;position:absolute;inset:0}[data-slot=comment-image-stack]{flex:none;align-self:flex-end;width:2.5rem;height:2rem;position:relative;&:not(:has([data-slot=comment-image-stack-card])){display:none}}[data-slot=comment-image-stack-cards]{position:absolute;inset:0}[data-slot=comment-image-stack-card]{--vh-stack-near:clamp(0, var(--vh-stack-depth), 2);background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .75);box-shadow:0 0 0 2px var(--vh-bg), 0 1px 3px color-mix(in oklab, var(--vh-highlighted) 18%, transparent);height:1.75rem;left:calc(.125rem + var(--vh-stack-near) * .1875rem);opacity:clamp(0, 3 - var(--vh-stack-depth), 1);top:calc(.25rem - var(--vh-stack-near) * .1875rem);width:1.75rem;z-index:calc(10 - var(--vh-stack-near));position:absolute;& .vh-image-preview{border-radius:inherit}& [data-slot=comment-image-stack-remove]{visibility:hidden;position:absolute;top:-.375rem;right:-.375rem}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-cards]{--vh-fan-width:min(var(--vh-fan-room), calc(var(--vh-fan-count) * 4rem + .5rem));box-sizing:border-box;bottom:100%;inset-inline:auto;left:clamp(var(--vh-fan-left), -.5rem, calc(var(--vh-fan-left) + var(--vh-fan-room) - var(--vh-fan-width)));width:var(--vh-fan-width);z-index:20;gap:.5rem;padding:.5rem;display:flex;top:auto;&[data-scrollable=true]{overflow-x:auto}&[data-below]{top:100%;bottom:auto}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-card]{opacity:1;z-index:auto;flex:none;width:3.5rem;height:3.5rem;position:relative;top:auto;left:auto;& [data-slot=comment-image-stack-remove]{visibility:visible}}[data-slot=comment-image-stack-toggle]{appearance:none;border-radius:calc(var(--vh-radius) * .75);cursor:pointer;z-index:15;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=comment-image-stack-count]{background:var(--vh-highlighted);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-inverted);font-variant-numeric:tabular-nums;pointer-events:none;text-align:center;z-index:16;border-radius:9999px;min-width:1.125rem;height:1.125rem;padding:0 .3125rem;font-size:.6875rem;font-weight:600;line-height:1.125rem;transition:opacity .15s;position:absolute;top:-.25rem;right:-.25rem}[data-fanned=true]>[data-slot=comment-image-stack-count]{opacity:0}[data-slot=comment-composer][data-layout=row][data-multiline=true] [data-slot=comment-image-stack]{order:1}[data-slot=comment-thread-actions]{align-items:center;gap:.25rem;display:flex}[data-slot=comment-thread-after]{padding:0 .75rem .75rem}[data-slot=comment-panel]{background:var(--vh-bg);color:var(--vh-text);flex-direction:column;min-height:0;font-size:.875rem;display:flex}[data-slot=comment-panel][data-variant=docked]{border-inline-start:1px solid var(--vh-border);height:100%}[data-slot=comment-panel][data-variant=floating]{border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));width:min(22.5rem,100vw - 1rem);max-height:min(36rem,100dvh - 2rem);overflow:hidden}[data-slot=comment-panel-header]{border-block-end:1px solid var(--vh-border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .5rem .5rem .75rem;display:flex}[data-slot=comment-panel-title]{color:var(--vh-highlighted);font-size:inherit;margin:0;font-weight:600}[data-slot=comment-panel-filters]{flex-wrap:wrap;flex:1;gap:.25rem;display:flex}[data-slot=comment-panel-actions]{flex-wrap:wrap;align-items:center;gap:.25rem;margin-block:-.25rem;display:flex}[data-slot=comment-panel-actions]:empty{display:none}[data-slot=comment-panel-items]{flex:1;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]){border:0;border-block-end:1px solid var(--vh-border);color:inherit;cursor:pointer;font:inherit;text-align:start;background:0 0;align-items:flex-start;gap:.5rem;width:100%;padding:.625rem .75rem;display:flex}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]):hover{background:var(--vh-bg-elevated)}[data-slot=comment-panel-empty]{color:var(--vh-muted);flex:1;margin:0;padding:1rem .75rem}[data-slot=comment-panel-composer],[data-slot=comment-thread]>[data-slot=comment-composer]{border-block-start:1px solid var(--vh-border)}[data-slot=comment-composer][data-layout=row]{padding:.25rem;& [data-slot=prompt-input-group]{box-shadow:none;background:0 0;border-color:#0000;border-radius:calc(1.125rem + 1px);flex-flow:wrap;align-items:flex-end;gap:.25rem;padding:.125rem}& [data-slot=prompt-input-attachments]{flex-basis:100%;padding:.25rem .25rem 0}& [data-slot=prompt-input-textarea]{flex:1;order:1;width:auto;min-width:0;min-height:2rem;padding:.25rem}& [data-slot=prompt-input-toolbar]{display:contents}& [data-slot=prompt-input-spacer]{display:none}& [data-slot=prompt-input-toolbar]>button:last-child{order:2}& [data-slot=prompt-input-toolbar]>button{justify-content:center;min-width:2rem;height:2rem}}[data-slot=comment-thread][data-size=sm]{font-size:.875rem;line-height:1.25rem}[data-slot=comment-thread][data-size=sm] [data-slot=comment-thread-quote]{margin-top:.5rem}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer]{border-block-start:0;& [data-slot=prompt-input-group]{background:var(--vh-bg-elevated);box-shadow:none;border-color:#0000}}[data-slot=comment-reply][data-size=sm]{padding:.5rem .75rem;position:relative;& [data-slot=comment-reply-header]{align-items:baseline}& [data-slot=comment-reply-header]>[data-slot=avatar-stack]{align-self:center}& [data-slot=comment-reply-author]{font-size:.875rem;line-height:1.5rem}& [data-slot=comment-reply-body]{--vh-typeset-leading:1.5;font-size:.875rem}}@media not (any-pointer:coarse){[data-slot=comment-reply][data-size=sm] [data-slot=comment-reply-actions]{background:var(--vh-bg);border-radius:var(--vh-radius);position:absolute;top:.375rem;right:.5rem}}[data-slot=comment-composer][data-size=sm] [data-slot=prompt-input-textarea]{min-height:2rem;padding:.375rem .625rem 0}[data-slot=comment-composer][data-size=sm][data-layout=row]{& [data-slot=prompt-input-group]{border-radius:calc(1rem + 1px)}& [data-slot=prompt-input-textarea]{min-height:1.75rem;padding:.21875rem .25rem;line-height:1.3125rem}& [data-slot=prompt-input-toolbar]>button{min-width:1.75rem;height:1.75rem}}[data-slot=comment-composer][data-layout=row][data-multiline=true]{& [data-slot=prompt-input-group]{row-gap:0}& [data-slot=prompt-input-attachments]{padding-bottom:.25rem}& [data-slot=prompt-input-textarea]{flex-basis:100%;order:0;padding-block-end:0;padding-inline:.5rem}& [data-slot=prompt-input-spacer]{display:block}@media (pointer:coarse){& [data-slot=prompt-input-toolbar]>button:before{inset-block-start:0}}}[data-slot=comment-panel-composer] [data-slot=comment-composer-mentions],[data-slot=comment-thread]>[data-slot=comment-composer] [data-slot=comment-composer-mentions]{margin:0 0 .25rem;top:auto;bottom:100%}[data-slot=comment-panel]>[data-slot=comment-thread]{flex:1;min-height:0}[data-slot=comment-panel]>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:1;max-height:none}[data-comment-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-comment-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-comment-button][data-size=sm]{font-size:.75rem}[data-comment-button][data-square]{padding:.375rem}[data-comment-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-comment-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-comment-button][data-variant=ghost]{color:var(--vh-muted)}[data-comment-button]:is([data-variant=ghost],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-comment-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-comment-button]:disabled{cursor:default;opacity:.4}[data-slot=comment-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-slot=message-scroller]{flex-direction:column;width:100%;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}[data-slot=message-scroller-viewport]{overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;width:100%;min-width:0;height:100%;min-height:0;overflow-y:auto}[data-slot=message-scroller-content]{flex-direction:column;gap:1.5rem;height:max-content;min-height:100%;display:flex}[data-slot=message-scroller-item]{flex-shrink:0;min-width:0}[data-slot=message-scroller-button]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;justify-content:center;align-items:center;width:2rem;height:2rem;transition:background-color .15s;display:flex;position:absolute;bottom:1rem;left:50%;transform:translate(-50%)}@media (hover:hover){[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated)}}[data-slot=message-scroller-button][hidden]{display:none}[data-slot=chat]{grid-template-rows:minmax(0,1fr);width:100%;min-width:0;height:100%;min-height:0;display:grid;position:relative;overflow:hidden}[data-slot=chat]>[data-slot=message-scroller-viewport]{overscroll-behavior-y:contain}[data-slot=chat]>[data-slot=message-scroller-viewport]>[data-slot=message-scroller-content]{max-width:48rem;padding:var(--vh-chat-content-padding,1.5rem 1rem 6rem);gap:1.25rem;margin-inline:auto}[data-slot=chat]>[data-slot=message-scroller-button]{background:var(--vh-bg-elevated);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-muted);font:inherit;letter-spacing:normal;white-space:nowrap;z-index:2;border:0;border-radius:999px;gap:.375rem;width:auto;padding:.25rem .75rem;font-size:.75rem;font-weight:500;line-height:1rem;transition:color .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out}[data-slot=chat]>[data-slot=message-scroller-button]>svg{flex:none;width:.875rem;height:.875rem}@media (hover:hover){[data-slot=chat]>[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated);color:var(--vh-text)}}[data-slot=chat]:has(>[data-slot=chat-composer])>[data-slot=message-scroller-button]{bottom:var(--vh-chat-scroll-button-offset,7rem)}@media (prefers-reduced-motion:reduce){[data-slot=chat]>[data-slot=message-scroller-viewport]{scroll-behavior:auto}}[data-slot=trace]{flex-direction:column;gap:.5rem;width:100%;min-width:0;display:flex}[data-slot=trace]>:has(>[data-slot=trace-line]){border-radius:calc(var(--vh-radius) * .75);text-align:left;width:fit-content;min-width:0;max-width:100%;display:flex}[data-trace-chevron] svg{stroke:currentColor;stroke-width:2px}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]){color:var(--vh-muted);cursor:pointer;height:var(--vh-agent-control);width:var(--vh-agent-control);background:0 0;border:0;border-radius:.5rem;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .15s ease-out,color .15s ease-out;display:inline-flex}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])>*{width:1rem;height:1rem}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]):hover{background:var(--vh-agent-hover);color:var(--vh-text)}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])[aria-pressed=true]{background:var(--vh-agent-pressed);color:var(--vh-highlighted)}.collaboration-carets__caret{pointer-events:none;word-break:normal;border-inline:1px solid;margin-inline:-1px;position:relative}.collaboration-carets__label{border-radius:calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) 0;color:var(--vh-inverted);inset-inline-start:-1px;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:.0625rem .375rem;font-size:.75rem;font-style:normal;font-weight:600;line-height:1.25;position:absolute;top:-1.4em}.vh-image-preview{appearance:none;aspect-ratio:4/3;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-muted);cursor:zoom-in;vertical-align:top;justify-content:center;align-items:center;width:13rem;max-width:100%;padding:0;display:inline-flex;overflow:hidden}.vh-image-preview img{object-fit:cover;width:100%;height:100%;display:block}.vh-image-preview--compact{aspect-ratio:1;border:0;width:100%;height:100%}.vh-image-unavailable{overflow-wrap:anywhere;padding:.5rem;font-size:.75rem}.vh-image-dialog__toolbar{color:var(--vh-on-media,var(--vh-highlighted));border:0;flex:none;align-items:center;gap:.25rem;padding-bottom:.5rem;display:flex}.vh-image-dialog__name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.75rem;overflow:hidden}.vh-image-dialog__image{border-radius:var(--vh-radius);object-fit:contain;max-width:92vw;max-height:calc(92dvh - 3rem);display:block}.vh-image-gallery__body{display:contents}.vh-image-gallery .vh-image-dialog__toolbar{transition:opacity .15s;&[data-closing=true]{opacity:0}}.vh-image-gallery__count{color:var(--vh-on-media,var(--vh-muted));font-variant-numeric:tabular-nums;opacity:.8;white-space:pre;margin-inline-end:.25rem;font-size:.75rem;display:inline-flex}.vh-image-gallery__stage{justify-content:center;display:flex;position:relative}.vh-image-gallery__step{z-index:1;border-radius:9999px;position:absolute;top:50%;transform:translateY(-50%);&.vh-image-gallery__step--previous{left:.5rem}&.vh-image-gallery__step--next{right:.5rem}}.vh-image-dialog__error{background:var(--vh-media-scrim,var(--vh-bg-elevated));border-radius:var(--vh-radius);color:var(--vh-on-media,var(--vh-highlighted));max-width:24rem;padding:2rem;font-size:.875rem}[data-slot=invocation] [data-activity-id][data-selected=true]{background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .85);scroll-margin-block:5rem}[data-slot=visually-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:where(:root,[class^=vh-ws-],[class*=\\ vh-ws-]){--vh-ws-font-mono:var(--font-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace);--vh-ws-code-bg:var(--vh-bg);--vh-ws-code-fg:var(--vh-highlighted);--vh-ws-code-cursor:var(--vh-highlighted);--vh-ws-code-selection:color-mix(in oklab, var(--vh-highlighted) 14%, transparent);--vh-ws-code-line:color-mix(in oklab, var(--vh-highlighted) 4%, transparent);--vh-ws-code-gutter:var(--vh-dimmed);--vh-ws-code-gutter-active:var(--vh-text);--vh-ws-code-comment:var(--vh-dimmed);--vh-ws-code-punctuation:var(--vh-muted);--vh-ws-terminal-bg:var(--vh-ws-code-bg);--vh-ws-terminal-fg:var(--vh-text);--vh-ws-ink:var(--ui-text-highlighted,CanvasText);--vh-ws-ink-inverted:var(--ui-bg,Canvas);--vh-ws-accent:var(--vh-focus,var(--ring,var(--vh-highlighted)))}:is(.vh-ws-preview-path,.vh-ws-input) input{font-family:var(--vh-ws-font-mono)}@keyframes vh-ws-pulse{50%{opacity:.35}}:where(.vh-ws-guide-content)>:where(p,ul,ol,blockquote){max-width:62ch;margin:0 0 10px}:where(.vh-ws-guide-content) :where(code:not(pre code)){background:var(--vh-bg-elevated);font:.75rem var(--vh-ws-font-mono);border-radius:4px;padding:1px 4px}}@layer utilities;:where([data-focus-ring]):has(:focus-visible){outline:2px solid var(--vh-focus,var(--vh-primary));outline-offset:2px}[data-slot=comment-composer][data-layout=row]{& [data-slot=prompt-input-textarea]:focus-visible{outline:none}&:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){border-color:color-mix(in oklab, var(--vh-highlighted) 22%, transparent);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-highlighted) 6%, transparent)}&[data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 14%, transparent)}&[data-size=sm]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none}}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer][data-layout=row]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){background:var(--vh-bg);border-color:var(--vh-border-accented)}[data-slot=comment-composer][data-frame=none]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none;border-color:#0000}@keyframes vh-prompt-input-spin{to{transform:rotate(360deg)}}[data-markdown-image] [data-markdown-image-action]{border-radius:calc(var(--vh-radius) / 2);color:var(--vh-on-media,var(--vh-highlighted));cursor:pointer;font:inherit;background:0 0;border:0;flex:none;justify-content:center;align-items:center;width:2rem;height:2rem;margin:0;padding:0;text-decoration:none;display:inline-flex}[data-markdown-image] [data-markdown-image-action] svg{width:1rem;height:1rem}@media (hover:hover){[data-markdown-image] [data-markdown-image-action]:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}}:where(:root,[data-slot],[class^=vh-],[class*=\\ vh-]){--vh-radius:var(--vh-ui-radius,calc(var(--ui-radius,.25rem) * 2));--vh-border:var(--vh-ui-border,var(--ui-border,color-mix(in oklab, currentColor 14%, transparent)));--vh-border-accented:var(--vh-ui-border-accented,var(--ui-border-accented,color-mix(in oklab, currentColor 24%, transparent)));--vh-muted:var(--vh-ui-muted,var(--ui-text-muted,color-mix(in oklab, currentColor 68%, transparent)));--vh-dimmed:var(--vh-ui-dimmed,var(--ui-text-dimmed,color-mix(in oklab, currentColor 68%, transparent)));--vh-text:var(--vh-ui-text,var(--ui-text,currentColor));--vh-bg:var(--vh-ui-bg,var(--ui-bg,Canvas));--vh-bg-muted:var(--vh-ui-bg-muted,var(--ui-bg-muted,color-mix(in oklab, Canvas 94%, currentColor)));--vh-bg-elevated:var(--vh-ui-bg-elevated,var(--ui-bg-elevated,color-mix(in oklab, Canvas 96%, currentColor)));--vh-bg-accented:var(--vh-ui-bg-accented,var(--ui-bg-accented,color-mix(in oklab, Canvas 90%, currentColor)));--vh-highlighted:var(--vh-ui-highlighted,var(--ui-text-highlighted,currentColor));--vh-inverted:var(--vh-ui-inverted,var(--ui-text-inverted,Canvas));--vh-primary:var(--vh-ui-primary,var(--ui-primary,var(--vh-highlighted)));--vh-ring:var(--vh-ui-ring,color-mix(in oklab, var(--vh-primary) 50%, transparent));--vh-error:var(--vh-ui-error,var(--ui-error,var(--vh-highlighted)));--vh-info:var(--vh-ui-info,var(--ui-info,var(--vh-highlighted)));--vh-success:var(--vh-ui-success,var(--ui-success,var(--vh-highlighted)));--vh-warning:var(--vh-ui-warning,var(--ui-warning,var(--vh-highlighted)))}.vh-image-overlay{background:rgb(from var(--vh-media-scrim,var(--vh-bg-elevated)) r g b / 80%);z-index:59;transition:opacity .15s}.vh-image-overlay--closing{opacity:0}.vh-image-dialog{box-shadow:none;z-index:60;background:0 0;border-radius:0;width:max-content;max-width:92vw;max-height:92dvh;overflow:visible}.vh-image-dialog__action{color:var(--vh-on-media,var(--vh-highlighted));flex:none}.vh-image-dialog__action:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}[data-slot=comment-image-stack-remove]{background:var(--vh-highlighted);box-shadow:0 1px 3px color-mix(in oklab, var(--vh-highlighted) 10%, transparent), 0 1px 2px -1px color-mix(in oklab, var(--vh-highlighted) 10%, transparent);color:var(--vh-inverted);border:0;border-radius:9999px;place-items:center;width:1.25rem;min-width:0;height:1.25rem;padding:0;display:grid;& :is(svg,.iconify){width:.75rem;height:.75rem}}`}));function yV(e){return typeof e==`string`&&e?e:void 0}function bV(e){let t=yV(e?.__name)??yV(e?.name);return t?{name:t}:void 0}function xV(){let e=[];for(let t of document.querySelectorAll(`[data-v-app], #__nuxt, #app`))t._vnode&&e.push(t);return e}function SV(e){let t=new Map,n=(e,r,i)=>{if(!e||typeof e!=`object`||i>4e3)return;let a=e;if(a.component){let e=bV(a.component.type);n(a.component.subTree,e?[...r,e]:r,i+1)}else if(a.el&&!t.has(a.el)&&t.set(a.el,r),a.suspense?.activeBranch&&n(a.suspense.activeBranch,r,i+1),Array.isArray(a.children))for(let e of a.children)n(e,r,i+1)};for(let e of xV())n(e._vnode,[],0);for(let n=e;n;n=n.parentElement){let e=t.get(n);if(e)return e.slice(-12)}return[]}function CV(){for(let e of xV()){let t=e.__vue_app__?.config?.globalProperties?.$router?.currentRoute?.value?.matched,n=t?.length?yV(t.at(-1)?.path):void 0;if(n)return n}}function wV(e,t){if(t===`a`)return e.hasAttribute(`href`)?`link`:void 0;if(t===`select`)return e.hasAttribute(`multiple`)||Number(e.getAttribute(`size`))>1?`listbox`:`combobox`;if(t===`input`){let t=e.getAttribute(`type`)?.toLowerCase()??`text`;switch(t){case`checkbox`:return`checkbox`;case`radio`:return`radio`;case`button`:case`submit`:case`reset`:case`image`:return`button`;case`range`:return`slider`;case`number`:return`spinbutton`;case`hidden`:case`password`:case`file`:case`color`:case`date`:case`datetime-local`:case`month`:case`time`:case`week`:return;default:{let n=e.getAttribute(`list`);return n&&e.ownerDocument.getElementById(n)?.localName===`datalist`?`combobox`:t===`search`?`searchbox`:`textbox`}}}return Object.hasOwn(DV,t)?DV[t]:void 0}function TV(e){let t=e.tagName.toLowerCase(),n={tag:t};e.id&&(n.id=e.id.slice(0,128));let r=e.closest(`[data-testid], [data-test], [data-cy]`),i=r?.getAttribute(`data-testid`)??r?.getAttribute(`data-test`)??r?.getAttribute(`data-cy`);i&&(n.testId=i.slice(0,128));let a=e.getAttribute(`role`)??wV(e,t);a&&(n.role=a.slice(0,64));let o=e.getAttribute(`aria-label`)??e.getAttribute(`alt`)??e.getAttribute(`title`)??e.textContent?.replace(/\s+/g,` `).trim();o&&(n.name=o.slice(0,120));let s=[...e.classList].slice(0,8).map(e=>e.slice(0,64));return s.length&&(n.classes=s),n}function EV(e){let t=new URL(location.href),n={url:`${t.origin}${t.pathname}`.slice(0,2048),environment:{viewport:{width:innerWidth,height:innerHeight},devicePixelRatio,userAgent:navigator.userAgent.slice(0,512),language:navigator.language,colorScheme:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}};document.title&&(n.title=document.title.slice(0,256));let r=CV();if(r&&(n.route=r.slice(0,256)),e){n.element=TV(e);let t=SV(e);t.length&&(n.components=t)}return n}var DV,OV=t((()=>{DV={button:`button`,h1:`heading`,h2:`heading`,h3:`heading`,h4:`heading`,h5:`heading`,h6:`heading`,img:`img`,nav:`navigation`,textarea:`textbox`}}));function kV(e){let t,n,r=0;async function i(i){r++;let a=t;if(!a)return;t=void 0,n?.();let{element:o,field:s,page:c,digest:l,original:u,initial:d}=a;o.contentEditable=`inherit`,o.removeAttribute(`data-vitehub-editing`);let f=(o.textContent??``).trim();if(!i){o.textContent=u;return}if(f===d.trim())return;let[p]=await ka.saveField({field:s,value:f,ifDigest:l},c);if(p)return o.textContent=u,e.failed(p);e.drafted(s),e.info(`Saved as a draft. Publish it in the Console.`)}async function a(a){let o=i(!0),s=r;if(await o,s!==r||!a.isConnected)return;let c=a.getAttribute(to);if(!c)return;let l=e.page(),[u,d]=await ka.field(c,l);if(s!==r||!a.isConnected)return;if(u)return e.failed(u);if(!d.editable||d.value===null){e.info(`This field is not plain text. Edit it in the Console.`);return}t={element:a,field:c,page:l,digest:d.digest,original:a.textContent??``,initial:d.value},a.textContent=d.value,a.setAttribute(`data-vitehub-editing`,``),a.contentEditable=`plaintext-only`,a.contentEditable!==`plaintext-only`&&(a.contentEditable=`true`),a.focus();let f=document.createRange();f.selectNodeContents(a),getSelection()?.removeAllRanges(),getSelection()?.addRange(f);let p=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),i(!0)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(!1))},m=()=>void i(!0);a.addEventListener(`keydown`,p),a.addEventListener(`blur`,m,{once:!0}),n=()=>{a.removeEventListener(`keydown`,p),a.removeEventListener(`blur`,m)}}return{start:a,finish:i,get element(){return t?.element}}}var AV=t((()=>{ro()}));function jV(e){let t=V(),n=e?.getRootNode(),r=(n instanceof ShadowRoot&&n.host instanceof HTMLElement?n.host:e)?.parentElement;if(!r)return t;let i=0,a=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{t.value=r.getAttribute(`edge`)===`top`&&!r.hidden?`${Math.round(r.getBoundingClientRect().bottom)+MV}px`:void 0})},o=new MutationObserver(a),s=typeof ResizeObserver==`function`?new ResizeObserver(a):void 0;return Ld(()=>{o.observe(r,{attributeFilter:[`edge`,`collapsed`,`hidden`,`style`]}),s?.observe(r),r.addEventListener(`transitionend`,a),addEventListener(`resize`,a,{passive:!0}),a()}),Bd(()=>{o.disconnect(),s?.disconnect(),r.removeEventListener(`transitionend`,a),removeEventListener(`resize`,a),cancelAnimationFrame(i)}),t}var MV,NV=t((()=>{Y(),MV=8})),PV=n({createContext:()=>nH,destroyContext:()=>CH,domToBlob:()=>HH,domToCanvas:()=>VH,domToDataUrl:()=>UH,domToForeignObjectSvg:()=>zH,domToImage:()=>GH,domToJpeg:()=>KH,domToPixel:()=>qH,domToPng:()=>JH,domToSvg:()=>WH,domToWebp:()=>YH,loadMedia:()=>XV,waitUntilLoad:()=>ZV});function FV(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function IV(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function LV(e){let t=-1;eU||=IV();for(let n=0;n<e.length;n++)t=eU[(t^e[n])&255]^t>>>8;return t^-1}function RV(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===XH&&e[n-2]===ZH&&e[n-1]===QH&&e[n]===$H)return n-3;return 0}function zV(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=XH,r[1]=ZH,r[2]=QH,r[3]=$H,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=LV(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=RV(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function BV(e){let t=e.indexOf(tU);return t===-1&&(t=e.indexOf(nU)),t===-1&&(t=e.indexOf(rU)),t}function VV(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}function HV(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(aU&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!aU)return e;let n=UV().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function UV(e){return(e&&_U(e)?e?.ownerDocument:e)??window.document}function WV(e,t,n){let r=UV(n).createElementNS(IU,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function GV(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function KV(e,t=`image/png`,n=1){try{return await new Promise((r,i)=>{e.toBlob(e=>{e?r(e):i(Error(`Blob is null`))},t,n)})}catch(r){if(sU)return qV(e.toDataURL(t,n));throw r}}function qV(e){let[t,n]=e.split(`,`),r=t.match(/data:(.+);/)?.[1]??void 0,i=window.atob(n),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e+=1)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function JV(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}function YV(e,t){let n=UV(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function XV(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?YV(e,UV(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),TU(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?XV(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=yU(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(wU(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(wU(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function ZV(e,t){xU(e)&&(wU(e)||TU(e)?await XV(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>XV(e,t)))))}function QV(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}function $V(e){let t=`${iU}[#${BU}]`;return BU++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&PU(...t)}}function eH(e){return{cache:e?`no-cache`:`force-cache`}}async function tH(e,t){return pU(e)?e:nH(e,{...t,autoDestruct:!0})}async function nH(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(aU?window.document:void 0),c=e.ownerDocument?.defaultView??(aU?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:eH(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:$V(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:rH(s),svgDefsElement:s?.createElementNS(IU,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:oU&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[VV(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await ZV(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=iH(e,u);return u.width=d,u.height=f,u}function rH(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
151
|
+
`)}function ym(e){return vm(e,1/0)}function bm(e,t){let n=fm(t),r=t=>{let r=new URL(Sm);return r.searchParams.set(`prompt`,vm(e,t)),n&&r.searchParams.set(`repo`,n),r.href},i=[1/0];for(let e=2e3;e>=wm;e=Math.floor(e/2))i.push(e);for(let t of[...i,`titles`,...e.agent?[`ids`]:[]]){let e=r(t);if(e.length<=8e3)return e}}function xm(e){let{agent:t,threads:n,url:r}=e;if(!t)return ym(e);let i=new URL(r),a=n.length===1?`a comment`:`${n.length} comments`,o=t.project.name?`"${t.project.name}" (${new URL(t.project.url).host})`:new URL(t.project.url).host,s=n.map(e=>e.id);return[`I left ${a} on ${i.href}`,`In the ViteHub Console, open app ${o} through the ViteHub MCP (${t.mcp}): find it with list_apps (id: ${t.project.id}, team ${t.project.teamId}; if it is missing, ask me to switch team), then call read_operation with the app id, operation "comments.get", and input { threadId } for each ID in ${JSON.stringify(s)}.`,t.resolve?`Fix each comment, then resolve it with run_operation, the app id, operation "comments.resolve", and input { threadId, reply }. Say what you changed in the reply.`:`Fix each comment and tell me what you changed.`].join(`
|
|
152
|
+
`)}var Sm,Cm,wm,Tm=t((()=>{Sm=`https://app.t3.codes/new`,Cm=/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/,wm=40}));function Em(e,t){return t>0?rh(Math.round(e/t*1e3)):0}function Dm(e){return e.nodeType===9?e:e.ownerDocument}function Om(e){let t=e.getRootNode();return t.nodeType===11?t:Dm(e)??document}function km(e){return`"${e.replace(/["\\]/g,`\\$&`)}"`}function Am(e,t){if(t===`:scope`&&e.nodeType===1)return[e];try{return[...e.querySelectorAll(t)]}catch{return[]}}function jm(e,t,n){let r=Am(e,t);return r.length===1&&r[0]===n}function Mm(e){if(ih.some(t=>t.test(e)))return!0;let t=e.replace(/\D/g,``).length;return e.length>=6&&t/e.length>.5}function Nm(e,t){let n=[],r=e.getAttribute(`data-comment-id`);r&&n.push(`[data-comment-id=${km(r)}]`);let i=e.getAttribute(`id`);i&&!Mm(i)&&n.push(/^[A-Za-z][\w-]*$/.test(i)?`#${i}`:`[id=${km(i)}]`);let a=e.getAttribute(`data-testid`);return a&&n.push(`[data-testid=${km(a)}]`),n.find(n=>jm(t,n,e))}function Pm(e){let t=e.localName,n=e.parentElement;if(!n)return t;let r=[...n.children].filter(e=>e.localName===t);return r.length>1?`${t}:nth-of-type(${r.indexOf(e)+1})`:t}function Fm(e,t=Om(e)){if(e===t)return`:scope`;let n=Nm(e,t);if(n)return n;let r=[],i=e;for(;i&&i!==t;){let n=i===e?void 0:Nm(i,t);r.unshift(n??Pm(i));let a=r.join(` > `);if(n||jm(t,a,e))return a;i=i.parentElement}return r.join(` > `)}function Im(e){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}function Lm(e,t){let n=t.root,r=n?.nodeType===11?n:n&&Dm(n)||document;return(typeof r.elementsFromPoint==`function`?r.elementsFromPoint(e.x,e.y):[r.elementFromPoint(e.x,e.y)]).find(e=>e!==null&&(!n||n.contains(e))&&!t.ignore?.(e))}function Rm(e,t=[]){for(let n of e.childNodes)n.nodeType===3?t.push(n):n.nodeType===1&&Rm(n,t);return t}function zm(e,t,n){let r=0,i=t.nodeType===3?void 0:t.childNodes[n];for(let a of Rm(e)){if(t.nodeType===3){if(a===t)return r+n}else if(i?a===i||i.compareDocumentPosition(a)&ah:!t.contains(a)&&t.compareDocumentPosition(a)&ah)break;r+=a.data.length}return r}function Bm(e){return`rangeCount`in e?e.rangeCount>0&&!e.isCollapsed?e.getRangeAt(0):void 0:e.collapsed?void 0:e}function Vm(e){return e.nodeType===1?e:e.parentElement}function Hm(e,t){let n=Bm(e),r=n?.toString()??``,i=n&&Vm(n.commonAncestorContainer);if(!n||!i||r===``)throw Mi.COMMENTS_R0001({target:`an empty selection`});let a=Um(i,t)??i;if(t.root&&(!t.root.contains(n.startContainer)||!t.root.contains(n.endContainer)||!t.root.contains(a)))throw Mi.COMMENTS_R0001({target:`a selection outside the configured root`});let o=zm(a,n.startContainer,n.startOffset),s=Rm(a).map(e=>e.data).join(``),c=t.context??nh;return{kind:`text`,selector:Fm(a,t.root??Om(a)),exact:r,prefix:s.slice(Math.max(0,o-c),o),suffix:s.slice(o+r.length,o+r.length+c)}}function Um(e,t){let n=e;for(;n&&t.ignore?.(n);)n=n.parentElement;return n??void 0}function Wm(e){return e.localName===`img`}function Gm(e,t,n){if(t.root&&!t.root.contains(e))throw Mi.COMMENTS_R0001({target:`an element outside the configured root`});let r=Im(e),i=Fm(e,t.root??Om(e)),a=Wm(e)?`image`:void 0;if(t.area){let e=Em(t.area.left-r.left,r.width),n=Em(t.area.top-r.top,r.height),o={selector:i,x:e,y:n,width:Math.max(0,Em(t.area.left+t.area.width-r.left,r.width)-e),height:Math.max(0,Em(t.area.top+t.area.height-r.top,r.height)-n)};if(o.width>0&&o.height>0)return a?{kind:a,...o}:{kind:`area`,...o}}let o=n?Em(n.x-r.left,r.width):500,s=n?Em(n.y-r.top,r.height):500;return a?{kind:a,selector:i,x:o,y:s}:{kind:`element`,selector:i,x:o,y:s}}function Km(e,t={}){if(e===`page`)return{kind:`page`};if(`nodeType`in e)return Gm(e,t,t.point);if(`rangeCount`in e||`startContainer`in e)return Hm(e,t);let n=Lm(e,t);if(!n)throw Mi.COMMENTS_R0001({target:`the point ${Math.round(e.x)}, ${Math.round(e.y)}`});return Gm(n,t,e)}function qm(e,t){let n=[];for(let r=e.indexOf(t.exact);r!==-1;r=e.indexOf(t.exact,r+1)){let i=e.slice(0,r),a=e.slice(r+t.exact.length),o=0;for(;o<t.prefix.length&&i.at(-1-o)===t.prefix.at(-1-o);)o++;let s=0;for(;s<t.suffix.length&&a[s]===t.suffix[s];)s++;n.push({start:r,score:o+s,ambiguous:!1})}if(n.length===1)return n[0];let r=Math.min(oh,t.prefix.length+t.suffix.length),i=n.reduce((e,t)=>!e||t.score>e.score?t:e,void 0);if(!(!i||r===0||i.score<r))return{...i,ambiguous:n.filter(e=>e.score===i.score).length>1}}function Jm(e,t,n){let r=0;for(let i of e){let e=r+i.data.length;if(n?t>r&&t<=e:t>=r&&t<e)return{node:i,offset:t-r};r=e}let i=e.at(-1);return i&&t===r?{node:i,offset:i.data.length}:void 0}function Ym(e){return e.width>0||e.height>0}function Xm(e){let t=Dm(e)?.defaultView;for(let n=e;n;n=n.parentElement){let e=t?.getComputedStyle(n).display??`block`;if(!e.startsWith(`inline`)&&e!==`contents`)return n}return e}function Zm(e,t){let n=Rm(t),r=qm(n.map(e=>e.data).join(``),e);if(!r)return;let i=r.start,a=Jm(n,i,!1),o=Jm(n,i+e.exact.length,!0),s=Im(t),c=s,l=s;if(a&&o){let e=(Dm(t)??document).createRange();if(e.setStart(a.node,a.offset),e.setEnd(o.node,o.offset),typeof e.getBoundingClientRect==`function`){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();Ym({left:t,top:n,width:r,height:i})&&(c={left:t,top:n,width:r,height:i})}let n=(typeof e.getClientRects==`function`?[...e.getClientRects()].filter(Ym):[]).at(-1);l=n?{left:n.left,top:n.top,width:n.width,height:n.height}:c}if(!Ym(c))return;let u=Dm(t)?.defaultView,d=Im(Xm(t)),f=Math.min(Math.max(d.left+d.width,l.left+l.width)+sh,(u?.innerWidth??1/0)-ch),p=l.top+l.height/2;return{position:{clipped:$m(t,l.left+Math.max(0,l.width-1),p),detached:!1,kind:`text`,x:f,y:p,width:c.width,height:c.height,element:t},score:r.score,ambiguous:r.ambiguous}}function Qm(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function $m(e,t,n){let r=e.ownerDocument.defaultView;if(!r)return!1;for(let i=Qm(e);i;i=Qm(i)){let{overflow:e,overflowX:a,overflowY:o}=r.getComputedStyle(i);if(![e,a,o].some(e=>e!==``&&e!==`visible`))continue;let s=Im(i);if(Ym(s)&&(t<s.left-1||t>s.left+s.width+1||n<s.top-1||n>s.top+s.height+1))return!0}return!1}function eh(e,t=document){let n;for(let r of Am(t,e.selector)){let t=Rm(r),i=qm(t.map(e=>e.data).join(``),e),a=i&&Jm(t,i.start,!1),o=i&&Jm(t,i.start+e.exact.length,!0);if(!i||!a||!o)continue;if(n&&i.score===n.score){n.ambiguous=!0;continue}if(n&&i.score<n.score)continue;let s=(Dm(r)??document).createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n={range:s,score:i.score,ambiguous:i.ambiguous}}return n&&!n.ambiguous?n.range:void 0}function th(e,t=document){if(e.kind===`page`)return{clipped:!1,detached:!1,kind:`page`,x:0,y:0,width:0,height:0};let n=Am(t,e.selector);if(e.kind===`text`){let t;for(let r of n){let n=Zm(e,r);n&&(!t||n.score>t.score)?t=n:n&&t&&n.score===t.score&&(t.ambiguous=!0)}return t&&!t.ambiguous?t.position:{detached:!0}}let r=n.length===1?n[0]:void 0;if(!r)return{detached:!0};let i=Im(r);if(!Ym(i))return{detached:!0};let a=`width`in e&&e.width?e.width/1e3*i.width:0,o=`height`in e&&e.height?e.height/1e3*i.height:0,s=i.left+e.x/1e3*i.width,c=i.top+e.y/1e3*i.height;return{clipped:$m(r,s,c),detached:!1,kind:e.kind,x:s,y:c,width:a,height:o,element:r}}var nh,rh,ih,ah,oh,sh,ch,lh=t((()=>{Ni(),nh=32,rh=e=>Math.min(1e3,Math.max(0,e)),ih=[/^:[\w-]+:$/,/^«[^»]*»$/,/^_r_[\w-]+_$/,/^radix-/,/^headlessui-/,/^reka-/,/^v-\d/,/^data-v-/,/^ember\d/,/^[\da-f-]{8,}$/i],ah=4,oh=4,sh=8,ch=30}));function uh(e){return e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase()}var dh=t((()=>{}));function fh(e){for(let t of[e.files,e.deferredFiles])t&&!Array.isArray(t)&&t.catch(()=>{});return e}async function ph({files:e,deferredFiles:t,...n}){return t?{...n,files:[...e??[],...await t]}:{...n,...e?{files:await e}:{}}}function mh(e={}){let t=e.transport??da({base:um(),guest:Gi}),n=new Set,r=new Map,i=new Set,a=new Set,o=new Set,s=[],c=`idle`,l,u=e.query??{},d=0,f=()=>!e.user&&!!(u.mine||u.mentions),p=()=>{for(let e of n)e()},m=(t,n=!1)=>{let r=e.user;return u.subject&&(t.subject.kind!==u.subject.kind||t.subject.id!==u.subject.id)||u.subjectKind!==void 0&&t.subject.kind!==u.subjectKind||u.page!==void 0&&(t.subject.kind!==`page`||t.subject.id!==u.page)||u.revision&&(t.revision===void 0||t.revision>u.revision.lte)||u.status&&t.status!==u.status||r&&u.mine&&t.author.id!==r.id||r&&u.mentions&&!t.messages.some(e=>e.mentions.includes(r.id))?!1:n?!(u.mentions&&!r):!(f()&&!i.has(t.id))},h=()=>{let e=[...r.values()],{server:t,local:n}=S?S.overlay(e):{server:e,local:[]};s=[...t.filter(e=>m(e)).sort((e,t)=>e.n-t.n),...n.filter(e=>m(e,!0))],p()},g=e=>{let t=r.get(e.id);return o.has(e.id)||t&&t.updatedAt>e.updatedAt?t??e:(r.set(e.id,e),a.add(e.id),h(),f()&&C(),e)},_=e=>{o.add(e),a.delete(e),r.delete(e)&&h()},v=new Map,y=async(e,t)=>{let n=v.get(e),r=(async()=>(await n?.catch(()=>void 0),t()))();v.set(e,r);try{return await r}finally{v.get(e)===r&&v.delete(e)}},b=async()=>{let e=++d;a=new Set,o=new Set,c=`loading`,p();try{let n={...u},f=n.limit??200,p=[],m;for(let r=0;;r++){p=[];let i=n.before,a=0;for(;;){let r=await t.list({...n,limit:f,...i?{before:i}:{}});if(e!==d)return s;if(a++,p.push(...r),n.limit!==void 0||r.length<f)break;let o=r.at(-1);i={id:o.id,updatedAt:o.updatedAt}}if(n.limit!==void 0||a===1&&m===void 0)break;let o=JSON.stringify(p);if(o===m)break;if(r===2)throw Mi.COMMENTS_R0015();m=o}if(e!==d)return s;let g=new Map;for(let e of p){let t=r.get(e.id);o.has(e.id)||g.set(e.id,t&&(t.updatedAt>e.updatedAt||a.has(e.id)&&t.updatedAt===e.updatedAt)?t:e)}for(let e of a){let t=r.get(e);t&&!g.has(e)&&g.set(e,t)}r.clear();for(let[e,t]of g)r.set(e,t);i=new Set(p.map(e=>e.id)),c=`ready`,l=void 0,h()}catch(t){throw e===d&&(c=`error`,l=t,p()),t}return s},x=e=>{let t=r.get(e),{server:n,local:i}=S?S.overlay(t?[t]:[]):{server:t?[t]:[],local:[]};return n[0]??i.find(t=>t.id===e)??null},S=e.outbox&&am(e.outbox,{transport:t,user:e.user,threads:()=>r.values(),upsert:e=>void g(e),changed:h}),C=()=>{b().catch(()=>void 0)},w=t=>{if(t.type===`thread`){if(!e.user&&(u.mine||u.mentions))return C();r.get(t.thread.id)?.updatedAt===t.thread.updatedAt?C():g(t.thread)}else t.type===`deleted`?_(t.threadId):C()};return{transport:t,user:e.user,get threads(){return s},get status(){return c},get error(){return l},get query(){return u},set query(e){u=e,d++,i.clear(),h()},refresh:b,get:async e=>{let n=await t.get(e);return!n||!S?n:(g(n),x(n.id)??n)},create:async e=>(fh(e),S?S.create(e):g(await t.create(await ph(e)))),reply:e=>(fh(e),S?S.reply(e):y(e.threadId,async()=>g(await t.reply(await ph(e))))),edit:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.edit(e.messageId,e.body,e.mentions))throw Mi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>g(await t.edit(e)))},delete:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.dismiss(e.messageId??e.threadId))throw Mi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>{let n=await t.delete(e);return n?g(n):_(e.threadId),n})},resolve:e=>y(e.threadId,async()=>{let n=S?await S.beforeResolve(e.threadId):e.threadId;if(n===void 0)throw Mi.COMMENTS_OUTBOX_RESOLVE_BLOCKED();return g(await t.resolve({...e,threadId:n}))}),reopen:e=>y(e.threadId,async()=>g(await t.reopen(e))),users:e=>t.users(e),outbox:S,onChange(e){return n.add(e),()=>{n.delete(e)}},start(){let n=[];return t.subscribe?n.push(t.subscribe(w)):e.refreshOnFocus!==!1&&typeof window<`u`&&(window.addEventListener(`focus`,C),n.push(()=>window.removeEventListener(`focus`,C))),S&&n.push(S.start()),C(),()=>{for(let e of n.splice(0))e()}}}}var hh=t((()=>{Ni(),cm(),dm(),Zi(),ma(),Tm(),lh(),jn(),dh()}));function gh(e){return{id:e.id,image:e.image,name:bh(e)}}function _h(e){let{author:t,actor:n}=e;return n?{id:`${t.id}:${n.id}`,image:n.image,name:n.name??n.id}:gh(t)}function vh(e){let t=e.replace(/\\([\\`*_{}[\]()#+\-.!>~|])/g,(e,t)=>String.fromCharCode(57344+t.charCodeAt(0))).replace(/^\s*(?:```|~~~).*$/gm,``).replace(/^\s*::+[\w-]*(?:\{[^}\n]*\})?\s*$/gm,``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/<\/?[a-z][^>]*>/gi,``).replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+\[[ xX]\]\s+|[-*+]\s+|\d+[.)]\s+)/gm,``);for(let e=0;e<3;e++)t=t.replace(/(`+)([^`]+?)\1/g,`$2`).replace(/(\*\*|~~|\*)(?=\S)(.*?\S)\1/g,`$2`).replace(/(?<![\p{L}\p{N}_])(__|_)(?=\S)(.*?\S)\1(?![\p{L}\p{N}_])/gu,`$2`);return t.replace(/[\ue000-\ue07f]/g,e=>String.fromCharCode(e.charCodeAt(0)-57344)).replace(/\s+/g,` `).trim()}function yh(e,t=60){let n=vh(e);return n.length>t?`${n.slice(0,t-1)}…`:n}var bh,xh,Sh=t((()=>{bh=e=>e.name??e.id,xh=({author:e,actor:t})=>t?`${t.name??t.id} (${bh(e)})`:bh(e)}));function Ch(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&!kh.test(n[r-1]))return;let i=n.slice(r+1);if(!(i.length>40||/^\s|\n|\s{2}|@/u.test(i)))return{start:r,query:i}}function wh(e,t,n={}){let r=uh(t),i=new Set(n.participants),a=new Set,o=[[],[],[],[]];for(let t of e){if(t.id===n.exclude||a.has(t.id))continue;a.add(t.id);let e=uh(bh(t)),s=e.startsWith(r)?0:e.split(/\s+/u).some((e,t)=>t>0&&e.startsWith(r))?1:void 0;s!==void 0&&o[s*2+ +!i.has(t.id)].push(t)}return o.flat().slice(0,n.limit??6)}function Th(e,t){let n=[...t].filter(e=>e.name).sort((e,t)=>t.name.length-e.name.length);if(n.length===0)return[e];let r=RegExp(`@(${n.map(e=>Ah(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`uy`),i=[],a=0;for(let t=e.indexOf(`@`);t!==-1;t=e.indexOf(`@`,t+1)){if(t>0&&!kh.test(e[t-1]))continue;r.lastIndex=t;let o=r.exec(e),s=o&&n.find(e=>e.name===o[1]);o&&s&&(t>a&&i.push(e.slice(a,t)),i.push(s),a=t+o[0].length,t=a-1)}return a<e.length&&i.push(e.slice(a)),i}function Eh(e){return jh.get(e)}function Dh(e){let t=[...new Map(e.filter(e=>e.name).map(e=>[e.name,e])).values()].sort((e,t)=>t.name.length-e.name.length),n=t.length>0?RegExp(`@(${t.map(e=>Ah(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`iuy`):void 0,r={name:`vitehub-comment-mentions`,markdownItPlugins:[e=>{e.inline.ruler.before(`text`,`vitehub_comment_mention`,(e,r)=>{if(!n||e.src[e.pos]!==`@`)return!1;let i=e.src[e.pos-1];if(i!==void 0&&!kh.test(i))return!1;n.lastIndex=e.pos;let a=n.exec(e.src);if(!a)return!1;let o=a[1].toLowerCase(),s=t.find(e=>e.name.toLowerCase()===o);if(!s)return!1;if(!r){let t=e.push(`mdc_inline_component`,Oh,0);t.attrs=[[`user`,s.id],[`label`,s.name]]}return e.pos+=a[0].length,!0})}]};return jh.set(r,t),r}var Oh,kh,Ah,jh,Mh=t((()=>{hh(),Sh(),Oh=`comment-mention`,kh=/[\s([{"'“]/u,Ah=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),jh=new WeakMap}));function Nh(){return Bh??zh?.matches??!1}function Ph(){let e=Nh();if(e!==Vh){Vh=e;for(let t of Rh)t(e)}}function Fh(){zh||typeof matchMedia!=`function`||(zh=matchMedia(`(prefers-reduced-motion: reduce)`),zh.addEventListener?.(`change`,Ph),Vh=Nh())}function Ih(){return Fh(),Nh()}function Lh(e){return Fh(),Rh.add(e),()=>Rh.delete(e)}var Rh,zh,Bh,Vh,Hh=t((()=>{Rh=new Set,Vh=!1}));function Uh(){let e=Reflect.get(globalThis,$h);if(e&&e!==eg&&typeof e==`object`&&`define`in e&&`install`in e)return e}function Wh(e){eg=e,Reflect.get(globalThis,$h)||Reflect.set(globalThis,$h,e)}function Gh(e){let t=[...Zh.values()];Zh.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function Kh(e,t=Ih){let n={effect:e,isReduced:t};Zh.set(e.name,n);for(let e of Qh)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(Zh.get(e.name)===n){Zh.delete(e.name);for(let e of Qh)e()}}}function qh(){return[...Zh.values()].map(e=>e.effect)}function Jh(){return[...Zh.values()]}function Yh(e){return Qh.add(e),()=>Qh.delete(e)}function X(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}var Xh,Zh,Qh,$h,eg,tg=t((()=>{Hh(),Xh=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],Zh=new Map,Qh=new Set,$h=Symbol.for(`vite-hub.motion.layer`)}));function ng(){return gg}function rg(e){let t=Math.min(.032,hg?(e-hg)/1e3:.016)/gg;hg=e;let n=Array.from(ug),r=Array.from(dg);for(let[e,r]of n)if(ug.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&ig(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&ig(e)}e.frame(e.value,e.velocity)}for(let e of r)dg.has(e)&&e(t)===!1&&dg.delete(e);ug.size||dg.size?mg=requestAnimationFrame(rg):(mg=0,hg=0)}function ig(e){e.value=e.target,e.velocity=0,e.tween=void 0,ug.delete(e)}function ag(e){ug.set(e,++fg),mg||=requestAnimationFrame(rg)}function og(e){let t=t=>e(t);return dg.add(t),mg||=requestAnimationFrame(rg),()=>{dg.delete(t)}}function sg(e){if(!e)return;let t=Array.from(ug);for(let[e,n]of t)ug.get(e)!==n||e.tween||(ig(e),e.frame(e.value,0))}function cg(e,t,n=lg.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return ug.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&Ih())return i.set(e);t.tween===void 0&&!pg&&(pg=!0,Lh(sg)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},ag(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,ug.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,ug.delete(r)}};return i}var lg,ug,dg,fg,pg,mg,hg,gg,_g=t((()=>{Hh(),lg={snappy:{stiffness:520,damping:34},glide:{stiffness:800,damping:57},soft:{stiffness:380,damping:20}},ug=new Map,dg=new Set,fg=0,pg=!1,mg=0,hg=0,gg=1}));function vg(e,t){let n=e.getAttribute(`aria-orientation`);return n===`vertical`?`x`:n===`horizontal`?`y`:t.height>=t.width?`x`:`y`}function yg(e){return!/^transparent$|rgba\([^)]*,\s*0\)$|\/\s*0\)$/.test(e.trim())}function bg(e,t){let n=e=>Number.parseFloat(t===`x`?e.width:e.height),r=[[getComputedStyle(e),e],[getComputedStyle(e,`::before`),e],[getComputedStyle(e,`::after`),e]];for(let t of e.children)t instanceof HTMLElement&&r.push([getComputedStyle(t),t]);for(let[e,t]of r){let r=n(e);if(e.display!==`none`&&yg(e.backgroundColor)&&r>0&&r<=4)return{color:e.backgroundColor,width:r,element:t}}return{color:`var(--ui-border, var(--vh-border, currentColor))`,width:1}}function xg(e,t){let{handle:n,axis:r,line:i}=e;if(Math.abs(t)<.5&&!e.spring.active){e.lane?.svg.remove(),i.element&&e.opacity&&i.element.style.setProperty(`opacity`,e.opacity.value,e.opacity.priority),Og.get(n)===e&&Og.delete(n);return}if(!e.lane){let t=document.createElementNS(Eg,`svg`);t.setAttribute(`aria-hidden`,`true`),t.dataset.motion=`bend`,t.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;z-index:1`;let n=document.createElementNS(Eg,`path`);if(n.setAttribute(`fill`,`none`),n.style.stroke=i.color,n.style.strokeWidth=`${i.width}px`,t.append(n),e.lane={svg:t,path:n},i.element){let{style:t}=i.element;e.opacity={value:t.opacity,priority:t.getPropertyPriority(`opacity`)},t.setProperty(`opacity`,`0`)}}let{svg:a,path:o}=e.lane;a.isConnected||n.after(a);let s=n.offsetHeight&&n.getBoundingClientRect().height/n.offsetHeight||1,c=e=>({left:e.left/s,top:e.top/s,width:e.width/s,height:e.height/s}),l=c(a.getBoundingClientRect()),u=c(n.getBoundingClientRect()),d=r===`x`?u.left+u.width/2-l.left:u.top+u.height/2-l.top,f=r===`x`?u.top-l.top:u.left-l.left,p=f+(r===`x`?u.height:u.width),m=(f+p)/2,h=p-f>80?Math.max(f+Tg,Math.min(p-Tg,e.at/s-(r===`x`?l.top:l.left))):m,g=(e,t)=>r===`x`?`${t.toFixed(2)},${e.toFixed(2)}`:`${e.toFixed(2)},${t.toFixed(2)}`,_=d+t;o.setAttribute(`d`,`M${g(f,d)} C${g(h-70,d)} ${g(h-40,_)} ${g(h,_)} C${g(h+40,_)} ${g(h+70,d)} ${g(p,d)}`)}function Sg(e){return e.matches(`[aria-disabled=true], [data-disabled]:not([data-disabled=false]), [data-panel-resize-handle-enabled=false]`)?!1:/resize/.test(getComputedStyle(e).cursor)||e.tabIndex>=0||e.hasAttribute(`aria-valuenow`)}var Cg,wg,Tg,Eg,Dg,Og,kg,Ag=t((()=>{_g(),Cg={stiffness:500,damping:14},wg=60,Tg=40,Eg=`http://www.w3.org/2000/svg`,Dg=`data-resize-handle-active`,Og=new WeakMap,kg={name:`divider`,selector:`[role=separator]`,press(e,t){if(!(t instanceof PointerEvent)||!Sg(e)||e.matches(`[role=separator][data-panel-resize-handle-id]`)&&e.getAttribute(`data-resize-handle-active`)!==`pointer`)return;let n=e.getBoundingClientRect(),r=vg(e,n),i=e=>r===`x`?e.clientX:e.clientY,a=e=>r===`x`?e.clientY:e.clientX,o=e=>r===`x`?e.left+e.width/2:e.top+e.height/2,s=i(t)-o(n),c=Og.get(e);if(!c){let n={handle:e,axis:r,line:bg(e,r),at:a(t),spring:cg(0,e=>xg(n,e),Cg)};c=n,Og.set(e,c)}let l=c;l.at=a(t);let u=t,d=0,f=()=>{d=0;let t=e.getBoundingClientRect(),n=e.offsetHeight&&t.height/e.offsetHeight||1,r=(i(u)-s-o(t))/n;l.at=a(u),l.spring.set(Math.abs(r)<1?0:r/(1+Math.abs(r)/wg))};return{move(e){u=e,d||=requestAnimationFrame(f)},release(){cancelAnimationFrame(d),l.spring.to(0,{preset:Cg})}}}}}));function jg(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}var Mg=t((()=>{}));function Ng(e,t){if(o_.has(t))return!1;try{return e.matches(t)}catch{return o_.add(t),!1}}function Pg(e){let t=e;for(;;){for(let e of $g.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&$g.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function Fg(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&Ng(e,t));return r===-1||r<=n||!Pg(e[r])?void 0:e[r]}function Ig(e,t,n){Lg(e,!0);let r=a_(t),i=[];for(let{effect:a,isReduced:o}of Jh()){if(!a.press||o())continue;let s=Fg(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>Rg(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(t_.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,Hg,{capture:!0,passive:!0}))}function Lg(e,t=!1){let n=t_.get(e);if(n){t_.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();zg()}}function Rg(e,t,n=!1){let r=t_.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||t_.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),zg())}function zg(){[...t_.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,Hg,{capture:!0})}function Bg(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(n_={event:e,path:t}),Ig(e.pointerId,e,t)}function Vg(e){n_?.event.pointerId===e.pointerId&&(n_=void 0),Lg(e.pointerId,e.type===`pointercancel`)}function Hg(e){for(let{press:t}of t_.get(e.pointerId)??[])t.move?.(e)}function Ug(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||Ig(`key`,e,t)}function Wg(e){(e.key===` `||e.key===`Enter`)&&Lg(`key`)}function Gg(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)Ng(e,t.selector)&&!jg(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function Kg(e){if(!n_||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=Jh().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=n_,i=t_.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&Rg(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!Pg(e)||jg(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),t_.set(n.pointerId,i),document.addEventListener(`pointermove`,Hg,{capture:!0,passive:!0}))}function qg(e){let t=[...new Set(e)],n=qh(),r=new Map;Gg(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){Kg(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&Ng(t,r.selector)&&!jg(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=Ng(t,e.selector);if(o_.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)jg(t)||e.enter(t)}}}function Jg(e,t){let n=qh().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...Xh,...qh().some(e=>e.name===`divider`)?[Dg]:[]],attributeOldValue:!0,childList:n||qh().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function Yg(e,t){let n=qh();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function Xg(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Bg,e),document.addEventListener(`pointerup`,Vg,e),document.addEventListener(`pointercancel`,Vg,e),document.addEventListener(`keydown`,Ug,e),document.addEventListener(`keyup`,Wg,e),r_=[()=>{document.removeEventListener(`pointerdown`,Bg,e),document.removeEventListener(`pointerup`,Vg,e),document.removeEventListener(`pointercancel`,Vg,e),document.removeEventListener(`keydown`,Ug,e),document.removeEventListener(`keyup`,Wg,e),n_=void 0;for(let e of t_.keys())Lg(e,!0)},Lh(e=>{if(e){n_=void 0;for(let e of t_.keys())Lg(e,!0)}})]}function Zg(e,t){if(typeof document>`u`)return()=>{};let n=Uh();return n?(Gh(n),n.install(e,t.effects,Ih)):(Wh(s_),Qg(e,t.effects))}function Qg(e,t,n=Ih){let r=new Set(qh().map(e=>e.name));for(let e of t)r.has(e.name)||Kh(e,n);if(!e_){Xg();let e=new MutationObserver((e,t)=>qg(e.concat(t.takeRecords())));e_=e,r_.push(Yh(()=>{for(let[t,{watchers:n}]of $g)Jg(t,e),Yg(t,n)}))}let i=$g.get(e);if(i)i.installs++;else{let t=new Map;Jg(e,e_),$g.set(e,{installs:1,watchers:t}),Yg(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=$g.get(e);if(!t||--t.installs>0)return;$g.delete(e);let n=e_,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if($g.size){for(let e of $g.keys())Jg(e,n);r.length&&queueMicrotask(()=>{if(e_!==n)return;let e=[...$g.keys()];qg(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{e_=void 0;for(let e of r_)e();r_=[]}}}var $g,e_,t_,n_,r_,i_,a_,o_,s_,c_=t((()=>{Ag(),Mg(),Hh(),tg(),$g=new Map,t_=new Map,r_=[],i_=Symbol.for(`vite-hub.motion.effect-presses`),a_=e=>{let t=Reflect.get(e,i_);if(t)return t;let n=new Map;return Reflect.set(e,i_,n),n},o_=new Set,s_={define:Kh,install:Qg}}));function l_(e){return y_.add(e),e}function u_(e){return y_.has(e)}function d_(e){let t=e.getRootNode(),n=t instanceof ShadowRoot?t:e.ownerDocument.head;if(!n)return!1;let r=x_.get(t);if(r?.parentNode===n)return!!r.sheet;let i=l_(e.ownerDocument.createElement(`style`));return i.dataset.motionGlyphs=``,i.textContent=b_,n.append(i),x_.set(t,i),!!i.sheet}function f_(e){let t=l_(document.createElement(`span`));return t.dataset.motionGlyph=e,t.style.whiteSpace=`pre`,t}function p_(e){return!e.isConnected||typeof requestAnimationFrame!=`function`||jg(e)}function m_(e){return p_(e)||!e.getClientRects().length||!d_(e)}function h_(){return Ih()}function g_(e){return w_.get(e)}function __(e,t,n){let r=C_.map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]),i=getComputedStyle(e);t===`end`?(e.style.display=i.display.startsWith(`inline`)||i.display===`contents`?`inline-flex`:`flex`,e.style.justifyContent=`flex-end`):(i.display===`inline`||i.display===`contents`)&&(e.style.display=`inline-block`),i.position===`static`&&(e.style.position=`relative`),e.style.whiteSpace=`nowrap`,e.style.boxSizing=`border-box`,e.style.overflow=`visible`;let a=l_(document.createElement(`span`));a.dataset.motionCopy=``,a.style.cssText=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0`;let o=l_(document.createElement(`span`));o.setAttribute(`aria-hidden`,`true`),o.dataset.motionGlyphs=``,o.style.display=`contents`,e.replaceChildren(a,o);let s=cg(0,(t,r)=>{e.style.width=`${t}px`,r===0&&t===s.target&&n()},S_),c={element:e,holder:o,width:s,name(e){a.textContent=e},restore(){(o.parentNode!==e||a.parentNode!==e)&&e.replaceChildren(a,o)},natural(){let t=e.style.width;e.style.width=`max-content`;let n=getComputedStyle(e),r=Number.parseFloat(n.width),i=Number.isFinite(r)?r:e.offsetWidth;return e.style.width=t,i},collapse(t){c.discard(),e.replaceChildren(l_(document.createTextNode(t)))},discard(){s.stop(),w_.delete(e),a.remove(),o.remove();for(let[t,n,i]of r)n?e.style.setProperty(t,n,i):e.style.removeProperty(t);e.getAttribute(`style`)||e.removeAttribute(`style`)}};return w_.set(e,c),c}function v_(e,t){let n=w_.get(e);n?n.collapse(t):e.textContent!==t&&e.replaceChildren(l_(document.createTextNode(t)))}var y_,b_,x_,S_,C_,w_,T_=t((()=>{c_(),Hh(),_g(),y_=new WeakSet,b_=`[data-motion-glyph]::before{content:attr(data-motion-glyph)}`,x_=new WeakMap,S_={stiffness:380,damping:34},C_=[`display`,`position`,`width`,`white-space`,`box-sizing`,`overflow`,`justify-content`,`vertical-align`],w_=new WeakMap}));function E_(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}function D_(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??k_,c=Ih(),l=0;return{stop:og(n=>{l+=n;let u=!c&&Ih()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function O_(e,t,n=k_,r=0){let i=()=>{},a=new Promise(e=>i=e),o=D_(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}var k_,A_,j_,M_=t((()=>{Hh(),_g(),k_=e=>e,A_=E_(.42,0,1,1),j_=E_(0,0,.58,1)}));function N_(e){let t=Math.max(0,L_.findIndex(([t])=>t>=e)-1),[n,r]=L_[t],[i,a]=L_[t+1]??L_[t],o=i>n?(e-n)/(i-n):1;return r+(a-r)*I_(Math.min(1,Math.max(0,o)))}function P_(e){if(R_.get(e)?.(),p_(e)||h_())return;let t=O_(F_,t=>X(e,{translate:t>=1?null:`${N_(t).toFixed(2)}px 0`})),n=()=>{t.stop(),R_.delete(e),X(e,{translate:null})};R_.set(e,n),t.done.then(e=>e&&n())}var F_,I_,L_,R_,z_=t((()=>{tg(),T_(),M_(),F_=.4,I_=E_(.36,.07,.19,.97),L_=[[0,0],[.1,-1],[.2,3],[.3,-5],[.4,5],[.5,-5],[.6,5],[.7,-5],[.8,3],[.9,-1],[1,0]],R_=new WeakMap})),B_,V_,H_=t((()=>{Y(),B_=Symbol(`ViteHubComments`),V_=()=>yl(B_,null)??void 0}));function U_(e,t,n){return n?t.slice(-1):[...e,...t]}function W_(e,t){return!t||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function G_(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??new DOMException(`Could not read ${e.name}.`,`NotReadableError`)),r.onload=()=>t({filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:String(r.result)}),r.readAsDataURL(e)})}function K_(){return typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches&&!matchMedia(`(any-pointer: fine)`).matches}var q_=t((()=>{})),J_=t((()=>{q_()}));function Y_(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function X_(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function Z_(e,t){return window.setTimeout(t,e*ng())}var Q_=t((()=>{_g()}));function $_(e){let t=[];for(let n of e.querySelectorAll(`svg, .iconify`))n instanceof SVGSVGElement&&n.parentElement?.closest(`svg`)||(n instanceof SVGSVGElement||ev(n))&&t.push(n);return t}function ev(e){let t=getComputedStyle(e).getPropertyValue(`--svg`).trim(),n=/^url\(\s*(["']?)(.*)\1\s*\)$/s.exec(t)?.[2];if(!n?.startsWith(`data:image/svg+xml`))return;let r=n.indexOf(`,`),i=n.slice(r+1);try{return n.slice(0,r).endsWith(`;base64`)?atob(i):decodeURIComponent(i)}catch{return}}function tv(e){let t=new Map;return{set(e,n,r){let i=t.get(e);i||t.set(e,i=new Map),i.has(n)||i.set(n,e.getAttribute(n)),e.setAttribute(n,r)},putBack(){for(let[e,n]of t)for(let[t,r]of n)r===null?e.removeAttribute(t):e.setAttribute(t,r);t.clear()},shapes:e}}function nv(e){if(e instanceof SVGSVGElement){let{set:t,putBack:n,shapes:r}=tv([...e.querySelectorAll(av)]);return r.length?{shapes:r,set:t,commit(){},restore:n,measure:e=>e(r)}:void 0}let t=ev(e);if(!t)return;let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(!(n instanceof SVGSVGElement)||n.matches(`[style], [class], [transform]`))return;let r=[],i=[];for(let e of n.children){let t=iv.get(e.localName);if(!t||!(e instanceof SVGGeometryElement)||e.childElementCount||e.matches(`[style], [class], [transform]`))return;let n=document.createElementNS(rv,e.localName);if(!(n instanceof SVGGeometryElement))return;for(let r of t){let t=e.getAttribute(r);t!==null&&n.setAttribute(r,t)}r.push(n),i.push(e)}if(!r.length)return;let{set:a,putBack:o,shapes:s}=tv(i),c=()=>({value:e.style.getPropertyValue(`--svg`),priority:e.style.getPropertyPriority(`--svg`)}),l=c(),u,d=e=>{let t=c();return e.value===t.value&&e.priority===t.priority};return{shapes:s,set:a,commit(){d(u??l)&&(e.style.setProperty(`--svg`,`url("data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(n))}")`,l.priority),u=c())},restore(){if(o(),u&&d(u)){let{value:t,priority:n}=l;t?e.style.setProperty(`--svg`,t,n):e.style.removeProperty(`--svg`)}u=void 0},measure(e){let t=document.createElementNS(rv,`svg`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,t.append(...r),document.body.append(t);try{return e(r)}finally{t.remove()}}}}var rv,iv,av,ov=t((()=>{rv=`http://www.w3.org/2000/svg`,iv=new Map([[`path`,[`d`]],[`line`,[`x1`,`y1`,`x2`,`y2`]],[`polyline`,[`points`]],[`polygon`,[`points`]],[`circle`,[`cx`,`cy`,`r`]],[`ellipse`,[`cx`,`cy`,`rx`,`ry`]],[`rect`,[`x`,`y`,`width`,`height`,`rx`,`ry`]]]),av=[...iv.keys()].join(`, `)}));function sv(e){return e===`true`||e===`mixed`}function cv(e){return e instanceof HTMLElement||e instanceof SVGElement?e:void 0}function lv(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;)n=n.parentElement;return n}function uv(e){let{indicator:t}=e;if(e.drawn.target||e.ghost||!t||t.isConnected)return;let n=cv(t);if(!n)return;let r=Y_(n,e.element,null);e.ghost=r,mv(e,$_(r)[0],r)}function dv(e,t){uv(e);let n=Math.min(1,Math.max(0,t));if(e.icon&&!e.reduced){let{icon:t,lengths:r}=e;t.shapes.forEach((e,i)=>{let a=r[i];t.set(e,`stroke-dasharray`,`${a} ${a}`),t.set(e,`stroke-dashoffset`,String(a*(1-n)))}),t.commit()}e.fade&&X(e.fade,{opacity:String(n)})}function fv(e){e.icon?.restore(),e.icon=void 0,e.fade&&X(e.fade,{opacity:null}),e.fade=void 0,e.ghost?.remove(),e.ghost=void 0}function pv(e,t){let n=hv.get(e);if(n)return n;let r={element:e,drawn:cg(+!!t,e=>{r.drawn.active?dv(r,e):fv(r)}),icon:void 0,lengths:[],fade:void 0,indicator:void 0,ghost:void 0,reduced:!1};return hv.set(e,r),r}function mv(e,t,n){return e.icon?.restore(),e.fade&&e.fade!==n&&X(e.fade,{opacity:null}),e.icon=t&&!e.reduced?nv(t):void 0,e.lengths=e.icon?.measure(e=>e.map(e=>e.getTotalLength()))??[],e.fade=n,!!e.icon||!!n}var hv,gv,_v=t((()=>{tg(),Hh(),_g(),Q_(),ov(),hv=new WeakMap,gv={name:`check`,selector:`[role=checkbox]`,state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=pv(e,sv(n));i.ghost?.remove(),i.ghost=void 0,i.reduced=Ih();let a=i.reduced?{tween:.15}:void 0;if(sv(r)){let t=$_(e)[0];if(i.indicator=t&&lv(e,t),sv(n)&&i.drawn.set(0),!mv(i,t,i.reduced?cv(i.indicator):void 0))return;dv(i,i.drawn.value),i.drawn.to(1,a);return}if(n!==`true`){i.drawn.set(0),i.indicator=void 0;return}let o=$_(e)[0];o&&(i.indicator=lv(e,o)),(mv(i,o,i.reduced?cv(i.indicator):void 0)||i.indicator)&&(i.drawn.to(0,a),dv(i,i.drawn.value))}}}));function vv(e){return e instanceof HTMLDetailsElement?e.querySelector(`:scope > summary`):e}function yv(e){if(!e||e===`none`)return 0;let t=e.trim().split(/\s+/),n=t.pop();if(t.length===1&&t[0]!==`z`||t.length===3&&(Number(t[0])!==0||Number(t[1])!==0))return 0;let r=Number.parseFloat(n);return n.endsWith(`turn`)?r*360:n.endsWith(`grad`)?r*.9:n.endsWith(`rad`)?r*180/Math.PI:Number.isFinite(r)?r:0}function bv(e){let t=/^matrix(?:3d)?\(([^)]+)\)$/.exec(e);if(!t)return 0;let[n=1,r=0]=t[1].split(`,`).map(Number);return Math.atan2(r,n)*180/Math.PI}function xv(e){let t=e.style.getPropertyValue(`rotate`);t&&e.style.removeProperty(`rotate`);let n=getComputedStyle(e),r=bv(n.transform),i=r+yv(n.rotate);return t&&e.style.setProperty(`rotate`,t),{total:i,base:r}}function Sv(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|rotate|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function Cv(e){return[...e.querySelectorAll(Tv)].filter(e=>!e.parentElement?.closest(Tv)||e.matches(`[data-motion-chevron]`))}function wv(e){let t=Dv.get(e);if(t)return t;let n={base:0,spring:cg(0,(t,r)=>{jg(e)?(n.spring.stop(),X(e,{rotate:null})):X(e,{rotate:r===0&&t===n.spring.target?null:`${(t*Ev-n.base).toFixed(2)}deg`})},lg.snappy)};return Dv.set(e,n),n}var Tv,Ev,Dv,Ov,kv,Av=t((()=>{c_(),Hh(),tg(),_g(),Tv=`[data-motion-chevron], svg, img, .iconify, [data-slot=icon], [data-slot$=Icon]`,Ev=90,Dv=new WeakMap,Ov=new WeakMap,kv={name:`disclosure`,selector:`details, summary, [aria-expanded]`,press(e){let t=e.tagName===`SUMMARY`?e.parentElement:e.matches(`[aria-expanded]`)?e:null;if(!t||!(t instanceof HTMLDetailsElement||t.matches(`[aria-expanded]`)))return;let n=vv(t);if(!n)return;let r=new Map;for(let e of Cv(n)){if(jg(e)||Sv(e))continue;let t=Dv.get(e)?.spring;r.set(e,t?.active?t.target*Ev:xv(e).total)}if(r.size)return Ov.set(t,r),{release(){setTimeout(()=>{Ov.get(t)===r&&Ov.delete(t)})}}},state(e,{attribute:t}){if(t!==(e instanceof HTMLDetailsElement?`open`:`aria-expanded`))return;let n=Ov.get(e);Ov.delete(e);let r=vv(e);if(r)for(let e of Cv(r)){let t=Dv.get(e),r=n?.get(e);if(jg(e)||r===void 0||Ih()||Sv(e)){t?.spring.active&&(t.spring.stop(),X(e,{rotate:null}));continue}let i=wv(e),a=i.spring.active?i.spring.value*Ev:r,{total:o,base:s}=xv(e);i.base=s,Math.abs(o-a)<.5?i.spring.active&&i.spring.set(o/Ev):(i.spring.active||i.spring.set(a/Ev),i.spring.to(o/Ev),i.spring.active&&X(e,{rotate:`${(i.spring.value*Ev-s).toFixed(2)}deg`}))}}}}));function jv({outline:e,box:t},n){let r=n<=1?.5*Math.sin(Math.PI*n):-.12*Math.sin(Math.PI*(n-1)/.5),i=-.15+1.35*Math.min(1,Math.max(0,n)),a=4*t.height/18;return`M${e.map(([e,n])=>{let o=(n-t.top)/t.height,s=Math.exp(-(((o-i)/.3)**2)),c=r*s*(.12+1.1*Math.max(0,o)**1.6),l=t.center+(e-t.center)*(1+c),u=o>.8?n-r*s*a*(o-.8):n;return`${l.toFixed(2)} ${u.toFixed(2)}`}).join(`L`)}Z`}function Mv(e){let[t,...n]=e.shapes;if(n.length||!(t instanceof SVGPathElement))return;let r=t.getAttribute(`d`)??``;return/^[Mm][^MmZz]+[Zz]\s*$/.test(r.trim())?t:void 0}function Nv(e){let t=Rv.get(e);if(t){t.clock.set(0),t.clock.to(1,{tween:Iv});return}let n=nv(e),r=n&&Mv(n);if(!n||!r)return;let i=n.measure(([e])=>{let t=e.getTotalLength(),n=e.getBBox();return{outline:Array.from({length:Lv},(n,r)=>{let i=e.getPointAtLength(t*r/Lv);return[i.x,i.y]}),box:{top:n.y,height:n.height,center:n.x+n.width/2}}});if(!i.box.height)return;let a={shape:n,path:r,...i,clock:cg(0,t=>{let i=1-Math.cbrt(1-Math.min(1,t));i>=1||!e.isConnected?(Rv.delete(e),a.clock.stop(),n.restore()):(n.set(r,`d`,jv(a,i*Fv)),n.commit())})};Rv.set(e,a),a.clock.to(1,{tween:Iv})}function Pv(){let e=zv;zv=void 0;for(let t of e.values())if(!(new Set(t.map(e=>e.getAttribute(`aria-pressed`)===`true`)).size>1))for(let e of t){let t=$_(e);t.length===1&&Nv(t[0])}}var Fv,Iv,Lv,Rv,zv,Bv,Vv=t((()=>{Hh(),_g(),ov(),Fv=1.5,Iv=.56*Fv,Lv=120,Rv=new WeakMap,Bv={name:`jelly`,selector:`[aria-pressed]`,state(e,{attribute:t}){if(t!==`aria-pressed`||Ih())return;zv||(zv=new Map,queueMicrotask(Pv));let n=zv.get(e.parentElement)??[];n.push(e),zv.set(e.parentElement,n)}}}));function Hv(e){let t=oy.get(e);return t||(t={shown:1,leaving:!1},oy.set(e,t)),t}function Uv(e){return e instanceof HTMLElement||e instanceof SVGElement}function Wv(e){let t=e instanceof SVGSVGElement?e:e.querySelector(`svg`),n=t?nv(t):void 0,r=n?.shapes.filter(e=>getComputedStyle(e).stroke!==`none`)??[];return n&&r.length?{shape:n,parts:r}:void 0}function Gv(e,t){let n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return()=>{n?e.setProperty(t,n,r):e.removeProperty(t)}}function Kv(e,t,n){if(!Uv(e))return;let r=t.styles??=new Map;for(let[t,i]of Object.entries(n))r.has(t)||r.set(t,Gv(e.style,t)),e.style.setProperty(t,i)}function qv(e){e.stroke?.restore(),e.stroke=void 0;for(let t of e.styles?.values()??[])t();e.styles=void 0}function Jv(e){let t=oy.get(e);t&&(t.fade?.stop(),qv(t),t.restorePlacement?.(),oy.delete(e))}function Yv(e,t,n,r){let i=Hv(e);i.fade?.stop(),qv(i),i.leaving=!0;let[a,o]=t===`blur`?[0,0]:ay[t];i.fade=D_(i.shown,0,{duration:n?iy:ey.duration,ease:n?j_:A_},r=>{i.shown=r;let s=1-r;Kv(e,i,{opacity:String(r),...n?{}:t===`blur`?{filter:`blur(${(ey.blur*s).toFixed(2)}px)`,scale:String(1-(1-ey.scale)*s)}:{translate:`${a*ey.travel*s}px ${o*ey.travel*s}px`}})},()=>{i.fade=void 0,r()})}function Xv(e,t,n,r){let i=Hv(e);i.fade?.stop(),i.restorePlacement?.(),i.restorePlacement=void 0,i.leaving=!1,qv(i);let a=t===`draw`&&!n?Wv(e):void 0;i.stroke=a?.shape;let o=()=>{i.fade=void 0,i.shown=1,qv(i)};if(n){i.fade=D_(r,1,{duration:iy,ease:j_},t=>{i.shown=t,Kv(e,i,{opacity:String(t)})},o);return}if(a){let{shape:t,parts:n}=a;for(let e of n)t.set(e,`pathLength`,`1`),t.set(e,`stroke-dasharray`,`1`),t.set(e,`stroke-dashoffset`,`1`);t.commit();let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);i.shown=1,i.fade=D_(1,0,{duration:r?ry.spinner:ry.duration,delay:ry.delay,ease:ry.ease},e=>{for(let r of n)t.set(r,`stroke-dashoffset`,String(e));t.commit()},o);return}let s=t===`draw`?`blur`:t;if(s===`blur`){i.fade=D_(r,1,{duration:ty.duration,delay:r?0:ty.delay,ease:ty.ease},t=>{i.shown=Math.min(1,t);let n=1-t;Kv(e,i,{opacity:String(Math.min(1,Math.max(0,t))),filter:`blur(${Math.max(0,ty.blur*n).toFixed(2)}px)`,scale:String(1-(1-ty.scale)*n)})},o);return}let[c,l]=ay[s];i.fade=D_(r,1,{duration:ny.duration,delay:r?0:ny.delay,ease:ny.ease},t=>{i.shown=t;let n=1-t;Kv(e,i,{opacity:String(Math.min(1,t)),translate:`${-c*ny.travel*n}px ${-l*ny.travel*n}px`})},o)}function Zv(e,t,n,r,i){let a=h_(),o=sy.get(e);!o&&getComputedStyle(e).position===`static`&&(o={exits:0,restore:Gv(e.style,`position`)},sy.set(e,o),e.style.position=`relative`),o&&o.exits++;let s=[];if(Uv(t)){let e={position:`absolute`,left:`${n.left}px`,top:`${n.top}px`,"pointer-events":`none`,"margin-top":`0`,"margin-right":`0`,"margin-bottom":`0`,"margin-left":`0`};for(let[n,r]of Object.entries(e))s.push(Gv(t.style,n)),t.style.setProperty(n,r)}let c=t.getAttribute(`aria-hidden`);t.setAttribute(`aria-hidden`,`true`),Hv(t).restorePlacement=()=>{for(let e of s)e();c===null?t.removeAttribute(`aria-hidden`):t.setAttribute(`aria-hidden`,c),o&&--o.exits===0&&(o.restore(),sy.delete(e))},Yv(t,r,a,()=>{Jv(t),i(t)})}function Qv(e,t,n){let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);Xv(e,t??(r?`draw`:`blur`),h_(),n)}function $v(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.offsetWidth?n.width/e.offsetWidth:1;return{left:(r.left-n.left)/(i||1)-e.clientLeft,top:(r.top-n.top)/(i||1)-e.clientTop}}var ey,ty,ny,ry,iy,ay,oy,sy,cy=t((()=>{ov(),T_(),M_(),ey={duration:200,travel:12,scale:.6,blur:2},ty={duration:260,delay:40,scale:.5,blur:3,ease:E_(.3,1.5,.5,1)},ny={duration:260,delay:80,travel:10,ease:E_(.2,.8,.2,1)},ry={duration:340,spinner:420,delay:120,ease:E_(.6,0,.2,1)},iy=150,ay={left:[-1,0],right:[1,0],up:[0,-1],down:[0,1]},oy=new WeakMap,sy=new WeakMap}));function ly(e,t){let n=[...e],r=[...t],i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{kept:n.slice(0,i).join(``),gone:n.slice(i).join(``),typed:r.slice(i).join(``)}}function uy(e,t,n){return n>1?Math.min(e,t/(n-1)):e}function dy(e){return Ey.get(e)?.text}function fy(e,t,n){e.shown=t,X(e.node,{opacity:t>=1?null:String(t),filter:n||t>=1?null:`blur(${(Sy*(1-t)).toFixed(2)}px)`})}function py(e){return f_(e)}function my(e,t){Ey.get(e)===t&&(t.leaving.size||t.timers.size||t.frame.width.active||t.letters.some(e=>e.fade||e.waiting)||(Ey.delete(e),t.frame.collapse(t.text)))}function hy(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[...e.letters,...e.leaving])t.fade?.stop()}function gy(e){let t=Ey.get(e);t&&(hy(t),Ey.delete(e),t.frame.discard())}function _y(e,t){yy(e,t,void 0)}function vy(e){let t=e;for(;t;){if(t.getClientRects().length)return!0;if(getComputedStyle(t).display!==`contents`)return!1;let e=t.getRootNode();t=t.parentElement??(e instanceof ShadowRoot?e.host:null)}return!1}function yy(e,t,n){let r=Ey.get(e),i=r?.text??n??e.textContent??``;if(!r&&i===t||m_(e)||!vy(e)){r&&(hy(r),Ey.delete(e)),v_(e,t);return}let a=h_();if(!r){let t=g_(e)??__(e,`inline`,()=>{let t=Ey.get(e);t&&my(e,t)}),n=[...i].map(e=>({node:py(e),char:e,shown:1,waiting:!1}));t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),r={frame:t,text:i,letters:n,leaving:new Set,timers:new Set},Ey.set(e,r)}let o=r,s=o.frame.width;o.frame.restore();for(let e of o.timers)clearTimeout(e);if(o.timers.clear(),o.text=t,o.frame.name(t),a){xy(o,o.letters,!0),o.letters=[...t].map(e=>{let t={node:py(e),char:e,shown:0,waiting:!1};return fy(t,0,!0),o.frame.holder.append(t.node),t}),s.set(o.frame.natural());for(let t of o.letters)by(e,o,t,0,Ty,!0);return}let c=ly(o.letters.map(e=>e.char).join(``),t),l=[...c.kept].length,u=o.letters.slice(0,l);xy(o,o.letters.slice(l),!1);let d=[...u.filter(e=>e.waiting),...[...c.typed].map(e=>{let t={node:py(e),char:e,shown:0,waiting:!0};return fy(t,0,!1),o.frame.holder.append(t.node),t})];o.letters=[...u,...d.filter(e=>!u.includes(e))];let f=o.frame.natural();if(!d.length){s.to(f);return}let p=s.value,m=f-d.reduce((e,t)=>e+t.node.offsetWidth,0),h=ng(),g=uy(wy.stagger,wy.spread,d.length);d.forEach((t,n)=>{m+=t.node.offsetWidth;let r=n===d.length-1?f:Math.max(m,n===0?Math.min(p,f):0),i=setTimeout(()=>{o.timers.delete(i),t.waiting=!1,s.to(r),by(e,o,t,t.shown,wy.duration,!1)},(wy.lead+n*g)*h);o.timers.add(i)})}function by(e,t,n,r,i,a){n.fade?.stop(),n.fade=D_(r,1,{duration:i,ease:j_},e=>fy(n,e,a),()=>{n.fade=void 0,fy(n,1,a),my(e,t)})}function xy(e,t,n){let r=e.frame.element,i=t.map(e=>({letter:e,left:e.node.offsetLeft,top:e.node.offsetTop})),a=uy(Cy.stagger,Cy.spread,i.length),o=0;for(let{letter:t,left:s,top:c}of i)t.fade?.stop(),t.fade=void 0,t.waiting||t.shown<=0?t.node.remove():(t.node.style.position=`absolute`,t.node.style.left=`${s}px`,t.node.style.top=`${c}px`,e.leaving.add(t),t.fade=D_(t.shown,0,{duration:n?Ty:Cy.duration,delay:n?0:o++*a,ease:n?j_:A_},e=>fy(t,e,n),()=>{t.fade=void 0,t.node.remove(),e.leaving.delete(t),my(r,e)}))}var Sy,Cy,wy,Ty,Ey,Dy=t((()=>{tg(),_g(),T_(),M_(),Sy=6,Cy={duration:200,stagger:30,spread:120},wy={duration:240,lead:30,stagger:55,spread:240},Ty=150,Ey=new WeakMap})),Oy,ky,Ay,jy=t((()=>{T_(),cy(),Dy(),Oy=`:is(button, a, [role=button])`,ky={name:`label`,selector:`${Oy} > [data-slot=label]`,content(e,{added:t,removed:n,oldText:r}){if(!(e instanceof HTMLElement))return;if([...e.childNodes].some(e=>e.nodeType!==Node.TEXT_NODE&&!u_(e))){gy(e);return}if(t.length?t.every(u_):n.length>0)return;let i=dy(e)??r;i!==void 0&&yy(e,e.textContent??``,i)}},Ay={name:`button-icon`,selector:`${Oy}, ${Oy} > svg:is([data-slot=leadingIcon], [data-slot=trailingIcon])`,content(e,{added:t,removed:n}){if(e instanceof HTMLElement){for(let r of[`leadingIcon`,`trailingIcon`]){let i=e=>e instanceof SVGSVGElement&&e.getAttribute(`data-slot`)===r&&!u_(e),a=t.find(t=>i(t)&&t.parentNode===e),o=n.find(i);if(o){let t=l_(o.cloneNode(!0));t.classList.remove(`animate-spin`),t.removeAttribute(`data-slot`),a?a.after(t):r===`leadingIcon`?e.prepend(t):e.append(t),Zv(e,t,$v(e,a??t),`blur`,e=>e.remove())}a&&Qv(a,void 0,0)}return}let r=e.parentElement;if(!(e instanceof SVGSVGElement)||!r||!n.length||t.every(u_)||!n.some(e=>e instanceof SVGElement))return;let i=$v(r,e),a=l_(e.cloneNode(!1));a.classList.remove(`animate-spin`),a.removeAttribute(`data-slot`),a.append(...n),e.after(a),Zv(r,a,i,`blur`,e=>e.remove()),Qv(e,void 0,0)}}}));function My(e){let t=Iy.get(e);t&&(Iy.delete(e),t.spring.stop(),t.ghost.remove(),e.removeAttribute(`data-motion-leave-managed`),X(e,{opacity:null}))}var Ny,Py,Fy,Iy,Ly,Ry=t((()=>{Hh(),tg(),_g(),Q_(),Ny={stiffness:260,damping:28},Py=.9,Fy=.15,Iy=new WeakMap,Ly={name:`leave`,selector:`*`,state(e,{attribute:t,value:n}){if(t!==`data-leaving`||(My(e),n!==`true`||!e.parentNode))return;e.setAttribute(`data-motion-leave-managed`,``);let r=e.getBoundingClientRect(),i=Y_(e,e.parentNode,e.nextSibling),a=getComputedStyle(e).position;a!==`absolute`&&a!==`fixed`&&X_(i,r),X(e,{opacity:`0`});let o=Ih(),s=cg(1,e=>{X(i,{scale:o?null:(Py+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&(s.stop(),i.remove())},Ny);Iy.set(e,{ghost:i,spring:s}),s.to(0,o?{tween:Fy}:{preset:Ny})}}}));function zy(e){let t=Gy.get(e)?.spring;t?.active&&(t.stop(),X(e,{width:null}))}function By(e){let t=new Set,n=new ResizeObserver(e=>{for(let{target:n}of e)n instanceof HTMLElement&&t.has(n)&&!Gy.get(n)?.spring.active&&Ky.set(n,n.getBoundingClientRect().width)});function r(r){if(t.has(r)||!e.contains(r)||!r.matches(Wy))return;t.add(r);let i=qy.get(r)??0;i===0&&Ky.set(r,r.getBoundingClientRect().width),qy.set(r,i+1),n.observe(r,{box:`border-box`})}function i(e){t.delete(e),n.unobserve(e);let r=qy.get(e)??1;r>1?qy.set(e,r-1):(qy.delete(e),zy(e),Ky.delete(e))}let a=new MutationObserver(n=>{for(let n of t)e.contains(n)&&n.matches(Wy)||i(n);for(let e of n){e.type===`attributes`&&e.target instanceof HTMLElement&&r(e.target);for(let t of e.addedNodes)if(t instanceof HTMLElement){r(t);for(let e of t.querySelectorAll(Wy))r(e)}}});e instanceof HTMLElement&&r(e);for(let t of e.querySelectorAll(Wy))r(t);return a.observe(e,{subtree:!0,childList:!0,attributeFilter:[`data-motion-panel`]}),()=>{a.disconnect();for(let e of t)i(e);n.disconnect()}}function Vy(e){let t=getComputedStyle(e);return t.boxSizing===`border-box`?0:[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+Number.parseFloat(t),0)}function Hy(e,t){X(e,{width:`${t.spring.value*Jy-t.frame}px`})}var Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy=t((()=>{Hh(),tg(),_g(),Uy={stiffness:420,damping:30},Wy=`[data-motion-panel]`,Gy=new WeakMap,Ky=new WeakMap,qy=new WeakMap,Jy=100,Yy={name:`panel`,selector:Wy,watch:By,state(e){let t=Gy.get(e),n=t?.spring.active?t.spring.value*Jy:Ky.get(e);t?.spring.active&&X(e,{width:null});let r=e.getBoundingClientRect().width;if(Ky.set(e,r),n===void 0||Ih()||Math.abs(r-n)<.5)zy(e);else{if(!t){let r={frame:0,spring:cg(n/Jy,(t,n)=>{n===0&&t===r.spring.target?X(e,{width:null}):Hy(e,r)},Uy)};t=r,Gy.set(e,t)}t.frame=Vy(e),t.spring.active||t.spring.set(n/Jy),t.spring.to(r/Jy),t.spring.active&&Hy(e,t)}}}}));function Zy(){let e=Reflect.get(globalThis,lb);return e===`opt-in`||e===`all`?e:`buttons`}function Qy(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function $y(e){let t=Zy();return t===`buttons`?e.matches(cb)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function eb(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(sb);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!$y(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:fb(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(sb)?{target:r,amount:.15}:{target:e,amount:fb(e)}}function tb(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function nb(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}var rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb=t((()=>{tg(),_g(),rb={stiffness:900,damping:40},ib={stiffness:380,damping:14},ab=[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`],ob=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${ab.map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,sb=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,cb=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,lb=Symbol.for(`vite-hub.motion.press-mode`),ub=new WeakMap,db=e=>e>=40?.03:e>=32?.04:.05,fb=e=>Math.min(db(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight)),pb={name:`press`,selector:ob,press(e,t){if(!(`pointerId`in t))return;let n=eb(e,Qy(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(tb(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),nb(o,t,i)))return;let s=ub.get(r);if(!s){let e={amount:i,spring:cg(0,t=>{X(r,{scale:t?String(1-e.amount*t):null})},rb)};s=e,ub.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:rb});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{nb(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:ib})},cancel:u}}}}));function hb(e,t){return e===`aria-selected`||e===`aria-checked`?t===`true`:e===`data-state`?t===`active`||t===`checked`||t===`on`:e===`data-checked`&&t!==null&&t!==`false`}function gb(e){let t=e.parentElement?.closest(Rb);if(!t||t.matches(`[role=listbox][aria-multiselectable=true]`))return null;let n=e.getAttribute(`role`),r=n?Ib[n]:void 0;return t.matches(Lb)||r&&t.matches(r)?t:null}function _b(e){return Vb.some(t=>hb(t,e.getAttribute(t)))}function vb(e,t){for(let n=t;n&&n!==e;n=n.parentElement)if(qb.has(n)||n.matches(Hb))return n}function yb(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,k:e.offsetWidth?t.width/e.offsetWidth:1}}function bb(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width/t.k,i=e.offsetHeight||n.height/t.k;return{x:(n.left+n.width/2-t.left)/t.k-r/2,y:(n.top+n.height/2-t.top)/t.k-i/2,width:r,height:i}}function xb(e,t){for(let n of t.querySelectorAll(Ub))if(n.closest(Rb)===e&&vb(e,n)===t)return n;for(let t of e.querySelectorAll(Wb))if(t.closest(Rb)===e&&!vb(e,t))return t}function Sb(e,t){return e.endsWith(`%`)?Number.parseFloat(e)/100*t:Number.parseFloat(e)||0}function Cb(e){X(e.element,{translate:null,scale:null});let t=getComputedStyle(e.element);e.rest=bb(e.element,yb(e.group));let[n=`0`,r=`0`]=t.translate===`none`?[]:t.translate.split(` `),[i=`50%`,a=`50%`]=t.transformOrigin.split(` `);e.translate=[Sb(n,e.rest.width),Sb(r,e.rest.height)],e.origin=[Sb(i,e.rest.width),Sb(a,e.rest.height)]}function wb(e,t,n){let r=t.width?n.width/t.width:1,i=t.height?n.height/t.height:1;return{x:n.x+(e.x-t.x)*r,y:n.y+(e.y-t.y)*i,width:e.width*r,height:e.height*i}}function Tb(e){return!!e&&(e.x.active||e.y.active||e.width.active||e.height.active)}function Eb(e){e.queued||(e.queued=!0,queueMicrotask(()=>{e.queued=!1,Db(e)}))}function Db(e){if(!e.ready)return;let{element:t,rest:n,translate:r,origin:i,x:a,y:o,width:s,height:c}=e;if(!Tb(e)){X(t,{translate:null,scale:null}),Mb(e);return}let l=n.width?s.value/n.width:1,u=n.height?c.value/n.height:1;X(t,{translate:`${a.value-(n.x-r[0])-i[0]*(1-l)}px ${o.value-(n.y-r[1])-i[1]*(1-u)}px`,scale:`${l} ${u}`})}function Ob(e,t,n,r,i){let a=Gb.get(e),o=Tb(a);a&&a.element!==t&&(X(a.element,{translate:null,scale:null}),Mb(a));let s=a??{element:t,group:e,ready:!1,rest:{x:0,y:0,width:0,height:0},translate:[0,0],origin:[0,0],queued:!1,x:cg(0,()=>Eb(s),lg.glide),y:cg(0,()=>Eb(s),lg.glide),width:cg(0,()=>Eb(s),lg.glide),height:cg(0,()=>Eb(s),lg.glide)};Gb.set(e,s),s.ready=!1,s.element=t,s.copyOf=i,Cb(s);let{rest:c}=s;if(!c.width||!c.height||!o&&!n)return s.ready=!0,Mb(s);if(!o&&n){let t=yb(e),i=wb(c,bb(r,t),bb(n,t));s.x.set(i.x),s.y.set(i.y),s.width.set(i.width),s.height.set(i.height)}for(let[e,t]of[[s.x,c.x],[s.y,c.y],[s.width,c.width],[s.height,c.height]])e.stop(),e.to(t);s.ready=!0,Db(s)}function kb(e){getComputedStyle(e).backgroundColor;for(let t of e.getAnimations())t instanceof CSSTransition&&Zb.includes(t.transitionProperty)&&t.finish()}function Ab(e){let t=e.getRootNode();(t instanceof Document||t instanceof ShadowRoot)&&($b||($b=new CSSStyleSheet,$b.replaceSync(Qb)),t.adoptedStyleSheets.includes($b)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,$b]))}function jb(e,t,n){kb(t),kb(n);let r=getComputedStyle(t),i=getComputedStyle(n),a=[],o={position:`absolute`,"z-index":`-1`,"box-sizing":`border-box`,margin:`0`,"pointer-events":`none`,"border-radius":i.borderRadius,"background-color":`transparent`,"box-shadow":`none`};i.backgroundColor!==r.backgroundColor&&!ex.test(i.backgroundColor)&&(o[`background-color`]=i.backgroundColor,a.push(`background`)),i.boxShadow!==r.boxShadow&&i.boxShadow!==`none`&&(o[`box-shadow`]=i.boxShadow,a.push(`shadow`));for(let e of Yb){let t=`border-${e}`,n=i.getPropertyValue(`${t}-width`),s=i.getPropertyValue(`${t}-color`);o[`${t}-width`]=n,o[`${t}-style`]=i.getPropertyValue(`${t}-style`),o[`${t}-color`]=`transparent`,Number.parseFloat(n)>0&&!ex.test(s)&&Xb.some(e=>{let n=`${t}-${e}`;return i.getPropertyValue(n)!==r.getPropertyValue(n)})&&(o[`${t}-color`]=s,a.push(t))}if(!a.length)return;let s=document.createElement(`span`);s.setAttribute(`aria-hidden`,`true`),s.setAttribute(`data-motion-copy`,``);for(let[e,t]of Object.entries(o))s.style.setProperty(e,t);Ab(e),e.append(s);let c=s.offsetParent instanceof HTMLElement?s.offsetParent:null,l=c&&(c!==document.body||getComputedStyle(c).position!==`static`)?c:null,u=bb(n,yb(l??document.documentElement));return s.style.left=`${u.x-(l?l.clientLeft-l.scrollLeft:0)}px`,s.style.top=`${u.y-(l?l.clientTop-l.scrollTop:0)}px`,s.style.width=`${u.width}px`,s.style.height=`${u.height}px`,{element:s,hidden:a}}function Mb(e){let t=e.copyOf;t&&(e.copyOf=void 0,t.removeAttribute(`data-motion-select-hidden`),kb(t),e.element.remove(),e.group.removeAttribute(`data-motion-select-moving`))}function Nb(e){let t=Gb.get(e);if(t){Gb.delete(e),t.ready=!1;for(let e of[t.x,t.y,t.width,t.height])e.stop();X(t.element,{translate:null,scale:null}),Mb(t)}}function Pb(e,t,n){if(Ih()||jg(n))return Nb(e);let r=xb(e,n);if(r)return jg(r)?Nb(e):Ob(e,r,t,n);let i=Gb.get(e),a=t??(Tb(i)?i?.copyOf:void 0);if(!a)return;let o=jb(e,a,n);o&&(n.setAttribute(`data-motion-select-hidden`,o.hidden.join(` `)),kb(n),Ob(e,o.element,t,n,n),o.element.isConnected&&e.setAttribute(`data-motion-select-moving`,``))}function Fb(){Jb=0;let e=[...Kb];Kb.clear();for(let[t,{from:n,to:r}]of e)r?.isConnected&&gb(r)===t&&_b(r)?Pb(t,n?.isConnected&&gb(n)===t?n:void 0,r):(!t.isConnected||Gb.has(t)&&![...t.querySelectorAll(Bb)].some(e=>_b(e)&&gb(e)===t))&&Nb(t)}var Ib,Lb,Rb,zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx=t((()=>{Mg(),Hh(),tg(),_g(),Ib={tab:`[role=tablist]`,radio:`[role=radiogroup]`,option:`[role=listbox]`,menuitemradio:`[role=group], [role=menu]`},Lb=`[data-motion-select]`,Rb=`[role=tablist], [role=radiogroup], [role=listbox], [role=group], [role=menu], ${Lb}`,zb=Object.keys(Ib).map(e=>`[role=${e}]`).join(`, `),Bb=`${zb}, ${Lb} *`,Vb=[`aria-selected`,`aria-checked`,`data-state`,`data-checked`],Hb=`${zb}, [aria-selected], [aria-checked], [data-checked], ${[`active`,`inactive`,`checked`,`unchecked`,`on`,`off`].map(e=>`[data-state=${e}]`).join(`, `)}`,Ub=`[data-motion-indicator], [data-slot=indicator]`,Wb=`${Ub}, [data-slot$="-indicator"]`,Gb=new WeakMap,Kb=new Map,qb=new WeakSet,Jb=0,Yb=[`top`,`right`,`bottom`,`left`],Xb=[`width`,`style`,`color`],Zb=[`background-color`,`box-shadow`,...Yb.flatMap(e=>Xb.map(t=>`border-${e}-${t}`))],Qb=[`[data-motion-select-moving] { isolation: isolate; }`,`[data-motion-select-hidden~="background"] { background-color: transparent !important; }`,`[data-motion-select-hidden~="shadow"] { box-shadow: none !important; }`,...Yb.map(e=>`[data-motion-select-hidden~="border-${e}"] { border-${e}-color: transparent !important; }`)].join(`
|
|
153
|
+
`),ex=/^transparent$|^rgba\((?:[^,]+,){3}\s*0(?:\.0+)?\)$|\/\s*0(?:\.0+)?%?\s*\)$/,tx={name:`select`,selector:Bb,state(e,{attribute:t,oldValue:n,value:r}){let i=hb(t,n),a=hb(t,r);if(i===a)return;let o=gb(e);if(!o)return;qb.add(e);let s=Kb.get(o)??{};a?s.to=e:s.from=e,Kb.set(o,s),Jb||=requestAnimationFrame(Fb)}}}));function rx(e){if(!(e instanceof HTMLInputElement))return e;let t=e.parentElement;return t?.matches(Mx)?t:void 0}function ix(e){return e.querySelectorAll(`:scope > [role=slider], :scope > ${Mx} > input[type=range]`)}function ax(e){return e.getAttribute(`aria-orientation`)===`vertical`||e.closest(`[data-orientation=vertical]`)?`y`:`x`}function ox(e,t){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();return{left:n/t.zoom,top:r/t.zoom,width:i/t.zoom,height:a/t.zoom}}function sx(e){return e.offsetWidth&&e.getBoundingClientRect().width/e.offsetWidth||1}function cx(e,t){return t===`x`?{start:e.left,size:e.width}:{start:e.top,size:e.height}}function lx(e){let{thumb:t,track:n,axis:r}=e;e.zoom=sx(n);let i=cx(ox(t,e),r),a=cx(ox(n,e),r);return e.length=a.size,i.start+i.size/2-a.start-(Fx.get(t)===e?e.position.value-e.layout:0)}function ux(e){return Number.parseFloat(e??``)}function dx({thumb:e,axis:t}){let{style:n}=e,r=t===`x`?n.left:n.top,i=t===`x`?n.right:n.bottom;return r&&!i?1:i&&!r||t===`y`||getComputedStyle(e).direction===`rtl`?-1:1}function fx(e,t,n,r){let i=ux(t.getAttribute(`aria-valuemin`)??t.getAttribute(`min`)),a=ux(t.getAttribute(`aria-valuemax`)??t.getAttribute(`max`)),o=Number.isFinite(i)?i:0,s=Number.isFinite(a)?a:100;if(!(s>o)||!Number.isFinite(n)||!Number.isFinite(r))return;let c=cx(ox(e.thumb,e),e.axis).size,l=(r-o)/(s-o),u=dx(e),d;for(let t of[e.length-c,e.length])for(let n of[u,-u]){let r=e.length/2+n*(l-.5)*t,i=Math.abs(r-e.layout);(!d||i<d.error)&&(d={error:i,travel:t,sign:n})}if(!(!d||d.error>3))return e.layout-d.sign*((r-n)/(s-o))*d.travel}function px(e){let[t=`0px`,n=`0px`]=e.split(` `).filter(Boolean);return{raw:e,x:t,y:n}}function mx(e,t){let n=e.parentElement;if(!n)return;let r=ax(t),i={thumb:e,track:n,range:n.querySelector(`:scope > [data-slot=range], :scope > [data-slot=slider-indicator]`),axis:r,layout:0,length:0,zoom:1,direction:1,held:!1,position:cg(0,(e,t)=>{Math.abs(t)>Ex*i.length&&(i.direction=t>0?1:-1),i.tail.to(Math.min(wx,Math.abs(t)*Tx)),vx(i)},xx),tail:cg(0,()=>vx(i),Sx),ownTranslate:px(e.style.translate)};return i.layout=lx(i),i.position.set(i.layout),Fx.set(e,i),i}function hx(e){Fx.delete(e.thumb),e.position.stop(),e.tail.stop(),X(e.thumb,{translate:e.ownTranslate.raw||null,scale:null}),gx(e),e.lane?.ownerSVGElement?.remove()}function gx(e){let{range:t,axis:n,track:r}=e;if(!t)return;let i=[...ix(r)].flatMap(t=>{let r=rx(t);if(!r)return[];let i=Fx.get(r),a=cx(ox(r,e),n);return[{center:a.start+a.size/2,moving:!!i&&Math.abs(i.position.value-i.layout)>=.01}]}),a=n===`x`?`minWidth`:`minHeight`,o=Ix.get(t);if(!i.some(e=>e.moving)){o&&(t.style[a]=o.minSize,X(t,{translate:o.translate,scale:o.scale}),Ix.delete(t));return}o||(o={minSize:t.style[a],scale:t.style.scale,translate:t.style.translate,shift:0},Ix.set(t,o),t.style[a]=`1px`);let s=Number.parseFloat(getComputedStyle(t)[n===`x`?`width`:`height`]);if(!(s>0))return;let c=cx(ox(t,e),n),l=c.start+c.size/2-o.shift-s/2,u=l+s,d=i.map(e=>e.center),f=Math.min(...d),p=Math.max(...d);i.length===1&&(dx(e)>0?f=l:p=u);let m=Math.max(0,p-f)/s,h=o.shift=(f+p)/2-(l+u)/2;X(t,{translate:n===`x`?`${h}px 0px`:`0px ${h}px`,scale:n===`x`?`${m} 1`:`1 ${m}`})}function _x(e){let{thumb:t,track:n,axis:r,direction:i,length:a,range:o}=e,s=Math.min(wx,e.tail.value);if(s<=2){e.lane?.setAttribute(`d`,``);return}if(!e.lane){let n=document.createElementNS(Ax,`svg`);n.setAttribute(`aria-hidden`,`true`),n.dataset.motion=`tail`,n.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;margin:0`;let r=document.createElementNS(Ax,`path`);r.style.fill=getComputedStyle(o??t).backgroundColor,n.append(r),e.lane=r}let c=e.lane.ownerSVGElement;c.isConnected||t.before(c);let l=ox(c,e),u=ox(n,e),d=ox(t,e),f=(r===`x`?d.height:d.width)/2/(e.held?Cx:1),p=r===`x`?d.top+d.height/2-l.top:d.left+d.width/2-l.left,m=r===`x`?u.left-l.left:u.top-l.top,h=Math.max(0,Math.min(a,e.position.value)),g=Math.min(s,i>0?h:a-h),_=i>0&&o?(r===`x`?o.offsetHeight:o.offsetWidth)/2:0,v=[],y=[];for(let e=0;e<=Dx;e++){let t=e/Dx,n=(m+h-i*g*t).toFixed(1),a=Math.max(_,f*.95*(1-t)**1.3),o=(p-a).toFixed(2),s=(p+a).toFixed(2);v.push(r===`x`?`${n} ${o}`:`${o} ${n}`),y.push(r===`x`?`${n} ${s}`:`${s} ${n}`)}e.lane.setAttribute(`d`,`M${v.join(`L`)}L${y.reverse().join(`L`)}Z`)}function vx(e){if(Fx.get(e.thumb)!==e)return;if(!e.held&&!e.position.active&&!e.tail.active){hx(e);return}let{thumb:t,axis:n}=e,r=e.position.value-e.layout,{x:i,y:a}=e.ownTranslate,o=n===`x`?`calc(${i} + ${r.toFixed(2)}px) ${a}`:`${i} calc(${a} + ${r.toFixed(2)}px)`,s=Math.abs(e.position.velocity)/Math.max(1,e.length),c=Math.min(kx,s*Ox),l=e.held?Cx:1,u=(l*(1+c)).toFixed(4),d=(l*(1-c*.25)).toFixed(4);X(t,{translate:o,scale:n===`x`?`${u} ${d}`:`${d} ${u}`}),gx(e),_x(e)}function yx(e,t,n,r){if(Ih()){let t=Fx.get(e);t&&hx(t);return}let i=Fx.get(e),a=i??mx(e,t);if(!a)return;let o=lx(a);if(!i){let e=n===void 0||r===void 0?void 0:fx(a,t,n,r);a.position.set(e??o)}Math.abs(o-a.layout)<.01&&i||(a.layout=o,a.position.to(o),vx(a))}function bx(e){return e.matches(`:disabled, [aria-disabled=true], [data-disabled]:not([data-disabled=false])`)}var xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx=t((()=>{c_(),tg(),Hh(),_g(),xx={stiffness:520,damping:38},Sx={stiffness:260,damping:30},Cx=1.12,wx=150,Tx=.13,Ex=.05,Dx=28,Ox=.09,kx=.55,Ax=`http://www.w3.org/2000/svg`,jx=`[role=slider], input[type=range]`,Mx=`[data-slot=slider-thumb]`,Nx=`[data-slot=range], [data-slot=slider-indicator]`,Px=`[data-slot=track], [data-slot=slider-track], :has(> [data-slot=range])`,Fx=new WeakMap,Ix=new WeakMap,Lx={name:`slider`,selector:`${jx}, ${Px}, [data-slot=slider-control]`,press(e,t){if(!(t instanceof PointerEvent))return;let n=t.composedPath()[0];if(!(n instanceof Element))return;let r=e.matches(`[data-slot=slider-control]`)?e.querySelector(`[data-slot=slider-track]`):e,i=e.matches(jx)?[e]:r&&(n===e||n===r||n.closest(Nx)?.parentElement===r)?ix(r):[],a,o=1/0;for(let e of i){let n=rx(e);if(!n||bx(e)||jg(e))continue;let r=n.getBoundingClientRect(),i=Math.hypot(r.left+r.width/2-t.clientX,r.top+r.height/2-t.clientY);i<o&&(o=i,a={thumb:n,value:e})}if(!a)return;let{thumb:s,value:c}=a,l=Fx.get(s)??mx(s,c);if(!l)return;l.held=!0,vx(l);let u=0;return{move(){u||=requestAnimationFrame(()=>{u=0,yx(s,c)})},release(){cancelAnimationFrame(u);let e=Fx.get(s);e&&(e.held=!1,yx(s,c),vx(e))}}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-valuenow`&&t!==`aria-valuetext`||!e.matches(jx))return;let i=rx(e);i&&yx(i,e,ux(n),ux(r))}}}));function zx(e){let t=e.querySelector(eS)??e.firstElementChild;return t instanceof HTMLElement?t:void 0}function Bx(e){return e===`true`}function Vx(e,t){X(t,{translate:null,scale:null});let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),[i=`0px`,a=`0px`]=getComputedStyle(t).translate.split(` `),o=e.offsetWidth?n.width/e.offsetWidth:1;return{rest:{center:(r.left+r.width/2-n.left)/o,width:r.width/o,height:r.height/o},translate:i===`none`?[`0px`,`0px`]:[i,a],width:t.offsetWidth,height:t.offsetHeight}}function Hx(e,t,n){let r=e.rest[+!!t];if(r)return r;let i=e.rest[+!t];return{...i,center:n-i.center}}function Ux(e,t){let{knob:n,now:r}=t;if(!t.position.active&&!t.size.active&&!t.press.active&&!t.press.target&&!t.wobble.active&&t.wobbleTimer===void 0){X(n,{translate:null,scale:null});return}let i=e.offsetWidth,a=Hx(t,!1,i),o=Hx(t,!0,i),s=t.position.value,c=t.size.value,l=Math.min(.55,Math.abs(t.velocity)*.09)+t.press.value*.4,u=1+l+t.wobble.value*.14,d=1-l*.25-t.wobble.value*.14,f=(a.width+(o.width-a.width)*c)*u,p=(a.height+(o.height-a.height)*c)*d,m=Math.min(a.center-a.width/2,o.center-o.width/2),h=Math.max(a.center+a.width/2,o.center+o.width/2),g=a.center+(o.center-a.center)*s,_=f/2,v=(m+_>h-_?(m+h)/2:Math.max(m+_,Math.min(h-_,g)))-(r.on?o:a).center;X(n,{translate:`calc(${r.translate[0]} + ${v.toFixed(2)}px) ${r.translate[1]}`,scale:`${(f/r.width).toFixed(4)} ${(p/r.height).toFixed(4)}`})}function Wx(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|translate|scale|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function Gx(e,t){let n=tS.get(e);if(n&&n.knob.isConnected&&e.contains(n.knob))return n;let r=zx(e);if(!r||Wx(r))return;let i=+!!t,a=()=>Ux(e,o),o={knob:r,rest:[void 0,void 0],now:{on:t,translate:[`0px`,`0px`],width:1,height:1},position:cg(i,(e,t)=>{o.velocity=t,a()},Jx),velocity:0,size:cg(i,a,Yx),press:cg(0,a,Xx),wobble:cg(0,a,Zx),wobbleTimer:void 0};return tS.set(e,o),o}function Kx(e,t,n){let{rest:r,translate:i,width:a,height:o}=Vx(e,t.knob);t.rest[+!!n]=r,t.now={on:n,translate:i,width:a,height:o}}function qx(e){return e.matches(`:disabled, [aria-disabled="true"]`)}var Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,rS=t((()=>{tg(),Hh(),_g(),Jx={stiffness:300,damping:24},Yx={stiffness:320,damping:16},Xx={stiffness:700,damping:32},Zx={stiffness:520,damping:9},Qx=170,$x=-5,eS=`[data-slot=thumb], [data-slot=switch-thumb]`,tS=new WeakMap,nS={name:`switch`,selector:`[role=switch]`,press(e){if(qx(e))return;let t=Bx(e.getAttribute(`aria-checked`)),n=Gx(e,t);if(n)return n.position.active||Kx(e,n,t),n.press.to(1),{release:()=>n.press.to(0)}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=Bx(r),a=Gx(e,Bx(n));a&&(Kx(e,a,i),a.position.to(+!!i),a.size.to(+!!i),clearTimeout(a.wobbleTimer),a.wobbleTimer=void 0,Ih()||(a.wobbleTimer=setTimeout(()=>{a.wobbleTimer=void 0,a.wobble.to(0,{velocity:$x})},Qx*ng())),Ux(e,a))}}}));function iS(e){let t=e.parentElement;if(!t||t.tagName!==`OL`&&t.tagName!==`UL`)return!1;let n=t.closest(`[role=region], [data-slot=toast-region]`);return!!n&&(yS(t)||yS(t.parentElement)||yS(n))}function aS(e){return e.top+e.height/2>innerHeight/2?`bottom`:`top`}function oS(e){return aS(e)===`bottom`?innerHeight-e.top:-(e.top+e.height)}function sS(e,t){if(t===`left`)return{axis:`x`,distance:-e.right};if(t===`right`)return{axis:`x`,distance:innerWidth-e.left};if(t===`up`)return{axis:`y`,distance:-e.bottom};if(t===`down`)return{axis:`y`,distance:innerHeight-e.top};let n=e.left+e.width/2;return Math.abs(n-innerWidth/2)<innerWidth/8?{axis:`y`,distance:oS(e)}:{axis:`x`,distance:n>innerWidth/2?innerWidth-e.left:-e.right}}function cS(e,t){let n=e.region.getAttribute(`data-align`);return n===`center`?e.region.getAttribute(`data-side`)===`top`?`up`:`down`:n===`start`||n===`end`?n===`start`==(getComputedStyle(e.region).direction===`rtl`)?`right`:`left`:t.getAttribute(`data-swipe-direction`)}function lS(e,t,n=!1){let r=`--reka-toast-swipe-${n?`end`:`move`}-${t}`;return Number.parseFloat(e.style.getPropertyValue(r)||e.style.getPropertyValue(`--toast-swipe-${t}`))||0}function uS(e,t,n,r){let i=Math.abs(t.value)<.01&&Math.abs(n.value)<.01,a=(e,t)=>`calc(${`${Math.round(e*100)/100}px`} + var(--reka-toast-swipe-move-${t}, var(--toast-swipe-${t}, 0px)))`;X(e,{translate:i&&!t.active&&!n.active?null:`${a(t.value,`x`)} ${a(n.value,`y`)}`,opacity:r&&(r.active||r.value<1)?String(r.value):null})}function dS(e,t){let n={element:e,rest:t},r=()=>uS(e,n.x,n.y,n.fade);return n.x=cg(0,r,lg.snappy),n.y=cg(0,r,lg.snappy),n}function fS(e,t){let n=e.velocity;e.set(e.value+t),e.to(0,{velocity:n})}function pS(e){for(let t of e.items.values()){if(!t.element.isConnected)continue;let e=t.element.getBoundingClientRect(),n={left:e.left-t.x.value-lS(t.element,`x`),top:e.top-t.y.value-lS(t.element,`y`),width:e.width,height:e.height},r=t.rest.left-n.left,i=t.rest.top-n.top;t.rest=n,Math.abs(r)>.5&&fS(t.x,r),Math.abs(i)>.5&&fS(t.y,i)}}function mS(e){if(e.watchFrames=12,e.frame)return;let t=()=>{pS(e),e.watchFrames=[...e.items.values()].some(e=>e.x.active||e.y.active)?Math.max(e.watchFrames,2):e.watchFrames-1,e.frame=e.watchFrames>0?requestAnimationFrame(t):0};e.frame=requestAnimationFrame(t)}function hS(e,t){let n=e.items.get(t);if(!n)return;e.items.delete(t),n.x.stop(),n.y.stop();let r=cS(e,t),i=t.getAttribute(`data-swipe`)===`end`||t.matches(`[data-slot=toast]`)&&t.hasAttribute(`data-swipe-direction`),a=i?t.getAttribute(`data-swipe-direction`):null,o=e.region.parentNode;if(o){let s=new DOMRect(n.rest.left+n.x.value+(i?lS(t,`x`,!0):0),n.rest.top+n.y.value+(i?lS(t,`y`,!0):0),n.rest.width,n.rest.height),c=Y_(t,o,e.region.nextSibling);if(X(c,{translate:null,opacity:null}),X_(c,s),Ih()){let e=cg(1,t=>{X(c,{opacity:String(t)}),!e.active&&t===0&&c.remove()});e.to(0,{tween:_S})}else{let{axis:e,distance:t}=sS(s,a??r),n=cg(0,r=>{let i=`${Math.round(r*100)/100}px`;X(c,{translate:e===`x`?`${i} 0px`:`0px ${i}`}),((t>0?r>=t:r<=t)||!n.active)&&(n.stop(),c.remove())},lg.snappy);n.to(t)}}pS(e),mS(e),e.items.size||(e.observer.disconnect(),vS.delete(e.element))}function gS(e){let t=e.parentElement,n=vS.get(t);if(n)return n;let r={element:t,items:new Map,observer:new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLElement&&!e.isConnected&&hS(r,e)}),region:t.closest(`[role=region], [data-slot=toast-region]`)??t,watchFrames:0,frame:0};return r.observer.observe(t,{childList:!0}),vS.set(t,r),n=r,n}var _S,vS,yS,bS,xS=t((()=>{Hh(),tg(),_g(),Q_(),_S=.15,vS=new WeakMap,yS=e=>!!e&&getComputedStyle(e).position===`fixed`,bS={name:`toast`,selector:`[role=region] li, [data-slot=toast]`,enter(e){if(!iS(e))return;let t=gS(e);if(t.items.has(e))return;pS(t);let n=e.getBoundingClientRect(),r=dS(e,{left:n.left,top:n.top,width:n.width,height:n.height});if(t.items.set(e,r),Ih()){let t=cg(0,()=>uS(e,r.x,r.y,t));r.fade=t,t.set(0),t.to(1,{tween:_S})}else r.y.set(oS(n)),r.y.to(0);mS(t)}}}));function SS(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function CS(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}function wS(e){if(e.matches(vC))return e;if(e.matches(`[role=tooltip]`))return SS(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&SS(t)?e:null}function TS(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function ES(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=CS(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function DS(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);X(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function OS(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function kS(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}function AS(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function jS(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!SS(t))}function MS(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!SS(t)).map(e=>e.textContent??``).join(``)}function NS(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}function PS(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(bC).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(bC).join(` `)})`);X(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${bC(u)} ${bC(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of jS(e))X(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${bC((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;X(e.old.element,{scale:h,opacity:String(t),filter:`blur(${bC((1-t)*5)})`})}}function FS(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function IS(e){if(!FS(e)){e.old?.element.remove(),e.old=void 0,X(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of jS(e))X(t,{scale:null,opacity:null,filter:null});e.done?.()}}function LS(e,t,n){let r=getComputedStyle(e),i=OS(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:kS(i,t,n),trigger:n,mode:NS(e)||e.matches(vC)?`clip`:`scale`,handoff:!e.matches(vC),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{PS(a),IS(a)};return a.x=cg(t.left+t.width/2,o,iC),a.y=cg(t.top+t.height/2,o,iC),a.width=cg(t.width,o,oC),a.label=cg(1,o),a.fade=cg(1,o),a}function RS(e){return e.handoff?lC:uC}function zS(e,t,n){let r=Z_(t,()=>{e.timers.delete(r),n(),IS(e)});e.timers.add(r)}function BS(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function VS(e){BS(e),gC.delete(e),_C===e&&(_C=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function HS(e){if(e){for(let e of gC)VS(e);for(let e of hC){let t=mC.get(e)?.box;t&&(BS(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,IS(t))}}}function US(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:yC(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function WS(e){return yC(e.side)?e.y:e.x}function GS(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=cg(n,()=>{PS(e),IS(e)});e.old={element:r,spring:i},i.to(0,{tween:dC})}function KS(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):jS(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function qS(e,t){let n=t.trigger?.getBoundingClientRect(),r=DS(e),i=LS(e,r,n);t.box=i,t.text=MS(i),t.label=KS(i),X(e,{opacity:null});let a=i.handoff&&_C&&US(_C,i)?_C:void 0;if(a&&(_C=void 0),Ih()){a&&JS(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:pC});return}if(a){let e=KS(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;VS(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),GS(i,e,n),i.x.to(r.left+r.width/2,{preset:iC,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:iC,velocity:t.y[1]}),i.width.to(r.width,{preset:oC,velocity:t.width[1]}),zS(i,cC,()=>i.label.to(1,{tween:lC.labelIn})),i.holding=!1,PS(i);return}WS(i).set(AS(i)),i.width.set(Math.min(sC,r.width)),i.label.set(0),PS(i),WS(i).to(yC(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:aC});let o=RS(i);zS(i,o.widenAfter,()=>{i.width.to(r.width,{preset:oC}),zS(i,o.labelAfterRise,()=>i.label.to(1,{tween:o.labelIn}))}),i.holding=!1}function JS(e,t){if(gC.add(e),e.holding=!1,t){e.done=()=>VS(e),e.fade.to(0,{tween:pC});return}e.handoff&&(_C=e),e.old&&e.old.spring.to(0,{tween:fC}),e.label.to(0,{tween:fC}),e.width.to(Math.min(sC,e.rest.width),{preset:oC});let n=RS(e);zS(e,n.sinkAfter,()=>{_C===e&&(_C=void 0),WS(e).to(AS(e),{preset:aC})}),zS(e,n.goneAfter,()=>VS(e))}function YS(e,t){if(!t.open)return;t.open=!1,hC.delete(e),t.stopWatch?.(),t.stopWatch=void 0,hC.size||rC();let n=t.box;if(t.box=void 0,X(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Y_(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;BS(n),n.old?.element.remove(),X(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of jS(n))X(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=XS(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(X(c,{scale:null}),X_(c,n.rest));let l=LS(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:cg(s,()=>PS(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);PS(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});JS(l,Ih())}function XS(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function ZS(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return ZS(e,t,n,r-1);n()})}function QS(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):YS(e,t)});return n(),()=>r.disconnect()}function $S(e){let t=mC.get(e);if(t?.open)return;let n=ES(e);if(n&&jg(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},mC.set(e,t),hC.add(e),nC(),X(e,{opacity:`0`}),t.stopWatch=QS(e,t);let i=t;ZS(e,t,()=>qS(e,i))}function eC(){xC=0;for(let e of hC){let t=mC.get(e),n=t?.box;if(!t||!n)continue;let r=DS(e),i=MS(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!FS(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=ES(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=KS(n),n.rest=r,n.side=OS(e,r,c),n.edge=kS(n.side,r,c),Ih()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:iC}),n.y.to(r.top+r.height/2,{preset:iC}),n.width.to(r.width,{preset:oC}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),GS(n,s,n.label.value),n.label.set(0),zS(n,cC,()=>n.label.to(1,{tween:RS(n).labelIn}))))}}function tC(){xC||=requestAnimationFrame(eC)}function nC(){CC??=Lh(HS),SC||(SC=!0,document.addEventListener(`pointerover`,tC,{capture:!0,passive:!0}),document.addEventListener(`focusin`,tC,{capture:!0,passive:!0}))}function rC(){SC=!1,cancelAnimationFrame(xC),xC=0,document.removeEventListener(`pointerover`,tC,{capture:!0}),document.removeEventListener(`focusin`,tC,{capture:!0})}var iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC=t((()=>{c_(),Hh(),tg(),_g(),Q_(),iC={stiffness:480,damping:36},aC={stiffness:380,damping:26},oC={stiffness:440,damping:32},sC=30,cC=40,lC={widenAfter:120,labelAfterRise:70,labelIn:.24,sinkAfter:90,goneAfter:520},uC={widenAfter:60,labelAfterRise:40,labelIn:.18,sinkAfter:50,goneAfter:320},dC=.15,fC=.14,pC=.15,mC=new WeakMap,hC=new Set,gC=new Set,vC=`[data-motion-appear]`,yC=e=>e===`top`||e===`bottom`,bC=e=>`${Math.round(e*100)/100}px`,xC=0,SC=!1,wC={enter(e){wS(e)===e&&TS(e)&&$S(e)},state(e){if(wS(e)!==e)return;let t=mC.get(e);TS(e)?$S(e):t&&YS(e,t)}},TC={name:`tooltip`,selector:`[role=tooltip], :has(> [role=tooltip])`,...wC},EC={name:`appear`,selector:vC,...wC}})),OC,kC=t((()=>{_v(),Av(),Ag(),Vv(),jy(),Ry(),Xy(),mb(),nx(),Rx(),rS(),xS(),DC(),OC=[pb,tx,nS,gv,Bv,TC,EC,bS,Lx,kg,ky,Ay,kv,Ly,Yy]}));function AC(e){let t=f_(e);return t.style.gridArea=`1 / 1`,{node:t,shown:1}}function jC(e){let t=l_(document.createElement(`span`));t.style.cssText=`display:inline-grid;overflow:hidden;justify-items:center`;let n=e?AC(e):void 0;return n&&t.append(n.node),{node:t,char:e,current:n,leaving:new Set}}function MC(e,t,n,r){e.shown=t;let i=1-t;X(e.node,{opacity:t>=1?null:String(Math.max(0,t)),filter:r||t>=1?null:`blur(${Math.max(0,zC*i).toFixed(2)}px)`,scale:r||t===1?null:String(1-.44999999999999996*i),translate:r||t===1?null:`0 ${(n*RC*i).toFixed(3)}em`})}function NC(e){return!e.frame.width.active&&e.columns.every(e=>!e.leaving.size&&!e.current?.fade)}function PC(e,t){UC.get(e)===t&&NC(t)&&(UC.delete(e),t.frame.collapse(t.text))}function FC(e,t,n=String){let r=n(t),i=UC.get(e),a=i?.text??e.textContent??``,o=i?.value??WC.get(e)??IC(a);if(WC.set(e,t),o===void 0||!i&&a===r||m_(e)){if(i){for(let e of i.columns)for(let t of[e.current,...e.leaving])t?.fade?.stop();UC.delete(e)}v_(e,r);return}let s=t>o?1:t<o?-1:0,c=h_();if(!i){let t=g_(e)??__(e,`end`,()=>{let t=UC.get(e);t&&PC(e,t)}),n=[...a].map(jC);t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),i={frame:t,text:a,value:o,columns:n},UC.set(e,i)}let l=i;l.frame.restore(),l.text=r,l.value=t,l.frame.name(r);let u=[...r],d=Math.max(u.length,l.columns.length);for(;l.columns.length<d;){let e=jC(``);l.frame.holder.prepend(e.node),l.columns.unshift(e)}let f=d-u.length;l.columns.forEach((t,n)=>{let r=u[n-f]??``;if(r===t.char)return;t.char=r;let i=t.current;if(i&&(i.fade?.stop(),t.leaving.add(i),i.fade=D_(i.shown,0,c?{duration:HC,ease:j_}:BC,e=>MC(i,e,-s,c),()=>{i.fade=void 0,i.node.remove(),t.leaving.delete(i),LC(e,l)})),t.current=void 0,!r)return;let a=AC(r);t.current=a,t.node.append(a.node),MC(a,0,s,c),a.fade=D_(0,1,c?{duration:HC,ease:j_}:VC,e=>MC(a,e,s,c),()=>{a.fade=void 0,MC(a,1,s,c),LC(e,l)})});let p=l.frame.width,m=l.columns.filter(e=>!e.char);for(let e of m)e.node.style.display=`none`;let h=l.frame.natural();for(let e of m)e.node.style.display=`inline-grid`;c?p.set(h):p.to(h)}function IC(e){let t=e.replace(/[^\d.-]/g,``),n=t?Number(t):NaN;return Number.isFinite(n)?n:void 0}function LC(e,t){UC.get(e)===t&&(t.columns=t.columns.filter(e=>e.char||e.leaving.size?!0:(e.node.remove(),!1)),PC(e,t))}var RC,zC,BC,VC,HC,UC,WC,GC=t((()=>{tg(),T_(),M_(),RC=1,zC=2,BC={duration:240,ease:A_},VC={duration:380,delay:60,ease:E_(.3,1.4,.5,1)},HC=150,UC=new WeakMap,WC=new WeakMap}));function KC(e,t,n){let r=e.width?n.width/e.width:1,i=e.height?n.height/e.height:1;return{x:n.left-t.x-r*(e.left-t.x),y:n.top-t.y-i*(e.top-t.y),scaleX:r,scaleY:i}}function qC(e){let{translate:t,scale:n}=e.style;X(e,{translate:null,scale:null});let r=e.getBoundingClientRect();X(e,{scale:`0.5`});let i=e.getBoundingClientRect();X(e,{translate:`100px 100px`});let a=e.getBoundingClientRect();return X(e,{translate:t,scale:n}),{box:r,origin:{x:2*i.left-r.left,y:2*i.top-r.top},pixels:{x:(a.left-i.left)/100||1,y:(a.top-i.top)/100||1}}}function JC(e,t){let n=YC.get(e);if(p_(e)||h_())return n?.stop(),{done:Promise.resolve(!1),stop(){}};let{box:r,origin:i,pixels:a}=qC(e),o=t.to??r,s=t.preset??lg.snappy,c,l=new Promise(e=>{c=e}),u=()=>{if(YC.get(e)!==h)return;let n=KC(r,i,{left:f.left.value,top:f.top.value,width:f.width.value,height:f.height.value});X(e,{translate:`${n.x/a.x}px ${n.y/a.y}px`,scale:`${n.scaleX} ${n.scaleY}`}),XC.some(e=>f[e].active)||(m(),t.to||(YC.delete(e),X(e,{translate:null,scale:null})),c(!0))},d=e=>cg(t.from?.[e]??n?.parts[e].value??r[e],u,s),f={left:d(`left`),top:d(`top`),width:d(`width`),height:d(`height`)},p=XC.map(e=>n?.parts[e].velocity??0),m=Lh(e=>{if(e)for(let e of XC)f[e].set(o[e])}),h={parts:f,stop(){if(YC.get(e)===h){m();for(let e of XC)f[e].stop();YC.delete(e),X(e,{translate:null,scale:null}),c(!1)}}};return n?.stop(),YC.set(e,h),XC.forEach((e,t)=>f[e].to(o[e],{velocity:p[t]})),u(),{done:l,stop:h.stop}}var YC,XC,ZC=t((()=>{Hh(),tg(),_g(),T_(),YC=new WeakMap,XC=[`left`,`top`,`width`,`height`]}));function QC(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}var $C=t((()=>{}));function ew(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function tw(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(cw))}function nw(e,t={}){let n=t.items??tw,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){X(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;X(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:cg(0,n,lg.snappy),y:cg(0,n,lg.snappy),grow:cg(1,n,rw),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),X(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:lg.snappy,velocity:n})}function f(t,n,r){if(!ew(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=QC(t);o.setAttribute(cw,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),X(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),Ih()){let e=O_(.15,e=>X(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=lw(r.getBoundingClientRect()),t=lw(n),i=O_(ow,n=>{X(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},sw);s.stop=i.stop,i.done.then(c);return}let l=cg(1,e=>{X(o,{scale:(aw+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},iw);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=lw(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=jg(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=lw(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!ew(a.rect)&&!ew(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!ew(n)||t.movesOnly)return;let o=l(e),s=_[i];if(Ih())o.from={x:0,y:0,scale:1};else if(s){let e=lw(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:aw};o.grow.set(0),o.grow.to(1,Ih()?{tween:.15}:{preset:rw})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}var rw,iw,aw,ow,sw,cw,lw,uw=t((()=>{M_(),$C(),c_(),Hh(),tg(),_g(),rw={stiffness:380,damping:26},iw={stiffness:260,damping:28},aw=.9,ow=.32,sw=E_(.5,0,.75,0),cw=`data-motion-ghost`,lw=e=>({x:e.left+e.width/2,y:e.top+e.height/2})})),dw=t((()=>{c_(),kC(),_v(),Av(),Ag(),Vv(),jy(),Ry(),Xy(),mb(),nx(),Rx(),rS(),xS(),DC(),tg(),Hh(),_g(),Dy(),cy(),GC(),T_(),M_(),z_(),ZC(),uw()}));function fw(e){return typeof document>`u`?()=>{}:Zg(e??document,{effects:OC})}var pw=t((()=>{kC(),c_()})),mw=t((()=>{dw(),pw()}));function hw(e){let t=e instanceof Element?e:e?.$el;return t instanceof HTMLElement?t:void 0}var gw=t((()=>{})),_w,vw=t((()=>{Y(),mw(),gw(),_w=G({inheritAttrs:!1,__name:`MotionList`,props:{origin:{type:Function},target:{type:Function}},setup(e){let t=Zl(),n,r;function i(e){let t=hw(e);t!==n&&(r?.destroy(),n=t,r=t?nw(t):void 0)}Fd(()=>r?.measure()),Id(()=>r?.play({origin:e.origin,target:e.target?.()})),Ld(()=>{r?.destroy(),r=void 0,n=void 0});let a=()=>q(df,t.default?.());return(e,t)=>Yl(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`motion-list`,ref:i},children:a()},()=>[Ru(`div`,qu(e.$attrs,{ref:i,"data-slot":`motion-list`}),[Yl(e.$slots,`default`)],16)])}})})),yw,bw=t((()=>{vw(),vw(),yw=_w})),xw,Sw=t((()=>{Y(),mw(),gw(),xw=G({inheritAttrs:!1,__name:`RollNumber`,props:{value:{},format:{type:Function},text:{}},setup(e){let t=e,n=e=>t.text??(t.format??String)(e),r=n(t.value),i=tc();function a(e){let r=hw(e);r&&(i.value&&r!==i.value&&(r.textContent=n(t.value)),i.value=r)}return W(()=>[i.value,t.value,t.text,t.format],([e,t])=>{e&&FC(e,t,n)},{flush:`post`}),(e,t)=>Yl(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`roll-number`,style:[e.$attrs.style,{fontVariantNumeric:`tabular-nums`}],ref:a},children:Hu(U(r))},()=>[Ru(`span`,qu(e.$attrs,{ref:a,"data-slot":`roll-number`,style:{fontVariantNumeric:`tabular-nums`}}),ss(U(r)),17)])}})})),Cw,ww=t((()=>{Sw(),Sw(),Cw=xw})),Tw=t((()=>{Y(),mw(),bw(),ww()})),Ew=t((()=>{Tw()}));function Dw(){let e=yl(Ow,void 0);return J(()=>({...kw,...Object.fromEntries(Object.entries(rc(e)??{}).filter(([,e])=>e))}))}var Ow,kw,Aw=t((()=>{Y(),Ow=Symbol(`ViteHubUIIcons`),kw={arrowLeft:`i-lucide-arrow-left`,arrowUp:`i-lucide-arrow-up`,check:`i-lucide-check`,chevronLeft:`i-lucide-chevron-left`,chevronRight:`i-lucide-chevron-right`,close:`i-lucide-x`,copy:`i-lucide-copy`,copyCheck:`i-lucide-check`,loading:`i-lucide-loader-circle`,external:`i-lucide-external-link`,file:`i-lucide-file`,plus:`i-lucide-plus`,reload:`i-lucide-refresh-cw`,stop:`i-lucide-square`,comment:`i-lucide-message-circle`,commentList:`i-lucide-list`,commentPage:`i-lucide-square-pen`,delete:`i-lucide-trash-2`,edit:`i-lucide-pencil`,reopen:`i-lucide-rotate-ccw`}})),jw,Mw=t((()=>{jw={"i-lucide-arrow-left":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m12 19l-7-7l7-7m7 7H5`}]],"i-lucide-arrow-up":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m5 12l7-7l7 7m-7 7V5`}]],"i-lucide-arrow-up-right":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 7h10v10M7 17L17 7`}]],"i-lucide-check":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`}]],"i-lucide-circle-alert":[[`circle`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,cx:`12`,cy:`12`,r:`10`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01`}]],"i-lucide-copy":[[`rect`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],"i-lucide-external-link":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]],"i-lucide-file":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14 2v5a1 1 0 0 0 1 1h5`}]],"i-lucide-inbox":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M22 12h-6l-2 3h-4l-2-3H2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11`}]],"i-lucide-list":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13`}]],"i-lucide-loader-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 1 1-6.219-8.56`}]],"i-lucide-message-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719`}]],"i-lucide-pencil":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`}]],"i-lucide-plus":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`}]],"i-lucide-refresh-cw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H3v5`}]],"i-lucide-rotate-ccw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 3v5h5`}]],"i-lucide-send":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11zm7.318-19.539l-10.94 10.939`}]],"i-lucide-square":[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,rx:`2`}]],"i-lucide-square-pen":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`}]],"i-lucide-trash-2":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]],"i-lucide-x":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18 6L6 18M6 6l12 12`}]]}}));function Nw(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:e.ownerDocument.body}var Pw,Fw,Iw,Lw,Rw=t((()=>{Y(),Mw(),Pw=G({name:`ViteHubIcon`,inheritAttrs:!1,props:{name:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=jw[e.name];return n?q(`svg`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`,fill:`none`,viewBox:`0 0 24 24`},n.map(([e,t])=>q(e,t))):q(`span`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`})}}}),Fw=G({name:`ViteHubButton`,inheritAttrs:!1,props:{color:{default:`primary`,type:String},disabled:{default:!1,type:Boolean},icon:{type:String},label:{type:String},loading:{default:!1,type:Boolean},size:{default:`md`,type:String},square:{default:!1,type:Boolean},to:{type:String},type:{default:`button`,type:String},variant:{default:`solid`,type:String}},setup(e,{attrs:t,slots:n}){return()=>{let r={...t,"aria-busy":e.loading?`true`:void 0,"data-color":e.color,"data-size":e.size,"data-square":e.square||!e.label&&!n.default?`true`:void 0,"data-variant":e.variant,"data-standalone-button":``},i=[e.icon?q(Pw,{name:e.icon}):null,e.label?q(`span`,e.label):null,n.default?.()];return e.to?q(`a`,{...r,href:e.to},i):q(`button`,{...r,disabled:e.disabled||e.loading,type:e.type},i)}}}),Iw=G({name:`ViteHubModal`,inheritAttrs:!1,props:{title:{type:String},ui:{default:()=>({}),type:Object}},setup(e,{slots:t}){let n=H(!1),r=H(null),i=H(null),a=()=>{n.value=!1,r.value?.querySelector(`button, a`)?.focus()},o=e=>{e.key===`Escape`&&n.value&&(e.stopPropagation(),a())};return W(n,e=>{e&&requestAnimationFrame(()=>i.value?.focus())}),Ld(()=>{n.value=!1}),()=>{let s=e.ui;return[q(`span`,{"data-slot":`standalone-modal-trigger`,onClick:()=>n.value=!0,ref:r},t.default?.()),n.value&&r.value?q(Od,{to:Nw(r.value)},q(`div`,{class:s.overlay,"data-slot":`standalone-modal`,onClick:e=>e.target===e.currentTarget&&a()},q(`div`,{"aria-label":e.title,"aria-modal":`true`,class:s.content,onKeydown:o,ref:i,role:`dialog`,tabindex:-1},t.content?.({close:a})))):null]}}}),Lw=G({name:`ViteHubTooltip`,inheritAttrs:!1,props:{text:String},setup(e,{slots:t}){return()=>(t.default?.()??[]).map(t=>Vu(t,{title:e.text}))}})})),zw=t((()=>{Rw()}));function Bw(e){if(!e)return!1;if(/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(e)||e.startsWith(`blob:`))return!0;try{let t=new URL(e,`https://vitehub.invalid`);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var Vw,Hw=t((()=>{Y(),Aw(),zw(),Vw=G({name:`ImagePreview`,inheritAttrs:!1,props:{alt:{default:``,type:String},compact:{default:!1,type:Boolean},src:{default:``,type:String},title:{type:String}},setup(e){let t=H(!1),n=J(()=>e.alt||e.title||`Image`),r=Dw();return W(()=>e.src,()=>{t.value=!1}),()=>Bw(e.src)?q(Iw,{title:n.value,transition:!1,ui:{overlay:`vh-image-overlay`,content:`vh-image-dialog`}},{default:()=>q(`button`,{"aria-label":`Preview ${n.value}`,class:[`vh-image-preview`,e.compact&&`vh-image-preview--compact`],title:e.title||n.value,type:`button`},t.value?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:n.value,loading:`lazy`,onError:()=>{t.value=!0},src:e.src})),content:({close:i})=>[q(`div`,{class:`vh-image-dialog__toolbar`},[q(`span`,{class:`vh-image-dialog__name`,title:n.value},n.value),q(Fw,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,icon:r.value.external,external:!0,to:e.src,target:`_blank`,rel:`noreferrer`,variant:`ghost`}),q(Fw,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:r.value.close,onClick:i,variant:`ghost`})]),t.value?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:n.value,class:`vh-image-dialog__image`,onError:()=>{t.value=!0},src:e.src})]}):q(`span`,{class:`vh-image-unavailable`},n.value)}})})),Uw,Ww,Gw=t((()=>{Y(),Ew(),Aw(),uw(),ZC(),Hw(),zw(),Uw=250,Ww=G({name:`CommentImageStack`,props:{images:{required:!0,type:Array},disabled:{default:!1,type:Boolean},origin:{type:Function}},emits:[`remove`],setup(e,{emit:t}){let n=Dw(),r=H(),i=H(),a=H(!1),o=H({left:0,width:0,scrollable:!1,below:!1}),s,c,l,u=!1,d=!1,f=!1,p,m=()=>[...i.value?.children??[]].filter(e=>e instanceof HTMLElement&&e.hasAttribute(`data-key`)&&!e.hasAttribute(`data-motion-ghost`));function h(){let t=r.value;if(!t)return;let n=(t.closest(`[data-slot=comment-composer-box]`)??t).getBoundingClientRect(),i=Math.max(0,n.left),a=t.ownerDocument.documentElement,s=Math.max(0,Math.min(a.clientWidth,n.right)-i),c=t.getBoundingClientRect(),l=i-c.left,u=Number.parseFloat(getComputedStyle(a).fontSize)||16,d=s<(e.images.length*4+.5)*u,f=c.top<4.5*u&&a.clientHeight-c.bottom>c.top;(o.value.left!==l||o.value.width!==s||o.value.scrollable!==d||o.value.below!==f)&&(o.value={left:l,width:s,scrollable:d,below:f})}function g(t){clearTimeout(l),t&&e.images.length===0&&(t=!1),a.value!==t&&(p=new Map(m().map(e=>[e,e.getBoundingClientRect()])),t&&h(),a.value=t)}let _=()=>{clearTimeout(l),l=setTimeout(()=>{!d&&!u&&g(!1)},Uw)};Pd(()=>{i.value&&(c=nw(i.value));let e=r.value?.closest(`[data-slot=comment-composer-box]`);e&&typeof ResizeObserver<`u`&&(s=new ResizeObserver(()=>{a.value&&h()}),s.observe(e))}),Fd(()=>{p||c?.measure()}),Id(()=>{e.images.length===0&&a.value&&g(!1),a.value&&h();let t=p;if(p=void 0,!t)return c?.play({origin:e.origin?.()??void 0});for(let[e,n]of t)e.isConnected&&JC(e,{from:n})}),Ld(()=>{clearTimeout(l),s?.disconnect(),c?.destroy()});let v=J(()=>e.images.length===1?`1 picture`:`${e.images.length} pictures`);return()=>{let s=e.images.length;return q(`div`,{"data-fanned":a.value?`true`:void 0,"data-slot":`comment-image-stack`,onFocusin:e=>{d=!0,f||e.target instanceof Element&&e.target.matches(`:focus-visible`)&&g(!0)},onFocusout:e=>{e.relatedTarget instanceof Node&&r.value?.contains(e.relatedTarget)||(d=!1,_())},onKeydown:e=>{e.key===`Escape`&&!e.defaultPrevented&&a.value&&(e.preventDefault(),e.stopPropagation(),g(!1),f=!0,r.value?.querySelector(`[data-slot=comment-image-stack-toggle]`)?.focus(),f=!1)},onPointerenter:e=>{e.pointerType===`mouse`&&(u=!0,g(!0))},onPointerleave:e=>{e.pointerType===`mouse`&&(u=!1,_())},ref:r,role:`group`,"aria-label":`Attached ${v.value}`,style:{"--vh-fan-left":`${o.value.left}px`,"--vh-fan-room":`${o.value.width}px`,"--vh-fan-count":s}},[q(`button`,{"aria-expanded":String(a.value),"aria-label":`Show ${v.value}`,"data-slot":`comment-image-stack-toggle`,onClick:()=>g(u||!a.value),type:`button`}),q(`div`,{"data-slot":`comment-image-stack-cards`,"data-scrollable":a.value&&o.value.scrollable?`true`:void 0,"data-below":o.value.below?``:void 0,ref:i},e.images.map((r,i)=>q(`div`,{"data-key":r.key,"data-slot":`comment-image-stack-card`,inert:!a.value||void 0,key:r.key,style:{"--vh-stack-depth":s-1-i}},[q(Vw,{alt:r.name,compact:!0,src:r.url}),q(Fw,{"aria-label":`Remove ${r.name}`,color:`neutral`,"data-slot":`comment-image-stack-remove`,disabled:e.disabled,icon:n.value.close,onClick:()=>t(`remove`,r.key),size:`xs`,square:!0,variant:`ghost`})]))),s>1?q(Cw,{value:s},{render:({props:e,children:t})=>q(`span`,{...e,"aria-hidden":`true`,"data-slot":`comment-image-stack-count`},[t])}):null])}}})})),Kw,qw,Jw=t((()=>{Y(),Kw=[`data-status`,`data-size`,`data-orientation`],qw=G({__name:`Attachment`,props:{status:{default:`done`},size:{default:`md`},orientation:{default:`horizontal`}},setup(e){return(t,n)=>(K(),Pu(`div`,{"data-slot":`attachment`,"data-status":e.status,"data-size":e.size,"data-orientation":e.orientation},[Yl(t.$slots,`default`)],8,Kw))}})})),Yw,Xw=t((()=>{Jw(),Jw(),Yw=qw})),Zw,Qw=t((()=>{Zw={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}})),$w,eT=t((()=>{$w=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)}}));function tT(e){return e!=null}function nT(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Zw.width,a=e.size??e.height??Zw.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?$w(...c):$w(`lucide`,...s,...c),u=t.strokeWidth??Zw[`stroke-width`];if(t.absoluteStrokeWidth){let n=Number(u)*Number(e.size??e.width??Zw.width)/Number(t.size??t.width??Zw.width);Number.isFinite(n)&&(u=n)}return[`svg`,{...Object.entries(Zw).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&tT(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&tT(t.width)&&{[r(`width`)]:t.width},...`height`in t&&tT(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}var rT=t((()=>{Qw(),eT()})),iT,aT=t((()=>{iT=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1}})),oT,sT=t((()=>{oT=e=>e===``})),cT,lT=t((()=>{cT=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase()}));function uT(){return yl(dT,{})}var dT,fT=t((()=>{Y(),dT=Symbol(`lucide-icons`)})),pT,mT=t((()=>{Y(),rT(),aT(),sT(),lT(),fT(),pT=({name:e,iconNode:t,"icon-node":n,icon:r={name:e&&cT(e),node:t??n??[],size:24,aliases:[]},absoluteStrokeWidth:i,"absolute-stroke-width":a,nonScalingStroke:o,"non-scaling-stroke":s,strokeWidth:c,"stroke-width":l,size:u,width:d=u,height:f=u,color:p,...m},{slots:h})=>{let{size:g,color:_,strokeWidth:v=2,absoluteStrokeWidth:y=!1,nonScalingStroke:b=!1,class:x=``}=uT(),S=oT(i)||oT(a)||i===!0||a===!0||y===!0,C=oT(o)||oT(s)||o===!0||s===!0||b===!0;delete m.class;let w=h.default?.(),[,T,E=[]]=nT(r,{color:p??_,width:d??u??g,height:f??u??g,strokeWidth:c??l??v,absoluteStrokeWidth:S,nonScalingStroke:C,className:x,hasA11yProp:w!=null&&w.length>0||iT(m),attributes:m});return q(`svg`,T,[...E.map(([e,t])=>q(e,t)),...w??[]])}}));function hT(e,t=[]){let n=typeof e==`string`?{name:e,node:t}:e;return(e,{slots:t})=>q(pT,{...e,icon:n},t.default?{default:t.default}:void 0)}var gT=t((()=>{Y(),mT()})),_T,vT,yT=t((()=>{gT(),_T={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]},vT=hT(_T)})),bT,xT,ST=t((()=>{gT(),bT={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]},xT=hT(bT)})),CT,wT,TT=t((()=>{gT(),CT={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]},wT=hT(CT)})),ET,DT,OT=t((()=>{gT(),ET={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]},DT=hT(ET)})),kT,AT,jT=t((()=>{gT(),kT={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]},AT=hT(kT)})),MT,NT,PT=t((()=>{gT(),MT={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]},NT=hT(MT)})),FT,IT,LT=t((()=>{gT(),FT={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]},IT=hT(FT)})),RT,zT,BT=t((()=>{gT(),RT={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]},zT=hT(RT)})),VT,HT,UT=t((()=>{gT(),VT={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]},HT=hT(VT)})),WT,GT,KT=t((()=>{gT(),WT={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]},GT=hT(WT)})),qT,JT,YT=t((()=>{gT(),qT={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]},JT=hT(qT)})),XT=t((()=>{gT(),yT(),ST(),TT(),OT(),jT(),PT(),LT(),BT(),UT(),KT(),YT(),fT(),mT()})),ZT,QT,$T=t((()=>{Y(),XT(),ZT=[`aria-label`,`disabled`],QT=G({__name:`AttachmentAction`,props:{label:{default:`Remove`},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(K(),Pu(`button`,{type:`button`,"data-slot":`attachment-action`,"aria-label":e.label,disabled:e.disabled},[Yl(t.$slots,`default`,{},()=>[bf(U(JT),{"aria-hidden":`true`})])],8,ZT))}})})),eE,tE=t((()=>{$T(),$T(),eE=QT})),nE,rE,iE=t((()=>{Y(),nE={"data-slot":`attachment-actions`},rE=G({__name:`AttachmentActions`,setup(e){return(e,t)=>(K(),Pu(`div`,nE,[Yl(e.$slots,`default`)]))}})})),aE,oE=t((()=>{iE(),iE(),aE=rE})),sE,cE,lE=t((()=>{Y(),sE={"data-slot":`attachment-content`},cE=G({__name:`AttachmentContent`,setup(e){return(e,t)=>(K(),Pu(`div`,sE,[Yl(e.$slots,`default`)]))}})})),uE,dE=t((()=>{lE(),lE(),uE=cE})),fE,pE,mE=t((()=>{Y(),fE={"data-slot":`attachment-group`},pE=G({__name:`AttachmentGroup`,setup(e){return(e,t)=>(K(),Pu(`div`,fE,[Yl(e.$slots,`default`)]))}})})),hE,gE=t((()=>{mE(),mE(),hE=pE})),_E,vE,yE=t((()=>{Y(),_E=[`data-kind`],vE=G({__name:`AttachmentMedia`,props:{kind:{default:`icon`}},setup(e){return(t,n)=>(K(),Pu(`div`,{"data-slot":`attachment-media`,"data-kind":e.kind},[Yl(t.$slots,`default`)],8,_E))}})})),bE,xE=t((()=>{yE(),yE(),bE=vE})),SE,CE,wE=t((()=>{Y(),SE={"data-slot":`attachment-title`},CE=G({__name:`AttachmentTitle`,setup(e){return(e,t)=>(K(),Pu(`span`,SE,[Yl(e.$slots,`default`)]))}})})),TE,EE=t((()=>{wE(),wE(),TE=CE})),DE=t((()=>{Xw(),tE(),oE(),dE(),Y(),gE(),xE(),EE()})),OE=t((()=>{DE()}));function kE(e){let t=e.replace(/@.*/,``).trim().split(/[\s._-]+/).filter(Boolean),n=t[0]??``,r=t.length>1?t.at(-1)??``:n.slice(1);return(n.slice(0,1)+r.slice(0,1)).toUpperCase()||`?`}var AE=t((()=>{})),jE,ME,NE,PE,FE,IE,LE=t((()=>{Y(),Tw(),AE(),jE=[`data-size`,`data-variant`,`aria-label`],ME=[`title`],NE=[`src`],PE={key:1,"data-slot":`avatar-stack-fallback`},FE=[`title`],IE=G({__name:`AvatarStack`,props:{people:{},max:{default:3},size:{default:`md`},variant:{default:`solid`}},setup(e){let t=J(()=>{let t=new Set;return e.people.filter(e=>!t.has(e.id)&&t.add(e.id))}),n=J(()=>{let n=e.max===null?1/0:Math.max(2,e.max);return t.value.length>n?t.value.slice(0,n-1):t.value}),r=J(()=>t.value.slice(n.value.length)),i=J(()=>`${t.value.length} ${t.value.length===1?`person`:`people`}: ${t.value.map(e=>e.name).join(`, `)}`);return(t,a)=>(K(),Pu(`div`,{"data-slot":`avatar-stack`,"data-size":e.size,"data-variant":e.variant,role:`group`,"aria-label":i.value},[(K(!0),Pu(df,null,ql(n.value,e=>(K(),Pu(`span`,{key:e.id,"data-slot":`avatar-stack-item`,"aria-hidden":`true`,title:e.name,style:ao(e.color?{"--vh-avatar-color":e.color}:void 0)},[e.image?(K(),Pu(`img`,{key:0,"data-slot":`avatar-stack-image`,alt:``,src:e.image},null,8,NE)):(K(),Pu(`span`,PE,ss(U(kE)(e.name)),1))],12,ME))),128)),r.value.length?(K(),Pu(`span`,{key:0,"data-slot":`avatar-stack-count`,"aria-hidden":`true`,title:r.value.map(e=>e.name).join(`, `)},[a[0]||=Hu(`+`,-1),bf(U(Cw),{value:r.value.length},null,8,[`value`])],8,FE)):Uu(``,!0)],8,jE))}})})),RE,zE=t((()=>{LE(),LE(),RE=IE})),BE=t((()=>{zE()})),VE=t((()=>{BE()}));function HE(){return yl(UE,void 0)}var UE,WE=t((()=>{Y(),UE=Symbol(`PromptInput`)})),GE,KE,qE,JE=t((()=>{Y(),XT(),WE(),GE=[`accept`,`aria-label`,`disabled`,`multiple`],KE=[`data-variant`,`aria-label`,`disabled`],qE=G({inheritAttrs:!1,__name:`PromptInputAttach`,props:{variant:{default:`outline`},disabled:{type:Boolean,default:!1},label:{default:`Add attachment`}},setup(e){let t=Ql(),n=HE(),r=Pl(`input`);n&&ps(n.addAttach(()=>e.disabled));let i=()=>e.disabled||(n?.disabled.value??!0);async function a(e){let t=e.currentTarget;t instanceof HTMLInputElement&&n&&(await n.addFiles(t.files??[]),t.value=``)}return(o,s)=>U(n)?(K(),Pu(df,{key:0},[Ru(`input`,{ref_key:`input`,ref:r,type:`file`,"data-slot":`visually-hidden`,tabindex:`-1`,accept:U(n).accept.value,"aria-label":e.label,disabled:i(),multiple:!U(n).single.value,onChange:a},null,40,GE),Ru(`button`,qu(U(t),{type:`button`,"data-slot":`prompt-input-attach`,"data-variant":e.variant,"aria-label":e.label,disabled:i(),onClick:s[0]||=e=>r.value?.click()}),[Yl(o.$slots,`default`,{},()=>[bf(U(IT),{"data-slot":`prompt-input-attach-icon`,"aria-hidden":`true`})])],16,KE)],64)):Uu(``,!0)}})})),YE,XE=t((()=>{JE(),JE(),YE=qE})),ZE,QE,$E=t((()=>{Y(),XT(),DE(),WE(),ZE=[`src`,`alt`],QE=G({__name:`PromptInputAttachments`,props:{disabled:{type:Boolean,default:!1}},setup(e){let t=HE();return(n,r)=>U(t)&&U(t).files.value.length>0?(K(),Fu(U(hE),{key:0,"data-slot":`prompt-input-attachments`},{default:gl(()=>[(K(!0),Pu(df,null,ql(U(t).files.value,(n,r)=>(K(),Fu(U(Yw),{key:`${n.filename}-${r}`,size:`xs`},{default:gl(()=>[bf(U(bE),{kind:n.mediaType.startsWith(`image/`)?`image`:`icon`},{default:gl(()=>[n.mediaType.startsWith(`image/`)?(K(),Pu(`img`,{key:0,src:n.url,alt:n.filename??n.mediaType},null,8,ZE)):(K(),Fu(U(xT),{key:1,"aria-hidden":`true`}))]),_:2},1032,[`kind`]),bf(U(uE),null,{default:gl(()=>[bf(U(TE),null,{default:gl(()=>[Hu(ss(n.filename??n.mediaType),1)]),_:2},1024)]),_:2},1024),bf(U(aE),null,{default:gl(()=>[bf(U(eE),{label:`Remove ${n.filename??`attachment`}`,disabled:e.disabled||U(t).disabled.value,onClick:e=>U(t).removeFile(r)},null,8,[`label`,`disabled`,`onClick`])]),_:2},1024)]),_:2},1024))),128))]),_:1})):Uu(``,!0)}})})),eD,tD=t((()=>{$E(),$E(),eD=QE})),nD,rD,iD=t((()=>{Y(),XT(),WE(),nD=[`data-status`,`data-variant`,`data-loading`,`aria-label`,`disabled`],rD=G({inheritAttrs:!1,__name:`PromptInputSubmit`,setup(e){let t=Ql(),n=HE(),r={error:`Retry prompt`,ready:`Send prompt`,streaming:`Stop response`,submitted:`Stop response`},i=J(()=>n?.status.value??`ready`),a=J(()=>i.value===`ready`&&n?.submitLabel.value||r[i.value]),o=J(()=>i.value===`ready`&&!!(n?.preparing.value||n?.readonly.value)),s=J(()=>i.value===`ready`&&!n?.canSubmit.value||i.value===`error`&&!!n?.disabled.value),c=J(()=>i.value===`ready`&&!n?.canSubmit.value?`soft`:`solid`),l=J(()=>({canSubmit:n?.canSubmit.value??!1,preparing:n?.preparing.value??!1,status:i.value}));return(e,r)=>U(n)?(K(),Pu(df,{key:0},[r[1]||=Ru(`span`,{"data-slot":`prompt-input-spacer`},null,-1),Ru(`button`,qu(U(t),{type:`button`,"data-slot":`prompt-input-submit`,"data-status":i.value,"data-variant":c.value,"data-loading":o.value?``:void 0,"aria-label":a.value,disabled:s.value||o.value,onClick:r[0]||=e=>U(n).press()}),[Yl(e.$slots,`default`,co(Bu(l.value)),()=>[o.value?(K(),Fu(U(DT),{key:0,class:`vh-prompt-input-spinner`,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`ready`?(K(),Fu(U(vT),{key:1,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`error`?(K(),Fu(U(zT),{key:2,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):(K(),Fu(U(GT),{key:3,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`}))])],16,nD)],64)):Uu(``,!0)}})})),aD,oD=t((()=>{iD(),iD(),aD=rD})),sD,cD,lD=t((()=>{Y(),WE(),q_(),sD=[`aria-label`,`enterkeyhint`,`placeholder`,`aria-busy`,`disabled`,`readonly`,`value`],cD=G({__name:`PromptInputTextarea`,setup(e){let t=HE(),n=H(!1);Pd(()=>{n.value=K_()});function r(e){!t||e.key!==`Enter`||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.isComposing||K_()||(e.preventDefault(),t.status.value===`ready`&&!t.disabled.value&&!t.readonly.value&&t.requestSubmit())}async function i(e){let n=e.clipboardData;if(!t?.takesFiles.value||!n)return;let r=n.getData(`text/plain`).length>0,i=Array.from(n.files).filter(e=>e.type.startsWith(`image/`)||!r);i.length>0&&await t.addFiles(i,()=>e.preventDefault())}function a(e){t&&e.target instanceof HTMLTextAreaElement&&(t.text.value=e.target.value)}return(e,o)=>U(t)?(K(),Pu(`textarea`,{key:0,"data-slot":`prompt-input-textarea`,"aria-label":U(t).label.value,enterkeyhint:n.value?`enter`:`send`,placeholder:U(t).placeholder.value,"aria-busy":U(t).readonly.value?`true`:void 0,disabled:U(t).disabled.value,readonly:U(t).readonly.value,rows:`1`,value:U(t).text.value,onInput:a,onKeydown:r,onPaste:i},null,40,sD)):Uu(``,!0)}})})),uD,dD=t((()=>{lD(),lD(),uD=cD})),fD,pD,mD=t((()=>{Y(),fD={"data-slot":`prompt-input-toolbar`},pD=G({__name:`PromptInputToolbar`,setup(e){return(e,t)=>(K(),Pu(`div`,fD,[Yl(e.$slots,`default`)]))}})})),hD,gD=t((()=>{mD(),mD(),hD=pD})),_D,vD,yD=t((()=>{Y(),WE(),q_(),XE(),tD(),oD(),dD(),gD(),_D={"data-focus-frame":``,"data-slot":`prompt-input-group`},vD=G({inheritAttrs:!1,__name:`PromptInput`,props:{modelValue:{},defaultValue:{default:``},files:{},defaultFiles:{},status:{default:`ready`},accept:{},single:{type:Boolean,default:!1},filterFiles:{type:Function},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{},submitLabel:{}},emits:[`update:modelValue`,`update:files`,`submit`,`stop`,`retry`,`error`],setup(e,{emit:t}){let n=t,r=Ql(),i=Pl(`form`),a=H(e.defaultValue),o=J({get:()=>e.modelValue??a.value,set:e=>{a.value=e,n(`update:modelValue`,e)}}),s=tc(e.defaultFiles??[]),c=J(()=>e.files??s.value);function l(e){s.value=e,n(`update:files`,e)}let u=H(0),d=J(()=>u.value>0),f=J(()=>e.status===`ready`&&!e.disabled&&!e.readonly&&!d.value&&(o.value.trim().length>0||c.value.length>0)),p=tc([]),m=J(()=>!e.disabled&&p.value.some(e=>!e()));function h(e){return p.value=[...p.value,e],()=>{p.value=p.value.filter(t=>t!==e)}}let g=!1,_=0,v=new Map;Ld(()=>{g=!0});async function y(t,r){if(e.disabled)return;let i=_++;u.value++;try{let n=Array.from(t),a=e.filterFiles?.(n)??n;if(a.length===0)return;r?.();let o=await Promise.all(Array.from(a,G_));g||v.set(i,o)}catch(e){g||n(`error`,{error:e})}finally{if(u.value--,!g&&u.value===0&&v.size>0){let t=[...v].sort(([e],[t])=>e-t).flatMap(([,e])=>e);v.clear(),l(U_(c.value,t,e.single))}}}function b(e){e.preventDefault(),f.value&&n(`submit`,{files:c.value,text:o.value.trim()})}return vl(UE,{text:o,files:c,status:J(()=>e.status),disabled:J(()=>e.disabled),readonly:J(()=>e.readonly),placeholder:J(()=>e.placeholder),accept:J(()=>e.accept),single:J(()=>e.single),submitLabel:J(()=>e.submitLabel),label:J(()=>typeof r[`aria-label`]==`string`?r[`aria-label`]:`Message`),canSubmit:f,preparing:d,takesFiles:m,addAttach:h,addFiles:y,removeFile:t=>{e.disabled||l(c.value.filter((e,n)=>n!==t))},requestSubmit:()=>i.value?.requestSubmit(),press:()=>{e.status===`streaming`||e.status===`submitted`?n(`stop`):e.status===`error`?n(`retry`):i.value?.requestSubmit()}}),(t,n)=>(K(),Pu(`form`,qu({ref_key:`form`,ref:i},U(r),{"data-slot":`prompt-input`,onSubmit:b}),[Ru(`div`,_D,[Yl(t.$slots,`default`,{canSubmit:f.value,preparing:d.value,status:e.status},()=>[bf(eD),bf(uD),bf(hD,null,{default:gl(()=>[bf(YE),bf(aD)]),_:1})])])],16))}})})),bD,xD=t((()=>{yD(),yD(),bD=vD})),SD=t((()=>{xD(),XE(),tD(),oD(),dD(),gD()})),CD=t((()=>{SD()})),wD,TD,ED,DD,OD,kD,AD,jD,MD=t((()=>{Y(),Bp(),Mh(),z_(),Sh(),H_(),J_(),Gw(),Aw(),OE(),VE(),CD(),zw(),wD=/^\S{2,}$/u,TD={comment:`Add a comment`,edit:`Edit your comment`,reply:`Reply`},ED={comment:`Comment`,edit:`Save`,reply:`Reply`},DD={comment:`Comment`,edit:`Edit comment`,reply:`Reply`},OD=e=>{let t=e.getData(`text/plain`).length>0;return Array.from(e.files).filter(e=>e.type.startsWith(`image/`)||!t)},kD=2e3,AD=1e3,jD=G({name:`CommentComposer`,props:{modelValue:{default:``,type:String},mentions:{default:()=>[],type:Array},files:{type:Array},user:{type:Object},variant:{default:`comment`,type:String},placeholder:{type:String},busy:{default:!1,type:Boolean},error:{type:String},autofocus:{default:!0,type:Boolean},guard:{default:!0,type:Boolean},people:{default:()=>[],type:Array},participants:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},allowEmpty:{default:void 0,type:Boolean},layout:{default:`box`,type:String},size:{default:`md`,type:String},frame:{default:`field`,type:String}},emits:[`update:modelValue`,`update:mentions`,`update:files`,`submit`,`cancel`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=V_(),a=H(null),o=H(null),s=H(null),c=H(),l=H(!1),u=new Map,d=Ml(),f=e=>`${d}-option-${e}`,p,m=H(!1),h;W(m,e=>{clearTimeout(h),e&&(h=setTimeout(()=>m.value=!1,kD))});let g=0,_,v,y=H([]),b=J(()=>e.files??y.value);W([()=>e.modelValue,b],()=>m.value=!1);let x=J(()=>e.attachments&&e.variant!==`edit`),S=J(()=>e.allowEmpty??e.variant===`reply`),C=new WeakMap,w=new Set,T=[],E=e=>{let t=C.get(e);return t||(t={filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:URL.createObjectURL(e)},C.set(e,t),w.add(t.url)),t},D=J(()=>b.value.map(E));W(()=>[...b.value],(e,t)=>{for(let n of t){let t=C.get(n);t&&!e.includes(n)&&(C.delete(n),T.push(setTimeout(()=>{URL.revokeObjectURL(t.url),w.delete(t.url)},AD)))}});function O(n){e.busy||(y.value=n,c.value=void 0,t(`update:files`,n))}function k(t){if(!x.value)return[];let n=Array.from(t).filter(t=>W_(t,e.accept));return n.length>0&&O([...b.value,...n]),n}let A=J(()=>[...e.people,...i?.people.value??[]]),ee=e=>{let t=A.value.find(t=>t.id===e);return u.get(e)??(t?bh(t):void 0)},j=()=>e.users?e.users:i?i.users:e.people.length>0?async()=>e.people:void 0,M=()=>e.user?.id??i?.user.value?.id,N=()=>a.value?.querySelector(`textarea`)??null,te=()=>e.modelValue.trim().length>0,P=()=>te()||b.value.length>0,F=()=>N()?.focus(),I=H(!1),ne=0;function re(){let t=N(),n=t?.parentElement;if(e.layout!==`row`||!t||!n||!e.modelValue){I.value=!1;return}let r=getComputedStyle(t),i=Number.parseFloat(r.lineHeight);if(!(i>0))return;I.value?(t.style.boxSizing=`border-box`,t.style.maxWidth=`${n.clientWidth-ne}px`):ne=n.clientWidth-t.offsetWidth;let a=t.scrollHeight-Number.parseFloat(r.paddingTop)-Number.parseFloat(r.paddingBottom);t.style.removeProperty(`box-sizing`),t.style.removeProperty(`max-width`),I.value=a>i*1.5}let L=typeof ResizeObserver==`function`?new ResizeObserver(()=>re()):void 0;W([()=>e.modelValue,()=>e.layout,()=>e.size],re,{flush:`post`});async function R(){let e=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;o.value=null,await ol(),a.value?.offsetWidth,o.value=e?`flash`:`shake`,!e&&a.value&&P_(a.value),clearTimeout(p),p=setTimeout(()=>o.value=null,450),F()}let ie=e=>{e instanceof CustomEvent&&e.detail?.escape===!0&&(m.value=!0),R()};Pd(()=>{a.value?.addEventListener(Lp,ie);let t=N()?.parentElement;t&&L?.observe(t),re(),e.autofocus&&ol(F)}),Ld(()=>{L?.disconnect(),a.value?.removeEventListener(Lp,ie),clearTimeout(p),clearTimeout(h);for(let e of T)clearTimeout(e);for(let e of w)URL.revokeObjectURL(e)}),n({focus:F,shake:R}),W(s,e=>{let t=N();if(!t)return;t.setAttribute(`role`,`combobox`),t.setAttribute(`aria-autocomplete`,`list`);let n=e!==null&&e.items.length>0;t.setAttribute(`aria-expanded`,String(n)),n?(t.setAttribute(`aria-controls`,`${d}-list`),t.setAttribute(`aria-activedescendant`,f(e.index))):(t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`))},{deep:!0}),Mp(n=>{e.guard&&a.value&&!zp(n).includes(a.value)&&(Ip.add(n),P()?(n.stopPropagation(),jp(),R()):t(`cancel`))});function z(){let e=N();!e||e.selectionStart===_&&e.selectionEnd===_||(g++,_=void 0,s.value=null)}function ae(n){z();let r=N(),i=s.value;if(!r||!i)return;if(r.selectionStart!==r.selectionEnd||r.value.slice(0,r.selectionStart)!==i.before){s.value=null;return}let a=r.selectionStart,o=`@${bh(n)} `,c=e.modelValue.slice(0,i.start)+o+e.modelValue.slice(a).replace(/^ /u,``);u.set(n.id,bh(n)),t(`update:modelValue`,c),e.mentions.includes(n.id)||t(`update:mentions`,[...e.mentions,n.id]),s.value=null,ol(()=>{let e=i.start+o.length;r.setSelectionRange(e,e),r.focus()})}async function oe(t){let n=++g;_=t.selectionStart;let r=j(),i=t.value.slice(0,t.selectionStart),a=t.selectionStart===t.selectionEnd?Ch(t.value,t.selectionStart):void 0;if(a?.start!==v&&(v=void 0),!r||!a||a.start===v){s.value=null;return}let o=[],c=!1;try{o=await r(a.query)}catch(e){c=!0,console.warn(`[vitehub] The comment box could not load people to mention:`,e)}let l=wh(o,a.query,{exclude:M(),participants:e.participants});if(z(),n!==g||a.start===v)return;let u=t.selectionStart===t.selectionEnd&&t.value.slice(0,t.selectionStart)===i,d=l.length>0||wD.test(a.query);s.value=u&&d?{before:i,failed:c,index:0,items:l,query:a.query,start:a.start}:null}function se(n){if(e.busy)return;let r=[...b.value];if(!n.text&&(r.length===0||!S.value)){r.length>0&&(c.value=`Write a comment to send with the files.`);return}let i=e.mentions.filter(e=>{let t=ee(e);if(t===void 0)return!1;let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|[^\\p{L}\\p{N}\\p{M}_])@${r}(?=$|[^\\p{L}\\p{N}\\p{M}_])`,`iu`).test(n.text)});t(`submit`,{body:n.text,files:r,mentions:[...i]})}function ce(e){if(e.isComposing||e.target instanceof Element&&e.target.closest(`[data-slot=comment-image-stack][data-fanned]`))return;let t=s.value,n=t!==null&&t.items.length>0;if(n&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault();let n=e.key===`ArrowDown`?1:-1;t.index=(t.index+n+t.items.length)%t.items.length}else n&&(e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey?(e.preventDefault(),e.stopPropagation(),ae(t.items[t.index])):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.repeat||(t?(g++,v=t.start,s.value=null):P()&&!m.value?(m.value=!0,R()):le()))}async function le(){e.busy||(m.value=!1,P()&&(t(`update:modelValue`,``),t(`update:mentions`,[]),O([]),await ol()),t(`cancel`))}let ue=e=>x.value&&(e.dataTransfer?.types.includes(`Files`)??!1),de,fe=()=>{let e=de;return de=void 0,e},pe=Dw(),me=e=>{let t=D.value[e];O(b.value.filter(e=>E(e)!==t))},he=({files:t,remove:n})=>{let r=[],i=[];return t.forEach((e,t)=>{e.mediaType.startsWith(`image/`)?r.push({key:e.url,name:e.filename??`Picture`,url:e.url}):i.push({file:e,index:t})}),[q(Ww,{disabled:e.busy,images:r,onRemove:e=>n(t.findIndex(t=>t.url===e)),origin:fe}),i.length>0?q(hE,{"data-slot":`prompt-input-attachments`},()=>i.map(({file:t,index:r})=>q(Yw,{key:t.url,size:`xs`},()=>[q(bE,{kind:`icon`},()=>q(Pw,{name:pe.value.file})),q(uE,()=>q(TE,()=>t.filename??t.mediaType)),q(aE,()=>q(eE,{disabled:e.busy,label:`Remove ${t.filename??`attachment`}`,onClick:()=>n(r)},()=>q(Pw,{name:pe.value.close})))]))):null]};return()=>q(`div`,{"data-busy":e.busy?`true`:void 0,"data-dirty":P()?`true`:void 0,"data-dragging":l.value?`true`:void 0,"data-frame":e.frame,"data-layout":e.layout,"data-multiline":I.value?`true`:void 0,"data-shake":o.value??void 0,"data-size":e.size,"data-slot":`comment-composer`,"data-variant":e.variant,onKeydownCapture:ce,onKeyupCapture:z,onClickCapture:z,onSelectCapture:z,onInputCapture:e=>{e.target instanceof HTMLTextAreaElement&&oe(e.target)},onPasteCapture:t=>{x.value&&t.clipboardData&&(de=N(),OD(t.clipboardData).some(t=>W_(t,e.accept))&&t.preventDefault())},onDragover:e=>{ue(e)&&(e.preventDefault(),l.value=!0)},onDragleave:e=>{e.relatedTarget instanceof Node&&a.value?.contains(e.relatedTarget)||(l.value=!1)},onDrop:e=>{l.value=!1,ue(e)&&(e.preventDefault(),de=a.value?.querySelector(`[data-slot=prompt-input-group]`),k(e.dataTransfer?.files??[]),F())},onChangeCapture:e=>{e.target instanceof HTMLInputElement&&e.target.type===`file`&&(de=a.value?.querySelector(`[data-slot=prompt-input-attach]`))},ref:a},[q(`div`,{"data-slot":`comment-composer-box`},[r.extra?q(`div`,{"data-slot":`comment-composer-extra`},r.extra()):null,q(bD,{accept:e.accept,"aria-label":DD[e.variant],files:D.value,readonly:e.busy,filterFiles:e=>(k(e),[]),modelValue:e.modelValue,placeholder:e.placeholder??TD[e.variant],submitLabel:ED[e.variant],onSubmit:se,"onUpdate:files":e=>O(b.value.filter(t=>e.includes(E(t)))),"onUpdate:modelValue":e=>t(`update:modelValue`,e)},()=>[x.value?he({files:D.value,remove:me}):null,q(uD),q(hD,()=>[x.value?q(YE,{disabled:e.busy,variant:e.layout===`row`?`ghost`:`outline`},()=>q(Pw,{name:pe.value.plus})):null,q(aD,null,()=>q(Pw,{name:pe.value.arrowUp}))])]),s.value&&s.value.items.length===0?q(`div`,{"data-slot":`comment-composer-mentions`,"data-state":s.value.failed?`error`:`empty`,role:`status`},q(`p`,{"data-slot":`comment-composer-mention-empty`},r[`mention-empty`]?.({failed:s.value.failed,query:s.value.query})??(s.value.failed?`Could not load people.`:`No one by that name can be mentioned here.`))):s.value?q(`ul`,{"aria-label":`People`,"data-slot":`comment-composer-mentions`,id:`${d}-list`,role:`listbox`},s.value.items.map((e,t)=>{let n=t===s.value?.index;return q(`li`,{"aria-selected":String(n),"data-slot":`comment-composer-mention`,id:f(t),key:e.id,onMousedown:t=>{t.preventDefault(),ae(e)},role:`option`},r[`mention-item`]?.({active:n,person:e})??[q(RE,{"aria-hidden":`true`,people:[gh(e)],size:`sm`}),q(`span`,{"data-slot":`comment-composer-mention-name`},bh(e))])})):null,e.error??c.value?q(`p`,{"data-slot":`comment-composer-error`,role:`alert`},e.error??c.value):null,q(`p`,{"aria-live":`polite`,"data-slot":`comment-composer-status`},m.value?`Press Esc again to discard.`:``)])])}})})),ND,PD,FD=t((()=>{jn(),ND={why:({message:e})=>e===void 0?``:String(e)},PD=Dn({docsBase:`https://vitehub.dev/docs/ui/diagnostics`,codes:{UI_R0001:{...ND,fix:`Pick the file again. The browser could not read the file that the message names.`},UI_R0002:{...ND,fix:"Use the component that the message names as it says: inside its parent, such as `CommentLayer`, `ChoicesInput`, or `MessageScroller`, or with the props that the message names."},UI_CLIPBOARD_UNAVAILABLE:{why:`The clipboard is not available.`,fix:"Serve the page over HTTPS or from `localhost`, where the browser gives pages the clipboard API."},UI_MARKDOWN_UPLOAD_URL_MISSING:{why:({route:e,file:t})=>`${e} stored ${t} without a URL. Serve the Blob store with \`blob.serve\` so the editor can link it.`,fix:"Add `serve` to the Blob options, such as `vitehub({ blob: { serve: { access: 'public' } } })`, so the upload route returns a URL for each file that it stores."},UI_RELATIVE_TIME_NOW_INVALID:{why:`RelativeTime cannot read the supplied clock value.`,fix:`Pass a valid Date, an ISO date string, or milliseconds as now.`},UI_RELATIVE_TIME_THRESHOLD_INVALID:{why:({threshold:e})=>`RelativeTime threshold "${e}" is not a duration.`,fix:`Pass a number and a unit, such as "3w", or "none" as threshold.`},UI_ZIP_PATH_UNSAFE:{why:`ZIP files must use safe project-relative paths.`,fix:"Pass `zipFiles()` and `downloadZip()` a folder name and file paths that are relative to the project, without empty, `.`, or `..` segments, `:`, or a backslash."}}})}));function ID(e={}){let t=e.flashMs??2500,n=e.visibility??`all`,r=null,i=null,a=[],o=[],s=[],c=new Set,l=new Map,u=new Map,d=new Map,f=new Map,p=new Set,m=(e,t)=>{let n=setTimeout(()=>{c.delete(n),e()},t);return c.add(n),n};function h(){let e=o;o=n===`hidden`?[...new Set([...r?[r]:[],...a])]:[];let t=n===`hidden`?e.filter(e=>!o.includes(e)):[];s=n===`hidden`?[...s.filter(e=>!o.includes(e)),...t.filter(e=>!s.includes(e))]:[];for(let e of t)clearTimeout(f.get(e)),f.set(e,m(()=>{f.delete(e),s=s.filter(t=>t!==e);for(let e of p)e()},130));for(let e of p)e()}function g(e){let t=l.get(e);t&&(clearTimeout(t),c.delete(t),l.delete(e))}function _(e,t){g(e),d.delete(e),e===i?d.set(e,t):(u.set(e,Date.now()+t),l.set(e,m(()=>{l.delete(e),u.delete(e),a=a.filter(t=>t!==e),h()},t)))}return{get visibility(){return n},get only(){return o},get leaving(){return s},set(e){if(e!==n){if(n=e,e===`all`){for(let e of[...l.keys()])g(e);u.clear(),d.clear(),a=[]}h()}},open(e){e!==r&&(r=e,h())},flash(e){n===`hidden`&&(_(e,t),a.includes(e)||(a=[...a,e],h()))},hover(e){if(e===i)return;let t=i;if(i=e,t!==null){let e=d.get(t);e!==void 0&&_(t,e)}if(e!==null&&l.has(e)){let t=Math.max(0,(u.get(e)??0)-Date.now());g(e),u.delete(e),d.set(e,t)}},isShown:e=>n===`all`||o.includes(e),subscribe(e){return p.add(e),()=>p.delete(e)},stop(){for(let e of c)clearTimeout(e);c.clear(),l.clear(),u.clear(),d.clear(),f.clear()}}}var LD=t((()=>{}));function RD(e){return e.requestId===void 0?e.id:JSON.stringify([e.subject.kind,e.subject.id,e.author.id,e.requestId])}function zD(e,t){let n=J(n=>{let r=t.value,i=e.value,a=i.find(e=>e.id===r),o=n?.id===r?n.thread:void 0,s=o?.requestId===void 0?void 0:RD(o);return{id:r,thread:a??(s===void 0?void 0:i.find(e=>RD(e)===s))}});return J(()=>n.value.thread)}var BD=t((()=>{Y()}));function VD(e){return(t,{message:n})=>e?t===`edit`||t===`delete`?n?.author.id===e.id:!0:!1}function HD(e){for(let t=e;t;){if(t.closest(XD))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function UD(e,t){return e.kind===t.kind&&e.id===t.id}function WD(e,t){return!e||!t?e===t:e.detached||t.detached?e.detached===t.detached:e.element===t.element&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.clipped===t.clipped}function GD(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}function KD(e){let t=e.client??mh(),n=tc(),r=tc(e.client?void 0:Gi()),i=tc(),a=J(()=>n.value??(r.value?Ji(r.value):void 0)),o=e.param??`comment`,s=e.hotkey===void 0?`c`:e.hotkey!==!1&&e.hotkey.toLowerCase(),c=e.ignore??HD,l=J(()=>rc(e.subject)),u=J(()=>rc(e.user)??t.user??a.value),d=H(!1),f=H(`page`),p=J({get:()=>f.value,set:e=>{if(e!==f.value){if(oe())return se();f.value=e}}}),m=Ws({open:!0,resolved:!1,mine:!1}),h=H(t.status),g=tc(t.threads),_=tc(t.outbox?.entries??[]),v=tc(new Map),y=H(null),b=H(null),x=tc(new Map),S=J(()=>new Set(x.value.values())),C=e=>{let t=Symbol();return x.value=new Map(x.value).set(t,e),()=>{let e=new Map(x.value);e.delete(t),x.value=e}},w=H(null),T=H(!1),E=H(0),D=e=>e.status===`open`,O=e=>m.open&&D(e)||m.resolved&&e.status===`resolved`?!m.mine||e.author.id===u.value?.id:!1,k=e=>UD(e.subject,l.value),A=J(()=>g.value.filter(e=>k(e)&&O(e))),ee=J(()=>g.value.filter(e=>(p.value===`site`||k(e))&&O(e))),j=J(()=>g.value.filter(e=>p.value===`site`||k(e))),M=J(()=>j.value.filter(D)),N=J(()=>({open:M.value.length,resolved:j.value.filter(e=>e.status===`resolved`).length})),te=zD(g,b);W(te,e=>{e&&e.id!==b.value&&(b.value=e.id)},{flush:`sync`});let P=ec(e.visibility)?e.visibility:H(e.visibility??`all`),F=ID({visibility:P.value,flashMs:e.flashMs}),I=H(0);F.subscribe(()=>I.value++),W(P,e=>F.set(e),{flush:`sync`}),W(b,e=>F.open(e),{flush:`sync`}),W(w,e=>F.hover(e),{flush:`sync`});let ne=J(()=>{I.value;let e=new Set(A.value.map(e=>e.id));te.value&&k(te.value)&&e.add(te.value.id);for(let t of g.value){let n=P.value===`hidden`&&(F.isShown(t.id)||F.leaving.includes(t.id));k(t)&&(S.value.has(t.id)||n)&&e.add(t.id)}return e}),re=J(()=>(I.value,new Set([...ne.value].filter(e=>F.isShown(e)||S.value.has(e))))),L=J(()=>(I.value,new Set(F.leaving.filter(e=>ne.value.has(e)&&!S.value.has(e))))),R=e=>F.flash(e),ie=()=>rc(e.root)??document,z=()=>rc(e.uiRoot)??document;function ae(){let e=new Map;for(let t of g.value.filter(e=>ne.value.has(e.id)))e.set(t.id,th(t.anchor,ie()));y.value&&e.set(YD,th(y.value.anchor,ie()));let t=v.value;e.size===t.size&&[...e].every(([e,n])=>WD(n,t.get(e)))||(v.value=e)}let oe=()=>(y.value?.body.trim().length??0)>0||Np(z(),y.value?void 0:ZD),se=(e=!1)=>{E.value++,Pp(z(),e)};function ce(){d.value=!0;let e=typeof window>`u`?void 0:window.getSelection();if(e&&!e.isCollapsed&&e.rangeCount>0){let t=e.getRangeAt(0).commonAncestorContainer,n=t instanceof Element?t:t.parentElement;if(n?.isConnected&&!c(n)){let t=e.getRangeAt(0).getBoundingClientRect();try{pe(e,{point:{x:t.left,y:t.top}}),e.removeAllRanges()}catch{}}}}function le(){y.value=null}function ue(){return oe()?(se(),!1):(b.value=null,w.value=null,!0)}function de(e=!1){if(oe())return se(e);le(),ue(),d.value=!1}function fe(){d.value?de():ce()}function pe(e,{files:t,...n}={}){if(oe())return se();ue();let r=Km(e,{root:ie(),ignore:c,...n}),i=n.point??{x:0,y:0};if(e===`page`)i={x:Math.max(16,window.innerWidth/2-180),y:96};else if(`nodeType`in e){let t=e.getBoundingClientRect();i=n.point??{x:t.left+t.width/2,y:t.top+t.height/2}}else!(`rangeCount`in e)&&!(`startContainer`in e)&&(i=e);y.value={anchor:r,point:i,body:``,mentions:[],attachments:[],...t?.length?{files:t}:{},busy:!1,error:void 0},ae()}async function me(e={}){let n=y.value,r=n?.body.trim()??``,i=e.files,a=tO(i);if(!n||n.busy||!r&&n.attachments.length===0&&!a)return;let o=n.body,s=[...n.mentions],c=[...n.attachments],u={subject:l.value,anchor:Qs(n.anchor),body:r,mentions:s,...c.length>0?{attachments:c}:{},...a?{files:i}:{}};if(n.error=void 0,t.outbox){y.value=null;try{let e=await t.create(u);return R(e.id),e}catch(e){n.error=GD(e),y.value||=n;return}}n.busy=!0;try{let e=await t.create(u);return n.busy=!1,R(e.id),y.value===n&&n.body===o&&n.mentions.length===s.length&&n.mentions.every((e,t)=>e===s[t])&&(y.value=null),e}catch(e){n.busy=!1,n.error=GD(e);return}}let he;function ge(e){clearTimeout(he);let t=0,n=()=>{ae();let r=v.value.get(e);r&&!r.detached?(r.element?.scrollIntoView?.({block:`center`}),ae()):++t<20&&(he=setTimeout(n,150))};n()}function _e(e,t={}){let n=typeof e==`string`?e:e.id;if(oe())return se();le(),b.value=n,w.value=null;let r=g.value.find(e=>e.id===n);r&&k(r)&&(t.scroll?ge(n):ae())}function ve(t){let n=e.location?.()??window.location,r=e.subjectUrl?.(t.subject)??(t.subject.kind===`page`?t.subject.id:n.href),i=new URL(r,n.origin);return i.searchParams.set(o,String(t.n)),`${i.pathname.startsWith(`//`)?`/%2F${i.pathname.slice(2)}`:i.pathname}${i.search}${i.hash}`}let ye=!1;function be(){if(ye||h.value!==`ready`)return;ye=!0;let t=e.location?.()??window.location,n=Number(new URLSearchParams(t.search).get(o));if(!Number.isInteger(n)||n<1)return;let r=g.value.find(e=>e.n===n&&k(e));r&&(r.status===`resolved`&&(m.resolved=!0),m.mine=!1,_e(r,{scroll:!0}))}function xe(e){if(e.defaultPrevented||e.isComposing||e.repeat)return;let t=QD(e),n=t[0];if(e.key===`Escape`){if(t.some(e=>e.matches(`[data-slot='comment-composer']`)))return;(d.value||y.value||b.value)&&de(!0)}else if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||eO(t))){if(e.key===`Enter`&&d.value&&n&&!t.some(c)&&n!==document.body&&n!==document.documentElement){e.preventDefault();try{pe(n)}catch{}}else s!==!1&&e.key.toLowerCase()===s&&(e.preventDefault(),fe())}}function Se(){let a=[];if(t.query=p.value===`page`?{subject:l.value}:{},a.push(t.onChange(()=>{h.value=t.status,g.value=t.threads,_.value=t.outbox?.entries??[]})),h.value=t.status,g.value=t.threads,a.push(t.start()),!e.client){let e=la({base:um(),guest:Gi});a.push(W([()=>l.value.kind,()=>l.value.id],([t,r],a,o)=>{i.value=void 0;let s=new AbortController;o(()=>s.abort());let c=new URLSearchParams({subjectKind:t,subjectId:r});e(`/session?${c}`,{signal:s.signal}).then(({data:e})=>{s.signal.aborted||(n.value=e.user??void 0,i.value=e.can)},()=>{})},{immediate:!0})),a.push(qi(e=>{r.value=e}))}document.addEventListener(`keydown`,xe),a.push(()=>document.removeEventListener(`keydown`,xe));let o=0,s=()=>{o||=requestAnimationFrame(()=>{o=0,ae()})};window.addEventListener(`scroll`,s,{capture:!0,passive:!0}),window.addEventListener(`resize`,s),window.addEventListener(`load`,s,{capture:!0}),document.fonts?.addEventListener(`loadingdone`,s);let c=()=>{ye=!1,be()};window.addEventListener(`popstate`,c),a.push(W(()=>e.location?.().search,c));let u=new MutationObserver(e=>{e.every(e=>e.target instanceof Element&&HD(e.target))||s()}),d={attributes:!0,characterData:!0,childList:!0,subtree:!0};a.push(W(ie,e=>{u.disconnect(),u.observe(document.documentElement,d),e!==document&&u.observe(e,d),s()},{immediate:!0,flush:`post`}));let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(s),m=new Set;return a.push(()=>{window.removeEventListener(`scroll`,s,{capture:!0}),window.removeEventListener(`resize`,s),window.removeEventListener(`load`,s,{capture:!0}),window.removeEventListener(`popstate`,c),document.fonts?.removeEventListener(`loadingdone`,s),u.disconnect(),f?.disconnect(),clearTimeout(he),o&&cancelAnimationFrame(o),F.stop()}),a.push(W(v,()=>{let e=new Set;for(let t of v.value.values())!t.detached&&t.element&&e.add(t.element);for(let t of m)e.has(t)||(f?.unobserve(t),m.delete(t));for(let t of e)m.has(t)||(f?.observe(t),m.add(t))},{flush:`post`})),a.push(W([ne,()=>y.value?.anchor,b],()=>ae(),{flush:`post`})),a.push(W(()=>h.value===`ready`,e=>e&&be(),{immediate:!0})),a.push(W(()=>`${l.value.kind}\u0000${l.value.id}\u0000${p.value}`,()=>{t.query=p.value===`page`?{subject:l.value}:{},le(),b.value=null,w.value=null,ye=!1,t.refresh().catch(()=>void 0)})),()=>{for(let e of a.splice(0))e()}}let Ce=tc(new Map),we=J(()=>{let t=new Map,n=e=>{e&&(!t.has(e.id)||e.name)&&t.set(e.id,e)};for(let e of Ce.value.values())n(e);for(let t of rc(e.people)??[])n(t);for(let e of g.value){n(e.author),n(e.resolvedBy);for(let t of e.messages)n(t.author)}return n(u.value),[...t.values()]});async function Te(e,n){let r=await t.users({query:e,...n?{threadId:n}:{subject:l.value}});if(r.some(e=>Ce.value.get(e.id)!==e)){let e=new Map(Ce.value);for(let t of r)e.set(t.id,t);Ce.value=e}return r}let Ee=(e,t)=>lm(u.value,i.value,e,t),De={client:t,subject:l,user:u,can:(t,n)=>u.value!==void 0&&(e.can??(e.client?VD(u.value):Ee))(t,n),people:we,active:d,scope:p,filters:m,status:h,threads:g,outbox:{enabled:t.outbox!==void 0,queued:J(()=>_.value.filter(e=>e.status!==`failed`)),failures:J(()=>_.value.filter(e=>e.status===`failed`)),delivery(e,t){let n=g.value.find(t=>t.id===e);return t===void 0?n?.delivery:n?.messages.find(e=>e.id===t)?.delivery},retry:async e=>t.outbox?.retry(e),dismiss:async e=>await t.outbox?.dismiss(e)??!1,edit:async(e,n,r)=>await t.outbox?.edit(e,n,r)??!1},pageThreads:A,listed:ee,openThreads:M,counts:N,positions:v,draft:y,openId:b,hoverId:w,opened:te,listOpen:T,blocked:E,visibility:P,shown:re,leaving:L,retainMark:C,isShown:e=>re.value.has(e),flash:R,enter:ce,exit:de,toggle:fe,startDraft:pe,cancelDraft:le,send:me,open:_e,close:ue,create:async({anchor:e={kind:`page`},attachments:n,body:r,files:i,mentions:a})=>{let o=await t.create({subject:l.value,anchor:e,body:r,mentions:a,...n?.length?{attachments:n}:{},...tO(i)?{files:i}:{}});return R(o.id),o},reply:async(e,n,r,i,a)=>{let o=await t.reply({threadId:e,body:n,mentions:r,...i?.length?{attachments:i}:{},...tO(a)?{files:a}:{}});return R(e),o},edit:(e,n,r,i)=>t.edit({threadId:e,messageId:n,body:r,mentions:i}),remove:async(e,n)=>{let r=await t.delete({threadId:e,messageId:n});return!r&&b.value===e&&(b.value=null,w.value=null),r},resolve:e=>t.resolve({threadId:e}),reopen:e=>t.reopen({threadId:e}),users:Te,link:ve,measure:ae,start:Se};if(e.autoStart!==!1&&wf()){let e;Pd(()=>{e=Se()}),Ld(()=>e?.())}return De}function qD(e){vl(B_,e)}function JD(e){let t=e??V_();if(!t)throw PD.UI_R0002({message:"Comment parts need a comments state. Put them inside CommentLayer, or pass the result of useComments() as the `comments` prop."});return t}var YD,XD,ZD,QD,$D,eO,tO,nO=t((()=>{Y(),hh(),FD(),LD(),Bp(),BD(),H_(),YD=`draft`,XD=`[data-comments-ui]`,ZD=`[data-draft] [data-slot='comment-composer']`,QD=e=>e.composedPath().filter(e=>e instanceof Element),$D=`input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='combobox'], [role='searchbox']`,eO=e=>e.some(e=>e.matches($D)),tO=e=>e!==void 0&&(!Array.isArray(e)||e.length>0)}));function rO(e,t){let n=J(()=>{if(e.client.transport.supportsAttachments!==!1){if(t.upload)return`upload`;if(e.outbox.enabled&&t.queueFiles)return`queue`}});return{enabled:J(()=>n.value!==void 0),queued(t){if(!(!e.outbox.enabled||n.value===`upload`&&t.length>0))return n.value===`queue`?t:[]},async prepare(e){return{files:n.value===`queue`?e:[],attachments:n.value===`upload`&&e.length>0&&t.upload?await t.upload(e):[]}}}}var iO=t((()=>{Y()}));function aO(e,t={}){let[n,r,i,a]=[1e3,6e4,36e5,864e5],[o,s,c]=[7*a,30*a,365*a],l={s:n,m:r,h:i,d:a,w:o,mo:s,y:c},{threshold:u=`3w`,locale:d=`en-US`,style:f=`long`}=t,[,p,m]=/^(\d+(?:\.\d+)?)\s*(s|m|h|d|w|mo|y)$/i.exec(u)??[],h=/^(none|never)$/i.test(u)?1/0:p&&m?Number(p)*(l[m.toLowerCase()]??NaN):NaN;if(Number.isNaN(h))throw PD.UI_RELATIVE_TIME_THRESHOLD_INVALID({threshold:u});let g=t.now===void 0?Date.now():new Date(t.now).getTime();if(!Number.isFinite(g))throw PD.UI_RELATIVE_TIME_NOW_INVALID();let _=t.timeZone??new Intl.DateTimeFormat().resolvedOptions().timeZone,v=new Intl.RelativeTimeFormat(d,{numeric:`auto`,style:f}),y=e=>Object.fromEntries(new Intl.DateTimeFormat(`en-US`,{timeZone:_,hourCycle:`h23`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}).formatToParts(e).map(e=>[e.type,Number(e.value)])),b=e=>{let t=y(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)-Math.floor(e/1e3)*1e3},x=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?\s*(Z|[+-]\d{2}:?\d{2})?)?$/i.exec(e);if(!t)return;let[n,r,i,o,s,c]=[1,2,3,4,5,6].map(e=>Number(t[e]??0)),l=Date.UTC(n,r-1,i,o,s,c,Number((t[7]??``).slice(0,3).padEnd(3,`0`))),u=new Date(l);if(u.getUTCFullYear()!==n||u.getUTCMonth()!==r-1||u.getUTCDate()!==i||o>23||s>59||c>59)return;if(t[4]===void 0)return{at:Math.floor(l/a)*a,wall:!0};let d=t[8];if(d?.toUpperCase()===`Z`)return{at:l,wall:!1};if(d){let e=d.replace(/\D/g,``),t=Number(e.slice(0,2)),n=Number(e.slice(2));return t>23||n>59?void 0:{at:l-(d.startsWith(`-`)?-1:1)*(t*60+n)*6e4,wall:!1}}let f=[...new Set([l-a,l,l+a].map(e=>l-b(e)))].filter(e=>e+b(e)===l).sort((e,t)=>e-t)[0];return f===void 0?void 0:{at:f,wall:!1}},S=Math.floor((g+b(g))/a),C=typeof e==`string`?NaN:new Date(e).getTime(),w=typeof e==`string`?x(e.trim()):Number.isFinite(C)?{at:C,wall:!1}:void 0;if(!w)return;let T=w.wall?(w.at/a-S)*a:w.at-g,E=w.wall?Math.max(Math.abs(T),a):Math.abs(T),[D,O]=E<r?[`second`,n]:E<i?[`minute`,r]:E<a?[`hour`,i]:E<o?[`day`,a]:E<s?[`week`,o]:E<c?[`month`,s]:[`year`,c],k=v.format(Math.trunc(T/O)||0,D),A=e=>new Intl.DateTimeFormat(d,{timeZone:w.wall?`UTC`:_,...e}).format(w.at),ee={day:`numeric`,month:`short`},j={hour:`numeric`,minute:`2-digit`,timeZoneName:`short`},M=Math.abs(T)>=h,N=w.wall?new Date(w.at).getUTCFullYear():y(w.at).year;return{datetime:w.wall?new Date(w.at).toISOString().slice(0,10):new Date(w.at).toISOString().replace(/\.000Z$/,`Z`),mode:M?`absolute`:`relative`,label:M?A(N===y(g).year?ee:{...ee,year:`numeric`}):k,tip:M?w.wall?k:`${k} · ${A(j)}`:A({weekday:`short`,...ee,year:`numeric`,...w.wall?{}:j})}}var oO=t((()=>{FD()}));function sO(e){let t,n=()=>e.value=Date.now(),r=()=>clearInterval(t),i=()=>{r(),n(),t=setInterval(n,dO)},a=()=>document.visibilityState===`hidden`?r():i();return document.addEventListener(`visibilitychange`,a),a(),()=>{r(),document.removeEventListener(`visibilitychange`,a)}}function cO(){return pO++===0&&(mO=sO(fO)),fO}function lO(){--pO===0&&mO?.()}var uO,dO,fO,pO,mO,hO=t((()=>{Y(),uO=Symbol(`ViteHubRelativeNow`),dO=3e4,fO=H(0),pO=0}));function gO(e){let t=yl(uO,void 0),n=tc(),r=H(!1);Pd(()=>{t||(n.value=cO()),r.value=!0}),Ld(()=>{n.value&&lO()});let i=J(()=>t?.value??n.value?.value),a=t=>{let n=i.value;if(n===void 0)return;let{at:r,format:a,locale:o,threshold:s}=e(),c={locale:o,style:a,threshold:s,timeZone:t},l=aO(r,{...c,now:n});if(!l?.datetime.includes(`T`))return l;let u=Date.parse(l.datetime);return Math.abs(u-n)<_O?aO(r,{...c,now:u}):l},o=J(()=>{let{at:t,locale:n}=e(),r=aO(t,{locale:n,now:0,threshold:`none`,timeZone:`UTC`});if(!r)return;let i=new Intl.DateTimeFormat(n,{day:`numeric`,month:`short`,timeZone:`UTC`,year:`numeric`}).format(Date.parse(r.datetime));return{...r,label:i,mode:`absolute`}});return{time:J(()=>a(r.value?void 0:`UTC`)??o.value),tip:J(()=>r.value?a()?.tip:void 0)}}var _O,vO=t((()=>{Y(),oO(),hO(),_O=6e4}));function yO(e){e()}var bO=t((()=>{})),xO=t((()=>{})),SO,CO=t((()=>{SO=e=>e.isTrusted}));function wO(e){(e.key===`Enter`||e.key===` `)&&(WO=e.target,setTimeout(GO))}function TO(e){wO(e),BO=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);e.key!==`Tab`&&t||(FO=`keyboard`)}function EO(e){if(FO=`pointer`,BO=!1,!(`pointerType`in e)){HO||(VO=`touch`);return}HO=!0,setTimeout(UO);let t=e.pointerType;VO=kO(e)?`virtual`:t===`touch`||t===`pen`?t:`mouse`}function DO(){IO||typeof document>`u`||(IO=!0,document.addEventListener(`keydown`,TO,!0),document.addEventListener(`keyup`,wO,!0),document.addEventListener(`pointerdown`,EO,!0),document.addEventListener(`touchstart`,EO,{capture:!0,passive:!0}),window.addEventListener(`blur`,e=>{e.target===window&&(BO=!0)}))}function OO(){IO||LO||(LO=!0,queueMicrotask(DO))}function kO(e){return e.type===`pointermove`?!1:e.width===0&&e.height===0&&e.pressure===0||e.pointerType===`mouse`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function AO(e){return e.detail>0?VO:WO&&WO.contains(e.target)?`keyboard`:`virtual`}function jO(e){if(DO(),!e)return KO();if(!SO(e))return`programmatic`;if(e.type.startsWith(`key`))return`keyboard`;if(e.type.startsWith(`touch`))return`touch`;if(e.type===`click`)return AO(e);let t=e.pointerType;return t===`mouse`||t===`touch`||t===`pen`?kO(e)?`virtual`:t:`button`in e?VO:KO()}function MO(){return DO(),FO===`keyboard`&&!RO&&!zO&&!BO}function NO(e){DO(),RO=!0;try{e.focus({preventScroll:!0})}finally{RO=!1}}function PO(e){DO(),zO=!0;try{e.focus({preventScroll:!0})}finally{zO=!1}}var FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO=t((()=>{CO(),FO=`pointer`,IO=!1,LO=!1,RO=!1,zO=!1,BO=!1,VO=`mouse`,HO=!1,UO=()=>HO=!1,WO=null,GO=()=>WO=null,KO=()=>FO===`keyboard`?`keyboard`:VO}));function JO(e,t){let n=XO.get(e);n||XO.set(e,n={});let r=n[t];if(r?.isConnected)return r;let i=e.createElement(`div`);return i.setAttribute(`role`,t===`assertive`?`alert`:`status`),i.setAttribute(`aria-live`,t),i.setAttribute(`aria-atomic`,`true`),i.setAttribute(`data-ui-sdk-announcer`,t===`assertive`?`assertive`:``),i.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(i),n[t]=i,i}function YO(e,{priority:t=`polite`,doc:n=typeof document>`u`?void 0:document}={}){if(!e)return;if(ZO)return ZO(e,t);if(!n?.body)return;let r=JO(n,t);r.textContent=``,clearTimeout(QO[t]),QO[t]=setTimeout(()=>{r.textContent=e},100)}var XO,ZO,QO,$O=t((()=>{XO=new WeakMap,QO={}}));function ek(){return tk&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)}var tk,nk=t((()=>{tk=typeof window<`u`&&typeof document<`u`}));function rk(){return tk&&typeof HTMLElement.prototype.showPopover==`function`}function ik(e){return e||(tk&&!rk()?document.body:null)}function ak(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function ok(e){let t=[e],n=e;for(;n;){let e=n.assignedSlot??n.parentNode??n.host;e&&e!==n.parentNode&&t.push(e),n=e}return t}function sk(e,t){return ok(t).some(t=>e.contains(t))}function ck(){return fk?fk===`apple`:pk??=tk&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function lk(){return fk===`apple`}function uk(e,t=ck()){return e.split(`+`).map(e=>{let n=e.toLowerCase();return n===`mod`?t?`Meta`:`Control`:mk[n]?mk[n]:e.length>1?e[0].toUpperCase()+e.slice(1):e.toUpperCase()}).join(`+`)}function dk(e,t=ck()){let n=uk(e,t);if(!n)return``;let r=n.split(`+`);return`\u2066${t?r.map(e=>hk[e]??e).join(``):r.map(e=>gk[e]??e).join(`+`)}\u2069`}var fk,pk,mk,hk,gk,_k=t((()=>{nk(),mk={alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`,ctrl:`Control`,control:`Control`,cmd:`Meta`,command:`Meta`,meta:`Meta`,backspace:`Backspace`,delete:`Delete`,del:`Delete`,enter:`Enter`,return:`Enter`,escape:`Escape`,esc:`Escape`,tab:`Tab`,space:`Space`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,arrowup:`ArrowUp`,arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,home:`Home`,end:`End`,pageup:`PageUp`,pagedown:`PageDown`},hk={Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`,Backspace:`⌫`,Delete:`⌦`,Enter:`↩`,Escape:`⎋`,Tab:`⇥`,Space:`␣`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`,PageUp:`⇞`,PageDown:`⇟`,Home:`↖`,End:`↘`},gk={Control:`Ctrl`,Delete:`Del`,Escape:`Esc`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`}}));function vk(e){return{"data-open":e?``:void 0,"data-closed":e?void 0:``}}var yk=t((()=>{}));function bk(e){jk++;try{e()}finally{jk--}}function xk(e){let t=kk,n={starts:[]};kk=n;let r;try{r=e()}finally{kk=t}return Ok.set(r,n),t?t.starts.push(()=>(Tk(r),()=>Ek(r))):!Ak&&typeof document<`u`&&Tk(r),r}function Sk(e){let t=Ak;Ak=!0;try{return e()}finally{Ak=t}}function Ck(e){kk&&kk.starts.push(e)}function wk(e,t){let n=kk,r={starts:[]};kk=r;try{t()}finally{kk=n}let i=Ok.get(e);if(i){i.starts.push(...r.starts);for(let e of i.stops?r.starts:[]){let t=e();t&&i.stops.push(t)}}}function Tk(e){let t=Ok.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let e of t.starts){let t=e();t&&n.push(t)}}function Ek(e){let t=Ok.get(e),n=t?.stops;n&&(t.stops=void 0,n.forEach(e=>e()))}function Dk(e){Ek(e),Ok.delete(e)}var Ok,kk,Ak,jk,Mk=t((()=>{bO(),Ok=new WeakMap,Ak=!1,jk=0}));function Nk(e,t){e?.[Ik]?.(t)}function Pk(e,t){e?.[Lk]?.(t)}function Fk(e,t){let n=e.options().controller,r=!1;Ck(()=>(r=!0,Nk(n,t),()=>{r=!1,Pk(n,t)})),e.onOptions(({controller:e})=>{e!==n&&(Pk(n,t),n=e,r&&Nk(e,t))})}var Ik,Lk,Rk=t((()=>{Mk(),Ik=Symbol.for(`ui-sdk.controller.attach`),Lk=Symbol.for(`ui-sdk.controller.detach`)}));function zk(e,t){let n=Hk.get(e);n||Hk.set(e,n=[]),n.push(t)}function Bk(e,t,n){zk(e.store,{from:`options`,keys:t,derive:n})}function Vk(e,t,n,r){let i=Hk.get(e);if(!i)return n;let a=n??{},o=!n,s=!!n;for(let c=0;c<i.length;c++){let l=i[c];if(!n&&l.from===`state`)continue;let u=s?{...r,...a}:r,d=l.from===`state`?e.view(u,()=>l.derive(u)):l.derive(a,r,t);if(d||l.from!==`options`){o||=(a={...a},!0);for(let e=0;e<l.keys.length;e++){let t=l.keys[e];d&&t in d?(a[t]=d[t],s=!0):l.from===`state`&&(a[t]=u[t],s=!0)}}}return s?a:void 0}var Hk,Uk,Wk=t((()=>{Hk=new WeakMap,Uk=e=>Hk.has(e)}));function Gk(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Kk(e){let t=`nativeEvent`in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var qk=t((()=>{}));function Jk(e,t){let{x:n,y:r}=e,{borders:i}=t,a=n>=i.left&&n<t.width-i.right&&r>=i.top&&r<t.height-i.bottom,o=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return a&&!o}function Yk(e,t){if(!(t instanceof Element))return!1;if(t===t.ownerDocument.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let n=t.getBoundingClientRect(),r=getComputedStyle(t);return Jk({x:e.clientX-n.left,y:e.clientY-n.top},{width:n.width,height:n.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(r.borderTopWidth)||0,right:parseFloat(r.borderRightWidth)||0,bottom:parseFloat(r.borderBottomWidth)||0,left:parseFloat(r.borderLeftWidth)||0}})}var Xk=t((()=>{}));function Zk(){return _A.persistent??=new Set}function Qk(e){for(let t of Zk())if(sk(t,e))return!0;return!1}function $k(){return[...Zk()].filter(e=>e.isConnected)}function eA(){return _A.pushed??0}function tA(e){return nA().some(t=>(t.order??0)>e)}function nA(){return _A.stack.filter(e=>e.active())}function rA(){return nA()}function iA(){return _A.escapeAt??-1/0}function aA(e,t,n){return oA(e,ok(t),n)}function oA(e,t,n){return t.some(t=>e.contains(t,n))?!0:nA().some(r=>r.parent===e&&(t.some(e=>r.covers?.(e))||oA(r,t,n)))}function sA(e,t){let n=!1,r,i;function a(e,t,n){let r=[],i=!1;if(Qk(t))return{dismissed:r,consume:i};for(let a of[..._A.stack].reverse())if(a.active()){if(aA(a,t,e)||(a.modal!==!1&&(i=!0),r.push(a),a.shield))break}else if(a.exiting?.()){if(aA(a,t,e))break;if(a.modal===!1)continue;a.overBackdrop?.(n.x,n.y)&&(i=!0);break}return{dismissed:r,consume:i}}function o(e,t,n){let{dismissed:r,consume:i}=a(e,t,n);for(let t of r)t.onOutsidePress?.(e);return i}let s=Gk(t,`pointerdown`,e=>{n=!1;let t=e.composedPath()[0];if(e.pointerType===`touch`){r={x:e.clientX,y:e.clientY,target:t};return}if(r=void 0,i=void 0,Yk(e,t))return;let o={x:e.clientX,y:e.clientY},{dismissed:s,consume:c}=a(e,t,o);if(s[0]?.outsidePress===`click`){if(e.button!==0)return;i={layer:s[0],target:t,point:o},c&&(e.preventDefault(),n=!0)}else{c&&(e.preventDefault(),n=!0);for(let t of s)t.onOutsidePress?.(e)}},{capture:!0}),c=Gk(t,`pointerup`,e=>{let t=i;i=void 0,t&&t.layer.active()&&(aA(t.layer,e.composedPath()[0],e)||o(e,t.target,t.point))},{capture:!0}),l=Gk(t,`click`,e=>{if(n&&e.detail){n=!1,e.preventDefault(),e.stopPropagation();return}if(n=!1,!r)return;let t=r;r=void 0,Math.hypot(e.clientX-t.x,e.clientY-t.y)>10||o(e,t.target,{x:t.x,y:t.y})&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),u=Gk(e,`keydown`,t=>mA(e,t)),d=Gk(t,`blur`,e=>{for(let t of nA().reverse())t.onBlur?.(e)});return()=>{if(s(),c(),u(),d(),!n)return l();let e=()=>(l(),r(),i()),r=Gk(t,`pointerdown`,e,{capture:!0}),i=Gk(t,`click`,e,{capture:!0})}}function cA(e,t){return aA(e,t)}function lA(e){let t=ok(e);return nA().reverse().find(e=>t.some(t=>e.contains(t)))}function uA(e){_A.closed=e,setTimeout(()=>{_A.closed===e&&(_A.closed=void 0)})}function dA(){return _A.closed}function fA(e){let t=e.defaultView;if(!t)return()=>{};let n=_A.listening.get(e);n||_A.listening.set(e,n={layers:0,stop:sA(e,t)});let r=n;return r.layers++,()=>{--r.layers>0||(_A.listening.delete(e),r.stop())}}function pA(e){return e.el?.ownerDocument??document}function mA(e,t,n){if(t.key!==`Escape`||t.defaultPrevented||Kk(t))return;let r=nA().filter(t=>pA(t)===e).at(-1);!r?.onEscape||r.takesEscape?.()===!1||n&&r!==n||(_A.escapeAt=performance.now(),r.onEscape(t))}function hA(e,t){mA(pA(e),t,e)}function gA(e){_A.pushed=(_A.pushed??0)+1,e.order=_A.pushed,_A.stack.push(e);let t=fA(pA(e)),n=!1;return()=>{if(n)return;n=!0;let r=_A.stack.indexOf(e);r!==-1&&_A.stack.splice(r,1),t()}}var _A,vA=t((()=>{bO(),qk(),_k(),Xk(),_A=globalThis[Symbol.for(`ui-sdk.layers@2`)]??={stack:[],listening:new Map}}));function yA(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let a=e.style.getPropertyValue(t);return()=>{e.style.getPropertyValue(t)===a&&(r?e.style.setProperty(t,r,i):e.style.removeProperty(t))}}function bA(e){if(typeof CSS<`u`&&CSS.registerProperty){for(let t of e)if(!OA.has(t)){OA.add(t);try{CSS.registerProperty({name:t,syntax:`*`,inherits:!1})}catch{}}}}function xA(e){if(AA.has(e))return AA.get(e);let t;for(let n=e;n&&!t;n=n.defaultView?.frameElement?.ownerDocument)t=n.head?.querySelector(`meta[property="csp-nonce"]`);let n=t?t.nonce||t.getAttribute(`nonce`)||``:null;return AA.set(e,n),n}function SA(e,t,n){if(!e.head)return;let r=e.defaultView;xA(e)===``&&r&&`adoptedStyleSheets`in e?wA(e,r,t,n):CA(e,t,n)}function CA(e,t,n){let r=e.getElementById(t);if(r){if(jA.get(r)===n)return;r.textContent!==n&&(r.textContent=n),jA.set(r,n);return}let i=e.createElement(`style`);i.id=t;let a=xA(e);a&&(i.nonce=a),i.textContent=n,jA.set(i,n);let o=e.head.querySelectorAll(`:scope > style[id^="ui-sdk-"]`);o.length?o[o.length-1].after(i):e.head.prepend(i)}function wA(e,t,n,r){let i=kA().get(e);i||kA().set(e,i=new Map);let a=i.get(n);a||i.set(n,a={sheet:new t.CSSStyleSheet,css:``}),a.css!==r&&(a.sheet.replaceSync(r),a.css=r),e.adoptedStyleSheets.includes(a.sheet)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a.sheet])}function TA(e){SA(e,`ui-sdk-hidden`,`@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }`)}function EA(e){typeof window<`u`&&(performance.getEntriesByType(`paint`).length?MA?MA.push(e):(MA=[e],(window.requestIdleCallback??setTimeout)(()=>{let e=MA;MA=void 0,e.forEach(e=>e())})):e())}function DA(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var OA,kA,AA,jA,MA,NA,PA=t((()=>{OA=new Set,kA=()=>globalThis[Symbol.for(`ui-sdk.styles@1`)]??=new WeakMap,AA=new WeakMap,jA=new WeakMap,NA=new WeakSet}));function FA(e=document,t){let n={},r=JA.holders.get(e);r||JA.holders.set(e,r=new Set),r.size||JA.thaw.set(e,LA(e)),r.add(n);let i=t&&ek()?WA(t):void 0;return()=>{r.delete(n)&&(i?.(),r.size||(JA.thaw.get(e)?.(),JA.thaw.delete(e)))}}function IA({scrollbar:e,gutter:t,padding:n}){let r={overflow:`hidden`,"scroll-behavior":`auto`};return e>0&&(t?r[`scrollbar-gutter`]=`stable`:r[`padding-right`]=`${n+e}px`),r}function LA(e){let{scroller:t,gutter:n,padding:r}=YA.get(e)??RA(e),i=IA({scrollbar:n,gutter:typeof CSS<`u`&&CSS.supports(`scrollbar-gutter`,`stable`),padding:r}),a=Object.entries(i).map(([e,n])=>yA(t,e,n));return n>0&&a.push(yA(e.documentElement,`--scrollbar-width`,`${n}px`)),()=>a.forEach(e=>e())}function RA(e){let t=e.defaultView??window,n=zA(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:BA(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function zA(e,t){let{body:n,documentElement:r}=e;return!n||t.getComputedStyle(r).overflowY===`visible`?r:/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function BA(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let i=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-i}function VA(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,i=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||i}function HA(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let i=e;i&&i!==n&&i!==r;i=i.parentElement)if(VA(i,t))return!0;return!1}function UA(e){return e.fingers>1||e.zoomed?`browser`:e.scroller||e.slider||e.selecting?`element`:`page`}function WA(e){let t=e.ownerDocument,n=t.defaultView??window;SA(t,`ui-sdk-scroll-guard`,XA);let r=!e.hasAttribute(`data-scroll-guard`);r&&e.setAttribute(`data-scroll-guard`,``);let i=`browser`,a={x:0,y:0},o=!1,s=!0,c=Gk(t,`touchstart`,e=>{let r=e.target instanceof Element?e.target:null,c=e.touches[0];a={x:c?.clientX??0,y:c?.clientY??0},o=!1,s=!0,i=UA({fingers:e.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!r&&HA(r,n),slider:!!r?.closest(`input[type="range"]`),selecting:t.getSelection()?.type===`Range`})},{capture:!0,passive:!0}),l=Gk(t,`touchmove`,e=>{let t=e.touches[0];(!t||Math.hypot(t.clientX-a.x,t.clientY-a.y)>ZA)&&(s=!1),i===`page`&&e.cancelable&&(e.preventDefault(),o=!0)},{passive:!1}),u=Gk(t,`touchend`,e=>{let t=e.target;!e.defaultPrevented&&o&&s&&e.cancelable&&t instanceof n.Element&&(e.preventDefault(),t.closest(`input, textarea, select, [contenteditable]`)?.focus(),t instanceof n.HTMLElement?t.click():t.dispatchEvent(new n.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0})))},{passive:!1});return()=>{c(),l(),u(),r&&e.removeAttribute(`data-scroll-guard`)}}function GA(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function KA(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(QA)),...$k()],r=n.filter(e=>!n.some(t=>t!==e&&t.contains(e))),i=new Set;for(let e of r)for(let t=e;t;t=GA(t))i.add(t);let a=[];for(let e of r)for(let n=e;n&&n!==t.body;n=GA(n))for(let e of Array.from(n.parentNode?.children??[])){if(i.has(e)||!(e instanceof HTMLElement))continue;let t=JA.inert.get(e)??(e.inert?1/0:0);t===0&&(e.inert=!0),t!==1/0&&JA.inert.set(e,t+1),a.push(e)}return()=>{for(let e of a){let t=JA.inert.get(e);t!==void 0&&(t<=1?(e.inert=!1,JA.inert.delete(e)):JA.inert.set(e,t-1))}}}function qA(e){let t=e,n=KA(t),r=!1,i=e=>{let r=n;t=e,n=KA(e),r()};return Object.assign(()=>{r||(r=!0,n())},{keep(e){return r?()=>{}:(i([...t,e]),()=>{r||i(t.filter(t=>t!==e))})}})}var JA,YA,XA,ZA,QA,$A=t((()=>{qk(),vA(),nk(),PA(),JA=globalThis[Symbol.for(`ui-sdk.modal@2`)]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap},YA=new WeakMap,XA=`@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }`,ZA=8,QA=`[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output`}));function ej(e){let t=e.length;if(t<=1)return e;let n=e[0].el.parentNode;if(n){let r=!0,i=!0;for(let a=1;a<t;a++){let t=e[a].el;if(t.parentNode!==n){r=!1;break}i&&e[a-1].el.nextElementSibling!==t&&(i=!1)}if(r){if(i)return e;if(`firstElementChild`in n){let r=new Map;for(let n=0;n<t;n++)r.set(e[n].el,e[n]);let i=[],a=t*aj;for(let e=n.firstElementChild;e&&a--;e=e.nextElementSibling){let n=r.get(e);if(n&&i.push(n)===t)return i}}}}let r=t<ij?null:n;for(;r;){let n=!0;for(let i=0;i<t;i++)if(!r.contains(e[i].el)){n=!1;break}if(n)break;r=r.parentNode}if(r){let n=new Map;for(let r=0;r<t;r++)n.set(e[r].el,e[r]);let i=[],a=e[0].el.ownerDocument.createTreeWalker(r,1),o=t*aj;for(let e=r;e&&o--;e=a.nextNode()){let r=n.get(e);if(r&&i.push(r)===t)return i}}return e.sort((e,t)=>rj(e.el,t.el))}var tj,nj,rj,ij,aj,oj=t((()=>{tj=4,nj=(e,t)=>!!(e.compareDocumentPosition(t)&tj),rj=(e,t)=>nj(e,t)?-1:1,ij=16,aj=32}));function sj(e,t){let n={...uj[e]};for(let e of Object.keys(cj)){let r=t[e];r!==void 0&&Object.assign(n,{[e]:r})}return n}var cj,lj,uj,dj=t((()=>{cj={tab:`close`,blur:`always`,outsidePress:`pointerdown`,shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},lj=e=>e.trapFocus?`trap`:`flow`,uj={menu:cj,select:cj,combobox:{...cj,tab:`native`},popover:{...cj,tab:lj,blur:`iframe`},dialog:{...cj,tab:lj,blur:`never`,outsidePress:`click`,shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:e=>e.inertAndLock},tooltip:{...cj,tab:`native`,movesFocus:!1},hoverCard:{...cj,tab:`flow`},navigationMenu:{...cj,tab:`flow`,blur:`never`}}}));function fj(e){let t=mj();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;r>0?t.set(e,r):t.delete(e)}}function pj(e,t,n=`[data-slot="${e.getAttribute(`data-slot`)}"]`){return t.target.closest(n)===e}var mj,hj=t((()=>{mj=()=>globalThis[Symbol.for(`ui-sdk.popup-elements@1`)]??=new WeakMap}));function gj(e){return!(e instanceof HTMLElement)||e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert]`)||(e.checked?[]:_j(e)).some(e=>e.checked&&gj(e))?!1:typeof e.checkVisibility==`function`?e.checkVisibility({visibilityProperty:!0}):e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`}function _j(e){return!(e instanceof HTMLInputElement)||e.type!==`radio`||!e.name?[]:(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter(t=>t instanceof HTMLInputElement&&t.type===`radio`&&t.name===e.name&&t.form===e.form)}function vj(e){return Array.from(e.querySelectorAll(Cj)).filter(gj)}function yj(e){let t=e=>[...e.filter(e=>e.index>0).sort((e,t)=>e.index-t.index),...e.filter(e=>e.index<=0)].flatMap(e=>e.stops),n=(e,r)=>{for(let i of e){let e=i.hasAttribute(`tabindex`)?i.tabIndex:0;if(i.hasAttribute(`inert`)||i.shadowRoot&&e<0)continue;let a=i.matches(Cj)&&!i.shadowRoot?.delegatesFocus&&gj(i)?[i]:[],o=i instanceof HTMLSlotElement?i.assignedElements():[];if(i.shadowRoot||o.length){let s=[];n(i.shadowRoot?.children??o,s),r.push({index:e,stops:[...a,...t(s)]})}else r.push({index:e,stops:a}),n(i.children,r)}},r=[];return n(e.children,r),r.flatMap(e=>e.stops)}function bj(e,t){let n=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(n.assignedSlot)return!0;return!1};return e.filter(e=>e.tabIndex>0&&!n(e)).sort((e,t)=>e.tabIndex-t.tabIndex)}function xj(e,t,n){let r=e=>{for(let t of e.children)if(i(t))return!0;return!1},i=e=>{if(e===n)return!1;if(t(e))return!0;if(e.shadowRoot)return r(e.shadowRoot);if(e.localName===`slot`){let t=e.assignedElements({flatten:!0});if(t.length)return t.some(i)}return r(e)};r(e)}function Sj(e,t){let n=e.ownerDocument??document,r=!1,i;return xj(n.body,t=>r&&t.matches(Cj)&&gj(t)?(i=t,!0):(r||=t===e,!1),t),i}var Cj,wj=t((()=>{Cj=`a[href],area[href],button,input:not([type='hidden']),select,textarea,iframe,summary,audio[controls],video[controls],[contenteditable]:not([contenteditable='false']),[tabindex]`}));function Tj(e,t){let n=e.ownerDocument,r=!1,i,a=[],o=()=>{a.forEach(e=>e.remove()),a=[],i=void 0},s=()=>{let e=n.createElement(`span`);return e.tabIndex=0,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=Ej,e},c=()=>{let o=ak(n);!r&&!a.length&&t()&&o instanceof HTMLIFrameElement&&sk(e,o)&&(i=o,a=[s(),s()],o.before(a[0]),o.after(a[1]))},l=()=>{c(),setTimeout(c)},u=Gk(n.defaultView??window,`blur`,l),d=Gk(n,`focusout`,l),f=Gk(n,`focusin`,t=>{let n=a.indexOf(t.composedPath()[0]),r=i;if(o(),n<0||!r)return;let s=yj(e),c=n===0?-1:1;(s.at((s.indexOf(r)+c)%s.length)??e).focus({preventScroll:!0})});return()=>{r=!0,u(),d(),f(),o()}}var Ej,Dj=t((()=>{qk(),wj(),_k(),Ej=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none`}));function Oj(e,t){Lj.get(e)?.();let n=NA.delete(e)?[]:e.getAnimations?.({subtree:!0}).filter(Rj),r=n?.every(t=>zj(t)!==e);if(e.setAttribute(`data-starting-style`,``),n&&r)for(let t of e.getAnimations?.({subtree:!0})??[])Rj(t)&&!n.some(e=>Bj(t,e))&&t.finish();let i,a,o=requestAnimationFrame(()=>a=setTimeout(()=>{e.removeAttribute(`data-starting-style`),t&&(i=Nj(e,t))}));return()=>{cancelAnimationFrame(o),clearTimeout(a),i?.(),e.removeAttribute(`data-starting-style`)}}function kj(e){return e.split(`,`).map(e=>{let t=parseFloat(e)||0;return e.trim().endsWith(`ms`)?t/1e3:t})}function Aj(e){return Math.max(jj(getComputedStyle(e)),jj(getComputedStyle(e,`::backdrop`)))}function jj(e){let t=(e,t,n=`1`)=>{let r=kj(e),i=kj(t),a=n.split(`,`).map(e=>e.trim()===`infinite`?1:parseFloat(e)||1);return r.map((e,t)=>(e*(a[t%a.length]??1)+(i[t%i.length]??0))*1e3)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Mj(e){let t=0;for(let n of e){let e=n.effect?.getComputedTiming(),r=Number(e?.endTime);e&&Number.isFinite(r)&&(t=Math.max(t,r-(Number(e.localTime)||0)))}return t}function Nj(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter(Vj),i=()=>{n||(n=!0,clearTimeout(a),t())},a=r.length?setTimeout(i,Math.max(Aj(e),Mj(r))+50):void 0;return r.length?Promise.allSettled(r.map(e=>e.finished)).then(i):yO(i),()=>{n=!0,clearTimeout(a)}}function Pj(e,t){e.toggleAttribute(`data-open`,t),e.toggleAttribute(`data-closed`,!t)}function Fj(e,t){let n=e.length,r=!1,i=[],a=e.map(e=>Ij(e,(e,a)=>{i.push(e),r||=a,--n>0||(i.forEach(e=>e(r)),t())}));return()=>a.forEach(e=>e())}function Ij(e,t){Lj.get(e)?.(),e.removeAttribute(`data-starting-style`),e.setAttribute(`data-ending-style`,``);let n=e.hasAttribute(`inert`);e.setAttribute(`inert`,``);let r=e.ownerDocument?.defaultView?.MutationObserver,i=!1,a=r&&new r(()=>i=!0);a?.observe(e,{attributeFilter:[`inert`]});let o=0,s=()=>{cancelAnimationFrame(o),Lj.delete(e),e.removeAttribute(`data-ending-style`),i||=!!a?.takeRecords().length,a?.disconnect(),i||e.toggleAttribute(`inert`,n)},c=t=>{if(!t)return s();Lj.set(e,s),o=requestAnimationFrame(()=>{o=requestAnimationFrame(s)})},l=!1,u=Nj(e,()=>t(c,l));return l=!0,()=>{u(),s()}}var Lj,Rj,zj,Bj,Vj,Hj=t((()=>{bO(),PA(),Lj=new WeakMap,Rj=e=>`transitionProperty`in e,zj=e=>e.effect?.target,Bj=(e,t)=>zj(e)===zj(t)&&e.transitionProperty===t.transitionProperty,Vj=e=>!e.timeline||!(`source`in e.timeline)}));function Uj(e){return{consumeOutsidePress:e===!0||e===`pointer`,trapFocus:e===!0||e===`trap-focus`,inertAndLock:e===!0}}function Wj(e){return e===`initial`||e===`hover`?`none`:e===`touch`?`popup`:`auto`}function Gj(e){return e.focusable&&!e.consumed?!1:e.type!==`pointerdown`||`later`}function Kj(e){e.localName===`input`&&uM.has(e.type)&&e.value&&e.getAttribute(`aria-expanded`)!==`true`&&e.select()}function qj(e,t){for(let n of e){let e=n();if(e&&t(e))return e}}function Jj(e,t,n){Bk(e,t,(e,t)=>`open`in e&&e.open!==t.open?n(!!e.open,t):void 0)}function Yj(e,t){return{id:`${t}-content`,tabindex:`-1`,hidden:e.mounted?void 0:``,...vk(e.open)}}function Xj(e,t){return typeof e==`function`?e()??void 0:typeof e==`string`?t.querySelector(e)??void 0:e}function Zj(e){return e.isConnected&&!e.closest(`[inert]`)}function Qj(e){let t=e.getRangeAt(0).cloneRange();return{range:t,backward:!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset}}function $j(){let e=ak();return!e||e===e.ownerDocument.body||!Zj(e)||e.checkVisibility?.()===!1}function eM(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function tM(e){return e.getRootNode().activeElement}function nM(e,t){let n=fM().get(e);n||fM().set(e,n={selectors:new Set,css:``});let r=n.selectors;t.every(e=>r.has(e))||(t.forEach(e=>r.add(e)),n.css=`@layer ui-sdk { :where(${[...r].map(e=>`${e}[popover]`).join(`, `)}) { inset: auto; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none } }`),n.css&&SA(e,`ui-sdk-popover-reset`,n.css)}function rM(e){tk&&!pM.has(e)&&(pM.add(e),EA(()=>{nM(document,e),TA(document)}))}function iM(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener(`close`,t=>{performance.now()-iA()<100||e(t)}),()=>n?.destroy()}function aM(e,t){for(let n=e;n;n=n.parent)if(n===t||hM.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function oM(e){let t=sj(e.preset,e),n=()=>typeof t.tab==`function`?t.tab(e.modal()):t.tab,{store:r}=e,i,a,o,s=!1,c,l,u,d=r.get().open?`initial`:`imperative`,f=t.focusOnMount&&r.get().open,p=!1,m=!1,h=!1,g=!0,_=!1,v,y=!1,b,x=r.get().open,S=()=>void 0,C=[],w=e.returnTrigger??e.trigger,T,E,D,O,k=(t,n)=>e.onOpenChangeComplete?.(t,n),A=e=>e||!!a?.el&&tk;Jj({store:r},[`mounted`],e=>A(e)===e?{mounted:e}:void 0);function ee(e){v=e;let t=e?.isContentEditable?e.ownerDocument.getSelection():null;b=t?.rangeCount&&e.contains(t.anchorNode)?Qj(t):void 0;let n=v&&lA(v),r=n?void 0:dA();S=n?.returnTarget??(()=>r)}let j=r.get().open;r.subscribe(()=>{let{open:n}=r.get();if(n===j)return;if(j=n,n){if(O?.(!0),e.onOpenChange?.(!0),c?.(),c=void 0,a)for(let e of[a.el,a.backdrop])e&&Pj(e,!0);let t=e.trigger();_=d===`imperative`&&!!t&&lM.has(t),f=!_,p=!0,g=!0;let n=tk?ak():null;ee(n&&n!==n.ownerDocument.body?n:void 0);let o=w();x=d===`imperative`||h&&!!v&&!lA(v)&&!dA()&&!(o&&sk(o,v));let s=!!a;r.set({mounted:!0}),i?(s&&ie(),re()):tk||(p=!1,k(!0));return}let m=t.movesFocus&&!_&&g;g=!0,f=!1,p=!1,d=`imperative`,h=!1;let y=O?.(!1);s=y?.reason===`outside-press`;let C=a?.el;o&&uA(te());let T=S,E=b;if(b=void 0,!C||!tk){e.onOpenChange?.(!1,y),r.set({mounted:!1}),k(!1,y);return}let D=ak(),A=e.trigger(),M=!D||D===C.ownerDocument.body||sk(C,D)||!!o&&cA(o,D)&&!(A&&sk(A,D));e.onOpenChange?.(!1,y),i?.config.onClose?.();let N=eA(),P=e.finalFocus?.()??`trigger`,I=[C,...a?.backdrop?[a.backdrop]:[]];I.forEach(e=>Pj(e,!1));let ne=!1,L=Fj(I,()=>{ne=!0,c=void 0,r.set({mounted:!1}),ie(),k(!1,y)});if(ne||(c=L),l?.(),l=void 0,u?.(),u=void 0,!m||!M)return;if(m===!0){F(C,T,!1,E,P);let e=ak();setTimeout(()=>{e&&!e.isConnected&&$j()&&!tA(N)&&F(C,T,!1,void 0,P)});return}if(m===`unless-moved`){queueMicrotask(()=>{let e=ak();e&&e!==C.ownerDocument.body&&!sk(C,e)||tA(N)||F(C,T,!1,E,P)});return}let R=()=>{z(),clearTimeout(ae),setTimeout(()=>{let e=ak();e&&e!==C.ownerDocument.body||F(C,T,!1,E,P)})},z=Gk(window,`pointerup`,R,{capture:!0}),ae=setTimeout(R,1e3)});function M(t,n,r=S,i=!1){let a=()=>r(n,i),o=()=>P(t,i);return x?[()=>v,a,w,o,e.trigger]:[w,()=>v,a,o,e.trigger]}let N=!1;function te(e=Zj,t=!1){if(!N){N=!0;try{return qj(M(a?.el,e,S,t),e)}finally{N=!1}}}function P(e,t=!1){let n=C[0]?.node;if(n?.isConnected&&!e?.contains(n)){for(let t of[...C.slice(1).map(e=>e.node),n.ownerDocument.body]){let r=vj(t).filter(t=>!e?.contains(t)),i=r.find(e=>nj(n,e)&&!n.contains(e))??r.filter(e=>nj(e,n)).pop();if(i)return i}return}let r=C.findIndex((e,t)=>!e.node.isConnected&&C[t+1]?.node.isConnected);if(r===-1)return;let i=C[r],a=i.next?.deref(),o=i.previous?.deref(),s=C[r+1].node,c=e=>!!e?.isConnected&&e.parentNode===s,l=c(a)?a.previousElementSibling===(i.previous?o:null):!i.next&&(i.previous?c(o)&&!o.nextElementSibling:!s.firstElementChild);if(t&&!l)return;let u=(e,t)=>e.contains(t)||nj(e,t),d=c(a)?e=>u(a,e):c(o)?e=>nj(o,e)&&!o.contains(e):e=>u(s,e);for(let{node:t}of C.slice(r+1)){let n=vj(t).filter(t=>!e?.contains(t)),r=c(o)?n.filter(e=>!u(o,e)||o.contains(e)).pop():void 0,i=n.find(d)??r??n[0];if(i)return i}}function F(t,n,r=!1,i,a=e.finalFocus?.()??`trigger`){if(a===`none`)return;let o=e=>{if(!Zj(e)||t.contains(e))return!1;let n=e.ownerDocument.getSelection(),r=i&&e===v?n?.rangeCount&&e.contains(n.anchorNode)?Qj(n):i:void 0;if(NO(e),ak()!==e)return!1;if(r&&e.contains(r.range.startContainer)){let{startContainer:e,startOffset:t,endContainer:i,endOffset:a}=r.range;r.backward?n?.setBaseAndExtent(i,a,e,t):n?.setBaseAndExtent(e,t,i,a)}return!0},s=M(t,o,n,r);a!==`trigger`&&s.unshift(()=>Xj(a,t.ownerDocument)),qj(s,o)}function I(e,n){if(!f||!a||!r.get().open||!t.movesFocus)return;f=!1;let i=Wj(d),o=d===`initial`&&t.focusOnMount||i===`popup`&&n?.()?`auto`:i;if(o===`none`)return;let s=()=>{if(!a||!r.get().open)return;let t=o===`popup`?a.el:e?.();if(!t||(PO(t),!a||!r.get().open))return;let n=ak();!n||!sk(t,n)&&!sk(a.el,n)?PO(a.el):Kj(t)};m?requestAnimationFrame(()=>{let e=ak();a&&e&&sk(a.el,e)||s()}):s()}function ne(i,c,m){let h=[],g=e.trigger(),b=c.host?.()??i;if(d===`initial`&&!v){let e=ak();ee(e&&e!==e.ownerDocument.body&&!sk(i,e)?e:void 0)}i.removeAttribute(`hidden`),b.removeAttribute(`hidden`);let x=a?.backdrop;if(x){let e=L(x,c.inline);h.push(()=>{e(),R(x)})}if(!c.inline){b.setAttribute(`popover`,`manual`);try{b.showPopover()}catch{}}if(m&&NA.add(i),c.position&&e.position){let t=e.position(()=>c.anchor?.()??e.trigger(),i,c.position,()=>e.close(`anchor-hidden`,{focus:!1}));T=t.place,E=t.follow,h.push(t,()=>T=E=void 0),c.rendered&&h.push(c.rendered(t.follow))}c.inline||rk()||b.style.zIndex||(b.style.zIndex=`2147483000`),h.push(Oj(i,p?()=>{p=!1,k(!0)}:void 0)),OO();let S=_?Uj(!1):e.modal(),O=t.blur,A=e.persistent?.()??[],j=(e,t)=>e===i&&!!t&&`clientX`in t&&eM({x:t.clientX,y:t.clientY},i.getBoundingClientRect()),M=w()??(!g&&v?.isConnected?v:void 0);(M||!g)&&(C=[]);for(let e=M??null;e&&e!==i.ownerDocument.body;e=e.parentElement){let{nextElementSibling:t,previousElementSibling:n}=e;C.push({node:e,next:t&&new WeakRef(t),previous:n&&new WeakRef(n)})}let N={parent:e.parent?.()??(g&&lA(g)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:S.consumeOutsidePress,blocking:typeof t.blocking==`function`?t.blocking(S):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:i,covers:e=>b.contains(e),contains:(t,n)=>i.contains(t)&&!j(t,n)||A.some(e=>e.contains(t))||(e.contains?e.contains(t,n):!!e.trigger()?.contains(t)),overBackdrop:(e,t)=>s&&!!a?.backdrop&&!eM({x:e,y:t},a.backdrop.getBoundingClientRect())&&eM({x:e,y:t},i.getBoundingClientRect()),returnTarget:te,onOutsidePress:t=>{let n=t.composedPath()[0];e.close(`outside-press`,{event:t,focus:Gj({type:t.type,focusable:!!n?.closest?.(dM),consumed:S.consumeOutsidePress})})},takesEscape:e.takesEscape,onEscape:t=>{t.preventDefault(),e.onEscape?e.onEscape(t):e.close(`escape-key`,{event:t,focus:!0})},onBlur:O===`never`?void 0:O===`always`?t=>e.close(`window-blur`,{event:t,focus:!1}):(t=>setTimeout(()=>{let n=tM(i)??i.ownerDocument.activeElement;n?.tagName===`IFRAME`&&!i.contains(n)&&e.close(`focus-out`,{event:t,focus:!1})}))};o=N,mM.set(N,[i,...x?[x]:[]]),h.push(gA(N)),gM.set(N,{inside:e=>e.contains(i)||!!g&&e.contains(g),again:()=>{let e=ak();ie();for(let e of[b,x])try{e?.hidePopover()}catch{}re(),e&&e!==ak()&&e.focus({preventScroll:!0})}}),S.inertAndLock&&hM.add(N);for(let t of[e.onShow,c.onShow]){let e=t?.(N);e&&h.push(e)}let P,F,ne,z=()=>{let e=[i,...a?.backdrop?[a.backdrop]:[],...A];g&&t.keepTrigger&&e.push(g);for(let t of rA())t!==N&&aM(t,N)&&e.push(...mM.get(t)??[]);P=FA(i.ownerDocument,i);let n=qA(e);N.keep=n.keep,l=F=n},ae=()=>{ne?.(),F?.(),P?.(),l===F&&(l=void 0),F=P=N.keep=void 0};S.inertAndLock&&(ne=DA(()=>{if(ne=void 0,!r.get().open)return;let e=ak();z(),n()===`trap`&&e&&!Zj(e)&&(f=!0,I(c.initialFocus,c.chosenFocus))})),D=()=>{let n=_?Uj(!1):e.modal();N.modal=n.consumeOutsidePress,N.blocking=typeof t.blocking==`function`?t.blocking(n):t.blocking,n.inertAndLock?hM.add(N):hM.delete(N),n.inertAndLock&&!S.inertAndLock&&r.get().open?z():!n.inertAndLock&&S.inertAndLock&&ae(),S=n},h.push(ae,()=>D=void 0);let oe=new Set(rA());for(let e=N.parent;e;e=e.parent)oe.add(e);oe.delete(N);for(let e of oe)if(e.keep&&aM(N,e))for(let t of[i,...x?[x]:[]])h.push(e.keep(t));if(n()===`flow`&&t.dismissOnFocusLoss){let t;h.push(Gk(i.ownerDocument,`mousedown`,e=>{t=e,y=!1,setTimeout(()=>{t===e&&(t=void 0)})},{capture:!0}),Gk(i.ownerDocument,`focusin`,n=>{y=!1;let a=tM(i)??n.target;r.get().open&&!cA(N,a)&&(t&&N.contains(a,t)||e.close(`focus-out`,{event:n,focus:!1}))}),Gk(i,`focusout`,t=>{y&&!t.relatedTarget&&setTimeout(()=>{let n=ak(i.ownerDocument);r.get().open&&!(n&&cA(N,n))&&e.close(`focus-out`,{event:t,focus:!1})})}))}if(h.push(Tj(i,()=>n()===`trap`)),t.closeWatcher){let t=iM(t=>e.close(`back`,{event:t,focus:!0}));t&&(u=t,h.push(()=>{t(),u===t&&(u=void 0)}))}let se=t=>{let n=t.target,r=t.submitter;(r?.getAttribute(`formmethod`)??n.getAttribute(`method`))?.toLowerCase()===`dialog`&&lA(n)===N&&(t.preventDefault(),e.close(`close-press`,{event:t,focus:!0,returnValue:r?.value||void 0}))};i.addEventListener(`submit`,se),h.push(()=>i.removeEventListener(`submit`,se)),r.get().open&&!f&&n()===`trap`&&$j()&&(f=!0);for(let e of rA()){let t=gM.get(e);e!==N&&t?.inside(i)&&t.again()}return queueMicrotask(()=>I(c.initialFocus,c.chosenFocus)),()=>{if(h.forEach(e=>e()),o===N&&(o=void 0),!r.get().mounted&&!c.inline)try{b.hidePopover()}catch{}}}function re(e=!1){if(!i||a)return;let{el:t,config:n}=i;a={el:t,cleanup:()=>{},backdrop:n.backdrop?.()},a.cleanup=ne(t,n,e)}function L(e,t=!1){if(e.removeAttribute(`hidden`),t)return Oj(e);e.setAttribute(`popover`,`manual`);try{e.showPopover()}catch{}return!rk()&&!e.style.zIndex&&(e.style.zIndex=`2147483000`),Oj(e)}function R(e){if(!r.get().mounted)try{e.hidePopover()}catch{}}function ie(){if(!a)return;let{cleanup:e}=a;a=void 0,e()}function z(t){if(y=t.key===`Tab`,t.key===`Escape`&&o)return hA(o,t);let r=a?.el;if(t.key!==`Tab`||!r)return;let i=n();if(i===`native`)return;if(i===`close`)return e.close(`focus-out`,{event:t,focus:!1});let s=vj(r),c=yj(r),l=c[0],u=c.at(-1),d=ak(),f=!l||d===l||d===r,p=!u||d===u,m=i===`trap`?bj(s,r):[];if(m.length){let e=[...m,...s.filter(e=>!m.includes(e))],n=e.indexOf(d),i=d===r?e.at(t.shiftKey?-1:0):e.at((n+(t.shiftKey?-1:1))%e.length),a=m.includes(d)||!!i&&m.includes(i),o=d?.shadowRoot,c=!t.shiftKey&&!!o&&vj(o).length>0;if(d!==r&&(n<0||!a||c))return;t.preventDefault(),i?.focus({preventScroll:!0});return}if(i===`trap`){if(t.shiftKey?f:p){t.preventDefault(),((t.shiftKey?u:l)??r).focus({preventScroll:!0});return}let e=s.indexOf(d),n=e<0?void 0:s[e+(t.shiftKey?-1:1)],i=n&&!n.checked?_j(n):[];if(i.some(e=>e.checked)&&!i.includes(d)){t.preventDefault(),n?.focus({preventScroll:!0});return}setTimeout(()=>{let e=ak(r.ownerDocument);a?.el===r&&!(e&&(sk(r,e)||o&&cA(o,e)))&&((t.shiftKey?u:l)??r).focus({preventScroll:!0})});return}let h=e.trigger()??(v?.isConnected?v:void 0);if(h){if(t.shiftKey&&f)t.preventDefault(),h.focus({preventScroll:!0});else if(!t.shiftKey&&p){let e=Sj(h,r);if(!e)return;t.preventDefault(),e.focus()}}}return{bind(n,o={}){let s=!1,c=fj(n),l=()=>{i={el:n,config:o},r.get().mounted&&(a&&a.el!==n&&ie(),re(!0))};return n.isConnected?l():queueMicrotask(()=>{!s&&n.isConnected&&l()}),()=>{s=!0;let o=e.finalFocus?.()??`trigger`;if(c(),i?.el===n&&(i=void 0,a?.el===n)){let e=ak(),a=r.get().open&&t.movesFocus&&!_&&(!e||e===n.ownerDocument.body||sk(n,e)),s=S;if(ie(),a){let e=b;b=void 0,queueMicrotask(()=>{!i&&!n.isConnected&&$j()&&F(n,s,!0,e,o)})}}}},keydown:z,triggerKeydown(e){let t=a?.el;e.key===`Tab`&&!e.shiftKey&&t&&r.get().open&&n()===`flow`&&(e.preventDefault(),(yj(t)[0]??t).focus({preventScroll:!0}))},opening(e,t){d=e,m=t?.type===`pointerdown`,h=t?.type===`keydown`},opener:()=>d,observe(e){O=e},requestClose:(t,n)=>e.close(t,{event:n,focus:!0}),returnFocus(e){g=e},initialFocus:I,place:()=>T?.(),checkPlacement:()=>E?.(),updateModal:()=>D?.(),layer:()=>o,element:()=>a?.el,mountedAs:A,backdrop(e){if(!a||a.backdrop===e)return()=>{};let{el:t}=a,n=i?.config.host?.()??t,r=!!i?.config.inline;a.backdrop=e;let s=L(e,r),c=ak();if(!r)try{n.hidePopover(),n.showPopover()}catch{}c&&c!==ak()&&c.focus({preventScroll:!0});let l=o?.keep?.(e);return()=>{l?.(),s(),a?.backdrop===e&&(a.backdrop=void 0),R(e)}}}}var sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M=t((()=>{yk(),Wk(),qk(),vA(),$A(),qO(),oj(),nk(),PA(),_k(),dj(),hj(),Dj(),Hj(),wj(),sM={mouse:`pointer`,pen:`pointer`,touch:`touch`,keyboard:`keyboard`,virtual:`keyboard`,programmatic:`imperative`,agent:`imperative`},cM=e=>e?sM[jO(e)]:`imperative`,lM=new Set,uM=new Set([`text`,`search`,`url`,`tel`,`email`,`password`]),dM=`a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]`,fM=()=>globalThis[Symbol.for(`ui-sdk.popover-reset@2`)]??=new WeakMap,pM=new WeakSet,mM=new WeakMap,hM=new WeakSet,gM=new WeakMap}));function vM(e,t=!1){return e===`start`?t?`right`:`left`:e===`end`?t?`left`:`right`:e}var yM,bM=t((()=>{yM={top:`bottom`,bottom:`top`,left:`right`,right:`left`}}));function xM(){return EM??=typeof CSS<`u`&&typeof CSS.supports==`function`&&[`position-anchor: --a`,`position-try-fallbacks: flip-y`,`position-visibility: always`].every(e=>CSS.supports(e)),EM}function SM(e,t,n,r,i){if(!xM()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!DM(i))return!1;let a=e=>e.split(`,`).some(e=>parseFloat(e)>0);return!a(r.transitionDuration)&&(r.animationName===`none`||!a(r.animationDuration))}function CM(e,t,n,r,i){let{sideOffset:a,alignOffset:o,collisionPadding:s}=r,c=t===`top`||t===`bottom`,[l,u]=c?[`left`,`right`]:[`top`,`bottom`],d=c?i.width:i.height,f=n===`start`?`anchor(${l}) + ${o}px`:n===`end`?`anchor(${u}) - ${d+o}px`:`anchor(center) - ${d/2-o}px`,p=yM[t];return{[p]:`round(anchor(${t}), 1px)`,[t]:`auto`,[`margin-${p}`]:`${a}px`,[`margin-${t}`]:`${s}px`,[l]:`round(min(max(${f}, min(${s}px, anchor(${u}))), max(100% - ${d+s}px, anchor(${l}) - ${d}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":c?`flip-y`:`flip-x`,"position-visibility":`always`}}function wM(e){let t=OM.get(e);if(t||(t=`--ui-anchor-${++kM.count}`,OM.set(e,t)),!e.style.getPropertyValue(`anchor-name`).split(`,`).some(e=>e.trim()===t)){let n=getComputedStyle(e).getPropertyValue(`anchor-name`);e.style.setProperty(`anchor-name`,n&&n!==`none`?`${n}, ${t}`:t)}return t}function TM(e){let t=OM.get(e),n=e.style.getPropertyValue(`anchor-name`).split(`,`).map(e=>e.trim()).filter(e=>e&&e!==t);n.length?e.style.setProperty(`anchor-name`,n.join(`, `)):e.style.removeProperty(`anchor-name`),e.getAttribute(`style`)||e.removeAttribute(`style`)}var EM,DM,OM,kM,AM=t((()=>{bM(),DM=e=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1},OM=new WeakMap,kM=globalThis[Symbol.for(`ui-sdk.anchor-names@1`)]??={count:0}}));function jM(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,[`scroll`,`load`,`input`,`pointermove`,`focusin`,`transitionstart`,`animationstart`]],[window,[`resize`]],[window.visualViewport,[`resize`,`scroll`]],[document.fonts,[`loadingdone`]]];for(let[e,r]of n)for(let n of r)e?.addEventListener(n,zM,t);let r=new MutationObserver(BM);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}function MM(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let t of[`scroll`,`load`,`transitionstart`,`animationstart`])e.addEventListener(t,zM,n);let r=new MutationObserver(BM);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function NM(e){let t=[];for(let n=e;n;)n.nodeType===11&&`host`in n?(t.push(n),n=n.host):n=n.assignedSlot??n.parentNode;return t}function PM(e){let t=[...e];for(let e of t){let t=VM.get(e)??{count:0,stop:MM(e)};t.count++,VM.set(e,t)}return()=>{for(let e of t.splice(0)){let t=VM.get(e);--t.count||(t.stop(),VM.delete(e))}}}function FM(e,t){IM.size||(RM=jM());let n=typeof ResizeObserver==`function`?new ResizeObserver(e):void 0;return t&&n?.observe(t),IM.set(e,n&&t),()=>{n?.disconnect(),IM.delete(e),IM.size||(RM(),RM=LM)}}var IM,LM,RM,zM,BM,VM,HM=t((()=>{IM=new Map,LM=()=>{},RM=LM,zM=e=>IM.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),BM=e=>IM.forEach((t,n)=>e.some(e=>e.attributeName!=`aria-activedescendant`&&!t?.contains(e.target))&&n()),VM=new Map}));function UM(e){let t=e;if(!e.getClientRects().length&&(getComputedStyle(e).display!==`contents`||(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)))return;let{x:n,y:r,width:i,height:a}=t.getBoundingClientRect();return{x:n,y:r,width:i,height:a}}function WM(e){let t=`getBoundingClientRect`in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}function GM(e,t,n,r,i){let{sideOffset:a,alignOffset:o}=i,s=n===`top`||n===`bottom`,c=0,l=0;return n===`bottom`&&(l=e.y+e.height+a),n===`top`&&(l=e.y-t.height-a),n===`right`&&(c=e.x+e.width+a),n===`left`&&(c=e.x-t.width-a),s?(r===`start`&&(c=e.x+o),r===`center`&&(c=e.x+e.width/2-t.width/2+o),r===`end`&&(c=e.x+e.width-t.width-o)):(r===`start`&&(l=e.y+o),r===`center`&&(l=e.y+e.height/2-t.height/2+o),r===`end`&&(l=e.y+e.height-t.height-o)),{x:c,y:l}}function KM(e,t,n,r,i){return e===`bottom`?t.y+n.height-(r.y+r.height-i):e===`top`?r.y+i-t.y:e===`right`?t.x+n.width-(r.x+r.width-i):r.x+i-t.x}function qM(e,t,n,r){let{sideOffset:i,collisionPadding:a}=r,o=e===`bottom`?n.y+n.height-a-(t.y+t.height+i):e===`top`?t.y-i-a-n.y:n.height-a*2,s=e===`right`?n.x+n.width-a-(t.x+t.width+i):e===`left`?t.x-i-a-n.x:n.width-a*2;return{width:Math.max(0,s),height:Math.max(0,o)}}function JM(e,t,n,r){let i={x:0,y:0,...n},a={...r,side:vM(r.side,r.rtl)},o=aN(a.side,a.align,a.rtl),s=a.side,c=GM(e,t,s,o,a),l=KM(s,c,t,i,a.collisionPadding);if(l>0){let n=yM[s],r=GM(e,t,n,o,a);KM(n,r,t,i,a.collisionPadding)<l&&(s=n,c=r)}let u=a.collisionPadding,d=qM(s,e,i,a),f=!1;if(KM(s,c,t,i,u)>0&&((s===`top`||s===`bottom`)&&t.height&&(e.height>=t.height||a.inside)?(f=!0,c.y=oN(oN(c.y,i.y+u,i.y+i.height-t.height-u),e.y,e.y+e.height-t.height),d.height=Math.max(0,i.height-u*2)):(s===`left`||s===`right`)&&t.width&&(e.width>=t.width||a.inside)&&(f=!0,c.x=oN(oN(c.x,i.x+u,i.x+i.width-t.width-u),e.x,e.x+e.width-t.width),d.width=Math.max(0,i.width-u*2))),s===`top`||s===`bottom`){let n=oN(c.x,i.x+u,i.x+i.width-t.width-u);c.x=n===c.x?n:oN(n,e.x-t.width,e.x+e.width)}else{let n=oN(c.y,i.y+u,i.y+i.height-t.height-u);c.y=n===c.y?n:oN(n,e.y-t.height,e.y+e.height)}return{...c,side:s,align:a.align,available:d,inside:f}}function YM(){uN||(uN=!0,EA(()=>bA(lN)))}function XM(e){let t=new Map,n=(e,n)=>t.get(e)!==n&&(t.set(e,n),!0);return{style(t,r){n(`style:${t}`,r)&&e.style.setProperty(t,r)},attribute(t,r){n(t,r)&&(r===null?e.removeAttribute(t):e.setAttribute(t,r))},reset:()=>t.clear()}}function ZM(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function QM(e,t,n={},r){let i=()=>typeof n==`function`?n():n,a=()=>typeof e==`function`?e():e,o=e=>({side:e.side??`bottom`,align:e.align??`start`,sideOffset:Number(e.sideOffset??4),alignOffset:Number(e.alignOffset??0),collisionPadding:Number(e.collisionPadding??8)});bA(lN),Object.assign(t.style,{position:`fixed`,inset:`auto`,margin:`0`,left:`0`,top:`0`});let s=XM(t),c=getComputedStyle(t),l,u=``,d=``,f=!1,p,m=!1,h=!1,g=[],_=()=>{},v=!1,y,b={left:`0`,top:`0`},x,S=new Set;function C(e={left:`0`,top:`0`}){y&&TM(y.anchor),y=void 0;for(let e of S)s.style(e,``);S.clear(),u=``,s.style(`inset`,`auto`),s.style(`margin`,`0`),s.style(`left`,e.left),s.style(`top`,e.top)}function w(){if(h)return!1;let e=i(),n=o(e),T=Number(e.arrowPadding??6),E=a();if(!E)return!1;let D=`nodeType`in E?E:void 0,O=D&&UM(D);if(D&&f&&(!D.isConnected||!O))return y&&C(b),D.isConnected&&p===D&&(p=void 0,r?.()),!1;p=O?D:void 0;let k=D?NM(D):[];(k.length!==g.length||k.some((e,t)=>e!==g[t]))&&(_(),g=k,_=PM(k)),m=!D&&`getBoundingClientRect`in E;let A=ZM();if(y&&(D!==y.anchor||!DM(A))&&C(),v)y&&wM(y.anchor);else if(v=!0,D&&O&&SM(D,O,t,c,A))y={anchor:D,name:wM(D)};else for(let e of dN)t.style.getPropertyValue(e)&&t.style.removeProperty(e);let ee=!f,j=ee&&NA.has(t),M=t.style.transition;ee&&!j&&(t.style.transition=`none`);let N=WM(O??E),te={width:t.offsetWidth,height:t.offsetHeight},P=fN(e),F=P?{width:P.offsetWidth,height:P.offsetHeight}:void 0,I=`${N.x},${N.y},${N.width},${N.height},${A.x},${A.y},${A.width},${A.height},${n.side},${n.align},${n.sideOffset},${n.alignOffset},${n.collisionPadding}`,ne=`${I},${te.width},${te.height},${F?.width??``},${F?.height??``},${T}`;if(ne===u&&(!P||P===l?.el))return!1;u=ne;let re={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},L=c.direction===`rtl`,R=$M(c,te);if(y){let e=vM(n.side,L),t=CM(y.name,e,aN(e,n.align,L),n,R);for(let[e,n]of Object.entries(t))S.add(e),s.style(e,n)}let ie=eN(t.getBoundingClientRect(),R,c),{scale:z}=ie,ae={width:R.width*z.x,height:R.height*z.y},oe={...n,inside:d===I,sideOffset:n.sideOffset*(iN(n.side)?z.y:z.x),alignOffset:n.alignOffset*(iN(n.side)?z.x:z.y),rtl:L},se={x:N.x,y:N.y,width:N.width,height:N.height},ce=JM(se,ae,A,oe);d=ce.inside?I:``;let le=x;x=se;let ue=e=>Math.abs(ie.x-e.x)<=1&&Math.abs(ie.y-e.y)<=1;if(y){let e=ue(ce),n=!e&&!!le&&ue(JM(le,ae,A,oe));if(!e&&!n)return C(),j||(t.style.transition=M),w();n&&(u=``),b={left:`${parseFloat(c.left)+parseFloat(c.marginLeft)}px`,top:`${parseFloat(c.top)+parseFloat(c.marginTop)}px`}}else{let e={x:ie.x-(parseFloat(c.left)||0)*z.x,y:ie.y-(parseFloat(c.top)||0)*z.y},n=t.ownerDocument.defaultView?.devicePixelRatio||1,r=e=>Math.round(e*n)/n;s.style(`left`,`${r((ce.x-e.x)/z.x)}px`),s.style(`top`,`${r((ce.y-e.y)/z.y)}px`)}let de=iN(ce.side)?z.x:z.y;ee&&(f=!0,j||(c.left,t.style.transition=M)),s.attribute(`data-side`,ce.side),s.attribute(`data-align`,ce.align),s.style(`--available-height`,`${ce.available.height/z.y}px`),s.style(`--available-width`,`${ce.available.width/z.x}px`),s.style(`--anchor-width`,`${N.width/z.x}px`),s.style(`--anchor-height`,`${N.height/z.y}px`);let[fe,pe]=rN(ce.side,ce.align,L,N,ae,ce);s.style(`--transform-origin`,`${Math.round(fe/z.x)}px ${Math.round(pe/z.y)}px`);let me={x:ce.x+re.left*z.x,y:ce.y+re.top*z.y,width:re.width*z.x,height:re.height*z.y},he=nN(N,me,ce.side,T*de);if(s.style(`--arrow-offset`,`${Math.round(he/de)}px`),P&&F){let e=tN(N,{...me,...ae},{width:F.width*z.x,height:F.height*z.y},ce.side,T*de),t=Math.round(e.offset/de);l?.el!==P&&(l={el:P,write:XM(P)});let{write:n}=l;n.style(`position`,`absolute`),n.style(`left`,iN(ce.side)?`${t}px`:``),n.style(`top`,iN(ce.side)?``:`${t}px`),n.attribute(`data-side`,ce.side),n.attribute(`data-align`,ce.align),n.attribute(`data-arrow-clamped`,e.clamped?``:null)}return!0}let T=0,E=0;function D(){T=0,E=w()?0:E+1,(E<sN||m)&&(T=requestAnimationFrame(D))}function O(){E=0,T||=requestAnimationFrame(D)}let k=FM(O,t),A=setInterval(()=>T||w()&&O(),cN);w(),O();let ee=()=>{cancelAnimationFrame(T),clearInterval(A),k(),_(),g=[],h=!0},j=i(),M=pN(j),N=fN(j);function te(){let e=i(),t=pN(e),n=fN(e);(t!==M||n!==N)&&(M=t,N=n,O())}return Object.assign(ee,{follow:te,place(){f=!1,u=``,s.reset(),l?.write.reset(),w()}})}function $M(e,t){let n=t=>parseFloat(e.getPropertyValue(t))||0,r=(t,r)=>e.boxSizing===`border-box`?0:n(`padding-${t}`)+n(`padding-${r}`)+n(`border-${t}-width`)+n(`border-${r}-width`),i=parseFloat(e.width)+r(`left`,`right`),a=parseFloat(e.height)+r(`top`,`bottom`),o={width:Math.abs(i-t.width)<1,height:Math.abs(a-t.height)<1};return{width:o.width?i:t.width,height:o.height?a:t.height,exact:o}}function eN(e,t,n){let r=!!n.translate&&n.translate!==`none`,i=!!n.rotate&&n.rotate!==`none`,a=!!n.scale&&n.scale!==`none`,o=!!n.transform&&n.transform!==`none`;if(!r&&!i&&!a&&!o)return{x:e.x,y:e.y,scale:{x:hN(e.width,t.width,t.exact?.width),y:hN(e.height,t.height,t.exact?.height)}};let[s=0,c=0]=n.transformOrigin.split(` `).map(e=>parseFloat(e)||0),l=(e,t)=>e?e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)||0:0,u=r?n.translate.split(` `):[],d=l(u[0],t.width),f=l(u[1],t.height),p=i?n.rotate.split(` `):[],[m,h,g]={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[p[0]]??(p.length===4?p.slice(0,3).map(parseFloat):[0,0,1]),_=Math.hypot(m,h,g)||1,[v,y,b]=[m/_,h/_,g/_],x=p.length?mN(p[p.length-1]):0,[S,C]=[Math.cos(x),Math.sin(x)],w=[S+(1-S)*v*v,(1-S)*v*y-C*b,(1-S)*v*y+C*b,S+(1-S)*y*y],[T=1,E=T]=a?n.scale.split(` `).map(parseFloat):[],D=o?/^matrix(3d)?\((.*)\)$/.exec(n.transform):null,O=D?.[2].split(`,`).map(parseFloat)??[],[k,A,ee,j,M,N,te,P,F]=D?D[1]?[O[0],O[1],O[4],O[5],O[12],O[13],O[3],O[7],O[15]]:[...O,0,0,1]:[1,0,0,1,0,0,0,0,1],I=(e,t)=>{let[n,r]=[e-s,t-c],i=te*n+P*r+F||1,a=T*(k*n+ee*r+M)/i,o=E*(A*n+j*r+N)/i;return[s+d+w[0]*a+w[1]*o,c+f+w[2]*a+w[3]*o]},ne=[I(0,0),I(t.width,0),I(0,t.height),I(t.width,t.height)],re=ne.map(([e])=>e),L=ne.map(([,e])=>e),R=Math.min(...re),ie=Math.min(...L),z={x:hN(e.width,Math.max(...re)-R,t.exact?.width),y:hN(e.height,Math.max(...L)-ie,t.exact?.height)};return{x:e.x-z.x*R,y:e.y-z.y*ie,scale:z}}function tN(e,t,n,r,i){let a=r===`top`||r===`bottom`,o=a?n.width:n.height,s=(a?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-o/2,c=(a?t.width:t.height)-o-i,l=Math.max(i,Math.min(s,c));return{offset:Math.round(l),clamped:Math.abs(l-s)>.5}}function nN(e,t,n,r){let i=n===`top`||n===`bottom`,a=i?e.x+e.width/2-t.x:e.y+e.height/2-t.y,o=i?t.width:t.height;return Math.round(Math.min(Math.max(a,r),Math.max(r,o-r)))}function rN(e,t,n,r,i,a){if(e===`top`||e===`bottom`){let o=n?r.right-a.x:r.left-a.x,s=n?r.left-a.x:r.right-a.x;return[t===`center`?r.left+r.width/2-a.x:t===`start`?o:s,e===`bottom`?0:i.height]}let o=t===`center`?r.top+r.height/2-a.y:t===`start`?r.top-a.y:r.bottom-a.y;return[e===`right`?0:i.width,o]}var iN,aN,oN,sN,cN,lN,uN,dN,fN,pN,mN,hN,gN=t((()=>{AM(),HM(),bM(),PA(),iN=e=>e===`top`||e===`bottom`,aN=(e,t,n=!1)=>n&&iN(e)&&t!==`center`?t===`start`?`end`:`start`:t,oN=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n)),sN=3,cN=500,lN=[`--available-height`,`--available-width`],uN=!1,dN=[`position-anchor`,`position-try-fallbacks`,`position-visibility`],fN=e=>typeof e.arrow==`function`?e.arrow():e.arrow,pN=e=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join(),mN=e=>{let t=parseFloat(e)||0;return e.endsWith(`turn`)?t*2*Math.PI:e.endsWith(`grad`)?t*Math.PI/200:e.endsWith(`rad`)?t:t*Math.PI/180},hN=(e,t,n=!1)=>t>.01&&Math.abs(e-t)>=(n?.05:1)?e/t:1}));function _N(e){return e.getAttribute(`role`)?.trim().split(/\s+/)[0]||(TN.find(([t])=>e.matches(t))?.[1]??``)}function vN(e){if(e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?.display===`none`||t?.visibility===`hidden`}function yN(e,t){return e.getRootNode().getElementById?.(t)??null}function bN(e){return(e.getAttribute(`aria-labelledby`)??``).split(/\s+/).map(t=>t&&yN(e,t)).filter(e=>!!e).map(e=>e.getAttribute(`aria-label`)??CN(e,!0)).join(` `)}function xN(e){return e.localName===`img`?e.getAttribute(`alt`)??``:e.localName===`svg`?[...e.children].find(e=>e.localName===`title`)?.textContent??``:``}function SN(e,t,n){if(e.matches(`input, select, textarea`))return``;let r=!t&&bN(e)||e.getAttribute(`aria-label`)?.trim()||xN(e);if(r)return` ${r} `;if(e.localName===`svg`)return``;let i=CN(e,t,n),a=e.getAttribute(`title`);return i||(a?` ${a} `:``)}function CN(e,t=!1,n=vN(e)){let r=``;for(let i of e.childNodes)if(i.nodeType===Node.TEXT_NODE)r+=i.nodeValue;else if(i.nodeType===Node.ELEMENT_NODE&&(n||!vN(i))){let e=SN(i,t,n);r+=wN(i,e)?` ${e} `:e}return r}function wN(e,t){let n=e.ownerDocument.defaultView?.getComputedStyle(e).display;return!!n&&n!==`inline`&&(!n.startsWith(`inline`)||!!t.trim())}var TN,EN,DN,ON,kN=t((()=>{TN=[[`button`,`button`],[`a[href]`,`link`],[`input[type=checkbox][switch]`,`switch`],[`input[type=checkbox]`,`checkbox`],[`input[type=radio]`,`radio`],[`input[type=range]`,`slider`],[`dialog`,`dialog`],[`h1, h2, h3, h4, h5, h6`,`heading`]],EN=new Set([`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`treeitem`]),DN=e=>[...e.labels??[]].map(e=>CN(e)).join(` `),ON=[bN,e=>e.getAttribute(`aria-label`)??``,DN,xN,e=>EN.has(_N(e))?CN(e):``,e=>e.getAttribute(`title`)??``],[...ON.filter(e=>e!==DN)]}));function AN(e){let t=``;for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3)t+=n.nodeValue;else if(n.nodeType===1){let e=n;if(e.hasAttribute(`hidden`)||e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`)continue;t+=e.firstElementChild?AN(e):e.textContent??``}return t}function jN(e){return e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`?``:e.firstElementChild?AN(e):e.textContent??``}var MN=t((()=>{}));function NN(e,t){if(LN===`agent`)return LN;if(IN.has(e))return`programmatic`;if(t){let e=t();return e===`programmatic`&&LN?LN:e}return LN??`programmatic`}function PN(e,t){let n=LN;LN=e;try{return t()}finally{LN=n}}function FN(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var IN,LN,RN=t((()=>{IN=new Set([`image-load`,`image-error`,`imperative`,`item-removed`,`unmount`,`reset`,`restore`,`timeout`,`resize`,`page-hide`])})),zN,BN,VN,HN=t((()=>{zN=e=>`${e[0].toUpperCase()}${e.slice(1)}`,BN=(e,t)=>`on${zN(e)}${t}`,VN=e=>`default${zN(e)}`}));function UN(e){return XN.add(e),e}function WN(e,t){return Object.is(e,t)?!0:!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length||XN.has(e)||XN.has(t)?!1:e.every((e,n)=>Object.is(e,t[n]))}function GN(e,t){return KN(e,t,void 0)}function KN(e,t,n){if(Object.is(e,t))return!0;let r=Array.isArray(e)&&Array.isArray(t);if(!r&&!(ZN(e)&&ZN(t)))return!1;if(n){for(let r=0;r<n.length;r+=2)if(n[r]===e&&n[r+1]===t)return!0}let i=n??[];i.push(e,t);try{if(r){let n=e,r=t;if(n.length!==r.length||XN.has(n)||XN.has(r))return!1;for(let e=0;e<n.length;e++)if(!KN(n[e],r[e],i))return!1;return!0}let n=e,a=t,o=Object.keys(n);if(o.length!==Object.keys(a).length)return!1;for(let e of o)if(!(e in a)||!KN(n[e],a[e],i))return!1;return!0}finally{i.length-=2}}function qN(e,t){let n=e,r,i,a=!1,o,s=new Set,c=new Map,l,u={state:e,renders:0,writes:0,touch:()=>p([],n,!1,!1),skipping:c},d={get(){return o??f()},set(e,i=!1){if(r&&!i&&!a){let t=f();if(t!==n){let n={...t};for(let t in e)delete n[t];d.set(n,!0)}}let o;for(let t in e)WN(n[t],e[t])||(o??=[]).push(t);if(!o)return;let s=n;n={...n,...e},u.state=n;let c=t.length>0;if(c){for(let e=0;e<o.length;e++)if(!t.includes(o[e])){c=!1;break}}p(o,s,c,i)},subscribe(e){return s.add(e),()=>{s.delete(e)}},setFanout(e){l=e},follow(e){r=e},view(e,t){let n=o;o=e;try{return t()}finally{o=n}}};function f(){if(!r||a)return n;a=!0;let e;try{e=r(n)}finally{a=!1}if(!e)return n;if(i?.state===n&&i.over===e)return i.result;let t=n;for(let r in e)if(!WN(n[r],e[r])){t={...n,...e};break}return i={state:n,over:e,result:t},t}function p(e,t,n,r){n||u.renders++,r||u.writes++;for(let t of s)t(n,r,e);for(let[t,i]of c){let a=!e.length;if(!a){for(let n=0;n<e.length;n++)if(!Object.hasOwn(t,e[n])){a=!0;break}}if(a)for(let t of i)t(n,r,e)}l?.(e,t,n,r)}return QN.set(d,u),d}function JN(e,t,n){return YN(QN.get(e).skipping,t,n)}function YN(e,t,n){let r=e.get(t);return r||e.set(t,r=new Set),r.add(n),()=>{r.delete(n),!r.size&&e.get(t)===r&&e.delete(t)}}var XN,ZN,QN,$N,eP,tP,nP,rP=t((()=>{XN=new WeakSet,ZN=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},QN=new WeakMap,$N=e=>QN.get(e).state,eP=e=>QN.get(e).renders,tP=(e,t)=>{QN.set(e,QN.get(t))},nP=e=>QN.get(e).touch()}));function iP(e,t,n,r){Ck(()=>{let i,a,o;if(aP.add)i=aP.add(e,t,n,r);else if(typeof document<`u`&&(oP.add(a=new WeakRef(e)),o={parts:t,definition:n,options:r},sP.set(e,o),oP.size%1e3==0))for(let e of oP)e.deref()||oP.delete(e);return()=>{(i??o?.unwatch)?.(),i=void 0,o&&(o.unwatch=void 0),a&&=(oP.delete(a),void 0)}})}var aP,oP,sP,cP=t((()=>{Mk(),aP={},oP=new Set,sP=new WeakMap}));function lP(e,t){let{store:n,options:r}=e,i=new Map,a=new Map,o=new Map;return e.onOptions((e,t)=>{if(!t)return;let n;for(let[e,r]of i)e in t&&(WN(t[e],r.value)&&(n=r.source),i.delete(e));return n}),(s,c,l)=>{if(o.has(s)&&WN(o.get(s),c))return!1;let u=(a.get(s)??0)+1;a.set(s,u);let d=n.get()[s];if(WN(d,c))return!1;let{reason:f,event:p}=l,m=FN(l,l.source??t(f,p));m.source;let h=r(),g=h[s]!==void 0,_=o.has(s),v=o.get(s);o.set(s,c);try{PN(m.source,()=>{let e=BN(s,`Change`),t=h[e];typeof t==`function`&&t(c,m);let r=a.get(s)!==u;m.canceled||g||r||n.set({[s]:c})})}finally{_?o.set(s,v):o.delete(s)}return!m.canceled&&(aP.change?.(e.id,s,c,m,d),g&&i.set(s,{value:c,source:m.source}),!0)}}var uP=t((()=>{bO(),RN(),HN(),rP(),cP()}));function dP(){return OO(),pP}function fP(e,t=dP()){return lP(e,t)}var pP,mP=t((()=>{qO(),uP(),RN(),pP=(e,t)=>NN(e,t&&(()=>jO(t)))}));function hP(e,t){return ej([...e.parts()].filter(e=>e.slot===t&&!!e.el?.isConnected)).map(({el:e,key:t,props:n})=>({el:e,key:t,props:n}))}var gP=t((()=>{oj()})),_P,vP,yP=t((()=>{_P=new WeakSet,vP=e=>(_P.add(e),e)}));function bP(e,t){return vP(Promise.resolve({reason:e,source:pP(e,t)}))}function xP(e){let{popup:t,store:n,rules:r={}}=e,i=`imperative`,a,o,s;t.observe(e=>{let t=e?void 0:o??{reason:i,source:`programmatic`};if(o=void 0,t)return a?.resolve(t),a=void 0,t}),e.onDestroy(()=>{a?.resolve({reason:`unmount`,source:`programmatic`}),a=void 0});function c(e){if(!a){let e;a={promise:vP(new Promise(t=>e=t)),resolve:e}}if(e&&!e.aborted){let n=()=>t.requestClose(`imperative`);e.addEventListener(`abort`,n,{once:!0}),a.promise.then(()=>e.removeEventListener(`abort`,n))}return a.promise}let l,u=(t,n)=>{let r=l;l=t;try{return e.change(t,n)}finally{l=r}};function d(e={},t){return f(e,t).result}function f(a,o){let{event:l,signal:d}=a;if(d?.aborted)return{opened:!1,result:bP(i)};let f=a.reason??(l?`trigger-press`:i),p=o??f,m={...a,reason:p,payloadReason:f},h=!1,g=(n=a.by??`imperative`)=>{s=a.anchor;let r=e.payload?.opening(a.trigger,a.payload,{reason:f,event:l});return t.opening(n,l),h=u(!0,{reason:p,event:l}),h||r?.(),h};return n.get().open?(t.opener()===`hover`&&a.by!==`hover`&&t.opening(a.by??`imperative`,l),a.trigger===void 0&&e.payload?.reopening(a,{reason:f})&&a.anchor&&(s=a.anchor),r.reopen?.(m,g),{opened:h,result:c(d)}):(r.open?r.open(m,g):g(),{opened:h,result:h?c(d):bP(p,l)})}function p(a={}){if(!n.get().open)return!1;let{event:s,returnValue:c}=a,l=a.reason??i;if(e.dismissal&&!e.dismissal.allows(l,s))return!1;let d=!1,f=()=>{o={reason:l,source:pP(l,s),returnValue:c},t.returnFocus(a.focus??e.returnFocus??!0);let n=u(!1,{reason:l,event:s,...c!==void 0&&{returnValue:c}});return n||(t.returnFocus(!0),o=void 0),d=n,n};return r.close?r.close({...a,reason:l},f):f(),d}function m({trigger:t,payload:n,anchor:r,reason:i,event:a}){s=r,e.payload?.handOver(t,n,{reason:i,event:a})}let h=(e,t)=>f({reason:i,event:t},e).opened;return{api:{isOpen:()=>n.get().open,setOpen:(e,{reason:t,event:r}={})=>e!==(l??n.get().open)&&(e?h(t,r):p({reason:t,event:r})),open:(e={})=>d({...e,reason:e.reason??i}),close:({reason:e,event:t,returnValue:n}={})=>p({reason:e,event:t,returnValue:n}),toggle:({reason:e,event:t}={})=>n.get().open?p({reason:e,event:t}):h(e,t)},show:d,attempt:f,hide:p,takeOver:m,result:c,anchor:()=>s}}var SP=t((()=>{yP(),mP()}));function CP(e,t){let n=e,{store:r,element:i,options:a}=n,{preset:o}=t,s=t.slot??`content`,c=t.trigger??`trigger`,l=fP(n),u=e=>e!==void 0&&n.props(s,e)||hP(n,s)[0]?.props||n.props(s)||{},d=()=>{if(v?.trigger)return v.trigger();let e=r.get().trigger;return e!==null&&i(c,e)||i(c)},f=null,p,m=()=>{let e=r.get().trigger;if(v?.trigger||e===null||e===f)return d();let t=p??hP(n,c).length<=1;return i(c,e)??(t?i(c):void 0)},h=r.get().open;r.subscribe(()=>{let{open:e,trigger:t}=r.get();e!==h&&(h=e,e&&(f=t!==null&&!i(c,t)?t:null,p=hP(n,c).length<=1))});function g(e){for(let t of n.parts())if(t.slot===c&&t.key!==e&&t.el?.isConnected)return t.key}let _={label:n.label,role:t.role??o.role,store:r,options:a,onOptions:n.onOptions,onDestroy:n.onDestroy,element:i,parts:n.parts,preset:o,get popup(){return k},get control(){return A},triggerElement:d,triggerSlot:c,nextTrigger:g,firstTrigger(){for(let e of n.parts())if(e.slot===c)return g()??e.key},triggerDisabled:e=>!!n.props(c,e)?.disabled,contentProps:u},v=_.rules=t.rules?.(_),y=o.dismissal?.(a,v),b=o.presentation?.(_,y),x=o.press?.(_),S=o.group?.(_),C=o.hover?.(_,S),w=o.focus?.(_),T=o.triggerName?.(_);o.resetStyles?.prepare(n.label,s),o.placement?.prepare();function E(e,t){if(o.modal!==void 0)return{modal:e.modal??(t.presentation===`sheet`||o.modal)}}function D(){let e=E(a(),r.get());e&&r.set(e)}function O(e,t){v?.dismiss?v.dismiss(e,t):A.hide({reason:e,...t})}let k=oM({...t.behavior,preset:o.behavior,position:o.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:d,returnTrigger:m,contains:(e,t)=>v?.contains?v.contains(e,t):!!d()?.contains(e)||!!x?.contains(e,t),close:O,modal:()=>v?.modal?.()??Uj(r.get().modal),parent:()=>v?.parent?.(),persistent:()=>v?.persistent?.()??[],finalFocus:()=>u().finalFocus,takesEscape:v?.takesEscape,onEscape:e=>v?.onEscape?v.onEscape(e):O(`escape-key`,{event:e,focus:!0}),onShow:e=>v?.onShow?.(e),onOpenChange(e,t){v?.onOpenChange?.(e,t),S?.change(e),e?(b?.open(),D()):(C?.clear(),w?.clear())},onOpenChangeComplete(e,t){v?.onOpenChangeComplete?.(e,t),a().onOpenChangeComplete?.(e)}}),A=xP({dismissal:y,popup:k,store:r,payload:o.payload?.(r,(e,t)=>l(`payload`,e,t)),change:(e,t)=>l(`open`,e,{...t,...v?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return v?.returnFocus},rules:{open(e,t){C?.clear(),S?.opening(e.event),v?.open?v.open(e,t):t()},reopen(e){if(C?.clear(),v?.reopen)return v.reopen(e);let{trigger:t,payload:n,payloadReason:i,event:a}=e;t!==void 0&&t!==r.get().trigger&&A.takeOver({trigger:t,payload:n,reason:i,event:a})},close:(e,t)=>v?.close?v.close(e,t):t()}});D(),Bk(n,[`modal`],(e,t,n)=>E(n,{...t,...e}));let ee=r.get().modal;r.subscribe(()=>{let{modal:e}=r.get();e!==ee&&(ee=e,k.updateModal())});let j={dismissal:y,presentation:b,press:x,group:S,hover:C,focus:w,triggerName:T,rules:v};return{...A.api,getPayload:()=>r.get().payload,focus:()=>d()?.focus(),internal:Object.assign(_,j)}}function wP(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:`popover`}}var TP=t((()=>{Wk(),mP(),gP(),_M(),SP()}));function EP(e){OP.add(e),kP||(kP=!0,queueMicrotask(DP))}function DP(){kP=!1;try{for(let e of OP)OP.delete(e),e()}finally{OP.size&&!kP&&(kP=!0,queueMicrotask(DP))}}var OP,kP,AP=t((()=>{OP=new Set,kP=!1}));function jP(e,t){let n=e;if(n.owner.sleeping)return new fF(n,t);let r=n.view;if(r&&r.props===t&&r.api===e.api)return r;let i={id:e.id,key:e.key,props:t,api:e.api};return t===e.props&&(n.view=i),i}function MP(e){e.dropped&&!e.owner.parts.has(e.mapKey)&&(IP(e),e.dropped=!1),e.leases++;let t=!0;return()=>{if(!t||(t=!1,--e.leases))return;let{owner:n}=e;n.released?n.released.push(e):(n.released=[e],queueMicrotask(()=>PP(n)))}}function NP(e){let{owner:t}=e;t.released?t.released.push(e):(t.released=[e],queueMicrotask(()=>PP(t)))}function PP(e){let t=e.released;if(t){e.released=void 0;for(let n=0;n<t.length;n++){let r=t[n];if(!r.leases&&e.parts.get(r.mapKey)===r){e.parts.delete(r.mapKey);let t=e.keyed.get(r.slot);t===r?e.keyed.delete(r.slot):t instanceof Map&&t.get(r.key)===r&&t.delete(r.key),r.dropped=!0}}}}function FP(e){let{parts:t}=e;if(e.unordered){e.unordered=!1;let n=0,r=!0;for(let e of t.values()){if(e.rank<n){r=!1;break}n=e.rank}if(!r){let e=[...t.values()].sort((e,t)=>e.rank-t.rank);t.clear();for(let n of e)t.set(n.mapKey,n)}}return t}function IP(e){let{owner:t}=e,{parts:n,keyed:r}=t;e.rank=++t.rank,n.set(e.mapKey,e);let i=r.get(e.slot);if(!i)r.set(e.slot,e);else if(i instanceof Map)i.set(e.key,e);else if(i.key===e.key)r.set(e.slot,e);else{let t=new Map;t.set(i.key,i),t.set(e.key,e),r.set(e.slot,t)}}function LP(e,t=e.props,n=e.store.get()){let r=lF(e),i=r.slots[e.slot],a=i.role,o=i.attrs||typeof a==`function`?jP(e,t):void 0,s=i.attrs?.(n,o),c=typeof a==`function`?a(n,o):a;if(s){let e=xF.get(i);e===void 0?xF.set(i,(`hidden`in s?yF:0)|(`id`in s?bF:0)):!(e&bF)&&`id`in s&&xF.set(i,e|bF)}let l=t.id;e.made=l===void 0||s?.id!==l?s?.id??null:void 0;let u=r.slotNames[e.slot]??(r.slotNames[e.slot]=e.slot===`root`?r.name:`${r.name}-${e.slot}`),d=a===void 0?{"data-slot":u,...s}:{"data-slot":u,role:c,...s};return a!==void 0&&(d.role=c),XP(e,d)}function RP(e,t){let n;for(let r in e)e[r]!==void 0&&hF.has(r)&&t(r)&&((n??={...e})[r]=void 0);return n??e}function zP(e,t=e.props,n=e.store.get()){let r=uF(e).state;return r?r(n,jP(e,t)):oF}function BP(e,t=e.props,n=e.store.get()){let r=uF(e).present;return!r||r(n,jP(e,t))}function VP(e,t,n=e.props){let r=uF(e).selects,i=MP(e),a=r?r.subscribe(e,t,n):JN(e.store,vF,t);return()=>{i(),a()}}function HP(e){let t=e,n=uF(e);if(t.handlersFor===n&&t.handlers)return t.handlers;let{on:r,press:i}=n;if(!r&&typeof i!=`function`)return t.handlersFor=n,t.handlers=sF;let a={};for(let t in r){let n=r[t];a[t]=t=>{t.defaultPrevented||aF(t)||n(t,mF(e))}}return typeof i==`function`&&!a.click&&(a.click=n=>{n.defaultPrevented||(t.owner.sleeping?.wake(),i(mF(e),n))}),t.handlersFor=n,t.handlers=a}function UP(e){e.propsListeners?.forEach(e=>e())}function WP(e){return lF(e).sleeping?.wake(),e.api}function GP(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}function KP(e){let t=SF.get(e);return t||(t=new Set(e),SF.set(e,t)),t}function qP(e){let t=uF(e),n=xF.get(t);if(n===void 0){let r=t.attrs?.(e.store.get(),jP(e,e.props));n=r?(`hidden`in r?yF:0)|(`id`in r?bF:0):0,xF.set(t,n)}return n}function JP(e,t,n={by:`core`}){let r=e,{owner:i}=r,a=e.el?r:i.parts.get(r.mapKey);a?!e.el&&a===r&&r.rank!==i.rank&&(r.rank=++i.rank,i.unordered=!0):IP(r);let o=uF(e),s={};e.el=t,r.binding=s;let c=[MP(r)],l=qP(e);if(l&yF&&TA(t.ownerDocument),(n.by===`core`||n.attaches!==`all`)&&(o.on||typeof o.press==`function`)){let r=n.by===`framework`&&n.attaches!==`all`?KP(n.attaches):void 0,i=n.by===`core`;if(r){for(let e in o.on)if(!r.has(e)){i=!0;break}!i&&typeof o.press==`function`&&!r.has(`click`)&&(i=!0)}if(i){let n=HP(e);for(let e in n)r&&r.has(e)||c.push(Gk(t,e,n[e]))}}o.live&&c.push(o.live.attach(e,t)),n.by===`framework`&&o.direct&&c.push(o.direct.attach(e,t));let u=o.asleep?.(t,e);u&&c.push(u);let{sleeping:d}=i;if(d&&o.bind){let n=()=>{let n=o.bind?.(t,e);n&&c.push(n)};d.binds.add(n),c.push(()=>d.binds.delete(n))}else if(o.bind){let n=o.bind(t,e);n&&c.push(n)}return l&bF&&typeof MutationObserver<`u`&&c.push(QP(r,t)),()=>{for(let e=0;e<c.length;e++)c[e]();r.binding===s&&(e.el=r.binding=void 0,r.own!==void 0&&eF(r))}}function YP(e,t){let n=e;if(n.ref)return n.ref;let r=null,i=()=>{};return n.ref=n=>{n!==r&&(i(),r=n,i=n?JP(e,n,t):()=>{})}}function XP(e,t){let{owner:n}=e;if(!n.named?.size||!CF.some(e=>t[e]))return t;let r=ZP(n,e.store);if(!r.size)return t;let i={...t};for(let e of CF){let t=i[e];t&&(i[e]=t.split(` `).map(e=>r.get(e)??e).join(` `))}return i}function ZP(e,t){let n=eP(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let t of e.named){let e=wF(t);e!==void 0&&e!==t.own&&r.set(e,t.own)}return e.aliases={version:n,map:r},r}function QP(e,t){let n=nF(t);(e.own!==void 0||n&&n!==e.made)&&eF(e);let r=EF.get(t);r?r instanceof Set?r.add(e):r!==e&&EF.set(t,new Set([r,e])):(EF.set(t,e),$P().observe(t,TF)),OF++;let i=!0;return()=>{if(!i)return;i=!1;let n=EF.get(t);n===e?EF.delete(t):n instanceof Set&&(n.delete(e),n.size||EF.delete(t)),!--OF&&DF&&(DF.disconnect(),DF=void 0)}}function $P(){return DF||=new MutationObserver(e=>{for(let{target:t}of e){let e=EF.get(t);if(e instanceof Set)for(let t of e)eF(t);else e&&eF(e)}}),DF}function eF(e){let{owner:t}=e;t.unread||(t.unread=new Set,EP(()=>tF(t,e.store))),t.unread.add(e)}function tF(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let e of n)r=iF(e,e.el&&nF(e.el))||r;r&&nP(t)}function nF(e){let t=e.id;return t&&typeof t==`object`?e.getAttribute(`id`):t}function rF(e,t){!e.el&&typeof t==`string`&&uF(e).attrs&&iF(e,t)&&(lF(e).renamed=!0)}function iF(e,t){let n=wF(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:i}=e;return e.own=r,i.named??=new Set,r===void 0?i.named.delete(e):i.named.add(e),i.aliases=void 0,n!==void 0}function aF(e){return(e.type===`keydown`||e.type===`keyup`)&&(typeof e.key!=`string`||Kk(e))}var oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF=t((()=>{AP(),bO(),PA(),qk(),rP(),oF=Object.freeze({}),Object.freeze({}),sF=Object.freeze({}),cF=Symbol(),lF=e=>e.owner,uF=e=>lF(e).slots[e.slot],dF=class{slot;key;mapKey;id;store;props;el=void 0;owner;leases=0;constructor(e,t,n,r,i,a,o){this.slot=e,this.key=t,this.mapKey=n,this.id=r,this.store=i,this.props=a,this.owner=o}get api(){return this.owner.api}},fF=class{id;key;props;[cF];constructor(e,t){this.id=e.id,this.key=e.key,this.props=t,this[cF]=e}get api(){return WP(this[cF])}},pF=class{el;id;key;props;store;#e;constructor(e,t){this.el=e.el,this.id=e.id,this.key=e.key,this.props=t,this.store=e.store,this.#e=e}get api(){return WP(this.#e)}},mF=(e,t=e.props)=>lF(e).sleeping?new pF(e,t):{el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api},hF=new Set([`aria-label`,`aria-labelledby`,`aria-description`,`title`,`autocomplete`,`autocapitalize`,`autocorrect`,`spellcheck`,`inputmode`,`enterkeyhint`]),gF=e=>uF(e).direct?.names,_F=(e,t=e.props)=>uF(e).selects?.selection(e,t)??``,vF={},yF=1,bF=2,xF=new WeakMap,SF=new WeakMap,CF=[`aria-activedescendant`,`aria-controls`,`aria-describedby`,`aria-details`,`aria-errormessage`,`aria-flowto`,`aria-labelledby`,`aria-owns`,`for`,`headers`],wF=e=>uF(e).attrs?.(e.store.get(),jP(e,{...e.props,id:void 0})).id,TF={attributeFilter:[`id`]},EF=new WeakMap,OF=0}));function AF(e,t,n=4){let r=MF([e,t].flatMap(e=>[{x:e.left-n,y:e.top-n},{x:e.right+n,y:e.top-n},{x:e.right+n,y:e.bottom+n},{x:e.left-n,y:e.bottom+n}]));return(e,t)=>{for(let n=0;n<r.length;n++){let i=r[n],a=r[(n+1)%r.length];if((a.x-i.x)*(t-i.y)-(a.y-i.y)*(e-i.x)<0)return!1}return!0}}function jF(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function MF(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=e=>{let t=[];for(let n of e){for(;t.length>=2&&jF(t[t.length-2],t[t.length-1],n)<=0;)t.pop();t.push(n)}return t.pop(),t};return[...n(t),...n(t.reverse())]}var NF=t((()=>{}));function PF(e){let t,n,r;function i(){r?.(),r=void 0}function a(){clearTimeout(t),clearTimeout(n),i()}function o(t){i(),clearTimeout(n),n=setTimeout(()=>e.close(t),e.closeDelay())}return{clear:a,enter(e,r,a=0){e.pointerType!==`touch`&&(clearTimeout(n),i(),r&&(clearTimeout(t),a>0?t=setTimeout(r,a):r()))},leave(n){if(n.pointerType===`touch`||(clearTimeout(t),!e.closesOnLeave()))return;let a=e.trigger(),s=e.popup();if(!a||!s)return o(n);let c=AF(a.getBoundingClientRect(),s.getBoundingClientRect());if(!c(n.clientX,n.clientY))return o(n);i(),r=Gk(s.ownerDocument,`pointermove`,e=>{c(e.clientX,e.clientY)||o(e)})}}}var FF=t((()=>{qk(),NF()}));function IF(e,t,n){if(typeof t!=`string`)return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function LF(e,t,n){return{side:e.side??t.side??`bottom`,align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}function RF(e,t,n){for(let r of GF){let i=r.popup.element();!r.store.get().open||r.popup.opener()!==`hover`?GF.delete(r):r!==e&&!i?.contains(t??null)&&!i?.contains(document.activeElement)&&r.control.hide({reason:`trigger-hover`,event:n,focus:!1})}}function zF(e,t){let{store:n,options:r,preset:i}=e;e.onDestroy(()=>GF.delete(e));let a=PF({trigger:e.triggerElement,popup:()=>e.popup.element(),closesOnLeave:()=>n.get().open&&e.popup.opener()===`hover`,closeDelay:()=>r().closeDelay??i.closeDelay??0,close(t){e.popup.element()?.contains(document.activeElement)||e.control.hide({reason:`trigger-hover`,event:t,focus:!1})}});e.onDestroy(a.clear);let o=()=>(!i.press||!!r().openOnHover)&&!r().disabled,s=e=>o()&&a.leave(e);return{clear:a.clear,enter(s,c,l){if(!o())return;if(c===void 0)return a.enter(s);let u=()=>{o()&&!e.triggerDisabled(c)&&(t||(RF(e,e.element(e.triggerSlot,c),s),GF.add(e)),e.control.show({by:`hover`,event:s,reason:`trigger-hover`,trigger:c,payload:l}))};if(n.get().open){a.enter(s),n.get().trigger!==c&&u();return}let d=r().delay??i.delay??300;a.enter(s,u,t?t.delay(d):d)},leave:s,leaveContent(t){let n=t.relatedTarget;n&&e.triggerElement()?.contains(n)||s(t)}}}function BF(e){let{store:t,options:n,preset:r}=e,i,a=()=>clearTimeout(i);return e.onDestroy(a),{clear:a,enter(o,s,c){if(n().disabled||!MO())return;let l=()=>{!n().disabled&&!e.triggerDisabled(o)&&e.element(e.triggerSlot,o)?.contains(document.activeElement)&&e.control.show({by:`keyboard`,event:c,reason:`trigger-focus`,trigger:o,payload:s})},u=r.focusDelay??n().delay??r.delay??0;a(),t.get().open?l():u>0?i=setTimeout(l,u):l()},leave(n){if(a(),!t.get().open||e.popup.opener()===`hover`)return;let r=n.relatedTarget;r&&(e.popup.element()?.contains(r)||[...e.parts()].some(t=>t.slot===e.triggerSlot&&t.el?.contains(r)&&!e.triggerDisabled(t.key)))||e.control.hide({reason:`focus-out`,event:n,focus:!1})},keydown(t){let n=e.popup.element();return t.key===`Tab`&&!(n&&yj(n).length)},triggerAttrs(e,t,n,r,i){let a=e.trigger===null||e.trigger===n;return{...vk(e.open&&a),"aria-describedby":i===`tooltip`&&a?`${t}-content`:void 0,"data-disabled":r.disabled?``:void 0}}}}function VF(e){return e?e.type.startsWith(`focus`)?`focus-out`:e.type.startsWith(`pointer`)?`trigger-hover`:`outside-press`:`imperative`}function HF(e){let t=t=>e.control.hide({reason:VF(t),event:t});function n(e){qF.close!==t&&qF.close?.(e)}let r=!1;return e.onDestroy(()=>{qF.close===t&&(qF.close=void 0)}),{delay:e=>JF()?0:e,opening:n,change(e){e?(r=JF(),n(),qF.close=t):qF.close===t&&(qF.close=void 0,qF.closedAt=performance.now())},instant:()=>r,join(){e.store.get().open&&!qF.close&&(qF.close=t)}}}function UF(e,t){let n=`${e}-${t}`,r=YF.get(n);return r||(r=[`[data-slot="${n}"]`,`[data-slot="${e}-backdrop"]`],YF.set(n,r)),r}var WF,GF,KF,qF,JF,YF,XF,ZF=t((()=>{Mk(),qO(),yk(),gN(),wj(),FF(),_M(),WF={position:QM,prepare:()=>Ck(YM),anchor:IF,options:LF},GF=new Set,KF=400,qF={close:void 0,closedAt:-1/0},JF=()=>!!qF.close||performance.now()-qF.closedAt<KF,YF=new Map,XF={prepare(e,t){let n=UF(e,t);Ck(()=>rM(n))},prepareClient(e,t){rM(UF(e,t))},bind(e){nM(e.ownerDocument,[`[data-slot="${e.getAttribute(`data-slot`)}"]`])}}}));function QF(e,t){return{opening(n,r,i){let a={trigger:e.get().trigger,payload:e.get().payload};return n!==void 0&&e.set({trigger:n}),t(r,i),()=>e.set(a)},handOver(n,r,i){e.set({trigger:n}),t(r,i)},reopening(e,n){return`payload`in e&&t(e.payload,n)}}}var $F=t((()=>{})),eI,tI=t((()=>{ZF(),$F(),eI={payload:QF,behavior:`tooltip`,role:`tooltip`,side:`top`,delay:600,closeDelay:0,focusDelay:0,placement:WF,hover:zF,focus:BF,group:HF,resetStyles:XF}}));function nI(e,t){let n=iI.get(e);if(n){n.push(t);return}let r=[t];iI.set(e,r),EP(()=>{iI.delete(e);let t={};for(let e of r)e(t);e.set(t)})}function rI(e,t){nI(e,n=>{n[t]===void 0&&e.get()[t]===null&&(n[t]=!1)})}var iI,aI=t((()=>{AP(),iI=new WeakMap}));function oI(e,t,n,r,i){e.press?.keydown(t,n,r,i)||e.focus?.keydown(t)||e.popup.triggerKeydown(t)}function sI(e,t,n){pj(n,t)&&e.popup.keydown(t)}function cI(e,t,n,r){let{preset:i,control:a,contentProps:o,triggerElement:s,element:c,popup:l,press:u,rules:d,presentation:f}=t,{placement:p}=i;i.resetStyles?.bind(e);let m=!!o(n).inline;return(f??l).bind(e,{inline:m,anchor:()=>a.anchor()??p?.anchor(e,o().anchor,s),position:p&&!m?()=>p.options(o(n),{side:i.side,align:`center`},c(`arrow`)):void 0,rendered:r&&(e=>GP(r,e)),initialFocus:u&&(()=>u.initialFocus(l.element(),o().initialFocus,d?.preferredFocus)),chosenFocus:u&&(()=>(o().initialFocus??`auto`)!==`auto`),backdrop:()=>c(`backdrop`),...d?.bind?.()})}function lI(e,t,n){return e.get().trigger===null&&e.set({trigger:t}),()=>{e.get().trigger===t&&!e.get().open&&e.set({trigger:n?.(t)??null})}}function uI(e){return e({props:{id:`id`,disabled:`boolean`,focusableWhenDisabled:`boolean`,payload:`value`},state:(e,{key:t,props:n})=>({open:e.open&&(e.trigger===null||e.trigger===t),disabled:!!n.disabled}),attrs:(e,{id:t,key:n,props:r,api:i})=>{let{press:a,focus:o,role:s}=i.internal;return(a??o)?.triggerAttrs(e,t,n,r,s)??{}},on:{pointerenter:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.hover?.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.hover?.leave(e),focusin:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.focus?.enter(n,r.payload,e),focusout:(e,{api:t})=>t.internal.focus?.leave(e),keydown:(e,{api:t,el:n,key:r,props:i})=>n&&oI(t.internal,e,n,r,i)},press:({api:e,key:t,props:n},r)=>e.internal.press?.press(t,n,r),bind(e,{api:t,key:n,id:r,store:i}){let a=lI(i,n,t.internal.nextTrigger);return i.get().trigger===n&&!e.hasAttribute(`id`)&&(e.id=`${r}-trigger`),a}})}function dI(e){return e({props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`,initialFocus:`string`,finalFocus:`string`,keepMounted:`boolean`},connect:fj,role:(e,{api:t})=>t.internal.role,roles:[`dialog`,`alertdialog`,`menu`,`tooltip`],keys:[`Tab`],state:e=>({open:e.open,modal:e.modal,presentation:e.presentation,payload:e.payload}),present:(e,{props:t,api:n})=>e.mounted||!!t.keepMounted||n.internal.role===`tooltip`,attrs:(e,{id:t,api:n})=>{let{role:r,press:i,triggerName:a}=n.internal;return{...Yj(e,t),tabindex:r===`tooltip`?void 0:`-1`,...i?.contentAttrs(e,t,r),...a?.contentAttrs(e,t)}},on:{keydown:(e,{api:t,el:n})=>n&&sI(t.internal,e,n),pointerenter:(e,{api:t})=>t.internal.hover?.enter(e),pointerleave:(e,{api:t})=>t.internal.hover?.leaveContent(e)},bind(e,t){rI(t.store,`titled`);let n=()=>{let n=e.hasAttribute(`aria-label`);n!==!!t.store.get().named&&nI(t.store,e=>{e.named=n})};n();let r=new MutationObserver(n);r.observe(e,{attributeFilter:[`aria-label`]});let i=cI(e,t.api.internal,t.key,t);return()=>{r.disconnect(),i?.()}}})}function fI(e){return e({state:e=>({open:e.open}),attrs:e=>({"aria-hidden":`true`,...vk(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}})}var pI=t((()=>{bO(),xO(),aI(),yk(),kF(),_M(),hj()}));function mI(e){let t=e.slots(e=>e),n=e.name,r=e.label??n,i={};for(let e in t)i[e]=e===`root`?n:`${n}-${e}`;let a=a=>{let o=a,s=a.id,c=e.state(o),l=e.sync?.(o),u=qN(l?{...c,...l}:c,e.live??gI),d,f,p=t,m;function h(e){m?.has(e)||(m||(m=new Set,g.slots=Object.create(p)),m.add(e),Object.assign(g.slots,e.slots),E(),e.extend?.(C))}let g={name:n,label:r,slots:p,slotNames:i,parts:new Map,keyed:new Map,rank:0},{parts:_}=g;function v(e={}){return e.id??(e.value==null?``:String(e.value))}let y;function b(e,t={},n=!1){let r=v(t),i=g.keyed.get(e),a=i instanceof Map?i.get(r):i?.key===r?i:void 0;if(!a){let i=`${e}:${r}`;a=g.sleeping?new dF(e,r,i,s,u,t,g):{slot:e,key:r,mapKey:i,id:s,api:C,store:u,props:t,el:void 0,owner:g,leases:0},IP(a),n&&NP(a)}else if(n)return a;return a.props=t,UP(a),a}function x(e,t){if(t===void 0){for(let t of FP(g).values())if(t.slot===e&&t.el?.isConnected)return t.el;return}let n=_.get(`${e}:${t}`)?.el;return n?.isConnected?n:void 0}let S={id:s,label:r,store:u,options:()=>o,onOptions:e=>{(f??=[]).push(e)},onDestroy:e=>{(d??=[]).push(e)},parts:()=>FP(g).values(),element:x,props:(e,t=``)=>{let n=y?.[e];return n&&v(n)===t?n:_.get(`${e}:${t}`)?.props}},C;function w(){C=e.api(S),g.api=C,Fk(S,C)}let T=!1;function E(){let{sleeping:e}=g;if(e&&!T){T=!0,wk(k,w),g.sleeping=void 0;for(let t of[...e.binds])t()}}e.asleep?.(o)?g.sleeping={wake:E,binds:new Set}:w();let D=!1,O=(t,n)=>Vk(u,t,e.sync?.(t),n),k={types:void 0,name:n,id:s,get:u.get,subscribe:u.subscribe,get api(){return E(),C},part:b,use:h,preview(e){let t=O({...e,id:s},u.get()),n=u.get();for(let e in t)if(!WN(n[e],t[e]))return{...n,...t}},get derives(){return Uk(u)},view(e,t,n){let r=y;y=n;try{return u.view(e,t)}finally{y=r}},setOptions(t){let n=$N(u);o=t.id===s?t:{...t,id:s},g.sleeping&&!e.asleep(o)&&E();let r=O(o,n),i;try{if(f)for(let e of f)i=e(o,r)??i;let e=$N(u)===n?r:O(o,$N(u));e&&PN(i,()=>u.set(e,!0))}finally{}},startState:t=>e.state({...t,id:s}),follow(e){let t,n,r=(r=$N(u),i)=>{if(i)return O({...i,id:s},r);if(D)return n;let a=e();return(t?.options!==a||t.state!==r)&&(t={options:a,state:r},n=O({...a,id:s},r)),n};return u.follow(r),r},destroy(){D||(D=!0,Dk(k),d&&bk(()=>{for(let e=0;e<d.length;e++)d[e]()}))}};return tP(k,u),iP(k,_,e,S.options),k},o=e=>xk(()=>a(e));return Object.defineProperty(o,"name",{value:n}),Object.assign(o,{options:e.options,slots:t})}function hI(e){let t=_I.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:`boolean`,...n},slots:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.props??{}]))},_I.set(e,t)}return t}var gI,_I,vI,yI=t((()=>{bO(),Rk(),Wk(),RN(),Mk(),kF(),rP(),cP(),gI=[],_I=new WeakMap,vI=e=>eP(e)}));function bI(e,t){return e?dk(e,t):``}function xI(e){queueMicrotask(()=>e.get().apple!==ck()&&e.set({apple:ck()}))}function SI(e,t){return e({props:{shortcut:`string`},state:(e,n)=>({text:bI(n.props.shortcut??t(e),e.apple)}),attrs:()=>({"aria-hidden":`true`,translate:`no`}),asleep(e,n){let{store:r,props:i}=n;if(xI(r),e.childNodes.length)return;let a=()=>{let a=r.get();e.textContent=bI(i.shortcut??t(a,e,n),a.apple)};a();let o=r.subscribe(a);return()=>{o(),e.textContent=``}}})}var CI=t((()=>{_k()}));function wI(e,t){let n=e.getAttribute(`aria-labelledby`);return!!e.getAttribute(`aria-label`)?.trim()||!!n&&n!==t||!!e.getAttribute(`title`)?.trim()||!!jN(e).trim()||!!e.querySelector(`img[alt]:not([alt=''])`)}function TI(e,t){let n=``;for(let r of e.childNodes)if(r.nodeType===Node.TEXT_NODE)n+=r.nodeValue;else if(r.nodeType===Node.ELEMENT_NODE&&!(t&&kI(r))){let e=TI(r,t);n+=e.trim()&&wN(r,e)?` ${e} `:e}return n}function EI(e){let t=null,n=()=>{let n=e.getAttribute(`aria-label`);if(n!==null&&n!==t)return;let r=jI(e),i=r===AI(TI(e,!1))?null:r;i!==t&&(t=i,i===null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,i))};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,characterData:!0,attributeFilter:[`aria-hidden`,`hidden`]}),()=>{r.disconnect(),t!==null&&e.getAttribute(`aria-label`)===t&&e.removeAttribute(`aria-label`)}}function DI(e){let{store:t,options:n}=e,r=CP(e,{preset:eI}),{control:i,hover:a,group:o}=r.internal,s=!1,c=!1,l=t.get().open;t.subscribe(()=>{let{open:e}=t.get();e!==l&&(l=e,e&&t.set({instant:!!o?.instant()}),e&&c&&queueMicrotask(()=>{let e=r.internal.popup.element();e&&YO(jI(e),{doc:e.ownerDocument})}),c=!1)});function u(e,o,l,u){let d=cM(l);if(n().toggleable){if(t.get().open&&r.internal.popup.opener()!==`hover`)return i.hide({reason:`trigger-press`,event:l});if(n().disabled)return;c=!t.get().open,i.show({event:l,by:d,reason:`trigger-press`,trigger:e,payload:o})}else n().closeOnPress!==!1&&u?.getAttribute(`aria-disabled`)!==`true`&&(a?.clear(),s=!!l&&d!==`keyboard`,i.hide({reason:`trigger-press`,event:l}))}return{...r,internal:Object.assign(r.internal,{tooltipPress:u,enter(e,t,n){s||a?.enter(e,t,n)},leave(e){s=!1,a?.leave(e)}})}}var OI,kI,AI,jI,MI,NI=t((()=>{bO(),xO(),qO(),$O(),_k(),_M(),kN(),MN(),TP(),tI(),pI(),yI(),CI(),OI=e=>(e.type??(e.unnamed?`label`:`description`))===`label`,kI=e=>e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`,AI=e=>e.replace(/\s+/g,` `).trim(),jI=e=>AI(TI(e,!0)),MI=mI({name:`tooltip`,options:{container:`value`,open:`boolean`,defaultOpen:`boolean`,onOpenChange:`callback`,onOpenChangeComplete:`callback`,onPayloadChange:`callback`,delay:`number`,closeDelay:`number`,disabled:`boolean`,toggleable:`boolean`,closeOnPress:`boolean`,type:`string`,shortcut:`string`,controller:`value`},state:e=>({...wP(e),instant:!1,unnamed:!1,type:e.type,shortcut:e.shortcut,apple:lk()}),asleep:e=>e.open===void 0&&!e.defaultOpen&&!e.controller,sync:e=>({...e.open!==void 0&&{open:e.open},type:e.type,shortcut:e.shortcut}),api:DI,slots:e=>{let t=uI(e),n=dI(e);return{trigger:e({...t,props:{id:`id`,payload:`value`},state:(e,{key:t})=>({open:e.open&&(e.trigger===null||e.trigger===t)}),attrs:(e,{id:t,key:n})=>{let r=e.trigger===null||e.trigger===n,i=OI(e);return{type:`button`,"aria-labelledby":i?`${t}-content`:void 0,"aria-describedby":!i&&r?`${t}-content`:void 0,"aria-keyshortcuts":e.shortcut?uk(e.shortcut,e.apple):void 0}},on:{...t.on,pointerenter:(e,{api:t,key:n,props:r})=>t.internal.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.leave(e)},press:({api:e,key:t,props:n,el:r},i)=>e.internal.tooltipPress(t,n.payload,i,r),bind:void 0,asleep(e,{key:t,store:n,id:r}){let i=lI(n,t);OO();let a=!0,o;return queueMicrotask(()=>{let i=n.get(),s={};i.trigger===t&&(s.unnamed=!wI(e,`${r}-content`)),i.apple!==ck()&&(i.shortcut?s.apple=ck():a&&(o=n.subscribe(()=>{n.get().shortcut&&(o(),xI(n))}))),(s.unnamed!==void 0||s.apple!==void 0)&&n.set(s)}),e.matches(`:disabled`),()=>{a=!1,o?.(),i()}}}),content:e({...n,props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`},state:e=>({open:e.open,instant:e.instant,payload:e.payload}),role:`tooltip`,present:()=>!0,attrs:(e,{id:t})=>({...Yj(e,t),tabindex:void 0,"data-instant":e.instant?``:void 0}),asleep:e=>EI(e),bind(e,t){return t.api.internal.group?.join(),n.bind(e,t)}}),arrow:fI(e),shortcut:SI(e,e=>e.shortcut)}},agent:{actions:[`setOpen`]}})})),PI=t((()=>{Y()}));function FI(){if(!(II||typeof document>`u`)){II=new WeakMap;for(let e of Array.from(document.querySelectorAll(`input`)))e.value!==e.defaultValue&&II.set(e,e.value)}}var II,LI=t((()=>{}));function RI(e){let t=HI.get(e);if(t)return t;let n=hI(e).options,r=Object.keys(n).filter(e=>VN(e)in n||BN(e,`Change`)in n),i=new Set(r.map(VN));return t={controlled:r,data:Object.keys(n).filter(e=>{let t=n[e],a=typeof t==`object`?t.kind:t;return(a===`value`||a===`list`)&&!r.includes(e)&&!i.has(e)})},HI.set(e,t),t}function zI(e,t){if(typeof e==`object`&&e&&!t.includes(e)){if(t.push(e),Array.isArray(e))for(let n=0;n<e.length;n++)zI(e[n],t);else if(ZN(e))for(let n in e)zI(e[n],t);t.pop()}}function BI(e,t){let n=!1;return t(()=>(zI(e,[]),n?UN([...e]):(n=!0,e)))}function VI(e,t){let n=RI(e);if(!n.controlled.length&&!n.data.length)return e=>e;let r,i;return e=>{let a=e,o;for(let e of n.controlled){let t=a[e];if(!Array.isArray(t))continue;let n=[...t];r??={};let i=r[e];i&&WN(i,n)||(r[e]=i=n),o??={...a},o[e]=i}for(let e of n.data){let n=a[e];if(!Array.isArray(n)){i&&e in i&&delete i[e];continue}i??={};let r=i[e];r?.list!==n&&(i[e]=r={list:n,handed:BI(n,t)});let s=r.handed();s!==n&&(o??={...a},o[e]=s)}return o??e}}var HI,UI=t((()=>{HN(),yI(),rP(),HI=new WeakMap})),WI=t((()=>{bO(),UI(),kF(),LI(),Mk(),yI(),rP(),_k()}));function GI(e){for(let t=e;t;t=t.parent)if(t.isDeactivated)return!0;return!1}function KI(){let e=tc(GI(wf()));return zl(()=>e.value=!0),Rl(()=>e.value=!1),e}function qI(){let e=new Map,t=fs(),n=GI(wf()),r,i=i=>{if(!r){let i=tc(n);r=i;let a=()=>W(i,()=>{n=i.value,e.forEach((e,t)=>t(n?null:e))},{flush:`post`});t?t.run(a):a()}r.value=i};zl(()=>i(!0)),Rl(()=>i(!1));let a=new WeakMap,o=new WeakMap,s={};return(t,r)=>{let i=wf()??s,c=a.get(i);c||a.set(i,c=new WeakMap);let l=c.get(t);if(l)return l;let u=i.suspense,d=null;return l=i=>{let a=i&&typeof i==`object`&&`$el`in i?i.$el:i;if(!a){let n=d;return d=null,e.get(t)===n?(e.delete(t),t(null)):void 0}let s=o.get(a);s||o.set(a,s=new Map);let c=s.get(r);s.set(r,t),c&&c!==t&&e.get(c)===a&&(e.delete(c),n||c(null)),d=a,e.set(t,a),n||(u?.pendingBranch?u.effects.push(()=>e.get(t)===a&&t(a)):t(a))},c.set(t,l),l}}var JI=t((()=>{Y()}));function YI(e){if(!wf()&&bl())throw Error(`${e} isn't set up in a VDOM component's setup. In a Vapor app, install vaporInteropPlugin, and define your own parts with defineComponent.`)}function XI(e,t){if(!e||!t)return e??t;let n=yL.get(e);n||yL.set(e,n=new WeakMap);let r=n.get(t);return r||(r=n=>{e(n),t(n)},n.set(t,r)),r}function ZI(e){let t=bL.get(e);if(t)return t;t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);e!==-1&&(t[n.slice(0,e).trim()]=n.slice(e+1).trim())}return bL.size>=500&&bL.clear(),bL.set(e,t),t}function QI(e){let t=xL.get(e);return t||xL.set(e,t=`on${e[0].toUpperCase()}${e.slice(1)}`),t}function $I(e){let t=HP(e),n=TL.get(e);if(n&&n.source===t)return n.entries;let r=null;for(let e in t){let n=t[e];FL.add(n),(r??=[]).push({prop:QI(e),handler:n})}return TL.set(e,{source:t,entries:r}),r}function eL(e,t,n){let r=RP(t,n?t=>e[t]!=null:SL);for(let t in r){let i=r[t];i===void 0||n&&t===`id`&&e.id!=null||(t===`style`?e.style=n&&e.style?ao([e.style,ZI(i)]):ZI(i):e[t]=n&&t===`class`&&e.class?so([e.class,i]):i)}return e}function tL(e){let t=DL.get(e);return t||DL.set(e,t=Symbol(e.name)),t}function nL(e){return yl(tL(e),null)}function rL(e){let t=nL(e);if(!t){let t=OL(e.name);throw Error(`${t} parts must be used inside <${t}>.`)}return t.handle}function iL(e){vl(tL(e.primitive),{handle:e,around:{}})}function aL(e,t,n){let r=nL(e);r&&vl(tL(e),{...r,around:{...r.around,[t]:n}})}function oL(e,t){YI(`A ui-sdk root`);let n=`ui-sdk-${Ml()}`,r=VI(e,kL);FI();let i;xl(()=>{let a=r({...t(),id:n});i?i.setOptions(a):(i=Sk(()=>e(a)),i.preview(a)&&i.setOptions(a))}),Pd(()=>Tk(i));let a,o,s=()=>{if(!a){let e=tc(vI(i));a=e,o=i.subscribe(()=>e.value=vI(i))}a.value};ps(()=>{o?.(),i.destroy()});let c=qI(),l=sL(i);AL.set(i,l);let u=e=>{let t=wf();if(t)return l(t,e);s()},d=(e,t,n,r)=>{let i={},a=!1;for(let e in n)e!==`ref`&&(i[e]=n[e],a=!0);eL(i,r,a);let o=$I(e);if(o)for(let e=0;e<o.length;e++){let{prop:t,handler:n}=o[e],r=a?i[t]:void 0;if(r){let e=e=>{if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]?.(e);else r(e);n(e)};FL.add(e),i[t]=e}else i[t]=n}return i.ref=XI(n.ref,c(YP(e,CL),t)),i},f={primitive:e,instance:i,get api(){return i.api},get state(){return s(),i.get()},present(e,t){let n=i.part(e,t),r=BP(n),a=u(n);return a&&(a.present=r),r},slot(e,t,n=wL){let r=i.part(e,t);rF(r,n.id);let a=LP(r),o=u(r);return o&&(o.attrs=a),d(r,e,n,a)}};return EL.set(f,(e,t,n)=>{let r=i.part(e,t),a=BP(r),o=u(r);if(o&&(o.present=a),!a)return null;rF(r,n.id);let s=LP(r);return o&&(o.attrs=s),d(r,e,n,s)}),iL(f),f}function sL(e){let t=new WeakMap;function n(t,n,r){n.onChange?.();let i=()=>n.present!==void 0&&BP(t,n.props)!==n.present;if(r){i()&&n.tick.value++;return}let a=vI(e);a!==n.version&&(n.version=a,(i()||n.attrs&&!cL(LP(t,n.props),n.attrs,gF(t)))&&n.tick.value++)}return(r,i)=>{let a=t.get(r);if(!a){let e=a=new Map;t.set(r,e),Rd(()=>e.forEach(e=>e.unsubscribe?.()),r)}let o=a.get(i);o||a.set(i,o={tick:tc(0),props:i.props,version:0}),o.props=i.props,o.version=vI(e);let s=_F(i);if(o.subscription!==s){let e=o;e.unsubscribe?.(),e.subscription=s,e.unsubscribe=VP(i,t=>n(i,e,t))}return o.tick.value,o}}function cL(e,t,n){let r=0;for(let i in e)if(r++,(e[i]!==t[i]||!(i in t))&&!n?.includes(i))return!1;let i=0;for(let e in t)i++;return r===i}function lL(e,t){let n={};for(let r in Qs(e))r!==t&&(n[r]=e[r]);return n}function uL(e,t,n,r=wf()){let i=tc(0),a,o,s=new Set,c=()=>zP(e.part(t,n())),l=e=>{for(let t of s)if(!GN(e[t],a[t]))return!0;return!1},u=()=>{let e=c();l(e)&&(a=e,s.clear(),i.value++)},d=r&&AL.get(e),f,p,m,h=e=>{let t=_F(e);(e!==p||t!==m)&&(p=e,m=t,d?(f&&(f.onChange=void 0),f=d(r,e),f.onChange=u):(o?.(),o=VP(e,u)))};return r?Rd(()=>o?.(),r):ps(()=>o?.()),new Proxy({},{get(r,o){i.value;let c=e.part(t,n());return a=zP(c),typeof o==`string`&&s.add(o),h(c),a[o]}})}function dL(e,t){let n=jL.get(e);if(!n){let r=tc(t);jL.set(e,n={own:r,component:()=>r.value()})}return n.own.value=t,n.component}function fL(e,t,n,r){let{tag:i,children:a,hidden:o}=r;if(t.render){let r=a?()=>a(n()):()=>t.default?.({get state(){return n()}}),{ref:i,...s}=e,c=t.render({props:i?{...s,...mL(i)}:s,get state(){return n()},children:dL(t,r)});return i&&hL(c,i,e[`data-slot`]),o?[...c,o()]:c.length===1?c[0]:c}let s=a?a(n()):t.default?.({get state(){return n()}});return q(i,e,o?[s,o()]:s)}function pL(e,t,n,r){return fL(e,t,()=>n,r)}function mL(e){let t=ML.get(e);if(!t){let n=t=>{!PL.has(t)&&t.el?.nodeType===Node.ELEMENT_NODE&&NL.get(e)!==t.el&&(NL.set(e,t.el),e(t.el))};t={onVnodeMounted:n,onVnodeUpdated:n,onVnodeUnmounted:t=>{NL.get(e)===t.el&&(NL.delete(e),e(null))}},ML.set(e,t)}return t}function hL(e,t,n){let r=[...e];for(;r.length;){let e=r.shift();if(Array.isArray(e))r.unshift(...e);else if(Iu(e)&&e.props?.[`data-slot`]===n){PL.has(e)||(PL.add(e),e.ref=Vu(e,{ref:t},!0).ref);return}else Iu(e)&&(e.type===df||e.type===Od)&&Array.isArray(e.children)&&r.unshift(...e.children)}}function gL(e,t,n=()=>({}),r,i=`div`){YI(`The ${t} part`);let a=wf();if(!a)throw Error(`The ${t} part must call usePart in its setup.`);let o=typeof e==`function`?nL(e)?.handle:e;if(!o)throw Error(`The ${t} part must be used inside its primitive's root.`);let s=Ql(),c=Zl(),l=typeof i==`string`?{tag:i}:i,u=EL.get(o),d,f=()=>d??=uL(o.instance,t,n,a);return Object.defineProperty(()=>{let e=n(),i=r?r():s,a;if(u){if(a=u(t,e,i),!a)return null}else{if(!o.present(t,e))return null;a=o.slot(t,e,i)}return fL(l.extend?l.extend(a):a,c,f,l)},"state",{get:f,enumerable:!0})}var _L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL=t((()=>{WI(),Y(),PI(),JI(),_L={type:Boolean,default:void 0},vL=(e,t)=>e===void 0?t:e,yL=new WeakMap,bL=new Map,xL=new Map,SL=()=>!1,CL={by:`framework`,attaches:`all`},wL=Object.freeze({}),TL=new WeakMap,EL=new WeakMap,DL=new WeakMap,OL=e=>e.replace(/(^|-)(\w)/g,(e,t,n)=>n.toUpperCase()),kL=e=>{let t=J(e);return()=>t.value},AL=new WeakMap,jL=new WeakMap,ML=new WeakMap,NL=new WeakMap,PL=new WeakSet,FL=new WeakSet}));function LL(e){let t=WL.get(e);return t||WL.set(e,t=tc(void 0)),t}function RL(e,t){let n=nL(e)?.handle;return()=>{let e=t();return(e&&LL(e).value)??n}}function zL(e,t){Pd(()=>W(e,(e,n,r)=>{if(!e)return;let i=LL(e);i.value=t,r(()=>{i.value===t&&(i.value=void 0)})},{flush:`post`,immediate:!!e()}))}function BL(e,t,{slots:n,state:r,children:i}){return pL(t,n,r,{tag:e,children:i})}function VL(e){let t,n=Object.create(e);n.slot=(n,r,i)=>{let a=e.slot(n,r,i);return t=a.ref,a};let r=EL.get(e);return r&&EL.set(n,(e,n,i)=>{let a=r(e,n,i);return a&&(t=a.ref),a}),{handle:n,release:()=>t?.(null)}}function HL(e,t,n){let r,i;return ps(()=>i?.scope.stop()),()=>{let a=e();return a!==r&&(r=a,i?.release(),i?.scope.stop(),i=a&&UL(a,t)),i?i.render():n()}}function UL(e,t){let n=ds(!0),r=VL(e);return{scope:n,render:n.run(()=>t(r.handle)),release:r.release}}var WL,GL=t((()=>{Y(),IL(),WL=new WeakMap}));function KL(e){let t=yl(YL,()=>void 0);return()=>e()??t()}function qL(e,t){let n=ik(t),r=t?[q(XL,{container:t},()=>e)]:[].concat(e);return n?q(ZL,{to:n},()=>r):r.length===1?r[0]:r}var JL,YL,XL,ZL,QL,$L=t((()=>{WI(),Y(),JI(),GL(),JL=Object,YL=Symbol(`popup-container`),XL=G({name:`PopupContainerScope`,props:{container:Object},setup(e,{slots:t}){return vl(YL,()=>e.container),()=>t.default?.()}}),ZL=G({name:`PopupTeleport`,props:{to:{type:Object,required:!0}},slots:Object,setup(e,{slots:t}){let n=KI();return()=>q(Od,{to:e.to,disabled:n.value},t.default())}}),QL=e=>e}));function eR(e,t,n=[]){let r=!1;for(let e in t)if(!n.includes(e)){r=!0;break}if(!r)return;let i=Object.keys(t).filter(e=>!n.includes(e)).join(`, `);i&&!nR.has(`${e} ${i}`)&&(nR.add(`${e} ${i}`),`${e}${i}`)}function tR(e){let t=e,n=t.setup;t.inheritAttrs=!1;let r=t.props&&`readOnly`in t.props?[`readonly`]:[];return t.setup=(e,i)=>(eR(t.name??`This root`,i.attrs,r),n?.(e,i)),e}var nR,rR=t((()=>{WI(),nR=new Set}));function iR(e){let t=[];for(let n in e){let r=e[n],i=uR(r);i!==`callback`&&t.push({prop:n,isId:i===`id`,from:dR(r,n),required:typeof r==`object`&&!!r.required,key:i===`key`})}return t}function aR(...e){let t={};for(let n of e)for(let e in n){let r=uR(n[e]);r!==`callback`&&(t[e]=hR[r])}return t}function oR(e){return Object.keys(e).filter(t=>uR(e[t])===`callback`).map(t=>{let n=t[2].toLowerCase()+t.slice(3),r=n.endsWith(`Change`)?n.slice(0,-6):``;return{key:t,event:n,update:r in e?`update:${r}`:void 0}})}function sR(e,t){let n={};for(let{key:r,event:i,update:a}of e)n[r]=(...e)=>{t(i,...e),a&&!e[1]?.canceled&&t(a,e[0])};return n}function cR(e,t){return t}function lR(e,t){let n=hI(e),r=OL(e.name),i=t,a=new Set(Object.values(n.slots).flatMap(e=>Object.entries(e).flatMap(([e,t])=>dR(t,e)?.slot??[]))),o=new Set(Object.entries(n.slots).flatMap(([e,t])=>Object.values(t).some(e=>uR(e)===`key`)?[e]:[])),s=Object.keys(n.options).filter(e=>uR(n.options[e])!==`callback`),c=i.root?n.slots.root??{}:{},l=i.root?iR(c):[],u=oR({...n.options,...c}),d=_R(u);function f(t,n,i,a,o){if(!n.length&&!a)return mR;let s=nL(e),c=s?.around??pR,l=n.some(e=>e.isId)?n.map(e=>e.isId?Ml():void 0):void 0;for(let e=0;e<n.length;e++){let i=n[e];if(i.from&&!c[i.from.slot]&&i.required)throw Error(`<${r}${OL(t)}> must be used inside <${r}${OL(i.from.slot)}>.`)}return()=>{let e=a?{...a}:{};for(let t=0;t<n.length;t++){let{prop:r,from:a,key:u}=n[t],d=i[r];d===void 0&&r===o&&(d=i.modelValue),d===void 0&&(d=l?.[t]??(a&&c[a.slot]?.()[a.prop])),e[r]=d,u&&(e.id=(s?.handle.api).internal.keyOf(d))}return e}}let p=u.length>0,m={Root:G({name:r,inheritAttrs:!1,props:{...aR(n.options,c),...d?{modelValue:null}:{}},emits:[...vR(u),...d?[`update:modelValue`]:[]],setup(t,{slots:n,emit:a,attrs:o}){let c=p?sR(u,(e,...t)=>{a(e,...t),e===`update:${d}`&&a(`update:modelValue`,...t)}):void 0,m=oL(e,()=>{let e=c?{...c}:{};for(let n=0;n<s.length;n++){let r=s[n];e[r]=t[r]}return d&&e[d]===void 0&&(e[d]=t.modelValue),e});return i.root?gL(m,`root`,f(`root`,l,t,c,d),void 0,i.root):(eR(r,o),()=>n.default?.())}})};for(let t in i){if(t===`root`)continue;let s=`${r}${OL(t)}`,c=n.slots[t]??{},l=iR(c),u=oR(c),d=u.length>0,p=a.has(t),h=o.has(t),g=`id`in c;m[OL(t)]=G({name:s,inheritAttrs:!1,props:aR(c),emits:vR(u),setup(n,{emit:a,attrs:o}){if(!nL(e))throw Error(`<${s}> must be used inside <${r}>.`);let c=f(t,l,n,d?sR(u,a):void 0);return p&&aL(e,t,h?()=>{let e=c();return{...e,value:e.id}}:c),gL(e,t,c,g?()=>n.id==null?o:{...o,id:n.id}:void 0,i[t])}})}return m}var uR,dR,fR,pR,mR,hR,gR,_R,vR,yR=t((()=>{WI(),Y(),IL(),rR(),uR=e=>typeof e==`string`?e:typeof e==`object`?e.kind:`value`,dR=(e,t)=>{if(typeof e!=`object`)return;let[n,r=t]=e.from.split(`.`);return{slot:n,prop:r}},fR=Object.freeze({}),pR=Object.freeze({}),mR=()=>fR,hR={string:String,number:Number,boolean:_L,list:[Array,String],value:null,id:null,key:null,action:Function},gR=[`value`,`checked`,`pressed`,`open`,`page`,`layout`],_R=e=>gR.find(t=>e.some(({update:e})=>e===`update:${t}`)),vR=e=>e.flatMap(({event:e,update:t})=>t?[e,t]:[e])})),bR,xR,SR,CR,wR,TR,ER=t((()=>{NI(),Y(),PI(),$L(),yR(),IL(),rR(),bR=Symbol(`tooltip-container`),xR=Symbol(`tooltip-trigger`),SR=lR(MI,{arrow:`div`}),CR=tR(G({name:`Tooltip`,props:{open:_L,modelValue:_L,defaultOpen:_L,delay:Number,closeDelay:Number,disabled:_L,toggleable:_L,closeOnPress:_L,type:String,shortcut:String,controller:Object,debug:_L,container:JL},emits:{"update:open":e=>!0,"update:modelValue":e=>!0,openChange:(e,t)=>!0,openChangeComplete:e=>!0,payloadChange:(e,t)=>!0},setup(e,{slots:t,emit:n}){vl(bR,()=>e.container);let r={onOpenChange:(e,t)=>{n(`openChange`,e,t),t.canceled||(n(`update:open`,e),n(`update:modelValue`,e))},onOpenChangeComplete:e=>n(`openChangeComplete`,e),onPayloadChange:(e,t)=>n(`payloadChange`,e,t)};return zL(()=>e.controller,oL(MI,()=>({...lL(e,`container`),open:vL(e.open,e.modelValue),...r}))),()=>t.default?.()}})),wR=cR(`button`,G({name:`TooltipTrigger`,inheritAttrs:!1,props:{payload:null,controller:Object},slots:Object,setup(e,{slots:t,attrs:n}){let r=RL(MI,()=>e.controller);vl(xR,r);let i=Ml();return HL(r,t=>gL(t,`trigger`,()=>({id:i,payload:e.payload}),void 0,`button`),()=>BL(`button`,{type:`button`,...n},{slots:t,state:{open:!1}}))}})),TR=QL(cR(`div`,G({name:`TooltipContent`,inheritAttrs:!1,props:{side:String,align:String,sideOffset:Number,alignOffset:Number,collisionPadding:Number,arrowPadding:Number,anchor:[Object,String],container:JL},slots:Object,setup(e){let t=rL(MI),n=yl(bR,()=>void 0),r=KL(()=>e.container??n()),i=gL(t,`content`,()=>lL(e,`container`));return()=>{let e=i();return e&&qL(e,r())}}}))),SR.Arrow})),DR,OR=t((()=>{Y(),ER(),DR=G({__name:`TooltipContent`,props:{side:{default:`top`},sideOffset:{default:6}},setup(e){return(t,n)=>(K(),Fu(U(TR),{"data-slot":`tooltip-content`,side:e.side,"side-offset":e.sideOffset},{default:gl(()=>[Yl(t.$slots,`default`)]),_:3},8,[`side`,`side-offset`]))}})})),kR,AR=t((()=>{OR(),OR(),kR=DR})),jR,MR=t((()=>{Y(),ER(),AR(),jR=G({__name:`Tooltip`,props:tu({open:{type:Boolean},defaultOpen:{type:Boolean,default:!1},delay:{},label:{}},{open:{type:Boolean,default:void 0},openModifiers:{}}),emits:tu([`update:open`],[`update:open`]),setup(e){let t=iu(e,`open`);return(n,r)=>(K(),Fu(U(CR),{open:t.value,"onUpdate:open":r[0]||=e=>t.value=e,"default-open":e.defaultOpen||void 0,delay:e.delay},{default:gl(()=>[Yl(n.$slots,`default`),e.label?(K(),Fu(kR,{key:0},{default:gl(()=>[Hu(ss(e.label),1)]),_:1})):Uu(``,!0)]),_:3},8,[`open`,`default-open`,`delay`]))}})})),NR,PR=t((()=>{MR(),MR(),NR=jR})),FR=t((()=>{PR(),AR(),Y(),ER()})),IR,LR,RR,zR=t((()=>{Y(),vO(),ER(),FR(),IR=[`data-mode`,`datetime`],LR=[`data-mode`,`data-slot`,`datetime`],RR=G({inheritAttrs:!1,__name:`RelativeTime`,props:{at:{},threshold:{default:`3w`},format:{default:`long`},locale:{default:`en`},plain:{type:Boolean,default:!1}},setup(e){let t=Ql(),{time:n,tip:r}=gO(()=>({at:e.at,threshold:e.threshold,format:e.format,locale:e.locale})),i=J(()=>t[`data-slot`]??`relative-time`),a=e=>{if(!r.value)return t;let{type:n,...i}=e;return{...i,...t}};return(o,s)=>U(n)?e.plain?(K(),Pu(`time`,qu({key:1,"data-slot":`relative-time`},U(t),{"data-mode":U(n).mode,datetime:U(n).datetime}),ss(U(n).label),17,IR)):(K(),Fu(U(NR),{key:2,label:U(r)},{default:gl(()=>[bf(U(wR),null,{render:gl(({props:e,children:t})=>[Ru(`time`,qu(a(e),{"data-mode":U(n).mode,"data-slot":i.value,datetime:U(n).datetime}),[(K(),Fu(Wl(t)))],16,LR)]),default:gl(()=>[Hu(ss(U(n).label),1)]),_:1})]),_:1},8,[`label`])):(K(),Pu(`time`,qu({key:0,"data-slot":`relative-time`},U(t)),ss(String(e.at)),17))}})})),BR,VR=t((()=>{zR(),zR(),BR=RR})),HR=t((()=>{VR()}));function UR(e){let t=e.anchor.kind===`text`?e.anchor.exact:``;return vh(e.messages[0]?.body??``)||t}function WR(e){return{thread:e,text:UR(e)}}var GR=t((()=>{Sh()})),KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz=t((()=>{Y(),BE(),HR(),Sh(),GR(),KR={"data-slot":`comment-list-number`},qR={"data-slot":`comment-list-body`},JR={"data-slot":`comment-list-text`},YR={"data-slot":`comment-list-meta`},XR={key:0},ZR={key:1},QR={key:2,"data-slot":`comment-list-detached`},$R={key:3},ez=G({name:`CommentRow`,__name:`CommentRow`,props:{thread:{},detached:{type:Boolean,default:!1},site:{type:Boolean,default:!1}},setup(e){let t=J(()=>e.thread.messages.length-1);return(n,r)=>(K(),Pu(df,null,[Ru(`span`,KR,ss(e.thread.n?String(e.thread.n):``),1),bf(U(RE),{"aria-hidden":`true`,people:[U(_h)(e.thread)],size:`sm`},null,8,[`people`]),Ru(`span`,qR,[Ru(`span`,JR,[Yl(n.$slots,`preview`,{},()=>[Hu(ss(U(UR)(e.thread)),1)])]),Ru(`span`,YR,[Ru(`span`,null,ss(U(xh)(e.thread)),1),bf(U(BR),{at:e.thread.updatedAt},null,8,[`at`]),t.value>0?(K(),Pu(`span`,XR,ss(t.value)+` `+ss(t.value===1?`reply`:`replies`),1)):Uu(``,!0),e.thread.status===`resolved`?(K(),Pu(`span`,ZR,`Resolved`)):Uu(``,!0),e.detached?(K(),Pu(`span`,QR,`Detached`)):Uu(``,!0),e.site&&e.thread.subject.kind===`page`?(K(),Pu(`span`,$R,ss(e.thread.subject.id),1)):Uu(``,!0)])])],64))}})})),nz,rz=t((()=>{tz(),tz(),nz=ez}));function iz(e,t){let n=e.subject.value;return t.anchor.kind===`page`&&t.subject.kind===n.kind&&t.subject.id===n.id}var az,oz,sz,cz=t((()=>{Y(),VE(),Aw(),Dy(),Bp(),Sh(),rz(),zw(),az=3,oz=`Comment on the whole page`,sz=G({name:`CommentPageIsland`,props:{comments:{required:!0,type:Object},canComment:{required:!0,type:Boolean}},slots:Object,setup(e,{slots:t}){let n=Dw(),r=e.comments,i=H(),a=H(),o=new Set;vl(Fp,o);let s=J(()=>r.pageThreads.value.filter(e=>e.anchor.kind===`page`)),c=J(()=>s.value.filter(e=>e.status===`open`)),l=J(()=>r.draft.value?.anchor.kind===`page`?r.draft.value:null),u=J(()=>r.opened.value&&iz(r,r.opened.value)?r.opened.value:null),d=J(()=>e.canComment&&!!r.user.value),f=H(!1),p=J(()=>r.visibility.value===`hidden`),m=J(()=>p.value?s.value.filter(e=>r.isShown(e.id)):s.value),h=()=>{let e=i.value?.getRootNode();return e instanceof ShadowRoot?e:document},g=J(()=>l.value||u.value||f.value&&(m.value.length>0||d.value)?`open`:r.active.value&&d.value?`hint`:p.value?`none`:c.value.length>0?`count`:`none`),_=H(),v=J(()=>p.value?0:c.value.length),y=J(()=>g.value===`hint`||g.value===`open`&&d.value);W([_,J(()=>y.value?oz:String(v.value))],([e,t],n)=>{e&&(e===n?.[0]?_y(e,t):e.textContent=t)},{flush:`post`,immediate:!0});let b=!1,x;W(p,e=>{e&&(f.value=!1)}),W(u,(e,t)=>{if(e){f.value=!0;return}if(!t||g.value!==`open`)return;let n=h().activeElement;n&&i.value?.contains(n)||ol(()=>i.value?.querySelector(`[data-slot='comment-page-island-item'][data-thread-id='${t.id}']`)?.focus())},{flush:`post`});let S=()=>(i.value?Np(i.value):!1)||(l.value?.body.trim().length??0)>0,C=e=>[...o].some(t=>t.value&&e.includes(t.value)),w=()=>{let e=h().activeElement,t=!!(e&&i.value?.contains(e));f.value=!1,l.value&&r.cancelDraft(),u.value&&r.close(),t&&ol(()=>a.value?.focus({preventScroll:!0}))},T=(e=!1)=>S()?(i.value&&Pp(i.value,e),!1):(w(),!0);Mp(e=>{if(g.value!==`open`||!i.value)return;let t=zp(e);t.includes(i.value)||C(t)||Ip.has(e)||(t.some(e=>e.matches(`[data-slot='comment-pin']`))||Ip.add(e),T()||(e.stopPropagation(),jp()))});let E=e=>{if(e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.repeat||g.value!==`open`)return;let t=zp(e);C(t)||t.some(e=>e.matches(`[data-slot='comment-composer']`))||(e.preventDefault(),T(!0))};Pd(()=>document.addEventListener(`keydown`,E,!0)),Ld(()=>{document.removeEventListener(`keydown`,E,!0)});let D=()=>{if(g.value===`open`)T();else if(g.value===`hint`)try{r.startDraft(`page`)}catch{}else f.value=!0},O=()=>{let e=new Map;for(let t of c.value){let n=_h(t);e.has(n.id)||e.set(n.id,n)}return[...e.values()].slice(0,az)},k=()=>q(`ul`,{"data-slot":`comment-page-island-items`},m.value.map(e=>q(`li`,{key:e.id},q(`button`,{"data-focus-inset":``,"data-slot":`comment-page-island-item`,"data-status":e.status,"data-thread-id":e.id,onClick:()=>{f.value=!0,r.open(e)},type:`button`},[q(nz,{thread:e})])))),A=()=>{let e=u.value;return e&&t.thread?t.thread({thread:e}):[m.value.length>0?k():null,d.value&&t.composer?q(`div`,{"data-draft":`true`,"data-slot":`comment-page-island-composer`,key:`composer`},t.composer({autofocus:!!l.value,draft:l.value,onCancel:w})):null]};return()=>{let e=g.value,t=e===`open`,o=v.value,s=y.value?oz:`${o} ${o===1?`comment`:`comments`} on the whole page`;return e===`none`?x=void 0:x??=b&&!t,b=r.status.value===`ready`||r.status.value===`error`,q(`div`,{"data-slot":`comment-page-island`,"data-state":e,ref:i},e===`none`?[]:[q(`div`,{"data-motion-appear":x?``:void 0,"data-open":t?``:void 0,"data-side":`bottom`,"data-slot":`comment-page-island-card`},[q(`button`,{"aria-expanded":String(t),"aria-label":y.value&&o>0?`${s}, ${o} open`:s,"data-motion-press":``,"data-slot":`comment-page-island-trigger`,onClick:D,ref:a,type:`button`},[o>0?q(`span`,{"data-slot":`comment-page-island-faces`},q(RE,{"aria-hidden":`true`,max:null,people:O(),size:`sm`})):q(Pw,{"aria-hidden":`true`,name:n.value.commentPage}),q(`span`,{"data-slot":`comment-page-island-label`,ref:_})]),t?q(`div`,{"data-slot":`comment-page-island-content`},A()):null])])}}})}));function lz(e){let{resolvedAt:t}=e;return e.status!==`resolved`||t===void 0?[]:e.messages.filter(e=>e.createdAt>t)}function uz(e){return e.n?`Comment ${e.n}`:`Comment`}function dz(e){return e.n?`#${e.n}`:`Comment`}function fz(e){return{"data-failed":e?.status===`failed`?`true`:void 0,"data-pending":e?.status===`pending`?`true`:void 0}}var pz=t((()=>{})),mz=t((()=>{Y()})),hz=t((()=>{Y(),FD(),nO(),LD(),mz(),vO()})),gz,_z,vz,yz,bz=t((()=>{Y(),hz(),Tw(),gz={"data-slot":`comment-filters`,role:`group`,"aria-label":`Filter comments`},_z=[`data-variant`,`data-active`,`aria-pressed`,`onClick`],vz={key:0},yz=G({name:`CommentFilters`,__name:`CommentFilters`,props:{comments:{}},setup(e){let t=JD(e.comments),n=J(()=>[{key:`open`,label:`Open`,count:t.counts.value.open},{key:`resolved`,label:`Resolved`,count:t.counts.value.resolved},{key:`mine`,label:`Mine`}]);return(e,r)=>(K(),Pu(`div`,gz,[(K(!0),Pu(df,null,ql(n.value,e=>(K(),Pu(`button`,{key:e.key,type:`button`,"data-slot":`comment-filter`,"data-comment-button":``,"data-size":`xs`,"data-variant":U(t).filters[e.key]?`soft`:`ghost`,"data-active":U(t).filters[e.key]?``:void 0,"aria-pressed":U(t).filters[e.key],onClick:n=>U(t).filters[e.key]=!U(t).filters[e.key]},[e.count===void 0?(K(),Pu(`span`,vz,ss(e.label),1)):(K(),Pu(df,{key:1},[Hu(ss(`${e.label} `),1),bf(U(Cw),{value:e.count},null,8,[`value`])],64))],8,_z))),128))]))}})})),xz,Sz=t((()=>{bz(),bz(),xz=yz})),Cz,wz,Tz,Ez,Dz,Oz,kz,Az=t((()=>{Y(),hz(),Tw(),Sz(),rz(),GR(),pz(),Cz={"data-slot":`comment-list`,"data-comments-ui":``,"aria-label":`Comments`},wz={"data-slot":`comment-list-header`},Tz={"data-slot":`comment-list-scopes`,role:`group`,"aria-label":`Scope`},Ez=[`data-variant`,`aria-pressed`,`onClick`],Dz={key:0,"data-slot":`comment-list-empty`,role:`status`},Oz=[`data-status`,`data-detached`,`aria-current`,`href`,`onClick`],kz=G({name:`CommentList`,__name:`CommentList`,props:{comments:{},navigate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=JD(n.comments),a=[{value:`page`,label:`This page`},{value:`site`,label:`All pages`}],o=J(()=>i.listed.value),s=J(()=>i.status.value===`loading`&&i.threads.value.length===0?`Loading comments.`:i.status.value===`error`?`The comments could not load.`:`No comments here.`);function c(e,t){r(`select`,{thread:e}),t.ctrlKey||t.metaKey||t.shiftKey||t.button!==0||(t.preventDefault(),e.subject.kind===i.subject.value.kind&&e.subject.id===i.subject.value.id?i.open(e,{scroll:!0}):i.close()&&(n.navigate??(e=>window.location.assign(e)))(i.link(e)))}return(e,t)=>(K(),Pu(`section`,Cz,[Ru(`header`,wz,[Ru(`div`,Tz,[(K(),Pu(df,null,ql(a,e=>Ru(`button`,{key:e.value,type:`button`,"data-slot":`comment-list-scope`,"data-comment-button":``,"data-size":`xs`,"data-variant":U(i).scope.value===e.value?`soft`:`ghost`,"aria-pressed":U(i).scope.value===e.value,onClick:t=>U(i).scope.value=e.value},[Ru(`span`,null,ss(e.label),1)],8,Ez)),64))]),bf(xz,{comments:U(i)},null,8,[`comments`])]),o.value.length===0?(K(),Pu(`p`,Dz,ss(s.value),1)):(K(),Fu(U(yw),{key:1},{render:gl(({props:e,children:t})=>[Ru(`ol`,qu(e,{"data-slot":`comment-list-items`}),[(K(),Fu(Wl(t)))],16)]),default:gl(()=>[(K(!0),Pu(df,null,ql(o.value,t=>(K(),Pu(`li`,{key:t.id},[Ru(`a`,qu({"data-slot":`comment-list-item`,"data-focus-inset":``,"data-status":t.status,"data-detached":U(i).positions.value.get(t.id)?.detached===!0?`true`:void 0},{ref_for:!0},U(fz)(t.delivery),{"aria-current":U(i).openId.value===t.id?`true`:void 0,href:U(i).link(t),onClick:e=>c(t,e)}),[Yl(e.$slots,`row`,qu({ref_for:!0},U(WR)(t)),()=>[bf(nz,{thread:t,detached:U(i).positions.value.get(t.id)?.detached===!0,site:U(i).scope.value===`site`},Jl({_:2},[e.$slots.preview?{name:`preview`,fn:gl(()=>[Yl(e.$slots,`preview`,qu({ref_for:!0},U(WR)(t)))]),key:`0`}:void 0]),1032,[`thread`,`detached`,`site`])])],16,Oz)]))),128))]),_:3}))]))}})})),jz,Mz=t((()=>{Az(),Az(),jz=kz})),Nz,Pz,Fz,Iz=t((()=>{Y(),BE(),Sh(),Nz=[`data-status`,`data-active`,`data-draft`,`aria-expanded`,`aria-label`],Pz={key:1,"data-slot":`comment-pin-number`},Fz=G({name:`CommentPin`,__name:`CommentPin`,props:{number:{},author:{},status:{default:`open`},excerpt:{},active:{type:Boolean,default:!1},draft:{type:Boolean,default:!1}},emits:[`select`,`hover`,`leave`],setup(e,{emit:t}){let n=t,r=J(()=>{if(e.draft)return`New comment`;let t=e.author?` by ${bh(e.author)}`:``,n=e.excerpt?`: ${e.excerpt}`:``;return`Comment${e.number===void 0?``:` ${e.number}`}${t}${n}${e.status===`resolved`?`, resolved`:``}`}),i=!1,a=!1;function o(){a=!0,n(`hover`)}function s(){a=!1,i||n(`leave`)}function c(){i=!0,n(`hover`)}function l(){i=!1,a||n(`leave`)}return(t,i)=>(K(),Pu(`button`,{type:`button`,"data-slot":`comment-pin`,"data-status":e.status,"data-active":e.active?`true`:void 0,"data-draft":e.draft?`true`:void 0,"aria-expanded":e.draft?void 0:e.active,"aria-label":r.value,onClick:i[0]||=e=>n(`select`),onFocus:o,onBlur:s,onPointerenter:c,onPointerleave:l},[e.author?(K(),Fu(U(RE),{key:0,"aria-hidden":`true`,people:[U(gh)(e.author)],size:`sm`},null,8,[`people`])):Uu(``,!0),!e.draft&&e.number!==void 0?(K(),Pu(`span`,Pz,ss(e.number),1)):Uu(``,!0)],40,Nz))}})})),Lz,Rz=t((()=>{Iz(),Iz(),Lz=Fz})),zz,Bz,Vz,Hz=t((()=>{Y(),XT(),zz=[`data-side`],Bz=[`data-action`,`aria-keyshortcuts`,`title`,`onClick`],Vz=G({name:`CommentSelectionBar`,__name:`CommentSelectionBar`,props:{suggest:{type:Boolean,default:!1},side:{default:`top`},tooltip:{type:[Object,Function]}},emits:[`comment`,`suggest`],setup(e,{emit:t}){let n=t,r=(e,{slots:t})=>t.default?.(),i=J(()=>[{name:`comment`,label:`Comment`,hint:`Comment on the selected text`,key:`C`,icon:AT},...e.suggest?[{name:`suggest`,label:`Suggest`,hint:`Suggest new words`,key:`E`,icon:NT}]:[]]);function a(e){n(e===`comment`?`comment`:`suggest`)}return(t,n)=>(K(),Pu(`div`,{"data-slot":`comment-selection-bar`,"data-side":e.side,role:`group`,"aria-label":`Selected text`,onMousedown:n[0]||=Ep(()=>{},[`prevent`])},[(K(!0),Pu(df,null,ql(i.value,n=>(K(),Fu(Wl(e.tooltip||r),qu({key:n.name},{ref_for:!0},e.tooltip?{side:e.side,hint:n.hint,shortcut:n.key}:{}),{default:gl(()=>[Ru(`button`,{type:`button`,"data-slot":`comment-selection-bar-action`,"data-action":n.name,"aria-keyshortcuts":n.key,title:e.tooltip?void 0:`${n.hint} (${n.key})`,onClick:e=>a(n.name)},[Yl(t.$slots,`${n.name}-icon`,{},()=>[(K(),Fu(Wl(n.icon),{"data-slot":`comment-icon`,"aria-hidden":`true`}))]),Hu(ss(n.label),1)],8,Bz)]),_:2},1040))),128))],40,zz))}})})),Uz,Wz=t((()=>{Hz(),Hz(),Uz=Vz})),Gz,Kz,qz,Jz,Yz=t((()=>{Y(),XT(),hz(),BE(),Gz={"data-slot":`comment-toolbar`,"data-comments-ui":``,role:`toolbar`,"aria-label":`Comments`},Kz=[`data-variant`,`aria-pressed`],qz=[`data-variant`,`aria-label`,`aria-pressed`],Jz=G({name:`CommentToolbar`,__name:`CommentToolbar`,props:{comments:{},people:{default:()=>[]}},setup(e){let t=e,n=JD(t.comments),r=J(()=>n.pageThreads.value.length);return(e,i)=>(K(),Pu(`div`,Gz,[Ru(`button`,{type:`button`,"data-slot":`comment-toolbar-mode`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":U(n).active.value?`solid`:`ghost`,"aria-keyshortcuts":`C`,"aria-label":`Comment mode`,"aria-pressed":U(n).active.value,title:`Comment (C)`,onClick:i[0]||=e=>U(n).toggle()},[Yl(e.$slots,`mode-icon`,{},()=>[bf(U(AT),{"data-slot":`comment-icon`,"aria-hidden":`true`})])],8,Kz),Ru(`button`,{type:`button`,"data-slot":`comment-toolbar-list`,"data-comment-button":``,"data-size":`sm`,"data-variant":U(n).listOpen.value?`solid`:`ghost`,"aria-label":`Comment list, ${r.value} on this page`,"aria-pressed":U(n).listOpen.value,onClick:i[1]||=e=>U(n).listOpen.value=!U(n).listOpen.value},[Yl(e.$slots,`list-icon`,{},()=>[bf(U(wT),{"data-slot":`comment-icon`,"aria-hidden":`true`})]),Ru(`span`,null,ss(r.value),1)],8,qz),Ru(`button`,{type:`button`,"data-slot":`comment-toolbar-page`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":`ghost`,"aria-label":`Comment on page`,title:`Comment on the whole page`,onClick:i[2]||=e=>U(n).startDraft(`page`)},[Yl(e.$slots,`page-icon`,{},()=>[bf(U(HT),{"data-slot":`comment-icon`,"aria-hidden":`true`})])]),t.people.length>0?(K(),Fu(U(RE),{key:0,people:t.people,size:`sm`,variant:`outline`},null,8,[`people`])):Uu(``,!0),Yl(e.$slots,`default`)]))}})})),Xz,Zz=t((()=>{Yz(),Yz(),Xz=Jz})),Qz=t((()=>{Sz(),Mz(),Rz(),Wz(),Zz()}));function $z(e,t,n){if(!t||!n||!e.width||!e.height)return e;let r=Math.max(e.width/t,e.height/n),i=t*r,a=n*r;return{left:e.left+(e.width-i)/2,top:e.top+(e.height-a)/2,width:i,height:a}}var eB,tB,nB=t((()=>{Y(),Ew(),Aw(),ZC(),Bp(),zw(),eB=4,tB=G({name:`ImageGallery`,props:{images:{required:!0,type:Array}},setup(e){let t=Dw(),n=H(null),r=H(!1),i=H(new Map),a=H(),o=yl(Fp,void 0);o?.add(a);let s=[],c=H(null),l,u=e=>s[Math.min(e,3)],d=J(()=>n.value===null?void 0:e.images[n.value]);W(()=>e.images,e=>{i.value=new Map(e.filter(({key:e,src:t})=>i.value.get(e)===t).map(({key:e,src:t})=>[e,t]))});let f=({key:t,src:n})=>{e.images.some(e=>e.key===t&&e.src===n)&&i.value.set(t,n)};async function p(e){await ol();let t=c.value,r=u(e);t&&r&&n.value===e&&(t.complete||await new Promise(e=>t.addEventListener(`load`,e,{once:!0})),n.value===e&&t.isConnected&&(l=JC(t,{from:$z(r.getBoundingClientRect(),t.offsetWidth,t.offsetHeight)})))}function m(e){l?.stop(),r.value=!1,n.value=e,p(e)}async function h(){if(n.value===null||r.value)return;let e=c.value,t=u(n.value);r.value=!0,e&&t&&e.complete&&e.naturalWidth&&(l=JC(e,{to:$z(t.getBoundingClientRect(),e.offsetWidth,e.offsetHeight)}),await l.done),l?.stop(),r.value&&(r.value=!1,n.value=null)}function g(t){n.value===null||r.value||e.images.length<2||(l?.stop(),n.value=(n.value+t+e.images.length)%e.images.length)}return Ld(()=>{l?.stop(),o?.delete(a)}),()=>{let o=e.images.length;s.length=0;let l=o>1,u=d.value;return q(`div`,{"data-count":Math.min(o,eB),"data-slot":`comment-reply-images`},[...e.images.slice(0,eB).map((e,t)=>q(`button`,{"aria-label":`Preview ${e.name}`,"data-open":n.value!==null&&Math.min(n.value,3)===t?`true`:void 0,"data-slot":`comment-reply-image`,key:e.key,onClick:()=>m(t),ref:e=>{e instanceof HTMLElement&&(s[t]=e)},title:e.name,type:`button`},[i.value.get(e.key)===e.src?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:``,loading:`lazy`,key:e.src,onError:()=>f(e),src:e.src}),t===3&&o>eB?q(`span`,{"aria-hidden":`true`,"data-slot":`comment-reply-image-more`},`+${o-eB+1}`):null])),q(Iw,{open:n.value!==null,title:d.value?.name??`Image`,transition:!1,ui:{content:`vh-image-dialog vh-image-gallery`,overlay:r.value?`vh-image-overlay vh-image-overlay--closing`:`vh-image-overlay`},"onUpdate:open":e=>{e||h()}},{content:()=>q(`div`,{class:`vh-image-gallery__body`,ref:a,onKeydown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),g(e.key===`ArrowLeft`?-1:1))}},[q(`div`,{class:`vh-image-dialog__toolbar`,"data-closing":r.value?`true`:void 0},[q(`span`,{class:`vh-image-dialog__name`,title:d.value?.name},d.value?.name),l?q(`span`,{class:`vh-image-gallery__count`},[q(Cw,{value:(n.value??0)+1}),` of ${o}`]):null,q(Fw,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,external:!0,icon:t.value.external,rel:`noreferrer`,target:`_blank`,to:d.value?.src,variant:`ghost`}),q(Fw,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:t.value.close,onClick:()=>void h(),variant:`ghost`})]),q(`div`,{class:`vh-image-gallery__stage`},[l?q(Fw,{"aria-label":`Previous picture`,class:`vh-image-gallery__step vh-image-gallery__step--previous rounded-full`,color:`neutral`,icon:t.value.chevronLeft,onClick:()=>g(-1),variant:`solid`}):null,u&&i.value.get(u.key)===u.src?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:u?.name??``,class:`vh-image-dialog__image`,key:u?.src,onError:()=>u&&f(u),ref:c,src:u?.src}),l?q(Fw,{"aria-label":`Next picture`,class:`vh-image-gallery__step vh-image-gallery__step--next rounded-full`,color:`neutral`,icon:t.value.chevronRight,onClick:()=>g(1),variant:`solid`}):null])])})])}}})}));function rB(e,t){return q(`a`,{href:e,rel:`noopener noreferrer`,target:`_blank`},t)}function iB(e,t,n){return!n||t.length===0?[e]:Th(e,t).map(e=>typeof e==`string`?e:q(n,{label:e.name,user:e.id}))}function aB(e,t=[],n){let r=[],i=0;for(let a of e.matchAll(oB)){let o=a.index;o>i&&r.push(...iB(e.slice(i,o),t,n));let s=a[0];if(a[1])r.push(q(`code`,s.slice(1,-1)));else if(a[2])r.push(q(`strong`,iB(s.slice(2,-2),t,n)));else if(a[3])r.push(q(`em`,iB(s.slice(1,-1),t,n)));else if(a[4]){let e=s.indexOf(`](`);r.push(rB(s.slice(e+2,-1),s.slice(1,e)))}else r.push(rB(s,s));i=o+s.length}return i<e.length&&r.push(...iB(e.slice(i),t,n)),r}var oB,sB,cB=t((()=>{Y(),Mh(),oB=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)|(\[[^\]\n]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s<>)]+)/g,sB=G({name:`Markdown`,inheritAttrs:!1,props:{components:{type:Object},plugins:{type:Array},value:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=(e.plugins??[]).flatMap(e=>Eh(Qs(e))??[]),r=e.components?.[`comment-mention`];return q(`div`,{...t,class:[`vh-markdown`,t.class]},e.value.split(/\n{2,}/).filter(e=>e.trim()).map(e=>q(`p`,e.split(`
|
|
154
|
+
`).flatMap((e,t)=>t?[q(`br`),...aB(e,n,r)]:aB(e,n,r)))))}}})})),lB,uB,dB=t((()=>{Y(),lB=[`data-variant`],uB=G({inheritAttrs:!1,__name:`Marker`,props:{variant:{default:`ghost`}},setup(e){let t=Zl(),n=()=>q(df,t.default?.());return(t,r)=>Yl(t.$slots,`render`,{props:{...t.$attrs,"data-slot":`marker`,"data-variant":e.variant},children:n()},()=>[Ru(`div`,qu(t.$attrs,{"data-slot":`marker`,"data-variant":e.variant}),[Yl(t.$slots,`default`)],16,lB)])}})})),fB,pB=t((()=>{dB(),dB(),fB=uB})),mB,hB,gB=t((()=>{Y(),mB={"data-slot":`marker-content`},hB=G({__name:`MarkerContent`,setup(e){return(e,t)=>(K(),Pu(`span`,mB,[Yl(e.$slots,`default`)]))}})})),_B,vB=t((()=>{gB(),gB(),_B=hB})),yB=t((()=>{pB(),vB(),Y()})),bB=t((()=>{yB()})),xB=t((()=>{Tw()})),SB=t((()=>{HR()}));function CB(e){return e instanceof Error?e.message:`That did not work. Try again.`}function wB(e,t){if(e)try{return t.includes(new URL(e,`https://vitehub.invalid`).protocol)?e:void 0}catch{return}}function TB({actor:e},t){if(!e?.via)return null;let n=t?void 0:wB(e.url,[`http:`,`https:`]),r=`via ${e.via}`;return q(`span`,{"data-slot":`comment-reply-via`},n?q(`a`,{href:n,rel:`noreferrer`,target:`_blank`},r):r)}function EB(e,t,n,r){if(e.attachments.length===0)return null;let i=e.attachments.map(e=>{let n=t?.(e),r=typeof n==`string`?{url:n}:n,i=r?.name||kB(e),a=/\.([a-z0-9]+)$/i.exec(i)?.[1]?.toLowerCase(),o=wB(r?.url,[`http:`,`https:`,`blob:`]);return{href:o,image:o!==void 0&&(r?.type?r.type.startsWith(`image/`):a===void 0||OB.has(a)),key:e,name:i}}),a=i.flatMap(e=>e.image&&e.href?[{key:e.key,name:e.name,src:e.href}]:[]),o=i.filter(e=>!e.image);return[a.length>0?q(tB,{images:a}):null,o.length>0?q(hE,{"data-slot":`comment-reply-attachments`},()=>o.map(e=>q(Yw,{key:e.key,size:`xs`},()=>[q(bE,{kind:`icon`},()=>q(n,{name:r})),q(uE,()=>q(TE,()=>e.href?q(`a`,{href:e.href,rel:`noreferrer`,target:`_blank`},e.name):e.name))]))):null]}function DB(e,t,n){let r=tc(t);return J({get:()=>e()??r.value,set:e=>{r.value=e,n(e)}})}var OB,kB,AB,jB,MB,NB=t((()=>{Y(),Ew(),Bp(),Mh(),Sh(),pz(),H_(),nO(),nB(),OE(),VE(),MD(),cB(),bB(),xB(),SB(),Aw(),zw(),OB=new Set([`apng`,`avif`,`bmp`,`gif`,`heic`,`jpeg`,`jpg`,`png`,`svg`,`webp`]),kB=e=>e.split(/[/\\]/).at(-1)||e,AB=G({name:`CommentReply`,props:{message:{required:!0,type:Object},user:{type:Object},editable:{default:!1,type:Boolean},deletable:{default:void 0,type:Boolean},compact:{default:!1,type:Boolean},confirmDelete:{default:!1,type:Boolean},size:{default:`md`,type:String},people:{default:()=>[],type:Array},users:{type:Function},attachmentUrl:{type:Function},onEdit:{type:Function},onDelete:{type:Function}},slots:Object,setup(e,{slots:t}){let n=Dw(),r=V_(),i=H(!1),a=H(!1),o=H(!1),s=H(),c=H(``),l=H([]),u=()=>e.user?.id??r?.user.value?.id,d=G({props:{label:{default:``,type:String},user:{default:``,type:String}},setup(t){return()=>e.message.mentions.includes(t.user)?q(`span`,{"data-self":t.user===u()?`true`:void 0,"data-slot":`comment-mention`},`@${t.label}`):`@${t.label}`}}),f={[Oh]:d},p=J(()=>{let t=new Map;for(let n of[...r?.people.value??[],...e.people,...e.user?[e.user]:[]])t.set(n.id,n);return[Dh(e.message.mentions.flatMap(e=>{let n=t.get(e);return n?[{id:e,name:bh(n)}]:[]}))]});async function m(e){if(o.value)return!1;o.value=!0,s.value=void 0;try{return await e(),!0}catch(e){return s.value=CB(e),!1}finally{o.value=!1}}function h(){c.value=e.message.body,l.value=[...e.message.mentions],s.value=void 0,i.value=!0}async function g(t){if(!e.onEdit)return;let n=c.value,r=l.value,a=t.body===e.message.body?[...new Set([...e.message.mentions,...t.mentions])]:t.mentions;await m(()=>e.onEdit?.(e.message.id,t.body,a))&&c.value===n&&l.value===r&&(i.value=!1)}let _=()=>e.editable&&e.onEdit!==void 0,v=()=>(e.deletable??e.editable)&&e.onDelete!==void 0;async function y(){e.onDelete&&await m(()=>e.onDelete?.(e.message.id))&&(a.value=!1)}let b=(n,i)=>{if(!t.status)return null;let a=r?.outbox,o=()=>!e.compact&&e.message.id===n.id&&e.message.delivery!==void 0,s=()=>o()&&e.editable,c=()=>o()&&(e.deletable??e.editable);return q(`div`,{"data-slot":`comment-reply-status`},t.status({delivery:i,dismiss:a?.enabled&&c()?async()=>c()&&await a.dismiss(n.id):void 0,edit:a?.enabled&&s()?async(e,t)=>s()&&await a.edit(n.id,e,t):void 0,message:n,retry:a?.enabled&&s()?async()=>{s()&&await a.retry(n.id)}:void 0}))};return()=>{let{message:r}=e;return q(`div`,{"data-compact":e.compact?`true`:void 0,"data-editing":i.value?`true`:void 0,...fz(r.delivery),"data-size":e.size,"data-slot":`comment-reply`},[q(`div`,{"data-slot":`comment-reply-content`},[q(`div`,{"data-slot":`comment-reply-header`},[q(RE,{"aria-hidden":`true`,people:[_h(r)],size:`sm`}),q(`span`,{"data-agent":r.actor?`true`:void 0,"data-slot":`comment-reply-author`},xh(r)),TB(r,e.compact),q(BR,{at:r.createdAt,"data-slot":`comment-reply-time`}),r.editedAt?q(`span`,{"data-slot":`comment-reply-edited`},`edited`):null]),i.value?q(jD,{autofocus:!0,busy:o.value,error:s.value,layout:`row`,mentions:l.value,modelValue:c.value,onCancel:()=>{o.value||(i.value=!1)},onSubmit:g,"onUpdate:mentions":e=>l.value=e,"onUpdate:modelValue":e=>c.value=e,people:e.people,size:e.size,users:e.users,variant:`edit`},{...t[`mention-item`]?{"mention-item":t[`mention-item`]}:{},...t[`mention-empty`]?{"mention-empty":t[`mention-empty`]}:{}}):t.body?.({message:r})??q(sB,{components:f,"data-slot":`comment-reply-body`,plugins:p.value,value:r.body}),i.value||e.compact?null:t.attachments?.({message:r})??EB(r,e.attachmentUrl,Pw,n.value.file),i.value||e.compact||!t.footer?null:q(`div`,{"data-slot":`comment-reply-footer`},t.footer({message:r})),!i.value&&r.delivery?b(r,r.delivery):null,a.value?q(`div`,{"aria-label":`Confirm delete`,"data-slot":`comment-reply-confirm`,role:`group`},[q(`p`,`Delete this comment and every reply to it?`),q(Fw,{color:`error`,label:`Delete thread`,loading:o.value,onClick:y,size:`xs`}),q(Fw,{color:`neutral`,label:`Cancel`,onClick:()=>a.value=!1,size:`xs`,variant:`ghost`})]):null,!i.value&&s.value?q(`p`,{"data-slot":`comment-reply-error`,role:`alert`},s.value):null]),(_()||v())&&!i.value&&!a.value&&!e.compact?q(`div`,{"data-slot":`comment-reply-actions`},[_()?q(Fw,{"aria-label":`Edit`,color:`neutral`,icon:n.value.edit,onClick:h,size:`xs`,variant:`ghost`}):null,v()?q(Fw,{"aria-label":`Delete`,color:`neutral`,icon:n.value.delete,onClick:()=>e.confirmDelete?a.value=!0:void y(),size:`xs`,variant:`ghost`}):null]):null])}}}),jB=e=>q(fB,{key:`resolved`,variant:`separator`},()=>q(_B,()=>`Resolved${e.resolvedBy?` by ${xh({author:e.resolvedBy,...e.resolvedActor?{actor:e.resolvedActor}:{}})}`:``}`)),MB=G({name:`CommentThread`,props:{thread:{required:!0,type:Object},user:{type:Object},preview:{default:!1,type:Boolean},readOnly:{default:!1,type:Boolean},can:{type:Function},busy:{default:!1,type:Boolean},error:{type:String},detached:{default:!1,type:Boolean},people:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},navigation:{default:`close`,type:String},dismissible:{default:!0,type:Boolean},size:{default:`md`,type:String},reply:{type:String},defaultReply:{default:``,type:String},mentions:{type:Array},defaultMentions:{default:()=>[],type:Array},files:{type:Array},defaultFiles:{default:()=>[],type:Array},onReply:{type:Function},onEdit:{type:Function},onDelete:{type:Function},onResolve:{type:Function},onReopen:{type:Function}},emits:[`close`,`update:reply`,`update:mentions`,`update:files`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=Dw(),a=V_(),o=H(null),s=DB(()=>e.reply,e.defaultReply,e=>t(`update:reply`,e)),c=DB(()=>e.mentions,e.defaultMentions,e=>t(`update:mentions`,e)),l=DB(()=>e.files,e.defaultFiles,e=>t(`update:files`,e)),u=H(!1),d=H(),f=H(null),p=yl(Fp,void 0)??new Set;vl(Fp,p);let m=J(()=>e.user??a?.user.value),h=J(()=>e.users??(a?t=>a.users(t,e.thread.id):void 0)),g=(t,n)=>!e.readOnly&&(e.can??a?.can??VD(m.value))(t,{message:n,thread:e.thread}),_=J(()=>{let t=new Map;for(let n of[...e.people,e.thread.author,...e.thread.messages.map(e=>e.author),...m.value?[m.value]:[]])t.set(n.id,n);return[...t.values()]}),v=J(()=>[...new Set([e.thread.author.id,...e.thread.messages.map(e=>e.author.id)])]);Mp(n=>{let r=zp(n);if(e.preview||!e.dismissible||!o.value||r.includes(o.value))return;for(let e of p)if(e.value&&r.includes(e.value))return;if(r.some(e=>e.matches(`[data-slot='comment-pin']`))||Ip.has(n))return;Ip.add(n);let i=o.value.getRootNode();Pp(i instanceof ShadowRoot?i:document)?(n.stopPropagation(),jp()):t(`close`)});async function y(t){if(u.value||!e.onReply)return;u.value=!0,d.value=void 0;let n=s.value,r=c.value,i=l.value,a=[...r],o=[...i];try{await e.onReply(t.body,[...t.mentions],[...t.files]),s.value===n&&c.value===r&&l.value===i&&r.length===a.length&&a.every((e,t)=>e===r[t])&&i.length===o.length&&o.every((e,t)=>e===i[t])&&(s.value=``,c.value=[],l.value=[]),ol(()=>f.value?.focus())}catch(e){d.value=CB(e)}finally{u.value=!1}}async function b(e){if(!(o.value&&Pp(o.value))){d.value=void 0;try{await e?.()}catch(e){d.value=CB(e)}}}function x(){o.value&&Pp(o.value)||t(`close`)}n({close:x});let S=()=>({...r.body?{body:r.body}:{},...r.attachments?{attachments:r.attachments}:{},...r.footer?{footer:r.footer}:{},...r.status?{status:r.status}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}}),C=()=>({...r.extra?{extra:r.extra}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}});return()=>{let{thread:t}=e,n=t.status===`resolved`,a=lz(t),p=t.messages[0],w=t.anchor.kind===`text`?t.anchor.exact:void 0;if(e.preview){let n=t.messages.length-1;return q(`div`,{...fz(t.delivery),"data-preview":`true`,"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status},[p?q(AB,{compact:!0,message:p,people:_.value,size:e.size,user:m.value},{...r.body?{body:r.body}:{},...r.status?{status:r.status}:{}}):null,n>0?q(`p`,{"data-slot":`comment-thread-count`},[q(Cw,{value:n}),n===1?` reply`:` replies`]):null])}let T=e.navigation===`back`,E=r.anchor?r.anchor({thread:t}):w?q(`blockquote`,{"data-slot":`comment-thread-quote`},w):null;return q(`section`,{"aria-label":uz(t),...fz(t.delivery),"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status,ref:o,role:`dialog`,tabindex:-1},[q(`header`,{"data-slot":`comment-thread-header`},[T?q(Fw,{"aria-label":`Back to comments`,color:`neutral`,icon:i.value.arrowLeft,onClick:x,size:`xs`,variant:`ghost`}):null,q(`span`,{"data-slot":`comment-thread-title`},dz(t)),q(`span`,{"data-slot":`comment-thread-spacer`}),r.actions?q(`div`,{"data-slot":`comment-thread-actions`},r.actions({thread:t})):null,g(`resolve`)?q(Fw,{"aria-label":n?`Reopen`:`Resolve`,color:`neutral`,icon:n?i.value.reopen:i.value.check,onClick:()=>void b(n?e.onReopen:e.onResolve),size:`xs`,variant:`ghost`}):null,T?null:q(Fw,{"aria-label":`Close`,color:`neutral`,icon:i.value.close,onClick:x,size:`xs`,variant:`ghost`})]),q(yw,null,{render:({props:e,children:t})=>q(`div`,{...e,"data-slot":`comment-thread-messages`},[t]),default:()=>[E,e.detached?q(`p`,{"data-slot":`comment-thread-detached`,role:`status`},`The place of this comment is no longer on the page.`):null,...t.messages.flatMap((r,i)=>[n&&r===a[0]?jB(t):null,q(AB,{attachmentUrl:e.attachmentUrl,confirmDelete:i===0,deletable:g(`delete`,r),editable:g(`edit`,r),key:r.id,message:r,onDelete:e.onDelete,onEdit:e.onEdit,people:_.value,size:e.size,user:m.value,users:h.value},S())]),n&&a.length===0?jB(t):null,r.after?q(`div`,{"data-slot":`comment-thread-after`},r.after({thread:t})):null]}),!g(`reply`)&&(d.value??e.error)?q(`p`,{role:`alert`},d.value??e.error):null,g(`reply`)?q(jD,{accept:e.accept,attachments:e.attachments,autofocus:!1,busy:e.busy||u.value,error:d.value??e.error,files:l.value,guard:!1,layout:`row`,mentions:c.value,modelValue:s.value,onCancel:x,onSubmit:y,participants:v.value,"onUpdate:files":e=>l.value=e,"onUpdate:mentions":e=>c.value=e,"onUpdate:modelValue":e=>s.value=e,people:_.value,ref:f,size:e.size,user:m.value,users:h.value,variant:`reply`},C()):null])}}})}));function PB(e,t,n){let r=(Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)||16)/2,i=e.x,a=i>n/2&&i+r+t>n-r,o=Math.max(r,Math.min(a?i-r-t:i+r,n-r-t));return{x:i,y:e.y,flipX:a,left:o-i}}function FB(e){let t={x:e.left+e.width/2,y:e.top+e.height/2},n=document.elementsFromPoint(t.x,t.y).find(e=>!e.closest(`[data-comments-ui]`)&&!e.localName.startsWith(`vitehub-`)&&e!==document.documentElement);for(let t=n??null;t&&t!==document.documentElement;t=t.parentElement){let n=t.getBoundingClientRect();if(n.left<=e.left+1&&n.top<=e.top+1&&n.right>=e.left+e.width-1&&n.bottom>=e.top+e.height-1)return t}}var IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB=t((()=>{Y(),nO(),FD(),iO(),Bp(),cz(),Sh(),rz(),BD(),pz(),uw(),MD(),Qz(),NB(),IB=360,LB=420,RB=e=>e===`area`||e===`image`?`round`:`point`,zB=6,BB=32,VB=8,HB=900,UB=8,WB=72,GB=G({name:`CommentLayer`,props:{client:{type:Object},subject:{type:Object},user:{type:Object},comments:{type:Object},people:{default:()=>[],type:Array},hotkey:{default:`c`,type:[String,Boolean]},readOnly:{default:!1,type:Boolean},canComment:{default:!0,type:Boolean},subjectUrl:{type:Function},navigate:{type:Function},can:{type:Function},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},placement:{default:`pin`,type:String},size:{default:`sm`,type:String}},setup(e,{slots:t}){let{client:n,subject:r}=e;if(!e.comments&&!r)throw PD.UI_R0002({message:"CommentLayer needs a `subject`, or the `comments` state from useComments()."});let i=H(null),a=()=>{let e=i.value?.getRootNode();return e instanceof ShadowRoot?e:document},o=e.comments??KD({client:n,hotkey:e.hotkey,subject:()=>e.subject,subjectUrl:e.subjectUrl,uiRoot:a,user:()=>e.user});qD(o);let s=H([]),c=tc(null);W(()=>o.draft.value,(e,t)=>{e!==t&&(s.value=e?.files?[...e.files]:[])});let{enabled:l,prepare:u,queued:d}=rO(o,e),f=J(()=>o.user.value),p=J(()=>o.threads.value.filter(e=>o.pageThreads.value.includes(e)||o.shown.value.has(e.id)||o.leaving.value.has(e.id))),m=J(()=>p.value.filter(e=>o.shown.value.has(e.id)||o.leaving.value.has(e.id))),h=null,g=H(null),_=(e,t)=>({left:Math.min(e.x,t.clientX),top:Math.min(e.y,t.clientY),width:Math.abs(t.clientX-e.x),height:Math.abs(t.clientY-e.y)}),v=e=>{g.value=null,h=Ip.has(e)||e.button!==0?null:{x:e.clientX,y:e.clientY,draw:e.pointerType!==`touch`},h?.draw&&e.target instanceof Element&&e.target.setPointerCapture?.(e.pointerId)},y=e=>{h?.draw&&(!g.value&&Math.hypot(e.clientX-h.x,e.clientY-h.y)<=zB||(g.value=_(h,e)))},b=e=>{let t=h,n=g.value;if(h=null,g.value=null,t){if(n){let n=_(t,e),r=n.width>=VB&&n.height>=VB?FB(n):void 0;if(!r)return;e.preventDefault();try{o.startDraft(r,{area:n,point:{x:n.left,y:n.top}})}catch{}}else if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>zB)){e.preventDefault();try{o.startDraft({x:e.clientX,y:e.clientY})}catch{}}}},x=null,S=!1;W(()=>o.opened.value&&RD(o.opened.value),e=>{e&&ol(()=>i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`)?.focus())}),W(()=>o.openId.value,(e,t)=>{if(e)return;x=null;let n=a().activeElement,r=i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`),s=o.threads.value.some(e=>e.id===t&&iz(o,e));t&&!s&&(!n||n===document.body||r?.contains(n))&&(x=t)},{flush:`pre`}),W(()=>o.openId.value,e=>{if(e||!x)return;let t=x;x=null,ol(()=>{let e=i.value?.querySelectorAll(`[data-slot='comment-pin']`)??[];S=!0,([...e].find(e=>e.getAttribute(`data-thread-id`)===t)??i.value?.querySelector(`:is([data-part='comment-toolbar-mode'], [data-slot='comment-toolbar-mode'])`))?.focus(),S=!1})},{flush:`post`});let C=null;W(()=>o.draft.value,(e,t)=>{if(e&&!t){let e=document.activeElement,t=a();C=e instanceof HTMLElement&&e!==document.body&&!(t instanceof ShadowRoot&&e===t.host)&&!i.value?.contains(e)?e:null;return}if(e||!t)return;let n=C;C=null,ol(()=>{let e=a().activeElement;n?.isConnected&&(!e||e===document.body)&&n.focus({preventScroll:!0})})},{flush:`sync`});let w=H(null),T=H(!1),E=H(0),D=()=>{E.value=w.value?.offsetWidth??0};W(()=>o.draft.value,(e,t)=>{e!==t&&(T.value=!1)});let O=typeof ResizeObserver==`function`?new ResizeObserver(()=>{D();let e=w.value;e?.parentElement?.hasAttribute(`data-above`)&&e.getBoundingClientRect().top<8&&(T.value=!0)}):void 0;W(w,(e,t)=>{t&&O?.unobserve(t),e&&O?.observe(e),D()}),Ld(()=>O?.disconnect());let k=({x:e,y:t})=>({left:`${e}px`,top:`${t}px`,"--vh-comment-x":`${e}px`}),A=Ws(new Map),ee=new Map,j=new Map,M=(e,t)=>{let n=j.get(e);n!==t&&(n&&te?.unobserve(n),j.delete(e),t&&(j.set(e,t),te?.observe(t)))},N=()=>{for(let[e,t]of ee){let n=t.querySelector(`:scope > [data-slot='comment-layer-popover']`),r=n?getComputedStyle(n).getPropertyValue(`position-area`):``;if(M(e,n&&r&&r!==`none`?n:null),!n||!r||r===`none`){A.delete(e);continue}let i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o={x:a.left+a.right<i.left*2,y:a.top+a.bottom<i.top*2},s=A.get(e);(s?.x!==o.x||s?.y!==o.y)&&A.set(e,o)}},te=typeof ResizeObserver==`function`?new ResizeObserver(N):void 0,P=0,F=()=>{P||=requestAnimationFrame(()=>{P=0,N()})};Pd(()=>{N(),window.addEventListener(`resize`,F,{passive:!0}),window.visualViewport?.addEventListener(`resize`,F,{passive:!0})});let I,ne=()=>{let e=i.value;e&&(I?I.play():I=nw(e,{items:e=>[...e.querySelectorAll(`[data-margin-key]`)],movesOnly:!0}),I.measure())};Pd(ne),Id(()=>{N(),ne()}),Ld(()=>{I?.destroy(),te?.disconnect(),cancelAnimationFrame(P),window.removeEventListener(`resize`,F),window.visualViewport?.removeEventListener(`resize`,F)});let re=e=>t=>{t instanceof HTMLElement?ee.set(e,t):(ee.delete(e),M(e,null),A.delete(e))},L=(e,t,n)=>{let r=n===void 0?void 0:A.get(n),i=r?r.x:e+IB>window.innerWidth,a=r?r.y:t+LB>window.innerHeight;return{"data-flip-x":i?`true`:void 0,"data-flip-y":a?`true`:void 0}},R=e=>{let t=o.draft.value;if(t?.anchor.kind===`page`)return t;try{o.startDraft(`page`,e?.length?{files:e}:{})}catch{}let n=o.draft.value;return n?.anchor.kind===`page`?n:null},ie=(t,n)=>q(jD,{accept:e.accept,attachments:l.value,autofocus:!n||n.autofocus,busy:t?t.busy||c.value===t:!1,error:t?.error,guard:!n,key:n?`page-island-composer`:void 0,mentions:t?.mentions??[],modelValue:t?.body??``,onCancel:n?n.onCancel:()=>o.cancelDraft(),files:s.value,frame:`none`,layout:`row`,onSubmit:async e=>{let n=t??R(e.files);if(!n||n.busy||c.value===n||o.draft.value!==n)return;n.error=void 0,n.mentions=e.mentions;let r=d(e.files);if(r){n.attachments=[],await o.send({files:r});return}c.value=n;let i=s.value,a=n.body,l=n.mentions;try{let{attachments:t,files:r}=await u(e.files);if(o.draft.value!==n||n.body!==a||n.mentions!==l||s.value!==i)return;n.attachments=t,await o.send({files:r})&&s.value===i&&(s.value=[])}catch(e){n.error=e instanceof Error?e.message:`The files could not be uploaded. Try again.`}finally{c.value===n&&(c.value=null)}},"onUpdate:files":e=>{t||!e.length?s.value=e:R(e)},"onUpdate:mentions":e=>{let n=t??(e.length?R():null);n&&(n.mentions=e)},"onUpdate:modelValue":e=>{let n=t??(e?R():null);n&&(n.body=e)},people:f.value?[f.value]:[],size:e.size,user:f.value,users:o.users}),z=H(0),ae=()=>{z.value=window.innerWidth,D()};Pd(()=>{z.value=window.innerWidth,window.addEventListener(`resize`,ae,{passive:!0})}),Ld(()=>window.removeEventListener(`resize`,ae));let oe=J(()=>e.placement===`margin`&&z.value>=HB),se=Ws(new Map),ce=new Map,le=typeof ResizeObserver==`function`?new ResizeObserver(e=>{for(let t of e){let e=t.target.getAttribute(`data-margin-key`),n=Math.round(t.target.getBoundingClientRect().height);e&&n&&se.get(e)!==n&&se.set(e,n)}}):void 0;Ld(()=>le?.disconnect());let ue=e=>t=>{let n=ce.get(e);n&&n!==t&&le?.unobserve(n),t instanceof Element?(ce.set(e,t),le?.observe(t)):ce.delete(e)},de=()=>t.status?{status:t.status}:void 0,fe=()=>({...de(),...t.actions?{actions:t.actions}:{}}),pe=(t,n=!1)=>q(MB,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:l.value,can:e.can,key:RD(t),detached:o.positions.value.get(t.id)?.detached===!0,...n?{dismissible:!1,navigation:`back`}:{},readOnly:e.readOnly,size:e.size,onClose:()=>o.close(),onDelete:e=>o.remove(t.id,e),onEdit:(e,n,r)=>o.edit(t.id,e,n,r),onReopen:()=>o.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:i,files:a}=await u(r);return o.reply(t.id,e,n,i,a)},onResolve:async()=>{await o.resolve(t.id),o.close()},thread:t,user:f.value},fe()),me=(e,t)=>{let n=p.value.flatMap(t=>{let n=o.shown.value.has(t.id)?e.get(t.id):void 0;return n?[{active:o.openId.value===t.id,key:t.id,thread:t,y:n.y}]:[]});t!==void 0&&n.push({active:!0,key:YD,y:t}),n.sort((e,t)=>e.y-t.y);let r=e=>se.get(e.key)??(e.active?LB:WB),i=[],a=-1/0;for(let e of n){let t=Math.max(e.y-16,a+UB);i.push(t),a=t+r(e)}let s=window.innerHeight-16;return n.forEach((e,t)=>{if(!(!e.active||i[t]+r(e)<=s)){i[t]=Math.max(16,s-r(e));for(let e=t-1;e>=0;e--)i[e]=Math.min(i[e],i[e+1]-UB-r(n[e]));for(let e=t+1;e<n.length;e++)i[e]=Math.max(i[e],i[e-1]+UB+r(n[e-1]))}}),{at:new Map(n.map((e,t)=>[e.key,i[t]])),node:q(`div`,{"data-slot":`comment-margin`},n.flatMap((e,t)=>{let n=e.thread;return!n||e.active?[]:[q(`button`,{"aria-label":`${uz(n)}: ${yh(n.messages[0]?.body??``)}`,"data-margin-key":e.key,"data-slot":`comment-margin-card`,"data-status":n.status,...fz(n.delivery),key:e.key,onClick:()=>o.open(n),onPointerenter:()=>{o.draft.value||(o.hoverId.value=n.id)},onPointerleave:()=>{o.hoverId.value===n.id&&(o.hoverId.value=null)},ref:ue(e.key),style:{top:`${i[t]}px`},type:`button`},[q(nz,{thread:n})])]}))}};return()=>{let n=new Map;for(let e of m.value){let t=o.positions.value.get(e.id);if(!t||t.detached||t.clipped||e.anchor.kind===`page`)continue;let r=e=>[...n.values()].some(n=>Math.abs(n.x-t.x)<BB&&Math.abs(n.y-e)<BB),i=t.y;for(;r(i);)i+=BB;if(i!==t.y&&i>window.innerHeight-BB)for(i=t.y-BB;r(i);)i-=BB;n.set(e.id,{...t,y:i})}let r=m.value.flatMap(t=>{let r=n.get(t.id);if(!r)return[];let i=!o.shown.value.has(t.id),a=o.openId.value===t.id,s=o.hoverId.value===t.id&&!i&&!a&&!o.draft.value&&!oe.value;return[q(`div`,{...L(r.x,r.y,t.id),"data-kind":t.anchor.kind,"data-leaving":i?`true`:void 0,"data-slot":`comment-layer-item`,inert:i||void 0,key:t.id,ref:re(t.id),style:k(r)},[q(Lz,{active:a,author:t.author,"data-shape":RB(t.anchor.kind),"data-thread-id":t.id,...fz(t.delivery),excerpt:yh(t.messages[0]?.body??``),...t.n?{number:t.n}:{},onHover:()=>{a||S||o.draft.value||(o.hoverId.value=t.id)},onLeave:()=>{o.hoverId.value===t.id&&(o.hoverId.value=null)},onSelect:()=>a?o.close():o.open(t),status:t.status}),s?q(`div`,{"data-preview":`true`,"data-slot":`comment-layer-popover`},q(MB,{preview:!0,size:e.size,thread:t},de())):null])]}),a=o.draft.value,s=a&&o.positions.value.get(`draft`),c=a&&a.anchor.kind!==`page`?a:null,l=c&&s&&!s.detached?s:c?.point,u=!!(oe.value&&c&&l),d=oe.value?me(n,u?l.y:void 0):null,p=e=>{let t=d?.at.get(e);return t===void 0?void 0:{"data-margin":`true`,"data-margin-key":e,style:{top:`${t}px`}}},_=o.opened.value,x=_&&!iz(o,_)?_:void 0,C=x&&o.positions.value.get(x.id),D=x&&C&&!C.detached&&!C.clipped&&x.anchor.kind!==`page`?n.get(x.id)??C:void 0,O=x&&D?p(x.id):void 0,A=x?q(`div`,{...D?L(D.x,D.y,`opened-thread`):{},"data-kind":x.anchor.kind,"data-slot":`comment-layer-item`,key:`opened-thread`,ref:re(`opened-thread`),style:D?k(D):void 0},q(`div`,{...O,"data-floating":D?void 0:`true`,"data-slot":`comment-layer-popover`,ref:e=>O&&ue(x.id)(e)},pe(x))):null,ee=c&&l?PB(l,E.value,z.value):void 0,j=u?p(YD):void 0,M=c&&ee?q(`div`,{...L(ee.x,ee.y),"data-flip-x":ee.flipX?`true`:void 0,...(c.anchor.kind===`area`||c.anchor.kind===`image`)&&ee.y>72&&!T.value?{"data-above":`true`}:{},"data-draft":`true`,"data-kind":c.anchor.kind,"data-slot":`comment-layer-item`,style:k(ee)},[q(Lz,{author:f.value,"data-shape":RB(c.anchor.kind),draft:!0}),q(`div`,{...j,"data-motion-appear":j?void 0:`[data-slot=comment-pin]`,"data-slot":`comment-layer-popover`,style:j?.style??{"--vh-comment-draft-left":`${ee.left}px`},ref:e=>{w.value=e instanceof HTMLElement?e:null,j&&ue(YD)(e)}},ie(c))]):null;return q(`div`,{"data-active":o.active.value?`true`:void 0,"data-comments-ui":``,"data-slot":`comment-layer`,ref:i},[o.active.value?q(`div`,{"data-slot":`comment-layer-overlay`,onPointercancel:()=>{h=null,g.value=null},onPointerdown:v,onPointermove:y,onPointerup:b},g.value?[q(`div`,{"data-slot":`comment-layer-area`,style:{left:`${g.value.left}px`,top:`${g.value.top}px`,width:`${g.value.width}px`,height:`${g.value.height}px`}},[...[`top-left`,`top-right`,`bottom-left`,`bottom-right`].map(e=>q(`span`,{"data-corner":e,"data-slot":`comment-layer-area-handle`,key:e})),q(`span`,{"data-slot":`comment-layer-area-size`},`${Math.round(g.value.width)} × ${Math.round(g.value.height)}`)])]:[]):null,...r,M,A,q(sz,{comments:o,canComment:e.canComment&&!e.readOnly},{composer:e=>[ie(e.draft,e)],thread:({thread:e})=>[pe(e,!0)]}),d?.node,t.default?.({comments:o})??[q(Xz,{comments:o,people:e.people}),o.listOpen.value?q(jz,{comments:o,navigate:e.navigate}):null]])}}})}));function qB(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}var JB,YB,XB,ZB=t((()=>{Y(),Ew(),nO(),FD(),iO(),rz(),GR(),BD(),pz(),H_(),MD(),NB(),zw(),JB=new Set([`row`,`preview`,`group-header`,`list-actions`]),YB=(e,t)=>e.kind===t.kind&&e.id===t.id,XB=G({name:`CommentPanel`,props:{comments:{type:Object},client:{type:Object},subject:{type:Object},user:{type:Object},variant:{default:`docked`,type:String},thread:{default:void 0,type:[String,null]},status:{type:String},title:{default:`Comments`,type:String},heading:{default:!0,type:Boolean},composer:{default:!0,type:Boolean},readOnly:{default:!1,type:Boolean},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},allowEmpty:{default:!1,type:Boolean},people:{default:()=>[],type:Array},can:{type:Function},group:{type:Function}},emits:[`update:thread`,`update:status`,`select`],slots:Object,setup(e,{emit:t,slots:n}){let r=e.comments??V_();if(!r&&!e.subject)throw PD.UI_R0002({message:"CommentPanel needs a comments state: put it inside CommentLayer, pass `comments`, or pass a `subject`."});let i=JD(r??KD({client:e.client,hotkey:!1,subject:()=>e.subject,user:()=>e.user}));qD(i);let a=H(null),o=H(null),s=H(`open`),c=J(()=>e.thread===void 0?o.value:e.thread),l=J(()=>e.status??s.value),u=J(()=>i.threads.value.filter(e=>i.scope.value===`site`||YB(e.subject,i.subject.value))),d=J(()=>u.value.filter(e=>e.status===l.value)),f=zD(i.threads,c);W(f,(e,t,n)=>{e&&n(i.retainMark(e.id))},{immediate:!0,flush:`sync`}),W(f,e=>{e&&e.id!==c.value&&v(e.id)});let p=H(``),m=H([]),h=H([]),g=H(!1),_=H();function v(e){o.value=e,t(`update:thread`,e)}function y(e){s.value=e,t(`update:status`,e)}function b(e){t(`select`,e),v(e.id),ol(()=>a.value?.querySelector(`[data-slot='comment-thread']`)?.focus())}function x(){let e=f.value?.id;v(null),ol(()=>{[...a.value?.querySelectorAll(`[data-slot='comment-panel-item']`)??[]].find(t=>t.dataset.threadId===e)?.focus()})}let{enabled:S,prepare:C,queued:w}=rO(i,e),T=()=>`${i.subject.value.kind}\u0000${i.subject.value.id}`,E=0;W(T,()=>{E++,p.value=``,m.value=[],h.value=[],_.value=void 0,g.value=!1});async function D(e){if(g.value)return;let t=++E;_.value=void 0;let n={body:p.value,files:h.value,mentions:m.value},r=w(e.files);if(r){p.value=``,m.value=[],h.value=[];try{await i.create({files:r,body:e.body,mentions:e.mentions})}catch(e){if(t!==E)return;_.value=qB(e),!p.value&&!h.value.length&&(p.value=n.body,m.value=n.mentions,h.value=n.files)}}else{g.value=!0;try{let r=await C(e.files);if(t!==E)return;await i.create({...r,body:e.body,mentions:e.mentions}),t===E&&p.value===n.body&&h.value===n.files&&m.value===n.mentions&&(p.value=``,m.value=[],h.value=[])}catch(e){t===E&&(_.value=qB(e))}finally{t===E&&(g.value=!1)}}}let O=()=>Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0&&!JB.has(e))),k=J(()=>{let t=[];for(let n of d.value){let r=e.group?.(n),i=t.find(e=>e.label===r);i||t.push(i={label:r,threads:[]}),i.threads.push(n)}return t.sort((e,t)=>Number(e.label!==void 0)-Number(t.label!==void 0))}),A=e=>q(`li`,{key:e.id},[q(`button`,{"data-focus-inset":``,"data-slot":`comment-panel-item`,"data-status":e.status,...fz(e.delivery),"data-thread-id":e.id,onClick:()=>b(e),type:`button`},n.row?.(WR(e))??q(nz,{detached:i.positions.value.get(e.id)?.detached===!0,site:i.scope.value===`site`,thread:e},n.preview?{preview:()=>n.preview?.(WR(e))}:void 0))]),ee=(e,t,n)=>q(`ol`,{"aria-label":t,"data-slot":`comment-panel-items`,key:n},e.map(A)),j=()=>k.value.map(({label:t,threads:r})=>t===void 0?ee(r,e.title,`ungrouped`):q(`section`,{"aria-label":t,"data-slot":`comment-panel-group`,key:t},[q(`h3`,{"data-slot":`comment-panel-group-header`},n[`group-header`]?.({group:t,threads:r})??t),ee(r,t)])),M=()=>{let t=i.counts.value,r=(e,t,n)=>q(Fw,{"aria-checked":String(l.value===e),color:`neutral`,"data-slot":`comment-panel-filter`,"data-state":l.value===e?`on`:`off`,onClick:()=>y(e),onKeydown:t=>{if(![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key))return;t.preventDefault();let n=t.currentTarget.closest(`[role=radiogroup]`);y(e===`open`?`resolved`:`open`),ol(()=>n?.querySelector(`[role=radio][aria-checked=true]`)?.focus())},role:`radio`,size:`xs`,tabindex:l.value===e?0:-1,variant:l.value===e?`soft`:`ghost`},{default:()=>[`${t} `,q(Cw,{value:n})]}),a=i.status.value===`loading`&&i.threads.value.length===0?`Loading comments.`:i.status.value===`error`?`The comments could not load.`:l.value===`open`?`No open comments.`:`No resolved comments.`;return[q(`header`,{"data-slot":`comment-panel-header`},[e.heading?q(`h2`,{"data-slot":`comment-panel-title`},e.title):null,q(`div`,{"aria-label":`Filter comments`,"data-slot":`comment-panel-filters`,role:`radiogroup`},[r(`open`,`Open`,t.open),r(`resolved`,`Resolved`,t.resolved)]),n[`list-actions`]?q(`div`,{"data-slot":`comment-panel-actions`},n[`list-actions`]()):null]),d.value.length===0?q(`p`,{"data-slot":`comment-panel-empty`,role:`status`},a):e.group||k.value.some(e=>e.label!==void 0)?q(`div`,{"data-slot":`comment-panel-groups`},j()):ee(d.value,e.title),e.readOnly||!e.composer?null:q(`div`,{"data-slot":`comment-panel-composer`},[q(jD,{accept:e.accept,allowEmpty:e.allowEmpty,attachments:S.value,autofocus:!1,busy:g.value,error:_.value,files:h.value,guard:!1,layout:`row`,mentions:m.value,modelValue:p.value,onSubmit:D,"onUpdate:files":e=>h.value=e,"onUpdate:mentions":e=>m.value=e,"onUpdate:modelValue":e=>p.value=e,people:e.people,placeholder:`Comment on this page`,user:i.user.value},{...n.extra?{extra:n.extra}:{},...n[`mention-item`]?{"mention-item":n[`mention-item`]}:{},...n[`mention-empty`]?{"mention-empty":n[`mention-empty`]}:{}})])]},N=t=>q(MB,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:S.value,can:e.can,detached:i.positions.value.get(t.id)?.detached===!0,dismissible:!1,key:RD(t),navigation:`back`,onClose:x,onDelete:async e=>{await i.remove(t.id,e)||x()},onEdit:(e,n,r)=>i.edit(t.id,e,n,r),onReopen:()=>i.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:a,files:o}=await C(r);return i.reply(t.id,e,n,a,o)},onResolve:()=>i.resolve(t.id),people:e.people,readOnly:e.readOnly,thread:t,user:i.user.value},O());return()=>q(`section`,{"aria-label":f.value?uz(f.value):e.title,"data-comments-ui":``,"data-slot":`comment-panel`,"data-variant":e.variant,"data-view":f.value?`thread`:`list`,ref:a},f.value?N(f.value):M())}})})),QB,$B,eV=t((()=>{Y(),Wz(),zw(),QB=G({props:{hint:{required:!0,type:String},shortcut:{required:!0,type:String},side:{required:!0,type:String}},setup(e,{slots:t}){let n=H(!1),r=!1;return Ul(()=>{if(!(r||n.value))return n.value=!0,!1}),()=>{let i=`${e.hint} (${e.shortcut})`;return n.value?t.default?.().map(e=>Vu(e,{title:i})):q(Lw,{content:{side:e.side,sideOffset:8},onVnodeMounted:()=>r=!0,text:i},{content:()=>[e.hint,q(`kbd`,{"data-slot":`comment-selection-bar-kbd`},e.shortcut)],default:t.default})}}}),$B=G({name:`CommentSelectionBar`,props:{side:{default:`top`,type:String},suggest:{default:!1,type:Boolean}},emits:{comment:()=>!0,suggest:()=>!0},slots:Object,setup(e,{emit:t,slots:n}){return()=>q(Uz,{...e,"data-slot":`comment-selection-bar`,tooltip:QB,onComment:()=>t(`comment`),onSuggest:()=>t(`suggest`)},n)}})})),tV=t((()=>{MD(),KB(),ZB(),NB(),Qz(),eV(),pz()})),nV=t((()=>{tV()})),rV,iV=t((()=>{rV=`:host{color:canvastext;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}*,:before,:after{box-sizing:border-box}[data-slot=standalone-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-standalone-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-standalone-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-standalone-button][data-size=sm]{padding:.375rem .625rem;font-size:.75rem}[data-standalone-button][data-square=true]{padding:.375rem}[data-standalone-button][data-size=xs][data-square=true]{padding:.25rem}[data-standalone-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=primary]{background:var(--vh-primary);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=error]{background:var(--vh-error);color:var(--vh-inverted)}[data-standalone-button][data-variant=outline]{border-color:var(--vh-border)}[data-standalone-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-standalone-button][data-variant=ghost]{color:var(--vh-muted)}[data-standalone-button]:is([data-variant=ghost],[data-variant=outline],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-standalone-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-standalone-button].rounded-full{border-radius:9999px}[data-standalone-button][aria-busy=true]{opacity:.6}[data-standalone-button]:disabled{cursor:default;opacity:.4}[data-slot=standalone-modal-trigger]{display:contents}[data-slot=standalone-modal]{background:color-mix(in oklab, var(--vh-bg-elevated) 75%, transparent);pointer-events:auto;z-index:2147483002;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}[data-slot=standalone-modal]>[role=dialog]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);overflow:auto}`})),aV,oV=t((()=>{aV=`@layer theme,base,comark;@layer components{:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}[data-slot=status]{align-items:center;gap:.375rem;min-width:0;font-size:.75rem;line-height:1rem;display:inline-flex}[data-slot=status][data-size=md]{font-size:.875rem;line-height:1.25rem}[data-slot=status][data-colored][data-tone=success]{color:var(--vh-text-success,var(--vh-success))}[data-slot=status][data-colored][data-tone=warning]{color:var(--vh-text-warning,var(--vh-warning))}[data-slot=status][data-colored][data-tone=error]{color:var(--vh-text-error,var(--vh-error))}[data-slot=status][data-colored][data-tone=info]{color:var(--vh-text-info,var(--vh-info))}@keyframes status-pulse{50%{opacity:.35}}@keyframes copy-button-spin{to{transform:rotate(360deg)}}[data-slot=message][data-align]{gap:.5rem;width:100%;min-width:0;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}[data-slot=message][data-align=end]{flex-direction:row-reverse}:is([data-slot=message-header],[data-slot=message-footer]){color:var(--vh-muted);align-items:center;min-width:0;max-width:100%;padding-inline:.75rem;font-size:.75rem;font-weight:500;line-height:1rem;display:flex}[data-slot=message][data-align]:is(:has([data-variant=ghost]),:not(:has([data-slot=bubble]))) :is([data-slot=message-header],[data-slot=message-footer]){padding-inline:0}[data-slot=bubble]{flex-direction:column;gap:.25rem;width:fit-content;min-width:0;max-width:80%;display:flex;position:relative}:is([data-slot=bubble][data-align=end],[data-slot=message][data-align=end] [data-slot=bubble]){align-self:flex-end}[data-slot=bubble][data-variant=ghost]{max-width:100%}[data-slot=bubble][data-variant=soft][data-tone=info]{--vh-bubble-tone:var(--vh-info)}[data-slot=bubble][data-variant=soft][data-tone=success]{--vh-bubble-tone:var(--vh-success)}[data-slot=bubble][data-variant=soft][data-tone=warning]{--vh-bubble-tone:var(--vh-warning)}[data-slot=bubble][data-variant=soft][data-tone=error]{--vh-bubble-tone:var(--vh-error)}[data-slot=attachment]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);flex-wrap:wrap;flex-shrink:0;width:fit-content;min-width:0;max-width:100%;transition:background-color .15s,border-color .15s;display:flex;position:relative}[data-slot=attachment]:has(>a,>button):hover{background:color-mix(in oklab, var(--vh-bg-elevated) 50%, var(--vh-bg))}[data-slot=attachment][data-status=error]{border-color:color-mix(in oklab, var(--vh-error) 30%, transparent)}[data-slot=attachment][data-status=idle]{border-style:dashed}[data-slot=attachment][data-size=md]{gap:.5rem;font-size:.875rem;line-height:1.25rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-media]){padding:.5rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-content]){padding:.5rem .625rem}[data-slot=attachment][data-size=sm]{gap:.625rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-media]){padding:.375rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-content]){padding:.375rem .5rem}[data-slot=attachment][data-size=xs]{border-radius:var(--vh-radius);gap:.375rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-media]){padding:.25rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-content]){padding:.25rem .375rem}[data-slot=attachment][data-orientation=horizontal]{align-items:center;min-width:10rem}[data-slot=attachment][data-orientation=vertical]{flex-direction:column;width:6rem}[data-slot=attachment][data-orientation=vertical]:has([data-slot=attachment-content]){width:7.5rem}[data-slot=attachment-media]{aspect-ratio:1;background:var(--vh-bg-elevated);border-radius:var(--vh-radius);color:var(--vh-highlighted);flex-shrink:0;justify-content:center;align-items:center;width:2.5rem;display:flex;position:relative;overflow:hidden}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media]{width:100%}[data-slot=attachment][data-size=sm] [data-slot=attachment-media]{width:2rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media]{border-radius:calc(var(--vh-radius) * .75);width:1.75rem}[data-slot=attachment][data-status=error] [data-slot=attachment-media]{background:color-mix(in oklab, var(--vh-error) 10%, transparent);color:var(--vh-error)}[data-slot=attachment-media] svg{pointer-events:none}[data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1rem;height:1rem}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1.5rem;height:1.5rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:.875rem;height:.875rem}[data-slot=attachment-media][data-kind=image]{opacity:.6}[data-slot=attachment]:is([data-status=done],[data-status=idle]) [data-slot=attachment-media][data-kind=image]{opacity:1}[data-slot=attachment-media][data-kind=image]>img{aspect-ratio:1;object-fit:cover;width:100%}[data-slot=attachment-content]{flex:1;min-width:0;max-width:100%;line-height:1.25}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-content]{padding-inline:.25rem}[data-slot=attachment-title]{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;font-weight:500;display:block;overflow:hidden}[data-slot=attachment-description]{color:var(--vh-muted);text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;margin-top:.125rem;font-size:.75rem;line-height:1rem;display:block;overflow:hidden}[data-slot=attachment][data-status=error] [data-slot=attachment-description]{color:color-mix(in oklab, var(--vh-error) 80%, transparent)}[data-slot=attachment-actions]{z-index:20;flex-shrink:0;align-items:center;display:flex;position:relative}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-actions]{gap:.25rem;position:absolute;top:.75rem;right:.75rem}[data-slot=attachment-action]{border-radius:calc(var(--vh-radius) * .75);color:var(--vh-text);cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;padding:.25rem;transition:color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=attachment-action]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}@media (hover:hover){[data-slot=attachment-action]:hover:not(:disabled){background:var(--vh-bg-elevated)}}[data-slot=attachment-action]:active:not(:disabled){background:var(--vh-bg-elevated)}[data-slot=attachment-action]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent)}[data-slot=attachment-action]:disabled{cursor:not-allowed;opacity:.5}[data-slot=attachment-trigger]{border-radius:inherit;cursor:pointer;z-index:10;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=attachment-group]{overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;gap:.75rem;min-width:0;padding-block:.25rem;scroll-padding-inline:.25rem;display:flex;overflow-x:auto}[data-slot=attachment-group]>[data-slot=attachment]{scroll-snap-align:start;flex:none}[data-slot=prompt-input]{width:100%}[data-slot=prompt-input-group]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 2);flex-direction:column;min-width:0;display:flex}[data-slot=prompt-input-attachments]{padding:.5rem .5rem 0}[data-slot=prompt-input-textarea]{color:var(--vh-highlighted);field-sizing:content;font:inherit;resize:none;background:0 0;border:0;width:100%;min-height:3.5rem;max-height:12rem;padding:.75rem .875rem .25rem;font-size:.875rem;line-height:1.5rem}@media (any-pointer:coarse){[data-slot=prompt-input-textarea]{font-size:max(1rem,16px)}}[data-slot=prompt-input-textarea]::placeholder{color:var(--vh-muted)}[data-slot=prompt-input-toolbar]{align-items:center;gap:.375rem;min-width:0;padding:.25rem .5rem .5rem;display:flex}[data-slot=prompt-input-spacer]{flex:1}@media (pointer:coarse){[data-slot=prompt-input-toolbar] button{position:relative}[data-slot=prompt-input-toolbar] button:before{content:"";position:absolute;inset:-8px}}[data-slot=prompt-input-attach],[data-slot=prompt-input-submit]{color:var(--vh-text);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:9999px;flex-shrink:0;justify-content:center;align-items:center;padding:.375rem;font-weight:500;transition-property:color,background-color,border-color,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=prompt-input-attach]>*,[data-slot=prompt-input-submit]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}[data-slot=prompt-input-attach]:focus-visible,[data-slot=prompt-input-submit]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent);outline-offset:0}[data-slot=prompt-input-attach]:disabled,[data-slot=prompt-input-submit]:disabled{cursor:not-allowed;opacity:.5}[data-slot=prompt-input-attach][data-variant=outline]{background:var(--vh-bg);box-shadow:inset 0 0 0 1px var(--vh-border-accented)}[data-slot=prompt-input-attach][data-variant=outline]:not(:disabled):hover{background:var(--vh-bg-elevated)}[data-slot=prompt-input-attach][data-variant=ghost]{color:var(--vh-muted)}[data-slot=prompt-input-attach][data-variant=ghost]:not(:disabled):hover{background:var(--vh-bg-elevated);color:var(--vh-text)}[data-slot=prompt-input-submit][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-slot=prompt-input-submit][data-variant=solid]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-highlighted) 90%, transparent)}[data-slot=prompt-input-submit][data-variant=soft]{background:var(--vh-bg-elevated)}[data-slot=prompt-input-submit][data-variant=soft]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-bg-accented) 75%, transparent)}[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation:1s linear infinite vh-prompt-input-spin}@media (prefers-reduced-motion:reduce){[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation-duration:3s}}[data-slot=swap-icon-item][data-spin]>*{animation:1s linear infinite swap-icon-spin}@keyframes swap-icon-spin{to{transform:rotate(360deg)}}@keyframes sync-status-pulse{50%{opacity:.35}}@keyframes connection-status-pulse{50%{opacity:.35}}[data-slot=progress]{color:var(--vh-highlighted);align-items:center;gap:.5rem;min-width:0;display:flex}[data-slot=drop-field]{--vh-drop-dot:var(--vh-highlighted);background:var(--vh-bg);border:1px solid var(--vh-border-accented);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;text-align:center;align-content:center;justify-items:center;gap:.125rem;min-height:10rem;padding:1rem;display:grid;overflow:hidden}[data-slot=drop-field][data-disabled]{cursor:not-allowed;opacity:.6}[data-slot=hold-to-delete] [data-part=icon]{flex:none;display:inline-flex}[data-slot=hold-to-delete] [data-part=icon]>svg{overflow:visible}[data-slot=hold-to-delete] [data-part=icon] [data-part=lid]{rotate:var(--vh-hold-lid,none);transform-box:fill-box;transform-origin:0 100%}[data-slot=hold-to-delete]{background:var(--vh-bg);border:1px solid color-mix(in oklch, var(--vh-error) calc(var(--vh-hold,0) * 100%), var(--vh-border-accented));border-radius:calc(var(--vh-radius) * .75);color:var(--vh-highlighted);cursor:pointer;justify-content:flex-start;align-items:center;gap:.375rem;height:1.75rem;padding:0 .625rem;font-size:.75rem;font-weight:500;display:inline-flex;overflow:visible}[data-slot=hold-to-delete][data-status=undo]{border-color:color-mix(in oklch, var(--vh-error) 40%, var(--vh-border-accented))}[data-slot=hold-to-delete][data-icon-only]:not([data-status=undo]){border-color:#0000;justify-content:center;width:1.75rem;padding:0}[data-slot=avatar-stack]{--vh-avatar-size:2rem;isolation:isolate;align-items:center;display:inline-flex}[data-slot=avatar-stack][data-size=sm]{--vh-avatar-size:1.5rem}[data-slot=avatar-stack][data-size=lg]{--vh-avatar-size:2.5rem}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){background:var(--vh-bg-accented);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-highlighted);font-size:calc(var(--vh-avatar-size) * .4);height:var(--vh-avatar-size);-webkit-user-select:none;user-select:none;width:var(--vh-avatar-size);border-radius:9999px;flex:none;justify-content:center;align-items:center;font-weight:500;line-height:1;display:inline-flex;overflow:hidden}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * -.15)}[data-slot=avatar-stack-count]{color:var(--vh-muted);font-size:calc(var(--vh-avatar-size) * .34)}[data-slot=avatar-stack][data-variant=outline] [data-slot=avatar-stack-item]{box-shadow:0 0 0 2px var(--vh-bg), 0 0 0 4px var(--vh-avatar-color,var(--vh-border))}[data-slot=avatar-stack][data-variant=outline] :is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * .05)}[data-slot=avatar-stack-image]{object-fit:cover;width:100%;height:100%}:is([data-slot=marker],[data-slot=marker-separator]){color:var(--vh-muted);text-align:left;align-items:center;gap:.5rem;width:100%;min-height:1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}:is([data-slot=marker],[data-slot=marker-separator]) :is(svg,.iconify):not([class*=size-]),[data-slot=marker-icon]{flex-shrink:0;width:1rem;height:1rem}:is(a[data-slot=marker],[data-slot=marker-content]>a){color:inherit;text-underline-offset:3px;text-decoration:underline}@media (hover:hover){:is(a[data-slot=marker],[data-slot=marker-content]>a):hover{color:var(--vh-highlighted)}}[data-slot=marker-separator]:before,[data-slot=marker-separator]:after{background:var(--vh-border);content:"";flex:1;min-width:0;height:1px}[data-slot=marker-separator]:before{margin-right:.25rem}[data-slot=marker-separator]:after{margin-left:.25rem}[data-slot=marker][data-variant=outline]{border-bottom:1px solid var(--vh-border);padding-bottom:.5rem}[data-slot=marker-content]{overflow-wrap:break-word;min-width:0}[data-slot=marker-separator] [data-slot=marker-content]{text-align:center;flex:none}[data-slot=tooltip-content]{border-radius:calc(var(--vh-radius) * .75);text-wrap:balance;max-width:20rem;font-size:.75rem;line-height:1rem}:is([data-slot=relative-time],[data-slot=comment-reply-time]){font-variant-numeric:tabular-nums}:is([data-slot=filter-search-leading],[data-slot=filter-search-trailing]){align-items:center;display:flex;position:absolute;inset-block:0}@keyframes vh-filter-search-spin{to{transform:rotate(360deg)}}:is([data-slot=code-view],[data-slot=file-diff],[data-slot=file-view],[data-slot=multi-file-diff],[data-slot=patch-diff],[data-slot=unresolved-file]){box-sizing:content-box;--diffs-addition-base:var(--vh-success);--diffs-bg:var(--vh-bg);--diffs-bg-addition:color-mix(in oklab, var(--vh-success) 12%, var(--vh-bg));--diffs-bg-addition-emphasis:color-mix(in oklab, var(--vh-success) 22%, var(--vh-bg));--diffs-bg-buffer:var(--vh-bg-muted);--diffs-bg-context:var(--vh-bg);--diffs-bg-context-gutter:color-mix(in oklab, var(--vh-bg-muted) 72%, var(--vh-bg));--diffs-bg-deletion:color-mix(in oklab, var(--vh-error) 12%, var(--vh-bg));--diffs-bg-deletion-emphasis:color-mix(in oklab, var(--vh-error) 22%, var(--vh-bg));--diffs-bg-separator:var(--vh-bg-muted);--diffs-deletion-base:var(--vh-error);--diffs-fg:var(--vh-text);--diffs-fg-conflict-marker:var(--vh-muted);--diffs-fg-number:var(--vh-dimmed);--diffs-font-family:var(--font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);--diffs-font-size:.8125rem;--diffs-header-font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);--diffs-modified-base:var(--vh-info);background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-text);min-height:4rem;display:block;overflow:hidden}:is([data-slot=markdown-editor-content],.vh-markdown-editor-content) .ProseMirror{outline:none;min-height:100%}:is([data-slot=editor-suggestion-label],[data-slot=editor-suggestion-description]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=comment-layer]{pointer-events:none;z-index:2147483000;position:fixed;inset:0}[data-slot=comment-layer]>*{pointer-events:auto}[data-slot=comment-layer-overlay]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M2 26V14a12 12 0 1 1 12 12H2z' fill='%23fff' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") 2 26,crosshair;position:absolute;inset:0}[data-slot=comment-layer-area-size]{background:color-mix(in oklab, var(--vh-comment-mark), black 10%);color:var(--vh-on-media,white);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:.25rem;padding:.0625rem .3125rem;font:500 .6875rem/1rem ui-monospace,SFMono-Regular,Menlo,monospace;position:absolute;top:calc(100% + .375rem);left:-2px}[data-slot=comment-margin]{pointer-events:none;width:18rem;position:absolute;top:0;right:1rem}[data-slot=comment-margin-card]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));box-sizing:border-box;color:var(--vh-text);font:inherit;pointer-events:auto;text-align:start;border:0;font-size:.875rem;position:absolute;left:0;right:0}button[data-slot=comment-margin-card]{cursor:pointer;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;display:flex}button[data-slot=comment-margin-card]:hover{background:var(--vh-bg-elevated)}button[data-slot=comment-margin-card][data-status=resolved]{opacity:.65}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{z-index:1;width:18rem;position:fixed;bottom:auto;left:auto;right:1rem}[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{flex-direction:column;max-height:calc(100dvh - 2rem);display:flex}[data-slot=comment-layer-popover][data-margin=true]>[data-slot=comment-thread]{flex-direction:column;flex:auto;min-height:0;display:flex}[data-slot=comment-layer-popover][data-margin=true] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}[data-slot=comment-margin-card] [data-slot=comment-list-text]{-webkit-line-clamp:3}[data-slot=comment-layer-item]{pointer-events:none;position:absolute}[data-slot=comment-layer-item]>*{pointer-events:auto}[data-slot=comment-pin]{translate:0 -100%}[data-slot=comment-pin] [data-slot=avatar-stack]{--vh-avatar-size:var(--vh-comment-pin-size);border-radius:inherit}[data-slot=comment-pin] [data-slot=avatar-stack-item]{border-radius:inherit;box-shadow:none;color:inherit;font-size:inherit;font-weight:inherit;background:0 0}[data-slot=comment-pin-number]{background:var(--vh-highlighted);color:var(--vh-inverted);text-align:center;border-radius:9999px;min-width:1rem;padding:.15rem .25rem;font-size:.625rem;font-weight:600;line-height:1;position:absolute;top:-.4rem;right:-.4rem}[data-slot=comment-selection-bar]{--vh-selection-bar-text:color-mix(in oklab, var(--vh-inverted) 82%, var(--vh-highlighted));background:var(--vh-highlighted);border:1px solid color-mix(in oklab, var(--vh-inverted) 12%, transparent);-webkit-font-smoothing:antialiased;border-radius:12px;align-items:center;gap:4px;width:max-content;padding:4px;font-size:12px;font-weight:500;line-height:1;display:flex;box-shadow:0 8px 24px oklab(0% none none/.25)}[data-slot=comment-selection-bar-action]{color:var(--vh-selection-bar-text);cursor:pointer;font:inherit;touch-action:manipulation;white-space:nowrap;background:0 0;border:0;border-radius:8px;align-items:center;gap:6px;height:28px;padding:0 10px;transition-property:background-color,color;transition-duration:.15s;transition-timing-function:cubic-bezier(.23,1,.32,1);display:inline-flex;position:relative}[data-slot=comment-selection-bar-action]:before{content:"";position:absolute;inset:-8px -2px}[data-slot=comment-selection-bar-action]>:first-child{flex:none;width:1.1em;height:1.1em}@media (hover:hover) and (pointer:fine){[data-slot=comment-selection-bar-action]:hover{background:color-mix(in oklab, var(--vh-inverted) 8%, transparent);color:var(--vh-inverted)}}[data-slot=comment-selection-bar-kbd]{font:inherit;opacity:.6;margin-inline-start:6px}[data-slot=comment-layer-popover]{--vh-comment-card-width:22.5rem;background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);max-width:calc(100vw - 1rem);width:var(--vh-comment-card-width);font-size:.875rem;position:absolute;top:.5rem;left:.5rem;overflow:visible}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]{left:auto;right:clamp(calc(var(--vh-comment-x,0px) + .5rem - 100vw), .5rem, calc(var(--vh-comment-x,100vw) - min(var(--vh-comment-card-width), 100vw - 1rem) - .5rem))}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]{top:auto;bottom:2.5rem}[data-slot=comment-layer-popover]:not([data-margin],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){--vh-comment-card-radius:1rem;--vh-comment-card-width:21.25rem;flex-direction:column;max-height:min(28rem,60dvh);display:flex;&>[data-slot=comment-thread]{flex:auto;min-height:0}& [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:.375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) .375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}[data-slot=comment-layer-item][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}@position-try --vh-comment-above{margin:0 0 2.5rem .5rem;position-area:top right}@position-try --vh-comment-above-left{margin:0 .5rem 2.5rem 0;position-area:top left}@position-try --vh-comment-below-inside{margin:.5rem .5rem 0;position-area:bottom span-all}@position-try --vh-comment-above-inside{margin:0 .5rem 2.5rem;position-area:top span-all}@supports (anchor-name:--a){[data-slot=comment-layer-item]{anchor-name:--vh-comment-spot;anchor-scope:--vh-comment-spot}[data-slot=comment-layer-item]:not([data-draft])>[data-slot=comment-layer-popover]:not([data-margin],[data-floating]){position-anchor:--vh-comment-spot;position-area:bottom right;position-try-fallbacks:flip-inline, --vh-comment-above, --vh-comment-above-left, --vh-comment-below-inside, --vh-comment-above-inside;margin:.5rem 0 0 .5rem;position:fixed;inset:auto}}[data-slot=comment-layer-popover][data-preview=true]{pointer-events:none;width:18rem}[data-slot=comment-layer-popover][data-floating=true]{position:fixed;inset:auto 1rem 4.5rem auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]{--vh-bubble-edge:var(--vh-border);--vh-bubble-radius:1.4375rem;border-radius:.375rem var(--vh-bubble-radius) var(--vh-bubble-radius);left:var(--vh-comment-draft-left,.5rem);box-shadow:0 0 0 1px var(--vh-bubble-edge), 0 2px 4px color-mix(in oklab, var(--vh-comment-shadow) calc(100% / 3), transparent), 0 10px 24px -6px var(--vh-comment-shadow);border:0;width:18rem;right:auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]:has(>[data-slot=comment-composer][data-size=sm]){--vh-bubble-radius:1.125rem}[data-slot=comment-layer-popover]:has([data-slot=comment-composer][data-frame=none] [data-slot=prompt-input-textarea]:focus-visible){--vh-bubble-edge:color-mix(in oklab, var(--vh-highlighted) 22%, transparent)}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) .375rem var(--vh-bubble-radius) var(--vh-bubble-radius)}[data-slot=comment-layer-item][data-draft=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer]>[data-slot=comment-page-island]{pointer-events:none;left:0;right:0;top:var(--vh-comment-island-top,max(12px, env(safe-area-inset-top)));place-items:start center;display:grid;position:fixed;&>*{grid-area:1/1}}[data-slot=comment-page-island-card]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);pointer-events:auto;border-radius:1rem;flex-direction:column;max-width:calc(100vw - 1.5rem);font-size:.875rem;line-height:1.25rem;display:flex}[data-slot=comment-page-island-card][data-open]{border-radius:.75rem;width:min(21.25rem,100vw - 1.5rem)}@media (hover:hover) and (pointer:fine){[data-slot=comment-page-island-card]:not([data-open]):hover{background:var(--vh-bg-elevated)}}[data-slot=comment-page-island-trigger]{color:inherit;cursor:pointer;font:inherit;font-variant-numeric:tabular-nums;text-align:start;white-space:nowrap;background:0 0;border:0;border-radius:1rem;flex:none;align-items:center;gap:.375rem;height:2rem;padding:0 .75rem 0 .4375rem;font-weight:500;display:flex;overflow:clip;&>svg,&>[data-slot=icon]{flex:none;width:1rem;height:1rem;margin-inline-start:.0625rem}}[data-slot=comment-page-island-label]{text-overflow:ellipsis;min-width:0;overflow:hidden}[data-slot=comment-page-island-faces]{flex:none;display:flex;& [data-slot=avatar-stack]{--vh-avatar-size:1.125rem}}[data-slot=comment-page-island-content]{flex-direction:column;min-height:0;max-height:min(26rem,60dvh - 2rem);display:flex;&>*{border-block-start:1px solid var(--vh-border)}&>[data-slot=comment-thread]{flex:auto;min-height:0}&>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-page-island-items]{flex:0 auto;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto;&>li:last-child>[data-slot=comment-page-island-item]{border-block-end:0}}[data-slot=comment-page-island-composer]{flex:none}[data-slot=comment-composer]{align-items:flex-start;gap:.5rem;padding:.5rem;display:flex}[data-slot=comment-composer-box]{flex:1;min-width:0;position:relative}[data-slot=comment-composer] [data-slot=prompt-input-textarea]{min-height:2.25rem;padding-block:.5rem .125rem}[data-slot=comment-composer][data-shake=flash] [data-slot=prompt-input-group]{animation:.45s both vh-comment-flash}@keyframes vh-comment-flash{0%,60%{border-color:var(--vh-error);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-error) 25%, transparent)}}[data-slot=comment-composer-mentions]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));z-index:1;width:100%;margin:.25rem 0 0;padding:.25rem;list-style:none;position:absolute;top:100%;left:0}[data-slot=comment-composer-mention]{border-radius:calc(var(--vh-radius) * .75);cursor:pointer;padding:.375rem .5rem}[data-slot=comment-composer-mention][aria-selected=true]{background:var(--vh-bg-accented)}[data-slot=comment-composer-mention-empty]{color:var(--vh-muted);margin:0;padding:.375rem .5rem}[data-slot=comment-composer-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-composer-status]{color:var(--vh-muted);margin:0;font-size:.75rem}[data-slot=comment-composer-status]:not(:empty){padding:.25rem .625rem .125rem}[data-slot=comment-thread]{flex-direction:column;display:flex}[data-slot=comment-thread-header]{border-block-end:1px solid var(--vh-border);align-items:center;gap:.25rem;padding:.375rem .5rem .375rem .75rem;display:flex}@media (pointer:coarse){:is([data-slot=comment-thread-header],[data-slot=comment-reply-actions])>:is(button,a){justify-content:center;min-width:2.75rem;min-height:2.75rem}}[data-slot=comment-thread-title]{color:var(--vh-highlighted);font-weight:600}[data-slot=comment-thread-spacer]{flex:1}[data-slot=comment-thread-messages]{flex-direction:column;max-height:22rem;display:flex;overflow-y:auto}[data-slot=comment-thread-quote]{border-inline-start:2px solid var(--vh-border);color:var(--vh-muted);margin:.75rem .75rem 0;padding-inline-start:.625rem}:is([data-slot=comment-thread-detached],[data-slot=comment-thread-count]){color:var(--vh-muted);margin:.5rem .75rem 0;font-size:.75rem}[data-slot=comment-reply]{gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-reply-content]{flex:1;min-width:0}[data-slot=comment-reply-header]{flex-wrap:wrap;align-items:center;gap:.375rem;min-height:1.5rem;display:flex}[data-slot=comment-reply-header]>[data-slot=avatar-stack]{margin-inline-end:.125rem}[data-slot=comment-reply-content]>:not([data-slot=comment-reply-header]){margin-inline-start:2rem}[data-slot=comment-reply-author]{color:var(--vh-highlighted);font-weight:500}:is([data-slot=comment-reply-time],[data-slot=comment-reply-edited],[data-slot=comment-reply-via]){color:var(--vh-muted);font-size:.75rem}[data-slot=comment-reply-via]>a{color:inherit;text-underline-offset:2px;text-decoration:underline}[data-slot=comment-reply-body]{overflow-wrap:anywhere}[data-slot=comment-reply-actions]{opacity:0;transition:opacity .12s;display:flex}[data-slot=comment-reply]:is(:hover,:focus-within) [data-slot=comment-reply-actions]{opacity:1}@media (any-pointer:coarse){[data-slot=comment-reply-actions]{opacity:1}}[data-slot=comment-reply][data-compact=true] [data-slot=comment-reply-body]{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-reply][data-editing=true] [data-slot=comment-composer]{padding:.25rem 0 0}[data-slot=comment-thread]:has([data-slot=comment-reply][data-editing=true])>[data-slot=comment-composer]{display:none}[data-slot=comment-toolbar]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));border-radius:9999px;align-items:center;gap:.25rem;padding:.25rem;display:flex;position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}[data-slot=comment-filters]{flex-wrap:wrap;gap:.25rem;display:flex}[data-slot=comment-list]{background:var(--vh-bg);border-inline-start:1px solid var(--vh-border);color:var(--vh-text);flex-direction:column;width:20rem;max-width:100vw;font-size:.875rem;display:flex;position:fixed;top:0;bottom:0;right:0;overflow-y:auto}[data-slot=comment-list-header]{border-block-end:1px solid var(--vh-border);flex-direction:column;gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-list-scopes]{gap:.25rem;display:flex}[data-slot=comment-list-empty]{color:var(--vh-muted);margin:0;padding:1rem .75rem}[data-slot=comment-list-items]{margin:0;padding:0;list-style:none}[data-slot=comment-list-item]{border-block-end:1px solid var(--vh-border);color:inherit;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;text-decoration:none;display:flex}[data-slot=comment-list-item]:is(:hover,[aria-current=true]){background:var(--vh-bg-elevated)}[data-slot=comment-list-item][data-status=resolved]{opacity:.65}[data-slot=comment-list-number]{color:var(--vh-muted);flex:none;min-width:1.25rem;padding-top:.25rem;font-size:.75rem}[data-slot=comment-list-body]{flex-direction:column;flex:1;gap:.125rem;min-width:0;display:flex}[data-slot=comment-list-text]{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-list-meta]{color:var(--vh-muted);flex-wrap:wrap;gap:.25rem .5rem;font-size:.75rem;display:flex}[data-slot=comment-reply-confirm]{flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}[data-slot=comment-reply-confirm]>p{flex-basis:100%;margin:0}[data-slot=comment-reply-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-mention]{background:var(--vh-comment-mention-bg,color-mix(in oklab, var(--vh-bg-accented) 80%, transparent));border-radius:calc(var(--vh-radius) * .5);color:var(--vh-highlighted);padding:0 .125rem;font-weight:500}[data-slot=comment-mention][data-self=true]{background:var(--vh-comment-mention-self-bg,color-mix(in oklab, var(--vh-warning) 25%, transparent))}[data-slot=comment-composer-extra]{margin-block-end:.375rem}[data-slot=comment-composer-mention]{align-items:center;gap:.5rem;display:flex}[data-slot=comment-composer-mention] [data-slot=avatar-stack]{--vh-avatar-size:1.25rem}[data-slot=comment-composer][data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 20%, transparent)}[data-slot=comment-composer] [data-slot=prompt-input-attachments]{flex-wrap:wrap;gap:.375rem;overflow:visible}[data-slot=comment-reply-attachments]{flex-wrap:wrap;margin-top:.5rem}[data-slot=comment-panel-groups]{flex:1;min-height:0;overflow-y:auto}[data-slot=comment-panel-groups] [data-slot=comment-panel-items]{flex:none;overflow:visible}[data-slot=comment-panel-group-header]{border-block-start:1px solid var(--vh-border);color:var(--vh-muted);margin:0;padding:.75rem .75rem .25rem;font-size:.75rem;font-weight:500}[data-slot=comment-reply-images]{gap:.25rem;margin-top:.5rem;display:grid;&[data-count="1"]{display:flex}&[data-count="2"]{grid-template-rows:7rem;grid-template-columns:1fr 1fr}&[data-count="3"]{grid-template-rows:4.75rem 4.75rem;grid-template-columns:2fr 1fr;&>[data-slot=comment-reply-image]:first-child{grid-row:span 2}}&[data-count="4"]{grid-template-rows:5.25rem 5.25rem;grid-template-columns:1fr 1fr}}[data-slot=comment-reply-image]{appearance:none;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * .75);color:var(--vh-muted);cursor:zoom-in;min-width:0;padding:0;display:flex;position:relative;overflow:hidden;& img{object-fit:cover;width:100%;height:100%;display:block}&[data-open=true]{visibility:hidden}}[data-count="1"]>[data-slot=comment-reply-image]{max-width:100%;& img{width:auto;max-width:100%;height:auto;max-height:10rem}}[data-slot=comment-reply-image-more]{background:color-mix(in oklab, var(--vh-highlighted) 55%, transparent);color:var(--vh-inverted);font-variant-numeric:tabular-nums;place-items:center;font-size:.9375rem;font-weight:500;display:grid;position:absolute;inset:0}[data-slot=comment-image-stack]{flex:none;align-self:flex-end;width:2.5rem;height:2rem;position:relative;&:not(:has([data-slot=comment-image-stack-card])){display:none}}[data-slot=comment-image-stack-cards]{position:absolute;inset:0}[data-slot=comment-image-stack-card]{--vh-stack-near:clamp(0, var(--vh-stack-depth), 2);background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .75);box-shadow:0 0 0 2px var(--vh-bg), 0 1px 3px color-mix(in oklab, var(--vh-highlighted) 18%, transparent);height:1.75rem;left:calc(.125rem + var(--vh-stack-near) * .1875rem);opacity:clamp(0, 3 - var(--vh-stack-depth), 1);top:calc(.25rem - var(--vh-stack-near) * .1875rem);width:1.75rem;z-index:calc(10 - var(--vh-stack-near));position:absolute;& .vh-image-preview{border-radius:inherit}& :is([data-part=comment-image-stack-remove],[data-slot=comment-image-stack-remove]){visibility:hidden;position:absolute;top:-.375rem;right:-.375rem}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-cards]{--vh-fan-width:min(var(--vh-fan-room), calc(var(--vh-fan-count) * 4rem + .5rem));box-sizing:border-box;bottom:100%;inset-inline:auto;left:clamp(var(--vh-fan-left), -.5rem, calc(var(--vh-fan-left) + var(--vh-fan-room) - var(--vh-fan-width)));width:var(--vh-fan-width);z-index:20;gap:.5rem;padding:.5rem;display:flex;top:auto;&[data-scrollable=true]{overflow-x:auto}&[data-below]{top:100%;bottom:auto}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-card]{opacity:1;z-index:auto;flex:none;width:3.5rem;height:3.5rem;position:relative;top:auto;left:auto;& :is([data-part=comment-image-stack-remove],[data-slot=comment-image-stack-remove]){visibility:visible}}[data-slot=comment-image-stack-toggle]{appearance:none;border-radius:calc(var(--vh-radius) * .75);cursor:pointer;z-index:15;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=comment-image-stack-count]{background:var(--vh-highlighted);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-inverted);font-variant-numeric:tabular-nums;pointer-events:none;text-align:center;z-index:16;border-radius:9999px;min-width:1.125rem;height:1.125rem;padding:0 .3125rem;font-size:.6875rem;font-weight:600;line-height:1.125rem;transition:opacity .15s;position:absolute;top:-.25rem;right:-.25rem}[data-fanned=true]>[data-slot=comment-image-stack-count]{opacity:0}[data-slot=comment-composer][data-layout=row][data-multiline=true] [data-slot=comment-image-stack]{order:1}[data-slot=comment-thread-actions]{align-items:center;gap:.25rem;display:flex}[data-slot=comment-thread-after]{padding:0 .75rem .75rem}[data-slot=comment-panel]{background:var(--vh-bg);color:var(--vh-text);flex-direction:column;min-height:0;font-size:.875rem;display:flex}[data-slot=comment-panel][data-variant=docked]{border-inline-start:1px solid var(--vh-border);height:100%}[data-slot=comment-panel][data-variant=floating]{border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));width:min(22.5rem,100vw - 1rem);max-height:min(36rem,100dvh - 2rem);overflow:hidden}[data-slot=comment-panel-header]{border-block-end:1px solid var(--vh-border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .5rem .5rem .75rem;display:flex}[data-slot=comment-panel-title]{color:var(--vh-highlighted);font-size:inherit;margin:0;font-weight:600}[data-slot=comment-panel-filters]{flex-wrap:wrap;flex:1;gap:.25rem;display:flex}[data-slot=comment-panel-actions]{flex-wrap:wrap;align-items:center;gap:.25rem;margin-block:-.25rem;display:flex}[data-slot=comment-panel-actions]:empty{display:none}[data-slot=comment-panel-items]{flex:1;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]){border:0;border-block-end:1px solid var(--vh-border);color:inherit;cursor:pointer;font:inherit;text-align:start;background:0 0;align-items:flex-start;gap:.5rem;width:100%;padding:.625rem .75rem;display:flex}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]):hover{background:var(--vh-bg-elevated)}[data-slot=comment-panel-empty]{color:var(--vh-muted);flex:1;margin:0;padding:1rem .75rem}[data-slot=comment-panel-composer],[data-slot=comment-thread]>[data-slot=comment-composer]{border-block-start:1px solid var(--vh-border)}[data-slot=comment-composer][data-layout=row]{padding:.25rem;& [data-slot=prompt-input-group]{box-shadow:none;background:0 0;border-color:#0000;border-radius:calc(1.125rem + 1px);flex-flow:wrap;align-items:flex-end;gap:.25rem;padding:.125rem}& [data-slot=prompt-input-attachments]{flex-basis:100%;padding:.25rem .25rem 0}& [data-slot=prompt-input-textarea]{flex:1;order:1;width:auto;min-width:0;min-height:2rem;padding:.25rem}& [data-slot=prompt-input-toolbar]{display:contents}& [data-slot=prompt-input-spacer]{display:none}& [data-slot=prompt-input-toolbar]>button:last-child{order:2}& [data-slot=prompt-input-toolbar]>button{justify-content:center;min-width:2rem;height:2rem}}[data-slot=comment-thread][data-size=sm]{font-size:.875rem;line-height:1.25rem}[data-slot=comment-thread][data-size=sm] [data-slot=comment-thread-quote]{margin-top:.5rem}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer]{border-block-start:0;& [data-slot=prompt-input-group]{background:var(--vh-bg-elevated);box-shadow:none;border-color:#0000}}[data-slot=comment-reply][data-size=sm]{padding:.5rem .75rem;position:relative;& [data-slot=comment-reply-header]{align-items:baseline}& [data-slot=comment-reply-header]>[data-slot=avatar-stack]{align-self:center}& [data-slot=comment-reply-author]{font-size:.875rem;line-height:1.5rem}& [data-slot=comment-reply-body]{--vh-typeset-leading:1.5;font-size:.875rem}}@media not (any-pointer:coarse){[data-slot=comment-reply][data-size=sm] [data-slot=comment-reply-actions]{background:var(--vh-bg);border-radius:var(--vh-radius);position:absolute;top:.375rem;right:.5rem}}[data-slot=comment-composer][data-size=sm] [data-slot=prompt-input-textarea]{min-height:2rem;padding:.375rem .625rem 0}[data-slot=comment-composer][data-size=sm][data-layout=row]{& [data-slot=prompt-input-group]{border-radius:calc(1rem + 1px)}& [data-slot=prompt-input-textarea]{min-height:1.75rem;padding:.21875rem .25rem;line-height:1.3125rem}& [data-slot=prompt-input-toolbar]>button{min-width:1.75rem;height:1.75rem}}[data-slot=comment-composer][data-layout=row][data-multiline=true]{& [data-slot=prompt-input-group]{row-gap:0}& [data-slot=prompt-input-attachments]{padding-bottom:.25rem}& [data-slot=prompt-input-textarea]{flex-basis:100%;order:0;padding-block-end:0;padding-inline:.5rem}& [data-slot=prompt-input-spacer]{display:block}@media (pointer:coarse){& [data-slot=prompt-input-toolbar]>button:before{inset-block-start:0}}}[data-slot=comment-panel-composer] [data-slot=comment-composer-mentions],[data-slot=comment-thread]>[data-slot=comment-composer] [data-slot=comment-composer-mentions]{margin:0 0 .25rem;top:auto;bottom:100%}[data-slot=comment-panel]>[data-slot=comment-thread]{flex:1;min-height:0}[data-slot=comment-panel]>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:1;max-height:none}[data-comment-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-comment-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-comment-button][data-size=sm]{font-size:.75rem}[data-comment-button][data-square]{padding:.375rem}[data-comment-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-comment-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-comment-button][data-variant=ghost]{color:var(--vh-muted)}[data-comment-button]:is([data-variant=ghost],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-comment-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-comment-button]:disabled{cursor:default;opacity:.4}[data-slot=comment-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-slot=message-scroller]{flex-direction:column;width:100%;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}[data-slot=message-scroller-viewport]{overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;width:100%;min-width:0;height:100%;min-height:0;overflow-y:auto}[data-slot=message-scroller-content]{flex-direction:column;gap:1.5rem;height:max-content;min-height:100%;display:flex}[data-slot=message-scroller-item]{flex-shrink:0;min-width:0}[data-slot=message-scroller-button]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;justify-content:center;align-items:center;width:2rem;height:2rem;transition:background-color .15s;display:flex;position:absolute;bottom:1rem;left:50%;transform:translate(-50%)}@media (hover:hover){[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated)}}[data-slot=message-scroller-button][hidden]{display:none}[data-slot=chat]{grid-template-rows:minmax(0,1fr);width:100%;min-width:0;height:100%;min-height:0;display:grid;position:relative;overflow:hidden}[data-slot=chat]>[data-slot=message-scroller-viewport]{overscroll-behavior-y:contain}[data-slot=chat]>[data-slot=message-scroller-viewport]>[data-slot=message-scroller-content]{max-width:48rem;padding:var(--vh-chat-content-padding,1.5rem 1rem 6rem);gap:1.25rem;margin-inline:auto}[data-slot=chat]>[data-slot=message-scroller-button]{background:var(--vh-bg-elevated);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-muted);font:inherit;letter-spacing:normal;white-space:nowrap;z-index:2;border:0;border-radius:999px;gap:.375rem;width:auto;padding:.25rem .75rem;font-size:.75rem;font-weight:500;line-height:1rem;transition:color .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out}[data-slot=chat]>[data-slot=message-scroller-button]>svg{flex:none;width:.875rem;height:.875rem}@media (hover:hover){[data-slot=chat]>[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated);color:var(--vh-text)}}[data-slot=chat]:has(>[data-slot=chat-composer])>[data-slot=message-scroller-button]{bottom:var(--vh-chat-scroll-button-offset,7rem)}@media (prefers-reduced-motion:reduce){[data-slot=chat]>[data-slot=message-scroller-viewport]{scroll-behavior:auto}}[data-slot=trace]{flex-direction:column;gap:.5rem;width:100%;min-width:0;display:flex}[data-slot=trace]>:has(>[data-slot=trace-line]){border-radius:calc(var(--vh-radius) * .75);text-align:left;width:fit-content;min-width:0;max-width:100%;display:flex}[data-trace-chevron] svg{stroke:currentColor;stroke-width:2px}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]){color:var(--vh-muted);cursor:pointer;height:var(--vh-agent-control);width:var(--vh-agent-control);background:0 0;border:0;border-radius:.5rem;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .15s ease-out,color .15s ease-out;display:inline-flex}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])>*{width:1rem;height:1rem}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]):hover{background:var(--vh-agent-hover);color:var(--vh-text)}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])[aria-pressed=true]{background:var(--vh-agent-pressed);color:var(--vh-highlighted)}.collaboration-carets__caret{pointer-events:none;word-break:normal;border-inline:1px solid;margin-inline:-1px;position:relative}.collaboration-carets__label{border-radius:calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) 0;color:var(--vh-inverted);inset-inline-start:-1px;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:.0625rem .375rem;font-size:.75rem;font-style:normal;font-weight:600;line-height:1.25;position:absolute;top:-1.4em}.vh-image-preview{appearance:none;aspect-ratio:4/3;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-muted);cursor:zoom-in;vertical-align:top;justify-content:center;align-items:center;width:13rem;max-width:100%;padding:0;display:inline-flex;overflow:hidden}.vh-image-preview img{object-fit:cover;width:100%;height:100%;display:block}.vh-image-preview--compact{aspect-ratio:1;border:0;width:100%;height:100%}.vh-image-unavailable{overflow-wrap:anywhere;padding:.5rem;font-size:.75rem}.vh-image-dialog__toolbar{color:var(--vh-on-media,var(--vh-highlighted));border:0;flex:none;align-items:center;gap:.25rem;padding-bottom:.5rem;display:flex}.vh-image-dialog__name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.75rem;overflow:hidden}.vh-image-dialog__image{border-radius:var(--vh-radius);object-fit:contain;max-width:92vw;max-height:calc(92dvh - 3rem);display:block}.vh-image-gallery__body{display:contents}.vh-image-gallery .vh-image-dialog__toolbar{transition:opacity .15s;&[data-closing=true]{opacity:0}}.vh-image-gallery__count{color:var(--vh-on-media,var(--vh-muted));font-variant-numeric:tabular-nums;opacity:.8;white-space:pre;margin-inline-end:.25rem;font-size:.75rem;display:inline-flex}.vh-image-gallery__stage{justify-content:center;display:flex;position:relative}.vh-image-gallery__step{z-index:1;border-radius:9999px;position:absolute;top:50%;transform:translateY(-50%);&.vh-image-gallery__step--previous{left:.5rem}&.vh-image-gallery__step--next{right:.5rem}}.vh-image-dialog__error{background:var(--vh-media-scrim,var(--vh-bg-elevated));border-radius:var(--vh-radius);color:var(--vh-on-media,var(--vh-highlighted));max-width:24rem;padding:2rem;font-size:.875rem}[data-slot=invocation] [data-activity-id][data-selected=true]{background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .85);scroll-margin-block:5rem}[data-slot=visually-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:where(:root,[class^=vh-ws-],[class*=\\ vh-ws-]){--vh-ws-font-mono:var(--font-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace);--vh-ws-code-bg:var(--vh-bg);--vh-ws-code-fg:var(--vh-highlighted);--vh-ws-code-cursor:var(--vh-highlighted);--vh-ws-code-selection:color-mix(in oklab, var(--vh-highlighted) 14%, transparent);--vh-ws-code-line:color-mix(in oklab, var(--vh-highlighted) 4%, transparent);--vh-ws-code-gutter:var(--vh-dimmed);--vh-ws-code-gutter-active:var(--vh-text);--vh-ws-code-comment:var(--vh-dimmed);--vh-ws-code-punctuation:var(--vh-muted);--vh-ws-terminal-bg:var(--vh-ws-code-bg);--vh-ws-terminal-fg:var(--vh-text);--vh-ws-ink:var(--ui-text-highlighted,CanvasText);--vh-ws-ink-inverted:var(--ui-bg,Canvas);--vh-ws-accent:var(--vh-focus,var(--ring,var(--vh-highlighted)))}:is(.vh-ws-preview-path,.vh-ws-input) input{font-family:var(--vh-ws-font-mono)}@keyframes vh-ws-pulse{50%{opacity:.35}}:where(.vh-ws-guide-content)>:where(p,ul,ol,blockquote){max-width:62ch;margin:0 0 10px}:where(.vh-ws-guide-content) :where(code:not(pre code)){background:var(--vh-bg-elevated);font:.75rem var(--vh-ws-font-mono);border-radius:4px;padding:1px 4px}}@layer utilities;:where([data-focus-ring]):has(:focus-visible){outline:2px solid var(--vh-focus,var(--vh-primary));outline-offset:2px}[data-slot=comment-composer][data-layout=row]{& [data-slot=prompt-input-textarea]:focus-visible{outline:none}&:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){border-color:color-mix(in oklab, var(--vh-highlighted) 22%, transparent);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-highlighted) 6%, transparent)}&[data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 14%, transparent)}&[data-size=sm]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none}}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer][data-layout=row]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){background:var(--vh-bg);border-color:var(--vh-border-accented)}[data-slot=comment-composer][data-frame=none]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none;border-color:#0000}@keyframes vh-prompt-input-spin{to{transform:rotate(360deg)}}[data-markdown-image] [data-markdown-image-action]{border-radius:calc(var(--vh-radius) / 2);color:var(--vh-on-media,var(--vh-highlighted));cursor:pointer;font:inherit;background:0 0;border:0;flex:none;justify-content:center;align-items:center;width:2rem;height:2rem;margin:0;padding:0;text-decoration:none;display:inline-flex}[data-markdown-image] [data-markdown-image-action] svg{width:1rem;height:1rem}@media (hover:hover){[data-markdown-image] [data-markdown-image-action]:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}}:where(:root,[data-slot],[class^=vh-],[class*=\\ vh-]){--vh-radius:var(--vh-ui-radius,calc(var(--ui-radius,.25rem) * 2));--vh-border:var(--vh-ui-border,var(--ui-border,color-mix(in oklab, currentColor 14%, transparent)));--vh-border-accented:var(--vh-ui-border-accented,var(--ui-border-accented,color-mix(in oklab, currentColor 24%, transparent)));--vh-muted:var(--vh-ui-muted,var(--ui-text-muted,color-mix(in oklab, currentColor 68%, transparent)));--vh-dimmed:var(--vh-ui-dimmed,var(--ui-text-dimmed,color-mix(in oklab, currentColor 68%, transparent)));--vh-text:var(--vh-ui-text,var(--ui-text,currentColor));--vh-bg:var(--vh-ui-bg,var(--ui-bg,Canvas));--vh-bg-muted:var(--vh-ui-bg-muted,var(--ui-bg-muted,color-mix(in oklab, Canvas 94%, currentColor)));--vh-bg-elevated:var(--vh-ui-bg-elevated,var(--ui-bg-elevated,color-mix(in oklab, Canvas 96%, currentColor)));--vh-bg-accented:var(--vh-ui-bg-accented,var(--ui-bg-accented,color-mix(in oklab, Canvas 90%, currentColor)));--vh-highlighted:var(--vh-ui-highlighted,var(--ui-text-highlighted,currentColor));--vh-inverted:var(--vh-ui-inverted,var(--ui-text-inverted,Canvas));--vh-primary:var(--vh-ui-primary,var(--ui-primary,var(--vh-highlighted)));--vh-ring:var(--vh-ui-ring,color-mix(in oklab, var(--vh-primary) 50%, transparent));--vh-error:var(--vh-ui-error,var(--ui-error,var(--vh-highlighted)));--vh-info:var(--vh-ui-info,var(--ui-info,var(--vh-highlighted)));--vh-success:var(--vh-ui-success,var(--ui-success,var(--vh-highlighted)));--vh-warning:var(--vh-ui-warning,var(--ui-warning,var(--vh-highlighted)))}.vh-image-overlay{background:rgb(from var(--vh-media-scrim,var(--vh-bg-elevated)) r g b / 80%);z-index:59;border:0;margin:0;padding:0;transition:opacity .15s;position:fixed;inset:0}.vh-image-overlay--closing{opacity:0}.vh-image-dialog{box-shadow:none;z-index:60;background:0 0;border:0;border-radius:0;flex-direction:column;gap:0;width:max-content;max-width:92vw;height:fit-content;max-height:92dvh;margin:auto;padding:0;display:flex;position:fixed;inset:0;overflow:visible}.vh-image-dialog__action{color:var(--vh-on-media,var(--vh-highlighted));flex:none}.vh-image-dialog__action:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}:is([data-part=comment-image-stack-remove],[data-slot=comment-image-stack-remove]){background:var(--vh-highlighted);box-shadow:0 1px 3px color-mix(in oklab, var(--vh-highlighted) 10%, transparent), 0 1px 2px -1px color-mix(in oklab, var(--vh-highlighted) 10%, transparent);color:var(--vh-inverted);border:0;border-radius:9999px;place-items:center;width:1.25rem;min-width:0;height:1.25rem;padding:0;display:grid;& :is(svg,.iconify){width:.75rem;height:.75rem}}`}));function sV(e){return typeof e==`string`&&e?e:void 0}function cV(e){let t=sV(e?.__name)??sV(e?.name);return t?{name:t}:void 0}function lV(){let e=[];for(let t of document.querySelectorAll(`[data-v-app], #__nuxt, #app`))t._vnode&&e.push(t);return e}function uV(e){let t=new Map,n=(e,r,i)=>{if(!e||typeof e!=`object`||i>4e3)return;let a=e;if(a.component){let e=cV(a.component.type);n(a.component.subTree,e?[...r,e]:r,i+1)}else if(a.el&&!t.has(a.el)&&t.set(a.el,r),a.suspense?.activeBranch&&n(a.suspense.activeBranch,r,i+1),Array.isArray(a.children))for(let e of a.children)n(e,r,i+1)};for(let e of lV())n(e._vnode,[],0);for(let n=e;n;n=n.parentElement){let e=t.get(n);if(e)return e.slice(-12)}return[]}function dV(){for(let e of lV()){let t=e.__vue_app__?.config?.globalProperties?.$router?.currentRoute?.value?.matched,n=t?.length?sV(t.at(-1)?.path):void 0;if(n)return n}}function fV(e,t){if(t===`a`)return e.hasAttribute(`href`)?`link`:void 0;if(t===`select`)return e.hasAttribute(`multiple`)||Number(e.getAttribute(`size`))>1?`listbox`:`combobox`;if(t===`input`){let t=e.getAttribute(`type`)?.toLowerCase()??`text`;switch(t){case`checkbox`:return`checkbox`;case`radio`:return`radio`;case`button`:case`submit`:case`reset`:case`image`:return`button`;case`range`:return`slider`;case`number`:return`spinbutton`;case`hidden`:case`password`:case`file`:case`color`:case`date`:case`datetime-local`:case`month`:case`time`:case`week`:return;default:{let n=e.getAttribute(`list`);return n&&e.ownerDocument.getElementById(n)?.localName===`datalist`?`combobox`:t===`search`?`searchbox`:`textbox`}}}return Object.hasOwn(hV,t)?hV[t]:void 0}function pV(e){let t=e.tagName.toLowerCase(),n={tag:t};e.id&&(n.id=e.id.slice(0,128));let r=e.closest(`[data-testid], [data-test], [data-cy]`),i=r?.getAttribute(`data-testid`)??r?.getAttribute(`data-test`)??r?.getAttribute(`data-cy`);i&&(n.testId=i.slice(0,128));let a=e.getAttribute(`role`)??fV(e,t);a&&(n.role=a.slice(0,64));let o=e.getAttribute(`aria-label`)??e.getAttribute(`alt`)??e.getAttribute(`title`)??e.textContent?.replace(/\s+/g,` `).trim();o&&(n.name=o.slice(0,120));let s=[...e.classList].slice(0,8).map(e=>e.slice(0,64));return s.length&&(n.classes=s),n}function mV(e){let t=new URL(location.href),n={url:`${t.origin}${t.pathname}`.slice(0,2048),environment:{viewport:{width:innerWidth,height:innerHeight},devicePixelRatio,userAgent:navigator.userAgent.slice(0,512),language:navigator.language,colorScheme:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}};document.title&&(n.title=document.title.slice(0,256));let r=dV();if(r&&(n.route=r.slice(0,256)),e){n.element=pV(e);let t=uV(e);t.length&&(n.components=t)}return n}var hV,gV=t((()=>{hV={button:`button`,h1:`heading`,h2:`heading`,h3:`heading`,h4:`heading`,h5:`heading`,h6:`heading`,img:`img`,nav:`navigation`,textarea:`textbox`}}));function _V(e){let t,n,r=0;async function i(i){r++;let a=t;if(!a)return;t=void 0,n?.();let{element:o,field:s,page:c,digest:l,original:u,initial:d}=a;o.contentEditable=`inherit`,o.removeAttribute(`data-vitehub-editing`);let f=(o.textContent??``).trim();if(!i){o.textContent=u;return}if(f===d.trim())return;let[p]=await ka.saveField({field:s,value:f,ifDigest:l},c);if(p)return o.textContent=u,e.failed(p);e.drafted(s),e.info(`Saved as a draft. Publish it in the Console.`)}async function a(a){let o=i(!0),s=r;if(await o,s!==r||!a.isConnected)return;let c=a.getAttribute(to);if(!c)return;let l=e.page(),[u,d]=await ka.field(c,l);if(s!==r||!a.isConnected)return;if(u)return e.failed(u);if(!d.editable||d.value===null){e.info(`This field is not plain text. Edit it in the Console.`);return}t={element:a,field:c,page:l,digest:d.digest,original:a.textContent??``,initial:d.value},a.textContent=d.value,a.setAttribute(`data-vitehub-editing`,``),a.contentEditable=`plaintext-only`,a.contentEditable!==`plaintext-only`&&(a.contentEditable=`true`),a.focus();let f=document.createRange();f.selectNodeContents(a),getSelection()?.removeAllRanges(),getSelection()?.addRange(f);let p=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),i(!0)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(!1))},m=()=>void i(!0);a.addEventListener(`keydown`,p),a.addEventListener(`blur`,m,{once:!0}),n=()=>{a.removeEventListener(`keydown`,p),a.removeEventListener(`blur`,m)}}return{start:a,finish:i,get element(){return t?.element}}}var vV=t((()=>{ro()}));function yV(e){let t=H(),n=e?.getRootNode(),r=(n instanceof ShadowRoot&&n.host instanceof HTMLElement?n.host:e)?.parentElement;if(!r)return t;let i=0,a=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{t.value=r.getAttribute(`edge`)===`top`&&!r.hidden?`${Math.round(r.getBoundingClientRect().bottom)+bV}px`:void 0})},o=new MutationObserver(a),s=typeof ResizeObserver==`function`?new ResizeObserver(a):void 0;return Pd(()=>{o.observe(r,{attributeFilter:[`edge`,`collapsed`,`hidden`,`style`]}),s?.observe(r),r.addEventListener(`transitionend`,a),addEventListener(`resize`,a,{passive:!0}),a()}),Ld(()=>{o.disconnect(),s?.disconnect(),r.removeEventListener(`transitionend`,a),removeEventListener(`resize`,a),cancelAnimationFrame(i)}),t}var bV,xV=t((()=>{Y(),bV=8})),SV=n({createContext:()=>WV,destroyContext:()=>dH,domToBlob:()=>AH,domToCanvas:()=>kH,domToDataUrl:()=>jH,domToForeignObjectSvg:()=>DH,domToImage:()=>NH,domToJpeg:()=>PH,domToPixel:()=>FH,domToPng:()=>IH,domToSvg:()=>MH,domToWebp:()=>LH,loadMedia:()=>RV,waitUntilLoad:()=>zV});function CV(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function wV(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function TV(e){let t=-1;HH||=wV();for(let n=0;n<e.length;n++)t=HH[(t^e[n])&255]^t>>>8;return t^-1}function EV(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===RH&&e[n-2]===zH&&e[n-1]===BH&&e[n]===VH)return n-3;return 0}function DV(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=RH,r[1]=zH,r[2]=BH,r[3]=VH,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=TV(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=EV(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function OV(e){let t=e.indexOf(UH);return t===-1&&(t=e.indexOf(WH)),t===-1&&(t=e.indexOf(GH)),t}function kV(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}function AV(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(qH&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!qH)return e;let n=jV().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function jV(e){return(e&&aU(e)?e?.ownerDocument:e)??window.document}function MV(e,t,n){let r=jV(n).createElementNS(wU,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function NV(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function PV(e,t=`image/png`,n=1){try{return await new Promise((r,i)=>{e.toBlob(e=>{e?r(e):i(Error(`Blob is null`))},t,n)})}catch(r){if(YH)return FV(e.toDataURL(t,n));throw r}}function FV(e){let[t,n]=e.split(`,`),r=t.match(/data:(.+);/)?.[1]??void 0,i=window.atob(n),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e+=1)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function IV(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}function LV(e,t){let n=jV(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function RV(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?LV(e,jV(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),pU(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?RV(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=sU(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(fU(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(fU(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function zV(e,t){lU(e)&&(fU(e)||pU(e)?await RV(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>RV(e,t)))))}function BV(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}function VV(e){let t=`${KH}[#${OU}]`;return OU++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&SU(...t)}}function HV(e){return{cache:e?`no-cache`:`force-cache`}}async function UV(e,t){return tU(e)?e:WV(e,{...t,autoDestruct:!0})}async function WV(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(qH?window.document:void 0),c=e.ownerDocument?.defaultView??(qH?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:HV(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:VV(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:GV(s),svgDefsElement:s?.createElementNS(wU,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:JH&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[kV(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await zV(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=KV(e,u);return u.width=d,u.height=f,u}function GV(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
152
155
|
.______background-clip--text {
|
|
153
156
|
background-clip: text;
|
|
154
157
|
-webkit-background-clip: text;
|
|
155
158
|
}
|
|
156
|
-
`);return t.appendChild(n),t}function
|
|
157
|
-
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}
|
|
158
|
-
`))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(
|
|
159
|
-
`)):o.push(
|
|
160
|
-
`))}))})}}}function
|
|
159
|
+
`);return t.appendChild(n),t}function KV(e,t){let{width:n,height:r}=t;if(aU(e)&&(!n||!r)){let t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute(`width`))||0,r=r||t.height||Number(e.getAttribute(`height`))||0}return{width:n,height:r}}async function qV(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await RV(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=JV(e.ownerDocument,t),l=()=>{try{c?.drawImage(o,0,0,s.width,s.height)}catch(e){t.log.warn(`Failed to drawImage`,e)}};if(l(),t.isEnable(`fixSvgXmlDecode`))for(let e=0;e<i;e++)await new Promise(t=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),t()},e+a)});return t.drawImageCount=0,n.timeEnd(`image to canvas`),s}function JV(e,t){let{width:n,height:r,scale:i,backgroundColor:a,maximumCanvasSize:o}=t,s=e.createElement(`canvas`);s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,o&&(s.width>o||s.height>o)&&(s.width>o&&s.height>o?s.width>s.height?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o):s.width>o?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o));let c=s.getContext(`2d`);return c&&a&&(c.fillStyle=a,c.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:c}}function YV(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return LV(t,e.ownerDocument)}catch(e){t.log.warn(`Failed to clone canvas`,e)}let n=e.cloneNode(!1),r=e.getContext(`2d`),i=n.getContext(`2d`);try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(e){t.log.warn(`Failed to clone canvas`,e)}return n}function XV(e,t){try{if(e?.contentDocument?.documentElement)return uH(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function ZV(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`),t}async function QV(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return LV(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin=`anonymous`,e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=!0;if(await RV(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?LV(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(e=>{n.addEventListener(`seeked`,e,{once:!0})});let a=r.createElement(`canvas`);a.width=e.offsetWidth,a.height=e.offsetHeight;try{let e=a.getContext(`2d`);e&&e.drawImage(n,0,0,a.width,a.height)}catch(r){return t.log.warn(`Failed to clone video`,r),e.poster?LV(e.poster,e.ownerDocument):n}return YV(a,t)}return n}function $V(e,t){return mU(e)?YV(e,t):xU(e)?XV(e,t):fU(e)?ZV(e):pU(e)?QV(e,t):e.cloneNode(!1)}function eH(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${DU()}`,t.width=`0`,t.height=`0`,t.style.visibility=`hidden`,t.style.position=`fixed`,n.body.appendChild(t),t.srcdoc=`<!DOCTYPE html><meta charset="UTF-8"><title></title><body>`,e.sandbox=t)}catch(t){e.log.warn(`Failed to getSandBox`,t)}}return t}function tH(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=oU(e)&&i!==`svg`,o=a?AU.map(t=>[t,e.getAttribute(t)]).filter(([,e])=>e!==null):[],s=[a&&`svg`,i,o.map((e,t)=>`${e}=${t}`).join(`,`),t].filter(Boolean).join(`:`);if(r.has(s))return r.get(s);let c=eH(n)?.contentWindow;if(!c)return new Map;let l=c?.document,u,d;a?(u=l.createElementNS(wU,`svg`),d=u.ownerDocument.createElementNS(u.namespaceURI,i),o.forEach(([e,t])=>{d.setAttributeNS(null,e,t)}),u.appendChild(d)):u=d=l.createElement(i),d.textContent=` `,l.body.appendChild(u);let f=c.getComputedStyle(d,t),p=new Map;for(let e=f.length,t=0;t<e;t++){let e=f.item(t);kU.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function nH(e,t,n){let r=new Map,i=[],a=new Map;if(n)for(let e of n)o(e);else for(let t=e.length,n=0;n<t;n++)o(e.item(n));for(let e=i.length,t=0;t<e;t++)a.get(i[t])?.forEach((e,t)=>r.set(t,e));function o(n){let o=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf(`-`),l=c>-1?n.substring(0,c):void 0;if(l){let e=a.get(l);e||(e=new Map,a.set(l,e)),e.set(n,[o,s])}(t.get(n)!==o||s)&&(l?i.push(l):r.set(n,[o,s]))}return r}function rH(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=tH(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=nH(c,l,a);u.delete(`transition-property`),u.delete(`all`),u.delete(`d`),u.delete(`content`),n&&(u.delete(`position`),u.delete(`margin-top`),u.delete(`margin-right`),u.delete(`margin-bottom`),u.delete(`margin-left`),u.delete(`margin-block-start`),u.delete(`margin-block-end`),u.delete(`margin-inline-start`),u.delete(`margin-inline-end`),u.set(`box-sizing`,[`border-box`,``])),u.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`),QH&&(u.has(`font-kerning`)||u.set(`font-kerning`,[`normal`,``]),(u.get(`overflow-x`)?.[0]===`hidden`||u.get(`overflow-y`)?.[0]===`hidden`)&&u.get(`text-overflow`)?.[0]===`ellipsis`&&e.scrollWidth===e.clientWidth&&u.set(`text-overflow`,[`clip`,``]));for(let e=s.length,t=0;t<e;t++)s.removeProperty(s.item(t));return u.forEach(([e,t],n)=>{s.setProperty(n,e,t)}),u}function iH(e,t){(hU(e)||gU(e)||yU(e))&&t.setAttribute(`value`,e.value)}function aH(e,t,n,r,i){let{ownerWindow:a,svgStyleElement:o,svgStyles:s,currentNodeStyle:c}=r;if(!o||!a)return;function l(n){let o=a.getComputedStyle(e,n),l=o.getPropertyValue(`content`);if(!l||l===`none`)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,``);let u=[DU()],d=tH(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=nH(o,d,r.includeStyleProperties);f.delete(`content`),f.delete(`-webkit-locale`),f.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`);let p=[`content: '${l}';`];if(f.forEach(([e,t],n)=>{p.push(`${n}: ${e}${t?` !important`:``};`)}),p.length===1)return;try{t.className=[t.className,...u].join(` `)}catch(e){r.log.warn(`Failed to copyPseudoClass`,e);return}let m=p.join(`
|
|
160
|
+
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}jU.forEach(l),n&&MU.forEach(l)}async function oH(e,t,n,r,i){if(aU(n)&&(_U(n)||vU(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=NU.has(t.nodeName)||NU.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await uH(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&cH(e,a),t.appendChild(a)}async function sH(e,t,n,r){let i=e.firstChild;aU(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=i;a;a=a.nextSibling)if(!uU(a)){if(aU(a)&&bU(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await oH(e,t,i[a],n,r)}else await oH(e,t,a,n,r)}}function cH(e,t){if(!lU(e)||!lU(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,a=new DOMMatrix(i),{a:o,b:s,c,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-n),a.a=o,a.b=s,a.c=c,a.d=l,t.style.transform=a.toString()}function lH(e,t){let{backgroundColor:n,width:r,height:i,style:a}=t,o=e.style;if(n&&o.setProperty(`background-color`,n,`important`),r&&o.setProperty(`width`,`${r}px`,`important`),i&&o.setProperty(`height`,`${i}px`,`important`),a)for(let e in a)o[e]=a[e]}async function uH(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&dU(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&aU(e)&&(lU(e)||oU(e))){let r=await $V(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];PU.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=rH(e,r,n,t);n&&lH(r,t);let a=!1;if(t.isEnable(`copyScrollbar`)){let t=[i.get(`overflow-x`)?.[0],i.get(`overflow-y`)?.[0]];a=t.includes(`scroll`)||(t.includes(`auto`)||t.includes(`overlay`))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let c=i.get(`text-transform`)?.[0],l=BV(i.get(`font-family`)?.[0]),u=l?e=>{c===`uppercase`?e=e.toUpperCase():c===`lowercase`?e=e.toLowerCase():c===`capitalize`&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach(t=>{let n=o.get(t);n||o.set(t,n=new Set),e.split(``).forEach(e=>n.add(e))})}:void 0;return aH(e,r,a,t,u),iH(e,r),pU(e)||await sH(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await sH(e,c,t),await s?.(c),c}function dH(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn(`Failed to destroyContext`,t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function fH(e){let{url:t,timeout:n,responseType:r,...i}=e,a=new AbortController,o=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...i}).then(e=>{if(!e.ok)throw Error(`Failed fetch, not 2xx response`,{cause:e});switch(r){case`arrayBuffer`:return e.arrayBuffer();case`dataUrl`:return e.blob().then(TU);default:return e.text()}}).finally(()=>clearTimeout(o))}function pH(e,t){let{url:n,requestType:r=`text`,responseType:i=`text`,imageDom:a}=t,o=n,{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:f,placeholderImage:p},font:m,workers:h,fontFamilies:g}=e;r===`image`&&($H||eU)&&e.drawImageCount++;let _=l.get(n);if(!_){f&&f instanceof RegExp&&f.test(o)&&(o+=(/\?/.test(o)?`&`:`?`)+new Date().getTime());let t=r.startsWith(`font`)&&m&&m.minify,v=new Set;t&&r.split(`;`)[1].split(`,`).forEach(e=>{g.has(e)&&g.get(e).forEach(e=>v.add(e))});let y=t&&v.size,b={url:o,timeout:s,responseType:y?`arrayBuffer`:i,headers:r===`image`?{accept:c}:void 0,...d};_={type:r,resolve:void 0,reject:void 0,response:null},_.response=(async()=>{if(u&&r===`image`){let e=await u(n);if(e)return e}return!$H&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):fH(b)})().catch(t=>{if(l.delete(n),r===`image`&&p)return e.log.warn(`Failed to fetch image base64, trying to use placeholder image`,o),typeof p==`string`?p:p(a);throw t}),l.set(n,_)}return _.response}async function mH(e,t,n,r){if(!hH(e))return e;for(let[i,a]of gH(e,t))try{let t=await pH(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(_H(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function hH(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function gH(e,t){let n=[];return e.replace(FU,(e,r,i)=>(n.push([i,AV(i,t)]),e)),n.filter(([e])=>!CU(e))}function _H(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function vH(e,t){return IU.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:(($H||eU)&&t.drawImageCount++,mH(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function yH(e,t){if(fU(e)){let n=e.currentSrc||e.src;if(!CU(n))return[pH(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];($H||eU)&&t.drawImageCount++}else if(oU(e)&&!CU(e.href.baseVal)){let n=e.href.baseVal;return[pH(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function bH(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!i)return[];let[a,o]=i.split(`#`);if(o){let i=`#${o}`,s=t.shadowRoots.reduce((e,t)=>e??t.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(a&&e.setAttribute(`href`,i),r?.querySelector(i))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(a)return[pH(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function xH(e,t){let{tasks:n}=t;aU(e)&&((fU(e)||sU(e))&&n.push(...yH(e,t)),cU(e)&&n.push(...bH(e,t))),lU(e)&&n.push(...vH(e.style,t)),e.childNodes.forEach(e=>{xH(e,t)})}async function SH(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:a,tasks:o,font:s}=t;if(n&&r&&i.size){if(s&&s.cssText){let e=wH(s.cssText,t);r.appendChild(n.createTextNode(`${e}
|
|
161
|
+
`))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(rU(e)){let n=e.href,r=``;try{r=await pH(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(FU,(e,t,r)=>e.replace(r,AV(r,n)));for(let e of CH(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn(`Error inserting rule from remote css import`,{rule:e,error:n})}}}))),l.cssRules.length&&e.push(l);let u=[];e.forEach(e=>{TH(e.cssRules,u)}),u.filter(e=>nU(e)&&hH(e.style.getPropertyValue(`src`))&&BV(e.style.getPropertyValue(`font-family`))?.some(e=>i.has(e))).forEach(e=>{let i=e,s=a.get(i.cssText);s?r.appendChild(n.createTextNode(`${s}
|
|
162
|
+
`)):o.push(mH(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=wH(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
|
|
163
|
+
`))}))})}}}function CH(e){if(e==null)return[];let t=[],n=e.replace(LU,``);for(;;){let e=RU.exec(n);if(!e)break;t.push(e[0])}n=n.replace(RU,``);let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=r.exec(n);if(e)i.lastIndex=r.lastIndex;else if(e=i.exec(n),e)r.lastIndex=i.lastIndex;else break;t.push(e[0])}return t}function wH(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(BU,e=>{for(;;){let[t,,n]=zU.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function TH(e,t=[]){for(let n of Array.from(e))iU(n)?t.push(...TH(n.cssRules)):`cssRules`in n?TH(n.cssRules,t):t.push(n);return t}function EH(e){return VU.test(e.innerHTML)}async function DH(e,t){let n=await UV(e,t);if(aU(n.node)&&oU(n.node)&&!EH(n.node))return n.node;let{ownerDocument:r,log:i,tasks:a,svgStyleElement:o,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:m}=n;i.time(`clone node`);let h=await uH(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
|
|
161
164
|
`)} {
|
|
162
165
|
${n}
|
|
163
166
|
}
|
|
164
|
-
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&_U(h)&&(i.time(`embed web font`),await PH(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),NH(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=BH(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&CH(n),await m?.(y),y}function BH(e,t){let{width:n,height:r}=t,i=WV(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function VH(e,t){let n=await tH(e,t),r=await zH(n),i=GV(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=rH(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(IU,`defs`),n.svgStyles.clear()),await aH(YV(i,r.ownerDocument),n)}async function HH(e,t){let n=await tH(e,t),{log:r,type:i,quality:a,dpi:o}=n,s=await VH(n);r.time(`canvas to blob`);let c=await KV(s,i,a);if([`image/png`,`image/jpeg`].includes(i)&&o){let e=await RU(c.slice(0,33)),t=new Uint8Array(e);return i===`image/png`?t=zV(t,o):i===`image/jpeg`&&(t=FV(t,o)),r.timeEnd(`canvas to blob`),new Blob([t,c.slice(33)],{type:i})}return r.timeEnd(`canvas to blob`),c}async function UH(e,t){let n=await tH(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await VH(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&sU&&cU){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=BV(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?zV(u,o,r):FV(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function WH(e,t){let n=await tH(e,t),{width:r,height:i,ownerDocument:a}=n,o=await UH(n),s=WV(r,i,a),c=s.ownerDocument.createElementNS(s.namespaceURI,`image`);return c.setAttributeNS(null,`href`,o),c.setAttributeNS(null,`height`,`100%`),c.setAttributeNS(null,`width`,`100%`),s.appendChild(c),GV(s,n.isEnable(`removeControlCharacter`))}async function GH(e,t){let n=await tH(e,t),{ownerDocument:r,width:i,height:a,scale:o,type:s}=n,c=YV(s===`image/svg+xml`?await WH(n):await UH(n),r);return c.width=Math.floor(i*o),c.height=Math.floor(a*o),c.style.width=`${i}px`,c.style.height=`${a}px`,c}async function KH(e,t){return UH(await tH(e,{...t,type:`image/jpeg`}))}async function qH(e,t){let n=await VH(await tH(e,t));return n.getContext(`2d`).getImageData(0,0,n.width,n.height).data}async function JH(e,t){return UH(await tH(e,{...t,type:`image/png`}))}async function YH(e,t){return UH(await tH(e,{...t,type:`image/webp`}))}var XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW=t((()=>{XH=112,ZH=72,QH=89,$H=115,tU=`AAlwSFlz`,nU=`AAAJcEhZ`,rU=`AAAACXBI`,iU=`[modern-screenshot]`,aU=typeof window<`u`,oU=aU&&`Worker`in window,sU=aU&&`atob`in window,cU=aU&&`btoa`in window,lU=aU?window.navigator?.userAgent:``,uU=lU.includes(`Chrome`),dU=lU.includes(`AppleWebKit`)&&!uU,fU=lU.includes(`Firefox`),pU=e=>e&&`__CONTEXT__`in e,mU=e=>e.constructor.name===`CSSFontFaceRule`,hU=e=>e.constructor.name===`CSSImportRule`,gU=e=>e.constructor.name===`CSSLayerBlockRule`,_U=e=>e.nodeType===1,vU=e=>typeof e.className==`object`,yU=e=>e.tagName===`image`,bU=e=>e.tagName===`use`,xU=e=>_U(e)&&e.style!==void 0&&!vU(e),SU=e=>e.nodeType===8,CU=e=>e.nodeType===3,wU=e=>e.tagName===`IMG`,TU=e=>e.tagName===`VIDEO`,EU=e=>e.tagName===`CANVAS`,DU=e=>e.tagName===`TEXTAREA`,OU=e=>e.tagName===`INPUT`,kU=e=>e.tagName===`STYLE`,AU=e=>e.tagName===`SCRIPT`,jU=e=>e.tagName===`SELECT`,MU=e=>e.tagName===`SLOT`,NU=e=>e.tagName===`IFRAME`,PU=(...e)=>console.warn(iU,...e),FU=e=>e.startsWith(`data:`),IU=`http://www.w3.org/2000/svg`,LU=e=>JV(e,`dataUrl`),RU=e=>JV(e,`arrayBuffer`),zU=function(){let e=0,t=()=>`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}(),BU=0,VU=[`width`,`height`,`-webkit-text-fill-color`],HU=[`stroke`,`fill`],UU=[`::before`,`::after`],WU=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`],GU=new Set([`symbol`]),KU=/^[\w-:]+$/,qU=/url\((['"]?)([^'"]+?)\1\)/g,JU=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`],YU=/(\/\*[\s\S]*?\*\/)/g,XU=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi,ZU=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,QU=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g,$U=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i}));function tW(e){let[t,...n]=e;if(!t)return``;if(n.length===0)return`M${DW(t)}l0.1 0`;let r=`M${DW(t)}`;for(let t=1;t<e.length-1;t++){let n=e[t],i=e[t+1];r+=`Q${DW(n)} ${DW([(n[0]+i[0])/2,(n[1]+i[1])/2])}`}return`${r}L${DW(e[e.length-1])}`}function nW(e,t,n=!1){let r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i)||1,o=n?0:Math.min(18,a*.08),s=[(e[0]+t[0])/2-i/a*o,(e[1]+t[1])/2+r/a*o],c=Math.atan2(t[1]-s[1],t[0]-s[0]),l=Math.min(14,a*.4)+yW.arrow.width,u=e=>[t[0]-l*Math.cos(c+e),t[1]-l*Math.sin(c+e)];return{control:s,left:u(-.5),right:u(.5)}}function rW(e){if(SW(e)!==`arrow`)return tW(e.points);let t=e.points[0],n=e.points[e.points.length-1];if(!t||!n)return``;let{control:r,left:i,right:a}=nW(t,n,e.straight);return`M${DW(t)}Q${DW(r)} ${DW(n)}M${DW(i)}L${DW(n)}L${DW(a)}`}function iW(e){return OW??=document.createElement(`canvas`).getContext(`2d`),OW?(OW.font=wW,OW.measureText(e).width):e.length*yW.text.width*.55}function aW(e){let t=yW.text.width,n=Math.round(t*.45),r=Math.round(t*1.5),[i,a]=e.points[0]??[0,0];return{left:i,top:a-r/2,width:Math.ceil(iW(e.text??``))+n*2,height:r,padding:n,radius:Math.round(t*.35)}}function oW(e){let[t,n,r]=[1,3,5].map(t=>{let n=Number.parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r>.4?`#0a0a0a`:`#ffffff`}function sW(e){let t=e.flatMap(e=>{if(SW(e)===`text`){let t=aW(e);return[{left:t.left,top:t.top,width:t.width,height:t.height+2}]}let t=CW(e)/2,n=e.points,r=e.points[0],i=e.points[e.points.length-1];if(SW(e)===`arrow`&&r&&i){let{control:t,left:a,right:o}=nW(r,i,e.straight);n=[r,t,i,a,o]}return n.map(([e,n])=>({left:e-t,top:n-t,width:t*2,height:t*2}))});if(t.length===0)return;let n=Math.min(...t.map(e=>e.left)),r=Math.min(...t.map(e=>e.top)),i=Math.max(...t.map(e=>e.left+e.width)),a=Math.max(...t.map(e=>e.top+e.height));return{left:n,top:r,width:i-n,height:a-r}}function cW(e,t){if(e===`arrow`)return`crosshair`;if(e===`text`)return`text`;let n=yW[e].width,r=Math.max(8,n+4),i=`<svg xmlns="${xW}" width="${r}" height="${r}"><circle cx="${r/2}" cy="${r/2}" r="${Math.max(2,n/2)}" fill="${t}" fill-opacity="${e===`marker`?.4:.9}" stroke="#0a0a0a" stroke-opacity=".55"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}") ${r/2} ${r/2}, crosshair`}function lW(e,t){let n=aW(t),r=document.createElementNS(xW,`rect`),i=document.createElementNS(xW,`text`);for(let[e,t]of Object.entries({x:n.left,y:n.top,width:n.width,height:n.height,rx:n.radius}))r.setAttribute(e,String(t));r.setAttribute(`fill`,t.color),i.setAttribute(`x`,String(n.left+n.padding)),i.setAttribute(`y`,String(t.points[0][1])),i.setAttribute(`dominant-baseline`,`central`),i.setAttribute(`fill`,oW(t.color)),i.textContent=t.text??``,e.replaceChildren(r,i)}function uW(e,t){if(SW(e)===`text`){let n=document.createElementNS(xW,`g`);return n.setAttribute(`class`,`label`),lW(n,e),t.append(n),n}let n=document.createElementNS(xW,`path`);return n.setAttribute(`class`,SW(e)),n.setAttribute(`stroke`,e.color),n.setAttribute(`d`,rW(e)),t.append(n),n}function dW(e,t){for(let n of t){if(e.save(),SW(n)===`text`){let t=aW(n),r=e.getTransform().a;e.shadowColor=`rgb(0 0 0 / 30%)`,e.shadowBlur=1.5*r,e.shadowOffsetY=r,e.fillStyle=n.color,e.beginPath(),e.roundRect(t.left,t.top,t.width,t.height,t.radius),e.fill(),e.shadowColor=`transparent`,e.font=wW,e.textBaseline=`middle`,e.fillStyle=oW(n.color),e.fillText(n.text??``,t.left+t.padding,n.points[0][1])}else{let t=SW(n)===`marker`;e.globalAlpha=t?.4:1,e.globalCompositeOperation=t?`multiply`:`source-over`,e.strokeStyle=n.color,e.lineWidth=CW(n),e.lineCap=t?`butt`:`round`,e.lineJoin=`round`,e.stroke(new Path2D(rW(n)))}e.restore()}}function fW(e){let t=document.createElement(`vitehub-marker`);t.setAttribute(`data-comments-ui`,``);let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=EW;let i=document.createElement(`div`);i.className=`layer`;let a=document.createElementNS(xW,`svg`);i.append(a),n.append(r,i),document.documentElement.append(t);let o=[],s,c,l,u=()=>{if(!l)return;let{input:e,stroke:t}=l,n=aW({...t,text:e.value||` `}),r=(t,n)=>e.style.setProperty(t,n);r(`left`,`${n.left}px`),r(`top`,`${n.top}px`),r(`width`,`${n.width+2}px`),r(`height`,`${n.height}px`),r(`padding`,`0 ${n.padding}px`),r(`border-radius`,`${n.radius}px`),r(`background`,t.color),r(`color`,oW(t.color))},d=()=>{if(!l)return;let{input:t,stroke:n,label:r}=l;l=void 0;let i=t.value.trim();if(t.remove(),r)i?(r.text=i,r.color=n.color,lW(r.element,r),r.element.removeAttribute(`visibility`)):o.splice(o.indexOf(r),1)[0]?.element.remove();else{if(!i)return;o.push({...n,text:i,element:uW({...n,text:i},a)})}e.onChange()},f=(e,t)=>{let n=document.createElement(`input`);n.type=`text`,n.maxLength=200,n.spellcheck=!1,n.value=e.text??``,n.setAttribute(`aria-label`,`Label`),n.setAttribute(`enterkeyhint`,`done`),l={input:n,stroke:{...e},label:t},u(),t?.element.setAttribute(`visibility`,`hidden`),n.addEventListener(`input`,u),n.addEventListener(`blur`,d),i.append(n),n.focus({preventScroll:!0}),t&&n.select()},p=t=>{l&&t.composedPath()[0]===l.input&&(t.stopPropagation(),t.isComposing||((t.key===`PageUp`||t.key===`PageDown`)&&t.preventDefault(),(t.key===`Enter`||t.key===`Escape`)&&(t.preventDefault(),d(),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&e.onSubmit?.())))};addEventListener(`keydown`,p,!0);let m=(e,t)=>o.findLast(n=>{if(SW(n)!==`text`)return!1;let r=aW(n);return e>=r.left-4&&e<=r.left+r.width+4&&t>=r.top-4&&t<=r.top+r.height+4}),h=()=>{i.style.cursor=cW(e.tip(),e.color()),l&&l.stroke.color!==e.color()&&(l.stroke.color=e.color(),u())};h(),i.addEventListener(`pointerdown`,t=>{if(l&&t.composedPath().includes(l.input)||t.button!==0||i.hasAttribute(`data-frozen`))return;if(t.preventDefault(),l)return d();i.setPointerCapture(t.pointerId);let n=e.tip(),r=e.color();if(n===`text`){let e=m(t.clientX,t.clientY);c={label:e,from:[t.clientX,t.clientY],at:e?.points[0],moved:!1,color:r};return}let o={tip:n,color:r,points:[[t.clientX,t.clientY]]};s={...o,element:uW(o,a)}}),i.addEventListener(`pointermove`,e=>{if(c){let{label:t,from:n,at:r}=c;if(!t||!r)return;let i=e.clientX-n[0],a=e.clientY-n[1];if(!c.moved&&Math.hypot(i,a)<3)return;c.moved=!0,t.points=[[r[0]+i,r[1]+a]],lW(t.element,t);return}if(!s)return;let t=[e.clientX,e.clientY],n=s.points[0];if(s.tip===`arrow`||e.shiftKey)e.shiftKey?s.straight=!0:delete s.straight,s.points=[n,s.tip===`marker`&&e.shiftKey?[t[0],n[1]]:t];else{let e=s.points[s.points.length-1];Math.hypot(t[0]-e[0],t[1]-e[1])>2&&s.points.push(t)}s.element.setAttribute(`d`,rW(s))});let g=t=>{if(c){let{label:n,from:r,moved:i,color:a}=c;if(c=void 0,t.type===`pointercancel`)return;if(n){i?e.onChange():f(n,n);return}return f({tip:`text`,color:a,points:[[r[0]-Math.round(yW.text.width*.45),r[1]]],text:``})}if(!s)return;let n=s;s=void 0;let r=n.points[0],i=n.points[n.points.length-1];if(n.tip===`arrow`&&Math.hypot(i[0]-r[0],i[1]-r[1])<10)return n.element.remove();o.push(n),e.onChange()};i.addEventListener(`pointerup`,g),i.addEventListener(`pointercancel`,g);for(let e of[`wheel`,`touchmove`])i.addEventListener(e,e=>e.preventDefault(),{passive:!1});return{strokes:()=>o.map(e=>{let t={tip:e.tip,color:e.color,points:e.points.map(([e,t])=>[e,t])};return e.straight&&(t.straight=!0),e.text!==void 0&&(t.text=e.text),t}),restyle:h,commit:d,undo(){d(),o.pop()?.element.remove(),e.onChange()},freeze(){d(),t.setAttribute(`frozen`,``),i.setAttribute(`data-frozen`,``),Object.assign(i.style,{left:`${scrollX}px`,top:`${scrollY}px`,width:`${innerWidth}px`,height:`${innerHeight}px`,cursor:``})},remove(){removeEventListener(`keydown`,p,!0),l&&=(l.input.removeEventListener(`blur`,d),void 0),t.remove()}}}function pW(){for(let e of[document.documentElement,document.body]){let t=e?getComputedStyle(e).backgroundColor:``;if(t&&t!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(t))return t}return`#ffffff`}function mW(e){return e.position!==`static`||e.transform!==`none`||e.filter!==`none`||e.perspective!==`none`||/paint|layout|strict|content/.test(e.contain)||/transform|perspective|filter/.test(e.willChange)}function hW(e){for(let t=e.parentElement;t&&t!==document.documentElement;t=t.parentElement){if(mW(getComputedStyle(t)))return t;let e=t.parentElement;if(e&&(e.scrollTop||e.scrollLeft))return t}}function gW(e){let t=`data-vitehub-pin`,n=[],r=document.createTreeWalker(document.documentElement,NodeFilter.SHOW_ELEMENT);for(let t=r.nextNode();t;t=r.nextNode()){if(!(t instanceof HTMLElement)||e(t))continue;let r=getComputedStyle(t);if(r.position!==`fixed`&&r.position!==`sticky`||r.visibility===`hidden`)continue;let i=t.getBoundingClientRect();i.bottom<=0||i.right<=0||i.top>=innerHeight||i.left>=innerWidth||n.push({element:t,sticky:r.position===`sticky`,rect:i})}for(let e of n.filter(e=>e.sticky)){let t=e.element.getAttribute(`style`);e.element.style.setProperty(`position`,`static`,`important`),e.from=e.element.getBoundingClientRect(),e.element.style.removeProperty(`position`),e.element.getAttribute(`style`)!==t&&(t===null?e.element.removeAttribute(`style`):e.element.setAttribute(`style`,t))}return n.forEach((e,n)=>{if(!e.sticky){let t=hW(e.element),n=t?.getBoundingClientRect(),r=e.element.parentElement;e.left=e.rect.left-(t&&n?n.left+t.clientLeft:0)+(r?.scrollLeft??0),e.top=e.rect.top-(t&&n?n.top+t.clientTop:0)+(r?.scrollTop??0)}e.element.setAttribute(t,String(n))}),{apply(e){if(!(e instanceof HTMLElement)||!e.hasAttribute(t))return;let r=n[Number(e.getAttribute(t))];if(e.removeAttribute(t),!r)return;let i=(t,n)=>e.style.setProperty(t,n,`important`);for(let t of[`inset`,`right`,`bottom`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`])e.style.removeProperty(t);if(r.sticky&&r.from)i(`position`,`relative`),i(`left`,`${r.rect.left-r.from.left}px`),i(`top`,`${r.rect.top-r.from.top}px`);else{i(`position`,`absolute`),i(`left`,`${r.left}px`),i(`top`,`${r.top}px`),i(`width`,`${r.rect.width}px`),i(`height`,`${r.rect.height}px`),i(`margin`,`0`),i(`box-sizing`,`border-box`);for(let e of[`transform`,`translate`,`rotate`,`scale`])i(e,`none`)}},release(){for(let e of n)e.element.removeAttribute(t)}}}function _W(e){let t=new Map,n=``;for(let r of e.querySelectorAll(`[style]`)){if(r.namespaceURI!==`http://www.w3.org/1999/xhtml`||r.closest(`defs, symbol`))continue;let e=r.getAttribute(`style`),i=t.get(e);if(!t.has(e)){let a=``;for(let e=0;e<r.style.length;e++){let t=r.style.item(e),n=r.style.getPropertyValue(t);if(!n){a=void 0;break}a+=`${t}:${n}!important;`}i=a===void 0?void 0:`_s${t.size.toString(36)}`,t.set(e,i),i&&(n+=`.${i}{${a}}\n`)}i&&(r.removeAttribute(`style`),r.classList.add(i))}let r=e.firstElementChild;(r?.localName===`style`?r:e.insertBefore(document.createElement(`style`),r)).append(n)}async function vW(e,t){let n=gW(t);try{let{domToCanvas:r}=await Ua(async()=>{let{domToCanvas:e}=await Promise.resolve().then(()=>(eW(),PV));return{domToCanvas:e}},[],import.meta.url),i=Math.min(devicePixelRatio||1,2),a=await r(document.documentElement,{width:innerWidth,height:innerHeight,scale:i,backgroundColor:pW(),filter:e=>!t(e),features:{restoreScrollPosition:!0},onCloneEachNode:e=>n.apply(e),onCreateForeignObjectSvg:_W,timeout:3e3}),o=a.getContext(`2d`);return o?(o.setTransform(i,0,0,i,0,0),dW(o,e),await new Promise(e=>a.toBlob(t=>e(t??void 0),`image/webp`,.85))):void 0}catch{return}finally{n.release()}}var yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW=t((()=>{Wa(),yW={marker:{label:`Marker`,key:`B`,width:14},pen:{label:`Pen`,key:`P`,width:3},arrow:{label:`Arrow`,key:`A`,width:3},text:{label:`Text`,key:`T`,width:20}},bW={pink:`#ec4899`,amber:`#f59e0b`,blue:`#2563eb`,green:`#16a34a`},xW=`http://www.w3.org/2000/svg`,SW=e=>e.tip??`marker`,CW=e=>yW[SW(e)].width,wW=`600 ${yW.text.width}px ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`,TW=`0 1px 1.5px rgb(0 0 0 / 30%)`,EW=`:host{position:absolute;left:0;top:0;width:0;height:0;z-index:2147482999}
|
|
167
|
+
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&aU(h)&&(i.time(`embed web font`),await SH(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),xH(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=OH(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&dH(n),await m?.(y),y}function OH(e,t){let{width:n,height:r}=t,i=MV(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function kH(e,t){let n=await UV(e,t),r=await DH(n),i=NV(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=GV(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(wU,`defs`),n.svgStyles.clear()),await qV(LV(i,r.ownerDocument),n)}async function AH(e,t){let n=await UV(e,t),{log:r,type:i,quality:a,dpi:o}=n,s=await kH(n);r.time(`canvas to blob`);let c=await PV(s,i,a);if([`image/png`,`image/jpeg`].includes(i)&&o){let e=await EU(c.slice(0,33)),t=new Uint8Array(e);return i===`image/png`?t=DV(t,o):i===`image/jpeg`&&(t=CV(t,o)),r.timeEnd(`canvas to blob`),new Blob([t,c.slice(33)],{type:i})}return r.timeEnd(`canvas to blob`),c}async function jH(e,t){let n=await UV(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await kH(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&YH&&XH){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=OV(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?DV(u,o,r):CV(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function MH(e,t){let n=await UV(e,t),{width:r,height:i,ownerDocument:a}=n,o=await jH(n),s=MV(r,i,a),c=s.ownerDocument.createElementNS(s.namespaceURI,`image`);return c.setAttributeNS(null,`href`,o),c.setAttributeNS(null,`height`,`100%`),c.setAttributeNS(null,`width`,`100%`),s.appendChild(c),NV(s,n.isEnable(`removeControlCharacter`))}async function NH(e,t){let n=await UV(e,t),{ownerDocument:r,width:i,height:a,scale:o,type:s}=n,c=LV(s===`image/svg+xml`?await MH(n):await jH(n),r);return c.width=Math.floor(i*o),c.height=Math.floor(a*o),c.style.width=`${i}px`,c.style.height=`${a}px`,c}async function PH(e,t){return jH(await UV(e,{...t,type:`image/jpeg`}))}async function FH(e,t){let n=await kH(await UV(e,t));return n.getContext(`2d`).getImageData(0,0,n.width,n.height).data}async function IH(e,t){return jH(await UV(e,{...t,type:`image/png`}))}async function LH(e,t){return jH(await UV(e,{...t,type:`image/webp`}))}var RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU=t((()=>{RH=112,zH=72,BH=89,VH=115,UH=`AAlwSFlz`,WH=`AAAJcEhZ`,GH=`AAAACXBI`,KH=`[modern-screenshot]`,qH=typeof window<`u`,JH=qH&&`Worker`in window,YH=qH&&`atob`in window,XH=qH&&`btoa`in window,ZH=qH?window.navigator?.userAgent:``,QH=ZH.includes(`Chrome`),$H=ZH.includes(`AppleWebKit`)&&!QH,eU=ZH.includes(`Firefox`),tU=e=>e&&`__CONTEXT__`in e,nU=e=>e.constructor.name===`CSSFontFaceRule`,rU=e=>e.constructor.name===`CSSImportRule`,iU=e=>e.constructor.name===`CSSLayerBlockRule`,aU=e=>e.nodeType===1,oU=e=>typeof e.className==`object`,sU=e=>e.tagName===`image`,cU=e=>e.tagName===`use`,lU=e=>aU(e)&&e.style!==void 0&&!oU(e),uU=e=>e.nodeType===8,dU=e=>e.nodeType===3,fU=e=>e.tagName===`IMG`,pU=e=>e.tagName===`VIDEO`,mU=e=>e.tagName===`CANVAS`,hU=e=>e.tagName===`TEXTAREA`,gU=e=>e.tagName===`INPUT`,_U=e=>e.tagName===`STYLE`,vU=e=>e.tagName===`SCRIPT`,yU=e=>e.tagName===`SELECT`,bU=e=>e.tagName===`SLOT`,xU=e=>e.tagName===`IFRAME`,SU=(...e)=>console.warn(KH,...e),CU=e=>e.startsWith(`data:`),wU=`http://www.w3.org/2000/svg`,TU=e=>IV(e,`dataUrl`),EU=e=>IV(e,`arrayBuffer`),DU=function(){let e=0,t=()=>`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}(),OU=0,kU=[`width`,`height`,`-webkit-text-fill-color`],AU=[`stroke`,`fill`],jU=[`::before`,`::after`],MU=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`],NU=new Set([`symbol`]),PU=/^[\w-:]+$/,FU=/url\((['"]?)([^'"]+?)\1\)/g,IU=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`],LU=/(\/\*[\s\S]*?\*\/)/g,RU=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi,zU=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,BU=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g,VU=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i}));function UU(e){let[t,...n]=e;if(!t)return``;if(n.length===0)return`M${hW(t)}l0.1 0`;let r=`M${hW(t)}`;for(let t=1;t<e.length-1;t++){let n=e[t],i=e[t+1];r+=`Q${hW(n)} ${hW([(n[0]+i[0])/2,(n[1]+i[1])/2])}`}return`${r}L${hW(e[e.length-1])}`}function WU(e,t,n=!1){let r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i)||1,o=n?0:Math.min(18,a*.08),s=[(e[0]+t[0])/2-i/a*o,(e[1]+t[1])/2+r/a*o],c=Math.atan2(t[1]-s[1],t[0]-s[0]),l=Math.min(14,a*.4)+sW.arrow.width,u=e=>[t[0]-l*Math.cos(c+e),t[1]-l*Math.sin(c+e)];return{control:s,left:u(-.5),right:u(.5)}}function GU(e){if(uW(e)!==`arrow`)return UU(e.points);let t=e.points[0],n=e.points[e.points.length-1];if(!t||!n)return``;let{control:r,left:i,right:a}=WU(t,n,e.straight);return`M${hW(t)}Q${hW(r)} ${hW(n)}M${hW(i)}L${hW(n)}L${hW(a)}`}function KU(e){return gW??=document.createElement(`canvas`).getContext(`2d`),gW?(gW.font=fW,gW.measureText(e).width):e.length*sW.text.width*.55}function qU(e){let t=sW.text.width,n=Math.round(t*.45),r=Math.round(t*1.5),[i,a]=e.points[0]??[0,0];return{left:i,top:a-r/2,width:Math.ceil(KU(e.text??``))+n*2,height:r,padding:n,radius:Math.round(t*.35)}}function JU(e){let[t,n,r]=[1,3,5].map(t=>{let n=Number.parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r>.4?`#0a0a0a`:`#ffffff`}function YU(e){let t=e.flatMap(e=>{if(uW(e)===`text`){let t=qU(e);return[{left:t.left,top:t.top,width:t.width,height:t.height+2}]}let t=dW(e)/2,n=e.points,r=e.points[0],i=e.points[e.points.length-1];if(uW(e)===`arrow`&&r&&i){let{control:t,left:a,right:o}=WU(r,i,e.straight);n=[r,t,i,a,o]}return n.map(([e,n])=>({left:e-t,top:n-t,width:t*2,height:t*2}))});if(t.length===0)return;let n=Math.min(...t.map(e=>e.left)),r=Math.min(...t.map(e=>e.top)),i=Math.max(...t.map(e=>e.left+e.width)),a=Math.max(...t.map(e=>e.top+e.height));return{left:n,top:r,width:i-n,height:a-r}}function XU(e,t){if(e===`arrow`)return`crosshair`;if(e===`text`)return`text`;let n=sW[e].width,r=Math.max(8,n+4),i=`<svg xmlns="${lW}" width="${r}" height="${r}"><circle cx="${r/2}" cy="${r/2}" r="${Math.max(2,n/2)}" fill="${t}" fill-opacity="${e===`marker`?.4:.9}" stroke="#0a0a0a" stroke-opacity=".55"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}") ${r/2} ${r/2}, crosshair`}function ZU(e,t){let n=qU(t),r=document.createElementNS(lW,`rect`),i=document.createElementNS(lW,`text`);for(let[e,t]of Object.entries({x:n.left,y:n.top,width:n.width,height:n.height,rx:n.radius}))r.setAttribute(e,String(t));r.setAttribute(`fill`,t.color),i.setAttribute(`x`,String(n.left+n.padding)),i.setAttribute(`y`,String(t.points[0][1])),i.setAttribute(`dominant-baseline`,`central`),i.setAttribute(`fill`,JU(t.color)),i.textContent=t.text??``,e.replaceChildren(r,i)}function QU(e,t){if(uW(e)===`text`){let n=document.createElementNS(lW,`g`);return n.setAttribute(`class`,`label`),ZU(n,e),t.append(n),n}let n=document.createElementNS(lW,`path`);return n.setAttribute(`class`,uW(e)),n.setAttribute(`stroke`,e.color),n.setAttribute(`d`,GU(e)),t.append(n),n}function $U(e,t){for(let n of t){if(e.save(),uW(n)===`text`){let t=qU(n),r=e.getTransform().a;e.shadowColor=`rgb(0 0 0 / 30%)`,e.shadowBlur=1.5*r,e.shadowOffsetY=r,e.fillStyle=n.color,e.beginPath(),e.roundRect(t.left,t.top,t.width,t.height,t.radius),e.fill(),e.shadowColor=`transparent`,e.font=fW,e.textBaseline=`middle`,e.fillStyle=JU(n.color),e.fillText(n.text??``,t.left+t.padding,n.points[0][1])}else{let t=uW(n)===`marker`;e.globalAlpha=t?.4:1,e.globalCompositeOperation=t?`multiply`:`source-over`,e.strokeStyle=n.color,e.lineWidth=dW(n),e.lineCap=t?`butt`:`round`,e.lineJoin=`round`,e.stroke(new Path2D(GU(n)))}e.restore()}}function eW(e){let t=document.createElement(`vitehub-marker`);t.setAttribute(`data-comments-ui`,``);let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=mW;let i=document.createElement(`div`);i.className=`layer`;let a=document.createElementNS(lW,`svg`);i.append(a),n.append(r,i),document.documentElement.append(t);let o=[],s,c,l,u=()=>{if(!l)return;let{input:e,stroke:t}=l,n=qU({...t,text:e.value||` `}),r=(t,n)=>e.style.setProperty(t,n);r(`left`,`${n.left}px`),r(`top`,`${n.top}px`),r(`width`,`${n.width+2}px`),r(`height`,`${n.height}px`),r(`padding`,`0 ${n.padding}px`),r(`border-radius`,`${n.radius}px`),r(`background`,t.color),r(`color`,JU(t.color))},d=()=>{if(!l)return;let{input:t,stroke:n,label:r}=l;l=void 0;let i=t.value.trim();if(t.remove(),r)i?(r.text=i,r.color=n.color,ZU(r.element,r),r.element.removeAttribute(`visibility`)):o.splice(o.indexOf(r),1)[0]?.element.remove();else{if(!i)return;o.push({...n,text:i,element:QU({...n,text:i},a)})}e.onChange()},f=(e,t)=>{let n=document.createElement(`input`);n.type=`text`,n.maxLength=200,n.spellcheck=!1,n.value=e.text??``,n.setAttribute(`aria-label`,`Label`),n.setAttribute(`enterkeyhint`,`done`),l={input:n,stroke:{...e},label:t},u(),t?.element.setAttribute(`visibility`,`hidden`),n.addEventListener(`input`,u),n.addEventListener(`blur`,d),i.append(n),n.focus({preventScroll:!0}),t&&n.select()},p=t=>{l&&t.composedPath()[0]===l.input&&(t.stopPropagation(),t.isComposing||((t.key===`PageUp`||t.key===`PageDown`)&&t.preventDefault(),(t.key===`Enter`||t.key===`Escape`)&&(t.preventDefault(),d(),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&e.onSubmit?.())))};addEventListener(`keydown`,p,!0);let m=(e,t)=>o.findLast(n=>{if(uW(n)!==`text`)return!1;let r=qU(n);return e>=r.left-4&&e<=r.left+r.width+4&&t>=r.top-4&&t<=r.top+r.height+4}),h=()=>{i.style.cursor=XU(e.tip(),e.color()),l&&l.stroke.color!==e.color()&&(l.stroke.color=e.color(),u())};h(),i.addEventListener(`pointerdown`,t=>{if(l&&t.composedPath().includes(l.input)||t.button!==0||i.hasAttribute(`data-frozen`))return;if(t.preventDefault(),l)return d();i.setPointerCapture(t.pointerId);let n=e.tip(),r=e.color();if(n===`text`){let e=m(t.clientX,t.clientY);c={label:e,from:[t.clientX,t.clientY],at:e?.points[0],moved:!1,color:r};return}let o={tip:n,color:r,points:[[t.clientX,t.clientY]]};s={...o,element:QU(o,a)}}),i.addEventListener(`pointermove`,e=>{if(c){let{label:t,from:n,at:r}=c;if(!t||!r)return;let i=e.clientX-n[0],a=e.clientY-n[1];if(!c.moved&&Math.hypot(i,a)<3)return;c.moved=!0,t.points=[[r[0]+i,r[1]+a]],ZU(t.element,t);return}if(!s)return;let t=[e.clientX,e.clientY],n=s.points[0];if(s.tip===`arrow`||e.shiftKey)e.shiftKey?s.straight=!0:delete s.straight,s.points=[n,s.tip===`marker`&&e.shiftKey?[t[0],n[1]]:t];else{let e=s.points[s.points.length-1];Math.hypot(t[0]-e[0],t[1]-e[1])>2&&s.points.push(t)}s.element.setAttribute(`d`,GU(s))});let g=t=>{if(c){let{label:n,from:r,moved:i,color:a}=c;if(c=void 0,t.type===`pointercancel`)return;if(n){i?e.onChange():f(n,n);return}return f({tip:`text`,color:a,points:[[r[0]-Math.round(sW.text.width*.45),r[1]]],text:``})}if(!s)return;let n=s;s=void 0;let r=n.points[0],i=n.points[n.points.length-1];if(n.tip===`arrow`&&Math.hypot(i[0]-r[0],i[1]-r[1])<10)return n.element.remove();o.push(n),e.onChange()};i.addEventListener(`pointerup`,g),i.addEventListener(`pointercancel`,g);for(let e of[`wheel`,`touchmove`])i.addEventListener(e,e=>e.preventDefault(),{passive:!1});return{strokes:()=>o.map(e=>{let t={tip:e.tip,color:e.color,points:e.points.map(([e,t])=>[e,t])};return e.straight&&(t.straight=!0),e.text!==void 0&&(t.text=e.text),t}),restyle:h,commit:d,undo(){d(),o.pop()?.element.remove(),e.onChange()},freeze(){d(),t.setAttribute(`frozen`,``),i.setAttribute(`data-frozen`,``),Object.assign(i.style,{left:`${scrollX}px`,top:`${scrollY}px`,width:`${innerWidth}px`,height:`${innerHeight}px`,cursor:``})},remove(){removeEventListener(`keydown`,p,!0),l&&=(l.input.removeEventListener(`blur`,d),void 0),t.remove()}}}function tW(){for(let e of[document.documentElement,document.body]){let t=e?getComputedStyle(e).backgroundColor:``;if(t&&t!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(t))return t}return`#ffffff`}function nW(e){return e.position!==`static`||e.transform!==`none`||e.filter!==`none`||e.perspective!==`none`||/paint|layout|strict|content/.test(e.contain)||/transform|perspective|filter/.test(e.willChange)}function rW(e){for(let t=e.parentElement;t&&t!==document.documentElement;t=t.parentElement){if(nW(getComputedStyle(t)))return t;let e=t.parentElement;if(e&&(e.scrollTop||e.scrollLeft))return t}}function iW(e){let t=`data-vitehub-pin`,n=[],r=document.createTreeWalker(document.documentElement,NodeFilter.SHOW_ELEMENT);for(let t=r.nextNode();t;t=r.nextNode()){if(!(t instanceof HTMLElement)||e(t))continue;let r=getComputedStyle(t);if(r.position!==`fixed`&&r.position!==`sticky`||r.visibility===`hidden`)continue;let i=t.getBoundingClientRect();i.bottom<=0||i.right<=0||i.top>=innerHeight||i.left>=innerWidth||n.push({element:t,sticky:r.position===`sticky`,rect:i})}for(let e of n.filter(e=>e.sticky)){let t=e.element.getAttribute(`style`);e.element.style.setProperty(`position`,`static`,`important`),e.from=e.element.getBoundingClientRect(),e.element.style.removeProperty(`position`),e.element.getAttribute(`style`)!==t&&(t===null?e.element.removeAttribute(`style`):e.element.setAttribute(`style`,t))}return n.forEach((e,n)=>{if(!e.sticky){let t=rW(e.element),n=t?.getBoundingClientRect(),r=e.element.parentElement;e.left=e.rect.left-(t&&n?n.left+t.clientLeft:0)+(r?.scrollLeft??0),e.top=e.rect.top-(t&&n?n.top+t.clientTop:0)+(r?.scrollTop??0)}e.element.setAttribute(t,String(n))}),{apply(e){if(!(e instanceof HTMLElement)||!e.hasAttribute(t))return;let r=n[Number(e.getAttribute(t))];if(e.removeAttribute(t),!r)return;let i=(t,n)=>e.style.setProperty(t,n,`important`);for(let t of[`inset`,`right`,`bottom`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`])e.style.removeProperty(t);if(r.sticky&&r.from)i(`position`,`relative`),i(`left`,`${r.rect.left-r.from.left}px`),i(`top`,`${r.rect.top-r.from.top}px`);else{i(`position`,`absolute`),i(`left`,`${r.left}px`),i(`top`,`${r.top}px`),i(`width`,`${r.rect.width}px`),i(`height`,`${r.rect.height}px`),i(`margin`,`0`),i(`box-sizing`,`border-box`);for(let e of[`transform`,`translate`,`rotate`,`scale`])i(e,`none`)}},release(){for(let e of n)e.element.removeAttribute(t)}}}function aW(e){let t=new Map,n=``;for(let r of e.querySelectorAll(`[style]`)){if(r.namespaceURI!==`http://www.w3.org/1999/xhtml`||r.closest(`defs, symbol`))continue;let e=r.getAttribute(`style`),i=t.get(e);if(!t.has(e)){let a=``;for(let e=0;e<r.style.length;e++){let t=r.style.item(e),n=r.style.getPropertyValue(t);if(!n){a=void 0;break}a+=`${t}:${n}!important;`}i=a===void 0?void 0:`_s${t.size.toString(36)}`,t.set(e,i),i&&(n+=`.${i}{${a}}\n`)}i&&(r.removeAttribute(`style`),r.classList.add(i))}let r=e.firstElementChild;(r?.localName===`style`?r:e.insertBefore(document.createElement(`style`),r)).append(n)}async function oW(e,t){let n=iW(t);try{let{domToCanvas:r}=await Ua(async()=>{let{domToCanvas:e}=await Promise.resolve().then(()=>(HU(),SV));return{domToCanvas:e}},[],import.meta.url),i=Math.min(devicePixelRatio||1,2),a=await r(document.documentElement,{width:innerWidth,height:innerHeight,scale:i,backgroundColor:tW(),filter:e=>!t(e),features:{restoreScrollPosition:!0},onCloneEachNode:e=>n.apply(e),onCreateForeignObjectSvg:aW,timeout:3e3}),o=a.getContext(`2d`);return o?(o.setTransform(i,0,0,i,0,0),$U(o,e),await new Promise(e=>a.toBlob(t=>e(t??void 0),`image/webp`,.85))):void 0}catch{return}finally{n.release()}}var sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W=t((()=>{Wa(),sW={marker:{label:`Marker`,key:`B`,width:14},pen:{label:`Pen`,key:`P`,width:3},arrow:{label:`Arrow`,key:`A`,width:3},text:{label:`Text`,key:`T`,width:20}},cW={pink:`#ec4899`,amber:`#f59e0b`,blue:`#2563eb`,green:`#16a34a`},lW=`http://www.w3.org/2000/svg`,uW=e=>e.tip??`marker`,dW=e=>sW[uW(e)].width,fW=`600 ${sW.text.width}px ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`,pW=`0 1px 1.5px rgb(0 0 0 / 30%)`,mW=`:host{position:absolute;left:0;top:0;width:0;height:0;z-index:2147482999}
|
|
165
168
|
:host([frozen]){z-index:2147482998}
|
|
166
169
|
.layer{position:fixed;inset:0;touch-action:none}
|
|
167
170
|
.layer[data-frozen]{position:absolute;pointer-events:none}
|
|
168
171
|
svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
|
|
169
172
|
path{fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
170
|
-
path.marker{stroke-width:${
|
|
171
|
-
path.pen{stroke-width:${
|
|
172
|
-
path.arrow{stroke-width:${
|
|
173
|
-
.label{filter:drop-shadow(${
|
|
174
|
-
.label text{font:${
|
|
175
|
-
input{position:fixed;z-index:1;box-sizing:border-box;margin:0;border:0;outline:0;font:${
|
|
173
|
+
path.marker{stroke-width:${sW.marker.width}px;stroke-opacity:.4;stroke-linecap:butt;mix-blend-mode:multiply}
|
|
174
|
+
path.pen{stroke-width:${sW.pen.width}px}
|
|
175
|
+
path.arrow{stroke-width:${sW.arrow.width}px}
|
|
176
|
+
.label{filter:drop-shadow(${pW})}
|
|
177
|
+
.label text{font:${fW};white-space:pre}
|
|
178
|
+
input{position:fixed;z-index:1;box-sizing:border-box;margin:0;border:0;outline:0;font:${fW};caret-color:currentColor;box-shadow:${pW},0 0 0 2px rgb(255 255 255 / 90%)}`,hW=([e,t])=>`${e.toFixed(1)} ${t.toFixed(1)}`})),vW,yW,bW,xW,SW,CW,wW,TW=t((()=>{vW=`
|
|
176
179
|
[data-slot="comment-reply-status"] { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ui-text-muted); }
|
|
177
180
|
.delivery[data-failed] { color: var(--vh-error); }
|
|
178
|
-
`,
|
|
181
|
+
`,yW=`
|
|
179
182
|
:host {
|
|
180
183
|
all: initial;
|
|
181
184
|
--ui-bg: #fff; --ui-bg-elevated: #f5f5f5; --ui-bg-accented: #e5e5e5; --ui-bg-muted: #fafafa; --ui-border: #e5e5e5;
|
|
@@ -185,8 +188,8 @@ input{position:fixed;z-index:1;box-sizing:border-box;margin:0;border:0;outline:0
|
|
|
185
188
|
--ui-bg: #171717; --ui-bg-elevated: #262626; --ui-bg-accented: #404040; --ui-bg-muted: #1f1f1f; --ui-border: rgb(255 255 255 / 12%);
|
|
186
189
|
--ui-text: #e5e5e5; --ui-text-muted: #a3a3a3; --ui-text-highlighted: #fafafa; --ui-text-inverted: #171717; --ui-primary: #fafafa;
|
|
187
190
|
}
|
|
188
|
-
`,
|
|
189
|
-
${
|
|
191
|
+
`,bW=`
|
|
192
|
+
${yW}
|
|
190
193
|
.root { position: fixed; inset: 0; pointer-events: none; z-index: 2147482999; font-family: "Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
191
194
|
.root > * { pointer-events: auto; }
|
|
192
195
|
/* The comment layer covers the page. Only its parts and the comment mode overlay take the pointer, as @vite-hub/ui styles them. */
|
|
@@ -303,9 +306,9 @@ ${jW}
|
|
|
303
306
|
.selection { position: fixed; z-index: 2147483001; translate: -50% -100%; }
|
|
304
307
|
.selection[data-below="true"] { translate: -50% 0; }
|
|
305
308
|
[data-slot="comment-selection-bar-action"]:focus-visible { outline: 2px solid var(--vh-inverted); outline-offset: 1px; }
|
|
306
|
-
${
|
|
307
|
-
`,
|
|
308
|
-
${
|
|
309
|
+
${vW}
|
|
310
|
+
`,xW=`
|
|
311
|
+
${yW}
|
|
309
312
|
:host { display: block; height: 100%; color-scheme: light; }
|
|
310
313
|
:host(.dark) { color-scheme: dark; }
|
|
311
314
|
.panel-root { height: 100%; }
|
|
@@ -323,8 +326,8 @@ ${jW}
|
|
|
323
326
|
@container (max-width: 299px) {
|
|
324
327
|
[data-slot="comment-panel-actions"] [data-action="copy-page-prompt"] > span:not([data-slot]) { display: none; }
|
|
325
328
|
}
|
|
326
|
-
${
|
|
327
|
-
`,
|
|
329
|
+
${vW}
|
|
330
|
+
`,SW=`
|
|
328
331
|
:host { font: inherit; color: inherit; color-scheme: inherit; }
|
|
329
332
|
/* The overlay's mount point sits between the segment and the toolbar. It passes the pill's alignment on, so items such as the avatars center like the buttons. */
|
|
330
333
|
:host > div { align-items: inherit; }
|
|
@@ -351,12 +354,12 @@ button:disabled { opacity: .45; cursor: default; }
|
|
|
351
354
|
.avatar { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: #18181b; overflow: hidden; }
|
|
352
355
|
.avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|
353
356
|
.avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--vitehub-pill-surface); }
|
|
354
|
-
`,
|
|
357
|
+
`,CW=`
|
|
355
358
|
html.vitehub-edit-mode [data-content-field] { cursor: text !important; }
|
|
356
359
|
[data-vitehub-editing] { outline: 2px solid #2563eb !important; outline-offset: 2px; border-radius: 2px; }
|
|
357
|
-
`,
|
|
360
|
+
`,wW=`
|
|
358
361
|
:host { all: initial; position: fixed; inset: 0; z-index: 1; pointer-events: none; }
|
|
359
|
-
`})),RW,zW,BW,VW=t((()=>{jn(),RW={why:({message:e})=>e===void 0?``:String(e)},zW={RUNTIME_R0001:{...RW,fix:"Pass `maxDepth` to `normalizeRuntimeDiagnosticError()` as an integer of 0 or more, or remove it to use the default."},RUNTIME_R0002:{...RW,fix:"Pass `maxErrors` to `normalizeRuntimeDiagnosticError()` as an integer of 1 or more, or remove it to use the default."},RUNTIME_R0003:{...RW,fix:"Pass `maxStringLength` to `normalizeRuntimeDiagnosticError()` as an integer of 64 or more, or remove it to use the default."},RUNTIME_R0004:{...RW,fix:"Read the logs of the process that `vitehub drain` waited for to find why its drain failed, then fix that failure and run `vitehub drain` again."},RUNTIME_R0005:{...RW,fix:"Read the logs of the process that the message names to find why it stopped, then start it again before you run `vitehub drain`."},RUNTIME_R0006:{...RW,fix:"Pass `new ViteHubError()` a nonempty `code` and `message` string within the length limits, and plain JSON `details`."},RUNTIME_R0007:{...RW,fix:"Give the execution authority a valid value for each of `credentials`, `environment`, `filesystem.access`, `filesystem.scope`, `isolation`, `network`, and `processes`."},RUNTIME_R0009:{...RW,fix:"Set `intervalMs` of the process reconciler to a number of milliseconds from 1 to 2147483647."},RUNTIME_R0010:{...RW,fix:"Give the process reconciler a `signal` other than `SIGKILL` or `SIGSTOP`, or set `signal: false`."},RUNTIME_R0011:{...RW,fix:"Call `drain()` of the process reconciler after its callback returns, not from inside the callback."},RUNTIME_R0015:{...RW,fix:"Pass the `Request` of a Fetchable handler, or the event of an H3 or Nitro route, to `getStandardContext()`."},RUNTIME_R0016:{...RW,fix:"Return the body or a `Response` from the handler, in place of setting `~standard.res.body`."},RUNTIME_R0017:RW,RUNTIME_R0018:RW,RUNTIME_CONSOLE_PATH_INVALID:{why:({value:e})=>`${e} is not a Console path. Use a path that starts with one /, such as /agents/<agent>.`,fix:"Pass `hostedConsoleUrl()` a Console path that starts with one `/`, such as `/kv` or `/agents/<agent>/invocations/<id>`."},RUNTIME_CONSOLE_PROJECT_URL_INVALID:{why:({value:e})=>`${e} is not a project URL. Use the https:// origin of the app, with its base path if it has one.`,fix:"Pass `hostedConsoleUrl()` the `https://` origin of the app, or `http://localhost` in development, with its base path and without a user name or password."},RUNTIME_DURATION_INVALID:{why:({option:e,value:t})=>`${e?`\`${e}\``:`The value`} is ${t}, which is not a duration. A duration is a string with a number of 0 or more and a unit, such as "30s", "5m", or "1 day".`,fix:({suggestion:e,unit:t=`milliseconds`,value:n})=>e?`Write the time as a string with a unit: ${n} ${t} is ${e}.`:'Write a number of 0 or more and one unit: `ms`, `s`, `m`, `h`, `d`, or `w`, or a long name such as `minutes` or `days`. For example `"30s"`, `"5m"`, or `"1 day"`.'},RUNTIME_EVENT_LOOP_WARNING_INVALID:{why:({value:e})=>`\`watchEventLoop()\` received \`afterMs: ${e}\`. The threshold must be a whole number of milliseconds of 100 or more.`,fix:"Pass a whole number of milliseconds of 100 or more, or omit `afterMs` to use the default of 10 000 ms."},RUNTIME_EXECUTION_BUDGET_AMOUNT_INVALID:{why:({counter:e})=>`[vitehub] Execution budget ${e} amount must be a finite non-negative number.`,fix:"Pass `consume()` and the `record*()` methods of the execution budget a finite number of 0 or more."},RUNTIME_EXECUTION_BUDGET_EXCEEDED:{why:({counter:e})=>`[vitehub] Execution budget exhausted for ${e}.`,fix:"Raise the `executionBudget` limit that `error.counter` names, such as `maxToolCalls`, `maxRetries`, `maxInputBytes`, or `maxOutputBytes`, or give the run less work."},RUNTIME_EXECUTION_BUDGET_LIMIT_INVALID:{why:()=>`[vitehub] Execution budget limits must be finite non-negative numbers.`,fix:"Set each limit of `executionBudget`, such as `maxToolCalls` or `maxOutputBytes`, to a finite number of 0 or more, or remove it."},RUNTIME_HIDDEN_ERROR:{why:()=>`The server failed. The error is not a ViteHub error, so its message and stack stay on the server.`,fix:"Read the server logs for the error. To send a code, a why, and a fix to the client, return a `ResultError` from `defineErrors()` and pass it to `toResponse()`."},RUNTIME_PUBLIC_URL_INVALID:{why:()=>"`VITEHUB_PUBLIC_URL` must be an http or https origin without a path.",fix:"Set `VITEHUB_PUBLIC_URL` on the server to the origin that serves the app, such as `https://shop.example.com`, with no path, query, or user name. Then restart or deploy the server."},RUNTIME_SERIALIZED_RESPONSE_INVALID:{why:()=>`Invalid serialized Response`,fix:"Pass `deserializeResponse()` the record that `serializeResponse()` returned, unchanged. Check it first with `isSerializedResponse()`."}},BW=Dn({docsBase:`https://vitehub.dev/docs/runtime/diagnostics`,codes:zW})}));function HW(){throw BW.RUNTIME_R0006({message:`[vitehub] ViteHubError requires a valid public error contract.`})}function UW(e){try{return Array.isArray(e)}catch{HW()}}function WW(e,t,n=!1){try{let r=Object.getOwnPropertyDescriptor(e,t);return r===void 0?void 0:((!(`value`in r)||n&&!r.enumerable)&&HW(),r.value)}catch{HW()}}function GW(e,t,n,r){if(t.nodes+=1,t.nodes>ZW&&HW(),e===void 0&&r)return;if(e===null||typeof e==`boolean`||typeof e==`string`&&e.length<=QW||typeof e==`number`&&Number.isFinite(e))return e;(typeof e!=`object`||n>JW||t.ancestors.has(e))&&HW();let i,a;try{i=Object.getPrototypeOf(e),a=Reflect.ownKeys(e)}catch{HW()}t.ancestors.add(e);try{if(UW(e)){let r=WW(e,`length`);(!Number.isSafeInteger(r)||r<0||r>YW||a.length!==r+1||!a.includes(`length`))&&HW();let i=[];for(let o=0;o<r;o+=1){let r=String(o);a.includes(r)||HW(),i.push(GW(WW(e,r,!0),t,n+1,!1))}return Object.freeze(i)}i!==Object.prototype&&i!==null&&HW(),(a.length>YW||a.some(e=>typeof e!=`string`))&&HW();let r={};for(let i of a)(i.length===0||i.length>XW)&&HW(),Object.defineProperty(r,i,{enumerable:!0,value:GW(WW(e,i,!0),t,n+1,!0),writable:!0});return Object.freeze(r)}finally{t.ancestors.delete(e)}}function KW(e){if(e!==void 0)return(typeof e!=`object`||!e||UW(e))&&HW(),GW(e,{ancestors:new Set,nodes:0},0,!1)}function qW(e,t,n){(typeof e!=`string`||e.length===0||e.length>$W)&&HW(),(typeof t!=`string`||t.length===0||t.length>eG)&&HW(),(typeof n!=`object`||!n||UW(n))&&HW();let r=WW(n,`cause`),i=KW(WW(n,`details`)),a=WW(n,`requestId`);return a!==void 0&&(typeof a!=`string`||a.length===0||a.length>tG)&&HW(),{cause:r,code:e,details:i,message:t,name:`ViteHubError`,requestId:a,shape:Object.freeze({code:e,...i===void 0?{}:{details:i},message:t,name:`ViteHubError`,...a===void 0?{}:{requestId:a}})}}var JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG=t((()=>{VW(),JW=8,YW=128,XW=128,ZW=1024,QW=16384,$W=128,eG=16384,tG=256,nG=new WeakMap,rG=class extends Error{code;details;requestId;constructor(e,t,n={}){let r=qW(e,t,n);super(r.message,r.cause===void 0?void 0:{cause:r.cause}),this.name=`ViteHubError`,this.code=r.code,this.details=r.details,this.requestId=r.requestId;let i=this.toJSON.bind(this);Object.defineProperties(this,{code:{configurable:!0,enumerable:!0,value:r.code,writable:!1},details:{configurable:!0,enumerable:!0,value:r.details,writable:!1},message:{configurable:!0,enumerable:!1,value:r.message,writable:!1},name:{configurable:!1,enumerable:!1,value:r.name,writable:!1},requestId:{configurable:!0,enumerable:!0,value:r.requestId,writable:!1},toJSON:{configurable:!1,enumerable:!1,value:i,writable:!1}}),nG.set(this,r.shape)}toJSON(){let e=nG.get(this);if(e)return e;let t=qW(WW(this,`code`),WW(this,`message`),{details:WW(this,`details`),requestId:WW(this,`requestId`)});return nG.set(this,t.shape),t.shape}}}));function aG(e){return e!==null&&Object(e)===e}function oG(e){if(!aG(e))return!1;try{let t=Reflect.get(Error,`isError`);if(typeof t==`function`)return t(e)===!0;let n=globalThis.process?.getBuiltinModule?.(`node:util`)?.types?.isNativeError;return n?n(e):e instanceof Error||!(Symbol.toStringTag in e)&&Object.prototype.toString.call(e)===`[object Error]`}catch{return!1}}var sG=t((()=>{}));function cG(e){if(!oG(e))return!1;try{let t=Reflect.get(e,`message`),n=Reflect.get(e,`code`),r=Reflect.get(e,`name`),i=Reflect.get(e,`why`),a=Reflect.get(e,`fix`),o=Reflect.get(e,`docs`),s=Reflect.get(e,`sources`);return typeof n==`string`&&n.length>0&&typeof r==`string`&&typeof t==`string`&&i===t&&(a===void 0||typeof a==`string`)&&(o===void 0||typeof o==`string`)&&(s===void 0||Array.isArray(s)&&s.every(e=>typeof e==`string`))&&typeof Reflect.get(e,`toJSON`)==`function`}catch{return!1}}var lG=t((()=>{sG()}));function uG(e){let t=t=>{let n=Object.getOwnPropertyDescriptor(e,t);return n?n.configurable===!0:Object.isExtensible(e)},n=t(`name`)&&t(`toJSON`)&&(Object.hasOwn(e,fG)||Object.isExtensible(e))?e:new kn({code:e.code,why:e.why,fix:e.fix,docs:e.docs,cause:e.cause,data:e.data,sources:e.sources});if(n!==e){n.stack=e.stack;let t=Reflect.get(e,`status`);typeof t==`number`&&Object.defineProperty(n,"status",{configurable:!0,value:t})}return Object.defineProperty(n,"name",{configurable:!0,value:n.code,writable:!0}),Object.defineProperty(n,fG,{value:!0}),Object.defineProperty(n,"toJSON",{configurable:!0,value:()=>({code:n.code,docs:n.docs,fix:n.fix,name:n.name,why:n.why})}),n}function dG(e){let t=Dn({codes:e.codes,docsBase:e.docs}),n=new Set(Object.keys(e.codes)),r=Object.defineProperty({},"is",{value:e=>cG(e)&&n.has(e.code)});for(let i of n){let n=t[i],a=e.codes[i]?.status;r[i]=Object.assign(e=>{let t=uG(n(e));return a!==void 0&&Object.defineProperty(t,"status",{configurable:!0,enumerable:!1,value:a}),t},{is:e=>cG(e)&&e.code===i})}return r}var fG,pG=t((()=>{lG(),jn(),fG=Symbol.for(`vitehub.runtime.resultError`)})),mG=t((()=>{iG(),pG()})),hG,gG=t((()=>{mG(),hG=dG({docs:`https://vitehub.dev/docs/realtime/diagnostics`,codes:{REALTIME_DISABLED:{why:({action:e})=>`Realtime is disabled, so \`${e}()\` cannot run.`,fix:"Set `enabled` to `true` on `useRealtimeTiptap()` before you call the method."},REALTIME_DISCONNECTED:{why:({action:e})=>`The realtime document disconnected or changed during \`${e}()\`.`,fix:"Call the method again after the new document connects. Read `synced` to know when it is ready."},REALTIME_INVALID_DOCUMENT:{why:({action:e})=>`The room body does not fit the editor schema, so \`${e}()\` did not write it. Writing it would lose content.`,fix:`Keep editing until the document fits the editor extensions of the Realtime Definition, then call the method again. The room keeps the edits.`},REALTIME_INVALID_RESPONSE:{why:({action:e})=>`The realtime server answered \`${e}()\` with a response that the client cannot use.`,fix:"Use the same `@vite-hub/realtime` version on the client and the server, and build again."},REALTIME_MISSING_DOCUMENT:{why:({action:e})=>`\`${e}()\` needs a document, and \`documentId\` is empty.`,fix:"Pass a document path to `useRealtimeTiptap(definition, documentId)` before you call the method."},REALTIME_READ_ONLY:{why:({action:e})=>`The room is read-only, so \`${e}()\` cannot write the document.`,fix:"Read `readOnlyReason` of `useRealtimeTiptap()` for the reason. Do not offer save or publish while it is set."},REALTIME_REQUEST_FAILED:{why:({action:e,message:t,status:n})=>`The realtime \`${e}()\` request failed${n===void 0?``:` with HTTP ${n}`}${t?`: ${t}`:`.`}`,fix:"Read `error.why` for the server message, `error.data.status` for the HTTP status, and `error.cause` for a network error. Retry when the server is available again.",data:({status:e})=>({status:e})},REALTIME_SOURCE_CHANGED:{why:({action:e})=>`The server refused \`${e}()\` because the stored document changed outside the room.`,fix:"Tell the person that the stored document changed. Use `onReset()` to detect a room reset and read unsaved edits from the event's `previous` document."},REALTIME_SYNC_PENDING:{why:({action:e})=>`The room did not receive every edit of this client in time, so \`${e}()\` did not run. The composable tried 20 times.`,fix:"Call the method again when `synced` is true. When it keeps failing, check that the WebSocket stays connected."},REALTIME_ROOM_ABORTED:{why:`The request to the room stopped because its signal aborted.`,fix:`Nothing to fix when the caller stopped on purpose, such as a cancelled Agent run. Call again to ask once more.`},REALTIME_ROOM_CROWDED:{why:({count:e})=>`${e} browsers are in the room, and a request goes to one browser only.`,fix:`Give each browser its own room, such as a random id for each tab, so that one browser answers.`},REALTIME_ROOM_ELSEWHERE:{why:`No browser in this instance is in the room. With Redis or Postgres, the browser can be connected to another instance, and requests reach only the browsers of the same instance.`,fix:`Route the browser and the caller to the same instance, such as with sticky sessions, or run one Node instance.`},REALTIME_ROOM_EMPTY:{why:`No browser is in the room. The page is closed, or it has not joined yet.`,fix:`Open the page again. The request waits a few seconds for a browser to join before it gives up.`},REALTIME_ROOM_REFUSED:{why:({reason:e})=>`The browser could not answer: ${e}`,fix:"Read the reason. Add `room.onRequest(handler)` on the page, and keep each answer under 1 MiB."},REALTIME_ROOM_REQUESTS_OFF:{why:({definition:e})=>`The Realtime Definition "${e}" does not take requests.`,fix:'Define it with `defineRealtime({ access: "public", document: false, requests: true })`.'},REALTIME_ROOM_TIMEOUT:{why:({timeout:e})=>`The browser did not answer in ${e/1e3} seconds.`,fix:"Make the page answer sooner, or pass a longer `timeout` to `requestRealtimeRoom()`."},REALTIME_AWARENESS_OWNERSHIP_CONFLICT:{why:`A realtime awareness client id belongs to another peer.`,fix:`Let each editor tab use its own Yjs awareness client. Do not reuse a client id on two connections.`},REALTIME_AWARENESS_TOO_LARGE:{why:`Realtime awareness state exceeds the 8 MiB room quota.`,fix:`Keep less data in awareness state. Store large values in the document or in Workspace.`},REALTIME_DOCUMENT_TOO_LARGE:{why:`The realtime document exceeds the 8 MiB room quota.`,fix:`Split the document into smaller documents, or keep large assets in Workspace or Blob.`},REALTIME_INVALID_AWARENESS:{why:`A realtime awareness update has a state that is not a plain object.`,fix:"Set awareness state to a plain object, for example `awareness.setLocalStateField('user', { name })`."},REALTIME_TOO_MANY_AWARENESS_CLIENTS:{why:`One realtime peer sent more than 1,024 awareness clients.`,fix:`Use one awareness client for each editor tab.`},REALTIME_ROOM_WRITE_CONFLICT:{why:`Realtime room record compare-and-set failed.`,fix:`Connect again. Another Realtime instance changed the room at the same time. If it keeps failing, check that every instance uses the same Realtime bus.`},REALTIME_WRITE_REJECTED:{why:({problem:e,readOnly:t})=>e===`missing-state`?`Realtime update depends on state this room does not have.`:e===`status`?`Realtime document status is written by the server.`:t??`This realtime connection is read-only.`,fix:"Write only through a writable connection, and do not change the `status` map, which the server writes. A client that misses room state connects again to sync it."},REALTIME_DOCUMENT_CONFLICT:{why:({problem:e})=>e??`The stored document changed since the realtime room loaded it.`,fix:"Realtime re-seeds the room from the stored document. Listen to `onReset()` to recover text that the room did not save."},REALTIME_BLOB_ETAG_MISSING:{why:({pathname:e})=>`The Blob store returned no \`httpEtag\` for ${e}, so \`blobDocument()\` cannot save the file only if it is unchanged.`,fix:"Pass a ViteHub Blob store, such as `blob` from `vite-hub/blob`, whose `head()` returns `httpEtag` on every driver. A store of your own must return `httpEtag` from `head()` and accept `ifMatch` in `put()`."},REALTIME_INVALID_PERSISTENCE:{why:({name:e,reason:t})=>t===`below-debounce`?"Realtime `persistence.maxWait` must be at least `persistence.debounce`.":`Realtime \`persistence.${e}\` must be a non-negative number of milliseconds.`,fix:"Set `persistence: { debounce: 2_000, maxWait: 10_000 }`, or remove the option to use these defaults."},REALTIME_MISSING_ACCESS:{why:`The Realtime definition sets no access rule, so it does not say who can read and write its rooms.`,fix:'Set `authorize: true` to require a signed-in user, set `authorize()` to decide each request, or set `access: "public"` to let anyone read and write.'},REALTIME_INVALID_ACCESS:{why:({reason:e})=>e===`auth`?"The Realtime definition sets `auth`. Realtime replaced it with `authorize: true`, and an `authorize()` callback now also runs for signed-out callers.":e===`public-with-rule`?'The Realtime definition sets `access: "public"` together with `authorize`, so its access rule is not clear.':e===`not-public`?'The Realtime definition sets `access` to a value other than "public".':e===`not-authorize`?"The Realtime definition sets `authorize` to a value that is not `true` or a function.":"The Realtime definition sets `origins()` with `authorize: true` and no `identify()`. Only the Auth trusted-origin policy can allow a different origin to use the ViteHub Auth session.",fix:({reason:e})=>e===`auth`?"Replace `auth: true` with `authorize: true`. With an `authorize()` callback, remove `auth` and return `false` from the callback when `user` is `null`.":e===`origins-without-identify`?"Remove `origins()`, or add `identify()` that reads a credential the page sends on purpose, such as a ticket in `params`.":e===`not-authorize`?"Set `authorize: true` to require a signed-in user, or set `authorize()` to a function that returns `true` to allow.":'Use `access: "public"` alone for open rooms. To limit access, remove `access` and set `authorize`.'},REALTIME_CHECKPOINT_UNSUPPORTED:{why:"The Realtime definition sets `history.checkpoint`, but its document adapter has no `checkpoint()` method, so `history.checkpoint()` could never run.",fix:"Add `checkpoint(context, { digest, message, user })` to the document adapter, use `document: { workspace }`, or remove `history`."},REALTIME_INVALID_USER:{why:"The realtime identity needs a user `id` that is a non-empty string of at most 256 characters.",fix:"Return a user with an `id` from the Auth session or from `authorize()`."},REALTIME_MISSING_DIGEST:{why:({operation:e})=>e===`save`?`Realtime saves need Workspace file digests, and the Workspace Store did not return one.`:`Realtime checkpoints need a stored document, and the save returned no digest.`,fix:"Use a Workspace Store that returns file digests, or return `digest` from the document adapter `save()`."},REALTIME_INVALID_POSTGRES_URL:{why:"REALTIME_POSTGRES_URL is set, and it is not a `postgres://` or `postgresql://` URL.",fix:`Set REALTIME_POSTGRES_URL to a Postgres URL, or remove it so that Realtime uses the connection of the Default Database.`},REALTIME_MISSING_BUS_CONNECTION:{why:({driver:e})=>e===`redis`?`Realtime driver "redis" shares rooms through Redis, and REDIS_URL and a Redis KV_URL are not set.`:`Realtime driver "postgres" needs REALTIME_POSTGRES_URL or a Default Database that uses postgres.js.`,fix:'Set REDIS_URL for Redis. For Postgres, set REALTIME_POSTGRES_URL or use a Default Database with `dialect: "postgresql"` and no `driver` override. A Default Database with `driver: "node-postgres"` needs a separate REALTIME_POSTGRES_URL for the Postgres bus.'},REALTIME_MISSING_SHARED_BUS:{why:`This host runs each request in one of many function instances. Realtime must use Redis or Postgres to share rooms, but it found no bus connection.`,fix:'Set REDIS_URL, a Redis KV_URL, or REALTIME_POSTGRES_URL. Realtime can also use the Default Database with `dialect: "postgresql"` and no `driver` override.'},REALTIME_ROOM_LOCK_TIMEOUT:{why:`Realtime waited 30 seconds for the save lock of a room, and another instance still holds it.`,fix:"Make the document adapter `save()` finish in less than 30 seconds. Realtime tries the save again."},REALTIME_DRIVER_CONFLICT:{why:({driver:e,host:t})=>e===`memory`?`Realtime driver "memory" is single-process only, and the ${t} host runs more than one process.`:e===`cloudflare`?`Realtime driver "cloudflare" does not work with the ${t} host.`:`Realtime driver "${e}" needs a Node.js server, and the ${t} host does not run one.`,fix:'Set `realtime.driver` to "cloudflare" with a Cloudflare host. With the Node host, use "auto", "postgres", "redis", or "memory". With the Vercel host, use "auto", "postgres", or "redis".'},REALTIME_MISSING_DRIVER:{why:`Realtime production builds need one room driver, and ViteHub cannot select one for this deployment.`,fix:`Deploy with a Cloudflare host to use Durable Objects, or with the Node or Vercel host to share rooms through Postgres or Redis.`},REALTIME_RENAMED_AUTHORITY_KEY:{why:({value:e})=>`\`realtime.authority\` is ${e}. ViteHub renamed this key to \`driver\`, and it does not read \`authority\`, so Realtime would not use the driver you chose.`,fix:({value:e})=>`Set \`realtime: { driver: ${e} }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`}}})})),_G=t((()=>{})),vG,yG,bG,xG,SG,CG,wG=t((()=>{vG=Math.floor,yG=Math.abs,bG=(e,t)=>e<t?e:t,xG=(e,t)=>e>t?e:t,Number.isNaN,SG=Math.pow,CG=e=>e===0?1/e<0:e<0})),TG,EG,DG,OG=t((()=>{wG(),TG=2**53-1,EG=-(2**53-1),DG=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&vG(e)===e),Number.isNaN,Number.parseInt})),kG,AG=t((()=>{kG=()=>new Set})),jG,MG,NG,PG,FG,IG,LG,RG=t((()=>{jG=e=>e[e.length-1],MG=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},NG=Array.from,PG=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},FG=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},IG=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},LG=Array.isArray})),zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,ZG=t((()=>{RG(),zG=String.fromCharCode,String.fromCodePoint,zG(65535),BG=e=>e.toLowerCase(),VG=/^\s*/g,HG=e=>e.replace(VG,``),UG=/([A-Z])/g,WG=(e,t)=>HG(e.replace(UG,e=>`${t}${BG(e)}`)),GG=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},KG=typeof TextEncoder<`u`?new TextEncoder:null,qG=e=>KG.encode(e),JG=KG?qG:GG,YG=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),YG&&YG.decode(new Uint8Array).length===1&&(YG=null),XG=(e,t)=>IG(t,()=>e).join(``)})),QG,$G,eK,tK=t((()=>{QG=e=>Error(e),$G=()=>{throw QG(`Method unimplemented`)},eK=()=>{throw QG(`Unexpected case`)}})),nK,rK,iK,aK,oK,sK,cK,Z,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,kK,AK=t((()=>{wG(),OG(),_G(),ZG(),RG(),nK=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},rK=()=>new nK,iK=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},aK=e=>{let t=new Uint8Array(iK(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},oK=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(xG(n,t)*2),e.cpos=0)},sK=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},cK=sK,Z=(e,t)=>{for(;t>127;)sK(e,128|127&t),t=vG(t/128);sK(e,127&t)},lK=(e,t)=>{let n=CG(t);for(n&&(t=-t),sK(e,(t>63?128:0)|(n?64:0)|63&t),t=vG(t/64);t>0;)sK(e,(t>127?128:0)|127&t),t=vG(t/128)},uK=new Uint8Array(3e4),dK=uK.length/3,fK=(e,t)=>{if(t.length<dK){let n=KG.encodeInto(t,uK).written||0;Z(e,n);for(let t=0;t<n;t++)sK(e,uK[t])}else gK(e,JG(t))},pK=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Z(e,r);for(let t=0;t<r;t++)sK(e,n.codePointAt(t))},mK=KG&&KG.encodeInto?fK:pK,hK=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=bG(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(xG(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},gK=(e,t)=>{Z(e,t.byteLength),hK(e,t)},_K=(e,t)=>{oK(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},vK=(e,t)=>_K(e,4).setFloat32(0,t,!1),yK=(e,t)=>_K(e,8).setFloat64(0,t,!1),bK=(e,t)=>_K(e,8).setBigInt64(0,t,!1),xK=new DataView(new ArrayBuffer(4)),SK=e=>(xK.setFloat32(0,e),xK.getFloat32(0)===e),CK=(e,t)=>{switch(typeof t){case`string`:sK(e,119),mK(e,t);break;case`number`:DG(t)&&yG(t)<=2147483647?(sK(e,125),lK(e,t)):SK(t)?(sK(e,124),vK(e,t)):(sK(e,123),yK(e,t));break;case`bigint`:sK(e,122),bK(e,t);break;case`object`:if(t===null)sK(e,126);else if(LG(t)){sK(e,117),Z(e,t.length);for(let n=0;n<t.length;n++)CK(e,t[n])}else if(t instanceof Uint8Array)sK(e,116),gK(e,t);else{sK(e,118);let n=Object.keys(t);Z(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];mK(e,i),CK(e,t[i])}}break;case`boolean`:sK(e,t?120:121);break;default:sK(e,127)}},wK=class extends nK{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Z(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},TK=e=>{e.count>0&&(lK(e.encoder,e.count===1?e.s:-e.s),e.count>1&&Z(e.encoder,e.count-2))},EK=class{constructor(){this.encoder=new nK,this.s=0,this.count=0}write(e){this.s===e?this.count++:(TK(this),this.count=1,this.s=e)}toUint8Array(){return TK(this),aK(this.encoder)}},DK=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);lK(e.encoder,t),e.count>1&&Z(e.encoder,e.count-2)}},OK=class{constructor(){this.encoder=new nK,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(DK(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return DK(this),aK(this.encoder)}},kK=class{constructor(){this.sarr=[],this.s=``,this.lensE=new EK}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new nK;return this.sarr.push(this.s),this.s=``,mK(e,this.sarr.join(``)),hK(e,this.lensE.toUint8Array()),aK(e)}}})),jK,MK,NK,PK,FK,IK,LK,RK,zK,BK,Q,VK,HK,UK,WK,GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq=t((()=>{_G(),wG(),OG(),ZG(),tK(),jK=QG(`Unexpected end of array`),MK=QG(`Integer out of Range`),NK=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw jK;return new Uint8Array(e.buffer,e.byteOffset+t,n)},PK=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw jK;return new DataView(e.buffer,e.byteOffset+t,n)},FK=class{constructor(e){this.arr=e,this.pos=0}},IK=e=>new FK(e),LK=e=>e.pos!==e.arr.length,RK=(e,t)=>{let n=NK(e.arr,e.pos,t);return e.pos+=t,n},zK=e=>RK(e,Q(e)),BK=e=>e.arr[e.pos++],Q=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>TG)throw MK}throw jK},VK=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>TG)throw MK}throw jK},HK=e=>{let t=Q(e);if(t===0)return``;{let n=String.fromCodePoint(BK(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(BK(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},UK=e=>YG.decode(zK(e)),WK=YG?UK:HK,GK=(e,t)=>{let n=PK(e.arr,e.pos,t);return e.pos+=t,n},KK=e=>GK(e,4).getFloat32(0,!1),qK=e=>GK(e,8).getFloat64(0,!1),JK=e=>GK(e,8).getBigInt64(0,!1),YK=[e=>void 0,e=>null,VK,KK,qK,JK,e=>!1,e=>!0,WK,e=>{let t=Q(e),n={};for(let r=0;r<t;r++){let t=WK(e);n[t]=XK(e)}return n},e=>{let t=Q(e),n=[];for(let r=0;r<t;r++)n.push(XK(e));return n},zK],XK=e=>YK[127-BK(e)](e),ZK=class extends FK{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),this.count=LK(this)?Q(this)+1:-1),this.count--,this.s}},QK=class extends FK{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=VK(this);let e=CG(this.s);this.count=1,e&&(this.s=-this.s,this.count=Q(this)+2)}return this.count--,this.s}},$K=class extends FK{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=VK(this),t=e&1;this.diff=vG(e/2),this.count=1,t&&(this.count=Q(this)+2)}return this.s+=this.diff,this.count--,this.s}},eq=class{constructor(e){this.decoder=new QK(e),this.str=WK(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),nq,$,rq,iq=t((()=>{jn(),nq={why:({message:e})=>e===void 0?``:String(e)},$=e=>({...nq,fix:e}),rq=Dn({docsBase:`https://vitehub.dev/docs/workspace/diagnostics`,codes:{WORKSPACE_CONFLICT:{...nq,fix:({conditionalRemovalUnsupported:e})=>e?"Use a Store that supports conditional removal to keep the `ifDigest` check. Remove a file without `ifDigest` only if you intend to delete it even if it changed since you read it.":"Another write changed the file or ref after you read it. Read it again, apply your change to the new content, and retry with its new digest in `ifDigest` or its new head in `ifHead`. For a merge conflict or a publish that is in progress, do the step that the message names first."},WORKSPACE_FORBIDDEN:{why:`An Agent may not write past an edit lease that a person holds.`,fix:`Tell the person you work for who is editing the files, and try again after they finish. A developer allows overrides with operations({ overrideLeases: true }).`},WORKSPACE_HISTORY_FAILED:{why:({workspace:e})=>`The history operation of Workspace "${e}" failed.`,fix:"Read `error.cause` for the Store error. Check that the Store of the Workspace is reachable, then retry."},WORKSPACE_HISTORY_INVALID:{why:({problem:e})=>e===`empty-commit`?"The commit has no changes. Pass `put` or `delete`.":`The cursor belongs to one ref. Pass the same ref.`,fix:"Pass `put` or `delete` to `workspace.commit`, and pass a `cursor` only with the `ref` of the `workspace.history` call that returned it."},WORKSPACE_NOT_FOUND:{why:({id:e,path:t,problem:n,workspace:r})=>({path:`Revision ${e} has no path "${t}".`,revision:`The Workspace has no revision "${e}". Pull again without a base revision.`,target:`Workspace "${r}" has no ref or revision "${e}". Run \`vitehub workspace refs ${r}\` to list refs.`,workspace:`Unknown Workspace: ${r}.`})[n],fix:"Check the Workspace name, the ref or revision, and the path. `vitehub workspace refs <workspace>` lists the refs, and `vitehub workspace get <workspace> <ref>` lists the files. When a base revision is gone, pull again without it."},WORKSPACE_PATH_INVALID:{why:({path:e,problem:t})=>t===`reserved`?`The Workspace path ${e} uses a reserved name. ViteHub keeps \`.git\` at any depth for Git and \`.vitehub\` at the root for its own data. It also reserves their NTFS short names \`git~N\` and \`vitehu~N\`.`:`The Workspace path ${e} is not a relative path inside the Workspace root. It is empty or absolute, starts with a drive letter, has a NUL byte, or has a \`.\` or \`..\` part.`,fix:({problem:e})=>e===`reserved`?"Rename the file or folder, for example `.git/config` to `git/config`. No part of a Workspace path can be `.git` or `git~1`, and the first part cannot be `.vitehub` or `vitehu~1`.":"Pass a relative path inside the Workspace, for example `docs/guide.md`. Remove a leading `/` or drive letter, NUL bytes, and `.` or `..` parts. `error.details.path` has the path that the Workspace rejected."},WORKSPACE_SOURCE_READ_ONLY:{why:({path:e,source:t})=>t===void 0?`The Workspace path "${e}" belongs to a Source. Source paths are read-only: a write, removal, or move cannot change them.`:`The Workspace path "${e}" belongs to Source "${t}". Source paths are read-only: a write, removal, or move cannot change them.`,fix:"Write the file outside the Source mount, for example under `drafts/`. To change a Source file, change it where the Source reads it, such as its GitHub repository, its URL, or its local files. For a Source with `sync: true`, run `workspace.sync({ sources: ['handbook'] })` with its Source key in place of `handbook`."},WORKSPACE_CHECKOUT_CONFLICT:{why:({conflicted:e,workspace:t})=>`Workspace "${t}" has unresolved conflicts: ${e}.`,fix:"Edit each file and remove the conflict markers, or run `vitehub resolve` for a binary file. Then push again."},WORKSPACE_CHECKOUT_DIR:{why:({dir:e,workspace:t})=>e===void 0?`Workspace "${t}" is not checked out yet.`:`The checkout folder "${e}" must be a folder inside the project, not the project root.`,fix:"Pass `--dir` with a folder inside the project, such as `vitehub pull <workspace> --dir content`."},WORKSPACE_CHECKOUT_FAILED:{why:({message:e})=>e,fix:"Read the message. Run `vitehub status` to see the state of the checkout, then run the command again."},WORKSPACE_CHECKOUT_MISSING:{why:({workspace:e})=>e===void 0?`vitehub.lock has no checked-out Workspace.`:`Workspace "${e}" is not checked out.`,fix:"Run `vitehub pull <workspace> --dir <folder>` first."},WORKSPACE_CHECKOUT_OPTIONS:{why:({actual:e,expected:t,key:n,workspace:r})=>r===void 0?`This checkout uses ${t}, not "${e}".`:`Workspace "${r}" is checked out with ${n} "${t}", not "${e}".`,fix:"Edit `vitehub.lock` to change the `dir` or `ref` of the entry. To change the remote, remove the entry from `vitehub.lock` and pull into a new folder."},WORKSPACE_CHECKOUT_OVERLAP:{why:({dir:e,other:t,otherDir:n,workspace:r})=>`Workspace "${r}" folder "${e}" overlaps Workspace "${t}" folder "${n}".`,fix:`Use separate checkout folders that do not contain one another.`},WORKSPACE_CHECKOUT_PATH:{why:({other:e,path:t,problem:n})=>({excluded:`The path "${t}" is excluded from the checkout.`,"not-portable":`The path "${t}" has a component that is not portable between file systems.`,"not-relative":`The remote path "${t}" is not a relative Workspace path.`,reserved:`The top-level file name "${t}" is reserved by the operation input map.`,spelling:`The checkout paths "${e}" and "${t}" use different spellings for one file-system path, or replace a file with a directory.`})[n],fix:"Rename the path to a portable name that the checkout does not exclude, before you pull or push it. For two spellings of one path, rename one. For a file that a folder replaces, keep local edits elsewhere, remove the `vitehub.lock` entry, and pull into a new empty folder."},WORKSPACE_CHECKOUT_SYMLINK:{why:({path:e})=>e===`vitehub.lock`?`vitehub.lock is a symbolic link. A checkout reads and writes only a real lock file.`:`${e} is a symbolic link. A checkout reads and writes only real files and folders.`,fix:`Replace the symbolic link with a real folder or file, then try again.`},WORKSPACE_CHECKOUT_TOO_LARGE:{why:({largest:e,limit:t,size:n,workspace:r})=>`The push of Workspace "${r}" is ${n}, over the ${t} limit of one push.${e?` Largest files: ${e}.`:``}`,fix:`A push is one revision and sends each changed file whole, with binary files in base64. Keep large media in Blob, or add new files in smaller groups with a push after each group.`},WORKSPACE_CHECKOUT_USAGE:{why:({command:e,flag:t,problem:n})=>({flag:`Unknown flag --${t}.`,names:`${e} accepts at most one Workspace name.`,value:`--${t} needs a value.`})[n],fix:"Pass only the flags of the command, each with its value, and at most one Workspace name, for example `vitehub pull docs --dir content`."},WORKSPACE_LOCK_BUSY:{why:`Another vitehub command is writing vitehub.lock: vitehub.lock.lock exists.`,fix:"Wait for that command to finish and try again. If no vitehub command runs, delete `vitehub.lock.lock`."},WORKSPACE_LOCK_INVALID:{why:({problem:e})=>e===`json`?`vitehub.lock is not valid JSON.`:"vitehub.lock has no `version: 1` and `workspaces` object.",fix:"Fix the conflict in `vitehub.lock`, or delete the entry and pull again."},WORKSPACE_RENAMED_STORE_PROVIDER_KEY:{why:({provider:e})=>`The Workspace \`store\` sets \`provider: ${e}\`. ViteHub renamed this key to \`driver\`, and it does not read \`provider\`, so the Store would not be the one you chose.`,fix:({driver:e})=>`Set \`store: { driver: ${e} }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`},WORKSPACE_RENAMED_STORE_REPOSITORY_KEY:{why:()=>"The GitHub Workspace `store` sets `repository`. ViteHub renamed this key to `repo`, and it does not read `repository`, so the Store would use `VITEHUB_WORKSPACE_GITHUB_REPOSITORY` or no repository.",fix:()=>'Rename `repository` to `repo` in `store: { driver: "github" }`, or run `vitehub migrate` to rename it in every file.'},WORKSPACE_UNKNOWN_STORE_DRIVER:{why:({driver:e,renamed:t})=>t?`The Workspace \`store.driver\` is ${e}. ViteHub renamed this driver to "${t}", and it does not read ${e}.`:`The Workspace \`store.driver\` ${e} is not a Workspace Store driver.`,fix:({renamed:e})=>e?`Set \`store: { driver: "${e}" }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`:'Set `store.driver` to "local", "memory", "github", "cloudflare", or "vercel", or pass a Store object.'},WORKSPACE_DEFAULT_REF_DELETE:{why:"`history.deleteRef()` cannot delete `main` or the ref that the Workspace working tree follows.",fix:"Delete another ref, such as the ref of one run. To remove files from the working ref, commit without them. To remove the whole Workspace history, call `delete()` on the Blob + Database Store."},WORKSPACE_POSTGRES_HISTORY_SCHEMA_MISSING:{why:`The Postgres Database for this Workspace is missing its history catalog table.`,fix:"Apply the migrations for `workspaceHistorySchema` from `vite-hub/workspace/blob-database/postgres`. For a ViteHub Database, add the schema to its Definition and run `vitehub database generate` and `vitehub database migrate`. With PGlite, stop the dev server before running `vitehub database migrate` and start it again afterward, because only one process can open the local PGlite folder at a time."},WORKSPACE_REGISTRY_LOAD_FAILED:{why:({reason:e,workspace:t})=>`The module of Workspace "${t}" did not load: ${e}`,fix:"Read `error.cause` for the first error. Make sure that the module of the Workspace loads without errors and exports its Definition: the default export of a file in `server/workspaces/`, or the export that the Vite plugin names in its Workspace contribution. Then restart the dev server or build again."},WORKSPACE_STORE_IN_WORKER_MEMORY:{why:`At least one Workspace in this Cloudflare build uses the default Memory Store. It keeps the files that the app writes in the memory of the Worker isolate. The files are lost when the isolate stops, and other isolates do not see them. Sources still read from the bundle.`,fix:'Set `workspace: { store: { driver: "cloudflare" } }` in `vitehub()` to keep the files in Cloudflare Artifacts, or use `{ driver: "github" }`. To keep the memory Store on purpose, set `store: { driver: "memory" }`, and the build does not print this notice.'},WORKSPACE_SOURCE_ACCESS_FAILED:{why:({source:e,workspace:t})=>`Source "${e}" of Workspace "${t}" cannot reach its data with the credentials of the build. The deployed app would fail on its first read.`,fix:"Read `error.cause` for the response of the provider. For a GitHub Source, check that `repo` and `ref` exist and that the token of the build (`auth`, `VITEHUB_GITHUB_TOKEN`, or `gh auth token`) can read the repository. Then build again."},WORKSPACE_R0069:$("Use a Store with retained history: `createBlobDatabaseWorkspaceStore()` or the `github` Store. Open the Workspace with a scope that grants the complete Workspace, not selected paths."),WORKSPACE_R0070:$("Pass a `limit` from 1 to 100, and pass a `cursor` only with the `ref` of the `history.list()` call that returned it."),WORKSPACE_R0071:$("Use a ref name with up to 128 letters, numbers, `_`, and `-`, joined by single `.` or `/`, for example `draft` or `team/review`. In a GitHub Store with `refs`, use `published` or `draft`, not the branch name."),WORKSPACE_R0072:$("Set the `repo` option of the GitHub Store or `VITEHUB_WORKSPACE_GITHUB_REPOSITORY`, for example `owner/repo`. Set the `token` option or `VITEHUB_GITHUB_TOKEN`."),WORKSPACE_R0073:$("Make the commit message or metadata shorter, as the message says. Remove each `Vitehub-Metadata:` line from the message, and pass the values in the `metadata` option."),WORKSPACE_R0001:$("Pass the path of a file or folder in the Workspace, for example `docs/guide.md`. The Workspace root itself cannot be written, moved, or deleted."),WORKSPACE_R0002:$("Enable at least one operation in `createWorkspaceTools(workspace, { operations })`, for example `{ operations: { read: true } }`."),WORKSPACE_R0003:$('Get write tools from `useWorkspace(name, { mode: "write" }).tools.write()`. Do not pass the result of `useWorkspace()` to `createWorkspaceTools()`. Or remove `write` from `operations`.'),WORKSPACE_B0001:$("Export the Workspace Definition from the file, for example `export default defineWorkspace({ ... })`. For a contributed Workspace, set `definition.export` to the name of the export."),WORKSPACE_B0002:$("Use `defineWorkspace()` in `server/workspaces/<name>.ts`. Move the `defineAgent()` call to `server/agents/<name>/agent.ts`."),WORKSPACE_B0003:$(`Rename or remove one of the definitions that the message lists. Each Workspace name has one definition.`),WORKSPACE_B0004:$("Set `vitehub.workspaces` in the plugin to an array of `{ name, definition: { module, export? }, reason? }` entries, or to a function that returns one. Set `module` to an absolute path, a `file:` URL, or a package specifier."),WORKSPACE_B0005:$('Set the Cloudflare Artifacts Store in the `workspace` config, for example `vitehub({ workspace: { store: { driver: "cloudflare", binding: "WORKSPACE_ARTIFACTS", namespace: "vitehub" } } })`, and remove `store` from the Workspace Definition. Or remove the import that the build cannot load from the Definition file, so that the build can read its `store`.'),WORKSPACE_R0004:$("Put a value after the option, for example `--timeout 30000` or `--url http://localhost:5173`."),WORKSPACE_R0005:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0006:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0007:$("Remove the option. `vitehub workspace dev --help` lists the options."),WORKSPACE_R0008:$("Put a command after `exec`, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0009:$("Put `exec` before the command, for example `vitehub workspace dev docs exec ls -la`. Or omit the command to open the interactive command loop."),WORKSPACE_C0001:$('Set `workspace` to an object, for example `workspace: { store: { driver: "memory" } }`, or to `false`.'),WORKSPACE_C0002:$("Remove the option. The `workspace` config accepts `assets`, `projectRoot`, `root`, and `store`."),WORKSPACE_R0015:$("Remove the option. `defineWorkspace()` accepts `bindings`, `commit`, `hooks`, `loaders`, `plugins`, `rootDir`, `rules`, `sourceRootDir`, `sources`, and `store`."),WORKSPACE_R0016:$("Pass an object to `defineWorkspace()`, for example `defineWorkspace({ sources: {} })`."),WORKSPACE_R0017:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0018:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0019:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0020:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0021:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0022:$('Pass the Workspace name as a non-empty string, for example `registerWorkspace("docs", definition)` or `registerWorkspacePlugin("docs", plugin)`.'),WORKSPACE_R0023:$('Set `maxBytes` to a number of bytes or to a string such as `"512kb"` or `"10mb"`.'),WORKSPACE_R0024:$('Give each Workspace plugin a non-empty string `id`, for example `{ id: "my-plugin", rules }`.'),WORKSPACE_R0025:$("Declare the target as a `url()` Source in the Workspace Definition, and make the Source visible in the Workspace scope."),WORKSPACE_R0026:$("Use a Store that supports rebase: `github` or `cloudflare`. Or do not call `rebase()` on this Workspace."),WORKSPACE_R0027:$("Set another `binding` in the Workspace `store` options, or set `namespace` to the namespace that Wrangler config already has for that binding."),WORKSPACE_R0028:$(`The client closed the Workspace Dev connection before the command finished. Run the command again and keep the connection open.`),WORKSPACE_R0029:$("Give each Cloudflare Artifacts namespace its own `binding` in the Workspace `store` options."),WORKSPACE_R0033:$(`Run the operation again. If it fails again, check the Blob store of the project in the Vercel dashboard.`),WORKSPACE_R0034:$('Pass the Workspace name, for example `createWorkspacePreparation({ workspace: "docs" })`.'),WORKSPACE_R0035:$('Pass Source keys of the Workspace as non-empty strings, for example `sources: ["handbook"]`, or omit `sources`.'),WORKSPACE_R0036:$("Set `retryDelayMs` to a number of milliseconds from 0 to 2147483647, or omit it to use 10000."),WORKSPACE_R0037:$('Set `materialize: "startup"` on the Sources to prepare, or pass their keys in `sources`.'),WORKSPACE_R0038:$("Check each Source that the message names: its URL, repository, or files, and its credentials. Without `requireNonEmpty`, an empty Source is ready."),WORKSPACE_R0039:$("`stop()` cancelled this preparation. Call `start()` again to prepare the Workspace."),WORKSPACE_R0040:$("Pass a non-empty command, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0041:$('Pass a Workspace name, or a Workspace from `useWorkspace(name, { mode: "write" })`, that can start a Workspace Session.'),WORKSPACE_R0042:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0043:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0044:$("Make sure that the Workspace Session host can run `readlink` and can read the path in the message."),WORKSPACE_R0045:$("Set `executionAuthority` on the Workspace Session host. Use `unknownExecutionAuthority` from `@vite-hub/runtime` when the host cannot describe it."),WORKSPACE_C0003:$("Rename the Source key to one file name without `/` and without a `.json` ending, for example `issues`. ViteHub keeps the request descriptor at `.vitehub/sources/<key>.json`."),WORKSPACE_C0004:$('Set `mount` on the Source to a folder, for example `mount: "docs"`, or set `probeKeys`. A Workspace Scope grant needs paths, and a Source at the root has none.'),WORKSPACE_C0005:$('Use a Source helper so that the Source kind is explicit, for example `github({ repo: "owner/name" })`, `url({ url, workspacePath: "issues.json" })`, or `file({ path: "README.md" })`. A `{ source: { ... } }` wrapper does not help, because ViteHub reads the options in it the same way.'),WORKSPACE_C0006:$('Pass `path` or `workspacePath` to `file()`, for example `file({ path: "README.md" })`.'),WORKSPACE_C0007:$('When the URL has a query, set `path` on the Source config, for example `{ url, path: "issues.json" }`. Or use the `url()` helper with `workspacePath: "issues.json"`.'),WORKSPACE_R0046:$("Set `workspacePath` on the `url()` Source to read the response as a file. A request-only Source answers only `curl` Source requests."),WORKSPACE_R0047:$("Read the `url()` Source at its `workspacePath`. The Source has no other file."),WORKSPACE_R0048:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0049:$('Set `responseType` to `"json"` or `"text"`.'),WORKSPACE_R0050:$('Set `method` to `"GET"`, `"HEAD"`, or `"POST"`.'),WORKSPACE_R0051:$("Use `query` for a fixed query or `querySchema` for a query that the Agent sets. Remove the other one, and remove the query from `url` when you use `querySchema`."),WORKSPACE_R0052:$("Use `body` for a fixed body or `bodySchema` for a body that the Agent sets. Remove the other one."),WORKSPACE_R0053:$('Set `method: "POST"` to send a body, or remove `body` and `bodySchema`.'),WORKSPACE_R0054:$("Pass a schema that has `~standard.jsonSchema.input()`, the Standard JSON Schema interface. Or use a fixed `query` or `body`."),WORKSPACE_R0055:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0056:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0057:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0058:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0059:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0060:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0061:$('Return `repo` from the `github()` resolver, for example `{ repo: "owner/name" }`, or start the Agent Invocation with a `pullRequest` context value.'),WORKSPACE_R0063:$("Use the URL of exactly one Source that the Workspace scope can see. Read `.vitehub/sources/<source>.json` in the Workspace and send the URL, method, query, and body that it declares."),WORKSPACE_R0064:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0065:$("The Cloudflare Artifacts Store keeps its Git checkout in memory. A Git step used the path in the message in a way that the error code rejects, for example `ENOENT` for a missing file. Run the operation again. If it fails again, report it at https://github.com/vite-hub/vitehub/issues with the message."),WORKSPACE_R0066:$("Connect a Blob store to the Vercel project so that it gets `BLOB_STORE_ID`. Off Vercel, set `BLOB_READ_WRITE_TOKEN`."),WORKSPACE_R0074:$(`The Workspace Store keeps no file revisions, so ViteHub cannot prove that the file at the path in the message is the one it started to remove. Check the file. If it must go, delete it in the Store itself, for example in its directory or bucket, because the Workspace rejects writes under a Source. Then run the Source operation again.`),WORKSPACE_R0075:$("Remove `read` from the rule. Workspace rules limit writes only, so `read: false` would not hide the files. Keep files that a reader must not see out of the Workspace, for example in another Workspace or in an Env secret."),WORKSPACE_R0076:$("Remove the option from the rule. A Workspace rule accepts `commit`, `maxBytes`, `mediaType`, `validate`, and `write`."),WORKSPACE_R0077:$('Pass the name of the history Database, `database: "history"`, or its Drizzle database, `database: () => useDatabase("history").db` with `import { useDatabase } from "vite-hub/database"`. The Database can be SQLite, libSQL, D1, or Postgres. A Database Definition from `defineDatabase()` is not a Drizzle database.')}})}));function aq(e,t={},n=`[vitehub] ${e.why}`){let r=new rG(e.code,n,t);return Object.defineProperties(r,{docs:{configurable:!0,enumerable:!1,value:e.docs,writable:!1},fix:{configurable:!0,enumerable:!1,value:e.fix,writable:!1},why:{configurable:!0,enumerable:!1,value:e.why,writable:!1}})}function oq(e,t=`not-relative`){let n=e.slice(0,4096);return aq(rq.WORKSPACE_PATH_INVALID({path:JSON.stringify(n),problem:t}),{details:{path:n}})}function sq(e){let t=e.toLowerCase().split(`:`,1)[0];return{normalized:t.replace(/[ .]+$/,``),isTraversal:/^(?:\.(?: +[. ]*)?|\.\.(?: +[. ]*)?)$/.test(t)}}function cq(e=``,t={}){let n=e.replace(/\\/g,`/`),r=n.replace(/^\/+/,``).replace(/\/+$/,``),i=r.split(`/`).filter(Boolean);if(!t.allowEmpty&&!r||n.startsWith(`/`)||/^[a-z]:/i.test(n)||n.includes(`\0`))throw oq(e);let a=i.map((e,t)=>({classification:sq(e),index:t,name:e.toLowerCase()}));if(a.some(({classification:e})=>e.isTraversal))throw oq(e);if(a.some(({classification:e,index:n,name:r})=>{let i=e.normalized===`.git`||/^git~\d+$/.test(e.normalized)||n===0&&e.normalized===`.vitehub`||n===0&&/^vitehu~\d+$/.test(e.normalized),a=(e.normalized===`.git`||n===0&&e.normalized===`.vitehub`)&&r===e.normalized;return i&&(!t.allowReserved||!a)}))throw oq(e,`reserved`);return r}var lq=t((()=>{iq(),mG()}));function uq(e){try{let t=JSON.parse(WK(e));if(!t||typeof t!=`object`||!(`epoch`in t)||!(`type`in t)||typeof t.epoch!=`string`||!t.epoch)return;if(t.type===`session`&&`access`in t&&(t.access===`read`||t.access===`write`))return t.access===`read`&&`reason`in t&&(t.reason===`access`||t.reason===`document`||t.reason===`version`)?{type:`session`,access:t.access,epoch:t.epoch,reason:t.reason}:{type:`session`,access:t.access,epoch:t.epoch};if(t.type===`reset`&&`reason`in t&&(t.reason===`source-changed`||t.reason===`stale`))return{type:`reset`,epoch:t.epoch,reason:t.reason}}catch{}}function dq(e){if(typeof e!=`string`||e.length===0||e.length>4096||e.includes(`\0`)||e.startsWith(`/`)||e.endsWith(`/`)||e.includes(`\\`)||e.includes(`//`)||/^[a-z]:/i.test(e))return!1;try{return cq(e)===e}catch{return!1}}function fq(e){try{let t=JSON.parse(WK(e));if((t.operation===`create`||t.operation===`delete`||t.operation===`update`)&&dq(t.path))return{operation:t.operation,path:t.path};if(t.operation===`move`&&dq(t.from)&&dq(t.to))return{operation:t.operation,from:t.from,to:t.to}}catch{}}function pq(e){let t=rK();return Z(t,4),mK(t,JSON.stringify(e)),aK(t)}function mq(e){let t=rK();return Z(t,6),mK(t,JSON.stringify(e)),aK(t)}function hq(e){try{let t=JSON.parse(WK(e));if(t&&typeof t==`object`&&`kind`in t&&t.kind===`notice`)return{kind:`notice`,body:`body`in t?t.body:void 0};if(!t||typeof t!=`object`||!(`id`in t)||typeof t.id!=`string`||!t.id||t.id.length>128||!(`kind`in t))return;if(t.kind===`request`)return{kind:`request`,id:t.id,body:`body`in t?t.body:void 0};if(t.kind!==`answer`||!(`ok`in t))return;if(t.ok===!0)return{kind:`answer`,id:t.id,ok:!0,body:`body`in t?t.body:void 0};if(t.ok===!1&&`why`in t&&typeof t.why==`string`)return{kind:`answer`,id:t.id,ok:!1,why:t.why}}catch{}}function gq(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _q,vq,yq=t((()=>{tq(),AK(),lq(),_q=`@workspace`,vq=`ping`})),bq,xq=t((()=>{bq=Date.now}));function Sq(e,t=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__){return t===`/`?e:`${t.replace(/\/+$/,``)}${e}`}function Cq(e){let t;e.on(`status`,({status:n})=>{clearInterval(t),t=void 0;let r=e.ws;if(n!==`connected`||!r)return;let i=r.onmessage;r.onmessage=function(t){if(t.data!==`pong`)return i?.call(this,t);e.ws===r&&(e.wsLastMessageReceived=bq())},t=setInterval(()=>{e.ws===r&&r.readyState===r.OPEN&&r.send(vq)},wq)})}var wq,Tq=t((()=>{yq(),xq(),wq=15e3}));function Eq(e){return typeof e==`string`?e:null}function Dq(e){let t=e.getMap(Oq.status),n=t.get(`issues`),r=t.get(`savedBy`),i={issues:Array.isArray(n)?n:[],savedBy:r&&!Array.isArray(r)&&r instanceof Object?r:null};return{digest:Eq(t.get(`digest`)),error:Eq(t.get(`error`)),issues:i.issues,savedAt:Eq(t.get(`savedAt`)),savedBy:i.savedBy}}var Oq,kq=t((()=>{Oq=Object.freeze({body:`body`,fields:`fields`,status:`status`})}));function Aq(e){try{return String(e)===e}catch{return!1}}function jq(e){if(!Aq(e.id)||!e.id||e.id.length>256)throw hG.REALTIME_INVALID_USER();let t=0;for(let n=0;n<e.id.length;n++)t=Math.imul(31,t)+e.id.charCodeAt(n)|0;let n=(Aq(e.name)&&e.name||Aq(e.email)&&e.email||`Anonymous`).slice(0,256),r={color:Pq[Math.abs(t)%Pq.length],id:e.id,name:n};return Aq(e.image)&&e.image&&e.image.length<=2048&&(r.image=e.image),r}function Mq(e){return gq(e)?Aq(e.id)&&e.id.length>0&&e.id.length<=256&&Aq(e.name)&&e.name.length>0&&e.name.length<=256&&Aq(e.color)&&/^#[\da-f]{6}$/i.test(e.color)&&(e.image===void 0||Aq(e.image)&&e.image.length<=2048):!1}function Nq(e){let t=[];for(let[n,r]of e)if(Mq(r.user)){let{color:e,id:i,image:a,name:o}=r.user,s={color:e,id:i,name:o,clientId:n};a!==void 0&&(s.image=a),t.push(s)}return t}var Pq,Fq=t((()=>{yq(),gG(),Pq=[`#E11D48`,`#D97706`,`#059669`,`#0891B2`,`#2563EB`,`#7C3AED`,`#C026D3`]})),Iq,Lq,Rq,zq,Bq,Vq=t((()=>{Iq=()=>new Map,Lq=e=>{let t=Iq();return e.forEach((e,n)=>{t.set(n,e)}),t},Rq=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},zq=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},Bq=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),Hq,Uq,Wq=t((()=>{Vq(),AG(),RG(),Hq=class{constructor(){this._observers=Iq()}on(e,t){return Rq(this._observers,e,kG).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return NG((this._observers.get(e)||Iq()).values()).forEach(e=>e(...t))}destroy(){this._observers=Iq()}},Uq=class{constructor(){this._observers=Iq()}on(e,t){Rq(this._observers,e,kG).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return NG((this._observers.get(e)||Iq()).values()).forEach(e=>e(...t))}destroy(){this._observers=Iq()}}})),Gq,Kq,qq=t((()=>{Gq=Symbol(`Equality`),Kq=(e,t)=>e===t||!!e?.[Gq]?.(t)||!1})),Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ=t((()=>{qq(),Jq=e=>typeof e==`object`,Yq=Object.assign,Xq=Object.keys,Zq=(e,t)=>{for(let n in e)t(e[n],n)},Qq=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},$q=e=>Xq(e).length,eJ=e=>{for(let t in e)return!1;return!0},tJ=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},nJ=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),rJ=(e,t)=>e===t||$q(e)===$q(t)&&tJ(e,(e,n)=>(e!==void 0||nJ(t,n))&&Kq(t[n],e)),iJ=Object.freeze,aJ=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&aJ(e[t])}return iJ(e)}})),sJ,cJ,lJ,uJ,dJ=t((()=>{oJ(),qq(),sJ=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&sJ(e,t,n+1)}},cJ=e=>e,lJ=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Gq]!=null)return e[Gq](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!lJ(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if($q(e)!==$q(t))return!1;for(let n in e)if(!nJ(e,n)||!lJ(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!lJ(e[n],t[n]))return!1;break;default:return!1}return!0},uJ=(e,t)=>t.includes(e)})),fJ,pJ=t((()=>{crypto.subtle,fJ=crypto.getRandomValues.bind(crypto)})),mJ,hJ,gJ,_J=t((()=>{pJ(),mJ=()=>fJ(new Uint32Array(1))[0],hJ=`10000000-1000-4000-8000-100000000000`,gJ=()=>hJ.replace(/[018]/g,e=>(e^mJ()&15>>e/4).toString(16))})),vJ,yJ=t((()=>{vJ=e=>new Promise(e),Promise.all.bind(Promise)})),bJ,xJ=t((()=>{bJ=e=>e===void 0?null:e})),SJ,CJ,wJ,TJ,EJ,DJ,OJ=t((()=>{SJ=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},CJ=new SJ,wJ=!0;try{typeof window<`u`&&typeof localStorage<`u`&&localStorage&&(CJ=localStorage,wJ=!1)}catch{}TJ=CJ,EJ=e=>wJ||addEventListener(`storage`,e),DJ=e=>wJ||removeEventListener(`storage`,e)})),kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ=t((()=>{Vq(),ZG(),xJ(),OJ(),dJ(),kJ=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,AJ=typeof window<`u`&&typeof document<`u`&&!kJ,typeof navigator<`u`&&/Mac/.test(navigator.platform),MJ=[],NJ=()=>{if(jJ===void 0){if(kJ){jJ=Iq();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&jJ.set(t,``),t=r):t===null?MJ.push(r):(jJ.set(t,r),t=null)}t!==null&&jJ.set(t,``)}else typeof location==`object`?(jJ=Iq(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);jJ.set(`--${WG(t,`-`)}`,n),jJ.set(`-${WG(t,`-`)}`,n)}})):jJ=Iq()}return jJ},PJ=e=>NJ().has(e),FJ=e=>bJ(kJ?{}[e.toUpperCase().replaceAll(`-`,`_`)]:TJ.getItem(e)),IJ=e=>PJ(`--`+e)||FJ(e)!==null,LJ=IJ(`production`),RJ=kJ&&uJ({}.FORCE_COLOR,[`true`,`1`,`2`]),zJ=RJ||!PJ(`--no-colors`)&&!IJ(`no-color`)&&(!kJ||process.stdout.isTTY)&&(!kJ||PJ(`--color`)||FJ(`COLORTERM`)!==null||(FJ(`TERM`)||``).includes(`color`))})),VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ=t((()=>{ZG(),BJ(),VJ=e=>new Uint8Array(e),HJ=e=>new Uint8Array(e),UJ=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=zG(e[n]);return btoa(t)},WJ=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),GJ=e=>{let t=atob(e),n=VJ(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},KJ=e=>new Uint8Array(Buffer.from(e,`base64`)),qJ=AJ?UJ:WJ,JJ=AJ?GJ:KJ,YJ=e=>{let t=VJ(e.byteLength);return t.set(e),t}})),ZJ,QJ,$J=t((()=>{ZJ=class{constructor(e,t){this.left=e,this.right=t}},QJ=(e,t)=>new ZJ(e,t)})),eY,tY,nY,rY,iY,aY,oY,sY=t((()=>{ZG(),wG(),eY=e=>e.next()>=.5,tY=(e,t,n)=>vG(e.next()*(n+1-t)+t),nY=(e,t,n)=>vG(e.next()*(n+1-t)+t),rY=(e,t,n)=>nY(e,t,n),iY=e=>zG(rY(e,97,122)),aY=(e,t=0,n=20)=>{let r=rY(e,t,n),i=``;for(let t=0;t<r;t++)i+=iY(e);return i},oY=(e,t)=>t[rY(e,0,t.length-1)]})),cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X=t((()=>{oJ(),RG(),tK(),BJ(),qq(),dJ(),ZG(),sY(),OG(),cY=Symbol(`0schema`),lY=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(XG(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
|
|
360
|
-
`)}},uY=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Gq]?Kq(e,t):LG(e)?PG(e,e=>FG(t,t=>uY(e,t))):Jq(e)?tJ(e,(e,n)=>uY(e,t[n])):!1,dY=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),uY(t,n)}equals(e){return this.constructor===e.constructor&&lJ(this.shape,e.shape)}[cY](){return!0}[Gq](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){$G()}get nullable(){return qY(this,cX)}get optional(){return new CY(this)}cast(e){return fX(e,this),e}expect(e){return fX(e,this),e}},fY=class extends dY{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},pY=(e,t=null)=>new fY(e,t),pY(fY),mY=class extends dY{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},hY=e=>new mY(e),pY(mY),gY=class extends dY{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},_Y=(...e)=>new gY(e),vY=pY(gY),yY=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),bY=e=>{if(rX.check(e))return[yY(e)];if(vY.check(e))return e.shape.map(e=>e+``);if(nX.check(e))return[`[+-]?\\d+.?\\d*`];if(iX.check(e))return[`.*`];if(JY.check(e))return e.shape.map(bY).flat(1);eK()},xY=class extends dY{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(bY).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},pY(xY),SY=Symbol(`optional`),CY=class extends dY{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[SY](){return!0}},wY=pY(CY),TY=class extends dY{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new TY,pY(TY),EY=class e extends dY{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):tJ(this.shape,(n,r)=>{let i=this._isPartial&&!nJ(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},DY=e=>new EY(e),OY=pY(EY),kY=hY(e=>e!=null&&(e.constructor===Object||e.constructor==null)),AY=class extends dY{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&tJ(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},jY=(e,t)=>new AY(e,t),MY=pY(AY),NY=class extends dY{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&tJ(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},PY=(...e)=>new NY(e),pY(NY),FY=class extends dY{constructor(e){super(),this.shape=e.length===1?e[0]:new KY(e)}check(e,t){let n=LG(e)&&PG(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},IY=(...e)=>new FY(e),LY=pY(FY),RY=hY(e=>LG(e)),zY=class extends dY{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},BY=(e,t=null)=>new zY(e,t),pY(zY),VY=BY(dY),HY=class extends dY{constructor(e){super(),this.len=e.length-1,this.args=PY(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},UY=pY(HY),WY=hY(e=>typeof e==`function`),GY=class extends dY{constructor(e){super(),this.shape=e}check(e,t){let n=PG(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},pY(GY,e=>e.shape.length>0),KY=class extends dY{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=FG(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},qY=(...e)=>e.findIndex(e=>JY.check(e))>=0?qY(...e.map(e=>dX(e)).map(e=>JY.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new KY(e),JY=pY(KY),YY=()=>!0,XY=hY(YY),ZY=pY(mY,e=>e.shape===YY),QY=hY(e=>typeof e==`bigint`),$Y=hY(e=>e===QY),eX=hY(e=>typeof e==`symbol`),hY(e=>e===eX),tX=hY(e=>typeof e==`number`),nX=hY(e=>e===tX),rX=hY(e=>typeof e==`string`),iX=hY(e=>e===rX),aX=hY(e=>typeof e==`boolean`),oX=hY(e=>e===aX),sX=_Y(void 0),pY(gY,e=>e.shape.length===1&&e.shape[0]===void 0),_Y(void 0),cX=_Y(null),lX=pY(gY,e=>e.shape.length===1&&e.shape[0]===null),pY(Uint8Array),pY(fY,e=>e.shape===Uint8Array),uX=qY(tX,rX,cX,sX,QY,aX,eX),(()=>{let e=IY(XY),t=jY(rX,XY),n=qY(tX,rX,cX,aX,e,t);return e.shape=n,t.shape.values=n,n})(),dX=e=>{if(VY.check(e))return e;if(kY.check(e)){let t={};for(let n in e)t[n]=dX(e[n]);return DY(t)}if(RY.check(e))return qY(...e.map(dX));if(uX.check(e))return _Y(e);if(WY.check(e))return pY(e);eK()},fX=LJ?()=>{}:(e,t)=>{let n=new lY;if(!t.check(e,n))throw QG(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},pX=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:dX(e),h:t}),this}else(e){return this.if(XY,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw QG(`Unhandled pattern`)}}},mX=e=>new pX(e),hX=mX(XY).if(nX,(e,t)=>tY(t,EG,TG)).if(iX,(e,t)=>aY(t)).if(oX,(e,t)=>eY(t)).if($Y,(e,t)=>BigInt(tY(t,EG,TG))).if(JY,(e,t)=>gX(t,oY(t,e.shape))).if(OY,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(wY.check(i)){if(eY(t))continue;i=i.shape}n[r]=hX(i,t)}return n}).if(LY,(e,t)=>{let n=[],r=nY(t,0,42);for(let i=0;i<r;i++)n.push(gX(t,e.shape));return n}).if(vY,(e,t)=>oY(t,e.shape)).if(lX,(e,t)=>null).if(UY,(e,t)=>{let n=gX(t,e.res);return()=>n}).if(ZY,(e,t)=>gX(t,oY(t,[tX,rX,cX,sX,QY,aX,IY(tX),jY(qY(`a`,`b`,`c`),tX)]))).if(MY,(e,t)=>{let n={},r=tY(t,0,3);for(let i=0;i<r;i++){let r=gX(t,e.shape.keys);n[r]=gX(t,e.shape.values)}return n}).done(),gX=(e,t)=>hX(dX(t),e)})),vX,yX,bX,xX,SX,CX,wX=t((()=>{Vq(),_X(),vX=typeof document<`u`?document:{},hY(e=>e.nodeType===CX),typeof DOMParser<`u`&&new DOMParser,hY(e=>e.nodeType===bX),hY(e=>e.nodeType===xX),yX=e=>zq(e,(e,t)=>`${t}:${e};`).join(``),bX=vX.ELEMENT_NODE,xX=vX.TEXT_NODE,vX.CDATA_SECTION_NODE,vX.COMMENT_NODE,SX=vX.DOCUMENT_NODE,vX.DOCUMENT_TYPE_NODE,CX=vX.DOCUMENT_FRAGMENT_NODE,hY(e=>e.nodeType===SX)})),TX,EX=t((()=>{TX=Symbol})),DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX=t((()=>{EX(),xq(),DX=TX(),OX=TX(),kX=TX(),AX=TX(),jX=TX(),MX=TX(),NX=TX(),PX=TX(),FX=TX(),IX=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},bq()})),RX,zX,BX,VX,HX,UX,WX=t((()=>{BJ(),AG(),$J(),wX(),Vq(),LX(),RX={[DX]:QJ(`font-weight`,`bold`),[OX]:QJ(`font-weight`,`normal`),[kX]:QJ(`color`,`blue`),[jX]:QJ(`color`,`green`),[AX]:QJ(`color`,`grey`),[MX]:QJ(`color`,`red`),[NX]:QJ(`color`,`purple`),[PX]:QJ(`color`,`orange`),[FX]:QJ(`color`,`black`)},zX=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=Iq(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=RX[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=yX(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},BX=zJ?zX:IX,VX=(...e)=>{console.log(...BX(e)),UX.forEach(t=>t.print(e))},HX=(...e)=>{console.warn(...BX(e)),e.unshift(PX),UX.forEach(t=>t.print(e))},UX=kG()})),GX,KX,qX,JX=t((()=>{GX=e=>({[Symbol.iterator](){return this},next:e}),KX=(e,t)=>GX(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),qX=(e,t)=>GX(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*YX(e){let t=Q(e.restDecoder);for(let n=0;n<t;n++){let t=Q(e.restDecoder),n=e.readClient(),r=Q(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Q(e.restDecoder);yield new b1(UZ(n,r),t),r+=t}else if(31&t){let i=!(t&192),a=new g1(UZ(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,_1(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new B$(UZ(n,r),t),r+=t}}}}var XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1=t((()=>{Wq(),RG(),wG(),Vq(),AK(),tq(),_J(),yJ(),XJ(),tK(),_G(),dJ(),AG(),WX(),JX(),oJ(),BJ(),XX=class{constructor(e,t){this.clock=e,this.len=t}},ZX=class{constructor(){this.clients=new Map}},QX=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])oQ(e,i,o.clock,o.len,n)}}),$X=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=vG((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},eZ=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&$X(n,t.clock)!==null},tZ=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new XX(r.clock,xG(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},nZ=e=>{let t=new ZX;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)MG(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return tZ(t),t},rZ=(e,t,n,r)=>{Rq(e.clients,t,()=>[]).push(new XX(n,r))},iZ=()=>new ZX,aZ=e=>{let t=iZ();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new XX(i,a))}}r.length>0&&t.clients.set(n,r)}),t},oZ=(e,t)=>{Z(e.restEncoder,t.clients.size),NG(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Z(e.restEncoder,t);let r=n.length;Z(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},sZ=e=>{let t=new ZX,n=Q(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Q(e.restDecoder),r=Q(e.restDecoder);if(r>0){let i=Rq(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new XX(e.readDsClock(),e.readDsLen()))}}return t},cZ=(e,t,n)=>{let r=new ZX,i=Q(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Q(e.restDecoder),a=Q(e.restDecoder),o=n.clients.get(i)||[],s=ZZ(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&rZ(r,i,s,a-s);let e=$Z(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,h1(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,h1(t,c,a-c.id.clock)),c.delete(t))}else rZ(r,i,n,a-n)}}if(r.clients.size>0){let e=new vZ;return Z(e.restEncoder,0),oZ(e,r),e.toUint8Array()}return null},lZ=mJ,uZ=class e extends Hq{constructor({guid:e=gJ(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=lZ(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new YZ,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=vJ(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>vJ(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&mQ(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(NG(this.subdocs).map(e=>e.guid))}transact(e,t=null){return mQ(this,e,t)}get(e,t=zQ){let n=Rq(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==zQ&&r!==t){if(r===zQ){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=``){return this.get(e,a$)}getText(e=``){return this.get(e,E$)}getMap(e=``){return this.get(e,c$)}getXmlElement(e=``){return this.get(e,j$)}getXmlFragment(e=``){return this.get(e,k$)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,NG(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,mQ(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},dZ=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Q(this.restDecoder)}readDsLen(){return Q(this.restDecoder)}},fZ=class extends dZ{readLeftID(){return UZ(Q(this.restDecoder),Q(this.restDecoder))}readRightID(){return UZ(Q(this.restDecoder),Q(this.restDecoder))}readClient(){return Q(this.restDecoder)}readInfo(){return BK(this.restDecoder)}readString(){return WK(this.restDecoder)}readParentInfo(){return Q(this.restDecoder)===1}readTypeRef(){return Q(this.restDecoder)}readLen(){return Q(this.restDecoder)}readAny(){return XK(this.restDecoder)}readBuf(){return YJ(zK(this.restDecoder))}readJSON(){return JSON.parse(WK(this.restDecoder))}readKey(){return WK(this.restDecoder)}},pZ=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Q(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Q(this.restDecoder)+1;return this.dsCurrVal+=e,e}},mZ=class extends pZ{constructor(e){super(e),this.keys=[],Q(e),this.keyClockDecoder=new $K(zK(e)),this.clientDecoder=new QK(zK(e)),this.leftClockDecoder=new $K(zK(e)),this.rightClockDecoder=new $K(zK(e)),this.infoDecoder=new ZK(zK(e),BK),this.stringDecoder=new eq(zK(e)),this.parentInfoDecoder=new ZK(zK(e),BK),this.typeRefDecoder=new QK(zK(e)),this.lenDecoder=new QK(zK(e))}readLeftID(){return new VZ(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new VZ(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return XK(this.restDecoder)}readBuf(){return zK(this.restDecoder)}readJSON(){return XK(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},hZ=class{constructor(){this.restEncoder=rK()}toUint8Array(){return aK(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Z(this.restEncoder,e)}writeDsLen(e){Z(this.restEncoder,e)}},gZ=class extends hZ{writeLeftID(e){Z(this.restEncoder,e.client),Z(this.restEncoder,e.clock)}writeRightID(e){Z(this.restEncoder,e.client),Z(this.restEncoder,e.clock)}writeClient(e){Z(this.restEncoder,e)}writeInfo(e){cK(this.restEncoder,e)}writeString(e){mK(this.restEncoder,e)}writeParentInfo(e){Z(this.restEncoder,+!!e)}writeTypeRef(e){Z(this.restEncoder,e)}writeLen(e){Z(this.restEncoder,e)}writeAny(e){CK(this.restEncoder,e)}writeBuf(e){gK(this.restEncoder,e)}writeJSON(e){mK(this.restEncoder,JSON.stringify(e))}writeKey(e){mK(this.restEncoder,e)}},_Z=class{constructor(){this.restEncoder=rK(),this.dsCurrVal=0}toUint8Array(){return aK(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,Z(this.restEncoder,t)}writeDsLen(e){e===0&&eK(),Z(this.restEncoder,e-1),this.dsCurrVal+=e}},vZ=class extends _Z{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new OK,this.clientEncoder=new EK,this.leftClockEncoder=new OK,this.rightClockEncoder=new OK,this.infoEncoder=new wK(cK),this.stringEncoder=new kK,this.parentInfoEncoder=new wK(cK),this.typeRefEncoder=new EK,this.lenEncoder=new EK}toUint8Array(){let e=rK();return Z(e,0),gK(e,this.keyClockEncoder.toUint8Array()),gK(e,this.clientEncoder.toUint8Array()),gK(e,this.leftClockEncoder.toUint8Array()),gK(e,this.rightClockEncoder.toUint8Array()),gK(e,aK(this.infoEncoder)),gK(e,this.stringEncoder.toUint8Array()),gK(e,aK(this.parentInfoEncoder)),gK(e,this.typeRefEncoder.toUint8Array()),gK(e,this.lenEncoder.toUint8Array()),hK(e,aK(this.restEncoder)),aK(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){CK(this.restEncoder,e)}writeBuf(e){gK(this.restEncoder,e)}writeJSON(e){CK(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},yZ=(e,t,n,r)=>{r=xG(r,t[0].id.clock);let i=$Z(t,r);Z(e.restEncoder,t.length-i),e.writeClient(n),Z(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},bZ=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{ZZ(t,n)>e&&r.set(n,e)}),XZ(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),Z(e.restEncoder,r.size),NG(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{yZ(e,t.clients.get(n),n,r)})},xZ=(e,t)=>{let n=Iq(),r=Q(e.restDecoder);for(let i=0;i<r;i++){let r=Q(e.restDecoder),i=Array(r),a=e.readClient(),o=Q(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new B$(UZ(a,o),t),o+=t;break}case 10:{let t=Q(e.restDecoder);i[n]=new b1(UZ(a,o),t),o+=t;break}default:{let s=!(r&192),c=new g1(UZ(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,_1(e,r));i[n]=c,o+=c.length}}}}return n},SZ=(e,t,n)=>{let r=[],i=NG(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new YZ,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==b1){let i=Rq(d,u.id.client,()=>ZZ(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,ZZ(t,a)),f();else{u=e.refs[e.i++];continue}}else(i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new vZ;return bZ(e,s,new Map),Z(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},CZ=(e,t)=>bZ(e,t.doc.store,t.beforeState),wZ=(e,t,n,r=new mZ(e))=>mQ(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=xZ(r,n),o=SZ(e,i,a),s=i.pendingStructs;if(s){for(let[e,n]of s.missing)if(n<ZZ(i,e)){t=!0;break}if(o){for(let[e,t]of o.missing){let n=s.missing.get(e);(n==null||n>t)&&s.missing.set(e,t)}s.update=yQ([s.update,o.update])}}else i.pendingStructs=o;let c=cZ(r,e,i);if(i.pendingDs){let t=new mZ(IK(i.pendingDs));Q(t.restDecoder);let n=cZ(t,e,i);i.pendingDs=c&&n?yQ([c,n]):c||n}else i.pendingDs=c;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,TZ(e.doc,t)}},n,!1),TZ=(e,t,n,r=mZ)=>{let i=IK(t);wZ(i,e,n,new r(i))},EZ=(e,t,n)=>TZ(e,t,n,fZ),DZ=(e,t,n=new Map)=>{bZ(e,t.store,n),oZ(e,aZ(t.store))},OZ=(e,t=new Uint8Array([0]),n=new vZ)=>{let r=jZ(t);DZ(n,e,r);let i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(bQ(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===gZ)return _Q(i.map((e,t)=>t===0?e:TQ(e)));if(n.constructor===vZ)return yQ(i)}return i[0]},kZ=(e,t)=>OZ(e,t,new gZ),AZ=e=>{let t=new Map,n=Q(e.restDecoder);for(let r=0;r<n;r++){let n=Q(e.restDecoder),r=Q(e.restDecoder);t.set(n,r)}return t},jZ=e=>AZ(new dZ(IK(e))),MZ=(e,t)=>(Z(e.restEncoder,t.size),NG(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Z(e.restEncoder,t),Z(e.restEncoder,n)}),e),NZ=(e,t)=>MZ(e,XZ(t.store)),PZ=(e,t=new _Z)=>(e instanceof Map?MZ(t,e):NZ(t,e),t.toUint8Array()),FZ=e=>PZ(e,new hZ),IZ=class{constructor(){this.l=[]}},LZ=()=>new IZ,RZ=(e,t)=>e.l.push(t),zZ=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},BZ=(e,t,n)=>sJ(e.l,[t,n]),VZ=class{constructor(e,t){this.client=e,this.clock=t}},HZ=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,UZ=(e,t)=>new VZ(e,t),WZ=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw eK()},GZ=class{constructor(e,t){this.ds=e,this.sv=t}},KZ=(e,t)=>new GZ(e,t),KZ(iZ(),new Map),qZ=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!eZ(t.ds,e.id),JZ=(e,t)=>{let n=Rq(e.meta,JZ,kG),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<ZZ(r,n)&&rQ(e,UZ(n,t))}),QX(e,t.ds,e=>{}),n.add(t))},YZ=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},XZ=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},ZZ=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},QZ=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw eK()}n.push(t)},$Z=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=vG(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=vG((n+r)/2)}throw eK()},eQ=(e,t)=>{let n=e.clients.get(t.client);return n[$Z(n,t.clock)]},tQ=eQ,nQ=(e,t,n)=>{let r=$Z(t,n),i=t[r];return i.id.clock<n&&i instanceof g1?(t.splice(r+1,0,h1(e,i,n-i.id.clock)),r+1):r},rQ=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[nQ(e,n,t.clock)]},iQ=(e,t,n)=>{let r=t.clients.get(n.client),i=$Z(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==B$&&r.splice(i+1,0,h1(e,a,n.clock-a.id.clock+1)),a},aQ=(e,t,n)=>{let r=e.clients.get(t.id.client);r[$Z(r,t.id.clock)]=n},oQ=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=nQ(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&nQ(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},sQ=class{constructor(e,t,n){this.doc=e,this.deleteSet=new ZX,this.beforeState=XZ(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},cQ=(e,t)=>t.deleteSet.clients.size===0&&!Bq(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(tZ(t.deleteSet),CZ(e,t),oZ(e,t.deleteSet),!0),lQ=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Rq(e.changed,t,kG).add(n)},uQ=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--i-1])n instanceof g1&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);let a=t-i;return a&&e.splice(t+1-a,a),a},dQ=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=$Z(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof g1&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},fQ=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=bG(r.length-1,1+$Z(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+uQ(r,e)}})},pQ=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{tZ(a),n.afterState=XZ(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{r._item!==null&&r._item.deleted||r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&e.push(()=>{t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),BZ(r._dEH,t,n)})}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&C$(n)})}),sJ(e,[])}finally{r.gc&&dQ(a,i,r.gcFilter),fQ(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=xG($Z(e,r),1);for(let t=e.length-1;t>=n;)t-=1+uQ(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=$Z(r,n);a+1<r.length&&uQ(r,a+1)>1||a>0&&uQ(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(VX(PX,DX,`[yjs] `,OX,MX,`Changed the client-id because another client seems to be using it.`),r.clientID=lZ()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new gZ;cQ(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new vZ;cQ(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):pQ(e,t+1)}}},mQ=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new sQ(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&pQ(i,0)}}return o},hQ=class{constructor(e,t){this.gen=YX(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===b1);return this.curr}},gQ=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},_Q=e=>yQ(e,fZ,gZ),vQ=(e,t)=>{if(e.constructor===B$){let{client:n,clock:r}=e.id;return new B$(UZ(n,r+t),e.length-t)}if(e.constructor===b1){let{client:n,clock:r}=e.id;return new b1(UZ(n,r+t),e.length-t)}{let n=e,{client:r,clock:i}=n.id;return new g1(UZ(r,i+t),null,UZ(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},yQ=(e,t=mZ,n=vZ)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(IK(e))),i=r.map(e=>new hQ(e,!0)),a=null,o=new n,s=new gQ(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===b1?1:-1:n}return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)SQ(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock){if(a.struct.constructor===b1)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{SQ(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new b1(UZ(t,a.struct.id.clock+a.struct.length),e),offset:0}}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===b1?a.struct.length-=t:n=vQ(n,t)),a.struct.mergeWith(n)||(SQ(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==b1;n=e.next())SQ(s,a.struct,a.offset),a={struct:n,offset:0}}a!==null&&(SQ(s,a.struct,a.offset),a=null),CQ(s);let c=r.map(e=>sZ(e)),l=nZ(c);return oZ(o,l),o.toUint8Array()},bQ=(e,t,n=mZ,r=vZ)=>{let i=jZ(t),a=new r,o=new gQ(a),s=new n(IK(e)),c=new hQ(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===b1)c.next();else if(e.id.clock+e.length>n)for(SQ(o,e,xG(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)SQ(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}CQ(o);let l=sZ(s);return oZ(a,l),a.toUint8Array()},xQ=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:aK(e.encoder.restEncoder)}),e.encoder.restEncoder=rK(),e.written=0)},SQ=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&xQ(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Z(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},CQ=e=>{xQ(e);let t=e.encoder.restEncoder;Z(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];Z(t,r.written),hK(t,r.restEncoder)}},wQ=(e,t,n,r)=>{let i=new n(IK(e)),a=new hQ(i,!1),o=new r,s=new gQ(o);for(let e=a.curr;e!==null;e=a.next())SQ(s,t(e),0);CQ(s);let c=sZ(i);return oZ(o,c),o.toUint8Array()},TQ=e=>wQ(e,cJ,mZ,gZ),EQ=`You must not compute changes after the event-handler fired.`,DQ=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=OQ(this.currentTarget,this.target)}deletes(e){return eZ(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw QG(EQ);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r)){if(e!==null&&this.deletes(e))i=`delete`,a=jG(e.content.getContent());else return}else e!==null&&this.deletes(e)?(i=`update`,a=jG(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=jG(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw QG(EQ);let t=this.target,n=kG(),r=kG(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},OQ=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},kQ=()=>{HX(`Invalid access: Add Yjs type to a document before reading data.`)},AQ=80,jQ=0,MQ=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=jQ++}},NQ=e=>{e.timestamp=jQ++},PQ=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=jQ++},FQ=(e,t,n)=>{if(e.length>=AQ){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return PQ(r,t,n),r}{let r=new MQ(t,n);return e.push(r),r}},IQ=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>yG(t-e.index)<yG(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,NQ(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&yG(n.index-i)<r.parent.length/AQ?(PQ(n,r,i),n):FQ(e._searchMarker,r,i)},LQ=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=xG(t,i.index+n))}},RQ=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;Rq(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;BZ(r._eH,n,t)},zQ=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=LZ(),this._dEH=LZ(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw $G()}clone(){throw $G()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){RZ(this._eH,e)}observeDeep(e){RZ(this._dEH,e)}unobserve(e){zZ(this._eH,e)}unobserveDeep(e){zZ(this._dEH,e)}toJSON(){}},BQ=(e,t,n)=>{e.doc??kQ(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},VQ=e=>{e.doc??kQ();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},HQ=(e,t)=>{let n=0,r=e._start;for(e.doc??kQ();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},UQ=(e,t)=>{let n=[];return HQ(e,(r,i)=>{n.push(t(r,i,e))}),n},WQ=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},GQ=(e,t)=>{e.doc??kQ();let n=IQ(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},KQ=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new g1(UZ(o,ZZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new t1(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new g1(UZ(o,ZZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new V$(new Uint8Array(n))),i.integrate(e,0);break;case uZ:i=new g1(UZ(o,ZZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new K$(n)),i.integrate(e,0);break;default:if(n instanceof zQ)i=new g1(UZ(o,ZZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new p1(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},qQ=()=>QG(`Length exceeded!`),JQ=(e,t,n,r)=>{if(n>t._length)throw qQ();if(n===0)return t._searchMarker&&LQ(t._searchMarker,n,r.length),KQ(e,t,null,r);let i=n,a=IQ(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&rQ(e,UZ(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&LQ(t._searchMarker,i,r.length),KQ(e,t,o,r)},YQ=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return KQ(e,t,r,n)},XQ=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=IQ(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&rQ(e,UZ(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&rQ(e,UZ(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw qQ();t._searchMarker&&LQ(t._searchMarker,i,-a+r)},ZQ=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},QQ=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new t1([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new t1([r]);break;case Uint8Array:s=new V$(r);break;case uZ:s=new K$(r);break;default:if(r instanceof zQ)s=new p1(r);else throw Error(`Unexpected content type`)}new g1(UZ(o,ZZ(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},$Q=(e,t)=>{e.doc??kQ();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},e$=e=>{let t={};return e.doc??kQ(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},t$=(e,t)=>{e.doc??kQ();let n=e._map.get(t);return n!==void 0&&!n.deleted},n$=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&qZ(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},r$=e=>(e.doc??kQ(),KX(e._map.entries(),e=>!e[1].deleted)),i$=class extends DQ{},a$=class e extends zQ{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof zQ?e.clone():e)),t}get length(){return this.doc??kQ(),this._length}_callObserver(e,t){super._callObserver(e,t),RQ(this,e,new i$(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):mQ(this.doc,n=>{JQ(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):mQ(this.doc,t=>{YQ(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):mQ(this.doc,n=>{XQ(n,this,e,t)})}get(e){return GQ(this,e)}toArray(){return VQ(this)}slice(e=0,t=this.length){return BQ(this,e,t)}toJSON(){return this.map(e=>e instanceof zQ?e.toJSON():e)}map(e){return UQ(this,e)}forEach(e){HQ(this,e)}[Symbol.iterator](){return WQ(this)}_write(e){e.writeTypeRef(o1)}},o$=e=>new a$,s$=class extends DQ{constructor(e,t,n){super(e,t),this.keysChanged=n}},c$=class e extends zQ{constructor(e){super(),this._prelimContent=null,this._prelimContent=e===void 0?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof zQ?e.clone():e)}),t}_callObserver(e,t){RQ(this,e,new s$(this,e,t))}toJSON(){this.doc??kQ();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof zQ?r.toJSON():r}}),e}get size(){return[...r$(this)].length}keys(){return qX(r$(this),e=>e[0])}values(){return qX(r$(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return qX(r$(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??kQ(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):mQ(this.doc,t=>{ZQ(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):mQ(this.doc,n=>{QQ(n,this,e,t)}),t}get(e){return $Q(this,e)}has(e){return t$(this,e)}clear(){this.doc===null?this._prelimContent.clear():mQ(this.doc,e=>{this.forEach(function(t,n,r){ZQ(e,r,n)})})}_write(e){e.writeTypeRef(s1)}},l$=e=>new c$,u$=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&rJ(e,t),d$=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&eK(),this.right.content.constructor){case X$:this.right.deleted||h$(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length)}this.left=this.right,this.right=this.right.right}},f$=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case X$:t.right.deleted||h$(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&rQ(e,UZ(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length)}t.left=t.right,t.right=t.right.right}return t},p$=(e,t,n,r)=>{let i=new Map,a=r?IQ(t,n):null;if(a){let t=new d$(a.p.left,a.p,a.index,i);return f$(e,t,n-a.index)}{let r=new d$(null,t._start,0,i);return f$(e,r,n)}},m$=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===X$&&u$(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new g1(UZ(a,ZZ(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new X$(o,r));l.integrate(e,0),n.right=l,n.forward()})},h$=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},g$=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===X$&&u$(t[e.right.content.key]??null,e.right.content.value));)e.forward()},_$=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!u$(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new g1(UZ(a,ZZ(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new X$(s,c)),n.right.integrate(e,0),n.forward()}}return o},v$=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;g$(n,i);let s=_$(e,t,n,i),c=r.constructor===String?new r1(r):r instanceof zQ?new p1(r):new J$(r),{left:l,right:u,index:d}=n;t._searchMarker&&LQ(t._searchMarker,n.index,c.getLength()),u=new g1(UZ(o,ZZ(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),m$(e,t,n,s)},y$=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;g$(n,i);let s=_$(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===X$));){if(!n.right.deleted)switch(n.right.content.constructor){case X$:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(u$(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&rQ(e,UZ(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
|
|
361
|
-
`;n.right=new
|
|
362
|
-
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&v$(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&w$(n,r,a.delete):y$(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??kQ();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(qZ(s,e)||t!==void 0&&qZ(s,t))switch(s.content.constructor){case r1:{let r=i.get(`ychange`);e!==void 0&&!qZ(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!qZ(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case p1:case J$:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case X$:qZ(s,e)&&(c(),h$(i,s.content))}s=s.right}c()};return e||t?mQ(a,n=>{e&&JZ(n,e),t&&JZ(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):mQ(r,r=>{let i=p$(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),v$(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):mQ(r,r=>{let i=p$(r,this,e,!n);v$(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):mQ(n,n=>{w$(n,p$(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):mQ(r,r=>{let i=p$(r,this,e,!1);i.right!==null&&y$(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):mQ(this.doc,t=>{ZQ(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):mQ(this.doc,n=>{QQ(n,this,e,t)})}getAttribute(e){return $Q(this,e)}getAttributes(){return e$(this)}_write(e){e.writeTypeRef(c1)}},D$=e=>new E$,O$=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??kQ()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===j$||t.constructor===k$)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},k$=class e extends zQ{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof zQ?e.clone():e)),t}get length(){return this.doc??kQ(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new O$(this,e)}querySelector(e){e=e.toUpperCase();let t=new O$(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),NG(new O$(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){RQ(this,e,new N$(this,t,e))}toString(){return UQ(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),HQ(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):mQ(this.doc,n=>{JQ(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)mQ(this.doc,n=>{let r=e&&e instanceof zQ?e._item:e;KQ(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw QG(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):mQ(this.doc,n=>{XQ(n,this,e,t)})}toArray(){return VQ(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return GQ(this,e)}slice(e=0,t=this.length){return BQ(this,e,t)}forEach(e){HQ(this,e)}_write(e){e.writeTypeRef(u1)}},A$=e=>new k$,j$=class e extends k${constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return Zq(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof zQ?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):mQ(this.doc,t=>{ZQ(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):mQ(this.doc,n=>{QQ(n,this,e,t)})}getAttribute(e){return $Q(this,e)}hasAttribute(e){return t$(this,e)}getAttributes(e){return e?n$(this,e):e$(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return HQ(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(l1),e.writeKey(this.nodeName)}},M$=e=>new j$(e.readKey()),N$=class extends DQ{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},P$=class e extends c${constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(d1),e.writeKey(this.hookName)}},F$=e=>new P$(e.readKey()),I$=class e extends E${get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(f1)}},L$=e=>new I$,R$=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw $G()}mergeWith(e){return!1}write(e,t,n){throw $G()}integrate(e,t){throw $G()}},z$=0,B$=class extends R${get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),QZ(e.doc.store,this)}write(e,t){e.writeInfo(z$),e.writeLen(this.length-t)}getMissing(e,t){return null}},V$=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw $G()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},H$=e=>new V$(e.readBuf()),U$=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){rZ(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},W$=e=>new U$(e.readLen()),G$=(e,t)=>new uZ({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),K$=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(G$(this.doc.guid,this.opts))}splice(e){throw $G()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},q$=e=>new K$(G$(e.readString(),e.readAny())),J$=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw $G()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},Y$=e=>new J$(e.readJSON()),X$=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw $G()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},Z$=e=>new X$(e.readKey(),e.readJSON()),Q$=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},$$=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new Q$(n)},e1=FJ(`node_env`)===`development`,t1=class e{constructor(e){this.arr=e,e1&&aJ(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},n1=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new t1(n)},r1=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},i1=e=>new r1(e.readString()),a1=[o$,l$,D$,M$,A$,F$,L$],o1=0,s1=1,c1=2,l1=3,u1=4,d1=5,f1=6,p1=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw $G()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},m1=e=>new p1(a1[e.readTypeRef()](e)),h1=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new g1(UZ(r,i+n),t,UZ(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=UZ(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},g1=class e extends R${constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=ZZ(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=ZZ(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===VZ&&this.id.client!==this.parent.client&&this.parent.clock>=ZZ(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=iQ(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=rQ(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===B$||this.right&&this.right.constructor===B$)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===VZ){let e=tQ(n,this.parent);this.parent=e.constructor===B$?null:e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=iQ(e,e.doc.store,UZ(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),HZ(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(HZ(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(tQ(e.doc.store,n.origin)))r.has(tQ(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null){let e=this.left.right;this.right=e,this.left.right=this}else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),QZ(e.doc.store,this),this.content.integrate(e,this),lQ(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new B$(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:UZ(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&HZ(e.origin,this.lastId)&&this.right===e&&HZ(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),rZ(e.deleteSet,this.id.client,this.id.clock,this.length),lQ(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw eK();this.content.gc(e),t?aQ(e,this,new B$(this.id,this.length)):this.content=new U$(this.length)}write(e,t){let n=t>0?UZ(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=WZ(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===VZ?(e.writeParentInfo(!1),e.writeLeftID(t)):eK();i!==null&&e.writeString(i)}this.content.write(e,t)}},_1=(e,t)=>v1[t&31](e),v1=[()=>{eK()},W$,$$,H$,i1,Y$,Z$,m1,n1,q$,()=>{eK()}],y1=10,b1=class extends R${get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){eK()}write(e,t){e.writeInfo(y1),Z(e.restEncoder,this.length-t)}getMissing(e,t){return null}},x1=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},S1=`__ $YJS$ __`,x1[S1]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),x1[S1]=!0})),w1,T1,E1,D1,O1,k1=t((()=>{AK(),tq(),xq(),wG(),Wq(),dJ(),w1=3e4,T1=class extends Uq{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=bq();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&E1(this,t,`timeout`)},vG(w1/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:bq()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),lJ(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},E1=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:bq()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},D1=(e,t,n=e.states)=>{let r=t.length,i=rK();Z(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;Z(i,r),Z(i,s),mK(i,JSON.stringify(o))}return aK(i)},O1=(e,t,n)=>{let r=IK(t),i=bq(),a=[],o=[],s=[],c=[],l=Q(r);for(let t=0;t<l;t++){let t=Q(r),n=Q(r),l=JSON.parse(WK(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(lJ(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])}})),A1,j1,M1,N1,P1,F1,I1,L1=t((()=>{Vq(),AG(),XJ(),OJ(),A1=new Map,j1=class{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:JJ(t.newValue||``)}),EJ(this._onChange)}postMessage(e){TJ.setItem(this.room,qJ(HJ(e)))}close(){DJ(this._onChange)}},M1=typeof BroadcastChannel>`u`?j1:BroadcastChannel,N1=e=>Rq(A1,e,()=>{let t=kG(),n=new M1(e);return n.onmessage=e=>t.forEach(t=>t(e.data,`broadcastchannel`)),{bc:n,subs:t}}),P1=(e,t)=>(N1(e).subs.add(t),t),F1=(e,t)=>{let n=N1(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),A1.delete(e)),r},I1=(e,t,n=null)=>{let r=N1(e);r.bc.postMessage(t),r.subs.forEach(e=>e(t,n))}})),R1,z1,B1,V1,H1,U1,W1,G1=t((()=>{AK(),tq(),C1(),R1=(e,t)=>{Z(e,0);let n=FZ(t);gK(e,n)},z1=(e,t,n)=>{Z(e,1),gK(e,kZ(t,n))},B1=(e,t,n)=>z1(t,n,zK(e)),V1=(e,t,n,r)=>{try{EZ(t,zK(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},H1=(e,t)=>{Z(e,2),gK(e,t)},U1=V1,W1=(e,t,n,r,i)=>{let a=Q(e);switch(a){case 0:B1(e,t,n);break;case 1:V1(e,n,r,i);break;case 2:U1(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a}})),K1,q1=t((()=>{tq(),K1=(e,t,n)=>{Q(e)===0&&n(t,WK(e))}})),J1,Y1=t((()=>{oJ(),J1=e=>Qq(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join(`&`)})),X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0=t((()=>{L1(),xq(),AK(),tq(),G1(),q1(),k1(),Wq(),wG(),Y1(),BJ(),X1=[],X1[0]=(e,t,n,r,i)=>{Z(e,0);let a=W1(t,e,n.doc,n);r&&a===1&&!n.synced&&(n.synced=!0)},X1[3]=(e,t,n,r,i)=>{Z(e,1),gK(e,D1(n.awareness,Array.from(n.awareness.getStates().keys())))},X1[1]=(e,t,n,r,i)=>{O1(n.awareness,zK(t),n)},X1[2]=(e,t,n,r,i)=>{K1(t,n.doc,(e,t)=>Q1(n,t))},Z1=3e4,Q1=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),$1=(e,t,n)=>{let r=IK(t),i=rK(),a=Q(r),o=e.messageHandlers[a];return o?o(i,r,e,n,a):console.error(`Unable to compute message`),i},e0=e=>!(e.code>=4400&&e.code<4500),t0=(e,t,n)=>{if(t!==null&&t===e.ws){e.emit(`connection-close`,[n,e]),e.ws=null,t.onmessage=null,t.onopen=null,t.onclose=null,t.onerror=()=>{},t.close(),e.wsconnecting=!1,e.wsconnected&&(e.wsconnected=!1,e.synced=!1,E1(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit(`status`,[{status:`disconnected`}])),e.wsUnsuccessfulReconnects++;let r=null;n!=null&&!e.shouldReconnect(n,e)&&(e.shouldConnect=!1,r={code:n.code,reason:n.reason}),setTimeout(n0,bG(SG(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e),r!==null&&e.emit(`closed`,[r,e])}},n0=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType=`arraybuffer`,e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{if(e.ws!==t)return;e.wsLastMessageReceived=bq();let r=$1(e,new Uint8Array(n.data),!0);iK(r)>1&&t.send(aK(r))},t.onerror=n=>{e.ws===t&&e.emit(`connection-error`,[n,e])},t.onclose=n=>{t0(e,t,n)},t.onopen=()=>{if(e.ws!==t)return;e.wsLastMessageReceived=bq(),e.wsconnecting=!1,e.wsconnected=!0,e.emit(`status`,[{status:`connected`}]);let n=rK();if(Z(n,0),R1(n,e.doc),t.send(aK(n)),e.awareness.getLocalState()!==null){let n=rK();Z(n,1),gK(n,D1(e.awareness,[e.doc.clientID])),t.send(aK(n))}},e.emit(`status`,[{status:`connecting`}])}},r0=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&I1(e.bcChannel,t,e)},i0=class extends Hq{constructor(e,t,n,{connect:r=!0,awareness:i=new T1(n),params:a={},protocols:o=[],WebSocketPolyfill:s=WebSocket,resyncInterval:c=-1,maxBackoffTime:l=2500,disableBc:u=!1,shouldReconnect:d=e0}={}){for(super();e[e.length-1]===`/`;)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+`/`+t,this.maxBackoffTime=l,this.shouldReconnect=d,this.params=a,this.protocols=o,this.roomname=t,this.doc=n,this._WS=s,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=X1.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,c>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=rK();Z(e,0),R1(e,n),this.ws.send(aK(e))}},c)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=$1(this,new Uint8Array(e),!1);iK(t)>1&&I1(this.bcChannel,aK(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=rK();Z(t,0),H1(t,e),r0(this,aK(t))}},this.doc.on(`update`,this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{let a=e.concat(t).concat(n),o=rK();Z(o,1),gK(o,D1(i,a)),r0(this,aK(o))},this._exitHandler=()=>{E1(this.awareness,[n.clientID],`app closed`)},kJ&&typeof process<`u`&&process.on(`exit`,this._exitHandler),i.on(`update`,this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&Z1<bq()-this.wsLastMessageReceived&&t0(this,this.ws,null)},Z1/10),r&&this.connect()}get url(){let e=J1(this.params);return this.serverUrl+`/`+this.roomname+(e.length===0?``:`?`+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,e&&(this.wsUnsuccessfulReconnects=0),this.emit(`synced`,[e]),this.emit(`sync`,[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),kJ&&typeof process<`u`&&process.off(`exit`,this._exitHandler),this.awareness.off(`update`,this._awarenessUpdateHandler),this.doc.off(`update`,this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||=(P1(this.bcChannel,this._bcSubscriber),!0);let e=rK();Z(e,0),R1(e,this.doc),I1(this.bcChannel,aK(e),this);let t=rK();Z(t,0),z1(t,this.doc),I1(this.bcChannel,aK(t),this);let n=rK();Z(n,3),I1(this.bcChannel,aK(n),this);let r=rK();Z(r,1),gK(r,D1(this.awareness,[this.doc.clientID])),I1(this.bcChannel,aK(r),this)}disconnectBc(){let e=rK();Z(e,1),gK(e,D1(this.awareness,[this.doc.clientID],new Map)),r0(this,aK(e)),this.bcconnected&&=(F1(this.bcChannel,this._bcSubscriber),!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&t0(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(n0(this),this.connectBc())}}})),o0=n({connectRealtimeRoom:()=>s0});function s0(e,t,n={}){let r=new Set,i=new Set,a=new Set,o=[],s,c=`connecting`,l=!1,u=!1,d,f,p=()=>{for(let e of r)e()},m=()=>{let t=n.origin?new URL(n.origin):window.location;return`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}${Sq(`/_vitehub/realtime/${encodeURIComponent(e)}`,n.baseURL)}`},h=t.split(`/`).map(encodeURIComponent).join(`/`),g={};function _(){l=!1,d=new uZ,f=new i0(m(),h,d,{disableBc:!0,params:{...n.params,clientId:String(d.clientID)}});let e=f;Cq(e),e.messageHandlers[5]=(t,n)=>{let r=uq(n);r&&(r.type===`session`?e.params.epoch=r.epoch:(e.destroy(),d.destroy(),u||(_(),p())))},e.messageHandlers[6]=(t,n)=>{let r=hq(n);if(r?.kind===`request`&&y(e,r.id,r.body),r?.kind===`notice`)for(let e of a)e(r.body)},e.awareness.off(`update`,e._awarenessUpdateHandler),e.awareness.on(`update`,({added:t,removed:n,updated:r})=>{let i=[...t,...r,...n].filter(t=>t===e.doc.clientID),a=e.ws;if(!i.length||!e.wsconnected||!a||a.readyState!==a.OPEN)return;let o=rK();Z(o,1),gK(o,D1(e.awareness,i)),a.send(aK(o))});let t=n.identity??{id:`guest:${d.clientID}`};e.awareness.setLocalState({...g,user:jq({...t,id:t.id||`guest:${d.clientID}`})}),e.awareness.on(`change`,p),d.getMap(Oq.status).observe(p),e.on(`sync`,t=>{f===e&&(l=t,p())}),e.on(`status`,e=>{c=e.status,p()})}_();let v;n.changes&&(v=new i0(m(),encodeURIComponent(_q),new uZ,{disableBc:!0,params:{...n.params,workspace:`events`}}),v.awareness.setLocalState(null),Cq(v),v.messageHandlers[4]=(e,t)=>{let n=fq(t);if(n)for(let e of i)e(n)},v.on(`status`,e=>{e.status===`connected`&&b()}));async function y(e,t,n){let r=e=>mq({kind:`answer`,id:t,ok:!1,why:e}),i;try{i=s?mq({kind:`answer`,id:t,ok:!0,body:await s(n)}):r(`This page does not answer requests.`),i.byteLength>c0&&(i=r(`The answer has ${i.byteLength} bytes, over the 1 MiB limit.`))}catch(e){i=r(e instanceof Error?e.message:String(e))}let a=e.ws;e.wsconnected&&a&&a.readyState===a.OPEN&&a.send(Uint8Array.from(i))}function b(){let e=v?.ws;if(v?.wsconnected&&e&&e.readyState===e.OPEN)for(;o.length;)e.send(Uint8Array.from(pq(o.shift())))}return{get awareness(){return f.awareness},get clientId(){return d.clientID},people:()=>Nq(f.awareness.getStates()),states:()=>{let e=new Map(f.awareness.getStates());return e.delete(d.clientID),e},status:()=>c,saveStatus:()=>l?Dq(d):void 0,setLocal(e,t){if(t!==null){g[e]=t,f.awareness.setLocalStateField(e,t);return}delete g[e];let n=f.awareness.getLocalState();if(!n||!Object.hasOwn(n,e))return;let{[e]:r,...i}=n;f.awareness.setLocalState(i)},notify(e){v&&(o.push(e),b())},onUpdate(e){return r.add(e),()=>r.delete(e)},onChange(e){return i.add(e),()=>i.delete(e)},onRequest(e){return s=e,()=>{s===e&&(s=void 0)}},onNotice(e){return a.add(e),()=>a.delete(e)},destroy(){u=!0,f.destroy(),d.destroy(),v?.destroy(),v?.doc.destroy(),r.clear(),i.clear(),a.clear(),s=void 0}}}var c0,l0=t((()=>{Tq(),kq(),Fq(),yq(),AK(),k1(),a0(),C1(),c0=1047552}));function u0(e){let t=document.createElement(`style`);return t.textContent=e,t}function d0(e,t){let n=new Map;for(let r of e){if(r.id===t)continue;let e=n.get(r.id);e?e.tabs++:n.set(r.id,{person:r,tabs:1})}return[...n.values()]}function f0(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join(``)||`?`}function p0(e){let t=[`#fb7185`,`#fbbf24`,`#34d399`,`#22d3ee`,`#60a5fa`,`#a78bfa`,`#f472b6`],n=0;for(let t=0;t<e.length;t++)n=Math.imul(31,n)+e.charCodeAt(t)|0;return t[Math.abs(n)%t.length]}function m0(e,t){let{files:n,deferredFiles:r,...i}=e,a=e=>Promise.all([e,t]).then(e=>e.flat());return n!==void 0&&!Array.isArray(n)?{...i,files:a(n)}:{...i,...n?{files:n}:{},deferredFiles:r?a(r):t}}function h0(){let e=document.documentElement;if(e.classList.contains(`dark`))return!0;if(e.classList.contains(`light`))return!1;if(e.dataset.theme===`dark`)return!0;if(e.dataset.theme===`light`)return!1;let t=getComputedStyle(e).colorScheme;return t===`dark`||t!==`light`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function g0(e){e.preventDefault(),e.stopPropagation()}function _0(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function v0(e){if(!(e.metaKey||e.ctrlKey||e.altKey))return Object.keys(yW).find(t=>yW[t].key===e.key.toUpperCase())}function y0(){try{return localStorage.getItem(V0)===`hidden`?`hidden`:`all`}catch{return`all`}}function b0(e){try{e===`hidden`?localStorage.setItem(V0,e):localStorage.removeItem(V0)}catch{}}function x0(e,t=1){let n=document.elementsFromPoint(e.left+e.width/2,e.top+e.height/2).find(e=>!w0(e)&&e!==document.documentElement);for(let r=n??null;r&&r!==document.documentElement;r=r.parentElement){let n=r.getBoundingClientRect();if(n.left<=e.left+t&&n.top<=e.top+t&&n.right>=e.left+e.width-t&&n.bottom>=e.top+e.height-t)return r}}function S0(e,t){let n=t.getBoundingClientRect(),r=Math.max(e.left,n.left),i=Math.max(e.top,n.top);return{left:r,top:i,width:Math.min(e.left+e.width,n.right)-r,height:Math.min(e.top+e.height,n.bottom)-i}}function C0(){let e=new URL(location.href);e.searchParams.has(W0)&&(e.searchParams.delete(W0),history.replaceState(history.state,``,e))}function w0(e){for(let t=e;t;){if(t.closest(`[data-comments-ui], vitehub-pill, vitehub-window`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function T0(e){let{host:t,context:n,session:r}=e,i=t.shadowRoot,a=document.createElement(`div`);a.className=`root`,i.replaceChildren(u0(D0(MW)),a);let o=[i,e.toolbar?.getRootNode(),e.areas].filter(e=>e instanceof ShadowRoot).map(e=>hw(e)),s=V(Ri(location.pathname)),c=tc(r?.subject??{kind:`page`,id:s.value}),l=r?.revision,d=V(!1),f=V(!1),p=0,m=V(location.search),h=tc(),g=new WeakMap,_=0,v=e=>{let t=g.get(e);return t===void 0&&g.set(e,t=++_),t},y=V(),b=V(!1),x=tc(),S=V(!1),C,w=V(!1),T=V(0),E=V(`marker`),D=V(`pink`),O,k=new WeakMap,A=tc(),ee=V(new Set),j=V(!1),M=V(`comment`),N,te=V(Gi()),P=V(0),F=tc([]),I=V(`open`),ne=V(null),re=tc(),L=V(0),ie=V(y0()===`hidden`),ae,R,oe=0,se,ce,le=new Set,ue=new WeakMap,de=(e,t=!1)=>{clearTimeout(ce),h.value=e,t||(ce=setTimeout(()=>h.value=void 0,e.kind===`error`?8e3:5e3))},fe=e=>de({text:e.fix?`${e.why} ${e.fix}`:e.why,kind:`error`}),pe=()=>r?.user??void 0,me=r?.presence!==!1,he=J(()=>pe()??(te.value?{id:`guest:${te.value.id}`,name:te.value.name,guest:!0}:void 0)),ge=tc(r?.can),_e=tc(r?.agent),ve=tc(r?.repository),ye=J(()=>!!ge.value?.comment),be=J(()=>ye.value&&r?.attachments!==!1),xe=J(()=>ye.value&&!he.value),Se=J({get:()=>ie.value&&ye.value?`hidden`:`all`,set:e=>{ie.value=e===`hidden`,b0(e)}}),Ce=(e,t)=>{let n=he.value;return!n||xe.value?!1:t.message?.delivery&&(e===`edit`||e===`delete`)?!0:fm(n,ge.value,e,t)},we=Ca({onPeople(e){let t=new Map(F.value.map(e=>[e.id,e]));for(let n of e)t.set(n.id,n);F.value=[...t.values()]},onChange:()=>ae?.setLocal(`commentsChange`,crypto.randomUUID()),...e.pageThreads&&r?.can.read?{pageThreads:{...e.pageThreads,subject:c.value}}:{}});function Te(e){let t=ha(),n=_h({transport:{...we,subscribe(e){return le.add(e),()=>le.delete(e)}},user:e,...e?{outbox:{account:e.id,namespace:t}}:{}}),r=n.create;return n.create=e=>{let t=e.revision??l,n=k.get(e.anchor);k.delete(e.anchor),n&&(n.sent=!0);let i={...n?m0(e,n.files):e,context:ue.get(e.anchor)??EV(void 0),...t===void 0?{}:{revision:t}};return r(i)},n}let Ee=tc(Te(he.value));U(()=>he.value?.id,()=>Ee.value=Te(he.value));let De=()=>{for(let e of le)e({type:`reconnected`})},Oe,ke=()=>{clearTimeout(Oe),Oe=setTimeout(De,100)},Ae=ba(ke),je=e=>{let t=we.attachmentUrl(e);return t?[new URL(t,location.href).href]:[]},Me=e=>({id:e.id,anchor:e.anchor,messages:e.messages.map(e=>({author:e.author.name??e.author.id,body:e.body})),...e.revision===void 0?{}:{revision:e.revision},files:e.messages.flatMap(e=>e.attachments.flatMap(je))}),Ne=e=>({url:new URL(s.value,location.origin).href,threads:e.map(Me),..._e.value?{agent:_e.value}:{}});async function Pe(e){let t=await navigator.clipboard?.writeText(Sm(Ne(e))).then(()=>!0,()=>!1);de(t?{text:`Prompt copied. Paste it in your agent.`,kind:`info`}:{text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`})}let Fe=J(()=>z.openThreads.value.filter(e=>!e.delivery)),Ie=J(()=>!d.value&&Fe.value.length>0),Le=V(!1),Re;async function ze(){if(!Ie.value)return;let e=p,t=await navigator.clipboard?.writeText(wm(Ne(Fe.value))).then(()=>!0,()=>!1);if(e===p){if(!t)return de({text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`});Le.value=!0,clearTimeout(Re),Re=setTimeout(()=>Le.value=!1,1500)}}let Be=e=>{let t=Cm(Ne(e),ve.value);return t?q(Hw,{"aria-label":`Open in T3 Code`,color:`neutral`,"data-action":`open-in-t3-code`,label:`Open in T3 Code`,rel:`noopener noreferrer`,size:`xs`,target:`_blank`,title:`Open in T3 Code`,to:t,variant:`ghost`},()=>q(Vw,{name:`i-lucide-arrow-up-right`})):q(`small`,`Too long for T3 Code. Copy the prompt instead.`)},Ve=({thread:e})=>e.status===`open`&&!e.delivery?[Be([e]),q(Hw,{color:`neutral`,"data-action":`copy-prompt`,icon:`i-lucide-copy`,label:`Copy`,onClick:()=>void Pe([e]),size:`xs`,variant:`ghost`})]:[],He=()=>{let e=Fe.value;return I.value===`open`&&Ie.value?[q(Hw,{"aria-label":Le.value?`Copied`:`Copy prompt`,color:`neutral`,"data-action":`copy-page-prompt`,icon:Le.value?`i-lucide-check`:`i-lucide-copy`,label:Le.value?`Copied`:`Copy prompt`,onClick:()=>void ze(),size:`xs`,title:Ue(),variant:`ghost`}),Be(e)]:[]},Ue=()=>_e.value?`Copy a prompt that sends your agent to these comments in the ViteHub Console`:`Copy a prompt with the open comments for your agent`,We=({delivery:{status:e,error:t},retry:n})=>{let r=e===`failed`,i=t?.status===401||t?.status===402,a=r?`Not sent.`:t?`Waiting to send.`:`Sending…`;return[q(`span`,{class:`delivery`,"data-failed":r?`true`:void 0},t?`${a} ${t.why}`:a),...n&&(r||i)?[q(Hw,{color:`neutral`,label:`Retry`,onClick:()=>void n(),size:`xs`,variant:`ghost`})]:[]]},Ge=kV({page:()=>s.value,info:e=>de({text:e,kind:`info`}),failed:fe,drafted(e){ee.value=new Set([...ee.value,e])}}),z;function Ke(e){if(e!==`mark`&&Xe(),d.value&&(f.value=e===`comment`&&ye.value),!(d.value&&e!==`edit`&&e!==`view`)){if(e===`mark`){if(!be.value||w.value)return;if(xe.value){M.value=e,N=void 0,j.value=!0;return}Ge.finish(!0),S.value=!1,z.exit(),Ye()}else if(e===`comment`){if(!ye.value)return;if(xe.value){M.value=e,N=void 0,j.value=!0;return}Ge.finish(!0),S.value=!1,z.enter()}else if(e===`edit`){if(!r?.content||!ye.value||(z.exit(),z.active.value))return;S.value=!0}else j.value=!1,N=void 0,z.exit(),S.value=!1,Ge.finish(!0);A.value=void 0}}let qe=J(()=>w.value?`mark`:S.value?`edit`:z?.active.value?`comment`:`view`),Je=J(()=>qe.value===`comment`||d.value&&f.value||j.value&&M.value!==`mark`);function Ye(){Ze(),C=fW({tip:()=>E.value,color:()=>bW[D.value],onChange:()=>T.value=C?.strokes().length??0,onSubmit:Qe}),T.value=0,w.value=!0}function Xe(){C?.remove(),C=void 0,T.value=0,w.value=!1}function Ze(){O?.session.remove(),O=void 0}function Qe(){let e=C;e?.commit();let t=e?.strokes()??[],n=sW(t);if(!e||!n)return;e.freeze();let r=vW(t,e=>e instanceof Element&&w0(e));C=void 0,w.value=!1,T.value=0;let i=z.draft.value,a=x0(n,yW.marker.width/2+1);try{if(a){let e=S0(n,a);z.startDraft(a,{area:e,point:{x:e.left,y:e.top}})}else z.startDraft(`page`)}catch{}let o=z.draft.value;if(!o||o===i){e.remove();return}O={session:e,draft:o};let s={files:r.then(e=>e?[new File([e],`highlight.webp`,{type:e.type})]:[],()=>[]),sent:!1};k.set(Qs(o.anchor),s),s.files.then(e=>{!e.length&&(s.sent||z.draft.value===o)&&de({text:`This page could not be drawn as a picture. The comment marks the area without one.`,kind:`info`})})}async function $e(e=!1){if(!r?.realtime||!t.isConnected||n?.signal.aborted||ae&&!e)return;let i=++oe,a=await Ua(()=>Promise.resolve().then(()=>(l0(),o0)),void 0,import.meta.url).catch(()=>void 0);if(!a||i!==oe||!t.isConnected||n?.signal.aborted)return;ae?.destroy(),R?.destroy();let o=pe()??(te.value?{id:`guest:${te.value.id}`,name:`${te.value.name} (guest)`}:void 0),l=Li(import.meta.url).slice(0,-Ui.length),u=a.connectRealtimeRoom(Vi,zi(s.value),{identity:o,baseURL:l,params:{page:s.value}}),d=new Map;u.onUpdate(()=>{P.value++;let e=new Map,t=!1;for(let[n,r]of u.states())n!==u.clientId&&typeof r.commentsChange==`string`&&(e.set(n,r.commentsChange),d.get(n)!==r.commentsChange&&(t=!0));d=e,t&&ke()}),R=a.connectRealtimeRoom(Hi,Bi(c.value),{baseURL:l,params:{page:s.value}}),R.onNotice(ke),ae=u}function et(){oe++,clearTimeout(Oe),ae?.destroy(),ae=void 0,R?.destroy(),R=void 0}function tt(){if(n){if(!se){let e=()=>t.classList.contains(`dark`),r=n.createWindow({id:`comments`,title:`Comments`,trigger:n.bar,colorScheme:()=>e()?`dark`:`light`,expand:!1,onHide:()=>b.value=!1});se=r;let i=document.createElement(`div`);i.setAttribute(`data-comments-ui`,``);let a=i.attachShadow({mode:`open`});o.push(hw(a));let s=document.createElement(`div`);s.className=`panel-root`;let c=()=>{i.classList.toggle(`dark`,e()),s.classList.toggle(`dark`,e()),r.syncColorScheme?.()};c();let l=new MutationObserver(c);l.observe(t,{attributes:!0,attributeFilter:[`class`]}),o.push(()=>l.disconnect()),a.append(u0(D0(NW)),s),r.body.append(i),x.value=s}b.value=!0,se.show()}}async function nt(e){te.value=Ki(e),j.value=!1,$e(!0);let t=M.value;M.value=`comment`;let n=N;if(N=void 0,await ol(),n?.startContainer.isConnected){let e=getSelection();if(e?.removeAllRanges(),e?.addRange(n),lt())return}Ke(t)}async function rt(e){await fetch(e,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(()=>void 0),location.reload()}function it(t){let n=new URL(location.href);n.searchParams.set(u,`comments`);let r=t.signIn,i=r?.provider===`console`,a=t.github;if(a&&t.signOut){let e=t.signOut,n=a.repository?`@${a.login} cannot push to ${a.repository}, so cannot comment here.`:`Signed in as @${a.login}, but this site does not say which GitHub repository it is built from.`;de({text:n,kind:`error`,action:[`Use another account`,()=>void rt(e)]},!0)}else de(r?{text:`Sign in to comment on this page.`,kind:`info`,link:i?{label:`Sign in to ViteHub`,href:r.url,newTab:!0}:{label:`Sign in with GitHub`,href:`${r.url}?return=${encodeURIComponent(n.pathname+n.search+n.hash)}`},action:[`Close`,e.exit]}:{text:`Comments are only for the site's team. Sign in with an account that may comment.`,kind:`error`,action:[`Close`,e.exit]},!0)}function at(){let e=getSelection();if(!ye.value||S.value||d.value||!e||e.isCollapsed||e.rangeCount===0||!e.toString().trim())return;let t=e.getRangeAt(0),n=t.commonAncestorContainer,r=n instanceof Element?n:n.parentElement;if(!(!r?.isConnected||w0(r)||r.closest(`input, textarea, select, [contenteditable]:not([contenteditable='false'])`)))return t.cloneRange()}let ot,st=!1;function ct(){if(st)return;ot=z?.draft.value?void 0:at();let e=ot?.getBoundingClientRect();re.value=e&&(e.width||e.height)?{left:e.left+e.width/2,top:e.top,bottom:e.bottom}:void 0}function lt(e=at()){if(st=!1,!e)return!1;if(xe.value)return M.value=`comment`,N=e,j.value=!0,!0;Ge.finish(!0);let t=e.getBoundingClientRect();try{z.startDraft(e,{point:{x:t.right,y:t.top}}),getSelection()?.removeAllRanges()}catch{return!1}return ot=void 0,re.value=void 0,!0}let ut=typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight==`function`;function dt(){if(!ut)return;let e={open:[],resolved:[],active:[],draft:[]},t=new Set([z.openId.value,z.hoverId.value].filter(Boolean)),n=z.threads.value.filter(e=>z.isShown(e.id));for(let r of n){if(r.anchor.kind!==`text`||!z.isShown(r.id))continue;let n=rh(r.anchor);n&&e[t.has(r.id)?`active`:r.status===`resolved`?`resolved`:`open`].push(n)}let r=z.draft.value?.anchor;if(r?.kind===`text`){let t=rh(Qs(r));t&&e.draft.push(t)}for(let[t,n]of Object.entries(E0))CSS.highlights.set(n,new Highlight(...e[t]))}function ft(){if(ut)for(let e of Object.values(E0))CSS.highlights.delete(e)}let pt=W({setup(){let e=V(null);ol(()=>e.value?.focus());let t=t=>{t.preventDefault();let n=e.value?.value.trim();n?nt(n):e.value?.focus()};return()=>q(`form`,{class:`card`,role:`dialog`,"aria-label":`Your name`,onSubmit:t,onKeydown:e=>e.key===`Escape`&&(j.value=!1)},[q(`label`,[`Your name`,q(`input`,{"aria-label":`Your name`,autocomplete:`name`,maxlength:64,placeholder:`Shown next to your comments`,ref:e})]),q(`div`,{class:`row`},[q(Hw,{color:`neutral`,label:`Cancel`,onClick:()=>j.value=!1,size:`sm`,variant:`ghost`}),q(Hw,{label:`Comment`,size:`sm`,type:`submit`})])])}}),mt=W({name:`CommentsOverlay`,setup(){z=oO({client:Ee.value,subject:()=>c.value,location:()=>({href:location.href,origin:location.origin,search:m.value}),user:()=>he.value,people:F,hotkey:!1,ignore:w0,can:Ce,uiRoot:()=>i,autoStart:!!r?.can.read,visibility:Se}),U(qe,t=>e.onMode(t),{immediate:!0,flush:`sync`}),U(()=>z.status.value,e=>{e===`ready`&&!ae&&$e()}),U(()=>z.status.value===`ready`&&!d.value?m.value:void 0,e=>{let t=p;e&&ol(()=>{t===p&&!d.value&&location.search===e&&C0()})},{immediate:!0}),U(()=>z.counts.value.open,()=>P.value++);let t=J(vt);n?.menu&&U(t,e=>n.menu(e),{immediate:!0});let a=W({setup(){let e=V(),r=new AbortController;return Ld(()=>{let i=mn({bar:e.value,pill:n?.bar.parentElement??null,items:()=>[t.value],signal:r.signal});U(t,i.update)}),Bd(()=>r.abort()),()=>q(`span`,{ref:e,"data-slot":`legacy-comments-menu`})}}),o,l=()=>{let e=y.value;o&&o.element!==e&&(o.motion.destroy(),o=void 0),e&&(o?o.motion.play():o={element:e,motion:aw(e)},o.motion.measure())};Ld(l),zd(l),Bd(()=>o?.motion.destroy()),U(I,e=>{z.filters.resolved=e===`resolved`}),U(()=>z.filters.resolved,e=>{e&&(I.value=`resolved`)}),U(()=>z.draft.value,e=>{if(!e||e.anchor.kind===`page`)return;let t=document.elementsFromPoint(e.point.x,e.point.y).find(e=>!w0(e)&&e!==document.documentElement);t&&(e.anchor.kind===`element`&&(e.anchor=eo(t,e.point.x,e.point.y)),ue.set(Qs(e.anchor),EV(t)))},{flush:`sync`}),U([L,z.pageThreads,z.openId,z.hoverId,()=>z.draft.value?.anchor,z.shown],dt,{flush:`post`}),U(()=>z.draft.value,ct),U(()=>z.draft.value,e=>{O&&e!==O.draft&&Ze(),e?.anchor.kind===`page`&&b.value&&se?.hide()});let u=jV(e.toolbar);return()=>{let t=[];if(ge.value?.read&&!d.value){t.push(q(rV,{comments:z,readOnly:!he.value,canComment:ye.value,queueFiles:be.value,attachmentUrl:we.attachmentUrl,style:u.value?{"--vh-comment-island-top":u.value}:void 0},{default:()=>[],status:We,actions:Ve})),t.push(q(`div`,{class:`cursors`,ref:y},bt())),t.push(q(`div`,{class:`outlines`},xt())),t.push(e.areas?q(Ad,{to:e.areas},yt()):q(`div`,{class:`areas`},yt()));let n=re.value;if(n&&!z.draft.value){let e=matchMedia(`(pointer: coarse)`).matches,r=n.bottom+(e?20:8),i=n.top<(e?102:56)||e&&r<=innerHeight-46,a=i?Math.min(r,innerHeight-46):n.top-(e?64:8);t.push(q(`div`,{class:`selection`,"data-below":i?`true`:void 0,style:{left:`${Math.min(Math.max(64,n.left),innerWidth-64)}px`,top:`${a}px`},onPointerdown:e=>{e.preventDefault(),st=!0,addEventListener(`pointerup`,()=>setTimeout(()=>{st&&(st=!1,ct())},300),{capture:!0,once:!0})}},q(dV,{side:i?`bottom`:`top`,onComment:()=>lt(ot)})))}x.value&&!d.value&&t.push(q(Ad,{to:x.value},q(cV,{key:s.value,comments:z,attachmentUrl:we.attachmentUrl,readOnly:!he.value||!z.threads.value.some(e=>e.id===ne.value)&&!ye.value,"onUpdate:thread":e=>ne.value=e,status:I.value,"onUpdate:status":e=>I.value=e,title:s.value,heading:!1,composer:!1,queueFiles:be.value,onSelect:e=>{let t=z.positions.value.get(e.id);t&&!t.detached&&t.element?.scrollIntoView({block:`center`,behavior:`smooth`})}},{status:We,actions:Ve,"list-actions":He})))}ge.value?.read&&e.toolbar&&t.push(q(Ad,{to:e.toolbar},_t(n?.menu?null:q(a)))),j.value&&t.push(q(pt));let r=h.value;return t.push(q(`section`,{role:`region`,"aria-label":`Comments notifications`},q(`ol`,{class:`toasts`},r?[q(`li`,{class:`toast`,role:`status`,"data-kind":r.kind,key:v(r)},[q(`span`,r.text),r.link?q(`a`,{href:r.link.href,...r.link.newTab?{target:`_blank`,rel:`noopener noreferrer`}:{}},r.link.label):null,r.action?q(Hw,{color:`neutral`,label:r.action[0],onClick:r.action[1],size:`sm`,variant:`ghost`}):null])]:[]))),t}}});function ht(e){E.value=e,C?.restyle()}function gt(){let e=e=>e.preventDefault();return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Highlight`},[q(`div`,{class:`swatches`},Object.keys(yW).map(e=>q(`button`,{key:e,class:`swatch`,type:`button`,"aria-label":yW[e].label,"aria-keyshortcuts":yW[e].key,"aria-pressed":String(E.value===e),title:`${yW[e].label} (${yW[e].key})`,onClick:()=>ht(e)},L0[e]()))),q(`span`,{class:`sep`}),q(`div`,{class:`swatches`},Object.keys(bW).map(t=>q(`button`,{key:t,class:`swatch`,type:`button`,"aria-label":`${t[0].toUpperCase()}${t.slice(1)} ink`,"aria-pressed":String(D.value===t),onMousedown:e,onClick:()=>{D.value=t,C?.restyle()}},q(`span`,{style:{background:bW[t]}})))),q(`span`,{class:`sep`}),q(`button`,{type:`button`,class:`icon`,"aria-label":`Undo`,"aria-keyshortcuts":`Meta+Z Control+Z`,title:`Undo`,disabled:T.value===0,onClick:()=>C?.undo()},R0()),q(`button`,{type:`button`,onClick:()=>Ke(`view`),title:`Cancel (Esc)`},`Cancel`),q(`button`,{type:`button`,class:`done`,"aria-keyshortcuts":`Enter`,disabled:T.value===0,onClick:Qe,title:`Comment on the highlighted area (Enter)`},`Done`)])}function _t(e){if(P.value,w.value)return gt();let t=me?d0(ae?.people()??[],he.value?.id):[],n=t.slice(0,5).map(({person:e,tabs:t})=>q(`span`,{class:`avatar`,key:e.id,title:t>1?`${e.name} · ${t} tabs`:e.name,style:{background:e.color}},e.image?q(`img`,{src:e.image,alt:``}):f0(e.name))),r=`${t.length} other ${t.length===1?`person`:`people`} on this page`,i=z.counts.value.open,a=Je.value,o=e=>e&&i>0?q(O0,{value:i}):null;return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Comments`},[ye.value?q(`button`,{"aria-keyshortcuts":`C`,"aria-label":a?`Comments: click anywhere on the page`:i?`Comments, ${i} open`:`Comments`,"aria-pressed":String(a),onClick:()=>Ke(a?`view`:`comment`),title:a?`Stop commenting (C)`:`Comment on the page (C)`,type:`button`},[F0(),`Comments`,o(!a)]):q(`button`,{"aria-expanded":String(b.value),"aria-label":i?`Comments, ${i} open`:`Comments`,onClick:()=>b.value?se?.hide():tt(),title:`Show comments`,type:`button`},[F0(),`Comments`,o(!0)]),qe.value===`edit`?q(`button`,{"aria-keyshortcuts":`E`,"aria-pressed":`true`,"data-action":`stop-editing`,onClick:()=>Ke(`view`),title:`Stop editing text (E)`,type:`button`},[z0(),`Editing text`]):null,ye.value&&Se.value===`hidden`?q(`button`,{"aria-keyshortcuts":`Shift+C`,"aria-label":`Show comments`,class:`eye`,onClick:Dt,title:`Comments are hidden. Show comments (Shift+C)`,type:`button`},B0()):null,Ie.value?q(`button`,{"data-action":`copy-page-prompt`,onClick:()=>void ze(),title:Ue(),type:`button`},q(`span`,{class:`swap`},[q(`span`,{"data-shown":String(!Le.value)},[H0(),`Copy prompt`]),q(`span`,{"data-shown":String(Le.value)},[U0(),`Copied`])])):null,n.length>0?q(`span`,{"aria-label":r,class:`people`},n):null,e])}function vt(){let e=r?.signOut,t=e?r?.github:void 0,n=Se.value===`hidden`,i=z.threads.value.length>0;return[be.value?{id:`highlight`,label:`Highlight`,icon:k0,keys:`B`,press:()=>Ke(`mark`)}:void 0,r?.content&&ye.value?{id:`edit`,label:`Edit text`,icon:A0,keys:`E`,press:()=>Ke(`edit`)}:void 0,ye.value&&(i||n)?{id:`visibility`,label:n?`Show comments`:`Hide comments`,icon:n?j0:M0,keys:`⇧C`,press:Dt}:void 0,ye.value&&i?{id:`all-comments`,label:`All comments`,icon:N0,press:tt}:void 0,e&&t?{id:`sign-out`,label:`Sign out @${t.login}`,icon:P0,press:()=>void rt(e)}:void 0].filter(e=>e!==void 0)}function yt(){let e=[],t=(t,n,r)=>{let i=z.positions.value.get(t);if(!i||i.detached||i.clipped||n!==`area`&&n!==`image`||!i.width||!i.height)return;let a=t!==`draft`&&z.leaving.value.has(t);(t===`draft`||a||z.isShown(t))&&e.push(q(`div`,{key:t,"data-leaving":a?`true`:void 0,"data-active":r.active?`true`:void 0,"data-draft":r.draft?`true`:void 0,"data-slot":`comment-mark-area`,"data-status":r.status,style:{left:`${i.x}px`,top:`${i.y}px`,width:`${i.width}px`,height:`${i.height}px`}}))},n=new Set([z.openId.value,z.hoverId.value]);for(let e of z.threads.value)t(e.id,e.anchor.kind,{status:e.status,active:n.has(e.id)});let r=z.draft.value;return r&&t(`draft`,r.anchor.kind,{draft:!0}),e}function bt(){P.value;let e=[];if(!me)return e;for(let[t,n]of ae?.states()??[]){let r=n.cursor,i=n.user;if(!r||!i?.id||i.id===he.value?.id)continue;let a=null;try{a=document.querySelector(r.selector)}catch{}if(!a)continue;let o=a.getBoundingClientRect(),s=typeof i.color==`string`&&/^#[\da-f]{6}$/i.test(i.color)?i.color:p0(i.id);e.push(q(`div`,{class:`cursor`,key:t,style:{left:`${o.left+r.x/1e3*o.width}px`,top:`${o.top+r.y/1e3*o.height}px`}},[q(`svg`,{width:15,height:15,viewBox:`0 0 24 24`,"aria-hidden":`true`},q(`path`,{d:`M4 2l16 7-7 2-3 8z`,fill:s,stroke:`#000`,"stroke-width":1.5})),q(`span`,{style:{background:s}},i.name??`Someone`)]))}return e}function xt(){if(P.value,!S.value)return[];let e=[];for(let t of document.querySelectorAll(`[${to}]`)){let n=t.getAttribute(to),r=t===A.value?`hover`:ee.value.has(n)?`draft`:void 0;if(!r)continue;let i=t.getBoundingClientRect();e.push(q(`div`,{class:`outline`,"data-kind":r,key:`${n}-outline`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`,width:`${i.width+6}px`,height:`${i.height+6}px`}})),e.push(q(`div`,{class:`tag`,key:`${n}-tag`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`}},r===`draft`?`Draft`:n))}return e}let St=Mp({render:()=>q(mt,{key:he.value?.id??``})});Bw(St),St.mount(a),r&&!r.can.read?e.prompt!==!1&&it(r):e.failure&&de({text:e.failure.why,kind:`error`,action:[`Close`,e.exit]},!0);let Ct;function wt(){h.value===Ct&&(h.value=void 0),Ct=void 0}function Tt(e){let t=++p;ka.session(e).then(async([n,r])=>{if(t!==p||s.value!==e)return;if(n){Ct={text:`${n.why} Comments are paused on this page.`,kind:`error`,action:[`Retry`,()=>{s.value===e&&Tt(e)}]},de(Ct,!0);return}wt(),ge.value=r.can,_e.value=r.agent,ve.value=r.repository,l=r.revision;let i=r.subject??{kind:`page`,id:e};if(i.kind!==c.value.kind||i.id!==c.value.id?c.value=i:!ae&&z.status.value===`ready`&&$e(),await ol(),t!==p)return;d.value=!1;let a=f.value;f.value=!1,a&&Ke(`comment`)})}let Et={text:`Comments hidden. Press Shift+C to show them.`,kind:`info`};function Dt(){let e=Se.value!==`hidden`;Se.value=e?`hidden`:`all`,e?de(Et):h.value===Et&&(h.value=void 0)}function Ot(){ye.value?Ke(`comment`):tt()}let kt=()=>[i,x.value?.getRootNode()].filter(e=>e instanceof ShadowRoot),At=()=>kt().some(e=>e.querySelector(`[data-slot='comment-composer'][data-dirty='true']`)!==null),jt=()=>At()||!!Ee.value.outbox?.entries.length,Mt,Nt;return{app:St,hasUnsentComment:At,waitForPendingComment:()=>(Nt||!jt()||(de({text:`Send or discard your Hosted Comments draft to switch to the app's Comments.`,kind:`info`}),Nt=new Promise(e=>{let t=()=>{jt()||Mt?.()},n=new MutationObserver(t),r=Ee.value.onChange(t);Mt=()=>{n.disconnect(),r(),Mt=void 0,Nt=void 0,e()};for(let e of kt())n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-dirty`]})})),Nt),showPanel:tt,pressComments:Ot,setMode:Ke,finishEdit:Ge.finish,navigated(e){if(e===s.value)m.value=location.search;else{if(At()){if(!window.confirm(`Discard your unsent comment and show comments for the new page?`))return;z.cancelDraft()}j.value=!1,N=void 0,s.value=e,clearTimeout(Re),Le.value=!1,m.value=location.search,ne.value=null,w.value&&Ke(`view`),Ze(),wt(),f.value=f.value||z.active.value,z.active.value=!1,d.value=!0,Tt(e),et()}},refresh:De,pointer(e,t){if(S.value){let e=t?$a(t):void 0;e!==A.value&&(A.value=e)}if(!ae||!t||!me)return;let n=t.getBoundingClientRect();ae.setLocal(`cursor`,{selector:Ya(t),x:n.width?Math.round((e.clientX-n.left)/n.width*1e3):0,y:n.height?Math.round((e.clientY-n.top)/n.height*1e3):0})},leave:()=>ae?.setLocal(`cursor`,null),layout:e=>{P.value++,e&&L.value++,re.value&&ct()},selectionChanged:ct,promptAccess:()=>{r&&!r.can.read&&it(r)},editMode:()=>S.value,editElement:()=>Ge.element,startEdit:e=>Ge.start(e),key(e){if(e.key===`Escape`&&S.value){Ke(`view`);return}let t=n?.bar.parentElement?.hasAttribute(`collapsed`)===!0,i=e.metaKey||e.ctrlKey||e.altKey;if(e.shiftKey&&e.key.toLowerCase()===`c`&&!i&&!_0(e)&&ye.value)g0(e),e.repeat||Dt();else if(!(t&&!i&&/^[a-z]$/i.test(e.key))){if(w.value&&(e.key!==`b`||E.value!==`marker`)){let t=v0(e);if(t)ht(t);else if(e.key===`Escape`)Ke(`view`);else if(e.key===`Enter`)Qe();else if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`)C?.undo();else if(![` `,`PageUp`,`PageDown`,`Home`,`End`,`ArrowUp`,`ArrowDown`].includes(e.key))return;g0(e)}else _0(e)||i||(e.key===`c`&&!e.shiftKey&&ye.value&&(g0(e),lt()||Ke(Je.value?`view`:`comment`)),e.key===`b`&&be.value&&(g0(e),Ke(qe.value===`mark`?`view`:`mark`)),e.key===`e`&&r?.content&&ye.value&&(g0(e),Ke(qe.value===`edit`?`view`:`edit`)))}},destroy(){Mt?.(),Xe(),Ze(),ft(),clearTimeout(ce),Ge.finish(!1),et(),Ae(),St.unmount(),se?.destroy();for(let e of o)e()}}}var E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0,L0,R0,z0,B0,V0,H0,U0,W0,G0=t((()=>{wn(),b(),mV(),kz(),_w(),Gw(),gV(),vV(),Y(),ro(),vh(),mm(),Om(),Wi(),Zi(),Aa(),OV(),AV(),NV(),kW(),LW(),Wa(),E0={open:`vh-comment`,resolved:`vh-comment-resolved`,active:`vh-comment-active`,draft:`vh-comment-draft`},D0=e=>`${e}\n${_V.replaceAll(`:root.dark`,`:host(.dark)`).replaceAll(`:root`,`:host`)}\n${hV}`,O0=W({props:{value:{required:!0,type:Number}},setup(e){let t=V(),n=String(e.value);return Ld(()=>t.value&&RC(t.value,e.value)),U(()=>e.value,e=>t.value&&RC(t.value,e),{flush:`post`}),()=>q(`span`,{class:`count`,ref:t},n)}}),k0=`m9 11-6 6v3h9l3-3M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,A0=`M21.17 6.81a1 1 0 0 0-3.98-3.98L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5zM15 5l4 4`,j0=`M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0M9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0`,M0=`M10.73 5.08A10.43 10.43 0 0 1 12 5c4.97 0 8.9 3.06 9.94 6.65a1 1 0 0 1 0 .7 10.8 10.8 0 0 1-1.44 2.49M14.08 14.16a3 3 0 0 1-4.24-4.24M17.48 17.5a10.75 10.75 0 0 1-15.42-5.15 1 1 0 0 1 0-.7 10.75 10.75 0 0 1 4.45-5.14M2 2l20 20`,N0=`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`,P0=`m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,F0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`})),I0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:k0})),L0={marker:I0,pen:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`})),arrow:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7 17 17 7M7 7h10v10`})),text:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M4 7V4h16v3M9 20h6M12 4v16`}))},R0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})),z0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:A0})),B0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:M0})),V0=`vitehub-comments-visibility`,H0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[q(`rect`,{width:14,height:14,x:8,y:8,rx:2}),q(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]),U0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M20 6 9 17l-5-5`})),W0=`comment`})),K0=n({default:()=>Z0,startHostedOverlay:()=>Q0});function q0(e){let t=document.createElement(`style`);return t.textContent=e,t}function J0(e){return t=>{customElements.get(e)||customElements.define(e,class extends Y0{});let n=document.createElement(e);if(!(n instanceof Y0))Ai(Mi.COMMENTS_OVERLAY_ELEMENT_TAKEN({name:e}));else return n.context=t,e===`vitehub-hosted-comments`&&n.addEventListener(Fa,e=>{if(!(e instanceof CustomEvent))return;let t=e.detail,r=n.waitForPendingComment();r&&(t.draft={ready:r,stop:()=>n.stop()})}),document.documentElement.append(n),()=>n.stop()}}var Y0,X0,Z0,Q0,$0=t((()=>{b(),Ka(),ro(),Ni(),Wi(),Aa(),G0(),LW(),Y0=class extends HTMLElement{context;documentStyle=q0(`@layer components {\n${Ga}\n}\n${FW}`);areas=document.createElement(`vitehub-comment-areas`);toolbar=document.createElement(`div`);control;mode=`view`;frame=0;changed=!1;lastCursor=0;cleanups=[];waitForPendingComment(){return this.control?.waitForPendingComment()}get active(){return this.isConnected&&!this.context?.signal.aborted}async connectedCallback(){this.setAttribute(`data-comments-ui`,``),this.shadowRoot||this.attachShadow({mode:`open`});let e=this.context?.bar;if(e){e.tabIndex=-1,e.setAttribute(`data-comments-ui`,``);let t=e.shadowRoot??e.attachShadow({mode:`open`}),n=document.createElement(`button`);n.disabled=!0,n.setAttribute(`aria-busy`,`true`),n.textContent=this.context?.tool.label??`Comments`,t.replaceChildren(q0(g+PW),this.toolbar),this.toolbar.replaceChildren(n)}this.restoreDocumentState(),this.cleanups.push(()=>this.documentStyle.remove());let t=this.areas.shadowRoot??this.areas.attachShadow({mode:`open`});t.replaceChildren(q0(Ga+IW)),this.areas.setAttribute(`data-comments-ui`,``),document.documentElement.append(this.areas),this.cleanups.push(()=>this.areas.remove()),this.followTheme();let n=Ri(location.pathname),r=new AbortController;this.cleanups.push(()=>r.abort());let i=ka.pageThreads(n,r.signal),[a,o]=await ka.session(n),s=this.active&&!a&&o.can.read;if(s||r.abort(),e&&(e.hidden=!s),this.active){if(this.toolbar.replaceChildren(),this.control=T0({host:this,...this.context?{context:this.context}:{},...e?{toolbar:this.toolbar}:{},areas:t,...a?{failure:a}:{session:o},...s&&i?{pageThreads:i}:{},onMode:e=>{this.mode=e,this.restoreDocumentState()},exit:()=>this.context?.exit(),prompt:this.context?.open!==!1}),!s){if(e&&o&&this.active&&!this.context?.open&&(o.signIn||o.signOut)){let t=document.createElement(`button`);t.type=`button`,t.textContent=this.context?.tool.label??`Comments`,t.addEventListener(`click`,()=>this.control?.promptAccess()),this.toolbar.replaceChildren(t),e.hidden=!1}}else this.listen(),this.context?.onOpen(()=>this.control?.showPanel()),this.context?.beforeExit(()=>!this.control?.hasUnsentComment()||window.confirm(`Turn off tools without sending your comment?`)),new URLSearchParams(location.search).has(`comment`)||(this.context?.linked?this.control.pressComments():this.context?.open&&this.control.showPanel())}}disconnectedCallback(){for(let e of this.cleanups.splice(0))e();cancelAnimationFrame(this.frame),this.control?.destroy(),this.control=void 0}followTheme(){let e=()=>{let e=h0();this.style.colorScheme=e?`dark`:`light`,this.classList.toggle(`dark`,e),this.areas.classList.toggle(`dark`,e),this.dataset.theme=e?`dark`:`light`;let t=getComputedStyle(this.areas).getPropertyValue(`--vh-comment-default-ink`).trim(),n=`@layer components {\n${Ga}\n:root { --vh-comment-ink: var(--vh-ui-comment-ink, var(--vh-highlighted, ${t})); }\n}\n${FW}`;this.documentStyle.textContent!==n&&(this.documentStyle.textContent=n)};e();let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`]});let n=matchMedia(`(prefers-color-scheme: dark)`);n.addEventListener(`change`,e),this.cleanups.push(()=>{t.disconnect(),n.removeEventListener(`change`,e)})}on(e,t,n,r){e.addEventListener(t,n,r),this.cleanups.push(()=>e.removeEventListener(t,n,r))}schedule(){cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>{let e=this.changed;this.changed=!1,this.control?.layout(e)})}listen(){let e=()=>this.schedule();this.on(window,`scroll`,e,{capture:!0,passive:!0}),this.on(window,`resize`,e);let t=new MutationObserver(t=>{if(t.every(e=>e.target===this||this.contains(e.target)))return;let n=this.control?.editElement();n&&!n.isConnected&&this.control?.finishEdit(!0),this.restoreDocumentState(),this.changed=!0,e()});t.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`style`,`hidden`]}),this.cleanups.push(()=>t.disconnect());let n=()=>queueMicrotask(()=>{this.active&&this.control?.navigated(Ri(location.pathname))});for(let e of[`astro:before-swap`,`turbo:before-render`])this.on(document,e,()=>void this.control?.finishEdit(!0));for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(...e){let r=t.apply(this,e);return n(),r},this.cleanups.push(()=>{history[e]=t})}this.on(window,`popstate`,n);let r,i=e=>{clearTimeout(r),r=setTimeout(()=>this.control?.selectionChanged(),e)};this.on(document,`selectionchange`,()=>i(200)),this.on(document,`pointerup`,()=>i(0)),this.cleanups.push(()=>clearTimeout(r)),this.on(document,`pointermove`,e=>this.pointerMoved(e),{passive:!0}),this.on(document,`pointerleave`,()=>this.control?.leave()),this.on(document,`click`,e=>this.clicked(e),{capture:!0}),this.on(document,`keydown`,e=>this.control?.key(e)),this.on(document,`visibilitychange`,()=>{document.visibilityState===`visible`&&this.control?.refresh()});let a=setInterval(()=>{document.visibilityState===`visible`&&this.control?.refresh()},3e4);this.cleanups.push(()=>clearInterval(a))}ours(e){let t=e.composedPath(),n=this.context?.bar.parentElement;return t.includes(this)||t.some(e=>e instanceof Element&&e.localName===`vitehub-window`)||!!(n&&t.includes(n))}elementAt(e,t){return document.elementsFromPoint(e,t).find(e=>e!==this&&!this.contains(e)&&e!==document.documentElement)}pointerMoved(e){this.ours(e)||!this.control?.editMode()&&e.timeStamp-this.lastCursor<80||(this.lastCursor=e.timeStamp,this.control?.pointer(e,this.elementAt(e.clientX,e.clientY)))}clicked(e){if(this.ours(e)||!this.control?.editMode())return;let t=this.elementAt(e.clientX,e.clientY),n=t?$a(t):void 0;n&&n!==this.control.editElement()&&(e.preventDefault(),e.stopPropagation(),this.control.startEdit(n))}restoreDocumentState(){this.documentStyle.parentElement!==document.head&&document.head.append(this.documentStyle);for(let e of[`comment`,`edit`]){let t=`vitehub-${e}-mode`,n=this.mode===e;document.documentElement.classList.contains(t)!==n&&document.documentElement.classList.toggle(t,n)}}stop(){this.isConnected&&(this.control?.finishEdit(!1),this.control?.setMode(`view`),this.mode=`view`,this.restoreDocumentState(),this.remove())}},X0=J0(Na),Z0=e=>{let t=ja();if(!t)return X0(e);let n=!1,r;return t.ready.then(()=>{n||e.signal.aborted||(t.stop(),r=X0(e))}),()=>{n=!0,r?.()}},Q0=J0(Pa)}));Ni(),Aa(),Ia(),Wa();var e2={id:`comments`,label:`Comments`,icon:`i-lucide-message-square-text`,script:`comments`,param:`comment`},t2={id:`console`,label:`Console`,icon:`i-lucide-layout-dashboard`,script:`console`},n2={id:`projects`,label:`Choose a team for Comments`,icon:``,script:`projects`},r2={name:`vitehub-hosted-comments-pill`,label:`ViteHub Comments`,off:`vitehub-hosted-comments-off`,collapsed:`vitehub-hosted-comments-collapsed`,dock:`vitehub-hosted-comments-dock`,initialDock:{edge:`right`,at:85}};function i2(){return Promise.reject(ki(405))}function a2(e,t){return{namespace:new URL(La(t.id),t.console).href,async session(n){try{let r=(await(await e).call(`session`,n)).value;if(t.consoleUrl&&r.signIn?.provider===`console`){let e=new URL(r.signIn.url);e.searchParams.set(`linked`,``),r.signIn={...r.signIn,url:e.href}}return[void 0,t.repository?{...r,repository:t.repository}:r]}catch(e){return[ga(e),void 0]}},changes(t){let n,r=!1;return e.then(e=>{r||(n=e.onChange(t))},()=>void 0),()=>{r=!0,n?.()}},transport(t){let n=async(n,r)=>{let i=await(await e).call(n,r);return t({data:i.value,people:i.people}),i.value};return{list:e=>n(`list`,e),get:e=>n(`get`,e),create:({files:e,outbox:t,...r})=>n(`create`,r),reply:({files:e,outbox:t,...r})=>n(`reply`,r),resolve:e=>n(`resolve`,{threadId:e.threadId}),reopen:e=>n(`reopen`,{threadId:e.threadId}),edit:i2,delete:i2,users:async()=>[],upload:i2,attachmentUrl:()=>``}}}}var o2;function s2(){return!Ma()&&(o2??=customElements.whenDefined(Na).then(async()=>{Ma();let e=ja();e&&await e.ready,Ei()}),!0)}async function c2(e,t){if(!s2())return;Ei(),ya(a2(e,t));let{consoleUrl:n}=t;await wi({pill:r2,session:async()=>({tools:n?[e2,t2]:[e2]}),load:async e=>e===`console`&&n?u2(n):{default:(await Ua(async()=>{let{startHostedOverlay:e}=await Promise.resolve().then(()=>($0(),K0));return{startHostedOverlay:e}},void 0,import.meta.url)).startHostedOverlay}})}var l2=`M7 7h10v10M7 17 17 7`;function u2(e){return{default({menu:t,onOpen:n}){let r=()=>{window.open(e,`_blank`,`noopener`)};n(r),t([{id:`console`,label:`Open in the Console`,icon:l2,press:r}])}}}async function d2(e,t){s2()&&await wi({pill:r2,session:async()=>({tools:t.length?[n2,t2]:[t2]}),load:async n=>n===`console`?u2(e):{default({bar:e}){let n=document.createElement(`select`);n.setAttribute(`aria-label`,n2.label),n.append(new Option(n2.label,``));for(let[e,r]of t.entries())n.append(new Option(r.team,String(e)));n.addEventListener(`change`,()=>{n.selectedIndex>0&&t[n.selectedIndex-1]?.choose()}),e.append(n)}}})}export{c2 as mountHostedComments,d2 as mountHostedProjectChoice};
|
|
362
|
+
`})),EW,DW,OW,kW=t((()=>{jn(),EW={why:({message:e})=>e===void 0?``:String(e)},DW={RUNTIME_R0001:{...EW,fix:"Pass `maxDepth` to `normalizeRuntimeDiagnosticError()` as an integer of 0 or more, or remove it to use the default."},RUNTIME_R0002:{...EW,fix:"Pass `maxErrors` to `normalizeRuntimeDiagnosticError()` as an integer of 1 or more, or remove it to use the default."},RUNTIME_R0003:{...EW,fix:"Pass `maxStringLength` to `normalizeRuntimeDiagnosticError()` as an integer of 64 or more, or remove it to use the default."},RUNTIME_R0004:{...EW,fix:"Read the logs of the process that `vitehub drain` waited for to find why its drain failed, then fix that failure and run `vitehub drain` again."},RUNTIME_R0005:{...EW,fix:"Read the logs of the process that the message names to find why it stopped, then start it again before you run `vitehub drain`."},RUNTIME_R0006:{...EW,fix:"Pass `new ViteHubError()` a nonempty `code` and `message` string within the length limits, and plain JSON `details`."},RUNTIME_R0007:{...EW,fix:"Give the execution authority a valid value for each of `credentials`, `environment`, `filesystem.access`, `filesystem.scope`, `isolation`, `network`, and `processes`."},RUNTIME_R0009:{...EW,fix:"Set `intervalMs` of the process reconciler to a number of milliseconds from 1 to 2147483647."},RUNTIME_R0010:{...EW,fix:"Give the process reconciler a `signal` other than `SIGKILL` or `SIGSTOP`, or set `signal: false`."},RUNTIME_R0011:{...EW,fix:"Call `drain()` of the process reconciler after its callback returns, not from inside the callback."},RUNTIME_R0015:{...EW,fix:"Pass the `Request` of a Fetchable handler, or the event of an H3 or Nitro route, to `getStandardContext()`."},RUNTIME_R0016:{...EW,fix:"Return the body or a `Response` from the handler, in place of setting `~standard.res.body`."},RUNTIME_R0017:EW,RUNTIME_R0018:EW,RUNTIME_CONSOLE_PATH_INVALID:{why:({value:e})=>`${e} is not a Console path. Use a path that starts with one /, such as /agents/<agent>.`,fix:"Pass `hostedConsoleUrl()` a Console path that starts with one `/`, such as `/kv` or `/agents/<agent>/invocations/<id>`."},RUNTIME_CONSOLE_PROJECT_URL_INVALID:{why:({value:e})=>`${e} is not a project URL. Use the https:// origin of the app, with its base path if it has one.`,fix:"Pass `hostedConsoleUrl()` the `https://` origin of the app, or `http://localhost` in development, with its base path and without a user name or password."},RUNTIME_CONSOLE_URL_INVALID:{why:()=>"`VITEHUB_CONSOLE_URL` must be an https origin without a path, or an http origin on localhost.",fix:"Set `VITEHUB_CONSOLE_URL` on the server to the origin of your ViteHub Console, such as `https://console.example.com`, with no path, query, or user name. Then restart or deploy the server."},RUNTIME_DURATION_INVALID:{why:({option:e,value:t})=>`${e?`\`${e}\``:`The value`} is ${t}, which is not a duration. A duration is a string with a number of 0 or more and a unit, such as "30s", "5m", or "1 day".`,fix:({suggestion:e,unit:t=`milliseconds`,value:n})=>e?`Write the time as a string with a unit: ${n} ${t} is ${e}.`:'Write a number of 0 or more and one unit: `ms`, `s`, `m`, `h`, `d`, or `w`, or a long name such as `minutes` or `days`. For example `"30s"`, `"5m"`, or `"1 day"`.'},RUNTIME_EVENT_LOOP_WARNING_INVALID:{why:({value:e})=>`\`watchEventLoop()\` received \`afterMs: ${e}\`. The threshold must be a whole number of milliseconds of 100 or more.`,fix:"Pass a whole number of milliseconds of 100 or more, or omit `afterMs` to use the default of 10 000 ms."},RUNTIME_EXECUTION_BUDGET_AMOUNT_INVALID:{why:({counter:e})=>`[vitehub] Execution budget ${e} amount must be a finite non-negative number.`,fix:"Pass `consume()` and the `record*()` methods of the execution budget a finite number of 0 or more."},RUNTIME_EXECUTION_BUDGET_EXCEEDED:{why:({counter:e})=>`[vitehub] Execution budget exhausted for ${e}.`,fix:"Raise the `executionBudget` limit that `error.counter` names, such as `maxToolCalls`, `maxRetries`, `maxInputBytes`, or `maxOutputBytes`, or give the run less work."},RUNTIME_EXECUTION_BUDGET_LIMIT_INVALID:{why:()=>`[vitehub] Execution budget limits must be finite non-negative numbers.`,fix:"Set each limit of `executionBudget`, such as `maxToolCalls` or `maxOutputBytes`, to a finite number of 0 or more, or remove it."},RUNTIME_HIDDEN_ERROR:{why:()=>`The server failed. The error is not a ViteHub error, so its message and stack stay on the server.`,fix:"Read the server logs for the error. To send a code, a why, and a fix to the client, return a `ResultError` from `defineErrors()` and pass it to `toResponse()`."},RUNTIME_PUBLIC_URL_INVALID:{why:()=>"`VITEHUB_PUBLIC_URL` must be an http or https origin without a path.",fix:"Set `VITEHUB_PUBLIC_URL` on the server to the origin that serves the app, such as `https://shop.example.com`, with no path, query, or user name. Then restart or deploy the server."},RUNTIME_SERIALIZED_RESPONSE_INVALID:{why:()=>`Invalid serialized Response`,fix:"Pass `deserializeResponse()` the record that `serializeResponse()` returned, unchanged. Check it first with `isSerializedResponse()`."}},OW=Dn({docsBase:`https://vitehub.dev/docs/runtime/diagnostics`,codes:DW})}));function AW(){throw OW.RUNTIME_R0006({message:`[vitehub] ViteHubError requires a valid public error contract.`})}function jW(e){try{return Array.isArray(e)}catch{AW()}}function MW(e,t,n=!1){try{let r=Object.getOwnPropertyDescriptor(e,t);return r===void 0?void 0:((!(`value`in r)||n&&!r.enumerable)&&AW(),r.value)}catch{AW()}}function NW(e,t,n,r){if(t.nodes+=1,t.nodes>zW&&AW(),e===void 0&&r)return;if(e===null||typeof e==`boolean`||typeof e==`string`&&e.length<=BW||typeof e==`number`&&Number.isFinite(e))return e;(typeof e!=`object`||n>IW||t.ancestors.has(e))&&AW();let i,a;try{i=Object.getPrototypeOf(e),a=Reflect.ownKeys(e)}catch{AW()}t.ancestors.add(e);try{if(jW(e)){let r=MW(e,`length`);(!Number.isSafeInteger(r)||r<0||r>LW||a.length!==r+1||!a.includes(`length`))&&AW();let i=[];for(let o=0;o<r;o+=1){let r=String(o);a.includes(r)||AW(),i.push(NW(MW(e,r,!0),t,n+1,!1))}return Object.freeze(i)}i!==Object.prototype&&i!==null&&AW(),(a.length>LW||a.some(e=>typeof e!=`string`))&&AW();let r={};for(let i of a)(i.length===0||i.length>RW)&&AW(),Object.defineProperty(r,i,{enumerable:!0,value:NW(MW(e,i,!0),t,n+1,!0),writable:!0});return Object.freeze(r)}finally{t.ancestors.delete(e)}}function PW(e){if(e!==void 0)return(typeof e!=`object`||!e||jW(e))&&AW(),NW(e,{ancestors:new Set,nodes:0},0,!1)}function FW(e,t,n){(typeof e!=`string`||e.length===0||e.length>VW)&&AW(),(typeof t!=`string`||t.length===0||t.length>HW)&&AW(),(typeof n!=`object`||!n||jW(n))&&AW();let r=MW(n,`cause`),i=PW(MW(n,`details`)),a=MW(n,`requestId`);return a!==void 0&&(typeof a!=`string`||a.length===0||a.length>UW)&&AW(),{cause:r,code:e,details:i,message:t,name:`ViteHubError`,requestId:a,shape:Object.freeze({code:e,...i===void 0?{}:{details:i},message:t,name:`ViteHubError`,...a===void 0?{}:{requestId:a}})}}var IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW=t((()=>{kW(),IW=8,LW=128,RW=128,zW=1024,BW=16384,VW=128,HW=16384,UW=256,WW=new WeakMap,GW=class extends Error{code;details;requestId;constructor(e,t,n={}){let r=FW(e,t,n);super(r.message,r.cause===void 0?void 0:{cause:r.cause}),this.name=`ViteHubError`,this.code=r.code,this.details=r.details,this.requestId=r.requestId;let i=this.toJSON.bind(this);Object.defineProperties(this,{code:{configurable:!0,enumerable:!0,value:r.code,writable:!1},details:{configurable:!0,enumerable:!0,value:r.details,writable:!1},message:{configurable:!0,enumerable:!1,value:r.message,writable:!1},name:{configurable:!1,enumerable:!1,value:r.name,writable:!1},requestId:{configurable:!0,enumerable:!0,value:r.requestId,writable:!1},toJSON:{configurable:!1,enumerable:!1,value:i,writable:!1}}),WW.set(this,r.shape)}toJSON(){let e=WW.get(this);if(e)return e;let t=FW(MW(this,`code`),MW(this,`message`),{details:MW(this,`details`),requestId:MW(this,`requestId`)});return WW.set(this,t.shape),t.shape}}}));function qW(e){return e!==null&&Object(e)===e}function JW(e){if(!qW(e))return!1;try{let t=Reflect.get(Error,`isError`);if(typeof t==`function`)return t(e)===!0;let n=globalThis.process?.getBuiltinModule?.(`node:util`)?.types?.isNativeError;return n?n(e):e instanceof Error||!(Symbol.toStringTag in e)&&Object.prototype.toString.call(e)===`[object Error]`}catch{return!1}}var YW=t((()=>{}));function XW(e){if(!JW(e))return!1;try{let t=Reflect.get(e,`message`),n=Reflect.get(e,`code`),r=Reflect.get(e,`name`),i=Reflect.get(e,`why`),a=Reflect.get(e,`fix`),o=Reflect.get(e,`docs`),s=Reflect.get(e,`sources`);return typeof n==`string`&&n.length>0&&typeof r==`string`&&typeof t==`string`&&i===t&&(a===void 0||typeof a==`string`)&&(o===void 0||typeof o==`string`)&&(s===void 0||Array.isArray(s)&&s.every(e=>typeof e==`string`))&&typeof Reflect.get(e,`toJSON`)==`function`}catch{return!1}}var ZW=t((()=>{YW()}));function QW(e){let t=t=>{let n=Object.getOwnPropertyDescriptor(e,t);return n?n.configurable===!0:Object.isExtensible(e)},n=t(`name`)&&t(`toJSON`)&&(Object.hasOwn(e,eG)||Object.isExtensible(e))?e:new kn({code:e.code,why:e.why,fix:e.fix,docs:e.docs,cause:e.cause,data:e.data,sources:e.sources});if(n!==e){n.stack=e.stack;let t=Reflect.get(e,`status`);typeof t==`number`&&Object.defineProperty(n,"status",{configurable:!0,value:t})}return Object.defineProperty(n,"name",{configurable:!0,value:n.code,writable:!0}),Object.defineProperty(n,eG,{value:!0}),Object.defineProperty(n,"toJSON",{configurable:!0,value:()=>({code:n.code,docs:n.docs,fix:n.fix,name:n.name,why:n.why})}),n}function $W(e){let t=Dn({codes:e.codes,docsBase:e.docs}),n=new Set(Object.keys(e.codes)),r=Object.defineProperty({},"is",{value:e=>XW(e)&&n.has(e.code)});for(let i of n){let n=t[i],a=e.codes[i]?.status;r[i]=Object.assign(e=>{let t=QW(n(e));return a!==void 0&&Object.defineProperty(t,"status",{configurable:!0,enumerable:!1,value:a}),t},{is:e=>XW(e)&&e.code===i})}return r}var eG,tG=t((()=>{ZW(),jn(),eG=Symbol.for(`vitehub.runtime.resultError`)})),nG=t((()=>{KW(),tG()})),rG,iG=t((()=>{nG(),rG=$W({docs:`https://vitehub.dev/docs/realtime/diagnostics`,codes:{REALTIME_DISABLED:{why:({action:e})=>`Realtime is disabled, so \`${e}()\` cannot run.`,fix:"Set `enabled` to `true` on `useRealtimeTiptap()` before you call the method."},REALTIME_DISCONNECTED:{why:({action:e})=>`The realtime document disconnected or changed during \`${e}()\`.`,fix:"Call the method again after the new document connects. Read `synced` to know when it is ready."},REALTIME_INVALID_DOCUMENT:{why:({action:e})=>`The room body does not fit the editor schema, so \`${e}()\` did not write it. Writing it would lose content.`,fix:`Keep editing until the document fits the editor extensions of the Realtime Definition, then call the method again. The room keeps the edits.`},REALTIME_INVALID_RESPONSE:{why:({action:e})=>`The realtime server answered \`${e}()\` with a response that the client cannot use.`,fix:"Use the same `@vite-hub/realtime` version on the client and the server, and build again."},REALTIME_MISSING_DOCUMENT:{why:({action:e})=>`\`${e}()\` needs a document, and \`documentId\` is empty.`,fix:"Pass a document path to `useRealtimeTiptap(definition, documentId)` before you call the method."},REALTIME_READ_ONLY:{why:({action:e})=>`The room is read-only, so \`${e}()\` cannot write the document.`,fix:"Read `readOnlyReason` of `useRealtimeTiptap()` for the reason. Do not offer save or publish while it is set."},REALTIME_REQUEST_FAILED:{why:({action:e,message:t,status:n})=>`The realtime \`${e}()\` request failed${n===void 0?``:` with HTTP ${n}`}${t?`: ${t}`:`.`}`,fix:"Read `error.why` for the server message, `error.data.status` for the HTTP status, and `error.cause` for a network error. Retry when the server is available again.",data:({status:e})=>({status:e})},REALTIME_SOURCE_CHANGED:{why:({action:e})=>`The server refused \`${e}()\` because the stored document changed outside the room.`,fix:"Tell the person that the stored document changed. Use `onReset()` to detect a room reset and read unsaved edits from the event's `previous` document."},REALTIME_SYNC_PENDING:{why:({action:e})=>`The room did not receive every edit of this client in time, so \`${e}()\` did not run. The composable tried 20 times.`,fix:"Call the method again when `synced` is true. When it keeps failing, check that the WebSocket stays connected."},REALTIME_ROOM_ABORTED:{why:`The request to the room stopped because its signal aborted.`,fix:`Nothing to fix when the caller stopped on purpose, such as a cancelled Agent run. Call again to ask once more.`},REALTIME_ROOM_CROWDED:{why:({count:e})=>`${e} browsers are in the room, and a request goes to one browser only.`,fix:`Give each browser its own room, such as a random id for each tab, so that one browser answers.`},REALTIME_ROOM_ELSEWHERE:{why:`No browser in this instance is in the room. With Redis or Postgres, the browser can be connected to another instance, and requests reach only the browsers of the same instance.`,fix:`Route the browser and the caller to the same instance, such as with sticky sessions, or run one Node instance.`},REALTIME_ROOM_EMPTY:{why:`No browser is in the room. The page is closed, or it has not joined yet.`,fix:`Open the page again. The request waits a few seconds for a browser to join before it gives up.`},REALTIME_ROOM_REFUSED:{why:({reason:e})=>`The browser could not answer: ${e}`,fix:"Read the reason. Add `room.onRequest(handler)` on the page, and keep each answer under 1 MiB."},REALTIME_ROOM_REQUESTS_OFF:{why:({definition:e})=>`The Realtime Definition "${e}" does not take requests.`,fix:'Define it with `defineRealtime({ access: "public", document: false, requests: true })`.'},REALTIME_ROOM_TIMEOUT:{why:({timeout:e})=>`The browser did not answer in ${e/1e3} seconds.`,fix:"Make the page answer sooner, or pass a longer `timeout` to `requestRealtimeRoom()`."},REALTIME_AWARENESS_OWNERSHIP_CONFLICT:{why:`A realtime awareness client id belongs to another peer.`,fix:`Let each editor tab use its own Yjs awareness client. Do not reuse a client id on two connections.`},REALTIME_AWARENESS_TOO_LARGE:{why:`Realtime awareness state exceeds the 8 MiB room quota.`,fix:`Keep less data in awareness state. Store large values in the document or in Workspace.`},REALTIME_DOCUMENT_TOO_LARGE:{why:`The realtime document exceeds the 8 MiB room quota.`,fix:`Split the document into smaller documents, or keep large assets in Workspace or Blob.`},REALTIME_INVALID_AWARENESS:{why:`A realtime awareness update has a state that is not a plain object.`,fix:"Set awareness state to a plain object, for example `awareness.setLocalStateField('user', { name })`."},REALTIME_TOO_MANY_AWARENESS_CLIENTS:{why:`One realtime peer sent more than 1,024 awareness clients.`,fix:`Use one awareness client for each editor tab.`},REALTIME_ROOM_WRITE_CONFLICT:{why:`Realtime room record compare-and-set failed.`,fix:`Connect again. Another Realtime instance changed the room at the same time. If it keeps failing, check that every instance uses the same Realtime bus.`},REALTIME_WRITE_REJECTED:{why:({problem:e,readOnly:t})=>e===`missing-state`?`Realtime update depends on state this room does not have.`:e===`status`?`Realtime document status is written by the server.`:t??`This realtime connection is read-only.`,fix:"Write only through a writable connection, and do not change the `status` map, which the server writes. A client that misses room state connects again to sync it."},REALTIME_DOCUMENT_CONFLICT:{why:({problem:e})=>e??`The stored document changed since the realtime room loaded it.`,fix:"Realtime re-seeds the room from the stored document. Listen to `onReset()` to recover text that the room did not save."},REALTIME_BLOB_ETAG_MISSING:{why:({pathname:e})=>`The Blob store returned no \`httpEtag\` for ${e}, so \`blobDocument()\` cannot save the file only if it is unchanged.`,fix:"Pass a ViteHub Blob store, such as `blob` from `vite-hub/blob`, whose `head()` returns `httpEtag` on every driver. A store of your own must return `httpEtag` from `head()` and accept `ifMatch` in `put()`."},REALTIME_INVALID_PERSISTENCE:{why:({name:e,reason:t})=>t===`below-debounce`?"Realtime `persistence.maxWait` must be at least `persistence.debounce`.":`Realtime \`persistence.${e}\` must be a non-negative number of milliseconds.`,fix:"Set `persistence: { debounce: 2_000, maxWait: 10_000 }`, or remove the option to use these defaults."},REALTIME_MISSING_ACCESS:{why:`The Realtime definition sets no access rule, so it does not say who can read and write its rooms.`,fix:'Set `authorize: true` to require a signed-in user, set `authorize()` to decide each request, or set `access: "public"` to let anyone read and write.'},REALTIME_INVALID_ACCESS:{why:({reason:e})=>e===`auth`?"The Realtime definition sets `auth`. Realtime replaced it with `authorize: true`, and an `authorize()` callback now also runs for signed-out callers.":e===`public-with-rule`?'The Realtime definition sets `access: "public"` together with `authorize`, so its access rule is not clear.':e===`not-public`?'The Realtime definition sets `access` to a value other than "public".':e===`not-authorize`?"The Realtime definition sets `authorize` to a value that is not `true` or a function.":"The Realtime definition sets `origins()` with `authorize: true` and no `identify()`. Only the Auth trusted-origin policy can allow a different origin to use the ViteHub Auth session.",fix:({reason:e})=>e===`auth`?"Replace `auth: true` with `authorize: true`. With an `authorize()` callback, remove `auth` and return `false` from the callback when `user` is `null`.":e===`origins-without-identify`?"Remove `origins()`, or add `identify()` that reads a credential the page sends on purpose, such as a ticket in `params`.":e===`not-authorize`?"Set `authorize: true` to require a signed-in user, or set `authorize()` to a function that returns `true` to allow.":'Use `access: "public"` alone for open rooms. To limit access, remove `access` and set `authorize`.'},REALTIME_CHECKPOINT_UNSUPPORTED:{why:"The Realtime definition sets `history.checkpoint`, but its document adapter has no `checkpoint()` method, so `history.checkpoint()` could never run.",fix:"Add `checkpoint(context, { digest, message, user })` to the document adapter, use `document: { workspace }`, or remove `history`."},REALTIME_INVALID_USER:{why:"The realtime identity needs a user `id` that is a non-empty string of at most 256 characters.",fix:"Return a user with an `id` from the Auth session or from `authorize()`."},REALTIME_MISSING_DIGEST:{why:({operation:e})=>e===`save`?`Realtime saves need Workspace file digests, and the Workspace Store did not return one.`:`Realtime checkpoints need a stored document, and the save returned no digest.`,fix:"Use a Workspace Store that returns file digests, or return `digest` from the document adapter `save()`."},REALTIME_INVALID_POSTGRES_URL:{why:"REALTIME_POSTGRES_URL is set, and it is not a `postgres://` or `postgresql://` URL.",fix:`Set REALTIME_POSTGRES_URL to a Postgres URL, or remove it so that Realtime uses the connection of the Default Database.`},REALTIME_MISSING_BUS_CONNECTION:{why:({driver:e})=>e===`redis`?`Realtime driver "redis" shares rooms through Redis, and REDIS_URL and a Redis KV_URL are not set.`:`Realtime driver "postgres" needs REALTIME_POSTGRES_URL or a Default Database that uses postgres.js.`,fix:'Set REDIS_URL for Redis. For Postgres, set REALTIME_POSTGRES_URL or use a Default Database with `dialect: "postgresql"` and no `driver` override. A Default Database with `driver: "node-postgres"` needs a separate REALTIME_POSTGRES_URL for the Postgres bus.'},REALTIME_MISSING_SHARED_BUS:{why:`This host runs each request in one of many function instances. Realtime must use Redis or Postgres to share rooms, but it found no bus connection.`,fix:'Set REDIS_URL, a Redis KV_URL, or REALTIME_POSTGRES_URL. Realtime can also use the Default Database with `dialect: "postgresql"` and no `driver` override.'},REALTIME_ROOM_LOCK_TIMEOUT:{why:`Realtime waited 30 seconds for the save lock of a room, and another instance still holds it.`,fix:"Make the document adapter `save()` finish in less than 30 seconds. Realtime tries the save again."},REALTIME_DRIVER_CONFLICT:{why:({driver:e,host:t})=>e===`memory`?`Realtime driver "memory" is single-process only, and the ${t} host runs more than one process.`:e===`cloudflare`?`Realtime driver "cloudflare" does not work with the ${t} host.`:`Realtime driver "${e}" needs a Node.js server, and the ${t} host does not run one.`,fix:'Set `realtime.driver` to "cloudflare" with a Cloudflare host. With the Node host, use "auto", "postgres", "redis", or "memory". With the Vercel host, use "auto", "postgres", or "redis".'},REALTIME_MISSING_DRIVER:{why:`Realtime production builds need one room driver, and ViteHub cannot select one for this deployment.`,fix:`Deploy with a Cloudflare host to use Durable Objects, or with the Node or Vercel host to share rooms through Postgres or Redis.`},REALTIME_RENAMED_AUTHORITY_KEY:{why:({value:e})=>`\`realtime.authority\` is ${e}. ViteHub renamed this key to \`driver\`, and it does not read \`authority\`, so Realtime would not use the driver you chose.`,fix:({value:e})=>`Set \`realtime: { driver: ${e} }\`.`}}})})),aG=t((()=>{})),oG,sG,cG,lG,uG,dG,fG=t((()=>{oG=Math.floor,sG=Math.abs,cG=(e,t)=>e<t?e:t,lG=(e,t)=>e>t?e:t,Number.isNaN,uG=Math.pow,dG=e=>e===0?1/e<0:e<0})),pG,mG,hG,gG=t((()=>{fG(),pG=2**53-1,mG=-(2**53-1),hG=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&oG(e)===e),Number.isNaN,Number.parseInt})),_G,vG=t((()=>{_G=()=>new Set})),yG,bG,xG,SG,CG,wG,TG,EG=t((()=>{yG=e=>e[e.length-1],bG=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},xG=Array.from,SG=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},CG=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},wG=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},TG=Array.isArray})),DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG=t((()=>{EG(),DG=String.fromCharCode,String.fromCodePoint,DG(65535),OG=e=>e.toLowerCase(),kG=/^\s*/g,AG=e=>e.replace(kG,``),jG=/([A-Z])/g,MG=(e,t)=>AG(e.replace(jG,e=>`${t}${OG(e)}`)),NG=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},PG=typeof TextEncoder<`u`?new TextEncoder:null,FG=e=>PG.encode(e),IG=PG?FG:NG,LG=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),LG&&LG.decode(new Uint8Array).length===1&&(LG=null),RG=(e,t)=>wG(t,()=>e).join(``)})),BG,VG,HG,UG=t((()=>{BG=e=>Error(e),VG=()=>{throw BG(`Method unimplemented`)},HG=()=>{throw BG(`Unexpected case`)}})),WG,GG,KG,qG,JG,YG,XG,Z,ZG,QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK=t((()=>{fG(),gG(),aG(),zG(),EG(),WG=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},GG=()=>new WG,KG=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},qG=e=>{let t=new Uint8Array(KG(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},JG=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(lG(n,t)*2),e.cpos=0)},YG=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},XG=YG,Z=(e,t)=>{for(;t>127;)YG(e,128|127&t),t=oG(t/128);YG(e,127&t)},ZG=(e,t)=>{let n=dG(t);for(n&&(t=-t),YG(e,(t>63?128:0)|(n?64:0)|63&t),t=oG(t/64);t>0;)YG(e,(t>127?128:0)|127&t),t=oG(t/128)},QG=new Uint8Array(3e4),$G=QG.length/3,eK=(e,t)=>{if(t.length<$G){let n=PG.encodeInto(t,QG).written||0;Z(e,n);for(let t=0;t<n;t++)YG(e,QG[t])}else iK(e,IG(t))},tK=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Z(e,r);for(let t=0;t<r;t++)YG(e,n.codePointAt(t))},nK=PG&&PG.encodeInto?eK:tK,rK=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=cG(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(lG(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},iK=(e,t)=>{Z(e,t.byteLength),rK(e,t)},aK=(e,t)=>{JG(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},oK=(e,t)=>aK(e,4).setFloat32(0,t,!1),sK=(e,t)=>aK(e,8).setFloat64(0,t,!1),cK=(e,t)=>aK(e,8).setBigInt64(0,t,!1),lK=new DataView(new ArrayBuffer(4)),uK=e=>(lK.setFloat32(0,e),lK.getFloat32(0)===e),dK=(e,t)=>{switch(typeof t){case`string`:YG(e,119),nK(e,t);break;case`number`:hG(t)&&sG(t)<=2147483647?(YG(e,125),ZG(e,t)):uK(t)?(YG(e,124),oK(e,t)):(YG(e,123),sK(e,t));break;case`bigint`:YG(e,122),cK(e,t);break;case`object`:if(t===null)YG(e,126);else if(TG(t)){YG(e,117),Z(e,t.length);for(let n=0;n<t.length;n++)dK(e,t[n])}else if(t instanceof Uint8Array)YG(e,116),iK(e,t);else{YG(e,118);let n=Object.keys(t);Z(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];nK(e,i),dK(e,t[i])}}break;case`boolean`:YG(e,t?120:121);break;default:YG(e,127)}},fK=class extends WG{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Z(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},pK=e=>{e.count>0&&(ZG(e.encoder,e.count===1?e.s:-e.s),e.count>1&&Z(e.encoder,e.count-2))},mK=class{constructor(){this.encoder=new WG,this.s=0,this.count=0}write(e){this.s===e?this.count++:(pK(this),this.count=1,this.s=e)}toUint8Array(){return pK(this),qG(this.encoder)}},hK=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);ZG(e.encoder,t),e.count>1&&Z(e.encoder,e.count-2)}},gK=class{constructor(){this.encoder=new WG,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(hK(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return hK(this),qG(this.encoder)}},_K=class{constructor(){this.sarr=[],this.s=``,this.lensE=new mK}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new WG;return this.sarr.push(this.s),this.s=``,nK(e,this.sarr.join(``)),rK(e,this.lensE.toUint8Array()),qG(e)}}})),yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,Q,kK,AK,jK,MK,NK,PK,FK,IK,LK,RK,zK,BK,VK,HK,UK=t((()=>{aG(),fG(),gG(),zG(),UG(),yK=BG(`Unexpected end of array`),bK=BG(`Integer out of Range`),xK=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw yK;return new Uint8Array(e.buffer,e.byteOffset+t,n)},SK=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw yK;return new DataView(e.buffer,e.byteOffset+t,n)},CK=class{constructor(e){this.arr=e,this.pos=0}},wK=e=>new CK(e),TK=e=>e.pos!==e.arr.length,EK=(e,t)=>{let n=xK(e.arr,e.pos,t);return e.pos+=t,n},DK=e=>EK(e,Q(e)),OK=e=>e.arr[e.pos++],Q=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>pG)throw bK}throw yK},kK=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>pG)throw bK}throw yK},AK=e=>{let t=Q(e);if(t===0)return``;{let n=String.fromCodePoint(OK(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(OK(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},jK=e=>LG.decode(DK(e)),MK=LG?jK:AK,NK=(e,t)=>{let n=SK(e.arr,e.pos,t);return e.pos+=t,n},PK=e=>NK(e,4).getFloat32(0,!1),FK=e=>NK(e,8).getFloat64(0,!1),IK=e=>NK(e,8).getBigInt64(0,!1),LK=[e=>void 0,e=>null,kK,PK,FK,IK,e=>!1,e=>!0,MK,e=>{let t=Q(e),n={};for(let r=0;r<t;r++){let t=MK(e);n[t]=RK(e)}return n},e=>{let t=Q(e),n=[];for(let r=0;r<t;r++)n.push(RK(e));return n},DK],RK=e=>LK[127-OK(e)](e),zK=class extends CK{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),this.count=TK(this)?Q(this)+1:-1),this.count--,this.s}},BK=class extends CK{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=kK(this);let e=dG(this.s);this.count=1,e&&(this.s=-this.s,this.count=Q(this)+2)}return this.count--,this.s}},VK=class extends CK{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=kK(this),t=e&1;this.diff=oG(e/2),this.count=1,t&&(this.count=Q(this)+2)}return this.s+=this.diff,this.count--,this.s}},HK=class{constructor(e){this.decoder=new BK(e),this.str=MK(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),WK,$,GK,KK=t((()=>{jn(),WK={why:({message:e})=>e===void 0?``:String(e)},$=e=>({...WK,fix:e}),GK=Dn({docsBase:`https://vitehub.dev/docs/workspace/diagnostics`,codes:{WORKSPACE_CONFLICT:{...WK,fix:({conditionalRemovalUnsupported:e})=>e?"Use a Store that supports conditional removal to keep the `ifDigest` check. Remove a file without `ifDigest` only if you intend to delete it even if it changed since you read it.":"Another write changed the file or ref after you read it. Read it again, apply your change to the new content, and retry with its new digest in `ifDigest` or its new head in `ifHead`. For a merge conflict or a publish that is in progress, do the step that the message names first."},WORKSPACE_FORBIDDEN:{why:`An Agent may not write past an edit lease that a person holds.`,fix:`Tell the person you work for who is editing the files, and try again after they finish. A developer allows overrides with operations({ overrideLeases: true }).`},WORKSPACE_HISTORY_FAILED:{why:({workspace:e})=>`The history operation of Workspace "${e}" failed.`,fix:"Read `error.cause` for the Store error. Check that the Store of the Workspace is reachable, then retry."},WORKSPACE_HISTORY_INVALID:{why:({problem:e})=>e===`empty-commit`?"The commit has no changes. Pass `put` or `delete`.":`The cursor belongs to one ref. Pass the same ref.`,fix:"Pass `put` or `delete` to `workspace.commit`, and pass a `cursor` only with the `ref` of the `workspace.history` call that returned it."},WORKSPACE_NOT_FOUND:{why:({id:e,path:t,problem:n,workspace:r})=>({path:`Revision ${e} has no path "${t}".`,revision:`The Workspace has no revision "${e}". Pull again without a base revision.`,target:`Workspace "${r}" has no ref or revision "${e}". Run \`vitehub workspace refs ${r}\` to list refs.`,workspace:`Unknown Workspace: ${r}.`})[n],fix:"Check the Workspace name, the ref or revision, and the path. `vitehub workspace refs <workspace>` lists the refs, and `vitehub workspace get <workspace> <ref>` lists the files. When a base revision is gone, pull again without it."},WORKSPACE_PATH_INVALID:{why:({path:e,problem:t})=>t===`reserved`?`The Workspace path ${e} uses a reserved name. ViteHub keeps \`.git\` at any depth for Git and \`.vitehub\` at the root for its own data. It also reserves their NTFS short names \`git~N\` and \`vitehu~N\`.`:`The Workspace path ${e} is not a relative path inside the Workspace root. It is empty or absolute, starts with a drive letter, has a NUL byte, or has a \`.\` or \`..\` part.`,fix:({problem:e})=>e===`reserved`?"Rename the file or folder, for example `.git/config` to `git/config`. No part of a Workspace path can be `.git` or `git~1`, and the first part cannot be `.vitehub` or `vitehu~1`.":"Pass a relative path inside the Workspace, for example `docs/guide.md`. Remove a leading `/` or drive letter, NUL bytes, and `.` or `..` parts. `error.details.path` has the path that the Workspace rejected."},WORKSPACE_SOURCE_READ_ONLY:{why:({path:e,source:t})=>t===void 0?`The Workspace path "${e}" belongs to a Source. Source paths are read-only: a write, removal, or move cannot change them.`:`The Workspace path "${e}" belongs to Source "${t}". Source paths are read-only: a write, removal, or move cannot change them.`,fix:"Write the file outside the Source mount, for example under `drafts/`. To change a Source file, change it where the Source reads it, such as its GitHub repository, its URL, or its local files. For a Source with `sync: true`, run `workspace.sync({ sources: ['handbook'] })` with its Source key in place of `handbook`."},WORKSPACE_CHECKOUT_CONFLICT:{why:({conflicted:e,workspace:t})=>`Workspace "${t}" has unresolved conflicts: ${e}.`,fix:"Edit each file and remove the conflict markers, or run `vitehub resolve` for a binary file. Then push again."},WORKSPACE_CHECKOUT_DIR:{why:({dir:e,workspace:t})=>e===void 0?`Workspace "${t}" is not checked out yet.`:`The checkout folder "${e}" must be a folder inside the project, not the project root.`,fix:"Pass `--dir` with a folder inside the project, such as `vitehub pull <workspace> --dir content`."},WORKSPACE_CHECKOUT_FAILED:{why:({message:e})=>e,fix:"Read the message. Run `vitehub status` to see the state of the checkout, then run the command again."},WORKSPACE_CHECKOUT_MISSING:{why:({workspace:e})=>e===void 0?`vitehub.lock has no checked-out Workspace.`:`Workspace "${e}" is not checked out.`,fix:"Run `vitehub pull <workspace> --dir <folder>` first."},WORKSPACE_CHECKOUT_OPTIONS:{why:({actual:e,expected:t,key:n,workspace:r})=>r===void 0?`This checkout uses ${t}, not "${e}".`:`Workspace "${r}" is checked out with ${n} "${t}", not "${e}".`,fix:"Edit `vitehub.lock` to change the `dir` or `ref` of the entry. To change the remote, remove the entry from `vitehub.lock` and pull into a new folder."},WORKSPACE_CHECKOUT_OVERLAP:{why:({dir:e,other:t,otherDir:n,workspace:r})=>`Workspace "${r}" folder "${e}" overlaps Workspace "${t}" folder "${n}".`,fix:`Use separate checkout folders that do not contain one another.`},WORKSPACE_CHECKOUT_PATH:{why:({other:e,path:t,problem:n})=>({excluded:`The path "${t}" is excluded from the checkout.`,"not-portable":`The path "${t}" has a component that is not portable between file systems.`,"not-relative":`The remote path "${t}" is not a relative Workspace path.`,reserved:`The top-level file name "${t}" is reserved by the operation input map.`,spelling:`The checkout paths "${e}" and "${t}" use different spellings for one file-system path, or replace a file with a directory.`})[n],fix:"Rename the path to a portable name that the checkout does not exclude, before you pull or push it. For two spellings of one path, rename one. For a file that a folder replaces, keep local edits elsewhere, remove the `vitehub.lock` entry, and pull into a new empty folder."},WORKSPACE_CHECKOUT_SYMLINK:{why:({path:e})=>e===`vitehub.lock`?`vitehub.lock is a symbolic link. A checkout reads and writes only a real lock file.`:`${e} is a symbolic link. A checkout reads and writes only real files and folders.`,fix:`Replace the symbolic link with a real folder or file, then try again.`},WORKSPACE_CHECKOUT_TOO_LARGE:{why:({largest:e,limit:t,size:n,workspace:r})=>`The push of Workspace "${r}" is ${n}, over the ${t} limit of one push.${e?` Largest files: ${e}.`:``}`,fix:`A push is one revision and sends each changed file whole, with binary files in base64. Keep large media in Blob, or add new files in smaller groups with a push after each group.`},WORKSPACE_CHECKOUT_USAGE:{why:({command:e,flag:t,problem:n})=>({flag:`Unknown flag --${t}.`,names:`${e} accepts at most one Workspace name.`,value:`--${t} needs a value.`})[n],fix:"Pass only the flags of the command, each with its value, and at most one Workspace name, for example `vitehub pull docs --dir content`."},WORKSPACE_LOCK_BUSY:{why:`Another vitehub command is writing vitehub.lock: vitehub.lock.lock exists.`,fix:"Wait for that command to finish and try again. If no vitehub command runs, delete `vitehub.lock.lock`."},WORKSPACE_LOCK_INVALID:{why:({problem:e})=>e===`json`?`vitehub.lock is not valid JSON.`:"vitehub.lock has no `version: 1` and `workspaces` object.",fix:"Fix the conflict in `vitehub.lock`, or delete the entry and pull again."},WORKSPACE_RENAMED_STORE_PROVIDER_KEY:{why:({provider:e})=>`The Workspace \`store\` sets \`provider: ${e}\`. ViteHub renamed this key to \`driver\`, and it does not read \`provider\`, so the Store would not be the one you chose.`,fix:({driver:e})=>`Set \`store: { driver: ${e} }\`.`},WORKSPACE_RENAMED_STORE_REPOSITORY_KEY:{why:()=>"The GitHub Workspace `store` sets `repository`. ViteHub renamed this key to `repo`, and it does not read `repository`, so the Store would use `VITEHUB_WORKSPACE_GITHUB_REPOSITORY` or no repository.",fix:()=>'Rename `repository` to `repo` in `store: { driver: "github" }`.'},WORKSPACE_UNKNOWN_STORE_DRIVER:{why:({driver:e,renamed:t})=>t?`The Workspace \`store.driver\` is ${e}. ViteHub renamed this driver to "${t}", and it does not read ${e}.`:`The Workspace \`store.driver\` ${e} is not a Workspace Store driver.`,fix:({renamed:e})=>e?`Set \`store: { driver: "${e}" }\`.`:'Set `store.driver` to "local", "memory", "github", "cloudflare", or "vercel", or pass a Store object.'},WORKSPACE_DEFAULT_REF_DELETE:{why:"`history.deleteRef()` cannot delete `main` or the ref that the Workspace working tree follows.",fix:"Delete another ref, such as the ref of one run. To remove files from the working ref, commit without them. To remove the whole Workspace history, call `delete()` on the Blob + Database Store."},WORKSPACE_POSTGRES_HISTORY_SCHEMA_MISSING:{why:`The Postgres Database for this Workspace is missing its history catalog table.`,fix:"Apply the migrations for `workspaceHistorySchema` from `vite-hub/workspace/blob-database/postgres`. For a ViteHub Database, add the schema to its Definition and run `vitehub database generate` and `vitehub database migrate`. With PGlite, stop the dev server before running `vitehub database migrate` and start it again afterward, because only one process can open the local PGlite folder at a time."},WORKSPACE_REGISTRY_LOAD_FAILED:{why:({reason:e,workspace:t})=>`The module of Workspace "${t}" did not load: ${e}`,fix:"Read `error.cause` for the first error. Make sure that the module of the Workspace loads without errors and exports its Definition: the default export of a file in `server/workspaces/`, or the export that the Vite plugin names in its Workspace contribution. Then restart the dev server or build again."},WORKSPACE_STORE_IN_WORKER_MEMORY:{why:`At least one Workspace in this Cloudflare build uses the default Memory Store. It keeps the files that the app writes in the memory of the Worker isolate. The files are lost when the isolate stops, and other isolates do not see them. Sources still read from the bundle.`,fix:'Set `workspace: { store: { driver: "cloudflare" } }` in `vitehub()` to keep the files in Cloudflare Artifacts, or use `{ driver: "github" }`. To keep the memory Store on purpose, set `store: { driver: "memory" }`, and the build does not print this notice.'},WORKSPACE_SOURCE_ACCESS_FAILED:{why:({source:e,workspace:t})=>`Source "${e}" of Workspace "${t}" cannot reach its data with the credentials of the build. The deployed app would fail on its first read.`,fix:"Read `error.cause` for the response of the provider. For a GitHub Source, check that `repo` and `ref` exist and that the token of the build (`auth`, `VITEHUB_GITHUB_TOKEN`, or `gh auth token`) can read the repository. Then build again."},WORKSPACE_R0069:$("Use a Store with retained history: `createBlobDatabaseWorkspaceStore()` or the `github` Store. Open the Workspace with a scope that grants the complete Workspace, not selected paths."),WORKSPACE_R0070:$("Pass a `limit` from 1 to 100, and pass a `cursor` only with the `ref` of the `history.list()` call that returned it."),WORKSPACE_R0071:$("Use a ref name with up to 128 letters, numbers, `_`, and `-`, joined by single `.` or `/`, for example `draft` or `team/review`. In a GitHub Store with `refs`, use `published` or `draft`, not the branch name."),WORKSPACE_R0072:$("Set the `repo` option of the GitHub Store or `VITEHUB_WORKSPACE_GITHUB_REPOSITORY`, for example `owner/repo`. Set the `token` option or `VITEHUB_GITHUB_TOKEN`."),WORKSPACE_R0073:$("Make the commit message or metadata shorter, as the message says. Remove each `Vitehub-Metadata:` line from the message, and pass the values in the `metadata` option."),WORKSPACE_R0001:$("Pass the path of a file or folder in the Workspace, for example `docs/guide.md`. The Workspace root itself cannot be written, moved, or deleted."),WORKSPACE_R0002:$("Enable at least one operation in `createWorkspaceTools(workspace, { operations })`, for example `{ operations: { read: true } }`."),WORKSPACE_R0003:$('Get write tools from `useWorkspace(name, { mode: "write" }).tools.write()`. Do not pass the result of `useWorkspace()` to `createWorkspaceTools()`. Or remove `write` from `operations`.'),WORKSPACE_B0001:$("Export the Workspace Definition from the file, for example `export default defineWorkspace({ ... })`. For a contributed Workspace, set `definition.export` to the name of the export."),WORKSPACE_B0002:$("Use `defineWorkspace()` in `server/workspaces/<name>.ts`. Move the `defineAgent()` call to `server/agents/<name>/agent.ts`."),WORKSPACE_B0003:$(`Rename or remove one of the definitions that the message lists. Each Workspace name has one definition.`),WORKSPACE_B0004:$("Set `vitehub.workspaces` in the plugin to an array of `{ name, definition: { module, export? }, reason? }` entries, or to a function that returns one. Set `module` to an absolute path, a `file:` URL, or a package specifier."),WORKSPACE_B0005:$('Set the Cloudflare Artifacts Store in the `workspace` config, for example `vitehub({ workspace: { store: { driver: "cloudflare", binding: "WORKSPACE_ARTIFACTS", namespace: "vitehub" } } })`, and remove `store` from the Workspace Definition. Or remove the import that the build cannot load from the Definition file, so that the build can read its `store`.'),WORKSPACE_R0004:$("Put a value after the option, for example `--timeout 30000` or `--url http://localhost:5173`."),WORKSPACE_R0005:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0006:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0007:$("Remove the option. `vitehub workspace dev --help` lists the options."),WORKSPACE_R0008:$("Put a command after `exec`, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0009:$("Put `exec` before the command, for example `vitehub workspace dev docs exec ls -la`. Or omit the command to open the interactive command loop."),WORKSPACE_C0001:$('Set `workspace` to an object, for example `workspace: { store: { driver: "memory" } }`, or to `false`.'),WORKSPACE_C0002:$("Remove the option. The `workspace` config accepts `assets`, `projectRoot`, `root`, and `store`."),WORKSPACE_R0015:$("Remove the option. `defineWorkspace()` accepts `bindings`, `commit`, `hooks`, `loaders`, `plugins`, `rootDir`, `rules`, `sourceRootDir`, `sources`, and `store`."),WORKSPACE_R0016:$("Pass an object to `defineWorkspace()`, for example `defineWorkspace({ sources: {} })`."),WORKSPACE_R0017:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0018:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0019:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0020:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0021:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0022:$('Pass the Workspace name as a non-empty string, for example `registerWorkspace("docs", definition)` or `registerWorkspacePlugin("docs", plugin)`.'),WORKSPACE_R0023:$('Set `maxBytes` to a number of bytes or to a string such as `"512kb"` or `"10mb"`.'),WORKSPACE_R0024:$('Give each Workspace plugin a non-empty string `id`, for example `{ id: "my-plugin", rules }`.'),WORKSPACE_R0025:$("Declare the target as a `url()` Source in the Workspace Definition, and make the Source visible in the Workspace scope."),WORKSPACE_R0026:$("Use a Store that supports rebase: `github` or `cloudflare`. Or do not call `rebase()` on this Workspace."),WORKSPACE_R0027:$("Set another `binding` in the Workspace `store` options, or set `namespace` to the namespace that Wrangler config already has for that binding."),WORKSPACE_R0028:$(`The client closed the Workspace Dev connection before the command finished. Run the command again and keep the connection open.`),WORKSPACE_R0029:$("Give each Cloudflare Artifacts namespace its own `binding` in the Workspace `store` options."),WORKSPACE_R0033:$(`Run the operation again. If it fails again, check the Blob store of the project in the Vercel dashboard.`),WORKSPACE_R0034:$('Pass the Workspace name, for example `createWorkspacePreparation({ workspace: "docs" })`.'),WORKSPACE_R0035:$('Pass Source keys of the Workspace as non-empty strings, for example `sources: ["handbook"]`, or omit `sources`.'),WORKSPACE_R0036:$("Set `retryDelayMs` to a number of milliseconds from 0 to 2147483647, or omit it to use 10000."),WORKSPACE_R0037:$('Set `materialize: "startup"` on the Sources to prepare, or pass their keys in `sources`.'),WORKSPACE_R0038:$("Check each Source that the message names: its URL, repository, or files, and its credentials. Without `requireNonEmpty`, an empty Source is ready."),WORKSPACE_R0039:$("`stop()` cancelled this preparation. Call `start()` again to prepare the Workspace."),WORKSPACE_R0040:$("Pass a non-empty command, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0041:$('Pass a Workspace name, or a Workspace from `useWorkspace(name, { mode: "write" })`, that can start a Workspace Session.'),WORKSPACE_R0042:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0043:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0044:$("Make sure that the Workspace Session host can run `readlink` and can read the path in the message."),WORKSPACE_R0045:$("Set `executionAuthority` on the Workspace Session host. Use `unknownExecutionAuthority` from `@vite-hub/runtime` when the host cannot describe it."),WORKSPACE_C0003:$("Rename the Source key to one file name without `/` and without a `.json` ending, for example `issues`. ViteHub keeps the request descriptor at `.vitehub/sources/<key>.json`."),WORKSPACE_C0004:$('Set `mount` on the Source to a folder, for example `mount: "docs"`, or set `probeKeys`. A Workspace Scope grant needs paths, and a Source at the root has none.'),WORKSPACE_C0005:$('Use a Source helper so that the Source kind is explicit, for example `github({ repo: "owner/name" })`, `url({ url, workspacePath: "issues.json" })`, or `file({ path: "README.md" })`. A `{ source: { ... } }` wrapper does not help, because ViteHub reads the options in it the same way.'),WORKSPACE_C0006:$('Pass `path` or `workspacePath` to `file()`, for example `file({ path: "README.md" })`.'),WORKSPACE_C0007:$('When the URL has a query, set `path` on the Source config, for example `{ url, path: "issues.json" }`. Or use the `url()` helper with `workspacePath: "issues.json"`.'),WORKSPACE_R0046:$("Set `workspacePath` on the `url()` Source to read the response as a file. A request-only Source answers only `curl` Source requests."),WORKSPACE_R0047:$("Read the `url()` Source at its `workspacePath`. The Source has no other file."),WORKSPACE_R0048:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0049:$('Set `responseType` to `"json"` or `"text"`.'),WORKSPACE_R0050:$('Set `method` to `"GET"`, `"HEAD"`, or `"POST"`.'),WORKSPACE_R0051:$("Use `query` for a fixed query or `querySchema` for a query that the Agent sets. Remove the other one, and remove the query from `url` when you use `querySchema`."),WORKSPACE_R0052:$("Use `body` for a fixed body or `bodySchema` for a body that the Agent sets. Remove the other one."),WORKSPACE_R0053:$('Set `method: "POST"` to send a body, or remove `body` and `bodySchema`.'),WORKSPACE_R0054:$("Pass a schema that has `~standard.jsonSchema.input()`, the Standard JSON Schema interface. Or use a fixed `query` or `body`."),WORKSPACE_R0055:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0056:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0057:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0058:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0059:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0060:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0061:$('Return `repo` from the `github()` resolver, for example `{ repo: "owner/name" }`, or start the Agent Invocation with a `pullRequest` context value.'),WORKSPACE_R0063:$("Use the URL of exactly one Source that the Workspace scope can see. Read `.vitehub/sources/<source>.json` in the Workspace and send the URL, method, query, and body that it declares."),WORKSPACE_R0064:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0065:$("The Cloudflare Artifacts Store keeps its Git checkout in memory. A Git step used the path in the message in a way that the error code rejects, for example `ENOENT` for a missing file. Run the operation again. If it fails again, report it at https://github.com/vite-hub/vitehub/issues with the message."),WORKSPACE_R0066:$("Connect a Blob store to the Vercel project so that it gets `BLOB_STORE_ID`. Off Vercel, set `BLOB_READ_WRITE_TOKEN`."),WORKSPACE_R0074:$(`The Workspace Store keeps no file revisions, so ViteHub cannot prove that the file at the path in the message is the one it started to remove. Check the file. If it must go, delete it in the Store itself, for example in its directory or bucket, because the Workspace rejects writes under a Source. Then run the Source operation again.`),WORKSPACE_R0075:$("Remove `read` from the rule. Workspace rules limit writes only, so `read: false` would not hide the files. Keep files that a reader must not see out of the Workspace, for example in another Workspace or in an Env secret."),WORKSPACE_R0076:$("Remove the option from the rule. A Workspace rule accepts `commit`, `maxBytes`, `mediaType`, `validate`, and `write`."),WORKSPACE_R0077:$('Pass the name of the history Database, `database: "history"`, or its Drizzle database, `database: () => useDatabase("history").db` with `import { useDatabase } from "vite-hub/database"`. The Database can be SQLite, libSQL, D1, or Postgres. A Database Definition from `defineDatabase()` is not a Drizzle database.')}})}));function qK(e,t={},n=`[vitehub] ${e.why}`){let r=new GW(e.code,n,t);return Object.defineProperties(r,{docs:{configurable:!0,enumerable:!1,value:e.docs,writable:!1},fix:{configurable:!0,enumerable:!1,value:e.fix,writable:!1},why:{configurable:!0,enumerable:!1,value:e.why,writable:!1}})}function JK(e,t=`not-relative`){let n=e.slice(0,4096);return qK(GK.WORKSPACE_PATH_INVALID({path:JSON.stringify(n),problem:t}),{details:{path:n}})}function YK(e){let t=e.toLowerCase().split(`:`,1)[0];return{normalized:t.replace(/[ .]+$/,``),isTraversal:/^(?:\.(?: +[. ]*)?|\.\.(?: +[. ]*)?)$/.test(t)}}function XK(e=``,t={}){let n=e.replace(/\\/g,`/`),r=n.replace(/^\/+/,``).replace(/\/+$/,``),i=r.split(`/`).filter(Boolean);if(!t.allowEmpty&&!r||n.startsWith(`/`)||/^[a-z]:/i.test(n)||n.includes(`\0`))throw JK(e);let a=i.map((e,t)=>({classification:YK(e),index:t,name:e.toLowerCase()}));if(a.some(({classification:e})=>e.isTraversal))throw JK(e);if(a.some(({classification:e,index:n,name:r})=>{let i=e.normalized===`.git`||/^git~\d+$/.test(e.normalized)||n===0&&e.normalized===`.vitehub`||n===0&&/^vitehu~\d+$/.test(e.normalized),a=(e.normalized===`.git`||n===0&&e.normalized===`.vitehub`)&&r===e.normalized;return i&&(!t.allowReserved||!a)}))throw JK(e,`reserved`);return r}var ZK=t((()=>{KK(),nG()}));function QK(e){try{let t=JSON.parse(MK(e));if(!t||typeof t!=`object`||!(`epoch`in t)||!(`type`in t)||typeof t.epoch!=`string`||!t.epoch)return;if(t.type===`session`&&`access`in t&&(t.access===`read`||t.access===`write`))return t.access===`read`&&`reason`in t&&(t.reason===`access`||t.reason===`document`||t.reason===`version`)?{type:`session`,access:t.access,epoch:t.epoch,reason:t.reason}:{type:`session`,access:t.access,epoch:t.epoch};if(t.type===`reset`&&`reason`in t&&(t.reason===`source-changed`||t.reason===`stale`))return{type:`reset`,epoch:t.epoch,reason:t.reason}}catch{}}function $K(e){if(typeof e!=`string`||e.length===0||e.length>4096||e.includes(`\0`)||e.startsWith(`/`)||e.endsWith(`/`)||e.includes(`\\`)||e.includes(`//`)||/^[a-z]:/i.test(e))return!1;try{return XK(e)===e}catch{return!1}}function eq(e){try{let t=JSON.parse(MK(e));if((t.operation===`create`||t.operation===`delete`||t.operation===`update`)&&$K(t.path))return{operation:t.operation,path:t.path};if(t.operation===`move`&&$K(t.from)&&$K(t.to))return{operation:t.operation,from:t.from,to:t.to}}catch{}}function tq(e){let t=GG();return Z(t,4),nK(t,JSON.stringify(e)),qG(t)}function nq(e){let t=GG();return Z(t,6),nK(t,JSON.stringify(e)),qG(t)}function rq(e){try{let t=JSON.parse(MK(e));if(t&&typeof t==`object`&&`kind`in t&&t.kind===`notice`)return{kind:`notice`,body:`body`in t?t.body:void 0};if(!t||typeof t!=`object`||!(`id`in t)||typeof t.id!=`string`||!t.id||t.id.length>128||!(`kind`in t))return;if(t.kind===`request`)return{kind:`request`,id:t.id,body:`body`in t?t.body:void 0};if(t.kind!==`answer`||!(`ok`in t))return;if(t.ok===!0)return{kind:`answer`,id:t.id,ok:!0,body:`body`in t?t.body:void 0};if(t.ok===!1&&`why`in t&&typeof t.why==`string`)return{kind:`answer`,id:t.id,ok:!1,why:t.why}}catch{}}function iq(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var aq,oq,sq=t((()=>{UK(),vK(),ZK(),aq=`@workspace`,oq=`ping`})),cq,lq=t((()=>{cq=Date.now}));function uq(e,t=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__){return t===`/`?e:`${t.replace(/\/+$/,``)}${e}`}function dq(e){let t;e.on(`status`,({status:n})=>{clearInterval(t),t=void 0;let r=e.ws;if(n!==`connected`||!r)return;let i=r.onmessage;r.onmessage=function(t){if(t.data!==`pong`)return i?.call(this,t);e.ws===r&&(e.wsLastMessageReceived=cq())},t=setInterval(()=>{e.ws===r&&r.readyState===r.OPEN&&r.send(oq)},pq)})}function fq(e){let{awareness:t}=e;t.on(`update`,({removed:n},r)=>{if(r===e)for(let e of n)e!==t.clientID&&t.meta.delete(e)})}var pq,mq=t((()=>{sq(),lq(),pq=15e3}));function hq(e){return typeof e==`string`?e:null}function gq(e){let t=e.getMap(_q.status),n=t.get(`issues`),r=t.get(`savedBy`),i={issues:Array.isArray(n)?n:[],savedBy:r&&!Array.isArray(r)&&r instanceof Object?r:null};return{digest:hq(t.get(`digest`)),error:hq(t.get(`error`)),issues:i.issues,savedAt:hq(t.get(`savedAt`)),savedBy:i.savedBy}}var _q,vq=t((()=>{_q=Object.freeze({body:`body`,fields:`fields`,status:`status`})}));function yq(e){try{return String(e)===e}catch{return!1}}function bq(e){if(!yq(e.id)||!e.id||e.id.length>256)throw rG.REALTIME_INVALID_USER();let t=0;for(let n=0;n<e.id.length;n++)t=Math.imul(31,t)+e.id.charCodeAt(n)|0;let n=(yq(e.name)&&e.name||yq(e.email)&&e.email||`Anonymous`).slice(0,256),r={color:Cq[Math.abs(t)%Cq.length],id:e.id,name:n};return yq(e.image)&&e.image&&e.image.length<=2048&&(r.image=e.image),r}function xq(e){return iq(e)?yq(e.id)&&e.id.length>0&&e.id.length<=256&&yq(e.name)&&e.name.length>0&&e.name.length<=256&&yq(e.color)&&/^#[\da-f]{6}$/i.test(e.color)&&(e.image===void 0||yq(e.image)&&e.image.length<=2048):!1}function Sq(e){let t=[];for(let[n,r]of e)if(xq(r.user)){let{color:e,id:i,image:a,name:o}=r.user,s={color:e,id:i,name:o,clientId:n};a!==void 0&&(s.image=a),t.push(s)}return t}var Cq,wq=t((()=>{sq(),iG(),Cq=[`#E11D48`,`#D97706`,`#059669`,`#0891B2`,`#2563EB`,`#7C3AED`,`#C026D3`]})),Tq,Eq,Dq,Oq,kq,Aq=t((()=>{Tq=()=>new Map,Eq=e=>{let t=Tq();return e.forEach((e,n)=>{t.set(n,e)}),t},Dq=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},Oq=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},kq=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),jq,Mq,Nq=t((()=>{Aq(),vG(),EG(),jq=class{constructor(){this._observers=Tq()}on(e,t){return Dq(this._observers,e,_G).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return xG((this._observers.get(e)||Tq()).values()).forEach(e=>e(...t))}destroy(){this._observers=Tq()}},Mq=class{constructor(){this._observers=Tq()}on(e,t){Dq(this._observers,e,_G).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return xG((this._observers.get(e)||Tq()).values()).forEach(e=>e(...t))}destroy(){this._observers=Tq()}}})),Pq,Fq,Iq=t((()=>{Pq=Symbol(`Equality`),Fq=(e,t)=>e===t||!!e?.[Pq]?.(t)||!1})),Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq=t((()=>{Iq(),Lq=e=>typeof e==`object`,Rq=Object.assign,zq=Object.keys,Bq=(e,t)=>{for(let n in e)t(e[n],n)},Vq=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},Hq=e=>zq(e).length,Uq=e=>{for(let t in e)return!1;return!0},Wq=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},Gq=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Kq=(e,t)=>e===t||Hq(e)===Hq(t)&&Wq(e,(e,n)=>(e!==void 0||Gq(t,n))&&Fq(t[n],e)),qq=Object.freeze,Jq=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&Jq(e[t])}return qq(e)}})),Xq,Zq,Qq,$q,eJ=t((()=>{Yq(),Iq(),Xq=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&Xq(e,t,n+1)}},Zq=e=>e,Qq=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Pq]!=null)return e[Pq](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!Qq(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(Hq(e)!==Hq(t))return!1;for(let n in e)if(!Gq(e,n)||!Qq(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Qq(e[n],t[n]))return!1;break;default:return!1}return!0},$q=(e,t)=>t.includes(e)})),tJ,nJ=t((()=>{crypto.subtle,tJ=crypto.getRandomValues.bind(crypto)})),rJ,iJ,aJ,oJ=t((()=>{nJ(),rJ=()=>tJ(new Uint32Array(1))[0],iJ=`10000000-1000-4000-8000-100000000000`,aJ=()=>iJ.replace(/[018]/g,e=>(e^rJ()&15>>e/4).toString(16))})),sJ,cJ=t((()=>{sJ=e=>new Promise(e),Promise.all.bind(Promise)})),lJ,uJ=t((()=>{lJ=e=>e===void 0?null:e})),dJ,fJ,pJ,mJ,hJ,gJ,_J=t((()=>{dJ=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},fJ=new dJ,pJ=!0;try{typeof window<`u`&&typeof localStorage<`u`&&localStorage&&(fJ=localStorage,pJ=!1)}catch{}mJ=fJ,hJ=e=>pJ||addEventListener(`storage`,e),gJ=e=>pJ||removeEventListener(`storage`,e)})),vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ=t((()=>{Aq(),zG(),uJ(),_J(),eJ(),vJ=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,yJ=typeof window<`u`&&typeof document<`u`&&!vJ,typeof navigator<`u`&&/Mac/.test(navigator.platform),xJ=[],SJ=()=>{if(bJ===void 0){if(vJ){bJ=Tq();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&bJ.set(t,``),t=r):t===null?xJ.push(r):(bJ.set(t,r),t=null)}t!==null&&bJ.set(t,``)}else typeof location==`object`?(bJ=Tq(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);bJ.set(`--${MG(t,`-`)}`,n),bJ.set(`-${MG(t,`-`)}`,n)}})):bJ=Tq()}return bJ},CJ=e=>SJ().has(e),wJ=e=>lJ(vJ?{}[e.toUpperCase().replaceAll(`-`,`_`)]:mJ.getItem(e)),TJ=e=>CJ(`--`+e)||wJ(e)!==null,EJ=TJ(`production`),DJ=vJ&&$q({}.FORCE_COLOR,[`true`,`1`,`2`]),OJ=DJ||!CJ(`--no-colors`)&&!TJ(`no-color`)&&(!vJ||process.stdout.isTTY)&&(!vJ||CJ(`--color`)||wJ(`COLORTERM`)!==null||(wJ(`TERM`)||``).includes(`color`))})),AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ=t((()=>{zG(),kJ(),AJ=e=>new Uint8Array(e),jJ=e=>new Uint8Array(e),MJ=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=DG(e[n]);return btoa(t)},NJ=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),PJ=e=>{let t=atob(e),n=AJ(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},FJ=e=>new Uint8Array(Buffer.from(e,`base64`)),IJ=yJ?MJ:NJ,LJ=yJ?PJ:FJ,RJ=e=>{let t=AJ(e.byteLength);return t.set(e),t}})),BJ,VJ,HJ=t((()=>{BJ=class{constructor(e,t){this.left=e,this.right=t}},VJ=(e,t)=>new BJ(e,t)})),UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ=t((()=>{zG(),fG(),UJ=e=>e.next()>=.5,WJ=(e,t,n)=>oG(e.next()*(n+1-t)+t),GJ=(e,t,n)=>oG(e.next()*(n+1-t)+t),KJ=(e,t,n)=>GJ(e,t,n),qJ=e=>DG(KJ(e,97,122)),JJ=(e,t=0,n=20)=>{let r=KJ(e,t,n),i=``;for(let t=0;t<r;t++)i+=qJ(e);return i},YJ=(e,t)=>t[KJ(e,0,t.length-1)]})),ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX=t((()=>{Yq(),EG(),UG(),kJ(),Iq(),eJ(),zG(),XJ(),gG(),ZJ=Symbol(`0schema`),QJ=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(RG(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
|
|
363
|
+
`)}},$J=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Pq]?Fq(e,t):TG(e)?SG(e,e=>CG(t,t=>$J(e,t))):Lq(e)?Wq(e,(e,n)=>$J(e,t[n])):!1,eY=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),$J(t,n)}equals(e){return this.constructor===e.constructor&&Qq(this.shape,e.shape)}[ZJ](){return!0}[Pq](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){VG()}get nullable(){return IY(this,ZY)}get optional(){return new fY(this)}cast(e){return tX(e,this),e}expect(e){return tX(e,this),e}},tY=class extends eY{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},nY=(e,t=null)=>new tY(e,t),nY(tY),rY=class extends eY{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},iY=e=>new rY(e),nY(rY),aY=class extends eY{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},oY=(...e)=>new aY(e),sY=nY(aY),cY=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),lY=e=>{if(KY.check(e))return[cY(e)];if(sY.check(e))return e.shape.map(e=>e+``);if(GY.check(e))return[`[+-]?\\d+.?\\d*`];if(qY.check(e))return[`.*`];if(LY.check(e))return e.shape.map(lY).flat(1);HG()},uY=class extends eY{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(lY).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},nY(uY),dY=Symbol(`optional`),fY=class extends eY{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[dY](){return!0}},pY=nY(fY),mY=class extends eY{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new mY,nY(mY),hY=class e extends eY{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):Wq(this.shape,(n,r)=>{let i=this._isPartial&&!Gq(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},gY=e=>new hY(e),_Y=nY(hY),vY=iY(e=>e!=null&&(e.constructor===Object||e.constructor==null)),yY=class extends eY{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&Wq(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},bY=(e,t)=>new yY(e,t),xY=nY(yY),SY=class extends eY{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&Wq(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},CY=(...e)=>new SY(e),nY(SY),wY=class extends eY{constructor(e){super(),this.shape=e.length===1?e[0]:new FY(e)}check(e,t){let n=TG(e)&&SG(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},TY=(...e)=>new wY(e),EY=nY(wY),DY=iY(e=>TG(e)),OY=class extends eY{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},kY=(e,t=null)=>new OY(e,t),nY(OY),AY=kY(eY),jY=class extends eY{constructor(e){super(),this.len=e.length-1,this.args=CY(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},MY=nY(jY),NY=iY(e=>typeof e==`function`),PY=class extends eY{constructor(e){super(),this.shape=e}check(e,t){let n=SG(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},nY(PY,e=>e.shape.length>0),FY=class extends eY{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=CG(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},IY=(...e)=>e.findIndex(e=>LY.check(e))>=0?IY(...e.map(e=>eX(e)).map(e=>LY.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new FY(e),LY=nY(FY),RY=()=>!0,zY=iY(RY),BY=nY(rY,e=>e.shape===RY),VY=iY(e=>typeof e==`bigint`),HY=iY(e=>e===VY),UY=iY(e=>typeof e==`symbol`),iY(e=>e===UY),WY=iY(e=>typeof e==`number`),GY=iY(e=>e===WY),KY=iY(e=>typeof e==`string`),qY=iY(e=>e===KY),JY=iY(e=>typeof e==`boolean`),YY=iY(e=>e===JY),XY=oY(void 0),nY(aY,e=>e.shape.length===1&&e.shape[0]===void 0),oY(void 0),ZY=oY(null),QY=nY(aY,e=>e.shape.length===1&&e.shape[0]===null),nY(Uint8Array),nY(tY,e=>e.shape===Uint8Array),$Y=IY(WY,KY,ZY,XY,VY,JY,UY),(()=>{let e=TY(zY),t=bY(KY,zY),n=IY(WY,KY,ZY,JY,e,t);return e.shape=n,t.shape.values=n,n})(),eX=e=>{if(AY.check(e))return e;if(vY.check(e)){let t={};for(let n in e)t[n]=eX(e[n]);return gY(t)}if(DY.check(e))return IY(...e.map(eX));if($Y.check(e))return oY(e);if(NY.check(e))return nY(e);HG()},tX=EJ?()=>{}:(e,t)=>{let n=new QJ;if(!t.check(e,n))throw BG(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},nX=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:eX(e),h:t}),this}else(e){return this.if(zY,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw BG(`Unhandled pattern`)}}},rX=e=>new nX(e),iX=rX(zY).if(GY,(e,t)=>WJ(t,mG,pG)).if(qY,(e,t)=>JJ(t)).if(YY,(e,t)=>UJ(t)).if(HY,(e,t)=>BigInt(WJ(t,mG,pG))).if(LY,(e,t)=>aX(t,YJ(t,e.shape))).if(_Y,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(pY.check(i)){if(UJ(t))continue;i=i.shape}n[r]=iX(i,t)}return n}).if(EY,(e,t)=>{let n=[],r=GJ(t,0,42);for(let i=0;i<r;i++)n.push(aX(t,e.shape));return n}).if(sY,(e,t)=>YJ(t,e.shape)).if(QY,(e,t)=>null).if(MY,(e,t)=>{let n=aX(t,e.res);return()=>n}).if(BY,(e,t)=>aX(t,YJ(t,[WY,KY,ZY,XY,VY,JY,TY(WY),bY(IY(`a`,`b`,`c`),WY)]))).if(xY,(e,t)=>{let n={},r=WJ(t,0,3);for(let i=0;i<r;i++){let r=aX(t,e.shape.keys);n[r]=aX(t,e.shape.values)}return n}).done(),aX=(e,t)=>iX(eX(t),e)})),sX,cX,lX,uX,dX,fX,pX=t((()=>{Aq(),oX(),sX=typeof document<`u`?document:{},iY(e=>e.nodeType===fX),typeof DOMParser<`u`&&new DOMParser,iY(e=>e.nodeType===lX),iY(e=>e.nodeType===uX),cX=e=>Oq(e,(e,t)=>`${t}:${e};`).join(``),lX=sX.ELEMENT_NODE,uX=sX.TEXT_NODE,sX.CDATA_SECTION_NODE,sX.COMMENT_NODE,dX=sX.DOCUMENT_NODE,sX.DOCUMENT_TYPE_NODE,fX=sX.DOCUMENT_FRAGMENT_NODE,iY(e=>e.nodeType===dX)})),mX,hX=t((()=>{mX=Symbol})),gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX=t((()=>{hX(),lq(),gX=mX(),_X=mX(),vX=mX(),yX=mX(),bX=mX(),xX=mX(),SX=mX(),CX=mX(),wX=mX(),TX=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},cq()})),DX,OX,kX,AX,jX,MX,NX=t((()=>{kJ(),vG(),HJ(),pX(),Aq(),EX(),DX={[gX]:VJ(`font-weight`,`bold`),[_X]:VJ(`font-weight`,`normal`),[vX]:VJ(`color`,`blue`),[bX]:VJ(`color`,`green`),[yX]:VJ(`color`,`grey`),[xX]:VJ(`color`,`red`),[SX]:VJ(`color`,`purple`),[CX]:VJ(`color`,`orange`),[wX]:VJ(`color`,`black`)},OX=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=Tq(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=DX[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=cX(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},kX=OJ?OX:TX,AX=(...e)=>{console.log(...kX(e)),MX.forEach(t=>t.print(e))},jX=(...e)=>{console.warn(...kX(e)),e.unshift(CX),MX.forEach(t=>t.print(e))},MX=_G()})),PX,FX,IX,LX=t((()=>{PX=e=>({[Symbol.iterator](){return this},next:e}),FX=(e,t)=>PX(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),IX=(e,t)=>PX(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*RX(e){let t=Q(e.restDecoder);for(let n=0;n<t;n++){let t=Q(e.restDecoder),n=e.readClient(),r=Q(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Q(e.restDecoder);yield new l1(MZ(n,r),t),r+=t}else if(31&t){let i=!(t&192),a=new a1(MZ(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,o1(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new k$(MZ(n,r),t),r+=t}}}}var zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1=t((()=>{Nq(),EG(),fG(),Aq(),vK(),UK(),oJ(),cJ(),zJ(),UG(),aG(),eJ(),vG(),NX(),LX(),Yq(),kJ(),zX=class{constructor(e,t){this.clock=e,this.len=t}},BX=class{constructor(){this.clients=new Map}},VX=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])YZ(e,i,o.clock,o.len,n)}}),HX=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=oG((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},UX=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&HX(n,t.clock)!==null},WX=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new zX(r.clock,lG(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},GX=e=>{let t=new BX;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)bG(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return WX(t),t},KX=(e,t,n,r)=>{Dq(e.clients,t,()=>[]).push(new zX(n,r))},qX=()=>new BX,JX=e=>{let t=qX();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new zX(i,a))}}r.length>0&&t.clients.set(n,r)}),t},YX=(e,t)=>{Z(e.restEncoder,t.clients.size),xG(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Z(e.restEncoder,t);let r=n.length;Z(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},XX=e=>{let t=new BX,n=Q(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Q(e.restDecoder),r=Q(e.restDecoder);if(r>0){let i=Dq(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new zX(e.readDsClock(),e.readDsLen()))}}return t},ZX=(e,t,n)=>{let r=new BX,i=Q(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Q(e.restDecoder),a=Q(e.restDecoder),o=n.clients.get(i)||[],s=BZ(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&KX(r,i,s,a-s);let e=HZ(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,i1(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,i1(t,c,a-c.id.clock)),c.delete(t))}else KX(r,i,n,a-n)}}if(r.clients.size>0){let e=new sZ;return Z(e.restEncoder,0),YX(e,r),e.toUint8Array()}return null},QX=rJ,$X=class e extends jq{constructor({guid:e=aJ(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=QX(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new RZ,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=sJ(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>sJ(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&rQ(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(xG(this.subdocs).map(e=>e.guid))}transact(e,t=null){return rQ(this,e,t)}get(e,t=OQ){let n=Dq(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==OQ&&r!==t){if(r===OQ){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=``){return this.get(e,JQ)}getText(e=``){return this.get(e,h$)}getMap(e=``){return this.get(e,ZQ)}getXmlElement(e=``){return this.get(e,b$)}getXmlFragment(e=``){return this.get(e,v$)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,xG(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,rQ(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},eZ=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Q(this.restDecoder)}readDsLen(){return Q(this.restDecoder)}},tZ=class extends eZ{readLeftID(){return MZ(Q(this.restDecoder),Q(this.restDecoder))}readRightID(){return MZ(Q(this.restDecoder),Q(this.restDecoder))}readClient(){return Q(this.restDecoder)}readInfo(){return OK(this.restDecoder)}readString(){return MK(this.restDecoder)}readParentInfo(){return Q(this.restDecoder)===1}readTypeRef(){return Q(this.restDecoder)}readLen(){return Q(this.restDecoder)}readAny(){return RK(this.restDecoder)}readBuf(){return RJ(DK(this.restDecoder))}readJSON(){return JSON.parse(MK(this.restDecoder))}readKey(){return MK(this.restDecoder)}},nZ=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Q(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Q(this.restDecoder)+1;return this.dsCurrVal+=e,e}},rZ=class extends nZ{constructor(e){super(e),this.keys=[],Q(e),this.keyClockDecoder=new VK(DK(e)),this.clientDecoder=new BK(DK(e)),this.leftClockDecoder=new VK(DK(e)),this.rightClockDecoder=new VK(DK(e)),this.infoDecoder=new zK(DK(e),OK),this.stringDecoder=new HK(DK(e)),this.parentInfoDecoder=new zK(DK(e),OK),this.typeRefDecoder=new BK(DK(e)),this.lenDecoder=new BK(DK(e))}readLeftID(){return new AZ(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new AZ(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return RK(this.restDecoder)}readBuf(){return DK(this.restDecoder)}readJSON(){return RK(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},iZ=class{constructor(){this.restEncoder=GG()}toUint8Array(){return qG(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Z(this.restEncoder,e)}writeDsLen(e){Z(this.restEncoder,e)}},aZ=class extends iZ{writeLeftID(e){Z(this.restEncoder,e.client),Z(this.restEncoder,e.clock)}writeRightID(e){Z(this.restEncoder,e.client),Z(this.restEncoder,e.clock)}writeClient(e){Z(this.restEncoder,e)}writeInfo(e){XG(this.restEncoder,e)}writeString(e){nK(this.restEncoder,e)}writeParentInfo(e){Z(this.restEncoder,+!!e)}writeTypeRef(e){Z(this.restEncoder,e)}writeLen(e){Z(this.restEncoder,e)}writeAny(e){dK(this.restEncoder,e)}writeBuf(e){iK(this.restEncoder,e)}writeJSON(e){nK(this.restEncoder,JSON.stringify(e))}writeKey(e){nK(this.restEncoder,e)}},oZ=class{constructor(){this.restEncoder=GG(),this.dsCurrVal=0}toUint8Array(){return qG(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,Z(this.restEncoder,t)}writeDsLen(e){e===0&&HG(),Z(this.restEncoder,e-1),this.dsCurrVal+=e}},sZ=class extends oZ{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new gK,this.clientEncoder=new mK,this.leftClockEncoder=new gK,this.rightClockEncoder=new gK,this.infoEncoder=new fK(XG),this.stringEncoder=new _K,this.parentInfoEncoder=new fK(XG),this.typeRefEncoder=new mK,this.lenEncoder=new mK}toUint8Array(){let e=GG();return Z(e,0),iK(e,this.keyClockEncoder.toUint8Array()),iK(e,this.clientEncoder.toUint8Array()),iK(e,this.leftClockEncoder.toUint8Array()),iK(e,this.rightClockEncoder.toUint8Array()),iK(e,qG(this.infoEncoder)),iK(e,this.stringEncoder.toUint8Array()),iK(e,qG(this.parentInfoEncoder)),iK(e,this.typeRefEncoder.toUint8Array()),iK(e,this.lenEncoder.toUint8Array()),rK(e,qG(this.restEncoder)),qG(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){dK(this.restEncoder,e)}writeBuf(e){iK(this.restEncoder,e)}writeJSON(e){dK(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},cZ=(e,t,n,r)=>{r=lG(r,t[0].id.clock);let i=HZ(t,r);Z(e.restEncoder,t.length-i),e.writeClient(n),Z(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},lZ=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{BZ(t,n)>e&&r.set(n,e)}),zZ(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),Z(e.restEncoder,r.size),xG(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{cZ(e,t.clients.get(n),n,r)})},uZ=(e,t)=>{let n=Tq(),r=Q(e.restDecoder);for(let i=0;i<r;i++){let r=Q(e.restDecoder),i=Array(r),a=e.readClient(),o=Q(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new k$(MZ(a,o),t),o+=t;break}case 10:{let t=Q(e.restDecoder);i[n]=new l1(MZ(a,o),t),o+=t;break}default:{let s=!(r&192),c=new a1(MZ(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,o1(e,r));i[n]=c,o+=c.length}}}}return n},dZ=(e,t,n)=>{let r=[],i=xG(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new RZ,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==l1){let i=Dq(d,u.id.client,()=>BZ(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,BZ(t,a)),f();else{u=e.refs[e.i++];continue}}else(i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new sZ;return lZ(e,s,new Map),Z(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},fZ=(e,t)=>lZ(e,t.doc.store,t.beforeState),pZ=(e,t,n,r=new rZ(e))=>rQ(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=uZ(r,n),o=dZ(e,i,a),s=i.pendingStructs;if(s){for(let[e,n]of s.missing)if(n<BZ(i,e)){t=!0;break}if(o){for(let[e,t]of o.missing){let n=s.missing.get(e);(n==null||n>t)&&s.missing.set(e,t)}s.update=cQ([s.update,o.update])}}else i.pendingStructs=o;let c=ZX(r,e,i);if(i.pendingDs){let t=new rZ(wK(i.pendingDs));Q(t.restDecoder);let n=ZX(t,e,i);i.pendingDs=c&&n?cQ([c,n]):c||n}else i.pendingDs=c;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,mZ(e.doc,t)}},n,!1),mZ=(e,t,n,r=rZ)=>{let i=wK(t);pZ(i,e,n,new r(i))},hZ=(e,t,n)=>mZ(e,t,n,tZ),gZ=(e,t,n=new Map)=>{lZ(e,t.store,n),YX(e,JX(t.store))},_Z=(e,t=new Uint8Array([0]),n=new sZ)=>{let r=bZ(t);gZ(n,e,r);let i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(lQ(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===aZ)return oQ(i.map((e,t)=>t===0?e:mQ(e)));if(n.constructor===sZ)return cQ(i)}return i[0]},vZ=(e,t)=>_Z(e,t,new aZ),yZ=e=>{let t=new Map,n=Q(e.restDecoder);for(let r=0;r<n;r++){let n=Q(e.restDecoder),r=Q(e.restDecoder);t.set(n,r)}return t},bZ=e=>yZ(new eZ(wK(e))),xZ=(e,t)=>(Z(e.restEncoder,t.size),xG(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Z(e.restEncoder,t),Z(e.restEncoder,n)}),e),SZ=(e,t)=>xZ(e,zZ(t.store)),CZ=(e,t=new oZ)=>(e instanceof Map?xZ(t,e):SZ(t,e),t.toUint8Array()),wZ=e=>CZ(e,new iZ),TZ=class{constructor(){this.l=[]}},EZ=()=>new TZ,DZ=(e,t)=>e.l.push(t),OZ=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},kZ=(e,t,n)=>Xq(e.l,[t,n]),AZ=class{constructor(e,t){this.client=e,this.clock=t}},jZ=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,MZ=(e,t)=>new AZ(e,t),NZ=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw HG()},PZ=class{constructor(e,t){this.ds=e,this.sv=t}},FZ=(e,t)=>new PZ(e,t),FZ(qX(),new Map),IZ=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!UX(t.ds,e.id),LZ=(e,t)=>{let n=Dq(e.meta,LZ,_G),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<BZ(r,n)&&KZ(e,MZ(n,t))}),VX(e,t.ds,e=>{}),n.add(t))},RZ=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},zZ=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},BZ=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},VZ=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw HG()}n.push(t)},HZ=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=oG(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=oG((n+r)/2)}throw HG()},UZ=(e,t)=>{let n=e.clients.get(t.client);return n[HZ(n,t.clock)]},WZ=UZ,GZ=(e,t,n)=>{let r=HZ(t,n),i=t[r];return i.id.clock<n&&i instanceof a1?(t.splice(r+1,0,i1(e,i,n-i.id.clock)),r+1):r},KZ=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[GZ(e,n,t.clock)]},qZ=(e,t,n)=>{let r=t.clients.get(n.client),i=HZ(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==k$&&r.splice(i+1,0,i1(e,a,n.clock-a.id.clock+1)),a},JZ=(e,t,n)=>{let r=e.clients.get(t.id.client);r[HZ(r,t.id.clock)]=n},YZ=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=GZ(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&GZ(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},XZ=class{constructor(e,t,n){this.doc=e,this.deleteSet=new BX,this.beforeState=zZ(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},ZZ=(e,t)=>t.deleteSet.clients.size===0&&!kq(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(WX(t.deleteSet),fZ(e,t),YX(e,t.deleteSet),!0),QZ=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Dq(e.changed,t,_G).add(n)},$Z=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--i-1])n instanceof a1&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);let a=t-i;return a&&e.splice(t+1-a,a),a},eQ=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=HZ(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof a1&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},tQ=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=cG(r.length-1,1+HZ(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+$Z(r,e)}})},nQ=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{WX(a),n.afterState=zZ(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{r._item!==null&&r._item.deleted||r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&e.push(()=>{t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),kZ(r._dEH,t,n)})}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&f$(n)})}),Xq(e,[])}finally{r.gc&&eQ(a,i,r.gcFilter),tQ(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=lG(HZ(e,r),1);for(let t=e.length-1;t>=n;)t-=1+$Z(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=HZ(r,n);a+1<r.length&&$Z(r,a+1)>1||a>0&&$Z(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(AX(CX,gX,`[yjs] `,_X,xX,`Changed the client-id because another client seems to be using it.`),r.clientID=QX()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new aZ;ZZ(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new sZ;ZZ(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):nQ(e,t+1)}}},rQ=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new XZ(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&nQ(i,0)}}return o},iQ=class{constructor(e,t){this.gen=RX(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===l1);return this.curr}},aQ=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},oQ=e=>cQ(e,tZ,aZ),sQ=(e,t)=>{if(e.constructor===k$){let{client:n,clock:r}=e.id;return new k$(MZ(n,r+t),e.length-t)}if(e.constructor===l1){let{client:n,clock:r}=e.id;return new l1(MZ(n,r+t),e.length-t)}{let n=e,{client:r,clock:i}=n.id;return new a1(MZ(r,i+t),null,MZ(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},cQ=(e,t=rZ,n=sZ)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(wK(e))),i=r.map(e=>new iQ(e,!0)),a=null,o=new n,s=new aQ(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===l1?1:-1:n}return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)dQ(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock){if(a.struct.constructor===l1)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{dQ(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new l1(MZ(t,a.struct.id.clock+a.struct.length),e),offset:0}}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===l1?a.struct.length-=t:n=sQ(n,t)),a.struct.mergeWith(n)||(dQ(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==l1;n=e.next())dQ(s,a.struct,a.offset),a={struct:n,offset:0}}a!==null&&(dQ(s,a.struct,a.offset),a=null),fQ(s);let c=r.map(e=>XX(e)),l=GX(c);return YX(o,l),o.toUint8Array()},lQ=(e,t,n=rZ,r=sZ)=>{let i=bZ(t),a=new r,o=new aQ(a),s=new n(wK(e)),c=new iQ(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===l1)c.next();else if(e.id.clock+e.length>n)for(dQ(o,e,lG(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)dQ(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}fQ(o);let l=XX(s);return YX(a,l),a.toUint8Array()},uQ=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:qG(e.encoder.restEncoder)}),e.encoder.restEncoder=GG(),e.written=0)},dQ=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&uQ(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Z(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},fQ=e=>{uQ(e);let t=e.encoder.restEncoder;Z(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];Z(t,r.written),rK(t,r.restEncoder)}},pQ=(e,t,n,r)=>{let i=new n(wK(e)),a=new iQ(i,!1),o=new r,s=new aQ(o);for(let e=a.curr;e!==null;e=a.next())dQ(s,t(e),0);fQ(s);let c=XX(i);return YX(o,c),o.toUint8Array()},mQ=e=>pQ(e,Zq,rZ,aZ),hQ=`You must not compute changes after the event-handler fired.`,gQ=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=_Q(this.currentTarget,this.target)}deletes(e){return UX(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw BG(hQ);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r)){if(e!==null&&this.deletes(e))i=`delete`,a=yG(e.content.getContent());else return}else e!==null&&this.deletes(e)?(i=`update`,a=yG(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=yG(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw BG(hQ);let t=this.target,n=_G(),r=_G(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},_Q=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},vQ=()=>{jX(`Invalid access: Add Yjs type to a document before reading data.`)},yQ=80,bQ=0,xQ=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=bQ++}},SQ=e=>{e.timestamp=bQ++},CQ=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=bQ++},wQ=(e,t,n)=>{if(e.length>=yQ){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return CQ(r,t,n),r}{let r=new xQ(t,n);return e.push(r),r}},TQ=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>sG(t-e.index)<sG(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,SQ(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&sG(n.index-i)<r.parent.length/yQ?(CQ(n,r,i),n):wQ(e._searchMarker,r,i)},EQ=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=lG(t,i.index+n))}},DQ=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;Dq(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;kZ(r._eH,n,t)},OQ=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=EZ(),this._dEH=EZ(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw VG()}clone(){throw VG()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){DZ(this._eH,e)}observeDeep(e){DZ(this._dEH,e)}unobserve(e){OZ(this._eH,e)}unobserveDeep(e){OZ(this._dEH,e)}toJSON(){}},kQ=(e,t,n)=>{e.doc??vQ(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},AQ=e=>{e.doc??vQ();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},jQ=(e,t)=>{let n=0,r=e._start;for(e.doc??vQ();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},MQ=(e,t)=>{let n=[];return jQ(e,(r,i)=>{n.push(t(r,i,e))}),n},NQ=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},PQ=(e,t)=>{e.doc??vQ();let n=TQ(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},FQ=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new a1(MZ(o,BZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new W$(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new a1(MZ(o,BZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new A$(new Uint8Array(n))),i.integrate(e,0);break;case $X:i=new a1(MZ(o,BZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new F$(n)),i.integrate(e,0);break;default:if(n instanceof OQ)i=new a1(MZ(o,BZ(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new n1(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},IQ=()=>BG(`Length exceeded!`),LQ=(e,t,n,r)=>{if(n>t._length)throw IQ();if(n===0)return t._searchMarker&&EQ(t._searchMarker,n,r.length),FQ(e,t,null,r);let i=n,a=TQ(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&KZ(e,MZ(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&EQ(t._searchMarker,i,r.length),FQ(e,t,o,r)},RQ=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return FQ(e,t,r,n)},zQ=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=TQ(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&KZ(e,MZ(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&KZ(e,MZ(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw IQ();t._searchMarker&&EQ(t._searchMarker,i,-a+r)},BQ=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},VQ=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new W$([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new W$([r]);break;case Uint8Array:s=new A$(r);break;case $X:s=new F$(r);break;default:if(r instanceof OQ)s=new n1(r);else throw Error(`Unexpected content type`)}new a1(MZ(o,BZ(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},HQ=(e,t)=>{e.doc??vQ();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},UQ=e=>{let t={};return e.doc??vQ(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},WQ=(e,t)=>{e.doc??vQ();let n=e._map.get(t);return n!==void 0&&!n.deleted},GQ=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&IZ(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},KQ=e=>(e.doc??vQ(),FX(e._map.entries(),e=>!e[1].deleted)),qQ=class extends gQ{},JQ=class e extends OQ{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof OQ?e.clone():e)),t}get length(){return this.doc??vQ(),this._length}_callObserver(e,t){super._callObserver(e,t),DQ(this,e,new qQ(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):rQ(this.doc,n=>{LQ(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):rQ(this.doc,t=>{RQ(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):rQ(this.doc,n=>{zQ(n,this,e,t)})}get(e){return PQ(this,e)}toArray(){return AQ(this)}slice(e=0,t=this.length){return kQ(this,e,t)}toJSON(){return this.map(e=>e instanceof OQ?e.toJSON():e)}map(e){return MQ(this,e)}forEach(e){jQ(this,e)}[Symbol.iterator](){return NQ(this)}_write(e){e.writeTypeRef(Y$)}},YQ=e=>new JQ,XQ=class extends gQ{constructor(e,t,n){super(e,t),this.keysChanged=n}},ZQ=class e extends OQ{constructor(e){super(),this._prelimContent=null,this._prelimContent=e===void 0?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof OQ?e.clone():e)}),t}_callObserver(e,t){DQ(this,e,new XQ(this,e,t))}toJSON(){this.doc??vQ();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof OQ?r.toJSON():r}}),e}get size(){return[...KQ(this)].length}keys(){return IX(KQ(this),e=>e[0])}values(){return IX(KQ(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return IX(KQ(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??vQ(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):rQ(this.doc,t=>{BQ(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):rQ(this.doc,n=>{VQ(n,this,e,t)}),t}get(e){return HQ(this,e)}has(e){return WQ(this,e)}clear(){this.doc===null?this._prelimContent.clear():rQ(this.doc,e=>{this.forEach(function(t,n,r){BQ(e,r,n)})})}_write(e){e.writeTypeRef(X$)}},QQ=e=>new ZQ,$Q=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&Kq(e,t),e$=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&HG(),this.right.content.constructor){case z$:this.right.deleted||i$(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length)}this.left=this.right,this.right=this.right.right}},t$=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case z$:t.right.deleted||i$(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&KZ(e,MZ(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length)}t.left=t.right,t.right=t.right.right}return t},n$=(e,t,n,r)=>{let i=new Map,a=r?TQ(t,n):null;if(a){let t=new e$(a.p.left,a.p,a.index,i);return t$(e,t,n-a.index)}{let r=new e$(null,t._start,0,i);return t$(e,r,n)}},r$=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===z$&&$Q(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new a1(MZ(a,BZ(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new z$(o,r));l.integrate(e,0),n.right=l,n.forward()})},i$=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},a$=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===z$&&$Q(t[e.right.content.key]??null,e.right.content.value));)e.forward()},o$=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!$Q(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new a1(MZ(a,BZ(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new z$(s,c)),n.right.integrate(e,0),n.forward()}}return o},s$=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;a$(n,i);let s=o$(e,t,n,i),c=r.constructor===String?new K$(r):r instanceof OQ?new n1(r):new L$(r),{left:l,right:u,index:d}=n;t._searchMarker&&EQ(t._searchMarker,n.index,c.getLength()),u=new a1(MZ(o,BZ(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),r$(e,t,n,s)},c$=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;a$(n,i);let s=o$(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===z$));){if(!n.right.deleted)switch(n.right.content.constructor){case z$:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if($Q(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&KZ(e,MZ(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
|
|
364
|
+
`;n.right=new a1(MZ(o,BZ(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new K$(i)),n.right.integrate(e,0),n.forward()}r$(e,t,n,s)},l$=(e,t,n,r,i)=>{let a=t,o=Tq();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===z$){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case z$:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&i$(i,n);break}}}t=t.right}return s},u$=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===z$){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},d$=e=>{let t=0;return rQ(e.doc,n=>{let r=e._start,i=e._start,a=Tq(),o=Eq(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case z$:i$(o,i.content);break;default:t+=l$(n,r,i,a,o),a=Eq(o),r=i}i=i.right}}),t},f$=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&YZ(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===z$&&e.constructor!==k$&&t.add(e.parent)})}rQ(n,n=>{VX(e,e.deleteSet,e=>{if(e instanceof k$||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===z$?t.add(r):u$(n,e)});for(let e of t)d$(e)})},p$=(e,t,n)=>{let r=n,i=Eq(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case n1:case L$:case K$:n<t.right.length&&KZ(e,MZ(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}a&&l$(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&EQ(o._searchMarker,t.index,-r+n),t},m$=class extends gQ{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];rQ(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},Uq(o)||(e.attributes=Rq({},o))),c=0}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case n1:case L$:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case K$:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case z$:{let{key:t,value:s}=i.content;if(this.adds(i)){if(!this.deletes(i)){let c=n.get(t)??null;$Q(c,s)?s!==null&&i.delete(e):(a===`retain`&&u(),$Q(s,r.get(t)??null)?delete o[t]:o[t]=s)}}else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;$Q(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&($Q(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),i$(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},h$=class e extends OQ{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??vQ(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new m$(this,e,t);DQ(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??vQ();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===K$&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):rQ(this.doc,n=>{let r=new e$(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
|
|
365
|
+
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&s$(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&p$(n,r,a.delete):c$(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??vQ();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(IZ(s,e)||t!==void 0&&IZ(s,t))switch(s.content.constructor){case K$:{let r=i.get(`ychange`);e!==void 0&&!IZ(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!IZ(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case n1:case L$:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case z$:IZ(s,e)&&(c(),i$(i,s.content))}s=s.right}c()};return e||t?rQ(a,n=>{e&&LZ(n,e),t&&LZ(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):rQ(r,r=>{let i=n$(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),s$(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):rQ(r,r=>{let i=n$(r,this,e,!n);s$(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):rQ(n,n=>{p$(n,n$(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):rQ(r,r=>{let i=n$(r,this,e,!1);i.right!==null&&c$(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):rQ(this.doc,t=>{BQ(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):rQ(this.doc,n=>{VQ(n,this,e,t)})}getAttribute(e){return HQ(this,e)}getAttributes(){return UQ(this)}_write(e){e.writeTypeRef(Z$)}},g$=e=>new h$,_$=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??vQ()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===b$||t.constructor===v$)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},v$=class e extends OQ{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof OQ?e.clone():e)),t}get length(){return this.doc??vQ(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new _$(this,e)}querySelector(e){e=e.toUpperCase();let t=new _$(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),xG(new _$(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){DQ(this,e,new S$(this,t,e))}toString(){return MQ(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),jQ(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):rQ(this.doc,n=>{LQ(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)rQ(this.doc,n=>{let r=e&&e instanceof OQ?e._item:e;FQ(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw BG(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):rQ(this.doc,n=>{zQ(n,this,e,t)})}toArray(){return AQ(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return PQ(this,e)}slice(e=0,t=this.length){return kQ(this,e,t)}forEach(e){jQ(this,e)}_write(e){e.writeTypeRef($$)}},y$=e=>new v$,b$=class e extends v${constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return Bq(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof OQ?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):rQ(this.doc,t=>{BQ(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):rQ(this.doc,n=>{VQ(n,this,e,t)})}getAttribute(e){return HQ(this,e)}hasAttribute(e){return WQ(this,e)}getAttributes(e){return e?GQ(this,e):UQ(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return jQ(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Q$),e.writeKey(this.nodeName)}},x$=e=>new b$(e.readKey()),S$=class extends gQ{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},C$=class e extends ZQ{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(e1),e.writeKey(this.hookName)}},w$=e=>new C$(e.readKey()),T$=class e extends h${get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(t1)}},E$=e=>new T$,D$=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw VG()}mergeWith(e){return!1}write(e,t,n){throw VG()}integrate(e,t){throw VG()}},O$=0,k$=class extends D${get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),VZ(e.doc.store,this)}write(e,t){e.writeInfo(O$),e.writeLen(this.length-t)}getMissing(e,t){return null}},A$=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw VG()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},j$=e=>new A$(e.readBuf()),M$=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){KX(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},N$=e=>new M$(e.readLen()),P$=(e,t)=>new $X({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),F$=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(P$(this.doc.guid,this.opts))}splice(e){throw VG()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},I$=e=>new F$(P$(e.readString(),e.readAny())),L$=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw VG()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},R$=e=>new L$(e.readJSON()),z$=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw VG()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},B$=e=>new z$(e.readKey(),e.readJSON()),V$=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},H$=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new V$(n)},U$=wJ(`node_env`)===`development`,W$=class e{constructor(e){this.arr=e,U$&&Jq(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},G$=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new W$(n)},K$=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},q$=e=>new K$(e.readString()),J$=[YQ,QQ,g$,x$,y$,w$,E$],Y$=0,X$=1,Z$=2,Q$=3,$$=4,e1=5,t1=6,n1=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw VG()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},r1=e=>new n1(J$[e.readTypeRef()](e)),i1=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new a1(MZ(r,i+n),t,MZ(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=MZ(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},a1=class e extends D${constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=BZ(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=BZ(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===AZ&&this.id.client!==this.parent.client&&this.parent.clock>=BZ(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=qZ(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=KZ(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===k$||this.right&&this.right.constructor===k$)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===AZ){let e=WZ(n,this.parent);this.parent=e.constructor===k$?null:e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=qZ(e,e.doc.store,MZ(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),jZ(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(jZ(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(WZ(e.doc.store,n.origin)))r.has(WZ(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null){let e=this.left.right;this.right=e,this.left.right=this}else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),VZ(e.doc.store,this),this.content.integrate(e,this),QZ(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new k$(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:MZ(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&jZ(e.origin,this.lastId)&&this.right===e&&jZ(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),KX(e.deleteSet,this.id.client,this.id.clock,this.length),QZ(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw HG();this.content.gc(e),t?JZ(e,this,new k$(this.id,this.length)):this.content=new M$(this.length)}write(e,t){let n=t>0?MZ(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=NZ(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===AZ?(e.writeParentInfo(!1),e.writeLeftID(t)):HG();i!==null&&e.writeString(i)}this.content.write(e,t)}},o1=(e,t)=>s1[t&31](e),s1=[()=>{HG()},N$,H$,j$,q$,R$,B$,r1,G$,I$,()=>{HG()}],c1=10,l1=class extends D${get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){HG()}write(e,t){e.writeInfo(c1),Z(e.restEncoder,this.length-t)}getMissing(e,t){return null}},u1=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},d1=`__ $YJS$ __`,u1[d1]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),u1[d1]=!0})),p1,m1,h1,g1,_1,v1=t((()=>{vK(),UK(),lq(),fG(),Nq(),eJ(),p1=3e4,m1=class extends Mq{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=cq();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&h1(this,t,`timeout`)},oG(p1/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:cq()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),Qq(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},h1=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:cq()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},g1=(e,t,n=e.states)=>{let r=t.length,i=GG();Z(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;Z(i,r),Z(i,s),nK(i,JSON.stringify(o))}return qG(i)},_1=(e,t,n)=>{let r=wK(t),i=cq(),a=[],o=[],s=[],c=[],l=Q(r);for(let t=0;t<l;t++){let t=Q(r),n=Q(r),l=JSON.parse(MK(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(Qq(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])}})),y1,b1,x1,S1,C1,w1,T1,E1=t((()=>{Aq(),vG(),zJ(),_J(),y1=new Map,b1=class{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:LJ(t.newValue||``)}),hJ(this._onChange)}postMessage(e){mJ.setItem(this.room,IJ(jJ(e)))}close(){gJ(this._onChange)}},x1=typeof BroadcastChannel>`u`?b1:BroadcastChannel,S1=e=>Dq(y1,e,()=>{let t=_G(),n=new x1(e);return n.onmessage=e=>t.forEach(t=>t(e.data,`broadcastchannel`)),{bc:n,subs:t}}),C1=(e,t)=>(S1(e).subs.add(t),t),w1=(e,t)=>{let n=S1(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),y1.delete(e)),r},T1=(e,t,n=null)=>{let r=S1(e);r.bc.postMessage(t),r.subs.forEach(e=>e(t,n))}})),D1,O1,k1,A1,j1,M1,N1,P1=t((()=>{vK(),UK(),f1(),D1=(e,t)=>{Z(e,0);let n=wZ(t);iK(e,n)},O1=(e,t,n)=>{Z(e,1),iK(e,vZ(t,n))},k1=(e,t,n)=>O1(t,n,DK(e)),A1=(e,t,n,r)=>{try{hZ(t,DK(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},j1=(e,t)=>{Z(e,2),iK(e,t)},M1=A1,N1=(e,t,n,r,i)=>{let a=Q(e);switch(a){case 0:k1(e,t,n);break;case 1:A1(e,n,r,i);break;case 2:M1(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a}})),F1,I1=t((()=>{UK(),F1=(e,t,n)=>{Q(e)===0&&n(t,MK(e))}})),L1,R1=t((()=>{Yq(),L1=e=>Vq(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join(`&`)})),z1,B1,V1,H1,U1,W1,G1,K1,q1,J1=t((()=>{E1(),lq(),vK(),UK(),P1(),I1(),v1(),Nq(),fG(),R1(),kJ(),z1=[],z1[0]=(e,t,n,r,i)=>{Z(e,0);let a=N1(t,e,n.doc,n);r&&a===1&&!n.synced&&(n.synced=!0)},z1[3]=(e,t,n,r,i)=>{Z(e,1),iK(e,g1(n.awareness,Array.from(n.awareness.getStates().keys())))},z1[1]=(e,t,n,r,i)=>{_1(n.awareness,DK(t),n)},z1[2]=(e,t,n,r,i)=>{F1(t,n.doc,(e,t)=>V1(n,t))},B1=3e4,V1=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),H1=(e,t,n)=>{let r=wK(t),i=GG(),a=Q(r),o=e.messageHandlers[a];return o?o(i,r,e,n,a):console.error(`Unable to compute message`),i},U1=e=>!(e.code>=4400&&e.code<4500),W1=(e,t,n)=>{if(t!==null&&t===e.ws){e.emit(`connection-close`,[n,e]),e.ws=null,t.onmessage=null,t.onopen=null,t.onclose=null,t.onerror=()=>{},t.close(),e.wsconnecting=!1,e.wsconnected&&(e.wsconnected=!1,e.synced=!1,h1(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit(`status`,[{status:`disconnected`}])),e.wsUnsuccessfulReconnects++;let r=null;n!=null&&!e.shouldReconnect(n,e)&&(e.shouldConnect=!1,r={code:n.code,reason:n.reason}),setTimeout(G1,cG(uG(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e),r!==null&&e.emit(`closed`,[r,e])}},G1=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType=`arraybuffer`,e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{if(e.ws!==t)return;e.wsLastMessageReceived=cq();let r=H1(e,new Uint8Array(n.data),!0);KG(r)>1&&t.send(qG(r))},t.onerror=n=>{e.ws===t&&e.emit(`connection-error`,[n,e])},t.onclose=n=>{W1(e,t,n)},t.onopen=()=>{if(e.ws!==t)return;e.wsLastMessageReceived=cq(),e.wsconnecting=!1,e.wsconnected=!0,e.emit(`status`,[{status:`connected`}]);let n=GG();if(Z(n,0),D1(n,e.doc),t.send(qG(n)),e.awareness.getLocalState()!==null){let n=GG();Z(n,1),iK(n,g1(e.awareness,[e.doc.clientID])),t.send(qG(n))}},e.emit(`status`,[{status:`connecting`}])}},K1=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&T1(e.bcChannel,t,e)},q1=class extends jq{constructor(e,t,n,{connect:r=!0,awareness:i=new m1(n),params:a={},protocols:o=[],WebSocketPolyfill:s=WebSocket,resyncInterval:c=-1,maxBackoffTime:l=2500,disableBc:u=!1,shouldReconnect:d=U1}={}){for(super();e[e.length-1]===`/`;)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+`/`+t,this.maxBackoffTime=l,this.shouldReconnect=d,this.params=a,this.protocols=o,this.roomname=t,this.doc=n,this._WS=s,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=z1.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,c>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=GG();Z(e,0),D1(e,n),this.ws.send(qG(e))}},c)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=H1(this,new Uint8Array(e),!1);KG(t)>1&&T1(this.bcChannel,qG(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=GG();Z(t,0),j1(t,e),K1(this,qG(t))}},this.doc.on(`update`,this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{let a=e.concat(t).concat(n),o=GG();Z(o,1),iK(o,g1(i,a)),K1(this,qG(o))},this._exitHandler=()=>{h1(this.awareness,[n.clientID],`app closed`)},vJ&&typeof process<`u`&&process.on(`exit`,this._exitHandler),i.on(`update`,this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&B1<cq()-this.wsLastMessageReceived&&W1(this,this.ws,null)},B1/10),r&&this.connect()}get url(){let e=L1(this.params);return this.serverUrl+`/`+this.roomname+(e.length===0?``:`?`+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,e&&(this.wsUnsuccessfulReconnects=0),this.emit(`synced`,[e]),this.emit(`sync`,[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),vJ&&typeof process<`u`&&process.off(`exit`,this._exitHandler),this.awareness.off(`update`,this._awarenessUpdateHandler),this.doc.off(`update`,this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||=(C1(this.bcChannel,this._bcSubscriber),!0);let e=GG();Z(e,0),D1(e,this.doc),T1(this.bcChannel,qG(e),this);let t=GG();Z(t,0),O1(t,this.doc),T1(this.bcChannel,qG(t),this);let n=GG();Z(n,3),T1(this.bcChannel,qG(n),this);let r=GG();Z(r,1),iK(r,g1(this.awareness,[this.doc.clientID])),T1(this.bcChannel,qG(r),this)}disconnectBc(){let e=GG();Z(e,1),iK(e,g1(this.awareness,[this.doc.clientID],new Map)),K1(this,qG(e)),this.bcconnected&&=(w1(this.bcChannel,this._bcSubscriber),!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&W1(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(G1(this),this.connectBc())}}})),Y1=n({connectRealtimeRoom:()=>X1});function X1(e,t,n={}){let r=new Set,i=new Set,a=new Set,o=[],s,c=`connecting`,l=!1,u=!1,d,f,p=()=>{for(let e of r)e()},m=()=>{let t=n.origin?new URL(n.origin):window.location;return`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}${uq(`/_vitehub/realtime/${encodeURIComponent(e)}`,n.baseURL)}`},h=t.split(`/`).map(encodeURIComponent).join(`/`),g={};function _(){l=!1,d=new $X,f=new q1(m(),h,d,{disableBc:!0,params:{...n.params,clientId:String(d.clientID)}});let e=f;dq(e),e.messageHandlers[5]=(t,n)=>{let r=QK(n);r&&(r.type===`session`?e.params.epoch=r.epoch:(e.destroy(),d.destroy(),u||(_(),p())))},e.messageHandlers[6]=(t,n)=>{let r=rq(n);if(r?.kind===`request`&&y(e,r.id,r.body),r?.kind===`notice`)for(let e of a)e(r.body)},e.awareness.off(`update`,e._awarenessUpdateHandler),e.awareness.on(`update`,({added:t,removed:n,updated:r})=>{let i=[...t,...r,...n].filter(t=>t===e.doc.clientID),a=e.ws;if(!i.length||!e.wsconnected||!a||a.readyState!==a.OPEN)return;let o=GG();Z(o,1),iK(o,g1(e.awareness,i)),a.send(qG(o))});let t=n.identity??{id:`guest:${d.clientID}`};fq(e),e.awareness.setLocalState({...g,user:bq({...t,id:t.id||`guest:${d.clientID}`})}),e.awareness.on(`change`,p),d.getMap(_q.status).observe(p),e.on(`sync`,t=>{f===e&&(l=t,p())}),e.on(`status`,e=>{c=e.status,p()})}_();let v;n.changes&&(v=new q1(m(),encodeURIComponent(aq),new $X,{disableBc:!0,params:{...n.params,workspace:`events`}}),v.awareness.setLocalState(null),dq(v),v.messageHandlers[4]=(e,t)=>{let n=eq(t);if(n)for(let e of i)e(n)},v.on(`status`,e=>{e.status===`connected`&&b()}));async function y(e,t,n){let r=e=>nq({kind:`answer`,id:t,ok:!1,why:e}),i;try{i=s?nq({kind:`answer`,id:t,ok:!0,body:await s(n)}):r(`This page does not answer requests.`),i.byteLength>Z1&&(i=r(`The answer has ${i.byteLength} bytes, over the 1 MiB limit.`))}catch(e){i=r(e instanceof Error?e.message:String(e))}let a=e.ws;e.wsconnected&&a&&a.readyState===a.OPEN&&a.send(Uint8Array.from(i))}function b(){let e=v?.ws;if(v?.wsconnected&&e&&e.readyState===e.OPEN)for(;o.length;)e.send(Uint8Array.from(tq(o.shift())))}return{get awareness(){return f.awareness},get clientId(){return d.clientID},people:()=>Sq(f.awareness.getStates()),states:()=>{let e=new Map(f.awareness.getStates());return e.delete(d.clientID),e},status:()=>c,saveStatus:()=>l?gq(d):void 0,setLocal(e,t){if(t!==null){g[e]=t,f.awareness.setLocalStateField(e,t);return}delete g[e];let n=f.awareness.getLocalState();if(!n||!Object.hasOwn(n,e))return;let{[e]:r,...i}=n;f.awareness.setLocalState(i)},notify(e){v&&(o.push(e),b())},onUpdate(e){return r.add(e),()=>r.delete(e)},onChange(e){return i.add(e),()=>i.delete(e)},onRequest(e){return s=e,()=>{s===e&&(s=void 0)}},onNotice(e){return a.add(e),()=>a.delete(e)},destroy(){u=!0,f.destroy(),d.destroy(),v?.destroy(),v?.doc.destroy(),r.clear(),i.clear(),a.clear(),s=void 0}}}var Z1,Q1=t((()=>{mq(),vq(),wq(),sq(),vK(),v1(),J1(),f1(),Z1=1047552}));function $1(e){let t=document.createElement(`style`);return t.textContent=e,t}function e0(e,t){let n=new Map;for(let r of e){if(r.id===t)continue;let e=n.get(r.id);e?e.tabs++:n.set(r.id,{person:r,tabs:1})}return[...n.values()]}function t0(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join(``)||`?`}function n0(e){let t=[`#fb7185`,`#fbbf24`,`#34d399`,`#22d3ee`,`#60a5fa`,`#a78bfa`,`#f472b6`],n=0;for(let t=0;t<e.length;t++)n=Math.imul(31,n)+e.charCodeAt(t)|0;return t[Math.abs(n)%t.length]}function r0(e,t){let{files:n,deferredFiles:r,...i}=e,a=e=>Promise.all([e,t]).then(e=>e.flat());return n!==void 0&&!Array.isArray(n)?{...i,files:a(n)}:{...i,...n?{files:n}:{},deferredFiles:r?a(r):t}}function i0(){let e=document.documentElement;if(e.classList.contains(`dark`))return!0;if(e.classList.contains(`light`))return!1;if(e.dataset.theme===`dark`)return!0;if(e.dataset.theme===`light`)return!1;let t=getComputedStyle(e).colorScheme;return t===`dark`||t!==`light`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function a0(e){e.preventDefault(),e.stopPropagation()}function o0(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function s0(e){if(!(e.metaKey||e.ctrlKey||e.altKey))return Object.keys(sW).find(t=>sW[t].key===e.key.toUpperCase())}function c0(){try{return localStorage.getItem(A0)===`hidden`?`hidden`:`all`}catch{return`all`}}function l0(e){try{e===`hidden`?localStorage.setItem(A0,e):localStorage.removeItem(A0)}catch{}}function u0(e,t=1){let n=document.elementsFromPoint(e.left+e.width/2,e.top+e.height/2).find(e=>!p0(e)&&e!==document.documentElement);for(let r=n??null;r&&r!==document.documentElement;r=r.parentElement){let n=r.getBoundingClientRect();if(n.left<=e.left+t&&n.top<=e.top+t&&n.right>=e.left+e.width-t&&n.bottom>=e.top+e.height-t)return r}}function d0(e,t){let n=t.getBoundingClientRect(),r=Math.max(e.left,n.left),i=Math.max(e.top,n.top);return{left:r,top:i,width:Math.min(e.left+e.width,n.right)-r,height:Math.min(e.top+e.height,n.bottom)-i}}function f0(){let e=new URL(location.href);e.searchParams.has(N0)&&(e.searchParams.delete(N0),history.replaceState(history.state,``,e))}function p0(e){for(let t=e;t;){if(t.closest(`[data-comments-ui], vitehub-pill, vitehub-window`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function m0(e){let{host:t,context:n,session:r}=e,i=t.shadowRoot,a=document.createElement(`div`);a.className=`root`,i.replaceChildren($1(g0(bW)),a);let o=[i,e.toolbar?.getRootNode(),e.areas].filter(e=>e instanceof ShadowRoot).map(e=>fw(e)),s=H(Ri(location.pathname)),c=tc(r?.subject??{kind:`page`,id:s.value}),l=r?.revision,d=H(!1),f=H(!1),p=0,m=H(location.search),h=tc(),g=new WeakMap,_=0,v=e=>{let t=g.get(e);return t===void 0&&g.set(e,t=++_),t},y=H(),b=H(!1),x=tc(),S=H(!1),C,w=H(!1),T=H(0),E=H(`marker`),D=H(`pink`),O,k=new WeakMap,A=tc(),ee=H(new Set),j=H(!1),M=H(`comment`),N,te=H(Gi()),P=H(0),F=tc([]),I=H(`open`),ne=H(null),re=tc(),L=H(0),R=H(c0()===`hidden`),ie,z,ae=0,oe,se,ce=new Set,le=new WeakMap,ue=(e,t=!1)=>{clearTimeout(se),h.value=e,t||(se=setTimeout(()=>h.value=void 0,e.kind===`error`?8e3:5e3))},de=e=>ue({text:e.fix?`${e.why} ${e.fix}`:e.why,kind:`error`}),fe=()=>r?.user??void 0,pe=r?.presence!==!1,me=J(()=>fe()??(te.value?{id:`guest:${te.value.id}`,name:te.value.name,guest:!0}:void 0)),he=tc(r?.can),ge=tc(r?.agent),_e=tc(r?.repository),ve=J(()=>!!he.value?.comment),ye=J(()=>ve.value&&r?.attachments!==!1),be=J(()=>ve.value&&!me.value),xe=J({get:()=>R.value&&ve.value?`hidden`:`all`,set:e=>{R.value=e===`hidden`,l0(e)}}),Se=(e,t)=>{let n=me.value;return!n||be.value?!1:t.message?.delivery&&(e===`edit`||e===`delete`)?!0:lm(n,he.value,e,t)},Ce=Ca({onPeople(e){let t=new Map(F.value.map(e=>[e.id,e]));for(let n of e)t.set(n.id,n);F.value=[...t.values()]},onChange:()=>ie?.setLocal(`commentsChange`,crypto.randomUUID()),...e.pageThreads&&r?.can.read?{pageThreads:{...e.pageThreads,subject:c.value}}:{}});function we(e){let t=ha(),n=mh({transport:{...Ce,subscribe(e){return ce.add(e),()=>ce.delete(e)}},user:e,...e?{outbox:{account:e.id,namespace:t}}:{}}),r=n.create;return n.create=e=>{let t=e.revision??l,n=k.get(e.anchor);k.delete(e.anchor),n&&(n.sent=!0);let i={...n?r0(e,n.files):e,context:le.get(e.anchor)??mV(void 0),...t===void 0?{}:{revision:t}};return r(i)},n}let Te=tc(we(me.value));W(()=>me.value?.id,()=>Te.value=we(me.value));let Ee=()=>{for(let e of ce)e({type:`reconnected`})},De,Oe=()=>{clearTimeout(De),De=setTimeout(Ee,100)},ke=ba(Oe),Ae=e=>{let t=Ce.attachmentUrl(e);return t?[new URL(t,location.href).href]:[]},je=e=>({id:e.id,anchor:e.anchor,messages:e.messages.map(e=>({author:e.author.name??e.author.id,body:e.body})),...e.revision===void 0?{}:{revision:e.revision},files:e.messages.flatMap(e=>e.attachments.flatMap(Ae))}),Me=e=>({url:new URL(s.value,location.origin).href,threads:e.map(je),...ge.value?{agent:ge.value}:{}});async function Ne(e){let t=await navigator.clipboard?.writeText(ym(Me(e))).then(()=>!0,()=>!1);ue(t?{text:`Prompt copied. Paste it in your agent.`,kind:`info`}:{text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`})}let Pe=J(()=>B.openThreads.value.filter(e=>!e.delivery)),Fe=J(()=>!d.value&&Pe.value.length>0),Ie=H(!1),Le;async function Re(){if(!Fe.value)return;let e=p,t=await navigator.clipboard?.writeText(xm(Me(Pe.value))).then(()=>!0,()=>!1);if(e===p){if(!t)return ue({text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`});Ie.value=!0,clearTimeout(Le),Le=setTimeout(()=>Ie.value=!1,1500)}}let ze=e=>{let t=bm(Me(e),_e.value);return t?q(Fw,{"aria-label":`Open in T3 Code`,color:`neutral`,"data-action":`open-in-t3-code`,label:`Open in T3 Code`,rel:`noopener noreferrer`,size:`xs`,target:`_blank`,title:`Open in T3 Code`,to:t,variant:`ghost`},()=>q(Pw,{name:`i-lucide-arrow-up-right`})):q(`small`,`Too long for T3 Code. Copy the prompt instead.`)},Be=({thread:e})=>e.status===`open`&&!e.delivery?[ze([e]),q(Fw,{color:`neutral`,"data-action":`copy-prompt`,icon:`i-lucide-copy`,label:`Copy`,onClick:()=>void Ne([e]),size:`xs`,variant:`ghost`})]:[],Ve=()=>{let e=Pe.value;return I.value===`open`&&Fe.value?[q(Fw,{"aria-label":Ie.value?`Copied`:`Copy prompt`,color:`neutral`,"data-action":`copy-page-prompt`,icon:Ie.value?`i-lucide-check`:`i-lucide-copy`,label:Ie.value?`Copied`:`Copy prompt`,onClick:()=>void Re(),size:`xs`,title:He(),variant:`ghost`}),ze(e)]:[]},He=()=>ge.value?`Copy a prompt that sends your agent to these comments in the ViteHub Console`:`Copy a prompt with the open comments for your agent`,Ue=({delivery:{status:e,error:t},retry:n})=>{let r=e===`failed`,i=t?.status===401||t?.status===402,a=r?`Not sent.`:t?`Waiting to send.`:`Sending…`;return[q(`span`,{class:`delivery`,"data-failed":r?`true`:void 0},t?`${a} ${t.why}`:a),...n&&(r||i)?[q(Fw,{color:`neutral`,label:`Retry`,onClick:()=>void n(),size:`xs`,variant:`ghost`})]:[]]},We=_V({page:()=>s.value,info:e=>ue({text:e,kind:`info`}),failed:de,drafted(e){ee.value=new Set([...ee.value,e])}}),B;function Ge(e){if(e!==`mark`&&Ye(),d.value&&(f.value=e===`comment`&&ve.value),!(d.value&&e!==`edit`&&e!==`view`)){if(e===`mark`){if(!ye.value||w.value)return;if(be.value){M.value=e,N=void 0,j.value=!0;return}We.finish(!0),S.value=!1,B.exit(),Je()}else if(e===`comment`){if(!ve.value)return;if(be.value){M.value=e,N=void 0,j.value=!0;return}We.finish(!0),S.value=!1,B.enter()}else if(e===`edit`){if(!r?.content||!ve.value||(B.exit(),B.active.value))return;S.value=!0}else j.value=!1,N=void 0,B.exit(),S.value=!1,We.finish(!0);A.value=void 0}}let Ke=J(()=>w.value?`mark`:S.value?`edit`:B?.active.value?`comment`:`view`),qe=J(()=>Ke.value===`comment`||d.value&&f.value||j.value&&M.value!==`mark`);function Je(){Xe(),C=eW({tip:()=>E.value,color:()=>cW[D.value],onChange:()=>T.value=C?.strokes().length??0,onSubmit:Ze}),T.value=0,w.value=!0}function Ye(){C?.remove(),C=void 0,T.value=0,w.value=!1}function Xe(){O?.session.remove(),O=void 0}function Ze(){let e=C;e?.commit();let t=e?.strokes()??[],n=YU(t);if(!e||!n)return;e.freeze();let r=oW(t,e=>e instanceof Element&&p0(e));C=void 0,w.value=!1,T.value=0;let i=B.draft.value,a=u0(n,sW.marker.width/2+1);try{if(a){let e=d0(n,a);B.startDraft(a,{area:e,point:{x:e.left,y:e.top}})}else B.startDraft(`page`)}catch{}let o=B.draft.value;if(!o||o===i){e.remove();return}O={session:e,draft:o};let s={files:r.then(e=>e?[new File([e],`highlight.webp`,{type:e.type})]:[],()=>[]),sent:!1};k.set(Qs(o.anchor),s),s.files.then(e=>{!e.length&&(s.sent||B.draft.value===o)&&ue({text:`This page could not be drawn as a picture. The comment marks the area without one.`,kind:`info`})})}async function Qe(e=!1){if(!r?.realtime||!t.isConnected||n?.signal.aborted||ie&&!e)return;let i=++ae,a=await Ua(()=>Promise.resolve().then(()=>(Q1(),Y1)),void 0,import.meta.url).catch(()=>void 0);if(!a||i!==ae||!t.isConnected||n?.signal.aborted)return;ie?.destroy(),z?.destroy();let o=fe()??(te.value?{id:`guest:${te.value.id}`,name:`${te.value.name} (guest)`}:void 0),l=Li(import.meta.url).slice(0,-Ui.length),u=a.connectRealtimeRoom(Vi,zi(s.value),{identity:o,baseURL:l,params:{page:s.value}}),d=new Map;u.onUpdate(()=>{P.value++;let e=new Map,t=!1;for(let[n,r]of u.states())n!==u.clientId&&typeof r.commentsChange==`string`&&(e.set(n,r.commentsChange),d.get(n)!==r.commentsChange&&(t=!0));d=e,t&&Oe()}),z=a.connectRealtimeRoom(Hi,Bi(c.value),{baseURL:l,params:{page:s.value}}),z.onNotice(Oe),ie=u}function $e(){ae++,clearTimeout(De),ie?.destroy(),ie=void 0,z?.destroy(),z=void 0}function et(){if(n){if(!oe){let e=()=>t.classList.contains(`dark`),r=n.createWindow({id:`comments`,title:`Comments`,trigger:n.bar,colorScheme:()=>e()?`dark`:`light`,expand:!1,onHide:()=>b.value=!1});oe=r;let i=document.createElement(`div`);i.setAttribute(`data-comments-ui`,``);let a=i.attachShadow({mode:`open`});o.push(fw(a));let s=document.createElement(`div`);s.className=`panel-root`;let c=()=>{i.classList.toggle(`dark`,e()),s.classList.toggle(`dark`,e()),r.syncColorScheme?.()};c();let l=new MutationObserver(c);l.observe(t,{attributes:!0,attributeFilter:[`class`]}),o.push(()=>l.disconnect()),a.append($1(g0(xW)),s),r.body.append(i),x.value=s}b.value=!0,oe.show()}}async function tt(e){te.value=Ki(e),j.value=!1,Qe(!0);let t=M.value;M.value=`comment`;let n=N;if(N=void 0,await ol(),n?.startContainer.isConnected){let e=getSelection();if(e?.removeAllRanges(),e?.addRange(n),ct())return}Ge(t)}async function nt(e){await fetch(e,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(()=>void 0),location.reload()}function rt(t){let n=new URL(location.href);n.searchParams.set(u,`comments`);let r=t.signIn,i=r?.provider===`console`,a=t.github;if(a&&t.signOut){let e=t.signOut,n=a.repository?`@${a.login} cannot push to ${a.repository}, so cannot comment here.`:`Signed in as @${a.login}, but this site does not say which GitHub repository it is built from.`;ue({text:n,kind:`error`,action:[`Use another account`,()=>void nt(e)]},!0)}else ue(r?{text:`Sign in to comment on this page.`,kind:`info`,link:i?{label:`Sign in to ViteHub`,href:r.url,newTab:!0}:{label:`Sign in with GitHub`,href:`${r.url}?return=${encodeURIComponent(n.pathname+n.search+n.hash)}`},action:[`Close`,e.exit]}:{text:`Comments are only for the site's team. Sign in with an account that may comment.`,kind:`error`,action:[`Close`,e.exit]},!0)}function it(){let e=getSelection();if(!ve.value||S.value||d.value||!e||e.isCollapsed||e.rangeCount===0||!e.toString().trim())return;let t=e.getRangeAt(0),n=t.commonAncestorContainer,r=n instanceof Element?n:n.parentElement;if(!(!r?.isConnected||p0(r)||r.closest(`input, textarea, select, [contenteditable]:not([contenteditable='false'])`)))return t.cloneRange()}let at,ot=!1;function st(){if(ot)return;at=B?.draft.value?void 0:it();let e=at?.getBoundingClientRect();re.value=e&&(e.width||e.height)?{left:e.left+e.width/2,top:e.top,bottom:e.bottom}:void 0}function ct(e=it()){if(ot=!1,!e)return!1;if(be.value)return M.value=`comment`,N=e,j.value=!0,!0;We.finish(!0);let t=e.getBoundingClientRect();try{B.startDraft(e,{point:{x:t.right,y:t.top}}),getSelection()?.removeAllRanges()}catch{return!1}return at=void 0,re.value=void 0,!0}let lt=typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight==`function`;function ut(){if(!lt)return;let e={open:[],resolved:[],active:[],draft:[]},t=new Set([B.openId.value,B.hoverId.value].filter(Boolean)),n=B.threads.value.filter(e=>B.isShown(e.id));for(let r of n){if(r.anchor.kind!==`text`||!B.isShown(r.id))continue;let n=eh(r.anchor);n&&e[t.has(r.id)?`active`:r.status===`resolved`?`resolved`:`open`].push(n)}let r=B.draft.value?.anchor;if(r?.kind===`text`){let t=eh(Qs(r));t&&e.draft.push(t)}for(let[t,n]of Object.entries(h0))CSS.highlights.set(n,new Highlight(...e[t]))}function dt(){if(lt)for(let e of Object.values(h0))CSS.highlights.delete(e)}let ft=G({setup(){let e=H(null);ol(()=>e.value?.focus());let t=t=>{t.preventDefault();let n=e.value?.value.trim();n?tt(n):e.value?.focus()};return()=>q(`form`,{class:`card`,role:`dialog`,"aria-label":`Your name`,onSubmit:t,onKeydown:e=>e.key===`Escape`&&(j.value=!1)},[q(`label`,[`Your name`,q(`input`,{"aria-label":`Your name`,autocomplete:`name`,maxlength:64,placeholder:`Shown next to your comments`,ref:e})]),q(`div`,{class:`row`},[q(Fw,{color:`neutral`,label:`Cancel`,onClick:()=>j.value=!1,size:`sm`,variant:`ghost`}),q(Fw,{label:`Comment`,size:`sm`,type:`submit`})])])}}),pt=G({name:`CommentsOverlay`,setup(){B=KD({client:Te.value,subject:()=>c.value,location:()=>({href:location.href,origin:location.origin,search:m.value}),user:()=>me.value,people:F,hotkey:!1,ignore:p0,can:Se,uiRoot:()=>i,autoStart:!!r?.can.read,visibility:xe}),W(Ke,t=>e.onMode(t),{immediate:!0,flush:`sync`}),W(()=>B.status.value,e=>{e===`ready`&&!ie&&Qe()}),W(()=>B.status.value===`ready`&&!d.value?m.value:void 0,e=>{let t=p;e&&ol(()=>{t===p&&!d.value&&location.search===e&&f0()})},{immediate:!0}),W(()=>B.counts.value.open,()=>P.value++);let t=J(_t);n?.menu&&W(t,e=>n.menu(e),{immediate:!0});let a=G({setup(){let e=H(),r=new AbortController;return Pd(()=>{let i=pn({bar:e.value,pill:n?.bar.parentElement??null,items:()=>[t.value],signal:r.signal});W(t,i.update)}),Ld(()=>r.abort()),()=>q(`span`,{ref:e,"data-slot":`legacy-comments-menu`})}}),o,l=()=>{let e=y.value;o&&o.element!==e&&(o.motion.destroy(),o=void 0),e&&(o?o.motion.play():o={element:e,motion:nw(e)},o.motion.measure())};Pd(l),Id(l),Ld(()=>o?.motion.destroy()),W(I,e=>{B.filters.resolved=e===`resolved`}),W(()=>B.filters.resolved,e=>{e&&(I.value=`resolved`)}),W(()=>B.draft.value,e=>{if(!e||e.anchor.kind===`page`)return;let t=document.elementsFromPoint(e.point.x,e.point.y).find(e=>!p0(e)&&e!==document.documentElement);t&&(e.anchor.kind===`element`&&(e.anchor=eo(t,e.point.x,e.point.y)),le.set(Qs(e.anchor),mV(t)))},{flush:`sync`}),W([L,B.pageThreads,B.openId,B.hoverId,()=>B.draft.value?.anchor,B.shown],ut,{flush:`post`}),W(()=>B.draft.value,st),W(()=>B.draft.value,e=>{O&&e!==O.draft&&Xe(),e?.anchor.kind===`page`&&b.value&&oe?.hide()});let u=yV(e.toolbar);return()=>{let t=[];if(he.value?.read&&!d.value){t.push(q(GB,{comments:B,readOnly:!me.value,canComment:ve.value,queueFiles:ye.value,attachmentUrl:Ce.attachmentUrl,style:u.value?{"--vh-comment-island-top":u.value}:void 0},{default:()=>[],status:Ue,actions:Be})),t.push(q(`div`,{class:`cursors`,ref:y},yt())),t.push(q(`div`,{class:`outlines`},bt())),t.push(e.areas?q(Od,{to:e.areas},vt()):q(`div`,{class:`areas`},vt()));let n=re.value;if(n&&!B.draft.value){let e=matchMedia(`(pointer: coarse)`).matches,r=n.bottom+(e?20:8),i=n.top<(e?102:56)||e&&r<=innerHeight-46,a=i?Math.min(r,innerHeight-46):n.top-(e?64:8);t.push(q(`div`,{class:`selection`,"data-below":i?`true`:void 0,style:{left:`${Math.min(Math.max(64,n.left),innerWidth-64)}px`,top:`${a}px`},onPointerdown:e=>{e.preventDefault(),ot=!0,addEventListener(`pointerup`,()=>setTimeout(()=>{ot&&(ot=!1,st())},300),{capture:!0,once:!0})}},q($B,{side:i?`bottom`:`top`,onComment:()=>ct(at)})))}x.value&&!d.value&&t.push(q(Od,{to:x.value},q(XB,{key:s.value,comments:B,attachmentUrl:Ce.attachmentUrl,readOnly:!me.value||!B.threads.value.some(e=>e.id===ne.value)&&!ve.value,"onUpdate:thread":e=>ne.value=e,status:I.value,"onUpdate:status":e=>I.value=e,title:s.value,heading:!1,composer:!1,queueFiles:ye.value,onSelect:e=>{let t=B.positions.value.get(e.id);t&&!t.detached&&t.element?.scrollIntoView({block:`center`,behavior:`smooth`})}},{status:Ue,actions:Be,"list-actions":Ve})))}he.value?.read&&e.toolbar&&t.push(q(Od,{to:e.toolbar},gt(n?.menu?null:q(a)))),j.value&&t.push(q(ft));let r=h.value;return t.push(q(`section`,{role:`region`,"aria-label":`Comments notifications`},q(`ol`,{class:`toasts`},r?[q(`li`,{class:`toast`,role:`status`,"data-kind":r.kind,key:v(r)},[q(`span`,r.text),r.link?q(`a`,{href:r.link.href,...r.link.newTab?{target:`_blank`,rel:`noopener noreferrer`}:{}},r.link.label):null,r.action?q(Fw,{color:`neutral`,label:r.action[0],onClick:r.action[1],size:`sm`,variant:`ghost`}):null])]:[]))),t}}});function mt(e){E.value=e,C?.restyle()}function ht(){let e=e=>e.preventDefault();return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Highlight`},[q(`div`,{class:`swatches`},Object.keys(sW).map(e=>q(`button`,{key:e,class:`swatch`,type:`button`,"aria-label":sW[e].label,"aria-keyshortcuts":sW[e].key,"aria-pressed":String(E.value===e),title:`${sW[e].label} (${sW[e].key})`,onClick:()=>mt(e)},E0[e]()))),q(`span`,{class:`sep`}),q(`div`,{class:`swatches`},Object.keys(cW).map(t=>q(`button`,{key:t,class:`swatch`,type:`button`,"aria-label":`${t[0].toUpperCase()}${t.slice(1)} ink`,"aria-pressed":String(D.value===t),onMousedown:e,onClick:()=>{D.value=t,C?.restyle()}},q(`span`,{style:{background:cW[t]}})))),q(`span`,{class:`sep`}),q(`button`,{type:`button`,class:`icon`,"aria-label":`Undo`,"aria-keyshortcuts":`Meta+Z Control+Z`,title:`Undo`,disabled:T.value===0,onClick:()=>C?.undo()},D0()),q(`button`,{type:`button`,onClick:()=>Ge(`view`),title:`Cancel (Esc)`},`Cancel`),q(`button`,{type:`button`,class:`done`,"aria-keyshortcuts":`Enter`,disabled:T.value===0,onClick:Ze,title:`Comment on the highlighted area (Enter)`},`Done`)])}function gt(e){if(P.value,w.value)return ht();let t=pe?e0(ie?.people()??[],me.value?.id):[],n=t.slice(0,5).map(({person:e,tabs:t})=>q(`span`,{class:`avatar`,key:e.id,title:t>1?`${e.name} · ${t} tabs`:e.name,style:{background:e.color}},e.image?q(`img`,{src:e.image,alt:``}):t0(e.name))),r=`${t.length} other ${t.length===1?`person`:`people`} on this page`,i=B.counts.value.open,a=qe.value,o=e=>e&&i>0?q(_0,{value:i}):null;return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Comments`},[ve.value?q(`button`,{"aria-keyshortcuts":`C`,"aria-label":a?`Comments: click anywhere on the page`:i?`Comments, ${i} open`:`Comments`,"aria-pressed":String(a),onClick:()=>Ge(a?`view`:`comment`),title:a?`Stop commenting (C)`:`Comment on the page (C)`,type:`button`},[w0(),`Comments`,o(!a)]):q(`button`,{"aria-expanded":String(b.value),"aria-label":i?`Comments, ${i} open`:`Comments`,onClick:()=>b.value?oe?.hide():et(),title:`Show comments`,type:`button`},[w0(),`Comments`,o(!0)]),Ke.value===`edit`?q(`button`,{"aria-keyshortcuts":`E`,"aria-pressed":`true`,"data-action":`stop-editing`,onClick:()=>Ge(`view`),title:`Stop editing text (E)`,type:`button`},[O0(),`Editing text`]):null,ve.value&&xe.value===`hidden`?q(`button`,{"aria-keyshortcuts":`Shift+C`,"aria-label":`Show comments`,class:`eye`,onClick:Et,title:`Comments are hidden. Show comments (Shift+C)`,type:`button`},k0()):null,Fe.value?q(`button`,{"data-action":`copy-page-prompt`,onClick:()=>void Re(),title:He(),type:`button`},q(`span`,{class:`swap`},[q(`span`,{"data-shown":String(!Ie.value)},[j0(),`Copy prompt`]),q(`span`,{"data-shown":String(Ie.value)},[M0(),`Copied`])])):null,n.length>0?q(`span`,{"aria-label":r,class:`people`},n):null,e])}function _t(){let e=r?.signOut,t=e?r?.github:void 0,n=xe.value===`hidden`,i=B.threads.value.length>0;return[ye.value?{id:`highlight`,label:`Highlight`,icon:v0,keys:`B`,press:()=>Ge(`mark`)}:void 0,r?.content&&ve.value?{id:`edit`,label:`Edit text`,icon:y0,keys:`E`,press:()=>Ge(`edit`)}:void 0,ve.value&&(i||n)?{id:`visibility`,label:n?`Show comments`:`Hide comments`,icon:n?b0:x0,keys:`⇧C`,press:Et}:void 0,ve.value&&i?{id:`all-comments`,label:`All comments`,icon:S0,press:et}:void 0,e&&t?{id:`sign-out`,label:`Sign out @${t.login}`,icon:C0,press:()=>void nt(e)}:void 0].filter(e=>e!==void 0)}function vt(){let e=[],t=(t,n,r)=>{let i=B.positions.value.get(t);if(!i||i.detached||i.clipped||n!==`area`&&n!==`image`||!i.width||!i.height)return;let a=t!==`draft`&&B.leaving.value.has(t);(t===`draft`||a||B.isShown(t))&&e.push(q(`div`,{key:t,"data-leaving":a?`true`:void 0,"data-active":r.active?`true`:void 0,"data-draft":r.draft?`true`:void 0,"data-slot":`comment-mark-area`,"data-status":r.status,style:{left:`${i.x}px`,top:`${i.y}px`,width:`${i.width}px`,height:`${i.height}px`}}))},n=new Set([B.openId.value,B.hoverId.value]);for(let e of B.threads.value)t(e.id,e.anchor.kind,{status:e.status,active:n.has(e.id)});let r=B.draft.value;return r&&t(`draft`,r.anchor.kind,{draft:!0}),e}function yt(){P.value;let e=[];if(!pe)return e;for(let[t,n]of ie?.states()??[]){let r=n.cursor,i=n.user;if(!r||!i?.id||i.id===me.value?.id)continue;let a=null;try{a=document.querySelector(r.selector)}catch{}if(!a)continue;let o=a.getBoundingClientRect(),s=typeof i.color==`string`&&/^#[\da-f]{6}$/i.test(i.color)?i.color:n0(i.id);e.push(q(`div`,{class:`cursor`,key:t,style:{left:`${o.left+r.x/1e3*o.width}px`,top:`${o.top+r.y/1e3*o.height}px`}},[q(`svg`,{width:15,height:15,viewBox:`0 0 24 24`,"aria-hidden":`true`},q(`path`,{d:`M4 2l16 7-7 2-3 8z`,fill:s,stroke:`#000`,"stroke-width":1.5})),q(`span`,{style:{background:s}},i.name??`Someone`)]))}return e}function bt(){if(P.value,!S.value)return[];let e=[];for(let t of document.querySelectorAll(`[${to}]`)){let n=t.getAttribute(to),r=t===A.value?`hover`:ee.value.has(n)?`draft`:void 0;if(!r)continue;let i=t.getBoundingClientRect();e.push(q(`div`,{class:`outline`,"data-kind":r,key:`${n}-outline`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`,width:`${i.width+6}px`,height:`${i.height+6}px`}})),e.push(q(`div`,{class:`tag`,key:`${n}-tag`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`}},r===`draft`?`Draft`:n))}return e}let xt=kp({render:()=>q(pt,{key:me.value?.id??``})});xt.mount(a),r&&!r.can.read?e.prompt!==!1&&rt(r):e.failure&&ue({text:e.failure.why,kind:`error`,action:[`Close`,e.exit]},!0);let St;function Ct(){h.value===St&&(h.value=void 0),St=void 0}function wt(e){let t=++p;ka.session(e).then(async([n,r])=>{if(t!==p||s.value!==e)return;if(n){St={text:`${n.why} Comments are paused on this page.`,kind:`error`,action:[`Retry`,()=>{s.value===e&&wt(e)}]},ue(St,!0);return}Ct(),he.value=r.can,ge.value=r.agent,_e.value=r.repository,l=r.revision;let i=r.subject??{kind:`page`,id:e};if(i.kind!==c.value.kind||i.id!==c.value.id?c.value=i:!ie&&B.status.value===`ready`&&Qe(),await ol(),t!==p)return;d.value=!1;let a=f.value;f.value=!1,a&&Ge(`comment`)})}let Tt={text:`Comments hidden. Press Shift+C to show them.`,kind:`info`};function Et(){let e=xe.value!==`hidden`;xe.value=e?`hidden`:`all`,e?ue(Tt):h.value===Tt&&(h.value=void 0)}function Dt(){ve.value?Ge(`comment`):et()}let Ot=()=>[i,x.value?.getRootNode()].filter(e=>e instanceof ShadowRoot),kt=()=>Ot().some(e=>e.querySelector(`[data-slot='comment-composer'][data-dirty='true']`)!==null),At=()=>kt()||!!Te.value.outbox?.entries.length,jt,Mt;return{app:xt,hasUnsentComment:kt,waitForPendingComment:()=>(Mt||!At()||(ue({text:`Send or discard your Hosted Comments draft to switch to the app's Comments.`,kind:`info`}),Mt=new Promise(e=>{let t=()=>{At()||jt?.()},n=new MutationObserver(t),r=Te.value.onChange(t);jt=()=>{n.disconnect(),r(),jt=void 0,Mt=void 0,e()};for(let e of Ot())n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-dirty`]})})),Mt),showPanel:et,pressComments:Dt,setMode:Ge,finishEdit:We.finish,navigated(e){if(e===s.value)m.value=location.search;else{if(kt()){if(!window.confirm(`Discard your unsent comment and show comments for the new page?`))return;B.cancelDraft()}j.value=!1,N=void 0,s.value=e,clearTimeout(Le),Ie.value=!1,m.value=location.search,ne.value=null,w.value&&Ge(`view`),Xe(),Ct(),f.value=f.value||B.active.value,B.active.value=!1,d.value=!0,wt(e),$e()}},refresh:Ee,pointer(e,t){if(S.value){let e=t?$a(t):void 0;e!==A.value&&(A.value=e)}if(!ie||!t||!pe)return;let n=t.getBoundingClientRect();ie.setLocal(`cursor`,{selector:Ya(t),x:n.width?Math.round((e.clientX-n.left)/n.width*1e3):0,y:n.height?Math.round((e.clientY-n.top)/n.height*1e3):0})},leave:()=>ie?.setLocal(`cursor`,null),layout:e=>{P.value++,e&&L.value++,re.value&&st()},selectionChanged:st,promptAccess:()=>{r&&!r.can.read&&rt(r)},editMode:()=>S.value,editElement:()=>We.element,startEdit:e=>We.start(e),key(e){if(e.key===`Escape`&&S.value){Ge(`view`);return}let t=n?.bar.parentElement?.hasAttribute(`collapsed`)===!0,i=e.metaKey||e.ctrlKey||e.altKey;if(e.shiftKey&&e.key.toLowerCase()===`c`&&!i&&!o0(e)&&ve.value)a0(e),e.repeat||Et();else if(!(t&&!i&&/^[a-z]$/i.test(e.key))){if(w.value&&(e.key!==`b`||E.value!==`marker`)){let t=s0(e);if(t)mt(t);else if(e.key===`Escape`)Ge(`view`);else if(e.key===`Enter`)Ze();else if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`)C?.undo();else if(![` `,`PageUp`,`PageDown`,`Home`,`End`,`ArrowUp`,`ArrowDown`].includes(e.key))return;a0(e)}else o0(e)||i||(e.key===`c`&&!e.shiftKey&&ve.value&&(a0(e),ct()||Ge(qe.value?`view`:`comment`)),e.key===`b`&&ye.value&&(a0(e),Ge(Ke.value===`mark`?`view`:`mark`)),e.key===`e`&&r?.content&&ve.value&&(a0(e),Ge(Ke.value===`edit`?`view`:`edit`)))}},destroy(){jt?.(),Ye(),Xe(),dt(),clearTimeout(se),We.finish(!1),$e(),ke(),xt.unmount(),oe?.destroy();for(let e of o)e()}}}var h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0=t((()=>{wn(),b(),nV(),hz(),mw(),Rw(),iV(),oV(),Y(),ro(),hh(),dm(),Tm(),Wi(),Zi(),Aa(),gV(),vV(),xV(),_W(),TW(),Wa(),h0={open:`vh-comment`,resolved:`vh-comment-resolved`,active:`vh-comment-active`,draft:`vh-comment-draft`},g0=e=>`${e}\n${aV.replaceAll(`:root.dark`,`:host(.dark)`).replaceAll(`:root`,`:host`)}\n${rV}`,_0=G({props:{value:{required:!0,type:Number}},setup(e){let t=H(),n=String(e.value);return Pd(()=>t.value&&FC(t.value,e.value)),W(()=>e.value,e=>t.value&&FC(t.value,e),{flush:`post`}),()=>q(`span`,{class:`count`,ref:t},n)}}),v0=`m9 11-6 6v3h9l3-3M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,y0=`M21.17 6.81a1 1 0 0 0-3.98-3.98L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5zM15 5l4 4`,b0=`M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0M9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0`,x0=`M10.73 5.08A10.43 10.43 0 0 1 12 5c4.97 0 8.9 3.06 9.94 6.65a1 1 0 0 1 0 .7 10.8 10.8 0 0 1-1.44 2.49M14.08 14.16a3 3 0 0 1-4.24-4.24M17.48 17.5a10.75 10.75 0 0 1-15.42-5.15 1 1 0 0 1 0-.7 10.75 10.75 0 0 1 4.45-5.14M2 2l20 20`,S0=`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`,C0=`m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,w0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`})),T0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:v0})),E0={marker:T0,pen:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`})),arrow:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7 17 17 7M7 7h10v10`})),text:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M4 7V4h16v3M9 20h6M12 4v16`}))},D0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})),O0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:y0})),k0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:x0})),A0=`vitehub-comments-visibility`,j0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[q(`rect`,{width:14,height:14,x:8,y:8,rx:2}),q(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]),M0=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M20 6 9 17l-5-5`})),N0=`comment`})),F0=n({default:()=>B0,startHostedOverlay:()=>V0});function I0(e){let t=document.createElement(`style`);return t.textContent=e,t}function L0(e){return t=>{customElements.get(e)||customElements.define(e,class extends R0{});let n=document.createElement(e);if(!(n instanceof R0))Ai(Mi.COMMENTS_OVERLAY_ELEMENT_TAKEN({name:e}));else return n.context=t,e===`vitehub-hosted-comments`&&n.addEventListener(Fa,e=>{if(!(e instanceof CustomEvent))return;let t=e.detail,r=n.waitForPendingComment();r&&(t.draft={ready:r,stop:()=>n.stop()})}),document.documentElement.append(n),()=>n.stop()}}var R0,z0,B0,V0,H0=t((()=>{b(),Ka(),ro(),Ni(),Wi(),Aa(),P0(),TW(),R0=class extends HTMLElement{context;documentStyle=I0(`@layer components {\n${Ga}\n}\n${CW}`);areas=document.createElement(`vitehub-comment-areas`);toolbar=document.createElement(`div`);control;mode=`view`;frame=0;changed=!1;lastCursor=0;cleanups=[];waitForPendingComment(){return this.control?.waitForPendingComment()}get active(){return this.isConnected&&!this.context?.signal.aborted}async connectedCallback(){this.setAttribute(`data-comments-ui`,``),this.shadowRoot||this.attachShadow({mode:`open`});let e=this.context?.bar;if(e){e.tabIndex=-1,e.setAttribute(`data-comments-ui`,``);let t=e.shadowRoot??e.attachShadow({mode:`open`}),n=document.createElement(`button`);n.disabled=!0,n.setAttribute(`aria-busy`,`true`),n.textContent=this.context?.tool.label??`Comments`,t.replaceChildren(I0(g+SW),this.toolbar),this.toolbar.replaceChildren(n)}this.restoreDocumentState(),this.cleanups.push(()=>this.documentStyle.remove());let t=this.areas.shadowRoot??this.areas.attachShadow({mode:`open`});t.replaceChildren(I0(Ga+wW)),this.areas.setAttribute(`data-comments-ui`,``),document.documentElement.append(this.areas),this.cleanups.push(()=>this.areas.remove()),this.followTheme();let n=Ri(location.pathname),r=new AbortController;this.cleanups.push(()=>r.abort());let i=ka.pageThreads(n,r.signal),[a,o]=await ka.session(n),s=this.active&&!a&&o.can.read;if(s||r.abort(),e&&(e.hidden=!s),this.active){if(this.toolbar.replaceChildren(),this.control=m0({host:this,...this.context?{context:this.context}:{},...e?{toolbar:this.toolbar}:{},areas:t,...a?{failure:a}:{session:o},...s&&i?{pageThreads:i}:{},onMode:e=>{this.mode=e,this.restoreDocumentState()},exit:()=>this.context?.exit(),prompt:this.context?.open!==!1}),!s){if(e&&o&&this.active&&!this.context?.open&&(o.signIn||o.signOut)){let t=document.createElement(`button`);t.type=`button`,t.textContent=this.context?.tool.label??`Comments`,t.addEventListener(`click`,()=>this.control?.promptAccess()),this.toolbar.replaceChildren(t),e.hidden=!1}}else this.listen(),this.context?.onOpen(()=>this.control?.showPanel()),this.context?.beforeExit(()=>!this.control?.hasUnsentComment()||window.confirm(`Turn off tools without sending your comment?`)),new URLSearchParams(location.search).has(`comment`)||(this.context?.linked?this.control.pressComments():this.context?.open&&this.control.showPanel())}}disconnectedCallback(){for(let e of this.cleanups.splice(0))e();cancelAnimationFrame(this.frame),this.control?.destroy(),this.control=void 0}followTheme(){let e=()=>{let e=i0();this.style.colorScheme=e?`dark`:`light`,this.classList.toggle(`dark`,e),this.areas.classList.toggle(`dark`,e),this.dataset.theme=e?`dark`:`light`;let t=getComputedStyle(this.areas).getPropertyValue(`--vh-comment-default-ink`).trim(),n=`@layer components {\n${Ga}\n:root { --vh-comment-ink: var(--vh-ui-comment-ink, var(--vh-highlighted, ${t})); }\n}\n${CW}`;this.documentStyle.textContent!==n&&(this.documentStyle.textContent=n)};e();let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`]});let n=matchMedia(`(prefers-color-scheme: dark)`);n.addEventListener(`change`,e),this.cleanups.push(()=>{t.disconnect(),n.removeEventListener(`change`,e)})}on(e,t,n,r){e.addEventListener(t,n,r),this.cleanups.push(()=>e.removeEventListener(t,n,r))}schedule(){cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>{let e=this.changed;this.changed=!1,this.control?.layout(e)})}listen(){let e=()=>this.schedule();this.on(window,`scroll`,e,{capture:!0,passive:!0}),this.on(window,`resize`,e);let t=new MutationObserver(t=>{if(t.every(e=>e.target===this||this.contains(e.target)))return;let n=this.control?.editElement();n&&!n.isConnected&&this.control?.finishEdit(!0),this.restoreDocumentState(),this.changed=!0,e()});t.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`style`,`hidden`]}),this.cleanups.push(()=>t.disconnect());let n=()=>queueMicrotask(()=>{this.active&&this.control?.navigated(Ri(location.pathname))});for(let e of[`astro:before-swap`,`turbo:before-render`])this.on(document,e,()=>void this.control?.finishEdit(!0));for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(...e){let r=t.apply(this,e);return n(),r},this.cleanups.push(()=>{history[e]=t})}this.on(window,`popstate`,n);let r,i=e=>{clearTimeout(r),r=setTimeout(()=>this.control?.selectionChanged(),e)};this.on(document,`selectionchange`,()=>i(200)),this.on(document,`pointerup`,()=>i(0)),this.cleanups.push(()=>clearTimeout(r)),this.on(document,`pointermove`,e=>this.pointerMoved(e),{passive:!0}),this.on(document,`pointerleave`,()=>this.control?.leave()),this.on(document,`click`,e=>this.clicked(e),{capture:!0}),this.on(document,`keydown`,e=>this.control?.key(e)),this.on(document,`visibilitychange`,()=>{document.visibilityState===`visible`&&this.control?.refresh()});let a=setInterval(()=>{document.visibilityState===`visible`&&this.control?.refresh()},3e4);this.cleanups.push(()=>clearInterval(a))}ours(e){let t=e.composedPath(),n=this.context?.bar.parentElement;return t.includes(this)||t.some(e=>e instanceof Element&&e.localName===`vitehub-window`)||!!(n&&t.includes(n))}elementAt(e,t){return document.elementsFromPoint(e,t).find(e=>e!==this&&!this.contains(e)&&e!==document.documentElement)}pointerMoved(e){this.ours(e)||!this.control?.editMode()&&e.timeStamp-this.lastCursor<80||(this.lastCursor=e.timeStamp,this.control?.pointer(e,this.elementAt(e.clientX,e.clientY)))}clicked(e){if(this.ours(e)||!this.control?.editMode())return;let t=this.elementAt(e.clientX,e.clientY),n=t?$a(t):void 0;n&&n!==this.control.editElement()&&(e.preventDefault(),e.stopPropagation(),this.control.startEdit(n))}restoreDocumentState(){this.documentStyle.parentElement!==document.head&&document.head.append(this.documentStyle);for(let e of[`comment`,`edit`]){let t=`vitehub-${e}-mode`,n=this.mode===e;document.documentElement.classList.contains(t)!==n&&document.documentElement.classList.toggle(t,n)}}stop(){this.isConnected&&(this.control?.finishEdit(!1),this.control?.setMode(`view`),this.mode=`view`,this.restoreDocumentState(),this.remove())}},z0=L0(Na),B0=e=>{let t=ja();if(!t)return z0(e);let n=!1,r;return t.ready.then(()=>{n||e.signal.aborted||(t.stop(),r=z0(e))}),()=>{n=!0,r?.()}},V0=L0(Pa)}));Ni(),Aa(),Ia(),Wa();var U0={id:`comments`,label:`Comments`,icon:`i-lucide-message-square-text`,script:`comments`,param:`comment`},W0={id:`console`,label:`Console`,icon:`i-lucide-layout-dashboard`,script:`console`},G0={id:`projects`,label:`Choose a team for Comments`,icon:``,script:`projects`},K0={name:`vitehub-hosted-comments-pill`,label:`ViteHub Comments`,off:`vitehub-hosted-comments-off`,collapsed:`vitehub-hosted-comments-collapsed`,dock:`vitehub-hosted-comments-dock`,initialDock:{edge:`right`,at:85}};function q0(){return Promise.reject(ki(405))}function J0(e,t){return{namespace:new URL(La(t.id),t.console).href,async session(n){try{let r=(await(await e).call(`session`,n)).value;if(t.consoleUrl&&r.signIn?.provider===`console`){let e=new URL(r.signIn.url);e.searchParams.set(`linked`,``),r.signIn={...r.signIn,url:e.href}}return[void 0,t.repository?{...r,repository:t.repository}:r]}catch(e){return[ga(e),void 0]}},changes(t){let n,r=!1;return e.then(e=>{r||(n=e.onChange(t))},()=>void 0),()=>{r=!0,n?.()}},transport(t){let n=async(n,r)=>{let i=await(await e).call(n,r);return t({data:i.value,people:i.people}),i.value};return{list:e=>n(`list`,e),get:e=>n(`get`,e),create:({files:e,outbox:t,...r})=>n(`create`,r),reply:({files:e,outbox:t,...r})=>n(`reply`,r),resolve:e=>n(`resolve`,{threadId:e.threadId}),reopen:e=>n(`reopen`,{threadId:e.threadId}),edit:q0,delete:q0,users:async()=>[],upload:q0,attachmentUrl:()=>``}}}}var Y0;function X0(){return!Ma()&&(Y0??=customElements.whenDefined(Na).then(async()=>{Ma();let e=ja();e&&await e.ready,Ei()}),!0)}async function Z0(e,t){if(!X0())return;Ei(),ya(J0(e,t));let{consoleUrl:n}=t;await wi({pill:K0,session:async()=>({tools:n?[U0,W0]:[U0]}),load:async e=>e===`console`&&n?$0(n):{default:(await Ua(async()=>{let{startHostedOverlay:e}=await Promise.resolve().then(()=>(H0(),F0));return{startHostedOverlay:e}},void 0,import.meta.url)).startHostedOverlay}})}var Q0=`M7 7h10v10M7 17 17 7`;function $0(e){return{default({menu:t,onOpen:n}){let r=()=>{window.open(e,`_blank`,`noopener`)};n(r),t([{id:`console`,label:`Open in the Console`,icon:Q0,press:r}])}}}async function e2(e,t){X0()&&await wi({pill:K0,session:async()=>({tools:t.length?[G0,W0]:[W0]}),load:async n=>n===`console`?$0(e):{default({bar:e}){let n=document.createElement(`select`);n.setAttribute(`aria-label`,G0.label),n.append(new Option(G0.label,``));for(let[e,r]of t.entries())n.append(new Option(r.team,String(e)));n.addEventListener(`change`,()=>{n.selectedIndex>0&&t[n.selectedIndex-1]?.choose()}),e.append(n)}}})}export{Z0 as mountHostedComments,e2 as mountHostedProjectChoice};
|